From dbc7db41c01ee7eb3c6654a7ee2f05201dc46a3b Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 5 Mar 2024 22:10:56 +0700 Subject: [PATCH 001/180] fix(BridgeManager): disable update operator --- .../BridgeManager.sol | 26 +------------------ .../bridge-manager/BridgeManagerCRUD.t.sol | 1 + 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/extensions/bridge-operator-governance/BridgeManager.sol b/src/extensions/bridge-operator-governance/BridgeManager.sol index e871e624..230f016d 100644 --- a/src/extensions/bridge-operator-governance/BridgeManager.sol +++ b/src/extensions/bridge-operator-governance/BridgeManager.sol @@ -118,31 +118,7 @@ abstract contract BridgeManager is IQuorum, IBridgeManager, BridgeManagerCallbac * their operator address blank null `address(0)`, consider add authorization check. */ function updateBridgeOperator(address newBridgeOperator) external onlyGovernor { - _requireNonZeroAddress(newBridgeOperator); - - // Queries the previous bridge operator - mapping(address => BridgeOperatorInfo) storage _gorvernorToBridgeOperatorInfo = _getGovernorToBridgeOperatorInfo(); - address currentBridgeOperator = _gorvernorToBridgeOperatorInfo[msg.sender].addr; - if (currentBridgeOperator == newBridgeOperator) { - revert ErrBridgeOperatorAlreadyExisted(newBridgeOperator); - } - - // Tries replace the bridge operator - EnumerableSet.AddressSet storage _bridgeOperatorSet = _getBridgeOperatorSet(); - bool updated = _bridgeOperatorSet.remove(currentBridgeOperator) && _bridgeOperatorSet.add(newBridgeOperator); - if (!updated) revert ErrBridgeOperatorUpdateFailed(newBridgeOperator); - - mapping(address => address) storage _governorOf = _getGovernorOf(); - delete _governorOf[currentBridgeOperator]; - _governorOf[newBridgeOperator] = msg.sender; - _gorvernorToBridgeOperatorInfo[msg.sender].addr = newBridgeOperator; - - _notifyRegisters( - IBridgeManagerCallback.onBridgeOperatorUpdated.selector, - abi.encode(currentBridgeOperator, newBridgeOperator) - ); - - emit BridgeOperatorUpdated(msg.sender, currentBridgeOperator, newBridgeOperator); + revert("Not supported"); } /** diff --git a/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol b/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol index 5f50b52e..e2febbaa 100644 --- a/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol +++ b/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol @@ -212,6 +212,7 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { uint256 r3, uint16 numBridgeOperators ) external virtual { + vm.skip(true); (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs( r1, r2, From 0551e0599af6d2e2f87122c9c99e09258fb10828 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 5 Mar 2024 16:56:19 +0700 Subject: [PATCH 002/180] chore: fix formatter, add local testing profile --- foundry.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/foundry.toml b/foundry.toml index f72d3fc2..da2e032e 100644 --- a/foundry.toml +++ b/foundry.toml @@ -28,6 +28,11 @@ evm_version = 'shanghai' line_length = 120 tab_width = 2 bracket_spacing = true +int_types = 'preserve' +multiline_func_header = 'params_first' + +[profile.local.fuzz] +runs = 10 [profile.default.fuzz] runs = 256 From 534a3009189177d3ae5f039e7e464680346898ad Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 5 Mar 2024 16:54:57 +0700 Subject: [PATCH 003/180] test: enable update operator test --- .../updateOperator.RoninBridgeManager.t.sol | 1 - .../mainchain-gateway/requestDepositFor.MainchainGatewayV3.t.sol | 1 - 2 files changed, 2 deletions(-) diff --git a/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol index 4b74f5f6..49a9b923 100644 --- a/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol @@ -42,7 +42,6 @@ contract UpdateOperator_RoninBridgeManager_Test is BaseIntegration_Test { } function test_updateOperator_and_wrapUpEpoch() public { - vm.skip(true); console.log("=============== Test Update Operator ==========="); _depositFor(); diff --git a/test/bridge/integration/mainchain-gateway/requestDepositFor.MainchainGatewayV3.t.sol b/test/bridge/integration/mainchain-gateway/requestDepositFor.MainchainGatewayV3.t.sol index b48f8d3b..9de95d9c 100644 --- a/test/bridge/integration/mainchain-gateway/requestDepositFor.MainchainGatewayV3.t.sol +++ b/test/bridge/integration/mainchain-gateway/requestDepositFor.MainchainGatewayV3.t.sol @@ -111,7 +111,6 @@ contract RequestDepositFor_MainchainGatewayV3_Test is BaseIntegration_Test { // test deposit > should be able to unwrap and deposit native. function test_unwrapAndDepositNative() public { - vm.skip(true); vm.startPrank(_sender); _mainchainWeth.deposit{ value: _quantity }(); _mainchainWeth.approve(address(_mainchainGatewayV3), _quantity); From 586f262ee92a7e0da5d79cabb985bc2726f9cae9 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 5 Mar 2024 19:19:31 +0700 Subject: [PATCH 004/180] test: add test for track in tryBulkDeposit --- test/bridge/integration/BaseIntegration.t.sol | 30 +++++ .../bulkDepositAndRecord.Gateway.t.sol | 108 +++++++++++++++++ .../depositAndRecord.Gateway.t.sol | 112 ++++++++++++++++++ .../updateOperator.RoninBridgeManager.t.sol | 45 ++----- 4 files changed, 262 insertions(+), 33 deletions(-) create mode 100644 test/bridge/integration/bridge-manager/deposit-and-record/bulkDepositAndRecord.Gateway.t.sol create mode 100644 test/bridge/integration/bridge-manager/deposit-and-record/depositAndRecord.Gateway.t.sol diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index 8dbabc08..b9200abd 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -582,4 +582,34 @@ contract BaseIntegration_Test is Base_Test { vm.warp(nextDayTimestamp); vm.roll(epochEndingBlockNumber); } + + function logBridgeTracking() public view { + console.log(">> logBridgeTracking ...."); + uint256 currentPeriod = _validatorSet.currentPeriod(); + uint256 lastSyncedPeriod = uint256(vm.load(address(_bridgeTracking), bytes32(uint256(11)))); + console.log(" -> current period:", currentPeriod); + console.log(" -> total votes:", _bridgeTracking.totalVote(currentPeriod)); + console.log(" -> total ballot:", _bridgeTracking.totalBallot(currentPeriod)); + for (uint256 i; i < _param.roninBridgeManager.bridgeOperators.length; i++) { + address operator = _param.roninBridgeManager.bridgeOperators[i]; + console.log(" -> total ballot of:", operator, _bridgeTracking.totalBallotOf(currentPeriod, operator)); + } + + console.log(" -> lastSynced period:", lastSyncedPeriod); + console.log(" -> total votes:", _bridgeTracking.totalVote(lastSyncedPeriod)); + console.log(" -> total ballot:", _bridgeTracking.totalBallot(lastSyncedPeriod)); + for (uint256 i; i < _param.roninBridgeManager.bridgeOperators.length; i++) { + address operator = _param.roninBridgeManager.bridgeOperators[i]; + console.log(" -> total ballot of:", operator, _bridgeTracking.totalBallotOf(lastSyncedPeriod, operator)); + } + } + + function logBridgeSlash() public view { + console.log(">> logBridgeSlash ...."); + + uint256[] memory periods = _bridgeSlash.getSlashUntilPeriodOf(_param.roninBridgeManager.bridgeOperators); + for (uint256 i; i < _param.roninBridgeManager.bridgeOperators.length; i++) { + console.log(" -> slash operator until:", _param.roninBridgeManager.bridgeOperators[i], periods[i]); + } + } } diff --git a/test/bridge/integration/bridge-manager/deposit-and-record/bulkDepositAndRecord.Gateway.t.sol b/test/bridge/integration/bridge-manager/deposit-and-record/bulkDepositAndRecord.Gateway.t.sol new file mode 100644 index 00000000..1e75083f --- /dev/null +++ b/test/bridge/integration/bridge-manager/deposit-and-record/bulkDepositAndRecord.Gateway.t.sol @@ -0,0 +1,108 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { console2 as console } from "forge-std/console2.sol"; +import { Transfer } from "@ronin/contracts/libraries/Transfer.sol"; +import { Token } from "@ronin/contracts/libraries/Token.sol"; +import "../../BaseIntegration.t.sol"; + +contract BulkDepositAndRecord_Gateway_Test is BaseIntegration_Test { + using Transfer for Transfer.Receipt; + + address _newBridgeOperator; + uint256 _numOperatorsForVoteExecuted; + Transfer.Receipt _sampleReceipt; + Transfer.Receipt[] _bulkReceipts; + uint256 _id = 0; + + function setUp() public virtual override { + super.setUp(); + + vm.deal(address(_bridgeReward), 10 ether); + _sampleReceipt = Transfer.Receipt({ + id: 0, + kind: Transfer.Kind.Deposit, + ronin: Token.Owner({ addr: makeAddr("recipient"), tokenAddr: address(_roninWeth), chainId: block.chainid }), + mainchain: Token.Owner({ addr: makeAddr("requester"), tokenAddr: address(_mainchainWeth), chainId: block.chainid }), + info: Token.Info({ erc: Token.Standard.ERC20, id: 0, quantity: 100 }) + }); + + _numOperatorsForVoteExecuted = + _param.roninBridgeManager.bridgeOperators.length * _param.roninBridgeManager.num / _param.roninBridgeManager.denom; + } + + function test_bulkDepositFor_wrapUp_checkRewardAndSlash() public { + _depositFor(); + _moveToEndPeriodAndWrapUpEpoch(); + + console.log("=============== First 50 Receipts ==========="); + _bulkDepositFor(); + + _wrapUpEpoch(); + _wrapUpEpoch(); + + _moveToEndPeriodAndWrapUpEpoch(); + + console.log("=============== Check slash and reward behavior ==========="); + console.log("==== Check total ballot before new deposit ===="); + + logBridgeTracking(); + + uint256 lastSyncedPeriod = uint256(vm.load(address(_bridgeTracking), bytes32(uint256(11)))); + for (uint256 i; i < _numOperatorsForVoteExecuted; i++) { + address operator = _param.roninBridgeManager.bridgeOperators[i]; + assertEq(_bridgeTracking.totalBallotOf(lastSyncedPeriod, operator), _id); + } + + for (uint256 i = _numOperatorsForVoteExecuted; i < _param.roninBridgeManager.bridgeOperators.length; i++) { + address operator = _param.roninBridgeManager.bridgeOperators[i]; + assertEq(_bridgeTracking.totalBallotOf(lastSyncedPeriod, operator), 0); + } + + console.log("==== Check total ballot after new deposit ===="); + _depositFor(); + + logBridgeTracking(); + logBridgeSlash(); + + lastSyncedPeriod = uint256(vm.load(address(_bridgeTracking), bytes32(uint256(11)))); + for (uint256 i; i < _param.roninBridgeManager.bridgeOperators.length; i++) { + address operator = _param.roninBridgeManager.bridgeOperators[i]; + assertEq(_bridgeTracking.totalBallotOf(lastSyncedPeriod, operator), 0); + } + + uint256[] memory toPeriodSlashArr = _bridgeSlash.getSlashUntilPeriodOf(_param.roninBridgeManager.bridgeOperators); + for (uint256 i = _numOperatorsForVoteExecuted; i < _param.roninBridgeManager.bridgeOperators.length; i++) { + assertEq(toPeriodSlashArr[i], 7); + } + } + + function _depositFor() internal { + console.log(">> depositFor ...."); + _sampleReceipt.id = ++_id; + for (uint256 i; i < _numOperatorsForVoteExecuted; i++) { + console.log(" -> Operator vote:", _param.roninBridgeManager.bridgeOperators[i]); + vm.prank(_param.roninBridgeManager.bridgeOperators[i]); + _roninGatewayV3.depositFor(_sampleReceipt); + } + } + + function _bulkDepositFor() internal { + console.log(">> bulkDepositFor ...."); + _prepareBulkRequest(); + for (uint256 i; i < _numOperatorsForVoteExecuted; i++) { + console.log(" -> Operator vote:", _param.roninBridgeManager.bridgeOperators[i]); + vm.prank(_param.roninBridgeManager.bridgeOperators[i]); + _roninGatewayV3.tryBulkDepositFor(_bulkReceipts); + } + } + + function _prepareBulkRequest() internal { + delete _bulkReceipts; + + for (uint256 i; i < 50; i++) { + _sampleReceipt.id = ++_id; + _bulkReceipts.push(_sampleReceipt); + } + } +} diff --git a/test/bridge/integration/bridge-manager/deposit-and-record/depositAndRecord.Gateway.t.sol b/test/bridge/integration/bridge-manager/deposit-and-record/depositAndRecord.Gateway.t.sol new file mode 100644 index 00000000..21ddda94 --- /dev/null +++ b/test/bridge/integration/bridge-manager/deposit-and-record/depositAndRecord.Gateway.t.sol @@ -0,0 +1,112 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { console2 as console } from "forge-std/console2.sol"; +import { Transfer } from "@ronin/contracts/libraries/Transfer.sol"; +import { Token } from "@ronin/contracts/libraries/Token.sol"; +import "../../BaseIntegration.t.sol"; + +contract DepositAndRecord_Gateway_Test is BaseIntegration_Test { + using Transfer for Transfer.Receipt; + + address _newBridgeOperator; + uint256 _numOperatorsForVoteExecuted; + Transfer.Receipt _sampleReceipt; + uint256 _id = 0; + + function setUp() public virtual override { + super.setUp(); + + vm.deal(address(_bridgeReward), 10 ether); + _sampleReceipt = Transfer.Receipt({ + id: 0, + kind: Transfer.Kind.Deposit, + ronin: Token.Owner({ addr: makeAddr("recipient"), tokenAddr: address(_roninWeth), chainId: block.chainid }), + mainchain: Token.Owner({ addr: makeAddr("requester"), tokenAddr: address(_mainchainWeth), chainId: block.chainid }), + info: Token.Info({ erc: Token.Standard.ERC20, id: 0, quantity: 100 }) + }); + + _numOperatorsForVoteExecuted = + _param.roninBridgeManager.bridgeOperators.length * _param.roninBridgeManager.num / _param.roninBridgeManager.denom; + } + + function test_depositFor_wrapUp_checkRewardAndSlash() public { + _depositFor(); + _moveToEndPeriodAndWrapUpEpoch(); + + console.log("=============== 50 Receipts with DepositFor ==========="); + + for (uint i; i < 50; i++) { + _depositFor(); + } + + _wrapUpEpoch(); + _wrapUpEpoch(); + + _moveToEndPeriodAndWrapUpEpoch(); + + console.log("=============== Check slash and reward behavior ==========="); + console.log("==== Check total ballot before new deposit ===="); + + logBridgeTracking(); + + uint256 lastSyncedPeriod = uint256(vm.load(address(_bridgeTracking), bytes32(uint256(11)))); + for (uint256 i; i < _numOperatorsForVoteExecuted; i++) { + address operator = _param.roninBridgeManager.bridgeOperators[i]; + assertEq(_bridgeTracking.totalBallotOf(lastSyncedPeriod, operator), _id); + } + + for (uint256 i = _numOperatorsForVoteExecuted; i < _param.roninBridgeManager.bridgeOperators.length; i++) { + address operator = _param.roninBridgeManager.bridgeOperators[i]; + assertEq(_bridgeTracking.totalBallotOf(lastSyncedPeriod, operator), 0); + } + + console.log("==== Check total ballot after new deposit ===="); + _depositFor(); + + logBridgeTracking(); + logBridgeSlash(); + + lastSyncedPeriod = uint256(vm.load(address(_bridgeTracking), bytes32(uint256(11)))); + for (uint256 i; i < _param.roninBridgeManager.bridgeOperators.length; i++) { + address operator = _param.roninBridgeManager.bridgeOperators[i]; + assertEq(_bridgeTracking.totalBallotOf(lastSyncedPeriod, operator), 0); + } + + uint256[] memory toPeriodSlashArr = _bridgeSlash.getSlashUntilPeriodOf(_param.roninBridgeManager.bridgeOperators); + for (uint256 i = _numOperatorsForVoteExecuted; i < _param.roninBridgeManager.bridgeOperators.length; i++) { + assertEq(toPeriodSlashArr[i], 7); + } + } + + function _updateBridgeOperator() internal { + vm.prank(_param.roninBridgeManager.governors[0]); + address previousOperator = _param.roninBridgeManager.bridgeOperators[0]; + _roninBridgeManager.updateBridgeOperator(_newBridgeOperator); + _param.roninBridgeManager.bridgeOperators[0] = _newBridgeOperator; + + console.log( + "Update operator: ", + string(abi.encodePacked(vm.toString(previousOperator), " => ", vm.toString(_newBridgeOperator))) + ); + } + + function _depositFor() internal { + console.log(">> depositFor ...."); + _sampleReceipt.id = ++_id; + for (uint256 i; i < _numOperatorsForVoteExecuted; i++) { + console.log(" -> Operator vote:", _param.roninBridgeManager.bridgeOperators[i]); + vm.prank(_param.roninBridgeManager.bridgeOperators[i]); + _roninGatewayV3.depositFor(_sampleReceipt); + } + } + + function _bulkDepositFor(Transfer.Receipt[] memory receipts) internal { + console.log(">> bulkDepositFor ...."); + for (uint256 i; i < _numOperatorsForVoteExecuted; i++) { + console.log(" -> Operator vote:", _param.roninBridgeManager.bridgeOperators[i]); + vm.prank(_param.roninBridgeManager.bridgeOperators[i]); + _roninGatewayV3.tryBulkDepositFor(receipts); + } + } +} diff --git a/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol index 49a9b923..a5d73409 100644 --- a/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol @@ -48,21 +48,30 @@ contract UpdateOperator_RoninBridgeManager_Test is BaseIntegration_Test { _moveToEndPeriodAndWrapUpEpoch(); console.log("=============== First 50 Receipts ==========="); - _bulkDepositFor(first50Receipts); + // _bulkDepositFor(first50Receipts); + + for (uint i; i < 50; i++) { + _depositFor(); + } console.log("=============== Update bridge operator ==========="); _updateBridgeOperator(); console.log("=============== Second 50 Receipts ==========="); - _bulkDepositFor(second50Receipts); + // _bulkDepositFor(second50Receipts); + for (uint i; i < 50; i++) { + _depositFor(); + } + + _wrapUpEpoch(); _wrapUpEpoch(); _moveToEndPeriodAndWrapUpEpoch(); console.log("=============== Check slash and reward behavior ==========="); _depositFor(); - logBridgeTracking(); + logBridgeTracking(); logBridgeSlash(); } @@ -97,34 +106,4 @@ contract UpdateOperator_RoninBridgeManager_Test is BaseIntegration_Test { _roninGatewayV3.tryBulkDepositFor(receipts); } } - - function logBridgeTracking() public { - console.log(">> logBridgeTracking ...."); - uint256 currentPeriod = _validatorSet.currentPeriod(); - uint256 lastSyncedPeriod = uint256(vm.load(address(_bridgeTracking), bytes32(uint256(11)))); - console.log(" -> current period:", currentPeriod); - console.log(" -> total votes:", _bridgeTracking.totalVote(currentPeriod)); - console.log(" -> total ballot:", _bridgeTracking.totalBallot(currentPeriod)); - for (uint256 i; i < _numOperatorsForVoteExecuted; i++) { - address operator = _param.roninBridgeManager.bridgeOperators[i]; - console.log(" -> total ballot of:", operator, _bridgeTracking.totalBallotOf(currentPeriod, operator)); - } - - console.log(" -> lastSynced period:", lastSyncedPeriod); - console.log(" -> total votes:", _bridgeTracking.totalVote(lastSyncedPeriod)); - console.log(" -> total ballot:", _bridgeTracking.totalBallot(lastSyncedPeriod)); - for (uint256 i; i < _numOperatorsForVoteExecuted; i++) { - address operator = _param.roninBridgeManager.bridgeOperators[i]; - console.log(" -> total ballot of:", operator, _bridgeTracking.totalBallotOf(lastSyncedPeriod, operator)); - } - } - - function logBridgeSlash() public { - console.log(">> logBridgeSlash ...."); - - uint256[] memory periods = _bridgeSlash.getSlashUntilPeriodOf(_param.roninBridgeManager.bridgeOperators); - for (uint256 i; i < _param.roninBridgeManager.bridgeOperators.length; i++) { - console.log(" -> slash operator until:", _param.roninBridgeManager.bridgeOperators[i], periods[i]); - } - } } From ba7c8381e56db8f29fcc04bb2458b5917c31d522 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 5 Mar 2024 19:19:40 +0700 Subject: [PATCH 005/180] fix(RoninGateway): fix handle vote after processing deposit --- src/ronin/gateway/RoninGatewayV3.sol | 108 ++++++++++++--------------- 1 file changed, 48 insertions(+), 60 deletions(-) diff --git a/src/ronin/gateway/RoninGatewayV3.sol b/src/ronin/gateway/RoninGatewayV3.sol index 6a11782c..2475fb04 100644 --- a/src/ronin/gateway/RoninGatewayV3.sol +++ b/src/ronin/gateway/RoninGatewayV3.sol @@ -75,8 +75,9 @@ contract RoninGatewayV3 is * @dev Reverts if the method caller is not bridge operator. */ function _requireBridgeOperator() internal view { - if (!IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)).isBridgeOperator(msg.sender)) + if (!IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)).isBridgeOperator(msg.sender)) { revert ErrUnauthorized(msg.sig, RoleAccess.__DEPRECATED_BRIDGE_OPERATOR); + } } /** @@ -88,7 +89,7 @@ contract RoninGatewayV3 is uint256 _denominator, uint256 _trustedNumerator, uint256 _trustedDenominator, - address[] calldata /* _withdrawalMigrators */, + address[] calldata, /* _withdrawalMigrators */ // _packedAddresses[0]: roninTokens // _packedAddresses[1]: mainchainTokens address[][2] calldata _packedAddresses, @@ -127,7 +128,7 @@ contract RoninGatewayV3 is address[] calldata operators ) external view returns (bytes[] memory _signatures) { _signatures = new bytes[](operators.length); - for (uint256 _i = 0; _i < operators.length; ) { + for (uint256 _i = 0; _i < operators.length;) { _signatures[_i] = _withdrawalSig[withdrawalId][operators[_i]]; unchecked { @@ -140,28 +141,24 @@ contract RoninGatewayV3 is * @inheritdoc IRoninGatewayV3 */ function depositFor(Transfer.Receipt calldata _receipt) external whenNotPaused onlyBridgeOperator { - address _sender = msg.sender; - _depositFor(_receipt, _sender, minimumVoteWeight()); - IBridgeTracking(getContract(ContractType.BRIDGE_TRACKING)).recordVote( - IBridgeTracking.VoteKind.Deposit, - _receipt.id, - _sender - ); + _depositFor(_receipt, msg.sender, minimumVoteWeight()); } /** * @inheritdoc IRoninGatewayV3 */ - function tryBulkAcknowledgeMainchainWithdrew( - uint256[] calldata _withdrawalIds - ) external onlyBridgeOperator returns (bool[] memory _executedReceipts) { + function tryBulkAcknowledgeMainchainWithdrew(uint256[] calldata _withdrawalIds) + external + onlyBridgeOperator + returns (bool[] memory _executedReceipts) + { address _governor = msg.sender; uint256 _minVoteWeight = minimumVoteWeight(); uint256 _withdrawalId; _executedReceipts = new bool[](_withdrawalIds.length); IBridgeTracking _bridgeTrackingContract = IBridgeTracking(getContract(ContractType.BRIDGE_TRACKING)); - for (uint256 _i; _i < _withdrawalIds.length; ) { + for (uint256 _i; _i < _withdrawalIds.length;) { _withdrawalId = _withdrawalIds[_i]; _bridgeTrackingContract.recordVote(IBridgeTracking.VoteKind.MainchainWithdrawal, _withdrawalId, _governor); if (mainchainWithdrew(_withdrawalId)) { @@ -187,26 +184,22 @@ contract RoninGatewayV3 is /** * @inheritdoc IRoninGatewayV3 */ - function tryBulkDepositFor( - Transfer.Receipt[] calldata _receipts - ) external whenNotPaused onlyBridgeOperator returns (bool[] memory _executedReceipts) { - address _sender = msg.sender; - - Transfer.Receipt memory _receipt; - _executedReceipts = new bool[](_receipts.length); - uint256 _minVoteWeight = minimumVoteWeight(); - IBridgeTracking _bridgeTrackingContract = IBridgeTracking(getContract(ContractType.BRIDGE_TRACKING)); - for (uint256 _i; _i < _receipts.length; ) { - _receipt = _receipts[_i]; - _bridgeTrackingContract.recordVote(IBridgeTracking.VoteKind.Deposit, _receipt.id, _sender); - if (depositVote[_receipt.mainchain.chainId][_receipt.id].status == VoteStatus.Executed) { - _executedReceipts[_i] = true; + function tryBulkDepositFor(Transfer.Receipt[] calldata receipts) + external + whenNotPaused + onlyBridgeOperator + returns (bool[] memory _executedReceipts) + { + _executedReceipts = new bool[](receipts.length); + uint256 minVoteWeight = minimumVoteWeight(); + + Transfer.Receipt memory iReceipt; + for (uint i; i < receipts.length; ++i) { + iReceipt = receipts[i]; + if (depositVote[iReceipt.mainchain.chainId][iReceipt.id].status == VoteStatus.Executed) { + _executedReceipts[i] = true; } else { - _depositFor(_receipt, _sender, _minVoteWeight); - } - - unchecked { - ++_i; + _depositFor(iReceipt, msg.sender, minVoteWeight); } } } @@ -224,7 +217,7 @@ contract RoninGatewayV3 is function bulkRequestWithdrawalFor(Transfer.Request[] calldata _requests, uint256 _chainId) external whenNotPaused { if (_requests.length == 0) revert ErrEmptyArray(); - for (uint256 _i; _i < _requests.length; ) { + for (uint256 _i; _i < _requests.length;) { _requestWithdrawalFor(_requests[_i], msg.sender, _chainId); unchecked { ++_i; @@ -263,7 +256,7 @@ contract RoninGatewayV3 is uint256 id; IBridgeTracking _bridgeTrackingContract = IBridgeTracking(getContract(ContractType.BRIDGE_TRACKING)); - for (uint256 _i; _i < withdrawals.length; ) { + for (uint256 _i; _i < withdrawals.length;) { id = withdrawals[_i]; _withdrawalSig[id][operator] = signatures[_i]; _bridgeTrackingContract.recordVote(IBridgeTracking.VoteKind.Withdrawal, id, operator); @@ -338,10 +331,11 @@ contract RoninGatewayV3 is uint256[] calldata _chainIds, Token.Standard[] calldata _standards ) internal { - if (!(_roninTokens.length == _mainchainTokens.length && _roninTokens.length == _chainIds.length)) + if (!(_roninTokens.length == _mainchainTokens.length && _roninTokens.length == _chainIds.length)) { revert ErrLengthMismatch(msg.sig); + } - for (uint256 _i; _i < _roninTokens.length; ) { + for (uint256 _i; _i < _roninTokens.length;) { _mainchainToken[_roninTokens[_i]][_chainIds[_i]].tokenAddr = _mainchainTokens[_i]; _mainchainToken[_roninTokens[_i]][_chainIds[_i]].erc = _standards[_i]; @@ -363,27 +357,30 @@ contract RoninGatewayV3 is uint256 id = receipt.id; receipt.info.validate(); if (receipt.kind != Transfer.Kind.Deposit) revert ErrInvalidReceiptKind(); - if (receipt.ronin.chainId != block.chainid) revert ErrInvalidChainId(msg.sig, receipt.ronin.chainId, block.chainid); - MappedToken memory _token = getMainchainToken(receipt.ronin.tokenAddr, receipt.mainchain.chainId); + MappedToken memory token = getMainchainToken(receipt.ronin.tokenAddr, receipt.mainchain.chainId); - if (!(_token.erc == receipt.info.erc && _token.tokenAddr == receipt.mainchain.tokenAddr)) + if (!(token.erc == receipt.info.erc && token.tokenAddr == receipt.mainchain.tokenAddr)) { revert ErrInvalidReceipt(); + } IsolatedGovernance.Vote storage _proposal = depositVote[receipt.mainchain.chainId][id]; bytes32 _receiptHash = receipt.hash(); - VoteStatus _status = _castIsolatedVote(_proposal, operator, minVoteWeight, _receiptHash); + VoteStatus status = _castIsolatedVote(_proposal, operator, minVoteWeight, _receiptHash); emit DepositVoted(operator, id, receipt.mainchain.chainId, _receiptHash); - if (_status == VoteStatus.Approved) { + + // Transfer assets and handle when the vote is approved. + IBridgeTracking _bridgeTrackingContract = IBridgeTracking(getContract(ContractType.BRIDGE_TRACKING)); + if (status == VoteStatus.Approved) { _proposal.status = VoteStatus.Executed; receipt.info.handleAssetTransfer(payable(receipt.ronin.addr), receipt.ronin.tokenAddr, IWETH(address(0))); - IBridgeTracking(getContract(ContractType.BRIDGE_TRACKING)).handleVoteApproved( - IBridgeTracking.VoteKind.Deposit, - receipt.id - ); + _bridgeTrackingContract.handleVoteApproved(IBridgeTracking.VoteKind.Deposit, receipt.id); emit Deposited(_receiptHash, receipt); } + + // Announce to BridgeTracking to record the vote, after marking the VoteStatus as Executed. + _bridgeTrackingContract.recordVote(IBridgeTracking.VoteKind.Deposit, receipt.id, operator); } /** @@ -418,12 +415,8 @@ contract RoninGatewayV3 is address _mainchainTokenAddr ) internal returns (uint256 _withdrawalId) { _withdrawalId = withdrawalCount++; - Transfer.Receipt memory _receipt = _request.into_withdrawal_receipt( - _requester, - _withdrawalId, - _mainchainTokenAddr, - _chainId - ); + Transfer.Receipt memory _receipt = + _request.into_withdrawal_receipt(_requester, _withdrawalId, _mainchainTokenAddr, _chainId); withdrawal[_withdrawalId] = _receipt; emit WithdrawalRequested(_receipt.hash(), _receipt); } @@ -468,9 +461,8 @@ contract RoninGatewayV3 is IsolatedGovernance.Vote storage _v, bytes32 _hash ) internal view returns (uint256 _totalWeight) { - (, address[] memory bridgeOperators, uint96[] memory weights) = IBridgeManager( - getContract(ContractType.BRIDGE_MANAGER) - ).getFullBridgeOperatorInfos(); + (, address[] memory bridgeOperators, uint96[] memory weights) = + IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)).getFullBridgeOperatorInfos(); uint256 length = bridgeOperators.length; unchecked { for (uint _i; _i < length; ++_i) { @@ -513,11 +505,7 @@ contract RoninGatewayV3 is _trustedDenom = _trustedDenominator; unchecked { emit TrustedThresholdUpdated( - nonce++, - _trustedNumerator, - _trustedDenominator, - _previousTrustedNum, - _previousTrustedDenom + nonce++, _trustedNumerator, _trustedDenominator, _previousTrustedNum, _previousTrustedDenom ); } } From 1274c9cadc0c6fa3b21e57b700b753473478a566 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 6 Mar 2024 10:11:45 +0700 Subject: [PATCH 006/180] nit(RoninGateway): convention Co-authored-by: HuyHuynh <63286199+huyhuynh3103@users.noreply.github.com> Signed-off-by: Bao --- src/ronin/gateway/RoninGatewayV3.sol | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ronin/gateway/RoninGatewayV3.sol b/src/ronin/gateway/RoninGatewayV3.sol index 2475fb04..4c2f0b2d 100644 --- a/src/ronin/gateway/RoninGatewayV3.sol +++ b/src/ronin/gateway/RoninGatewayV3.sol @@ -157,10 +157,10 @@ contract RoninGatewayV3 is uint256 _withdrawalId; _executedReceipts = new bool[](_withdrawalIds.length); - IBridgeTracking _bridgeTrackingContract = IBridgeTracking(getContract(ContractType.BRIDGE_TRACKING)); + IBridgeTracking bridgeTrackingContract = IBridgeTracking(getContract(ContractType.BRIDGE_TRACKING)); for (uint256 _i; _i < _withdrawalIds.length;) { _withdrawalId = _withdrawalIds[_i]; - _bridgeTrackingContract.recordVote(IBridgeTracking.VoteKind.MainchainWithdrawal, _withdrawalId, _governor); + bridgeTrackingContract.recordVote(IBridgeTracking.VoteKind.MainchainWithdrawal, _withdrawalId, _governor); if (mainchainWithdrew(_withdrawalId)) { _executedReceipts[_i] = true; } else { @@ -170,7 +170,7 @@ contract RoninGatewayV3 is VoteStatus _status = _castIsolatedVote(_vote, _governor, _minVoteWeight, _hash); if (_status == VoteStatus.Approved) { _vote.status = VoteStatus.Executed; - _bridgeTrackingContract.handleVoteApproved(IBridgeTracking.VoteKind.MainchainWithdrawal, _withdrawalId); + bridgeTrackingContract.handleVoteApproved(IBridgeTracking.VoteKind.MainchainWithdrawal, _withdrawalId); emit MainchainWithdrew(_hash, _withdrawal); } } @@ -371,16 +371,16 @@ contract RoninGatewayV3 is emit DepositVoted(operator, id, receipt.mainchain.chainId, _receiptHash); // Transfer assets and handle when the vote is approved. - IBridgeTracking _bridgeTrackingContract = IBridgeTracking(getContract(ContractType.BRIDGE_TRACKING)); + IBridgeTracking bridgeTrackingContract = IBridgeTracking(getContract(ContractType.BRIDGE_TRACKING)); if (status == VoteStatus.Approved) { _proposal.status = VoteStatus.Executed; receipt.info.handleAssetTransfer(payable(receipt.ronin.addr), receipt.ronin.tokenAddr, IWETH(address(0))); - _bridgeTrackingContract.handleVoteApproved(IBridgeTracking.VoteKind.Deposit, receipt.id); + bridgeTrackingContract.handleVoteApproved(IBridgeTracking.VoteKind.Deposit, receipt.id); emit Deposited(_receiptHash, receipt); } // Announce to BridgeTracking to record the vote, after marking the VoteStatus as Executed. - _bridgeTrackingContract.recordVote(IBridgeTracking.VoteKind.Deposit, receipt.id, operator); + bridgeTrackingContract.recordVote(IBridgeTracking.VoteKind.Deposit, receipt.id, operator); } /** From 2cc5f8ed3c5003e8c1f9923eb5e347c6b014b4a4 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 6 Mar 2024 10:23:22 +0700 Subject: [PATCH 007/180] fix(RoninGateway): cache calldata length, nit `_i` --- src/ronin/gateway/RoninGatewayV3.sol | 63 +++++++++++++--------------- 1 file changed, 29 insertions(+), 34 deletions(-) diff --git a/src/ronin/gateway/RoninGatewayV3.sol b/src/ronin/gateway/RoninGatewayV3.sol index 4c2f0b2d..565e1f27 100644 --- a/src/ronin/gateway/RoninGatewayV3.sol +++ b/src/ronin/gateway/RoninGatewayV3.sol @@ -152,32 +152,31 @@ contract RoninGatewayV3 is onlyBridgeOperator returns (bool[] memory _executedReceipts) { - address _governor = msg.sender; - uint256 _minVoteWeight = minimumVoteWeight(); + address governor = msg.sender; + uint256 minVoteWeight = minimumVoteWeight(); - uint256 _withdrawalId; - _executedReceipts = new bool[](_withdrawalIds.length); + uint256 withdrawalId; + uint length = _withdrawalIds.length; + + _executedReceipts = new bool[](length); IBridgeTracking bridgeTrackingContract = IBridgeTracking(getContract(ContractType.BRIDGE_TRACKING)); - for (uint256 _i; _i < _withdrawalIds.length;) { - _withdrawalId = _withdrawalIds[_i]; - bridgeTrackingContract.recordVote(IBridgeTracking.VoteKind.MainchainWithdrawal, _withdrawalId, _governor); - if (mainchainWithdrew(_withdrawalId)) { - _executedReceipts[_i] = true; + + for (uint256 i; i < length; i++) { + withdrawalId = _withdrawalIds[i]; + bridgeTrackingContract.recordVote(IBridgeTracking.VoteKind.MainchainWithdrawal, withdrawalId, governor); + if (mainchainWithdrew(withdrawalId)) { + _executedReceipts[i] = true; } else { - IsolatedGovernance.Vote storage _vote = mainchainWithdrewVote[_withdrawalId]; - Transfer.Receipt memory _withdrawal = withdrawal[_withdrawalId]; + IsolatedGovernance.Vote storage _vote = mainchainWithdrewVote[withdrawalId]; + Transfer.Receipt memory _withdrawal = withdrawal[withdrawalId]; bytes32 _hash = _withdrawal.hash(); - VoteStatus _status = _castIsolatedVote(_vote, _governor, _minVoteWeight, _hash); + VoteStatus _status = _castIsolatedVote(_vote, governor, minVoteWeight, _hash); if (_status == VoteStatus.Approved) { _vote.status = VoteStatus.Executed; - bridgeTrackingContract.handleVoteApproved(IBridgeTracking.VoteKind.MainchainWithdrawal, _withdrawalId); + bridgeTrackingContract.handleVoteApproved(IBridgeTracking.VoteKind.MainchainWithdrawal, withdrawalId); emit MainchainWithdrew(_hash, _withdrawal); } } - - unchecked { - ++_i; - } } } @@ -190,11 +189,12 @@ contract RoninGatewayV3 is onlyBridgeOperator returns (bool[] memory _executedReceipts) { - _executedReceipts = new bool[](receipts.length); + uint length = receipts.length; + _executedReceipts = new bool[](length); uint256 minVoteWeight = minimumVoteWeight(); Transfer.Receipt memory iReceipt; - for (uint i; i < receipts.length; ++i) { + for (uint i; i < length; ++i) { iReceipt = receipts[i]; if (depositVote[iReceipt.mainchain.chainId][iReceipt.id].status == VoteStatus.Executed) { _executedReceipts[i] = true; @@ -214,14 +214,12 @@ contract RoninGatewayV3 is /** * @inheritdoc IRoninGatewayV3 */ - function bulkRequestWithdrawalFor(Transfer.Request[] calldata _requests, uint256 _chainId) external whenNotPaused { - if (_requests.length == 0) revert ErrEmptyArray(); + function bulkRequestWithdrawalFor(Transfer.Request[] calldata requests, uint256 chainId) external whenNotPaused { + uint length = requests.length; + if (length == 0) revert ErrEmptyArray(); - for (uint256 _i; _i < _requests.length;) { - _requestWithdrawalFor(_requests[_i], msg.sender, _chainId); - unchecked { - ++_i; - } + for (uint i; i < length; ++i) { + _requestWithdrawalFor(requests[i], msg.sender, chainId); } } @@ -248,7 +246,8 @@ contract RoninGatewayV3 is ) external whenNotPaused onlyBridgeOperator { address operator = msg.sender; - if (!(withdrawals.length > 0 && withdrawals.length == signatures.length)) { + uint length = withdrawals.length; + if (!(length > 0 && length == signatures.length)) { revert ErrLengthMismatch(msg.sig); } @@ -256,9 +255,9 @@ contract RoninGatewayV3 is uint256 id; IBridgeTracking _bridgeTrackingContract = IBridgeTracking(getContract(ContractType.BRIDGE_TRACKING)); - for (uint256 _i; _i < withdrawals.length;) { - id = withdrawals[_i]; - _withdrawalSig[id][operator] = signatures[_i]; + for (uint i; i < length; ++i) { + id = withdrawals[i]; + _withdrawalSig[id][operator] = signatures[i]; _bridgeTrackingContract.recordVote(IBridgeTracking.VoteKind.Withdrawal, id, operator); IsolatedGovernance.Vote storage _proposal = withdrawalStatVote[id]; @@ -267,10 +266,6 @@ contract RoninGatewayV3 is _proposal.status = VoteStatus.Executed; _bridgeTrackingContract.handleVoteApproved(IBridgeTracking.VoteKind.Withdrawal, id); } - - unchecked { - ++_i; - } } } From a524543b615c7703693d1f0374e939d10c6169e6 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Fri, 12 Jan 2024 15:35:30 +0700 Subject: [PATCH 008/180] fix(BridgeReward): clean up slot naming --- src/ronin/gateway/BridgeReward.sol | 84 +++++++++++------------------- 1 file changed, 30 insertions(+), 54 deletions(-) diff --git a/src/ronin/gateway/BridgeReward.sol b/src/ronin/gateway/BridgeReward.sol index edb10d0b..4a445ae0 100644 --- a/src/ronin/gateway/BridgeReward.sol +++ b/src/ronin/gateway/BridgeReward.sol @@ -17,19 +17,15 @@ import { ErrSyncTooFarPeriod, ErrInvalidArguments, ErrLengthMismatch, ErrUnautho contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONTransferHelper, Initializable { /// @dev value is equal to keccak256("@ronin.dpos.gateway.BridgeReward.rewardInfo.slot") - 1 - bytes32 private constant REWARD_INFO_SLOT = 0x518cfd198acbffe95e740cfce1af28a3f7de51f0d784893d3d72c5cc59d7062a; + bytes32 private constant $_REWARD_INFO = 0x518cfd198acbffe95e740cfce1af28a3f7de51f0d784893d3d72c5cc59d7062a; /// @dev value is equal to keccak256("@ronin.dpos.gateway.BridgeReward.rewardPerPeriod.slot") - 1 - TUint256Slot private constant REWARD_PER_PERIOD_SLOT = - TUint256Slot.wrap(0x90f7d557245e5dd9485f463e58974fa7cdc93c0abbd0a1afebb8f9640ec73910); + TUint256Slot private constant $_REWARD_PER_PERIOD = TUint256Slot.wrap(0x90f7d557245e5dd9485f463e58974fa7cdc93c0abbd0a1afebb8f9640ec73910); /// @dev value is equal to keccak256("@ronin.dpos.gateway.BridgeReward.latestRewardedPeriod.slot") - 1 - TUint256Slot private constant LATEST_REWARDED_PERIOD_SLOT = - TUint256Slot.wrap(0x2417f25874c1cdc139a787dd21df976d40d767090442b3a2496917ecfc93b619); + TUint256Slot private constant $_LATEST_REWARDED_PERIOD = TUint256Slot.wrap(0x2417f25874c1cdc139a787dd21df976d40d767090442b3a2496917ecfc93b619); /// @dev value is equal to keccak256("@ronin.dpos.gateway.BridgeReward.totalRewardToppedUp.slot") - 1 - TUint256Slot private constant TOTAL_REWARDS_TOPPED_UP_SLOT = - TUint256Slot.wrap(0x9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c64); + TUint256Slot private constant $_TOTAL_REWARDS_TOPPED_UP = TUint256Slot.wrap(0x9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c64); /// @dev value is equal to keccak256("@ronin.dpos.gateway.BridgeReward.totalRewardScattered.slot") - 1 - TUint256Slot private constant TOTAL_REWARDS_SCATTERED_SLOT = - TUint256Slot.wrap(0x3663384f6436b31a97d9c9a02f64ab8b73ead575c5b6224fa0800a6bd57f62f4); + TUint256Slot private constant $_TOTAL_REWARDS_SCATTERED = TUint256Slot.wrap(0x3663384f6436b31a97d9c9a02f64ab8b73ead575c5b6224fa0800a6bd57f62f4); address private immutable _self; @@ -51,7 +47,7 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT _setContract(ContractType.BRIDGE_SLASH, bridgeSlashContract); _setContract(ContractType.VALIDATOR, validatorSetContract); _setContract(ContractType.GOVERNANCE_ADMIN, dposGA); - LATEST_REWARDED_PERIOD_SLOT.store(type(uint256).max); + $_LATEST_REWARDED_PERIOD.store(type(uint256).max); _setRewardPerPeriod(rewardPerPeriod); _receiveRON(); } @@ -62,7 +58,7 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT */ function initializeREP2() external onlyContract(ContractType.GOVERNANCE_ADMIN) { require(getLatestRewardedPeriod() == type(uint256).max, "already init rep 2"); - LATEST_REWARDED_PERIOD_SLOT.store(IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod() - 1); + $_LATEST_REWARDED_PERIOD.store(IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod() - 1); _setContract(ContractType.GOVERNANCE_ADMIN, address(0)); } @@ -85,23 +81,19 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT if (currentPeriod <= latestRewardedPeriod) revert ErrInvalidArguments(msg.sig); if (latestRewardedPeriod + periodLength > currentPeriod) revert ErrInvalidArguments(msg.sig); - LATEST_REWARDED_PERIOD_SLOT.addAssign(periodLength); + $_LATEST_REWARDED_PERIOD.addAssign(periodLength); address[] memory operators = IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)).getBridgeOperators(); IBridgeTracking bridgeTrackingContract = IBridgeTracking(getContract(ContractType.BRIDGE_TRACKING)); - for (uint256 i = 1; i <= periodLength; ) { - unchecked { - _syncReward({ - operators: operators, - ballots: bridgeTrackingContract.getManyTotalBallots(latestRewardedPeriod, operators), - totalBallot: bridgeTrackingContract.totalBallot(latestRewardedPeriod), - totalVote: bridgeTrackingContract.totalVote(latestRewardedPeriod), - period: latestRewardedPeriod += i - }); - - ++i; - } + for (uint256 i = 1; i <= periodLength; i++) { + _syncReward({ + operators: operators, + ballots: bridgeTrackingContract.getManyTotalBallots(latestRewardedPeriod, operators), + totalBallot: bridgeTrackingContract.totalBallot(latestRewardedPeriod), + totalVote: bridgeTrackingContract.totalVote(latestRewardedPeriod), + period: latestRewardedPeriod + i + }); } } @@ -126,29 +118,23 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT if (period < latestRewardedPeriod + 1) revert ErrInvalidArguments(msg.sig); else if (period > latestRewardedPeriod + 1) revert ErrSyncTooFarPeriod(period, latestRewardedPeriod); } - LATEST_REWARDED_PERIOD_SLOT.store(period); - - _syncReward({ - operators: operators, - ballots: ballots, - totalBallot: totalBallot, - totalVote: totalVote, - period: period - }); + $_LATEST_REWARDED_PERIOD.store(period); + + _syncReward({ operators: operators, ballots: ballots, totalBallot: totalBallot, totalVote: totalVote, period: period }); } /** * @inheritdoc IBridgeReward */ function getTotalRewardToppedUp() external view returns (uint256) { - return TOTAL_REWARDS_TOPPED_UP_SLOT.load(); + return $_TOTAL_REWARDS_TOPPED_UP.load(); } /** * @inheritdoc IBridgeReward */ function getTotalRewardScattered() external view returns (uint256) { - return TOTAL_REWARDS_SCATTERED_SLOT.load(); + return $_TOTAL_REWARDS_SCATTERED.load(); } /** @@ -158,8 +144,8 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT // prevent transfer RON directly to logic contract if (address(this) == _self) revert ErrUnauthorizedCall(msg.sig); - emit SafeReceived(msg.sender, TOTAL_REWARDS_TOPPED_UP_SLOT.load(), msg.value); - TOTAL_REWARDS_TOPPED_UP_SLOT.addAssign(msg.value); + emit SafeReceived(msg.sender, $_TOTAL_REWARDS_TOPPED_UP.load(), msg.value); + $_TOTAL_REWARDS_TOPPED_UP.addAssign(msg.value); } /** @@ -170,13 +156,7 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT * @param totalVote The total number of votes recorded for the period. * @param period The period for which the rewards are being synchronized. */ - function _syncReward( - address[] memory operators, - uint256[] memory ballots, - uint256 totalBallot, - uint256 totalVote, - uint256 period - ) internal { + function _syncReward(address[] memory operators, uint256[] memory ballots, uint256 totalBallot, uint256 totalVote, uint256 period) internal { uint256 numBridgeOperators = operators.length; uint256 rewardPerPeriod = getRewardPerPeriod(); uint256[] memory slashedDurationList = _getSlashInfo(operators); @@ -206,7 +186,7 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT } } - TOTAL_REWARDS_SCATTERED_SLOT.addAssign(sumRewards); + $_TOTAL_REWARDS_SCATTERED.addAssign(sumRewards); } /** @@ -215,11 +195,7 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT * * Emit a {BridgeTrackingIncorrectlyResponded} event when in case of incorrect data. */ - function _shouldShareEqually( - uint256 totalBallot, - uint256 totalVote, - uint256[] memory ballots - ) internal returns (bool shareEqually) { + function _shouldShareEqually(uint256 totalBallot, uint256 totalVote, uint256[] memory ballots) internal returns (bool shareEqually) { bool valid = _isValidBridgeTrackingResponse(totalBallot, totalVote, ballots); if (!valid) { emit BridgeTrackingIncorrectlyResponded(); @@ -308,14 +284,14 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT * @inheritdoc IBridgeReward */ function getRewardPerPeriod() public view returns (uint256) { - return REWARD_PER_PERIOD_SLOT.load(); + return $_REWARD_PER_PERIOD.load(); } /** * @inheritdoc IBridgeReward */ function getLatestRewardedPeriod() public view returns (uint256) { - return LATEST_REWARDED_PERIOD_SLOT.load(); + return $_LATEST_REWARDED_PERIOD.load(); } /** @@ -330,7 +306,7 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT * Emit an {UpdatedRewardPerPeriod} event after set. */ function _setRewardPerPeriod(uint256 rewardPerPeriod) internal { - REWARD_PER_PERIOD_SLOT.store(rewardPerPeriod); + $_REWARD_PER_PERIOD.store(rewardPerPeriod); emit UpdatedRewardPerPeriod(rewardPerPeriod); } @@ -354,7 +330,7 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT */ function _getRewardInfo() internal pure returns (mapping(address => BridgeRewardInfo) storage rewardInfo) { assembly ("memory-safe") { - rewardInfo.slot := REWARD_INFO_SLOT + rewardInfo.slot := $_REWARD_INFO } } } From 0e049752f6694432e7569041ac42896c3cdf2a3d Mon Sep 17 00:00:00 2001 From: nxqbao Date: Fri, 12 Jan 2024 15:36:34 +0700 Subject: [PATCH 009/180] chore: set compiler to 0.8.23 --- src/ronin/gateway/BridgeReward.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ronin/gateway/BridgeReward.sol b/src/ronin/gateway/BridgeReward.sol index 4a445ae0..a70fde37 100644 --- a/src/ronin/gateway/BridgeReward.sol +++ b/src/ronin/gateway/BridgeReward.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity ^0.8.23; import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import { BridgeTrackingHelper } from "../../extensions/bridge-operator-governance/BridgeTrackingHelper.sol"; From ac909cd05fa63fd6860980ead947d0022f8cdcb9 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Fri, 12 Jan 2024 15:44:17 +0700 Subject: [PATCH 010/180] fix(MainchainGateway): clean up naming `_` --- src/mainchain/MainchainGatewayV3.sol | 173 +++++++++++---------------- 1 file changed, 72 insertions(+), 101 deletions(-) diff --git a/src/mainchain/MainchainGatewayV3.sol b/src/mainchain/MainchainGatewayV3.sol index 68be6019..770ffef8 100644 --- a/src/mainchain/MainchainGatewayV3.sol +++ b/src/mainchain/MainchainGatewayV3.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity ^0.8.23; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; @@ -10,13 +10,7 @@ import "../extensions/WithdrawalLimitation.sol"; import "../libraries/Transfer.sol"; import "../interfaces/IMainchainGatewayV3.sol"; -contract MainchainGatewayV3 is - WithdrawalLimitation, - Initializable, - AccessControlEnumerable, - IMainchainGatewayV3, - HasContracts -{ +contract MainchainGatewayV3 is WithdrawalLimitation, Initializable, AccessControlEnumerable, IMainchainGatewayV3, HasContracts { using Token for Token.Info; using Transfer for Transfer.Request; using Transfer for Transfer.Receipt; @@ -30,7 +24,7 @@ contract MainchainGatewayV3 is uint256 public roninChainId; /// @dev Total deposit uint256 public depositCount; - /// @dev Domain seperator + /// @dev Domain separator bytes32 internal _domainSeparator; /// @dev Mapping from mainchain token => token address on Ronin network mapping(address => MappedToken) internal _roninToken; @@ -147,31 +141,31 @@ contract MainchainGatewayV3 is /** * @inheritdoc IMainchainGatewayV3 */ - function unlockWithdrawal(Transfer.Receipt calldata _receipt) external onlyRole(WITHDRAWAL_UNLOCKER_ROLE) { - bytes32 _receiptHash = _receipt.hash(); - if (withdrawalHash[_receipt.id] != _receipt.hash()) { + function unlockWithdrawal(Transfer.Receipt calldata receipt) external onlyRole(WITHDRAWAL_UNLOCKER_ROLE) { + bytes32 _receiptHash = receipt.hash(); + if (withdrawalHash[receipt.id] != receipt.hash()) { revert ErrInvalidReceipt(); } - if (!withdrawalLocked[_receipt.id]) { + if (!withdrawalLocked[receipt.id]) { revert ErrQueryForApprovedWithdrawal(); } - delete withdrawalLocked[_receipt.id]; - emit WithdrawalUnlocked(_receiptHash, _receipt); - - address _token = _receipt.mainchain.tokenAddr; - if (_receipt.info.erc == Token.Standard.ERC20) { - Token.Info memory _feeInfo = _receipt.info; - _feeInfo.quantity = _computeFeePercentage(_receipt.info.quantity, unlockFeePercentages[_token]); - Token.Info memory _withdrawInfo = _receipt.info; - _withdrawInfo.quantity = _receipt.info.quantity - _feeInfo.quantity; - - _feeInfo.handleAssetTransfer(payable(msg.sender), _token, wrappedNativeToken); - _withdrawInfo.handleAssetTransfer(payable(_receipt.mainchain.addr), _token, wrappedNativeToken); + delete withdrawalLocked[receipt.id]; + emit WithdrawalUnlocked(_receiptHash, receipt); + + address token = receipt.mainchain.tokenAddr; + if (receipt.info.erc == Token.Standard.ERC20) { + Token.Info memory feeInfo = receipt.info; + feeInfo.quantity = _computeFeePercentage(receipt.info.quantity, unlockFeePercentages[token]); + Token.Info memory withdrawInfo = receipt.info; + withdrawInfo.quantity = receipt.info.quantity - feeInfo.quantity; + + feeInfo.handleAssetTransfer(payable(msg.sender), token, wrappedNativeToken); + withdrawInfo.handleAssetTransfer(payable(receipt.mainchain.addr), token, wrappedNativeToken); } else { - _receipt.info.handleAssetTransfer(payable(_receipt.mainchain.addr), _token, wrappedNativeToken); + receipt.info.handleAssetTransfer(payable(receipt.mainchain.addr), token, wrappedNativeToken); } - emit Withdrew(_receiptHash, _receipt); + emit Withdrew(_receiptHash, receipt); } /** @@ -210,9 +204,9 @@ contract MainchainGatewayV3 is /** * @inheritdoc IMainchainGatewayV3 */ - function getRoninToken(address _mainchainToken) public view returns (MappedToken memory _token) { - _token = _roninToken[_mainchainToken]; - if (_token.tokenAddr == address(0)) revert ErrUnsupportedToken(); + function getRoninToken(address mainchainToken) public view returns (MappedToken memory token) { + token = _roninToken[mainchainToken]; + if (token.tokenAddr == address(0)) revert ErrUnsupportedToken(); } /** @@ -224,25 +218,15 @@ contract MainchainGatewayV3 is * Emits the `TokenMapped` event. * */ - function _mapTokens( - address[] calldata _mainchainTokens, - address[] calldata _roninTokens, - Token.Standard[] calldata _standards - ) internal virtual { - if (!(_mainchainTokens.length == _roninTokens.length && _mainchainTokens.length == _standards.length)) { - revert ErrLengthMismatch(msg.sig); - } + function _mapTokens(address[] calldata mainchainTokens, address[] calldata roninTokens, Token.Standard[] calldata standards) internal virtual { + if (!(mainchainTokens.length == roninTokens.length && mainchainTokens.length == standards.length)) revert ErrLengthMismatch(msg.sig); - for (uint256 _i; _i < _mainchainTokens.length;) { - _roninToken[_mainchainTokens[_i]].tokenAddr = _roninTokens[_i]; - _roninToken[_mainchainTokens[_i]].erc = _standards[_i]; - - unchecked { - ++_i; - } + for (uint256 i; i < mainchainTokens.length; i++) { + _roninToken[mainchainTokens[i]].tokenAddr = roninTokens[i]; + _roninToken[mainchainTokens[i]].erc = standards[i]; } - emit TokenMapped(_mainchainTokens, _roninTokens, _standards); + emit TokenMapped(mainchainTokens, roninTokens, standards); } /** @@ -259,75 +243,67 @@ contract MainchainGatewayV3 is * Emits the `Withdrew` once the assets are released. * */ - function _submitWithdrawal(Transfer.Receipt calldata _receipt, Signature[] memory _signatures) - internal - virtual - returns (bool _locked) - { - uint256 _id = _receipt.id; - uint256 _quantity = _receipt.info.quantity; - address _tokenAddr = _receipt.mainchain.tokenAddr; + function _submitWithdrawal(Transfer.Receipt calldata receipt, Signature[] memory signatures) internal virtual returns (bool locked) { + uint256 id = receipt.id; + uint256 quantity = receipt.info.quantity; + address tokenAddr = receipt.mainchain.tokenAddr; - _receipt.info.validate(); - if (_receipt.kind != Transfer.Kind.Withdrawal) revert ErrInvalidReceiptKind(); + receipt.info.validate(); + if (receipt.kind != Transfer.Kind.Withdrawal) revert ErrInvalidReceiptKind(); - if (_receipt.mainchain.chainId != block.chainid) { - revert ErrInvalidChainId(msg.sig, _receipt.mainchain.chainId, block.chainid); + if (receipt.mainchain.chainId != block.chainid) { + revert ErrInvalidChainId(msg.sig, receipt.mainchain.chainId, block.chainid); } - MappedToken memory _token = getRoninToken(_receipt.mainchain.tokenAddr); + MappedToken memory token = getRoninToken(receipt.mainchain.tokenAddr); - if (!(_token.erc == _receipt.info.erc && _token.tokenAddr == _receipt.ronin.tokenAddr)) revert ErrInvalidReceipt(); + if (!(token.erc == receipt.info.erc && token.tokenAddr == receipt.ronin.tokenAddr)) revert ErrInvalidReceipt(); - if (withdrawalHash[_id] != 0) revert ErrQueryForProcessedWithdrawal(); + if (withdrawalHash[id] != 0) revert ErrQueryForProcessedWithdrawal(); - if (!(_receipt.info.erc == Token.Standard.ERC721 || !_reachedWithdrawalLimit(_tokenAddr, _quantity))) { + if (!(receipt.info.erc == Token.Standard.ERC721 || !_reachedWithdrawalLimit(tokenAddr, quantity))) { revert ErrReachedDailyWithdrawalLimit(); } - bytes32 _receiptHash = _receipt.hash(); - bytes32 _receiptDigest = Transfer.receiptDigest(_domainSeparator, _receiptHash); + bytes32 receiptHash = receipt.hash(); + bytes32 receiptDigest = Transfer.receiptDigest(_domainSeparator, receiptHash); - uint256 _minimumVoteWeight; - (_minimumVoteWeight, _locked) = _computeMinVoteWeight(_receipt.info.erc, _tokenAddr, _quantity); + uint256 minimumWeight; + (minimumWeight, locked) = _computeMinVoteWeight(receipt.info.erc, tokenAddr, quantity); { - bool _passed; - address _signer; - address _lastSigner; - Signature memory _sig; - uint256 _weight; - for (uint256 _i; _i < _signatures.length;) { - _sig = _signatures[_i]; - _signer = ecrecover(_receiptDigest, _sig.v, _sig.r, _sig.s); - if (_lastSigner >= _signer) revert ErrInvalidOrder(msg.sig); - - _lastSigner = _signer; - - _weight += _getWeight(_signer); - if (_weight >= _minimumVoteWeight) { - _passed = true; + bool passed; + address signer; + address lastSigner; + Signature memory sig; + uint256 weight; + for (uint256 i; i < signatures.length; i++) { + sig = signatures[i]; + signer = ecrecover(receiptDigest, sig.v, sig.r, sig.s); + if (lastSigner >= signer) revert ErrInvalidOrder(msg.sig); + + lastSigner = signer; + + weight += _getWeight(signer); + if (weight >= minimumWeight) { + passed = true; break; } - - unchecked { - ++_i; - } } - if (!_passed) revert ErrQueryForInsufficientVoteWeight(); - withdrawalHash[_id] = _receiptHash; + if (!passed) revert ErrQueryForInsufficientVoteWeight(); + withdrawalHash[id] = receiptHash; } - if (_locked) { - withdrawalLocked[_id] = true; - emit WithdrawalLocked(_receiptHash, _receipt); - return _locked; + if (locked) { + withdrawalLocked[id] = true; + emit WithdrawalLocked(receiptHash, receipt); + return locked; } - _recordWithdrawal(_tokenAddr, _quantity); - _receipt.info.handleAssetTransfer(payable(_receipt.mainchain.addr), _tokenAddr, wrappedNativeToken); - emit Withdrew(_receiptHash, _receipt); + _recordWithdrawal(tokenAddr, quantity); + receipt.info.handleAssetTransfer(payable(receipt.mainchain.addr), tokenAddr, wrappedNativeToken); + emit Withdrew(receiptHash, receipt); } /** @@ -367,8 +343,7 @@ contract MainchainGatewayV3 is } uint256 _depositId = depositCount++; - Transfer.Receipt memory _receipt = - _request.into_deposit_receipt(_requester, _depositId, _token.tokenAddr, roninChainId); + Transfer.Receipt memory _receipt = _request.into_deposit_receipt(_requester, _depositId, _token.tokenAddr, roninChainId); emit DepositRequested(_receipt.hash(), _receipt); } @@ -376,11 +351,7 @@ contract MainchainGatewayV3 is /** * @dev Returns the minimum vote weight for the token. */ - function _computeMinVoteWeight(Token.Standard _erc, address _token, uint256 _quantity) - internal - virtual - returns (uint256 _weight, bool _locked) - { + function _computeMinVoteWeight(Token.Standard _erc, address _token, uint256 _quantity) internal virtual returns (uint256 _weight, bool _locked) { uint256 _totalWeight = _getTotalWeight(); _weight = _minimumVoteWeight(_totalWeight); if (_erc == Token.Standard.ERC20) { From f7ba362976ba337b2e037dcd414a53a622a5b053 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Fri, 12 Jan 2024 16:19:32 +0700 Subject: [PATCH 011/180] fix(BridgeManager): prettier --- .../BridgeManager.sol | 51 +++++-------------- 1 file changed, 13 insertions(+), 38 deletions(-) diff --git a/src/extensions/bridge-operator-governance/BridgeManager.sol b/src/extensions/bridge-operator-governance/BridgeManager.sol index e871e624..bd2ca0d6 100644 --- a/src/extensions/bridge-operator-governance/BridgeManager.sol +++ b/src/extensions/bridge-operator-governance/BridgeManager.sol @@ -16,43 +16,37 @@ abstract contract BridgeManager is IQuorum, IBridgeManager, BridgeManagerCallbac using EnumerableSet for EnumerableSet.AddressSet; /// @dev value is equal to keccak256("@ronin.dpos.gateway.BridgeAdmin.governorToBridgeOperatorInfo.slot") - 1 - bytes32 private constant GOVERNOR_TO_BRIDGE_OPERATOR_INFO_SLOT = - 0x88547008e60f5748911f2e59feb3093b7e4c2e87b2dd69d61f112fcc932de8e3; + bytes32 private constant GOVERNOR_TO_BRIDGE_OPERATOR_INFO_SLOT = 0x88547008e60f5748911f2e59feb3093b7e4c2e87b2dd69d61f112fcc932de8e3; /// @dev value is equal to keccak256("@ronin.dpos.gateway.BridgeAdmin.govenorOf.slot") - 1 bytes32 private constant GOVENOR_OF_SLOT = 0x8400683eb2cb350596d73644c0c89fe45f108600003457374f4ab3e87b4f3aa3; /// @dev value is equal to keccak256("@ronin.dpos.gateway.BridgeAdmin.governors.slot") - 1 bytes32 private constant GOVERNOR_SET_SLOT = 0x546f6b46ab35b030b6816596b352aef78857377176c8b24baa2046a62cf1998c; /// @dev value is equal to keccak256("@ronin.dpos.gateway.BridgeAdmin.bridgeOperators.slot") - 1 - bytes32 private constant BRIDGE_OPERATOR_SET_SLOT = - 0xd38c234075fde25875da8a6b7e36b58b86681d483271a99eeeee1d78e258a24d; + bytes32 private constant BRIDGE_OPERATOR_SET_SLOT = 0xd38c234075fde25875da8a6b7e36b58b86681d483271a99eeeee1d78e258a24d; /** * @dev The numerator value used for calculations in the contract. * @notice value is equal to keccak256("@ronin.dpos.gateway.BridgeAdmin.numerator.slot") - 1 */ - TUint256Slot internal constant NUMERATOR_SLOT = - TUint256Slot.wrap(0xc55405a488814eaa0e2a685a0131142785b8d033d311c8c8244e34a7c12ca40f); + TUint256Slot internal constant NUMERATOR_SLOT = TUint256Slot.wrap(0xc55405a488814eaa0e2a685a0131142785b8d033d311c8c8244e34a7c12ca40f); /** * @dev The denominator value used for calculations in the contract. * @notice value is equal to keccak256("@ronin.dpos.gateway.BridgeAdmin.denominator.slot") - 1 */ - TUint256Slot internal constant DENOMINATOR_SLOT = - TUint256Slot.wrap(0xac1ff16a4f04f2a37a9ba5252a69baa100b460e517d1f8019c054a5ad698f9ff); + TUint256Slot internal constant DENOMINATOR_SLOT = TUint256Slot.wrap(0xac1ff16a4f04f2a37a9ba5252a69baa100b460e517d1f8019c054a5ad698f9ff); /** * @dev The nonce value used for tracking nonces in the contract. * @notice value is equal to keccak256("@ronin.dpos.gateway.BridgeAdmin.nonce.slot") - 1 */ - TUint256Slot internal constant NONCE_SLOT = - TUint256Slot.wrap(0x92872d32822c9d44b36a2537d3e0d4c46fc4de1ce154ccfaed560a8a58445f1d); + TUint256Slot internal constant NONCE_SLOT = TUint256Slot.wrap(0x92872d32822c9d44b36a2537d3e0d4c46fc4de1ce154ccfaed560a8a58445f1d); /** * @dev The total weight value used for storing the cumulative weight in the contract. * @notice value is equal to keccak256("@ronin.dpos.gateway.BridgeAdmin.totalWeights.slot") - 1 */ - TUint256Slot internal constant TOTAL_WEIGHTS_SLOT = - TUint256Slot.wrap(0x6924fe71b0c8b61aea02ca498b5f53b29bd95726278b1fe4eb791bb24a42644c); + TUint256Slot internal constant TOTAL_WEIGHTS_SLOT = TUint256Slot.wrap(0x6924fe71b0c8b61aea02ca498b5f53b29bd95726278b1fe4eb791bb24a42644c); /** * @inheritdoc IBridgeManager @@ -105,9 +99,7 @@ abstract contract BridgeManager is IQuorum, IBridgeManager, BridgeManagerCallbac /** * @inheritdoc IBridgeManager */ - function removeBridgeOperators( - address[] calldata bridgeOperators - ) external onlySelfCall returns (bool[] memory removeds) { + function removeBridgeOperators(address[] calldata bridgeOperators) external onlySelfCall returns (bool[] memory removeds) { removeds = _removeBridgeOperators(bridgeOperators); } @@ -137,10 +129,7 @@ abstract contract BridgeManager is IQuorum, IBridgeManager, BridgeManagerCallbac _governorOf[newBridgeOperator] = msg.sender; _gorvernorToBridgeOperatorInfo[msg.sender].addr = newBridgeOperator; - _notifyRegisters( - IBridgeManagerCallback.onBridgeOperatorUpdated.selector, - abi.encode(currentBridgeOperator, newBridgeOperator) - ); + _notifyRegisters(IBridgeManagerCallback.onBridgeOperatorUpdated.selector, abi.encode(currentBridgeOperator, newBridgeOperator)); emit BridgeOperatorUpdated(msg.sender, currentBridgeOperator, newBridgeOperator); } @@ -156,10 +145,7 @@ abstract contract BridgeManager is IQuorum, IBridgeManager, BridgeManagerCallbac /** * @inheritdoc IQuorum */ - function setThreshold( - uint256 numerator, - uint256 denominator - ) external override onlySelfCall returns (uint256, uint256) { + function setThreshold(uint256 numerator, uint256 denominator) external override onlySelfCall returns (uint256, uint256) { return _setThreshold(numerator, denominator); } @@ -187,9 +173,7 @@ abstract contract BridgeManager is IQuorum, IBridgeManager, BridgeManagerCallbac /** * @inheritdoc IBridgeManager */ - function sumGovernorsWeight( - address[] calldata governors - ) external view nonDuplicate(governors) returns (uint256 sum) { + function sumGovernorsWeight(address[] calldata governors) external view nonDuplicate(governors) returns (uint256 sum) { sum = _sumGovernorsWeight(governors); } @@ -375,9 +359,7 @@ abstract contract BridgeManager is IQuorum, IBridgeManager, BridgeManagerCallbac * @param bridgeOperators An array of addresses representing the bridge operators to be removed. * @return removeds An array of boolean values indicating whether each bridge operator was successfully removed. */ - function _removeBridgeOperators( - address[] memory bridgeOperators - ) internal nonDuplicate(bridgeOperators) returns (bool[] memory removeds) { + function _removeBridgeOperators(address[] memory bridgeOperators) internal nonDuplicate(bridgeOperators) returns (bool[] memory removeds) { uint256 length = bridgeOperators.length; removeds = new bool[](length); // simply skip remove operations if inputs are empty. @@ -431,10 +413,7 @@ abstract contract BridgeManager is IQuorum, IBridgeManager, BridgeManagerCallbac * Emits the `ThresholdUpdated` event. * */ - function _setThreshold( - uint256 numerator, - uint256 denominator - ) internal virtual returns (uint256 previousNum, uint256 previousDenom) { + function _setThreshold(uint256 numerator, uint256 denominator) internal virtual returns (uint256 previousNum, uint256 previousDenom) { if (numerator > denominator) revert ErrInvalidThreshold(msg.sig); previousNum = NUMERATOR_SLOT.load(); @@ -540,11 +519,7 @@ abstract contract BridgeManager is IQuorum, IBridgeManager, BridgeManagerCallbac * @dev Internal function to access the mapping from governor => BridgeOperatorInfo. * @return governorToBridgeOperatorInfo the mapping from governor => BridgeOperatorInfo. */ - function _getGovernorToBridgeOperatorInfo() - internal - pure - returns (mapping(address => BridgeOperatorInfo) storage governorToBridgeOperatorInfo) - { + function _getGovernorToBridgeOperatorInfo() internal pure returns (mapping(address => BridgeOperatorInfo) storage governorToBridgeOperatorInfo) { assembly ("memory-safe") { governorToBridgeOperatorInfo.slot := GOVERNOR_TO_BRIDGE_OPERATOR_INFO_SLOT } From c7d79aeab6edf5d2ebf13ba35c2d859d1dae8001 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 16 Jan 2024 15:01:16 +0700 Subject: [PATCH 012/180] BREAKING CHANGE(BridgeManager): rework to reduce tx gas --- .../BridgeManager.sol | 550 ++++++++---------- .../BridgeManagerQuorum.sol | 76 +++ src/interfaces/bridge/IBridgeManager.sol | 41 +- .../bridge/IBridgeManagerThreshold.sol | 13 + .../bridge/events/IBridgeManagerEvents.sol | 33 +- 5 files changed, 365 insertions(+), 348 deletions(-) create mode 100644 src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol create mode 100644 src/interfaces/bridge/IBridgeManagerThreshold.sol diff --git a/src/extensions/bridge-operator-governance/BridgeManager.sol b/src/extensions/bridge-operator-governance/BridgeManager.sol index bd2ca0d6..a15d0dfe 100644 --- a/src/extensions/bridge-operator-governance/BridgeManager.sol +++ b/src/extensions/bridge-operator-governance/BridgeManager.sol @@ -1,58 +1,49 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity ^0.8.23; -import { IBridgeManagerCallback, EnumerableSet, BridgeManagerCallbackRegister } from "./BridgeManagerCallbackRegister.sol"; +import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; +import { IBridgeManagerCallback, BridgeManagerCallbackRegister } from "./BridgeManagerCallbackRegister.sol"; import { IHasContracts, HasContracts } from "../../extensions/collections/HasContracts.sol"; -import { IQuorum } from "../../interfaces/IQuorum.sol"; + import { IBridgeManager } from "../../interfaces/bridge/IBridgeManager.sol"; import { AddressArrayUtils } from "../../libraries/AddressArrayUtils.sol"; import { ContractType } from "../../utils/ContractType.sol"; import { RoleAccess } from "../../utils/RoleAccess.sol"; import { TUint256Slot } from "../../types/Types.sol"; import "../../utils/CommonErrors.sol"; +import "./BridgeManagerQuorum.sol"; -abstract contract BridgeManager is IQuorum, IBridgeManager, BridgeManagerCallbackRegister, HasContracts { +abstract contract BridgeManager is IBridgeManager, HasContracts, BridgeManagerQuorum, BridgeManagerCallbackRegister { using AddressArrayUtils for address[]; using EnumerableSet for EnumerableSet.AddressSet; - /// @dev value is equal to keccak256("@ronin.dpos.gateway.BridgeAdmin.governorToBridgeOperatorInfo.slot") - 1 - bytes32 private constant GOVERNOR_TO_BRIDGE_OPERATOR_INFO_SLOT = 0x88547008e60f5748911f2e59feb3093b7e4c2e87b2dd69d61f112fcc932de8e3; - /// @dev value is equal to keccak256("@ronin.dpos.gateway.BridgeAdmin.govenorOf.slot") - 1 - bytes32 private constant GOVENOR_OF_SLOT = 0x8400683eb2cb350596d73644c0c89fe45f108600003457374f4ab3e87b4f3aa3; - /// @dev value is equal to keccak256("@ronin.dpos.gateway.BridgeAdmin.governors.slot") - 1 - bytes32 private constant GOVERNOR_SET_SLOT = 0x546f6b46ab35b030b6816596b352aef78857377176c8b24baa2046a62cf1998c; - /// @dev value is equal to keccak256("@ronin.dpos.gateway.BridgeAdmin.bridgeOperators.slot") - 1 - bytes32 private constant BRIDGE_OPERATOR_SET_SLOT = 0xd38c234075fde25875da8a6b7e36b58b86681d483271a99eeeee1d78e258a24d; - - /** - * @dev The numerator value used for calculations in the contract. - * @notice value is equal to keccak256("@ronin.dpos.gateway.BridgeAdmin.numerator.slot") - 1 - */ - TUint256Slot internal constant NUMERATOR_SLOT = TUint256Slot.wrap(0xc55405a488814eaa0e2a685a0131142785b8d033d311c8c8244e34a7c12ca40f); - - /** - * @dev The denominator value used for calculations in the contract. - * @notice value is equal to keccak256("@ronin.dpos.gateway.BridgeAdmin.denominator.slot") - 1 - */ - TUint256Slot internal constant DENOMINATOR_SLOT = TUint256Slot.wrap(0xac1ff16a4f04f2a37a9ba5252a69baa100b460e517d1f8019c054a5ad698f9ff); - - /** - * @dev The nonce value used for tracking nonces in the contract. - * @notice value is equal to keccak256("@ronin.dpos.gateway.BridgeAdmin.nonce.slot") - 1 - */ - TUint256Slot internal constant NONCE_SLOT = TUint256Slot.wrap(0x92872d32822c9d44b36a2537d3e0d4c46fc4de1ce154ccfaed560a8a58445f1d); + struct BridgeManagerStorage { + /// @notice List of the governors. + /// @dev We do not use EnumerableSet here to maintain identical order of `governors` and `operators`. If `.contains` is needed, use the corresponding weight mapping. + address[] _governors; + address[] _operators; + /// @dev Mapping from address to the governor weight + mapping(address governor => uint96 weight) _governorWeight; + /// @dev Mapping from address to the operator weight. This must always be identical `_governorWeight`. + mapping(address operator => uint96 weight) _operatorWeight; + /// @dev Total weight of all governors / operators. + uint256 _totalWeight; + } - /** - * @dev The total weight value used for storing the cumulative weight in the contract. - * @notice value is equal to keccak256("@ronin.dpos.gateway.BridgeAdmin.totalWeights.slot") - 1 - */ - TUint256Slot internal constant TOTAL_WEIGHTS_SLOT = TUint256Slot.wrap(0x6924fe71b0c8b61aea02ca498b5f53b29bd95726278b1fe4eb791bb24a42644c); + // keccak256(abi.encode(uint256(keccak256("ronin.storage.BridgeManagerStorageLocation")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant $$_BridgeManagerStorageLocation = 0xc648703095712c0419b6431ae642c061f0a105ac2d7c3d9604061ef4ebc38300; /** * @inheritdoc IBridgeManager */ bytes32 public immutable DOMAIN_SEPARATOR; + function _getBridgeManagerStorage() private pure returns (BridgeManagerStorage storage $) { + assembly { + $.slot := $$_BridgeManagerStorageLocation + } + } + modifier onlyGovernor() virtual { _requireGovernor(msg.sender); _; @@ -67,10 +58,7 @@ abstract contract BridgeManager is IQuorum, IBridgeManager, BridgeManagerCallbac address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights - ) payable BridgeManagerCallbackRegister(callbackRegisters) { - NONCE_SLOT.store(1); - - _setThreshold(num, denom); + ) payable BridgeManagerQuorum(num, denom) BridgeManagerCallbackRegister(callbackRegisters) { _setContract(ContractType.BRIDGE, bridgeContract); DOMAIN_SEPARATOR = keccak256( @@ -85,54 +73,7 @@ abstract contract BridgeManager is IQuorum, IBridgeManager, BridgeManagerCallbac _addBridgeOperators(voteWeights, governors, bridgeOperators); } - /** - * @inheritdoc IBridgeManager - */ - function addBridgeOperators( - uint96[] calldata voteWeights, - address[] calldata governors, - address[] calldata bridgeOperators - ) external onlySelfCall returns (bool[] memory addeds) { - addeds = _addBridgeOperators(voteWeights, governors, bridgeOperators); - } - - /** - * @inheritdoc IBridgeManager - */ - function removeBridgeOperators(address[] calldata bridgeOperators) external onlySelfCall returns (bool[] memory removeds) { - removeds = _removeBridgeOperators(bridgeOperators); - } - - /** - * @inheritdoc IBridgeManager - * @notice This method checks authorization by querying the corresponding operator of the msg.sender and then - * attempts to remove it from the `_bridgeOperatorSet` for gas optimization. In case we allow a governor can leave - * their operator address blank null `address(0)`, consider add authorization check. - */ - function updateBridgeOperator(address newBridgeOperator) external onlyGovernor { - _requireNonZeroAddress(newBridgeOperator); - - // Queries the previous bridge operator - mapping(address => BridgeOperatorInfo) storage _gorvernorToBridgeOperatorInfo = _getGovernorToBridgeOperatorInfo(); - address currentBridgeOperator = _gorvernorToBridgeOperatorInfo[msg.sender].addr; - if (currentBridgeOperator == newBridgeOperator) { - revert ErrBridgeOperatorAlreadyExisted(newBridgeOperator); - } - - // Tries replace the bridge operator - EnumerableSet.AddressSet storage _bridgeOperatorSet = _getBridgeOperatorSet(); - bool updated = _bridgeOperatorSet.remove(currentBridgeOperator) && _bridgeOperatorSet.add(newBridgeOperator); - if (!updated) revert ErrBridgeOperatorUpdateFailed(newBridgeOperator); - - mapping(address => address) storage _governorOf = _getGovernorOf(); - delete _governorOf[currentBridgeOperator]; - _governorOf[newBridgeOperator] = msg.sender; - _gorvernorToBridgeOperatorInfo[msg.sender].addr = newBridgeOperator; - - _notifyRegisters(IBridgeManagerCallback.onBridgeOperatorUpdated.selector, abi.encode(currentBridgeOperator, newBridgeOperator)); - - emit BridgeOperatorUpdated(msg.sender, currentBridgeOperator, newBridgeOperator); - } + // ===================== CONFIG ======================== /** * @inheritdoc IHasContracts @@ -143,17 +84,26 @@ abstract contract BridgeManager is IQuorum, IBridgeManager, BridgeManagerCallbac } /** - * @inheritdoc IQuorum + * @dev Internal function to require that the caller has governor role access. */ - function setThreshold(uint256 numerator, uint256 denominator) external override onlySelfCall returns (uint256, uint256) { - return _setThreshold(numerator, denominator); + function _requireGovernor(address addr) internal view { + if (_getGovernorWeight(addr) == 0) { + revert ErrUnauthorized(msg.sig, RoleAccess.GOVERNOR); + } } + // ===================== WEIGHTS METHOD ======================== + /** * @inheritdoc IBridgeManager */ function getTotalWeight() public view returns (uint256) { - return TOTAL_WEIGHTS_SLOT.load(); + return _totalWeight(); + } + + function _totalWeight() internal view override returns (uint256) { + BridgeManagerStorage storage $ = _getBridgeManagerStorage(); + return $._totalWeight; } /** @@ -164,120 +114,114 @@ abstract contract BridgeManager is IQuorum, IBridgeManager, BridgeManagerCallbac } /** - * @inheritdoc IBridgeManager + * @dev Internal function to get the vote weights of a given array of governors. */ - function getGovernorWeight(address governor) external view returns (uint96 weight) { - weight = _getGovernorWeight(governor); + function _getGovernorWeights(address[] memory governors) internal view returns (uint96[] memory weights) { + BridgeManagerStorage storage $ = _getBridgeManagerStorage(); + uint256 length = governors.length; + weights = new uint96[](length); + + for (uint256 i; i < length; i++) { + weights[i] = $._governorWeight[governors[i]]; + } } /** * @inheritdoc IBridgeManager */ - function sumGovernorsWeight(address[] calldata governors) external view nonDuplicate(governors) returns (uint256 sum) { - sum = _sumGovernorsWeight(governors); + function getGovernorWeight(address governor) external view returns (uint96 weight) { + weight = _getGovernorWeight(governor); } /** - * @inheritdoc IBridgeManager + * @dev Internal function to retrieve the vote weight of a specific governor. */ - function totalBridgeOperator() external view returns (uint256) { - return _getBridgeOperatorSet().length(); + function _getGovernorWeight(address governor) internal view returns (uint96) { + BridgeManagerStorage storage $ = _getBridgeManagerStorage(); + return $._governorWeight[governor]; } /** * @inheritdoc IBridgeManager */ - function isBridgeOperator(address addr) external view returns (bool) { - return _getBridgeOperatorSet().contains(addr); + function sumGovernorsWeight(address[] calldata governors) external view nonDuplicate(governors) returns (uint256 sum) { + sum = _sumGovernorsWeight(governors); } /** - * @inheritdoc IBridgeManager + * @dev Internal function to calculate the sum of vote weights for a given array of governors. + * @param governors The non-duplicated input. */ - function getBridgeOperators() external view returns (address[] memory) { - return _getBridgeOperators(); + function _sumGovernorsWeight(address[] memory governors) internal view nonDuplicate(governors) returns (uint256 sum) { + BridgeManagerStorage storage $ = _getBridgeManagerStorage(); + + for (uint256 i; i < governors.length; i++) { + sum += $._governorWeight[governors[i]]; + } } /** * @inheritdoc IBridgeManager */ - function getGovernors() external view returns (address[] memory) { - return _getGovernors(); + function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint96 weight) { + BridgeManagerStorage storage $ = _getBridgeManagerStorage(); + + return $._operatorWeight[bridgeOperator]; } /** - * @inheritdoc IBridgeManager + * @inheritdoc IQuorum */ - function getBridgeOperatorOf(address[] memory governors) public view returns (address[] memory bridgeOperators) { - uint256 length = governors.length; - bridgeOperators = new address[](length); + function minimumVoteWeight() public view virtual returns (uint256) { + BridgeManagerStorage storage $ = _getBridgeManagerStorage(); - mapping(address => BridgeOperatorInfo) storage _gorvernorToBridgeOperator = _getGovernorToBridgeOperatorInfo(); - for (uint256 i; i < length; ) { - bridgeOperators[i] = _gorvernorToBridgeOperator[governors[i]].addr; - unchecked { - ++i; - } - } + (uint256 numerator, uint256 denominator) = getThreshold(); + return (numerator * $._totalWeight + denominator - 1) / denominator; } + // ===================== MANAGER CRUD ======================== + /** * @inheritdoc IBridgeManager */ - function getGovernorsOf(address[] calldata bridgeOperators) external view returns (address[] memory governors) { - uint256 length = bridgeOperators.length; - governors = new address[](length); - mapping(address => address) storage _governorOf = _getGovernorOf(); - - for (uint256 i; i < length; ) { - governors[i] = _governorOf[bridgeOperators[i]]; - unchecked { - ++i; - } - } + function addBridgeOperators( + uint96[] calldata voteWeights, + address[] calldata governors, + address[] calldata bridgeOperators + ) external onlySelfCall returns (bool[] memory addeds) { + addeds = _addBridgeOperators(voteWeights, governors, bridgeOperators); } /** * @inheritdoc IBridgeManager */ - function getFullBridgeOperatorInfos() - external - view - returns (address[] memory governors, address[] memory bridgeOperators, uint96[] memory weights) - { - governors = _getGovernors(); - bridgeOperators = getBridgeOperatorOf(governors); - weights = _getGovernorWeights(governors); + function removeBridgeOperators(address[] calldata bridgeOperators) external onlySelfCall returns (bool[] memory removeds) { + removeds = _removeBridgeOperators(bridgeOperators); } /** * @inheritdoc IBridgeManager */ - function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint96 weight) { - mapping(address => address) storage _governorOf = _getGovernorOf(); - mapping(address => BridgeOperatorInfo) storage _governorToBridgeOperatorInfo = _getGovernorToBridgeOperatorInfo(); - weight = _governorToBridgeOperatorInfo[_governorOf[bridgeOperator]].voteWeight; - } + function updateBridgeOperator(address currOperator, address newOperator) external onlyGovernor { + _requireNonZeroAddress(newOperator); - /** - * @inheritdoc IQuorum - */ - function minimumVoteWeight() public view virtual returns (uint256) { - return (NUMERATOR_SLOT.mul(TOTAL_WEIGHTS_SLOT.load()) + DENOMINATOR_SLOT.load() - 1) / DENOMINATOR_SLOT.load(); - } + BridgeManagerStorage storage $ = _getBridgeManagerStorage(); + if (currOperator == newOperator || $._governorWeight[newOperator] > 0 || $._operatorWeight[newOperator] > 0) { + revert ErrBridgeOperatorAlreadyExisted(newOperator); + } - /** - * @inheritdoc IQuorum - */ - function getThreshold() external view virtual returns (uint256 num_, uint256 denom_) { - return (NUMERATOR_SLOT.load(), DENOMINATOR_SLOT.load()); - } + // Query the index of the operator in the array + (address requiredGovernor, uint idx) = _getGovernorOf(currOperator); + if (requiredGovernor != msg.sender) revert ErrGovernorNotMatch(requiredGovernor, msg.sender); - /** - * @inheritdoc IQuorum - */ - function checkThreshold(uint256 _voteWeight) external view virtual returns (bool) { - return _voteWeight * DENOMINATOR_SLOT.load() >= NUMERATOR_SLOT.mul(TOTAL_WEIGHTS_SLOT.load()); + // Replace the bridge operator: (1) change in the array, (2) update weight of two addresses, (3) notify register + $._operators[idx] = newOperator; + $._operatorWeight[newOperator] = $._operatorWeight[currOperator]; + delete $._operatorWeight[currOperator]; + + _notifyRegisters(IBridgeManagerCallback.onBridgeOperatorUpdated.selector, abi.encode(currOperator, newOperator)); + + emit BridgeOperatorUpdated(msg.sender, currOperator, newOperator); } /** @@ -289,63 +233,59 @@ abstract contract BridgeManager is IQuorum, IBridgeManager, BridgeManagerCallbac * - The caller must have the necessary permission to add bridge operators. * - The lengths of `voteWeights`, `governors`, and `bridgeOperators` arrays must be equal. * - * @param voteWeights An array of uint256 values representing the vote weights for each bridge operator. - * @param governors An array of addresses representing the governors for each bridge operator. * @return addeds An array of boolean values indicating whether each bridge operator was successfully added. */ function _addBridgeOperators( uint96[] memory voteWeights, - address[] memory governors, - address[] memory bridgeOperators - ) internal nonDuplicate(governors.extend(bridgeOperators)) returns (bool[] memory addeds) { - uint256 length = bridgeOperators.length; - if (!(length == voteWeights.length && length == governors.length)) revert ErrLengthMismatch(msg.sig); + address[] memory newGovernors, + address[] memory newOperators + ) internal nonDuplicate(newGovernors.extend(newOperators)) returns (bool[] memory addeds) { + BridgeManagerStorage storage $ = _getBridgeManagerStorage(); + + uint256 length = newOperators.length; + if (!(length == voteWeights.length && length == newGovernors.length)) revert ErrLengthMismatch(msg.sig); addeds = new bool[](length); + // simply skip add operations if inputs are empty. if (length == 0) return addeds; - EnumerableSet.AddressSet storage _governorSet = _getGovernorsSet(); - mapping(address => address) storage _governorOf = _getGovernorOf(); - EnumerableSet.AddressSet storage _bridgeOperatorSet = _getBridgeOperatorSet(); - mapping(address => BridgeOperatorInfo) storage _governorToBridgeOperatorInfo = _getGovernorToBridgeOperatorInfo(); - - address governor; - address bridgeOperator; + address iGovernor; + address iOperator; + uint96 iVoteWeight; uint256 accumulatedWeight; - BridgeOperatorInfo memory bridgeOperatorInfo; - for (uint256 i; i < length; ) { - governor = governors[i]; - bridgeOperator = bridgeOperators[i]; + for (uint256 i; i < length; i++) { + iGovernor = newGovernors[i]; + iOperator = newOperators[i]; + iVoteWeight = voteWeights[i]; - _requireNonZeroAddress(governor); - _requireNonZeroAddress(bridgeOperator); - if (voteWeights[i] == 0) revert ErrInvalidVoteWeight(msg.sig); + // Check non-zero inputs + _requireNonZeroAddress(iGovernor); + _requireNonZeroAddress(iOperator); + if (iVoteWeight == 0) revert ErrInvalidVoteWeight(msg.sig); - addeds[i] = !(_governorSet.contains(governor) || - _governorSet.contains(bridgeOperator) || - _bridgeOperatorSet.contains(governor) || - _bridgeOperatorSet.contains(bridgeOperator)); + // Check not yet added operators + addeds[i] = ($._governorWeight[iGovernor] + $._governorWeight[iOperator] + $._operatorWeight[iOperator] + $._operatorWeight[iGovernor]) == 0; + // Only add the valid operator if (addeds[i]) { - _governorSet.add(governor); - _bridgeOperatorSet.add(bridgeOperator); - _governorOf[bridgeOperator] = governor; - bridgeOperatorInfo.addr = bridgeOperator; - accumulatedWeight += bridgeOperatorInfo.voteWeight = voteWeights[i]; - _governorToBridgeOperatorInfo[governor] = bridgeOperatorInfo; - } + // Add governor to list, update governor weight + $._governors.push(iGovernor); + $._governorWeight[iGovernor] = iVoteWeight; - unchecked { - ++i; + // Add operator to list, update governor weight + $._operators.push(iOperator); + $._operatorWeight[iOperator] = iVoteWeight; + + accumulatedWeight += iVoteWeight; } } - TOTAL_WEIGHTS_SLOT.addAssign(accumulatedWeight); + $._totalWeight += accumulatedWeight; - _notifyRegisters(IBridgeManagerCallback.onBridgeOperatorsAdded.selector, abi.encode(bridgeOperators, addeds)); + _notifyRegisters(IBridgeManagerCallback.onBridgeOperatorsAdded.selector, abi.encode(newOperators, addeds)); - emit BridgeOperatorsAdded(addeds, voteWeights, governors, bridgeOperators); + emit BridgeOperatorsAdded(addeds, voteWeights, newGovernors, newOperators); } /** @@ -356,182 +296,170 @@ abstract contract BridgeManager is IQuorum, IBridgeManager, BridgeManagerCallbac * Requirements: * - The caller must have the necessary permission to remove bridge operators. * - * @param bridgeOperators An array of addresses representing the bridge operators to be removed. + * @param removingOperators An array of addresses representing the bridge operators to be removed. * @return removeds An array of boolean values indicating whether each bridge operator was successfully removed. */ - function _removeBridgeOperators(address[] memory bridgeOperators) internal nonDuplicate(bridgeOperators) returns (bool[] memory removeds) { - uint256 length = bridgeOperators.length; + function _removeBridgeOperators(address[] memory removingOperators) internal nonDuplicate(removingOperators) returns (bool[] memory removeds) { + BridgeManagerStorage storage $ = _getBridgeManagerStorage(); + + uint256 length = removingOperators.length; removeds = new bool[](length); + // simply skip remove operations if inputs are empty. if (length == 0) return removeds; - mapping(address => address) storage _governorOf = _getGovernorOf(); - EnumerableSet.AddressSet storage _governorSet = _getGovernorsSet(); - EnumerableSet.AddressSet storage _bridgeOperatorSet = _getBridgeOperatorSet(); - mapping(address => BridgeOperatorInfo) storage _governorToBridgeOperatorInfo = _getGovernorToBridgeOperatorInfo(); - - address governor; - address bridgeOperator; + address iGovernor; + address iOperator; uint256 accumulatedWeight; - BridgeOperatorInfo memory bridgeOperatorInfo; + uint idx; - for (uint256 i; i < length; ) { - bridgeOperator = bridgeOperators[i]; - governor = _governorOf[bridgeOperator]; + for (uint256 i; i < length; i++) { + iOperator = removingOperators[i]; - _requireNonZeroAddress(governor); - _requireNonZeroAddress(bridgeOperator); + // Check non-zero inputs + (iGovernor, idx) = _getGovernorOf(iOperator); + _requireNonZeroAddress(iGovernor); + _requireNonZeroAddress(iOperator); - bridgeOperatorInfo = _governorToBridgeOperatorInfo[governor]; - if (bridgeOperatorInfo.addr != bridgeOperator) revert ErrInvalidArguments(msg.sig); + // Check existing operators + removeds[i] = $._governorWeight[iGovernor] > 0 && $._operatorWeight[iOperator] > 0; - removeds[i] = _bridgeOperatorSet.contains(bridgeOperator) && _governorSet.contains(governor); + // Only remove the valid operator if (removeds[i]) { - _governorSet.remove(governor); - _bridgeOperatorSet.remove(bridgeOperator); + uint removingVoteWeight = $._governorWeight[iGovernor]; - delete _governorOf[bridgeOperator]; - delete _governorToBridgeOperatorInfo[governor]; - accumulatedWeight += bridgeOperatorInfo.voteWeight; - } + // Remove governor from list, update governor weight + uint lastIdx = $._governors.length - 1; + $._governors[idx] = $._governors[lastIdx]; + $._governors.pop(); + delete $._governorWeight[iGovernor]; + + // Remove operator from list, update operator weight + $._operators[idx] = $._operators[lastIdx]; + $._operators.pop(); + delete $._operatorWeight[iOperator]; - unchecked { - ++i; + accumulatedWeight += removingVoteWeight; } } - TOTAL_WEIGHTS_SLOT.subAssign(accumulatedWeight); + $._totalWeight -= accumulatedWeight; - _notifyRegisters(IBridgeManagerCallback.onBridgeOperatorsRemoved.selector, abi.encode(bridgeOperators, removeds)); + _notifyRegisters(IBridgeManagerCallback.onBridgeOperatorsRemoved.selector, abi.encode(removingOperators, removeds)); - emit BridgeOperatorsRemoved(removeds, bridgeOperators); + emit BridgeOperatorsRemoved(removeds, removingOperators); } - /** - * @dev Sets threshold and returns the old one. - * - * Emits the `ThresholdUpdated` event. - * - */ - function _setThreshold(uint256 numerator, uint256 denominator) internal virtual returns (uint256 previousNum, uint256 previousDenom) { - if (numerator > denominator) revert ErrInvalidThreshold(msg.sig); + function _findOperatorInArray(address addr) internal view returns (bool found, uint idx) { + BridgeManagerStorage storage $ = _getBridgeManagerStorage(); - previousNum = NUMERATOR_SLOT.load(); - previousDenom = DENOMINATOR_SLOT.load(); - NUMERATOR_SLOT.store(numerator); - DENOMINATOR_SLOT.store(denominator); + for (uint i; i < $._operators.length; i++) { + if (addr == $._operators[i]) { + return (true, i); + } + } - emit ThresholdUpdated(NONCE_SLOT.postIncrement(), numerator, denominator, previousNum, previousDenom); + return (false, type(uint256).max); } - /** - * @dev Internal function to get all bridge operators. - * @return bridgeOperators An array containing all the registered bridge operator addresses. - */ - function _getBridgeOperators() internal view returns (address[] memory) { - return _getBridgeOperatorSet().values(); + function _findGovernorInArray(address addr) internal view returns (bool found, uint idx) { + BridgeManagerStorage storage $ = _getBridgeManagerStorage(); + + for (uint i; i < $._governors.length; i++) { + if (addr == $._governors[i]) { + return (true, i); + } + } + + return (false, type(uint256).max); } + // ================= MANAGER VIEW METHODS ============= + /** - * @dev Internal function to get all governors. - * @return governors An array containing all the registered governor addresses. + * @inheritdoc IBridgeManager */ - function _getGovernors() internal view returns (address[] memory) { - return _getGovernorsSet().values(); + function totalBridgeOperator() external view returns (uint256) { + BridgeManagerStorage storage $ = _getBridgeManagerStorage(); + return $._operators.length; } /** - * @dev Internal function to get the vote weights of a given array of governors. - * @param governors An array containing the addresses of governors. - * @return weights An array containing the vote weights of the corresponding governors. + * @inheritdoc IBridgeManager */ - function _getGovernorWeights(address[] memory governors) internal view returns (uint96[] memory weights) { - uint256 length = governors.length; - weights = new uint96[](length); - mapping(address => BridgeOperatorInfo) storage _governorToBridgeOperatorInfo = _getGovernorToBridgeOperatorInfo(); - for (uint256 i; i < length; ) { - weights[i] = _governorToBridgeOperatorInfo[governors[i]].voteWeight; - unchecked { - ++i; - } - } + function isBridgeOperator(address addr) external view returns (bool) { + BridgeManagerStorage storage $ = _getBridgeManagerStorage(); + return $._operatorWeight[addr] > 0; } /** - * @dev Internal function to calculate the sum of vote weights for a given array of governors. - * @param governors An array containing the addresses of governors to calculate the sum of vote weights. - * @return sum The total sum of vote weights for the provided governors. - * @notice The input array `governors` must contain unique addresses to avoid duplicate calculations. + * @inheritdoc IBridgeManager */ - function _sumGovernorsWeight(address[] memory governors) internal view nonDuplicate(governors) returns (uint256 sum) { - mapping(address => BridgeOperatorInfo) storage _governorToBridgeOperatorInfo = _getGovernorToBridgeOperatorInfo(); - - for (uint256 i; i < governors.length; ) { - sum += _governorToBridgeOperatorInfo[governors[i]].voteWeight; - - unchecked { - ++i; - } - } + function getBridgeOperators() external view returns (address[] memory) { + BridgeManagerStorage storage $ = _getBridgeManagerStorage(); + return $._operators; } /** - * @dev Internal function to require that the caller has governor role access. - * @param addr The address to check for governor role access. - * @dev If the address does not have governor role access (vote weight is zero), a revert with the corresponding error message is triggered. + * @inheritdoc IBridgeManager */ - function _requireGovernor(address addr) internal view { - if (_getGovernorWeight(addr) == 0) { - revert ErrUnauthorized(msg.sig, RoleAccess.GOVERNOR); - } + function getGovernors() external view returns (address[] memory) { + BridgeManagerStorage storage $ = _getBridgeManagerStorage(); + return $._governors; } /** - * @dev Internal function to retrieve the vote weight of a specific governor. - * @param governor The address of the governor to get the vote weight for. - * @return voteWeight The vote weight of the specified governor. + * @inheritdoc IBridgeManager + * @custom:deprecated Deprecated due to high gas consume in new design. */ - function _getGovernorWeight(address governor) internal view returns (uint96) { - return _getGovernorToBridgeOperatorInfo()[governor].voteWeight; + function getBridgeOperatorOf(address[] memory /*governors*/) external pure returns (address[] memory /*bridgeOperators*/) { + revert("Deprecated method"); } /** - * @dev Internal function to access the address set of bridge operators. - * @return bridgeOperators the storage address set. + * @inheritdoc IBridgeManager */ - function _getBridgeOperatorSet() internal pure returns (EnumerableSet.AddressSet storage bridgeOperators) { - assembly ("memory-safe") { - bridgeOperators.slot := BRIDGE_OPERATOR_SET_SLOT - } + function getOperatorOf(address governor) external view returns (address operator) { + (bool found, uint idx) = _findGovernorInArray(governor); + if (!found) revert ErrGovernorNotFound(governor); + + return _getBridgeManagerStorage()._operators[idx]; } /** - * @dev Internal function to access the address set of bridge operators. - * @return governors the storage address set. + * @inheritdoc IBridgeManager + * @custom:deprecated Deprecated due to high gas consume in new design. */ - function _getGovernorsSet() internal pure returns (EnumerableSet.AddressSet storage governors) { - assembly ("memory-safe") { - governors.slot := GOVERNOR_SET_SLOT - } + function getGovernorsOf(address[] calldata /*bridgeOperators*/) external pure returns (address[] memory /*governors*/) { + revert("Deprecated method"); } /** - * @dev Internal function to access the mapping from governor => BridgeOperatorInfo. - * @return governorToBridgeOperatorInfo the mapping from governor => BridgeOperatorInfo. + * @inheritdoc IBridgeManager */ - function _getGovernorToBridgeOperatorInfo() internal pure returns (mapping(address => BridgeOperatorInfo) storage governorToBridgeOperatorInfo) { - assembly ("memory-safe") { - governorToBridgeOperatorInfo.slot := GOVERNOR_TO_BRIDGE_OPERATOR_INFO_SLOT - } + function getGovernorOf(address operator) external view returns (address governor) { + (governor, ) = _getGovernorOf(operator); + } + + function _getGovernorOf(address operator) internal view returns (address governor, uint idx) { + (bool found, uint foundId) = _findOperatorInArray(operator); + if (!found) revert ErrOperatorNotFound(operator); + + return (_getBridgeManagerStorage()._governors[foundId], foundId); } /** - * @dev Internal function to access the mapping from bridge operator => governor. - * @return governorOf the mapping from bridge operator => governor. + * @inheritdoc IBridgeManager */ - function _getGovernorOf() internal pure returns (mapping(address => address) storage governorOf) { - assembly ("memory-safe") { - governorOf.slot := GOVENOR_OF_SLOT - } + function getFullBridgeOperatorInfos() + external + view + returns (address[] memory governors, address[] memory bridgeOperators, uint96[] memory weights) + { + BridgeManagerStorage storage $ = _getBridgeManagerStorage(); + + governors = $._governors; + bridgeOperators = $._operators; + weights = _getGovernorWeights(governors); } } diff --git a/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol b/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol new file mode 100644 index 00000000..e2cf4504 --- /dev/null +++ b/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol @@ -0,0 +1,76 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.23; + +import { IQuorum } from "../../interfaces/IQuorum.sol"; +import { IdentityGuard } from "../../utils/IdentityGuard.sol"; +import "../../utils/CommonErrors.sol"; + +abstract contract BridgeManagerQuorum is IQuorum, IdentityGuard { + struct BridgeManagerConfigStorage { + uint256 _nonce; + uint256 _numerator; + uint256 _denominator; + } + + // keccak256(abi.encode(uint256(keccak256("ronin.storage.BridgeManagerConfigStorage")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant $$_BridgeManagerConfigStorage = 0xa284664d8adf7d69a916362ec8082a90fd7c59679617cbcde6ef7ac0ead56500; + + function _getBridgeManagerConfigStorage() private pure returns (BridgeManagerConfigStorage storage $) { + assembly { + $.slot := $$_BridgeManagerConfigStorage + } + } + + constructor(uint256 num, uint256 denom) { + BridgeManagerConfigStorage storage $ = _getBridgeManagerConfigStorage(); + $._nonce = 1; + + _setThreshold(num, denom); + } + + /** + * @inheritdoc IQuorum + */ + function setThreshold(uint256 numerator, uint256 denominator) external override onlySelfCall returns (uint256, uint256) { + return _setThreshold(numerator, denominator); + } + + /** + * @inheritdoc IQuorum + */ + function getThreshold() public view virtual returns (uint256 num, uint256 denom) { + BridgeManagerConfigStorage storage $ = _getBridgeManagerConfigStorage(); + return ($._numerator, $._denominator); + } + + /** + * @inheritdoc IQuorum + */ + function checkThreshold(uint256 voteWeight) external view virtual returns (bool) { + BridgeManagerConfigStorage storage $ = _getBridgeManagerConfigStorage(); + + return voteWeight * $._denominator >= $._numerator * _totalWeight(); + } + + /** + * @dev Sets threshold and returns the old one. + * + * Emits the `ThresholdUpdated` event. + * + */ + function _setThreshold(uint256 numerator, uint256 denominator) internal virtual returns (uint256 previousNum, uint256 previousDenom) { + if (numerator > denominator) revert ErrInvalidThreshold(msg.sig); + + BridgeManagerConfigStorage storage $ = _getBridgeManagerConfigStorage(); + + previousNum = $._numerator; + previousDenom = $._denominator; + + $._numerator = numerator; + $._denominator = denominator; + + emit ThresholdUpdated($._nonce++, numerator, denominator, previousNum, previousDenom); + } + + function _totalWeight() internal view virtual returns (uint256); +} diff --git a/src/interfaces/bridge/IBridgeManager.sol b/src/interfaces/bridge/IBridgeManager.sol index c6975b37..ccbe7d16 100644 --- a/src/interfaces/bridge/IBridgeManager.sol +++ b/src/interfaces/bridge/IBridgeManager.sol @@ -8,6 +8,13 @@ import { IBridgeManagerEvents } from "./events/IBridgeManagerEvents.sol"; * @dev The interface for managing bridge operators. */ interface IBridgeManager is IBridgeManagerEvents { + /// @notice Error indicating that cannot find the querying operator + error ErrOperatorNotFound(address operator); + /// @notice Error indicating that cannot find the querying governor + error ErrGovernorNotFound(address governor); + /// @notice Error indicating that the msg.sender is not match the required governor + error ErrGovernorNotMatch(address required, address sender); + /** * @dev The domain separator used for computing hash digests in the contract. */ @@ -51,10 +58,7 @@ interface IBridgeManager is IBridgeManagerEvents { * ``` * */ - function getFullBridgeOperatorInfos() - external - view - returns (address[] memory governors, address[] memory bridgeOperators, uint96[] memory weights); + function getFullBridgeOperatorInfos() external view returns (address[] memory governors, address[] memory bridgeOperators, uint96[] memory weights); /** * @dev Returns total weights of the governor list. @@ -73,20 +77,26 @@ interface IBridgeManager is IBridgeManagerEvents { function getBridgeOperators() external view returns (address[] memory); /** - * @dev Returns an array of bridge operators correspoding to governor addresses. - * @return bridgeOperators_ An array containing the addresses of all bridge operators. + * @dev Returns an array of bridge operators corresponding to governor addresses. */ function getBridgeOperatorOf(address[] calldata gorvernors) external view returns (address[] memory bridgeOperators_); + /** + * @dev Returns the corresponding `operator` of a `governor`. + */ + function getOperatorOf(address governor) external view returns (address operator); + /** * @dev Retrieves the governors corresponding to a given array of bridge operators. - * This external function allows external callers to obtain the governors associated with a given array of bridge operators. - * The function takes an input array `bridgeOperators` containing bridge operator addresses and returns an array of corresponding governors. - * @param bridgeOperators An array of bridge operator addresses for which governors are to be retrieved. - * @return governors An array of addresses representing the governors corresponding to the provided bridge operators. */ function getGovernorsOf(address[] calldata bridgeOperators) external view returns (address[] memory governors); + /** + * @dev Returns the corresponding `governor` of a `operator`. + */ + + function getGovernorOf(address operator) external view returns (address governor); + /** * @dev External function to retrieve the vote weight of a specific governor. * @param governor The address of the governor to get the vote weight for. @@ -168,10 +178,13 @@ interface IBridgeManager is IBridgeManagerEvents { function removeBridgeOperators(address[] calldata bridgeOperators) external returns (bool[] memory removeds); /** - * @dev Governor updates their corresponding governor and/or operator address. + * @dev Governor updates their corresponding or operator address. + * * Requirements: - * - The caller must the governor of the operator that is requested changes. - * @param bridgeOperator The address of the bridge operator to update. + * - The caller must be the governor of the operator that is requested changes. + * + * @param currOperator The address of the operator to update. + * @param newOperator The new address of the operator. */ - function updateBridgeOperator(address bridgeOperator) external; + function updateBridgeOperator(address currOperator, address newOperator) external; } diff --git a/src/interfaces/bridge/IBridgeManagerThreshold.sol b/src/interfaces/bridge/IBridgeManagerThreshold.sol new file mode 100644 index 00000000..0238e9b0 --- /dev/null +++ b/src/interfaces/bridge/IBridgeManagerThreshold.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +/** + * @title IBridgeManagerThreshold + */ +interface IBridgeManagerThreshold { + function setThreshold(uint256 num, uint256 denom) external; + + function getThreshold() external view returns (uint256 num, uint256 denom); + + function checkThreshold(uint256 voteWeight) external view returns (bool); +} diff --git a/src/interfaces/bridge/events/IBridgeManagerEvents.sol b/src/interfaces/bridge/events/IBridgeManagerEvents.sol index ef919303..163d5dea 100644 --- a/src/interfaces/bridge/events/IBridgeManagerEvents.sol +++ b/src/interfaces/bridge/events/IBridgeManagerEvents.sol @@ -3,40 +3,27 @@ pragma solidity ^0.8.0; interface IBridgeManagerEvents { /** - * @dev The structure representing information about a bridge operator. - * @param addr The address of the bridge operator. - * @param voteWeight The vote weight assigned to the bridge operator. + * @dev Emitted when new bridge operators are added. */ - struct BridgeOperatorInfo { - address addr; - uint96 voteWeight; - } + event BridgeOperatorsAdded(bool[] statuses, uint96[] voteWeights, address[] governors, address[] bridgeOperators); /** - * @dev Emitted when new bridge operators are added. - * @param statuses The array of boolean values represents whether the corresponding bridge operator is added successfully. - * @param voteWeights The array of vote weights assigned to the added bridge operators. - * @param governors The array of addresses representing the governors associated with the added bridge operators. - * @param bridgeOperators The array of addresses representing the added bridge operators. + * @dev Emitted when a bridge operator is failed to add. */ - event BridgeOperatorsAdded(bool[] statuses, uint96[] voteWeights, address[] governors, address[] bridgeOperators); + event BridgeOperatorAddingFailed(address indexed operator); /** * @dev Emitted when bridge operators are removed. - * @param statuses The array of boolean values representing the statuses of the removed bridge operators. - * @param bridgeOperators The array of addresses representing the removed bridge operators. */ event BridgeOperatorsRemoved(bool[] statuses, address[] bridgeOperators); + /** + * @dev Emitted when a bridge operator is failed to remove. + */ + event BridgeOperatorRemovingFailed(address indexed operator); + /** * @dev Emitted when a bridge operator is updated. - * @param governor The address of the governor initiating the update. - * @param fromBridgeOperator The address of the bridge operator being updated. - * @param toBridgeOperator The updated address of the bridge operator. */ - event BridgeOperatorUpdated( - address indexed governor, - address indexed fromBridgeOperator, - address indexed toBridgeOperator - ); + event BridgeOperatorUpdated(address indexed governor, address indexed fromBridgeOperator, address indexed toBridgeOperator); } From c603ca1dcaab950ab4b7dd452e713a0b58335fbf Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 16 Jan 2024 15:07:56 +0700 Subject: [PATCH 013/180] test(BridgeManager): adapt test as new revert --- .../bridge-manager/BridgeManager.t.sol | 55 +++----- .../concrete/bridge-manager/add/add.t.sol | 100 +++---------- .../bridge-manager/remove/remove.t.sol | 69 ++++----- .../bridge-manager/update/update.t.sol | 26 ++-- .../bridge-manager/BridgeManagerCRUD.t.sol | 132 +++--------------- test/helpers/LibArrayUtils.t.sol | 30 ++++ test/mocks/MockBridgeManager.sol | 10 +- 7 files changed, 148 insertions(+), 274 deletions(-) diff --git a/test/bridge/unit/concrete/bridge-manager/BridgeManager.t.sol b/test/bridge/unit/concrete/bridge-manager/BridgeManager.t.sol index c7adddbb..78ed19fe 100644 --- a/test/bridge/unit/concrete/bridge-manager/BridgeManager.t.sol +++ b/test/bridge/unit/concrete/bridge-manager/BridgeManager.t.sol @@ -16,20 +16,12 @@ contract BridgeManager_Unit_Concrete_Test is Base_Test { modifier assertStateNotChange() { // Get before test state - ( - address[] memory beforeBridgeOperators, - address[] memory beforeGovernors, - uint96[] memory beforeVoteWeights - ) = _getBridgeMembers(); + (address[] memory beforeBridgeOperators, address[] memory beforeGovernors, uint96[] memory beforeVoteWeights) = _getBridgeMembers(); _; // Compare after and before state - ( - address[] memory afterBridgeOperators, - address[] memory afterGovernors, - uint96[] memory afterVoteWeights - ) = _getBridgeMembers(); + (address[] memory afterBridgeOperators, address[] memory afterGovernors, uint96[] memory afterVoteWeights) = _getBridgeMembers(); _assertBridgeMembers({ comparingOperators: beforeBridgeOperators, @@ -70,11 +62,7 @@ contract BridgeManager_Unit_Concrete_Test is Base_Test { _bridgeManager = new MockBridgeManager(bridgeOperators, governors, voteWeights); } - function _generateNewOperators() - internal - pure - returns (address[] memory operators, address[] memory governors, uint96[] memory weights) - { + function _generateNewOperators() internal pure returns (address[] memory operators, address[] memory governors, uint96[] memory weights) { operators = new address[](1); operators[0] = address(0x10003); @@ -100,7 +88,7 @@ contract BridgeManager_Unit_Concrete_Test is Base_Test { ) { if (removingNumber > _totalOperator) { - revert(); + revert("_generateRemovingOperators: exceed number to remove"); } uint remainingNumber = _totalOperator - removingNumber; @@ -129,24 +117,23 @@ contract BridgeManager_Unit_Concrete_Test is Base_Test { return address(0x10010); } - function _getBridgeMembers() - internal - view - returns (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) - { - governors = _bridgeManager.getGovernors(); - bridgeOperators = _bridgeManager.getBridgeOperatorOf(governors); - voteWeights = _bridgeManager.getGovernorWeights(governors); - // (governors, bridgeOperators, voteWeights) = _bridgeManager.getFullBridgeOperatorInfos(); + function _getBridgeMembers() internal view returns (address[] memory operators, address[] memory governors, uint96[] memory weights) { + // (governors, operators, weights) = _bridgeManager.getFullBridgeOperatorInfos(); + address[] memory governors_ = _bridgeManager.getGovernors(); + return _getBridgeMembersByGovernors(governors_); } - function _getBridgeMembers( - address[] memory governors - ) internal view returns (address[] memory bridgeOperators, address[] memory governors_, uint96[] memory voteWeights) { - governors_ = governors; - bridgeOperators = _bridgeManager.getBridgeOperatorOf(governors); - voteWeights = _bridgeManager.getGovernorWeights(governors); - // (governors, bridgeOperators, voteWeights) = _bridgeManager.getFullBridgeOperatorInfos(); + function _getBridgeMembersByGovernors( + address[] memory queryingGovernors + ) internal view returns (address[] memory operators, address[] memory governors, uint96[] memory weights) { + governors = queryingGovernors; + + operators = new address[](queryingGovernors.length); + for (uint i; i < queryingGovernors.length; i++) { + operators[i] = _bridgeManager.getOperatorOf(queryingGovernors[i]); + } + + weights = _bridgeManager.getGovernorWeights(queryingGovernors); } function _assertBridgeMembers( @@ -157,6 +144,10 @@ contract BridgeManager_Unit_Concrete_Test is Base_Test { uint96[] memory comparingWeights, uint96[] memory expectingWeights ) internal { + assertEq(comparingOperators.length, expectingOperators.length, "wrong bridge operators length"); + assertEq(comparingGovernors.length, expectingGovernors.length, "wrong governors length"); + assertEq(comparingWeights.length, expectingWeights.length, "wrong weights length"); + assertEq(comparingOperators, expectingOperators, "wrong bridge operators"); assertEq(comparingGovernors, expectingGovernors, "wrong governors"); assertEq(comparingWeights, expectingWeights, "wrong weights"); diff --git a/test/bridge/unit/concrete/bridge-manager/add/add.t.sol b/test/bridge/unit/concrete/bridge-manager/add/add.t.sol index ec51cbcd..fe92ff02 100644 --- a/test/bridge/unit/concrete/bridge-manager/add/add.t.sol +++ b/test/bridge/unit/concrete/bridge-manager/add/add.t.sol @@ -4,6 +4,8 @@ pragma solidity >=0.8.17 <0.9.0; import { console2 } from "forge-std/console2.sol"; import { StdStyle } from "forge-std/StdStyle.sol"; +import { LibArrayUtils } from "@ronin/test/helpers/LibArrayUtils.t.sol"; + import "@ronin/contracts/utils/CommonErrors.sol"; import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; @@ -17,11 +19,7 @@ contract Add_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { function test_RevertWhen_NotSelfCall() external { // Prepare data - ( - address[] memory addingOperators, - address[] memory addingGovernors, - uint96[] memory addingWeights - ) = _generateNewOperators(); + (address[] memory addingOperators, address[] memory addingGovernors, uint96[] memory addingWeights) = _generateNewOperators(); // Make the caller not self-call. changePrank({ msgSender: _bridgeOperators[0] }); @@ -33,11 +31,7 @@ contract Add_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { function test_RevertWhen_ThreeInputArrayLengthMismatch() external { // Prepare data - ( - address[] memory addingOperators, - address[] memory addingGovernors, - uint96[] memory addingWeights - ) = _generateNewOperators(); + (address[] memory addingOperators, address[] memory addingGovernors, uint96[] memory addingWeights) = _generateNewOperators(); uint length = addingOperators.length; @@ -64,11 +58,7 @@ contract Add_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { function test_RevertWhen_VoteWeightIsZero() external { // Prepare data - ( - address[] memory addingOperators, - address[] memory addingGovernors, - uint96[] memory addingWeights - ) = _generateNewOperators(); + (address[] memory addingOperators, address[] memory addingGovernors, uint96[] memory addingWeights) = _generateNewOperators(); addingWeights[0] = 0; vm.expectRevert(abi.encodeWithSelector(ErrInvalidVoteWeight.selector, IBridgeManager.addBridgeOperators.selector)); @@ -77,11 +67,7 @@ contract Add_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { function test_RevertWhen_BridgeOperatorAddressIsZero() external { // Prepare data - ( - address[] memory addingOperators, - address[] memory addingGovernors, - uint96[] memory addingWeights - ) = _generateNewOperators(); + (address[] memory addingOperators, address[] memory addingGovernors, uint96[] memory addingWeights) = _generateNewOperators(); addingOperators[0] = address(0); vm.expectRevert(abi.encodeWithSelector(ErrZeroAddress.selector, IBridgeManager.addBridgeOperators.selector)); @@ -90,11 +76,7 @@ contract Add_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { function test_RevertWhen_GovernorAddressIsZero() external { // Prepare data - ( - address[] memory addingOperators, - address[] memory addingGovernors, - uint96[] memory addingWeights - ) = _generateNewOperators(); + (address[] memory addingOperators, address[] memory addingGovernors, uint96[] memory addingWeights) = _generateNewOperators(); addingGovernors[0] = address(0); vm.expectRevert(abi.encodeWithSelector(ErrZeroAddress.selector, IBridgeManager.addBridgeOperators.selector)); @@ -102,11 +84,7 @@ contract Add_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { } function test_AddOperators_DuplicatedGovernor() external assertStateNotChange { - ( - address[] memory addingOperators, - address[] memory addingGovernors, - uint96[] memory addingWeights - ) = _generateNewOperators(); + (address[] memory addingOperators, address[] memory addingGovernors, uint96[] memory addingWeights) = _generateNewOperators(); addingGovernors[0] = _governors[0]; bool[] memory addeds = _bridgeManager.addBridgeOperators(addingWeights, addingGovernors, addingOperators); @@ -116,11 +94,7 @@ contract Add_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { } function test_AddOperators_DuplicatedBridgeOperator() external assertStateNotChange { - ( - address[] memory addingOperators, - address[] memory addingGovernors, - uint96[] memory addingWeights - ) = _generateNewOperators(); + (address[] memory addingOperators, address[] memory addingGovernors, uint96[] memory addingWeights) = _generateNewOperators(); addingOperators[0] = _bridgeOperators[0]; bool[] memory addeds = _bridgeManager.addBridgeOperators(addingWeights, addingGovernors, addingOperators); @@ -130,11 +104,7 @@ contract Add_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { } function test_AddOperators_DuplicatedGovernorWithExistedBridgeOperator() external assertStateNotChange { - ( - address[] memory addingOperators, - address[] memory addingGovernors, - uint96[] memory addingWeights - ) = _generateNewOperators(); + (address[] memory addingOperators, address[] memory addingGovernors, uint96[] memory addingWeights) = _generateNewOperators(); addingGovernors[0] = _bridgeOperators[0]; bool[] memory addeds = _bridgeManager.addBridgeOperators(addingWeights, addingGovernors, addingOperators); @@ -144,11 +114,7 @@ contract Add_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { } function test_AddOperators_DuplicatedBridgeOperatorWithExistedGovernor() external assertStateNotChange { - ( - address[] memory addingOperators, - address[] memory addingGovernors, - uint96[] memory addingWeights - ) = _generateNewOperators(); + (address[] memory addingOperators, address[] memory addingGovernors, uint96[] memory addingWeights) = _generateNewOperators(); addingOperators[0] = _governors[0]; bool[] memory addeds = _bridgeManager.addBridgeOperators(addingWeights, addingGovernors, addingOperators); @@ -159,17 +125,8 @@ contract Add_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { function test_AddOperators_AllInfoIsValid() external { // Get before test state - ( - address[] memory beforeBridgeOperators, - address[] memory beforeGovernors, - uint96[] memory beforeVoteWeights - ) = _getBridgeMembers(); - - ( - address[] memory addingOperators, - address[] memory addingGovernors, - uint96[] memory addingWeights - ) = _generateNewOperators(); + (address[] memory beforeBridgeOperators, address[] memory beforeGovernors, uint96[] memory beforeVoteWeights) = _getBridgeMembers(); + (address[] memory addingOperators, address[] memory addingGovernors, uint96[] memory addingWeights) = _generateNewOperators(); bool[] memory addeds = _bridgeManager.addBridgeOperators(addingWeights, addingGovernors, addingOperators); bool[] memory expectedAddeds = new bool[](1); @@ -177,31 +134,20 @@ contract Add_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { assertEq(addeds, expectedAddeds); // Compare after and before state - ( - address[] memory afterBridgeOperators, - address[] memory afterGovernors, - uint96[] memory afterVoteWeights - ) = _getBridgeMembers(); + (address[] memory afterBridgeOperators, address[] memory afterGovernors, uint96[] memory afterVoteWeights) = _getBridgeMembers(); _totalWeight += addingWeights[0]; - uint extendedLength = beforeBridgeOperators.length + 1; - assembly { - mstore(beforeBridgeOperators, extendedLength) - mstore(beforeGovernors, extendedLength) - mstore(beforeVoteWeights, extendedLength) - } - - beforeBridgeOperators[3] = addingOperators[0]; - beforeGovernors[3] = addingGovernors[0]; - beforeVoteWeights[3] = addingWeights[0]; + address[] memory expectingOperators = LibArrayUtils.concat(beforeBridgeOperators, addingOperators); + address[] memory expectingGovernors = LibArrayUtils.concat(beforeGovernors, addingGovernors); + uint96[] memory expectingWeights = LibArrayUtils.concat(beforeVoteWeights, addingWeights); _assertBridgeMembers({ - comparingOperators: beforeBridgeOperators, - comparingGovernors: beforeGovernors, - comparingWeights: beforeVoteWeights, - expectingOperators: afterBridgeOperators, - expectingGovernors: afterGovernors, - expectingWeights: afterVoteWeights + comparingOperators: afterBridgeOperators, + comparingGovernors: afterGovernors, + comparingWeights: afterVoteWeights, + expectingOperators: expectingOperators, + expectingGovernors: expectingGovernors, + expectingWeights: expectingWeights }); assertEq(_bridgeManager.getTotalWeight(), _totalWeight); } diff --git a/test/bridge/unit/concrete/bridge-manager/remove/remove.t.sol b/test/bridge/unit/concrete/bridge-manager/remove/remove.t.sol index 3b971574..96318586 100644 --- a/test/bridge/unit/concrete/bridge-manager/remove/remove.t.sol +++ b/test/bridge/unit/concrete/bridge-manager/remove/remove.t.sol @@ -33,7 +33,7 @@ contract Remove_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { function test_RevertWhen_RemoveOperator_OneAddress_AddressNotOperator() external { address[] memory removingOperators = wrapAddress(_governors[0]); - vm.expectRevert(abi.encodeWithSelector(ErrZeroAddress.selector, IBridgeManager.removeBridgeOperators.selector)); + vm.expectRevert(abi.encodeWithSelector(IBridgeManager.ErrOperatorNotFound.selector, removingOperators[0])); _bridgeManager.removeBridgeOperators(removingOperators); } @@ -54,19 +54,17 @@ contract Remove_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { assertEq(_bridgeManager.totalBridgeOperator(), _bridgeOperators.length - 1, "wrong total bridge operator"); assertEq(_bridgeManager.getTotalWeight(), _totalWeight - removingWeights[0], "wrong total total weight"); - assertEq( - _bridgeManager.getBridgeOperatorOf(removingGovernors), - wrapAddress(address(0)), - "wrong bridge operator of" - ); - assertEq(_bridgeManager.getGovernorsOf(removingOperators), wrapAddress(address(0)), "wrong governor of"); + + vm.expectRevert(abi.encodeWithSelector(IBridgeManager.ErrGovernorNotFound.selector, removingGovernors[0])); + _bridgeManager.getOperatorOf(removingGovernors[0]); + + vm.expectRevert(abi.encodeWithSelector(IBridgeManager.ErrOperatorNotFound.selector, removingOperators[0])); + _bridgeManager.getGovernorOf(removingOperators[0]); // Compare after and before state - ( - address[] memory afterBridgeOperators, - address[] memory afterGovernors, - uint96[] memory afterVoteWeights - ) = _getBridgeMembers(remainingGovernors); + (address[] memory afterBridgeOperators, address[] memory afterGovernors, uint96[] memory afterVoteWeights) = _getBridgeMembersByGovernors( + remainingGovernors + ); _assertBridgeMembers({ comparingOperators: afterBridgeOperators, @@ -79,27 +77,20 @@ contract Remove_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { } function test_RevertWhen_TwoAddress_Duplicated() external { - ( - address[] memory removingOperators, - address[] memory removingGovernors, - uint96[] memory removingWeights, - , - , - - ) = _generateRemovingOperators(2); + (address[] memory removingOperators, address[] memory removingGovernors, uint96[] memory removingWeights, , , ) = _generateRemovingOperators(2); removingOperators[1] = removingOperators[0]; removingGovernors[1] = removingGovernors[0]; removingWeights[1] = removingWeights[0]; // Run the test. - vm.expectRevert( - abi.encodeWithSelector(AddressArrayUtils.ErrDuplicated.selector, IBridgeManager.removeBridgeOperators.selector) - ); + vm.expectRevert(abi.encodeWithSelector(AddressArrayUtils.ErrDuplicated.selector, IBridgeManager.removeBridgeOperators.selector)); _bridgeManager.removeBridgeOperators(removingOperators); } function test_RemoveOperators_TwoAddress_ThatValid() external { + uint TO_REMOVE_NUM = 2; + ( address[] memory removingOperators, address[] memory removingGovernors, @@ -107,33 +98,33 @@ contract Remove_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { address[] memory remainingOperators, address[] memory remainingGovernors, uint96[] memory remainingWeights - ) = _generateRemovingOperators(2); + ) = _generateRemovingOperators(TO_REMOVE_NUM); bool[] memory removeds = _bridgeManager.removeBridgeOperators(removingOperators); - bool[] memory expectedRemoved = new bool[](2); + bool[] memory expectedRemoved = new bool[](TO_REMOVE_NUM); expectedRemoved[0] = true; expectedRemoved[1] = true; assertEq(removeds, expectedRemoved); - address[] memory zeroAddressArrays = new address[](2); + address[] memory zeroAddressArrays = new address[](TO_REMOVE_NUM); zeroAddressArrays[0] = address(0); zeroAddressArrays[1] = address(0); - assertEq(_bridgeManager.totalBridgeOperator(), _bridgeOperators.length - 2, "wrong total bridge operator"); - assertEq( - _bridgeManager.getTotalWeight(), - _totalWeight - (LibArrayUtils.sum(removingWeights)), - "wrong total total weight" - ); - assertEq(_bridgeManager.getBridgeOperatorOf(removingGovernors), zeroAddressArrays, "wrong bridge operator of"); - assertEq(_bridgeManager.getGovernorsOf(removingOperators), zeroAddressArrays, "wrong governor of"); + assertEq(_bridgeManager.totalBridgeOperator(), _bridgeOperators.length - TO_REMOVE_NUM, "wrong total bridge operator"); + assertEq(_bridgeManager.getTotalWeight(), _totalWeight - (LibArrayUtils.sum(removingWeights)), "wrong total total weight"); + + for (uint i; i < TO_REMOVE_NUM; i++) { + vm.expectRevert(abi.encodeWithSelector(IBridgeManager.ErrGovernorNotFound.selector, removingGovernors[i])); + _bridgeManager.getOperatorOf(removingGovernors[i]); + + vm.expectRevert(abi.encodeWithSelector(IBridgeManager.ErrOperatorNotFound.selector, removingOperators[i])); + _bridgeManager.getGovernorOf(removingOperators[i]); + } // Compare after and before state - ( - address[] memory afterBridgeOperators, - address[] memory afterGovernors, - uint96[] memory afterVoteWeights - ) = _getBridgeMembers(remainingGovernors); + (address[] memory afterBridgeOperators, address[] memory afterGovernors, uint96[] memory afterVoteWeights) = _getBridgeMembersByGovernors( + remainingGovernors + ); _assertBridgeMembers({ comparingOperators: afterBridgeOperators, diff --git a/test/bridge/unit/concrete/bridge-manager/update/update.t.sol b/test/bridge/unit/concrete/bridge-manager/update/update.t.sol index f188ef1e..4b425d79 100644 --- a/test/bridge/unit/concrete/bridge-manager/update/update.t.sol +++ b/test/bridge/unit/concrete/bridge-manager/update/update.t.sol @@ -35,7 +35,7 @@ contract Update_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { RoleAccess.GOVERNOR ) ); - _bridgeManager.updateBridgeOperator(newOperator); + _bridgeManager.updateBridgeOperator(_bridgeOperators[0], newOperator); } function test_RevertWhen_NewOperatorAddressIsZero() external { @@ -43,15 +43,15 @@ contract Update_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { // Run the test. vm.expectRevert(abi.encodeWithSelector(ErrZeroAddress.selector, IBridgeManager.updateBridgeOperator.selector)); - _bridgeManager.updateBridgeOperator(newOperator); + _bridgeManager.updateBridgeOperator(_bridgeOperators[0], newOperator); } function test_RevertWhen_NewOperatorIsExistedInCurrentOperatorList() external { address newOperator = _bridgeOperators[2]; // Run the test. - vm.expectRevert(abi.encodeWithSelector(ErrBridgeOperatorUpdateFailed.selector, newOperator)); - _bridgeManager.updateBridgeOperator(newOperator); + vm.expectRevert(abi.encodeWithSelector(ErrBridgeOperatorAlreadyExisted.selector, newOperator)); + _bridgeManager.updateBridgeOperator(_bridgeOperators[0], newOperator); } function test_RevertWhen_NewOperatorIsExistedInCurrentGovernorList() external { @@ -60,16 +60,16 @@ contract Update_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { // Run the test. vm.expectRevert(abi.encodeWithSelector(ErrZeroAddress.selector, IBridgeManager.updateBridgeOperator.selector)); // TODO: fix error sig here - _bridgeManager.updateBridgeOperator(newOperator); + _bridgeManager.updateBridgeOperator(_bridgeOperators[0], newOperator); } function test_RevertWhen_NewOperatorIsTheSameWithPreviousOperator() external { - address prevOperator = unwrapAddress(_bridgeManager.getBridgeOperatorOf(wrapAddress(_caller))); + address prevOperator = _bridgeManager.getOperatorOf(_caller); address newOperator = prevOperator; // Run the test. vm.expectRevert(abi.encodeWithSelector(ErrBridgeOperatorAlreadyExisted.selector, prevOperator)); - _bridgeManager.updateBridgeOperator(newOperator); + _bridgeManager.updateBridgeOperator(_bridgeOperators[0], newOperator); } function test_UpdateOperators_NewOperatorIsValid() external { @@ -81,7 +81,7 @@ contract Update_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { ) = _getBridgeMembers(); // Prepare data. - address prevOperator = unwrapAddress(_bridgeManager.getBridgeOperatorOf(wrapAddress(_caller))); + address prevOperator = _bridgeManager.getOperatorOf(_caller); address newOperator = _generateBridgeOperatorAddressToUpdate(); // Run the test @@ -90,7 +90,7 @@ contract Update_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { vm.expectEmit({ emitter: address(_bridgeManager) }); emit BridgeOperatorUpdated(_caller, prevOperator, newOperator); - _bridgeManager.updateBridgeOperator(newOperator); + _bridgeManager.updateBridgeOperator(_bridgeOperators[0], newOperator); // Get after test state ( @@ -111,8 +111,10 @@ contract Update_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { }); // it should remove the old operator - assertEq(_bridgeManager.getBridgeOperatorOf(wrapAddress(_caller)), wrapAddress(newOperator)); - assertEq(_bridgeManager.getGovernorsOf(wrapAddress(newOperator)), wrapAddress(_caller)); - assertEq(_bridgeManager.getGovernorsOf(wrapAddress(prevOperator)), wrapAddress(address(0))); + assertEq(_bridgeManager.getOperatorOf(_caller), newOperator); + assertEq(_bridgeManager.getGovernorOf(newOperator), _caller); + + vm.expectRevert(abi.encodeWithSelector(IBridgeManager.ErrOperatorNotFound.selector, prevOperator)); + _bridgeManager.getGovernorOf(prevOperator); } } diff --git a/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol b/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol index 5f50b52e..e8ed23f0 100644 --- a/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol +++ b/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol @@ -38,7 +38,7 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { for (uint256 i = 1; i < bridgeOperators.length; ++i) { lastOperator = bridgeOperators[i]; - bridgeManager.updateBridgeOperator(lastOperator); + bridgeManager.updateBridgeOperator(bridgeOperators[0], lastOperator); vm.expectRevert(abi.encodeWithSelector(ErrBridgeOperatorUpdateFailed.selector, lastOperator)); } @@ -57,20 +57,10 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { ) external virtual { vm.assume(caller != _bridgeManager); - (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs( - r1, - r2, - r3, - numBridgeOperators - ); + (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs(r1, r2, r3, numBridgeOperators); vm.expectRevert( - abi.encodeWithSelector( - ErrUnexpectedInternalCall.selector, - IBridgeManager.addBridgeOperators.selector, - ContractType.BRIDGE, - caller - ) + abi.encodeWithSelector(ErrUnexpectedInternalCall.selector, IBridgeManager.addBridgeOperators.selector, ContractType.BRIDGE, caller) ); _addBridgeOperators(caller, _bridgeManager, voteWeights, governors, bridgeOperators); @@ -79,26 +69,10 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { /** * @notice Checks whether bridge contract can add bridge operators. */ - function test_AddBridgeOperators_CallerIsBridgeAdminOperator( - uint256 r1, - uint256 r2, - uint256 r3, - uint256 numBridgeOperators - ) external virtual { - (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs( - r1, - r2, - r3, - numBridgeOperators - ); + function test_AddBridgeOperators_CallerIsBridgeAdminOperator(uint256 r1, uint256 r2, uint256 r3, uint256 numBridgeOperators) external virtual { + (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs(r1, r2, r3, numBridgeOperators); - IBridgeManager bridgeManager = _addBridgeOperators( - _bridgeManager, - _bridgeManager, - voteWeights, - governors, - bridgeOperators - ); + IBridgeManager bridgeManager = _addBridgeOperators(_bridgeManager, _bridgeManager, voteWeights, governors, bridgeOperators); _invariantTest(bridgeManager, voteWeights, governors, bridgeOperators); } @@ -107,12 +81,7 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { * @notice Checks whether bridge contract can add bridge operators * when governors, operators or vote weight contains null or duplicated. */ - function testFail_AddBridgeOperators_NullOrDuplicateInputs( - uint256 r1, - uint256 r2, - uint256 r3, - uint256 numBridgeOperators - ) external virtual { + function testFail_AddBridgeOperators_NullOrDuplicateInputs(uint256 r1, uint256 r2, uint256 r3, uint256 numBridgeOperators) external virtual { ( bool nullifyOrDuplicate, uint256 modifyTimes, @@ -125,16 +94,12 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { if (modifiedInputIdx == uint8(InputIndex.VoteWeights)) { // allow duplicate vote weights vm.assume(nullifyOrDuplicate); - vm.expectRevert( - abi.encodeWithSelector(ErrInvalidVoteWeight.selector, IBridgeManager.addBridgeOperators.selector) - ); + vm.expectRevert(abi.encodeWithSelector(ErrInvalidVoteWeight.selector, IBridgeManager.addBridgeOperators.selector)); } else { if (modifyTimes == 1) { vm.expectRevert(abi.encodeWithSelector(ErrZeroAddress.selector, IBridgeManager.addBridgeOperators.selector)); } else { - vm.expectRevert( - abi.encodeWithSelector(AddressArrayUtils.ErrDuplicated.selector, IBridgeManager.addBridgeOperators.selector) - ); + vm.expectRevert(abi.encodeWithSelector(AddressArrayUtils.ErrDuplicated.selector, IBridgeManager.addBridgeOperators.selector)); } } @@ -144,26 +109,10 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { /** * @notice Checks whether bridge contract can remove bridge operators. */ - function test_RemoveBridgeOperators_CallerIsBridgeContract( - uint256 r1, - uint256 r2, - uint256 r3, - uint16 numBridgeOperators - ) external virtual { - (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs( - r1, - r2, - r3, - numBridgeOperators - ); + function test_RemoveBridgeOperators_CallerIsBridgeContract(uint256 r1, uint256 r2, uint256 r3, uint16 numBridgeOperators) external virtual { + (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs(r1, r2, r3, numBridgeOperators); - IBridgeManager bridgeManager = _addBridgeOperators( - _bridgeManager, - _bridgeManager, - voteWeights, - governors, - bridgeOperators - ); + IBridgeManager bridgeManager = _addBridgeOperators(_bridgeManager, _bridgeManager, voteWeights, governors, bridgeOperators); uint256 removeAmount = _randomize(voteWeights.length, 1, voteWeights.length); uint256 tailIdx = voteWeights.length - 1; @@ -206,28 +155,13 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { /** * @notice Checks whether governor can update their bridge operator address. */ - function test_UpdateBridgeOperator_CallerIsGovernor( - uint256 r1, - uint256 r2, - uint256 r3, - uint16 numBridgeOperators - ) external virtual { - (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs( - r1, - r2, - r3, - numBridgeOperators - ); - IBridgeManager bridgeManager = _addBridgeOperators( - _bridgeManager, - _bridgeManager, - voteWeights, - governors, - bridgeOperators - ); + function test_UpdateBridgeOperator_CallerIsGovernor(uint256 r1, uint256 r2, uint256 r3, uint16 numBridgeOperators) external virtual { + (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs(r1, r2, r3, numBridgeOperators); + IBridgeManager bridgeManager = _addBridgeOperators(_bridgeManager, _bridgeManager, voteWeights, governors, bridgeOperators); uint256 randomSeed = _randomize(_triShuffle(r1, r2, r3), 0, voteWeights.length - 1); address randomGovernor = governors[randomSeed]; + address correspondingOperator = bridgeOperators[randomSeed]; address newBridgeOperator = makeAddr("NEW_BRIDGE_OPERATOR"); vm.deal(newBridgeOperator, 1 ether); @@ -236,7 +170,7 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { bool[] memory statuses = new bool[](1); statuses[0] = true; emit BridgeOperatorUpdated(randomGovernor, bridgeOperators[randomSeed], newBridgeOperator); - bridgeManager.updateBridgeOperator(newBridgeOperator); + bridgeManager.updateBridgeOperator(correspondingOperator, newBridgeOperator); // swap and pop bridgeOperators[randomSeed] = bridgeOperators[bridgeOperators.length - 1]; @@ -248,25 +182,9 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { /** * @notice Checks whether unauthorized sender can update bridge operator address. */ - function testFail_UpdateBridgeOperator_CallerIsNotGovernor( - uint256 r1, - uint256 r2, - uint256 r3, - uint16 numBridgeOperators - ) external virtual { - (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs( - r1, - r2, - r3, - numBridgeOperators - ); - IBridgeManager bridgeManager = _addBridgeOperators( - _bridgeManager, - _bridgeManager, - voteWeights, - governors, - bridgeOperators - ); + function testFail_UpdateBridgeOperator_CallerIsNotGovernor(uint256 r1, uint256 r2, uint256 r3, uint16 numBridgeOperators) external virtual { + (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs(r1, r2, r3, numBridgeOperators); + IBridgeManager bridgeManager = _addBridgeOperators(_bridgeManager, _bridgeManager, voteWeights, governors, bridgeOperators); address unauthorizedCaller = makeAddr("UNAUTHORIZED_CALLER"); for (uint256 i; i < governors.length; ) { @@ -278,15 +196,9 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { address newBridgeOperator = makeAddr("NEW_BRIDGE_OPERATOR"); vm.prank(unauthorizedCaller); - bridgeManager.updateBridgeOperator(newBridgeOperator); + bridgeManager.updateBridgeOperator(bridgeOperators[0], newBridgeOperator); - vm.expectRevert( - abi.encodeWithSelector( - ErrUnauthorized.selector, - IBridgeManager.updateBridgeOperator.selector, - RoleAccess.GOVERNOR - ) - ); + vm.expectRevert(abi.encodeWithSelector(ErrUnauthorized.selector, IBridgeManager.updateBridgeOperator.selector, RoleAccess.GOVERNOR)); } function _setUp() internal virtual { diff --git a/test/helpers/LibArrayUtils.t.sol b/test/helpers/LibArrayUtils.t.sol index c27e74ad..8ca5451a 100644 --- a/test/helpers/LibArrayUtils.t.sol +++ b/test/helpers/LibArrayUtils.t.sol @@ -30,4 +30,34 @@ library LibArrayUtils { return sum(arr256); } + + function concat(uint96[] memory a, uint96[] memory b) internal pure returns (uint96[] memory c) { + c = new uint96[](a.length + b.length); + + uint i; + for (; i < a.length; i++) { + c[i] = a[i]; + } + + for (uint j; j < b.length; ) { + c[i] = b[j]; + ++i; + ++j; + } + } + + function concat(address[] memory a, address[] memory b) internal pure returns (address[] memory c) { + c = new address[](a.length + b.length); + + uint i; + for (; i < a.length; i++) { + c[i] = a[i]; + } + + for (uint j; j < b.length; ) { + c[i] = b[j]; + ++i; + ++j; + } + } } diff --git a/test/mocks/MockBridgeManager.sol b/test/mocks/MockBridgeManager.sol index 7f5f5546..8ff151d7 100644 --- a/test/mocks/MockBridgeManager.sol +++ b/test/mocks/MockBridgeManager.sol @@ -12,9 +12,9 @@ contract MockBridgeManager is IBridgeManager { address[] calldata bridgeOperators ) external returns (bool[] memory addeds) {} - function getBridgeOperatorOf( - address[] calldata gorvernors - ) external view returns (address[] memory bridgeOperators_) {} + function getBridgeOperatorOf(address[] calldata gorvernors) external view returns (address[] memory bridgeOperators_) {} + + function getOperatorOf(address governor) external view returns (address operator) {} function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint96 weight) {} @@ -34,6 +34,8 @@ contract MockBridgeManager is IBridgeManager { function getGovernorsOf(address[] calldata bridgeOperators) external view returns (address[] memory governors) {} + function getGovernorOf(address operator) external view returns (address governor) {} + function getTotalWeight() external view returns (uint256) {} function isBridgeOperator(address addr) external view returns (bool) {} @@ -44,5 +46,5 @@ contract MockBridgeManager is IBridgeManager { function totalBridgeOperator() external view returns (uint256) {} - function updateBridgeOperator(address bridgeOperator) external {} + function updateBridgeOperator(address currOperator, address newOperator) external {} } From 564511b2e6875dec121604a4437f476792b4d392 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 5 Mar 2024 23:57:51 +0700 Subject: [PATCH 014/180] test: fix update operator test after require previous operator --- .../updateOperator.RoninBridgeManager.t.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol index a5d73409..ea8b0e93 100644 --- a/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol @@ -78,7 +78,7 @@ contract UpdateOperator_RoninBridgeManager_Test is BaseIntegration_Test { function _updateBridgeOperator() internal { vm.prank(_param.roninBridgeManager.governors[0]); address previousOperator = _param.roninBridgeManager.bridgeOperators[0]; - _roninBridgeManager.updateBridgeOperator(_newBridgeOperator); + _roninBridgeManager.updateBridgeOperator(previousOperator, _newBridgeOperator); _param.roninBridgeManager.bridgeOperators[0] = _newBridgeOperator; console.log( From 137260176a0e191ee010bae7812666c9376d3b8d Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 16 Jan 2024 15:16:04 +0700 Subject: [PATCH 015/180] fix(BridgeManager): rename Config to Quorum --- .../BridgeManagerQuorum.sol | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol b/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol index e2cf4504..705656d9 100644 --- a/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol +++ b/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol @@ -6,23 +6,23 @@ import { IdentityGuard } from "../../utils/IdentityGuard.sol"; import "../../utils/CommonErrors.sol"; abstract contract BridgeManagerQuorum is IQuorum, IdentityGuard { - struct BridgeManagerConfigStorage { + struct BridgeManagerQuorumStorage { uint256 _nonce; uint256 _numerator; uint256 _denominator; } - // keccak256(abi.encode(uint256(keccak256("ronin.storage.BridgeManagerConfigStorage")) - 1)) & ~bytes32(uint256(0xff)) - bytes32 private constant $$_BridgeManagerConfigStorage = 0xa284664d8adf7d69a916362ec8082a90fd7c59679617cbcde6ef7ac0ead56500; + // keccak256(abi.encode(uint256(keccak256("ronin.storage.BridgeManagerQuorumStorage")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant $$_BridgeManagerQuorumStorage = 0xf3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00; - function _getBridgeManagerConfigStorage() private pure returns (BridgeManagerConfigStorage storage $) { + function _getBridgeManagerQuorumStorage() private pure returns (BridgeManagerQuorumStorage storage $) { assembly { - $.slot := $$_BridgeManagerConfigStorage + $.slot := $$_BridgeManagerQuorumStorage } } constructor(uint256 num, uint256 denom) { - BridgeManagerConfigStorage storage $ = _getBridgeManagerConfigStorage(); + BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage(); $._nonce = 1; _setThreshold(num, denom); @@ -39,7 +39,7 @@ abstract contract BridgeManagerQuorum is IQuorum, IdentityGuard { * @inheritdoc IQuorum */ function getThreshold() public view virtual returns (uint256 num, uint256 denom) { - BridgeManagerConfigStorage storage $ = _getBridgeManagerConfigStorage(); + BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage(); return ($._numerator, $._denominator); } @@ -47,7 +47,7 @@ abstract contract BridgeManagerQuorum is IQuorum, IdentityGuard { * @inheritdoc IQuorum */ function checkThreshold(uint256 voteWeight) external view virtual returns (bool) { - BridgeManagerConfigStorage storage $ = _getBridgeManagerConfigStorage(); + BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage(); return voteWeight * $._denominator >= $._numerator * _totalWeight(); } @@ -61,7 +61,7 @@ abstract contract BridgeManagerQuorum is IQuorum, IdentityGuard { function _setThreshold(uint256 numerator, uint256 denominator) internal virtual returns (uint256 previousNum, uint256 previousDenom) { if (numerator > denominator) revert ErrInvalidThreshold(msg.sig); - BridgeManagerConfigStorage storage $ = _getBridgeManagerConfigStorage(); + BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage(); previousNum = $._numerator; previousDenom = $._denominator; From 63b80c49a9b2ce94094ebde95fadedbafe3077ed Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 22 Jan 2024 13:41:25 +0700 Subject: [PATCH 016/180] test(MainchainGateway): first benchmark with actual config --- foundry.toml | 2 +- script/Migration.s.sol | 18 ++-- test/bridge/integration/BaseIntegration.t.sol | 55 ++++-------- ...l.MainchainGatewayV3.erc20.benchmark.t.sol | 55 ++++++++++++ ....MainchainGatewayV3.native.benchmark.t.sol | 53 ++++++++++++ .../submitWithdrawal.MainchainGatewayV3.t.sol | 86 +++++++++++++++++++ 6 files changed, 222 insertions(+), 47 deletions(-) create mode 100644 test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.erc20.benchmark.t.sol create mode 100644 test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.native.benchmark.t.sol create mode 100644 test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.t.sol diff --git a/foundry.toml b/foundry.toml index da2e032e..06eee488 100644 --- a/foundry.toml +++ b/foundry.toml @@ -25,7 +25,7 @@ evm_version = 'istanbul' evm_version = 'shanghai' [fmt] -line_length = 120 +line_length = 160 tab_width = 2 bracket_spacing = true int_types = 'preserve' diff --git a/script/Migration.s.sol b/script/Migration.s.sol index ecec4fa8..9aa39514 100644 --- a/script/Migration.s.sol +++ b/script/Migration.s.sol @@ -46,7 +46,7 @@ contract Migration is BaseMigrationV2, Utils { param.mockErc721.name = "Mock ERC721"; param.mockErc721.symbol = "M_ERC721"; - uint256 num = 6; + uint256 num = 22; address[] memory operatorAddrs = new address[](num); address[] memory governorAddrs = new address[](num); uint256[] memory operatorPKs = new uint256[](num); @@ -86,14 +86,14 @@ contract Migration is BaseMigrationV2, Utils { param.roninPauseEnforcer.sentries = wrapAddress(makeAddr("pause-enforcer-sentry")); // Ronin Gateway V3 - param.roninGatewayV3.numerator = 3; - param.roninGatewayV3.denominator = 6; - param.roninGatewayV3.trustedNumerator = 2; - param.roninGatewayV3.trustedDenominator = 3; + param.roninGatewayV3.numerator = 7; + param.roninGatewayV3.denominator = 10; + param.roninGatewayV3.trustedNumerator = 9; + param.roninGatewayV3.trustedDenominator = 10; // Ronin Bridge Manager - param.roninBridgeManager.num = 2; - param.roninBridgeManager.denom = 4; + param.roninBridgeManager.num = 7; + param.roninBridgeManager.denom = 10; param.roninBridgeManager.roninChainId = 0; param.roninBridgeManager.roninChainId = block.chainid; param.roninBridgeManager.expiryDuration = 60 * 60 * 24 * 14; // 14 days @@ -114,8 +114,8 @@ contract Migration is BaseMigrationV2, Utils { param.mainchainGatewayV3.denominator = 10; // Mainchain Bridge Manager - param.mainchainBridgeManager.num = 2; - param.mainchainBridgeManager.denom = 4; + param.mainchainBridgeManager.num = 7; + param.mainchainBridgeManager.denom = 10; param.mainchainBridgeManager.roninChainId = 0; param.mainchainBridgeManager.roninChainId = block.chainid; param.mainchainBridgeManager.bridgeOperators = operatorAddrs; diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index b9200abd..37a2a0e0 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -26,6 +26,7 @@ import { Token } from "@ronin/contracts/libraries/Token.sol"; import { IWETH } from "@ronin/contracts/interfaces/IWETH.sol"; import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; import { Ballot } from "@ronin/contracts/libraries/Ballot.sol"; +import { Transfer } from "@ronin/contracts/libraries/Transfer.sol"; import { GlobalCoreGovernance } from "@ronin/contracts/extensions/sequential-governance/GlobalCoreGovernance.sol"; import { IHasContracts } from "@ronin/contracts/interfaces/collections/IHasContracts.sol"; import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; @@ -58,6 +59,8 @@ import { RoninBridgeAdminUtils } from "test/helpers/RoninBridgeAdminUtils.t.sol" import { MainchainBridgeAdminUtils } from "test/helpers/MainchainBridgeAdminUtils.t.sol"; contract BaseIntegration_Test is Base_Test { + using Transfer for Transfer.Receipt; + IGeneralConfig _config; ISharedArgument.SharedParameter _param; @@ -540,47 +543,25 @@ contract BaseIntegration_Test is Base_Test { _config = IGeneralConfig(LibSharedAddress.CONFIG); } - function _wrapUpEpochAndMine() internal { - _wrapUpEpoch(); - // mine a dummy block - vm.roll(block.number + 1); - } - - function _moveToEndPeriodAndWrapUpEpoch() internal { - console.log(">> Move to end period ... "); - uint256 prevPeriod = _validatorSet.currentPeriod(); - - _fastForwardToNextDay(); - _wrapUpEpoch(); - uint256 afterPeriod = _validatorSet.currentPeriod(); - - console.log( - " -> period changes: ", string(abi.encodePacked(vm.toString(prevPeriod), " => ", vm.toString(afterPeriod))) - ); - } - - function _wrapUpEpoch() internal { - console.log(">> Wrap up epoch ... "); - uint256 prevEpoch = _validatorSet.epochOf(block.number); + function _generateSignaturesFor( + Transfer.Receipt memory receipt, + uint256[] memory signerPKs, + bytes32 domainSeparator + ) internal pure returns (SignatureConsumer.Signature[] memory sigs) { + sigs = new SignatureConsumer.Signature[](signerPKs.length); - _validatorSet.wrapUpEpoch(); - vm.roll(block.number + _validatorSet.numberOfBlocksInEpoch()); + for (uint256 i; i < signerPKs.length; i++) { + bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, receipt.hash())); - uint256 afterEpoch = _validatorSet.epochOf(block.number); - console.log( - " -> epoch changes: ", string(abi.encodePacked(vm.toString(prevEpoch), " => ", vm.toString(afterEpoch))) - ); + sigs[i] = _sign(signerPKs[i], digest); + } } - function _fastForwardToNextDay() internal { - uint256 numberOfBlocksInEpoch = _validatorSet.numberOfBlocksInEpoch(); - - uint256 epochEndingBlockNumber = block.number + (numberOfBlocksInEpoch - 1) - (block.number % numberOfBlocksInEpoch); - uint256 nextDayTimestamp = block.timestamp + 1 days; - - // fast forward to next day - vm.warp(nextDayTimestamp); - vm.roll(epochEndingBlockNumber); + function _sign(uint256 pk, bytes32 digest) internal pure returns (SignatureConsumer.Signature memory sig) { + (uint8 v, bytes32 r, bytes32 s) = vm.sign(pk, digest); + sig.v = v; + sig.r = r; + sig.s = s; } function logBridgeTracking() public view { diff --git a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.erc20.benchmark.t.sol b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.erc20.benchmark.t.sol new file mode 100644 index 00000000..cf4311d7 --- /dev/null +++ b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.erc20.benchmark.t.sol @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { console2 as console } from "forge-std/console2.sol"; +import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; +import { Transfer } from "@ronin/contracts/libraries/Transfer.sol"; +import { Token } from "@ronin/contracts/libraries/Token.sol"; +import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; +import "../../BaseIntegration.t.sol"; + +contract SubmitWithdrawal_MainchainGatewayV3_Native_Benchmark_Test is BaseIntegration_Test { + using Transfer for Transfer.Receipt; + + Transfer.Receipt _withdrawalReceipt; + bytes32 _domainSeparator; + + SignatureConsumer.Signature[] _signatures; + + function setUp() public virtual override { + super.setUp(); + _config.switchTo(Network.EthLocal.key()); + + _domainSeparator = _mainchainGatewayV3.DOMAIN_SEPARATOR(); + + _withdrawalReceipt.id = 0; + _withdrawalReceipt.kind = Transfer.Kind.Withdrawal; + _withdrawalReceipt.ronin.addr = makeAddr("requester"); + _withdrawalReceipt.ronin.tokenAddr = address(_roninWeth); + _withdrawalReceipt.ronin.chainId = _param.test.roninChainId; + _withdrawalReceipt.mainchain.addr = makeAddr("recipient"); + _withdrawalReceipt.mainchain.tokenAddr = address(_mainchainWeth); + _withdrawalReceipt.mainchain.chainId = _param.test.mainchainChainId; + _withdrawalReceipt.info.erc = Token.Standard.ERC20; + _withdrawalReceipt.info.id = 0; + _withdrawalReceipt.info.quantity = 0; + + vm.deal(address(_mainchainGatewayV3), 10 ether); + vm.prank(address(_mainchainGatewayV3)); + _mainchainWeth.deposit{ value: 10 ether }(); + + _withdrawalReceipt.info.quantity = 10; + _withdrawalReceipt.ronin.tokenAddr = address(_roninAxs); + _withdrawalReceipt.mainchain.tokenAddr = address(_mainchainAxs); + + SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs, _domainSeparator); + + for (uint i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + } + + function test_benchmark_submitWithdrawal_ERC20() public { + _mainchainGatewayV3.submitWithdrawal(_withdrawalReceipt, _signatures); + } +} diff --git a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.native.benchmark.t.sol b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.native.benchmark.t.sol new file mode 100644 index 00000000..334cfcf3 --- /dev/null +++ b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.native.benchmark.t.sol @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { console2 as console } from "forge-std/console2.sol"; +import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; +import { Transfer } from "@ronin/contracts/libraries/Transfer.sol"; +import { Token } from "@ronin/contracts/libraries/Token.sol"; +import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; +import "../../BaseIntegration.t.sol"; + +contract SubmitWithdrawal_MainchainGatewayV3_Native_Benchmark_Test is BaseIntegration_Test { + using Transfer for Transfer.Receipt; + + Transfer.Receipt _withdrawalReceipt; + bytes32 _domainSeparator; + + SignatureConsumer.Signature[] _signatures; + + function setUp() public virtual override { + super.setUp(); + _config.switchTo(Network.EthLocal.key()); + + _domainSeparator = _mainchainGatewayV3.DOMAIN_SEPARATOR(); + + _withdrawalReceipt.id = 0; + _withdrawalReceipt.kind = Transfer.Kind.Withdrawal; + _withdrawalReceipt.ronin.addr = makeAddr("requester"); + _withdrawalReceipt.ronin.tokenAddr = address(_roninWeth); + _withdrawalReceipt.ronin.chainId = _param.test.roninChainId; + _withdrawalReceipt.mainchain.addr = makeAddr("recipient"); + _withdrawalReceipt.mainchain.tokenAddr = address(_mainchainWeth); + _withdrawalReceipt.mainchain.chainId = _param.test.mainchainChainId; + _withdrawalReceipt.info.erc = Token.Standard.ERC20; + _withdrawalReceipt.info.id = 0; + _withdrawalReceipt.info.quantity = 0; + + vm.deal(address(_mainchainGatewayV3), 10 ether); + vm.prank(address(_mainchainGatewayV3)); + _mainchainWeth.deposit{ value: 10 ether }(); + + _withdrawalReceipt.info.quantity = 10; + + SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs, _domainSeparator); + + for (uint i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + } + + function test_benchmark_submitWithdrawal_Native() public { + _mainchainGatewayV3.submitWithdrawal(_withdrawalReceipt, _signatures); + } +} diff --git a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.t.sol b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.t.sol new file mode 100644 index 00000000..7cfbdf5d --- /dev/null +++ b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.t.sol @@ -0,0 +1,86 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { console2 as console } from "forge-std/console2.sol"; +import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; +import { Transfer } from "@ronin/contracts/libraries/Transfer.sol"; +import { Token } from "@ronin/contracts/libraries/Token.sol"; +import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; +import "../../BaseIntegration.t.sol"; + +contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test { + using Transfer for Transfer.Receipt; + + Transfer.Receipt _withdrawalReceipt; + bytes32 _domainSeparator; + + function setUp() public virtual override { + super.setUp(); + + _domainSeparator = _mainchainGatewayV3.DOMAIN_SEPARATOR(); + + _withdrawalReceipt.id = 0; + _withdrawalReceipt.kind = Transfer.Kind.Withdrawal; + _withdrawalReceipt.ronin.addr = makeAddr("requester"); + _withdrawalReceipt.ronin.tokenAddr = address(_roninWeth); + _withdrawalReceipt.ronin.chainId = block.chainid; + _withdrawalReceipt.mainchain.addr = makeAddr("recipient"); + _withdrawalReceipt.mainchain.tokenAddr = address(_mainchainWeth); + _withdrawalReceipt.mainchain.chainId = block.chainid; + _withdrawalReceipt.info.erc = Token.Standard.ERC20; + _withdrawalReceipt.info.id = 0; + _withdrawalReceipt.info.quantity = 0; + + vm.deal(address(_mainchainGatewayV3), 10 ether); + vm.prank(address(_mainchainGatewayV3)); + _mainchainWeth.deposit{ value: 10 ether }(); + } + + function test_submitWithdrawal_Native() public { + _withdrawalReceipt.info.quantity = 10; + + SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs); + + _mainchainGatewayV3.submitWithdrawal(_withdrawalReceipt, signatures); + } + + function test_submitWithdrawal_ERC20() public { + _withdrawalReceipt.info.quantity = 10; + _withdrawalReceipt.ronin.tokenAddr = address(_roninAxs); + _withdrawalReceipt.mainchain.tokenAddr = address(_mainchainAxs); + + SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs); + + _mainchainGatewayV3.submitWithdrawal(_withdrawalReceipt, signatures); + } + + function testFuzz_submitWithdrawal_ERC20(uint seed) external { + _withdrawalReceipt.ronin.tokenAddr = address(_roninAxs); + _withdrawalReceipt.mainchain.tokenAddr = address(_mainchainAxs); + _withdrawalReceipt.info.quantity = seed % 1_000_000; + + SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs); + + _mainchainGatewayV3.submitWithdrawal(_withdrawalReceipt, signatures); + } + + function _generateSignaturesFor( + Transfer.Receipt memory receipt, + uint256[] memory signerPKs + ) internal view returns (SignatureConsumer.Signature[] memory sigs) { + sigs = new SignatureConsumer.Signature[](signerPKs.length); + + for (uint256 i; i < signerPKs.length; i++) { + bytes32 digest = keccak256(abi.encodePacked("\x19\x01", _domainSeparator, receipt.hash())); + + sigs[i] = _sign(signerPKs[i], digest); + } + } + + function _sign(uint256 pk, bytes32 digest) internal pure returns (SignatureConsumer.Signature memory sig) { + (uint8 v, bytes32 r, bytes32 s) = vm.sign(pk, digest); + sig.v = v; + sig.r = r; + sig.s = s; + } +} From dba72baed053e8ad261c0a062e4795c09b2ceacb Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 6 Mar 2024 00:27:37 +0700 Subject: [PATCH 017/180] test: fix cherry-pick issue --- test/bridge/integration/BaseIntegration.t.sol | 105 ++++++++++-------- ...l.MainchainGatewayV3.erc20.benchmark.t.sol | 7 +- ....MainchainGatewayV3.native.benchmark.t.sol | 5 +- .../submitWithdrawal.MainchainGatewayV3.t.sol | 30 +---- .../submitWithdrawal.MainchainGatewayV3.t.sol | 48 ++------ 5 files changed, 78 insertions(+), 117 deletions(-) diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index 37a2a0e0..b1169ab7 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -26,13 +26,12 @@ import { Token } from "@ronin/contracts/libraries/Token.sol"; import { IWETH } from "@ronin/contracts/interfaces/IWETH.sol"; import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; import { Ballot } from "@ronin/contracts/libraries/Ballot.sol"; -import { Transfer } from "@ronin/contracts/libraries/Transfer.sol"; +import { Transfer as LibTransfer } from "@ronin/contracts/libraries/Transfer.sol"; import { GlobalCoreGovernance } from "@ronin/contracts/extensions/sequential-governance/GlobalCoreGovernance.sol"; import { IHasContracts } from "@ronin/contracts/interfaces/collections/IHasContracts.sol"; import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; import { TransparentUpgradeableProxyV2 } from "@ronin/contracts/extensions/TransparentUpgradeableProxyV2.sol"; -import { MockValidatorContract_OnlyTiming_ForHardhatTest } from - "@ronin/contracts/mocks/ronin/MockValidatorContract_OnlyTiming_ForHardhatTest.sol"; +import { MockValidatorContract_OnlyTiming_ForHardhatTest } from "@ronin/contracts/mocks/ronin/MockValidatorContract_OnlyTiming_ForHardhatTest.sol"; import { PauseEnforcer } from "@ronin/contracts/ronin/gateway/PauseEnforcer.sol"; import { IPauseTarget } from "@ronin/contracts/interfaces/IPauseTarget.sol"; import { GatewayV3 } from "@ronin/contracts/extensions/GatewayV3.sol"; @@ -59,7 +58,7 @@ import { RoninBridgeAdminUtils } from "test/helpers/RoninBridgeAdminUtils.t.sol" import { MainchainBridgeAdminUtils } from "test/helpers/MainchainBridgeAdminUtils.t.sol"; contract BaseIntegration_Test is Base_Test { - using Transfer for Transfer.Receipt; + using LibTransfer for LibTransfer.Receipt; IGeneralConfig _config; ISharedArgument.SharedParameter _param; @@ -127,8 +126,7 @@ contract BaseIntegration_Test is Base_Test { _roninMockERC721 = new MockERC721Deploy().run(); _param = ISharedArgument(LibSharedAddress.CONFIG).sharedArguments(); - _roninProposalUtils = - new RoninBridgeAdminUtils(_param.test.governorPKs, _roninBridgeManager, _param.roninBridgeManager.governors[0]); + _roninProposalUtils = new RoninBridgeAdminUtils(_param.test.governorPKs, _roninBridgeManager, _param.roninBridgeManager.governors[0]); _validatorSet = new MockValidatorContract_OnlyTiming_ForHardhatTest(_param.test.numberOfBlocksInEpoch); } @@ -144,9 +142,7 @@ contract BaseIntegration_Test is Base_Test { _mainchainMockERC721 = new MockERC721Deploy().run(); _param = ISharedArgument(LibSharedAddress.CONFIG).sharedArguments(); - _mainchainProposalUtils = new MainchainBridgeAdminUtils( - _param.test.governorPKs, _mainchainBridgeManager, _param.mainchainBridgeManager.governors[0] - ); + _mainchainProposalUtils = new MainchainBridgeAdminUtils(_param.test.governorPKs, _mainchainBridgeManager, _param.mainchainBridgeManager.governors[0]); } function _initializeRonin() internal { @@ -178,12 +174,7 @@ contract BaseIntegration_Test is Base_Test { ISharedArgument.BridgeRewardParam memory param = _param.bridgeReward; _bridgeReward.initialize( - param.bridgeManagerContract, - param.bridgeTrackingContract, - param.bridgeSlashContract, - param.validatorSetContract, - param.dposGA, - param.rewardPerPeriod + param.bridgeManagerContract, param.bridgeTrackingContract, param.bridgeSlashContract, param.validatorSetContract, param.dposGA, param.rewardPerPeriod ); vm.prank(_param.test.dposGA); @@ -199,9 +190,7 @@ contract BaseIntegration_Test is Base_Test { _bridgeTracking.initialize(param.bridgeContract, param.validatorContract, param.startedAtBlock); // _bridgeTracking.initializeV2(); NOT INITIALIZE V2 - _bridgeTracking.initializeV3( - address(_roninBridgeManager), address(_bridgeSlash), address(_bridgeReward), _param.test.dposGA - ); + _bridgeTracking.initializeV3(address(_roninBridgeManager), address(_bridgeSlash), address(_bridgeReward), _param.test.dposGA); vm.prank(_param.test.dposGA); _bridgeTracking.initializeREP2(); } @@ -214,9 +203,7 @@ contract BaseIntegration_Test is Base_Test { ISharedArgument.BridgeSlashParam memory param = _param.bridgeSlash; - _bridgeSlash.initialize( - param.validatorContract, param.bridgeManagerContract, param.bridgeTrackingContract, param.dposGA - ); + _bridgeSlash.initialize(param.validatorContract, param.bridgeManagerContract, param.bridgeTrackingContract, param.dposGA); vm.prank(_param.test.dposGA); _bridgeSlash.initializeREP2(); @@ -308,8 +295,7 @@ contract BaseIntegration_Test is Base_Test { nonce: _roninBridgeManager.round(0) + 1 }); - SignatureConsumer.Signature[] memory signatures = - _roninProposalUtils.generateSignaturesGlobal(globalProposal, _param.test.governorPKs); + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignaturesGlobal(globalProposal, _param.test.governorPKs); vm.prank(_param.roninBridgeManager.governors[0]); _roninBridgeManager.proposeGlobalProposalStructAndCastVotes(globalProposal, supports_, signatures); @@ -325,8 +311,7 @@ contract BaseIntegration_Test is Base_Test { nonce: _roninBridgeManager.round(0) + 1 }); - SignatureConsumer.Signature[] memory signatures = - _roninProposalUtils.generateSignaturesGlobal(globalProposal, _param.test.governorPKs); + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignaturesGlobal(globalProposal, _param.test.governorPKs); vm.prank(_param.roninBridgeManager.governors[0]); _roninBridgeManager.proposeGlobalProposalStructAndCastVotes(globalProposal, supports_, signatures); @@ -334,8 +319,7 @@ contract BaseIntegration_Test is Base_Test { { // set callback register - bytes memory calldata_ = - abi.encodeCall(IBridgeManagerCallbackRegister.registerCallbacks, (param.callbackRegisters)); + bytes memory calldata_ = abi.encodeCall(IBridgeManagerCallbackRegister.registerCallbacks, (param.callbackRegisters)); GlobalProposal.GlobalProposalDetail memory globalProposal = _roninProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, targetOption: GlobalProposal.TargetOption.BridgeManager, @@ -345,8 +329,7 @@ contract BaseIntegration_Test is Base_Test { nonce: _roninBridgeManager.round(0) + 1 }); - SignatureConsumer.Signature[] memory signatures = - _roninProposalUtils.generateSignaturesGlobal(globalProposal, _param.test.governorPKs); + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignaturesGlobal(globalProposal, _param.test.governorPKs); vm.prank(_param.roninBridgeManager.governors[0]); _roninBridgeManager.proposeGlobalProposalStructAndCastVotes(globalProposal, supports_, signatures); @@ -383,8 +366,7 @@ contract BaseIntegration_Test is Base_Test { nonce: _mainchainBridgeManager.round(0) + 1 }); - SignatureConsumer.Signature[] memory signatures = - _mainchainProposalUtils.generateSignaturesGlobal(globalProposal, _param.test.governorPKs); + SignatureConsumer.Signature[] memory signatures = _mainchainProposalUtils.generateSignaturesGlobal(globalProposal, _param.test.governorPKs); vm.prank(_param.roninBridgeManager.governors[0]); _mainchainBridgeManager.relayGlobalProposal(globalProposal, supports_, signatures); @@ -400,8 +382,7 @@ contract BaseIntegration_Test is Base_Test { nonce: _mainchainBridgeManager.round(0) + 1 }); - SignatureConsumer.Signature[] memory signatures = - _mainchainProposalUtils.generateSignaturesGlobal(globalProposal, _param.test.governorPKs); + SignatureConsumer.Signature[] memory signatures = _mainchainProposalUtils.generateSignaturesGlobal(globalProposal, _param.test.governorPKs); vm.prank(_param.roninBridgeManager.governors[0]); _mainchainBridgeManager.relayGlobalProposal(globalProposal, supports_, signatures); @@ -409,8 +390,7 @@ contract BaseIntegration_Test is Base_Test { { // set callback register - bytes memory calldata_ = - abi.encodeCall(IBridgeManagerCallbackRegister.registerCallbacks, (param.callbackRegisters)); + bytes memory calldata_ = abi.encodeCall(IBridgeManagerCallbackRegister.registerCallbacks, (param.callbackRegisters)); GlobalProposal.GlobalProposalDetail memory globalProposal = _mainchainProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, targetOption: GlobalProposal.TargetOption.BridgeManager, @@ -420,8 +400,7 @@ contract BaseIntegration_Test is Base_Test { nonce: _mainchainBridgeManager.round(0) + 1 }); - SignatureConsumer.Signature[] memory signatures = - _mainchainProposalUtils.generateSignaturesGlobal(globalProposal, _param.test.governorPKs); + SignatureConsumer.Signature[] memory signatures = _mainchainProposalUtils.generateSignaturesGlobal(globalProposal, _param.test.governorPKs); vm.prank(_param.roninBridgeManager.governors[0]); _mainchainBridgeManager.relayGlobalProposal(globalProposal, supports_, signatures); @@ -483,11 +462,7 @@ contract BaseIntegration_Test is Base_Test { _mainchainPauseEnforcer.initialize(IPauseTarget(param.target), param.admin, param.sentries); } - function _getMainchainAndRoninTokens() - internal - view - returns (address[] memory mainchainTokens, address[] memory roninTokens) - { + function _getMainchainAndRoninTokens() internal view returns (address[] memory mainchainTokens, address[] memory roninTokens) { uint256 tokenNum = 5; mainchainTokens = new address[](tokenNum); roninTokens = new address[](tokenNum); @@ -531,8 +506,7 @@ contract BaseIntegration_Test is Base_Test { } function _configBridgeTrackingForRoninGateway() internal { - bytes memory calldata_ = - abi.encodeCall(IHasContracts.setContract, (ContractType.BRIDGE_TRACKING, address(_bridgeTracking))); + bytes memory calldata_ = abi.encodeCall(IHasContracts.setContract, (ContractType.BRIDGE_TRACKING, address(_bridgeTracking))); _roninProposalUtils.functionDelegateCall(address(_roninGatewayV3), calldata_); } @@ -543,11 +517,50 @@ contract BaseIntegration_Test is Base_Test { _config = IGeneralConfig(LibSharedAddress.CONFIG); } + function _wrapUpEpochAndMine() internal { + _wrapUpEpoch(); + // mine a dummy block + vm.roll(block.number + 1); + } + + function _moveToEndPeriodAndWrapUpEpoch() internal { + console.log(">> Move to end period ... "); + uint256 prevPeriod = _validatorSet.currentPeriod(); + + _fastForwardToNextDay(); + _wrapUpEpoch(); + uint256 afterPeriod = _validatorSet.currentPeriod(); + + console.log(" -> period changes: ", string(abi.encodePacked(vm.toString(prevPeriod), " => ", vm.toString(afterPeriod)))); + } + + function _wrapUpEpoch() internal { + console.log(">> Wrap up epoch ... "); + uint256 prevEpoch = _validatorSet.epochOf(block.number); + + _validatorSet.wrapUpEpoch(); + vm.roll(block.number + _validatorSet.numberOfBlocksInEpoch()); + + uint256 afterEpoch = _validatorSet.epochOf(block.number); + console.log(" -> epoch changes: ", string(abi.encodePacked(vm.toString(prevEpoch), " => ", vm.toString(afterEpoch)))); + } + + function _fastForwardToNextDay() internal { + uint256 numberOfBlocksInEpoch = _validatorSet.numberOfBlocksInEpoch(); + + uint256 epochEndingBlockNumber = block.number + (numberOfBlocksInEpoch - 1) - (block.number % numberOfBlocksInEpoch); + uint256 nextDayTimestamp = block.timestamp + 1 days; + + // fast forward to next day + vm.warp(nextDayTimestamp); + vm.roll(epochEndingBlockNumber); + } + function _generateSignaturesFor( - Transfer.Receipt memory receipt, + LibTransfer.Receipt memory receipt, uint256[] memory signerPKs, bytes32 domainSeparator - ) internal pure returns (SignatureConsumer.Signature[] memory sigs) { + ) internal view returns (SignatureConsumer.Signature[] memory sigs) { sigs = new SignatureConsumer.Signature[](signerPKs.length); for (uint256 i; i < signerPKs.length; i++) { diff --git a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.erc20.benchmark.t.sol b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.erc20.benchmark.t.sol index cf4311d7..dc8d1906 100644 --- a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.erc20.benchmark.t.sol +++ b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.erc20.benchmark.t.sol @@ -8,7 +8,7 @@ import { Token } from "@ronin/contracts/libraries/Token.sol"; import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; import "../../BaseIntegration.t.sol"; -contract SubmitWithdrawal_MainchainGatewayV3_Native_Benchmark_Test is BaseIntegration_Test { +contract SubmitWithdrawal_MainchainGatewayV3_Native_Benchmark_Test is BaseIntegration_Test{ using Transfer for Transfer.Receipt; Transfer.Receipt _withdrawalReceipt; @@ -18,7 +18,6 @@ contract SubmitWithdrawal_MainchainGatewayV3_Native_Benchmark_Test is BaseIntegr function setUp() public virtual override { super.setUp(); - _config.switchTo(Network.EthLocal.key()); _domainSeparator = _mainchainGatewayV3.DOMAIN_SEPARATOR(); @@ -26,10 +25,10 @@ contract SubmitWithdrawal_MainchainGatewayV3_Native_Benchmark_Test is BaseIntegr _withdrawalReceipt.kind = Transfer.Kind.Withdrawal; _withdrawalReceipt.ronin.addr = makeAddr("requester"); _withdrawalReceipt.ronin.tokenAddr = address(_roninWeth); - _withdrawalReceipt.ronin.chainId = _param.test.roninChainId; + _withdrawalReceipt.ronin.chainId = block.chainid; _withdrawalReceipt.mainchain.addr = makeAddr("recipient"); _withdrawalReceipt.mainchain.tokenAddr = address(_mainchainWeth); - _withdrawalReceipt.mainchain.chainId = _param.test.mainchainChainId; + _withdrawalReceipt.mainchain.chainId = block.chainid; _withdrawalReceipt.info.erc = Token.Standard.ERC20; _withdrawalReceipt.info.id = 0; _withdrawalReceipt.info.quantity = 0; diff --git a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.native.benchmark.t.sol b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.native.benchmark.t.sol index 334cfcf3..bb547ed2 100644 --- a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.native.benchmark.t.sol +++ b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.native.benchmark.t.sol @@ -18,7 +18,6 @@ contract SubmitWithdrawal_MainchainGatewayV3_Native_Benchmark_Test is BaseIntegr function setUp() public virtual override { super.setUp(); - _config.switchTo(Network.EthLocal.key()); _domainSeparator = _mainchainGatewayV3.DOMAIN_SEPARATOR(); @@ -26,10 +25,10 @@ contract SubmitWithdrawal_MainchainGatewayV3_Native_Benchmark_Test is BaseIntegr _withdrawalReceipt.kind = Transfer.Kind.Withdrawal; _withdrawalReceipt.ronin.addr = makeAddr("requester"); _withdrawalReceipt.ronin.tokenAddr = address(_roninWeth); - _withdrawalReceipt.ronin.chainId = _param.test.roninChainId; + _withdrawalReceipt.ronin.chainId = block.chainid; _withdrawalReceipt.mainchain.addr = makeAddr("recipient"); _withdrawalReceipt.mainchain.tokenAddr = address(_mainchainWeth); - _withdrawalReceipt.mainchain.chainId = _param.test.mainchainChainId; + _withdrawalReceipt.mainchain.chainId = block.chainid; _withdrawalReceipt.info.erc = Token.Standard.ERC20; _withdrawalReceipt.info.id = 0; _withdrawalReceipt.info.quantity = 0; diff --git a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.t.sol b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.t.sol index 7cfbdf5d..4c30a518 100644 --- a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.t.sol +++ b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.t.sol @@ -8,7 +8,7 @@ import { Token } from "@ronin/contracts/libraries/Token.sol"; import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; import "../../BaseIntegration.t.sol"; -contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test { +contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test{ using Transfer for Transfer.Receipt; Transfer.Receipt _withdrawalReceipt; @@ -39,7 +39,7 @@ contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test { function test_submitWithdrawal_Native() public { _withdrawalReceipt.info.quantity = 10; - SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs); + SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs, _domainSeparator); _mainchainGatewayV3.submitWithdrawal(_withdrawalReceipt, signatures); } @@ -49,7 +49,7 @@ contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test { _withdrawalReceipt.ronin.tokenAddr = address(_roninAxs); _withdrawalReceipt.mainchain.tokenAddr = address(_mainchainAxs); - SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs); + SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs, _domainSeparator); _mainchainGatewayV3.submitWithdrawal(_withdrawalReceipt, signatures); } @@ -59,28 +59,8 @@ contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test { _withdrawalReceipt.mainchain.tokenAddr = address(_mainchainAxs); _withdrawalReceipt.info.quantity = seed % 1_000_000; - SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs); + SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs, _domainSeparator); _mainchainGatewayV3.submitWithdrawal(_withdrawalReceipt, signatures); } - - function _generateSignaturesFor( - Transfer.Receipt memory receipt, - uint256[] memory signerPKs - ) internal view returns (SignatureConsumer.Signature[] memory sigs) { - sigs = new SignatureConsumer.Signature[](signerPKs.length); - - for (uint256 i; i < signerPKs.length; i++) { - bytes32 digest = keccak256(abi.encodePacked("\x19\x01", _domainSeparator, receipt.hash())); - - sigs[i] = _sign(signerPKs[i], digest); - } - } - - function _sign(uint256 pk, bytes32 digest) internal pure returns (SignatureConsumer.Signature memory sig) { - (uint8 v, bytes32 r, bytes32 s) = vm.sign(pk, digest); - sig.v = v; - sig.r = r; - sig.s = s; - } -} + } diff --git a/test/bridge/integration/mainchain-gateway/submitWithdrawal.MainchainGatewayV3.t.sol b/test/bridge/integration/mainchain-gateway/submitWithdrawal.MainchainGatewayV3.t.sol index fd18b7db..d9b1d03a 100644 --- a/test/bridge/integration/mainchain-gateway/submitWithdrawal.MainchainGatewayV3.t.sol +++ b/test/bridge/integration/mainchain-gateway/submitWithdrawal.MainchainGatewayV3.t.sol @@ -52,8 +52,7 @@ contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test { // test withdrawal > should not be able to withdraw without enough signature function test_RevertWhen_NotEnoughSignatures() public { - SignatureConsumer.Signature[] memory signatures = - _generateSignaturesFor(_withdrawalReceipt, wrapUint(_param.test.operatorPKs[0])); + SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(_withdrawalReceipt, wrapUint(_param.test.operatorPKs[0]), _domainSeparator); vm.expectRevert(ErrQueryForInsufficientVoteWeight.selector); @@ -69,8 +68,7 @@ contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test { _param.test.operatorPKs[0] = _param.test.operatorPKs[1]; _param.test.operatorPKs[1] = tempPK; - SignatureConsumer.Signature[] memory signatures = - _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs); + SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs, _domainSeparator); vm.expectRevert(abi.encodeWithSelector(ErrInvalidOrder.selector, IMainchainGatewayV3.submitWithdrawal.selector)); @@ -79,8 +77,7 @@ contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test { // test withdrawal > should be able to withdraw eth function test_WithdrawNative_OnMainchain() public { - SignatureConsumer.Signature[] memory signatures = - _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs); + SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs, _domainSeparator); uint256 balanceBefore = _withdrawalReceipt.mainchain.addr.balance; @@ -97,8 +94,7 @@ contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test { function test_RevertWhen_WithdrawWithSameId() public { test_WithdrawNative_OnMainchain(); - SignatureConsumer.Signature[] memory signatures = - _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs); + SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs, _domainSeparator); vm.expectRevert(ErrQueryForProcessedWithdrawal.selector); @@ -110,8 +106,7 @@ contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test { address sender = makeAddr("sender"); _withdrawalReceipt.mainchain.addr = sender; - SignatureConsumer.Signature[] memory signatures = - _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs); + SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs, _domainSeparator); vm.expectEmit(address(_mainchainGatewayV3)); emit Withdrew(_withdrawalReceipt.hash(), _withdrawalReceipt); @@ -132,8 +127,7 @@ contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test { _withdrawalReceipt.mainchain.tokenAddr = address(_mainchainAxs); _withdrawalReceipt.ronin.tokenAddr = address(_roninAxs); - SignatureConsumer.Signature[] memory signatures = - _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs); + SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs, _domainSeparator); vm.expectEmit(address(_mainchainAxs)); emit IERC20.Transfer(address(_mainchainGatewayV3), recipient, quantity); @@ -158,8 +152,7 @@ contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test { _withdrawalReceipt.mainchain.tokenAddr = address(_mainchainSlp); _withdrawalReceipt.ronin.tokenAddr = address(_roninSlp); - SignatureConsumer.Signature[] memory signatures = - _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs); + SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs, _domainSeparator); vm.expectEmit(address(_mainchainSlp)); emit IERC20.Transfer(address(0), address(_mainchainGatewayV3), quantity); @@ -190,8 +183,7 @@ contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test { _withdrawalReceipt.info.erc = Token.Standard.ERC721; _withdrawalReceipt.info.quantity = 0; - SignatureConsumer.Signature[] memory signatures = - _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs); + SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs, _domainSeparator); vm.expectEmit(address(_mainchainMockERC721)); emit IERC721.Transfer(address(_mainchainGatewayV3), recipient, tokenId); @@ -218,8 +210,7 @@ contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test { _withdrawalReceipt.info.erc = Token.Standard.ERC721; _withdrawalReceipt.info.quantity = 0; - SignatureConsumer.Signature[] memory signatures = - _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs); + SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs, _domainSeparator); vm.expectEmit(address(_mainchainMockERC721)); emit IERC721.Transfer(address(0), recipient, tokenId); @@ -231,25 +222,4 @@ contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test { assertEq(_mainchainMockERC721.ownerOf(tokenId), recipient); } - - function _generateSignaturesFor(LibTransfer.Receipt memory receipt, uint256[] memory signerPKs) - internal - view - returns (SignatureConsumer.Signature[] memory sigs) - { - sigs = new SignatureConsumer.Signature[](signerPKs.length); - - for (uint256 i; i < signerPKs.length; i++) { - bytes32 digest = keccak256(abi.encodePacked("\x19\x01", _domainSeparator, receipt.hash())); - - sigs[i] = _sign(signerPKs[i], digest); - } - } - - function _sign(uint256 pk, bytes32 digest) internal pure returns (SignatureConsumer.Signature memory sig) { - (uint8 v, bytes32 r, bytes32 s) = vm.sign(pk, digest); - sig.v = v; - sig.r = r; - sig.s = s; - } } From 4285236afbad45c0f1af313add83911b11a6f51c Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 6 Mar 2024 00:31:12 +0700 Subject: [PATCH 018/180] test(MainchainGateway): fix setup token in test, mostly threshold --- test/bridge/integration/BaseIntegration.t.sol | 48 +++++++++----- ...l.MainchainGatewayV3.erc20.benchmark.t.sol | 5 -- ....MainchainGatewayV3.native.benchmark.t.sol | 2 - ...al.MainchainGatewayV3.weth.benchmark.t.sol | 66 +++++++++++++++++++ 4 files changed, 96 insertions(+), 25 deletions(-) create mode 100644 test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.weth.benchmark.t.sol diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index b1169ab7..dd6b3e95 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -164,6 +164,22 @@ contract BaseIntegration_Test is Base_Test { _mainchainGatewayV3Initialize(); } + function _getMainchainAndRoninTokens() internal view returns (address[] memory mainchainTokens, address[] memory roninTokens) { + uint256 tokenNum = 4; + mainchainTokens = new address[](tokenNum); + roninTokens = new address[](tokenNum); + + mainchainTokens[0] = address(_mainchainWeth); + mainchainTokens[1] = address(_mainchainAxs); + mainchainTokens[2] = address(_mainchainSlp); + mainchainTokens[3] = address(_mainchainUsdc); + + roninTokens[0] = address(_roninWeth); + roninTokens[1] = address(_roninAxs); + roninTokens[2] = address(_roninSlp); + roninTokens[3] = address(_roninUsdc); + } + function _bridgeRewardInitialize() internal { // Bridge rewards _param.bridgeReward.validatorSetContract = address(_validatorSet); @@ -193,6 +209,8 @@ contract BaseIntegration_Test is Base_Test { _bridgeTracking.initializeV3(address(_roninBridgeManager), address(_bridgeSlash), address(_bridgeReward), _param.test.dposGA); vm.prank(_param.test.dposGA); _bridgeTracking.initializeREP2(); + // _bridgeTracking.initializeV2(); + // _bridgeTracking.initializeV3(address(_roninBridgeManager), address(_bridgeSlash), address(_bridgeReward), _param.test.dposGA); } function _bridgeSlashInitialize() internal { @@ -414,6 +432,17 @@ contract BaseIntegration_Test is Base_Test { uint256[] memory lockedThreshold = new uint256[](tokenNum); uint256[] memory unlockFeePercentages = new uint256[](tokenNum); uint256[] memory dailyWithdrawalLimits = new uint256[](tokenNum); + + highTierThreshold[0] = 10 ether; + lockedThreshold[0] = 20 ether; + unlockFeePercentages[0] = 10_0000; // 10% + dailyWithdrawalLimits[0] = 12 ether; + + highTierThreshold[1] = highTierThreshold[2] = highTierThreshold[3] = 100_000_000; + lockedThreshold[1] = lockedThreshold[2] = lockedThreshold[3] = 200_000_000; + unlockFeePercentages[1] = unlockFeePercentages[2] = unlockFeePercentages[3] = 10_0000; // 10% + dailyWithdrawalLimits[1] = dailyWithdrawalLimits[2] = dailyWithdrawalLimits[3] = 120_000_000; + Token.Standard[] memory standards = new Token.Standard[](tokenNum); for (uint256 i; i < tokenNum; i++) { @@ -436,6 +465,7 @@ contract BaseIntegration_Test is Base_Test { _param.mainchainGatewayV3.thresholds[2] = unlockFeePercentages; _param.mainchainGatewayV3.thresholds[3] = dailyWithdrawalLimits; _param.mainchainGatewayV3.standards = standards; + _param.mainchainGatewayV3.wrappedToken = address(_mainchainWeth); ISharedArgument.MainchainGatewayV3Param memory param = _param.mainchainGatewayV3; @@ -462,24 +492,6 @@ contract BaseIntegration_Test is Base_Test { _mainchainPauseEnforcer.initialize(IPauseTarget(param.target), param.admin, param.sentries); } - function _getMainchainAndRoninTokens() internal view returns (address[] memory mainchainTokens, address[] memory roninTokens) { - uint256 tokenNum = 5; - mainchainTokens = new address[](tokenNum); - roninTokens = new address[](tokenNum); - - mainchainTokens[0] = address(_mainchainWeth); - mainchainTokens[1] = address(_mainchainAxs); - mainchainTokens[2] = address(_mainchainSlp); - mainchainTokens[3] = address(_mainchainUsdc); - mainchainTokens[4] = address(_mainchainMockERC721); - - roninTokens[0] = address(_roninWeth); - roninTokens[1] = address(_roninAxs); - roninTokens[2] = address(_roninSlp); - roninTokens[3] = address(_roninUsdc); - roninTokens[4] = address(_roninMockERC721); - } - function _changeAdminOnRonin() internal { vm.startPrank(_param.test.proxyAdmin); TransparentUpgradeableProxyV2(payable(address(_roninGatewayV3))).changeAdmin(address(_roninBridgeManager)); diff --git a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.erc20.benchmark.t.sol b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.erc20.benchmark.t.sol index dc8d1906..04b549c9 100644 --- a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.erc20.benchmark.t.sol +++ b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.erc20.benchmark.t.sol @@ -31,11 +31,6 @@ contract SubmitWithdrawal_MainchainGatewayV3_Native_Benchmark_Test is BaseIntegr _withdrawalReceipt.mainchain.chainId = block.chainid; _withdrawalReceipt.info.erc = Token.Standard.ERC20; _withdrawalReceipt.info.id = 0; - _withdrawalReceipt.info.quantity = 0; - - vm.deal(address(_mainchainGatewayV3), 10 ether); - vm.prank(address(_mainchainGatewayV3)); - _mainchainWeth.deposit{ value: 10 ether }(); _withdrawalReceipt.info.quantity = 10; _withdrawalReceipt.ronin.tokenAddr = address(_roninAxs); diff --git a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.native.benchmark.t.sol b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.native.benchmark.t.sol index bb547ed2..12811230 100644 --- a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.native.benchmark.t.sol +++ b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.native.benchmark.t.sol @@ -34,8 +34,6 @@ contract SubmitWithdrawal_MainchainGatewayV3_Native_Benchmark_Test is BaseIntegr _withdrawalReceipt.info.quantity = 0; vm.deal(address(_mainchainGatewayV3), 10 ether); - vm.prank(address(_mainchainGatewayV3)); - _mainchainWeth.deposit{ value: 10 ether }(); _withdrawalReceipt.info.quantity = 10; diff --git a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.weth.benchmark.t.sol b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.weth.benchmark.t.sol new file mode 100644 index 00000000..cf190f85 --- /dev/null +++ b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.weth.benchmark.t.sol @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { console2 as console } from "forge-std/console2.sol"; +import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; +import { Transfer } from "@ronin/contracts/libraries/Transfer.sol"; +import { Token } from "@ronin/contracts/libraries/Token.sol"; +import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; +import "../../BaseIntegration.t.sol"; + +contract SubmitWithdrawal_MainchainGatewayV3_Weth_Benchmark_Test is BaseIntegration_Test { + using Transfer for Transfer.Receipt; + + Transfer.Receipt _withdrawalReceipt; + bytes32 _domainSeparator; + + SignatureConsumer.Signature[] _signatures; + + function setUp() public virtual override { + super.setUp(); + + DiscardEther notReceiveEtherRecipient = new DiscardEther(); + + _domainSeparator = _mainchainGatewayV3.DOMAIN_SEPARATOR(); + + _withdrawalReceipt.id = 0; + _withdrawalReceipt.kind = Transfer.Kind.Withdrawal; + _withdrawalReceipt.ronin.addr = makeAddr("requester"); + _withdrawalReceipt.ronin.tokenAddr = address(_roninWeth); + _withdrawalReceipt.ronin.chainId =block.chainid; + _withdrawalReceipt.mainchain.addr = address(notReceiveEtherRecipient); + _withdrawalReceipt.mainchain.tokenAddr = address(_mainchainWeth); + _withdrawalReceipt.mainchain.chainId =block.chainid; + _withdrawalReceipt.info.erc = Token.Standard.ERC20; + _withdrawalReceipt.info.id = 0; + _withdrawalReceipt.info.quantity = 0; + + vm.deal(address(_mainchainGatewayV3), 6 ether); + + _withdrawalReceipt.info.quantity = 2 ether; + + SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs, _domainSeparator); + + for (uint i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + } + + function test_benchmark_submitWithdrawal_Weth() public { + _mainchainGatewayV3.submitWithdrawal(_withdrawalReceipt, _signatures); + } +} + +contract DiscardEther { + fallback() external payable { + _fallback(); + } + + receive() external payable { + _fallback(); + } + + function _fallback() internal { + revert("Not receive ether"); + } +} \ No newline at end of file From 6b2a6c250edce6c7ffba5b162c71aadb0e1791a9 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 6 Mar 2024 00:32:56 +0700 Subject: [PATCH 019/180] test(MainchainGateway): fix num and denom --- script/Migration.s.sol | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/script/Migration.s.sol b/script/Migration.s.sol index 9aa39514..0ca03767 100644 --- a/script/Migration.s.sol +++ b/script/Migration.s.sol @@ -94,7 +94,6 @@ contract Migration is BaseMigrationV2, Utils { // Ronin Bridge Manager param.roninBridgeManager.num = 7; param.roninBridgeManager.denom = 10; - param.roninBridgeManager.roninChainId = 0; param.roninBridgeManager.roninChainId = block.chainid; param.roninBridgeManager.expiryDuration = 60 * 60 * 24 * 14; // 14 days param.roninBridgeManager.bridgeOperators = operatorAddrs; @@ -103,20 +102,15 @@ contract Migration is BaseMigrationV2, Utils { param.roninBridgeManager.targetOptions = options; param.roninBridgeManager.targets = targets; - // Mainchain Gateway Pause Enforcer - param.mainchainPauseEnforcer.admin = makeAddr("pause-enforcer-admin"); - param.mainchainPauseEnforcer.sentries = wrapAddress(makeAddr("pause-enforcer-sentry")); - // Mainchain Gateway V3 param.mainchainGatewayV3.roninChainId = block.chainid; - param.mainchainGatewayV3.numerator = 1; - param.mainchainGatewayV3.highTierVWNumerator = 10; + param.mainchainGatewayV3.numerator = 7; + param.mainchainGatewayV3.highTierVWNumerator = 9; param.mainchainGatewayV3.denominator = 10; // Mainchain Bridge Manager param.mainchainBridgeManager.num = 7; param.mainchainBridgeManager.denom = 10; - param.mainchainBridgeManager.roninChainId = 0; param.mainchainBridgeManager.roninChainId = block.chainid; param.mainchainBridgeManager.bridgeOperators = operatorAddrs; param.mainchainBridgeManager.governors = governorAddrs; From bff5c9e871f97bbf70500b1f40612296c71fa62e Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 6 Mar 2024 00:38:38 +0700 Subject: [PATCH 020/180] feat(MainchainGateway, MainchainBridgeMananger): clone operators to gateway --- .../bridge/IBridgeManagerCallback.sol | 1 + src/mainchain/MainchainGatewayV3.sol | 115 +++++++++++++++--- src/ronin/gateway/BridgeSlash.sol | 3 +- test/bridge/integration/BaseIntegration.t.sol | 2 + 4 files changed, 103 insertions(+), 18 deletions(-) diff --git a/src/interfaces/bridge/IBridgeManagerCallback.sol b/src/interfaces/bridge/IBridgeManagerCallback.sol index 8811bccd..2c879a5c 100644 --- a/src/interfaces/bridge/IBridgeManagerCallback.sol +++ b/src/interfaces/bridge/IBridgeManagerCallback.sol @@ -16,6 +16,7 @@ interface IBridgeManagerCallback is IERC165 { */ function onBridgeOperatorsAdded( address[] memory bridgeOperators, + uint96[] calldata weights, bool[] memory addeds ) external returns (bytes4 selector); diff --git a/src/mainchain/MainchainGatewayV3.sol b/src/mainchain/MainchainGatewayV3.sol index 770ffef8..dd1fab10 100644 --- a/src/mainchain/MainchainGatewayV3.sol +++ b/src/mainchain/MainchainGatewayV3.sol @@ -10,7 +10,14 @@ import "../extensions/WithdrawalLimitation.sol"; import "../libraries/Transfer.sol"; import "../interfaces/IMainchainGatewayV3.sol"; -contract MainchainGatewayV3 is WithdrawalLimitation, Initializable, AccessControlEnumerable, IMainchainGatewayV3, HasContracts { +contract MainchainGatewayV3 is + WithdrawalLimitation, + Initializable, + AccessControlEnumerable, + IMainchainGatewayV3, + HasContracts, + IBridgeManagerCallback +{ using Token for Token.Info; using Transfer for Transfer.Request; using Transfer for Transfer.Receipt; @@ -38,6 +45,9 @@ contract MainchainGatewayV3 is WithdrawalLimitation, Initializable, AccessContro /// @custom:deprecated Previously `_bridgeOperators` (uint256[]) uint256 private ______deprecatedBridgeOperators; + uint96 private _totalOperatorWeight; + mapping(address operator => uint96 weight) private _operatorWeight; + fallback() external payable { _fallback(); } @@ -87,12 +97,8 @@ contract MainchainGatewayV3 is WithdrawalLimitation, Initializable, AccessContro } // Grant role for withdrawal unlocker - for (uint256 _i; _i < _addresses[2].length;) { - _grantRole(WITHDRAWAL_UNLOCKER_ROLE, _addresses[2][_i]); - - unchecked { - ++_i; - } + for (uint256 i; i < _addresses[2].length; i++) { + _grantRole(WITHDRAWAL_UNLOCKER_ROLE, _addresses[2][i]); } } @@ -100,10 +106,19 @@ contract MainchainGatewayV3 is WithdrawalLimitation, Initializable, AccessContro _setContract(ContractType.BRIDGE_MANAGER, bridgeManagerContract); } + function initializeV3(address[] calldata operators, uint96[] calldata weights) external reinitializer(3) { + uint96 totalWeight; + for (uint i; i < operators.length; i++) { + _operatorWeight[operators[i]] = weights[i]; + totalWeight += weights[i]; + } + _totalOperatorWeight = totalWeight; + } + /** * @dev Receives ether without doing anything. Use this function to topup native token. */ - function receiveEther() external payable { } + function receiveEther() external payable {} /** * @inheritdoc IMainchainGatewayV3 @@ -129,12 +144,10 @@ contract MainchainGatewayV3 is WithdrawalLimitation, Initializable, AccessContro /** * @inheritdoc IMainchainGatewayV3 */ - function submitWithdrawal(Transfer.Receipt calldata _receipt, Signature[] calldata _signatures) - external - virtual - whenNotPaused - returns (bool _locked) - { + function submitWithdrawal( + Transfer.Receipt calldata _receipt, + Signature[] calldata _signatures + ) external virtual whenNotPaused returns (bool _locked) { return _submitWithdrawal(_receipt, _signatures); } @@ -418,13 +431,81 @@ contract MainchainGatewayV3 is WithdrawalLimitation, Initializable, AccessContro * @inheritdoc GatewayV3 */ function _getTotalWeight() internal view override returns (uint256) { - return IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)).getTotalWeight(); + return _totalOperatorWeight; } /** * @dev Returns the weight of an address. */ - function _getWeight(address _addr) internal view returns (uint256) { - return IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)).getBridgeOperatorWeight(_addr); + function _getWeight(address addr) internal view returns (uint256) { + return _operatorWeight[addr]; + } + + /////////////////////////////////////////////// + // CALLBACKS + /////////////////////////////////////////////// + + /** + * @inheritdoc IBridgeManagerCallback + */ + function onBridgeOperatorsAdded( + address[] calldata operators, + uint96[] calldata weights, + bool[] memory addeds + ) external onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) { + uint256 length = operators.length; + if (length != addeds.length || length != weights.length) revert ErrLengthMismatch(msg.sig); + if (length == 0) { + return IBridgeManagerCallback.onBridgeOperatorsAdded.selector; + } + + for (uint256 i; i < length; ++i) { + unchecked { + if (addeds[i]) { + _totalOperatorWeight += weights[i]; + _operatorWeight[operators[i]] = weights[i]; + } + } + } + + return IBridgeManagerCallback.onBridgeOperatorsAdded.selector; + } + + /** + * @inheritdoc IBridgeManagerCallback + */ + function onBridgeOperatorUpdated(address currOperator, address newOperator) external onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) { + _operatorWeight[newOperator] = _operatorWeight[currOperator]; + delete _operatorWeight[currOperator]; + + return IBridgeManagerCallback.onBridgeOperatorUpdated.selector; + } + + /** + * @inheritdoc IBridgeManagerCallback + */ + function onBridgeOperatorsRemoved( + address[] calldata operators, + bool[] calldata removeds + ) external onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) { + uint length = operators.length; + if (length != removeds.length) revert ErrLengthMismatch(msg.sig); + if (length == 0) { + return IBridgeManagerCallback.onBridgeOperatorsRemoved.selector; + } + + uint96 totalRemovingWeight; + for (uint i; i < length; ++i) { + unchecked { + if (removeds[i]) { + totalRemovingWeight += _operatorWeight[operators[i]]; + delete _operatorWeight[operators[i]]; + } + } + } + + _totalOperatorWeight -= totalRemovingWeight; + + return IBridgeManagerCallback.onBridgeOperatorsRemoved.selector; } } diff --git a/src/ronin/gateway/BridgeSlash.sol b/src/ronin/gateway/BridgeSlash.sol index 3a39415b..5c43e32d 100644 --- a/src/ronin/gateway/BridgeSlash.sol +++ b/src/ronin/gateway/BridgeSlash.sol @@ -93,6 +93,7 @@ contract BridgeSlash is */ function onBridgeOperatorsAdded( address[] calldata bridgeOperators, + uint96[] calldata /* weights */, bool[] memory addeds ) external onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) { uint256 length = bridgeOperators.length; @@ -203,7 +204,7 @@ contract BridgeSlash is address[] calldata, bool[] calldata ) external view onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) { - return IBridgeManagerCallback.onBridgeOperatorsAdded.selector; + return IBridgeManagerCallback.onBridgeOperatorsRemoved.selector; } /** diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index dd6b3e95..fde203a4 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -29,6 +29,7 @@ import { Ballot } from "@ronin/contracts/libraries/Ballot.sol"; import { Transfer as LibTransfer } from "@ronin/contracts/libraries/Transfer.sol"; import { GlobalCoreGovernance } from "@ronin/contracts/extensions/sequential-governance/GlobalCoreGovernance.sol"; import { IHasContracts } from "@ronin/contracts/interfaces/collections/IHasContracts.sol"; +import { IBridgeManagerCallbackRegister } from "@ronin/contracts/interfaces/bridge/IBridgeManagerCallbackRegister.sol"; import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; import { TransparentUpgradeableProxyV2 } from "@ronin/contracts/extensions/TransparentUpgradeableProxyV2.sol"; import { MockValidatorContract_OnlyTiming_ForHardhatTest } from "@ronin/contracts/mocks/ronin/MockValidatorContract_OnlyTiming_ForHardhatTest.sol"; @@ -482,6 +483,7 @@ contract BaseIntegration_Test is Base_Test { ); _mainchainGatewayV3.initializeV2(address(_mainchainBridgeManager)); + _mainchainGatewayV3.initializeV3(_param.mainchainBridgeManager.bridgeOperators, _param.mainchainBridgeManager.voteWeights); } function _mainchainPauseEnforcerInitialize() internal { From e361e6ccfec15105d8ff5ca55a490aec4aa87f28 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 6 Mar 2024 10:50:30 +0700 Subject: [PATCH 021/180] test: disable updateOperator test --- .../depositAndRecord.Gateway.t.sol | 12 ------ .../updateOperator.RoninBridgeManager.t.sol | 2 + .../bridge-manager/BridgeManagerCRUD.t.sol | 39 +++++++++---------- 3 files changed, 21 insertions(+), 32 deletions(-) diff --git a/test/bridge/integration/bridge-manager/deposit-and-record/depositAndRecord.Gateway.t.sol b/test/bridge/integration/bridge-manager/deposit-and-record/depositAndRecord.Gateway.t.sol index 21ddda94..7722a75a 100644 --- a/test/bridge/integration/bridge-manager/deposit-and-record/depositAndRecord.Gateway.t.sol +++ b/test/bridge/integration/bridge-manager/deposit-and-record/depositAndRecord.Gateway.t.sol @@ -79,18 +79,6 @@ contract DepositAndRecord_Gateway_Test is BaseIntegration_Test { } } - function _updateBridgeOperator() internal { - vm.prank(_param.roninBridgeManager.governors[0]); - address previousOperator = _param.roninBridgeManager.bridgeOperators[0]; - _roninBridgeManager.updateBridgeOperator(_newBridgeOperator); - _param.roninBridgeManager.bridgeOperators[0] = _newBridgeOperator; - - console.log( - "Update operator: ", - string(abi.encodePacked(vm.toString(previousOperator), " => ", vm.toString(_newBridgeOperator))) - ); - } - function _depositFor() internal { console.log(">> depositFor ...."); _sampleReceipt.id = ++_id; diff --git a/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol index ea8b0e93..07925eaa 100644 --- a/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol @@ -42,6 +42,8 @@ contract UpdateOperator_RoninBridgeManager_Test is BaseIntegration_Test { } function test_updateOperator_and_wrapUpEpoch() public { + // Disable test due to not supporting update operator + vm.skip(true); console.log("=============== Test Update Operator ==========="); _depositFor(); diff --git a/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol b/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol index e8ed23f0..74a35d36 100644 --- a/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol +++ b/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol @@ -5,7 +5,14 @@ import { console } from "forge-std/console.sol"; import { IBridgeManager, BridgeManagerUtils } from "../utils/BridgeManagerUtils.t.sol"; import { RoninGatewayV3 } from "@ronin/contracts/ronin/gateway/RoninGatewayV3.sol"; import { RoleAccess, ContractType, AddressArrayUtils, MockBridgeManager } from "@ronin/contracts/mocks/ronin/MockBridgeManager.sol"; -import { ErrBridgeOperatorUpdateFailed, ErrBridgeOperatorAlreadyExisted, ErrUnauthorized, ErrInvalidVoteWeight, ErrZeroAddress, ErrUnexpectedInternalCall } from "@ronin/contracts/utils/CommonErrors.sol"; +import { + ErrBridgeOperatorUpdateFailed, + ErrBridgeOperatorAlreadyExisted, + ErrUnauthorized, + ErrInvalidVoteWeight, + ErrZeroAddress, + ErrUnexpectedInternalCall +} from "@ronin/contracts/utils/CommonErrors.sol"; contract BridgeManagerCRUDTest is BridgeManagerUtils { using AddressArrayUtils for address[]; @@ -24,12 +31,8 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { } function testFail_MaliciousUpdateBridgeOperator() external { - (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs( - DEFAULT_R1, - DEFAULT_R2, - DEFAULT_R3, - DEFAULT_NUM_BRIDGE_OPERATORS - ); + (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = + getValidInputs(DEFAULT_R1, DEFAULT_R2, DEFAULT_R3, DEFAULT_NUM_BRIDGE_OPERATORS); _bridgeManager = address(new MockBridgeManager(bridgeOperators, governors, voteWeights)); MockBridgeManager bridgeManager = MockBridgeManager(_bridgeManager); @@ -59,9 +62,7 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs(r1, r2, r3, numBridgeOperators); - vm.expectRevert( - abi.encodeWithSelector(ErrUnexpectedInternalCall.selector, IBridgeManager.addBridgeOperators.selector, ContractType.BRIDGE, caller) - ); + vm.expectRevert(abi.encodeWithSelector(ErrUnexpectedInternalCall.selector, IBridgeManager.addBridgeOperators.selector, ContractType.BRIDGE, caller)); _addBridgeOperators(caller, _bridgeManager, voteWeights, governors, bridgeOperators); } @@ -118,7 +119,7 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { uint256 tailIdx = voteWeights.length - 1; uint256 r = _randomize(_triShuffle(r1, r2, r3), 0, tailIdx); address[] memory removeBridgeOperators = new address[](removeAmount); - for (uint256 i; i < removeAmount; ) { + for (uint256 i; i < removeAmount;) { r = _randomize(r, 0, tailIdx); governors[r] = governors[tailIdx]; @@ -155,7 +156,8 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { /** * @notice Checks whether governor can update their bridge operator address. */ - function test_UpdateBridgeOperator_CallerIsGovernor(uint256 r1, uint256 r2, uint256 r3, uint16 numBridgeOperators) external virtual { + function testFuzz_UpdateBridgeOperator_CallerIsGovernor(uint256 r1, uint256 r2, uint256 r3, uint16 numBridgeOperators) external virtual { + vm.skip(true); (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs(r1, r2, r3, numBridgeOperators); IBridgeManager bridgeManager = _addBridgeOperators(_bridgeManager, _bridgeManager, voteWeights, governors, bridgeOperators); @@ -182,12 +184,13 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { /** * @notice Checks whether unauthorized sender can update bridge operator address. */ - function testFail_UpdateBridgeOperator_CallerIsNotGovernor(uint256 r1, uint256 r2, uint256 r3, uint16 numBridgeOperators) external virtual { + function test_UpdateBridgeOperator_CallerIsNotGovernor(uint256 r1, uint256 r2, uint256 r3, uint16 numBridgeOperators) external virtual { + vm.skip(true); (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs(r1, r2, r3, numBridgeOperators); IBridgeManager bridgeManager = _addBridgeOperators(_bridgeManager, _bridgeManager, voteWeights, governors, bridgeOperators); address unauthorizedCaller = makeAddr("UNAUTHORIZED_CALLER"); - for (uint256 i; i < governors.length; ) { + for (uint256 i; i < governors.length;) { vm.assume(unauthorizedCaller != governors[i]); unchecked { ++i; @@ -202,12 +205,8 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { } function _setUp() internal virtual { - (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs( - DEFAULT_R1, - DEFAULT_R2, - DEFAULT_R3, - DEFAULT_NUM_BRIDGE_OPERATORS - ); + (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = + getValidInputs(DEFAULT_R1, DEFAULT_R2, DEFAULT_R3, DEFAULT_NUM_BRIDGE_OPERATORS); _bridgeManager = address(new MockBridgeManager(bridgeOperators, governors, voteWeights)); // empty storage for testing From 8dbfb5ba8b205d771f61d6fc133e06b82142d51a Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 6 Mar 2024 10:50:50 +0700 Subject: [PATCH 022/180] test: fix mockERC721 test --- test/bridge/integration/BaseIntegration.t.sol | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index fde203a4..0672de1b 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -166,7 +166,7 @@ contract BaseIntegration_Test is Base_Test { } function _getMainchainAndRoninTokens() internal view returns (address[] memory mainchainTokens, address[] memory roninTokens) { - uint256 tokenNum = 4; + uint256 tokenNum = 5; mainchainTokens = new address[](tokenNum); roninTokens = new address[](tokenNum); @@ -174,11 +174,13 @@ contract BaseIntegration_Test is Base_Test { mainchainTokens[1] = address(_mainchainAxs); mainchainTokens[2] = address(_mainchainSlp); mainchainTokens[3] = address(_mainchainUsdc); + mainchainTokens[4] = address(_mainchainMockERC721); roninTokens[0] = address(_roninWeth); roninTokens[1] = address(_roninAxs); roninTokens[2] = address(_roninSlp); roninTokens[3] = address(_roninUsdc); + roninTokens[4] = address(_roninMockERC721); } function _bridgeRewardInitialize() internal { From f09c2211bb994c8931ddee8f06928545bbe2f02d Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 6 Mar 2024 11:50:40 +0700 Subject: [PATCH 023/180] test: fix minNumOperator --- .../bulkDepositAndRecord.Gateway.t.sol | 3 +-- .../depositAndRecord.Gateway.t.sol | 3 +-- .../updateOperator.RoninBridgeManager.t.sol | 3 +-- .../depositVote.RoninGatewayV3.t.sol | 21 +++++++++++++------ 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/test/bridge/integration/bridge-manager/deposit-and-record/bulkDepositAndRecord.Gateway.t.sol b/test/bridge/integration/bridge-manager/deposit-and-record/bulkDepositAndRecord.Gateway.t.sol index 1e75083f..c4a6f767 100644 --- a/test/bridge/integration/bridge-manager/deposit-and-record/bulkDepositAndRecord.Gateway.t.sol +++ b/test/bridge/integration/bridge-manager/deposit-and-record/bulkDepositAndRecord.Gateway.t.sol @@ -27,8 +27,7 @@ contract BulkDepositAndRecord_Gateway_Test is BaseIntegration_Test { info: Token.Info({ erc: Token.Standard.ERC20, id: 0, quantity: 100 }) }); - _numOperatorsForVoteExecuted = - _param.roninBridgeManager.bridgeOperators.length * _param.roninBridgeManager.num / _param.roninBridgeManager.denom; + _numOperatorsForVoteExecuted = (_roninBridgeManager.minimumVoteWeight() - 1) / 100 + 1; } function test_bulkDepositFor_wrapUp_checkRewardAndSlash() public { diff --git a/test/bridge/integration/bridge-manager/deposit-and-record/depositAndRecord.Gateway.t.sol b/test/bridge/integration/bridge-manager/deposit-and-record/depositAndRecord.Gateway.t.sol index 7722a75a..d505955b 100644 --- a/test/bridge/integration/bridge-manager/deposit-and-record/depositAndRecord.Gateway.t.sol +++ b/test/bridge/integration/bridge-manager/deposit-and-record/depositAndRecord.Gateway.t.sol @@ -26,8 +26,7 @@ contract DepositAndRecord_Gateway_Test is BaseIntegration_Test { info: Token.Info({ erc: Token.Standard.ERC20, id: 0, quantity: 100 }) }); - _numOperatorsForVoteExecuted = - _param.roninBridgeManager.bridgeOperators.length * _param.roninBridgeManager.num / _param.roninBridgeManager.denom; + _numOperatorsForVoteExecuted = (_roninBridgeManager.minimumVoteWeight() - 1) / 100 + 1; } function test_depositFor_wrapUp_checkRewardAndSlash() public { diff --git a/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol index 07925eaa..8398e397 100644 --- a/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol @@ -37,8 +37,7 @@ contract UpdateOperator_RoninBridgeManager_Test is BaseIntegration_Test { id++; } - _numOperatorsForVoteExecuted = - _param.roninBridgeManager.bridgeOperators.length * _param.roninBridgeManager.num / _param.roninBridgeManager.denom; + _numOperatorsForVoteExecuted = (_roninBridgeManager.minimumVoteWeight() - 1) / 100 + 1; } function test_updateOperator_and_wrapUpEpoch() public { diff --git a/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol b/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol index 055a1050..8a8b18b7 100644 --- a/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol +++ b/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol @@ -33,8 +33,8 @@ contract DepositVote_RoninGatewayV3_Test is BaseIntegration_Test { receipt.id = 1; _depositReceipts.push(receipt); - _numOperatorsForVoteExecuted = - _param.roninBridgeManager.bridgeOperators.length * _param.roninBridgeManager.num / _param.roninBridgeManager.denom; + + _numOperatorsForVoteExecuted = (_roninBridgeManager.minimumVoteWeight() - 1) / 100 + 1; } // @dev Should be able to bulk deposits using bridge operator accounts @@ -45,8 +45,7 @@ contract DepositVote_RoninGatewayV3_Test is BaseIntegration_Test { } for (uint256 i = 0; i < _depositReceipts.length; i++) { - (VoteStatusConsumer.VoteStatus status,,,) = - _roninGatewayV3.depositVote(_depositReceipts[i].mainchain.chainId, _depositReceipts[i].id); + (VoteStatusConsumer.VoteStatus status,,,) = _roninGatewayV3.depositVote(_depositReceipts[i].mainchain.chainId, _depositReceipts[i].id); assertEq(uint256(uint8(status)), uint256(uint8(VoteStatusConsumer.VoteStatus.Pending))); @@ -61,12 +60,22 @@ contract DepositVote_RoninGatewayV3_Test is BaseIntegration_Test { function test_tryBulkDepositFor_Executed() public { test_tryBulkDepositFor_NotExecuted(); + console.log("_numOperatorsForVoteExecuted", _numOperatorsForVoteExecuted); + + console.log("vote #15"); + // Let the last operator to vote to execute vm.prank(_param.roninBridgeManager.bridgeOperators[_numOperatorsForVoteExecuted - 1]); _roninGatewayV3.tryBulkDepositFor(_depositReceipts); + // for (uint i; i < 7; i++) { + // console.log("vote #", 15 + i); + // vm.prank(_param.roninBridgeManager.bridgeOperators[_numOperatorsForVoteExecuted + i]); + // _roninGatewayV3.tryBulkDepositFor(_depositReceipts); + // } + for (uint256 i = 0; i < _depositReceipts.length; i++) { - (VoteStatusConsumer.VoteStatus status,,,) = - _roninGatewayV3.depositVote(_depositReceipts[i].mainchain.chainId, _depositReceipts[i].id); + // Let the pending operator to vote after executed to tracking + (VoteStatusConsumer.VoteStatus status,,,) = _roninGatewayV3.depositVote(_depositReceipts[i].mainchain.chainId, _depositReceipts[i].id); assertEq(uint256(uint8(status)), uint256(uint8(VoteStatusConsumer.VoteStatus.Executed))); From c38fe508d103609b2ec6b5436eb65d100d590f1e Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 6 Mar 2024 12:45:01 +0700 Subject: [PATCH 024/180] fix(BridgeManager): fix param in operator adding callback --- src/extensions/bridge-operator-governance/BridgeManager.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extensions/bridge-operator-governance/BridgeManager.sol b/src/extensions/bridge-operator-governance/BridgeManager.sol index a15d0dfe..e9eff37a 100644 --- a/src/extensions/bridge-operator-governance/BridgeManager.sol +++ b/src/extensions/bridge-operator-governance/BridgeManager.sol @@ -283,7 +283,7 @@ abstract contract BridgeManager is IBridgeManager, HasContracts, BridgeManagerQu $._totalWeight += accumulatedWeight; - _notifyRegisters(IBridgeManagerCallback.onBridgeOperatorsAdded.selector, abi.encode(newOperators, addeds)); + _notifyRegisters(IBridgeManagerCallback.onBridgeOperatorsAdded.selector, abi.encode(newOperators, voteWeights, addeds)); emit BridgeOperatorsAdded(addeds, voteWeights, newGovernors, newOperators); } From 633c93298f439791b831b96aa9750858f95c55d3 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 6 Mar 2024 13:03:27 +0700 Subject: [PATCH 025/180] fix(BridgeManager): nit deprecated method --- src/extensions/bridge-operator-governance/BridgeManager.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extensions/bridge-operator-governance/BridgeManager.sol b/src/extensions/bridge-operator-governance/BridgeManager.sol index 589d203b..a1541f33 100644 --- a/src/extensions/bridge-operator-governance/BridgeManager.sol +++ b/src/extensions/bridge-operator-governance/BridgeManager.sol @@ -202,7 +202,7 @@ abstract contract BridgeManager is IBridgeManager, HasContracts, BridgeManagerQu /** * @inheritdoc IBridgeManager */ - function updateBridgeOperator(address currOperator, address newOperator) external onlyGovernor { + function updateBridgeOperator(address, /* currOperator */ address /* newOperator */ ) external view onlyGovernor { revert("Not supported"); } From 1a8945671a6bad21ddc7b10944691e1ec2d680ea Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 6 Mar 2024 13:03:53 +0700 Subject: [PATCH 026/180] test: disable more update operator test, nit test --- test/bridge/integration/BaseIntegration.t.sol | 2 +- .../submitWithdrawal.MainchainGatewayV3.t.sol | 4 +++- .../bridge-manager/update/update.t.sol | 24 ++++++------------- 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index 0672de1b..0be51cd2 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -576,7 +576,7 @@ contract BaseIntegration_Test is Base_Test { LibTransfer.Receipt memory receipt, uint256[] memory signerPKs, bytes32 domainSeparator - ) internal view returns (SignatureConsumer.Signature[] memory sigs) { + ) internal pure returns (SignatureConsumer.Signature[] memory sigs) { sigs = new SignatureConsumer.Signature[](signerPKs.length); for (uint256 i; i < signerPKs.length; i++) { diff --git a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.t.sol b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.t.sol index 4c30a518..49b71529 100644 --- a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.t.sol +++ b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.t.sol @@ -57,7 +57,9 @@ contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test{ function testFuzz_submitWithdrawal_ERC20(uint seed) external { _withdrawalReceipt.ronin.tokenAddr = address(_roninAxs); _withdrawalReceipt.mainchain.tokenAddr = address(_mainchainAxs); - _withdrawalReceipt.info.quantity = seed % 1_000_000; + + // Make sure quantity > 0 + _withdrawalReceipt.info.quantity = seed % 1_000_000 + 1; SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs, _domainSeparator); diff --git a/test/bridge/unit/concrete/bridge-manager/update/update.t.sol b/test/bridge/unit/concrete/bridge-manager/update/update.t.sol index 4b425d79..e5c62c6c 100644 --- a/test/bridge/unit/concrete/bridge-manager/update/update.t.sol +++ b/test/bridge/unit/concrete/bridge-manager/update/update.t.sol @@ -28,17 +28,12 @@ contract Update_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { changePrank({ msgSender: _bridgeOperators[0] }); // Run the test. - vm.expectRevert( - abi.encodeWithSelector( - ErrUnauthorized.selector, - IBridgeManager.updateBridgeOperator.selector, - RoleAccess.GOVERNOR - ) - ); + vm.expectRevert(abi.encodeWithSelector(ErrUnauthorized.selector, IBridgeManager.updateBridgeOperator.selector, RoleAccess.GOVERNOR)); _bridgeManager.updateBridgeOperator(_bridgeOperators[0], newOperator); } function test_RevertWhen_NewOperatorAddressIsZero() external { + vm.skip(true); address newOperator = address(0); // Run the test. @@ -47,6 +42,7 @@ contract Update_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { } function test_RevertWhen_NewOperatorIsExistedInCurrentOperatorList() external { + vm.skip(true); address newOperator = _bridgeOperators[2]; // Run the test. @@ -64,6 +60,7 @@ contract Update_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { } function test_RevertWhen_NewOperatorIsTheSameWithPreviousOperator() external { + vm.skip(true); address prevOperator = _bridgeManager.getOperatorOf(_caller); address newOperator = prevOperator; @@ -73,12 +70,9 @@ contract Update_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { } function test_UpdateOperators_NewOperatorIsValid() external { + vm.skip(true); // Get before test state. - ( - address[] memory beforeBridgeOperators, - address[] memory beforeGovernors, - uint96[] memory beforeVoteWeights - ) = _getBridgeMembers(); + (address[] memory beforeBridgeOperators, address[] memory beforeGovernors, uint96[] memory beforeVoteWeights) = _getBridgeMembers(); // Prepare data. address prevOperator = _bridgeManager.getOperatorOf(_caller); @@ -93,11 +87,7 @@ contract Update_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { _bridgeManager.updateBridgeOperator(_bridgeOperators[0], newOperator); // Get after test state - ( - address[] memory afterBridgeOperators, - address[] memory afterGovernors, - uint96[] memory afterVoteWeights - ) = _getBridgeMembers(); + (address[] memory afterBridgeOperators, address[] memory afterGovernors, uint96[] memory afterVoteWeights) = _getBridgeMembers(); // it should modify the current operators list beforeBridgeOperators[0] = newOperator; From 81e7c3dde721e4fecc8926fa67e3c0fae63d6e21 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 6 Mar 2024 15:19:29 +0700 Subject: [PATCH 027/180] fix(MainchainGateway): handle deposit out-of-gas with WETH --- src/extensions/WETHVault.sol | 44 +++++++++++++++++++ src/interfaces/IWETH.sol | 4 ++ src/mainchain/MainchainGatewayV3.sol | 66 ++++++++++++++-------------- 3 files changed, 82 insertions(+), 32 deletions(-) create mode 100644 src/extensions/WETHVault.sol diff --git a/src/extensions/WETHVault.sol b/src/extensions/WETHVault.sol new file mode 100644 index 00000000..8ce38ec0 --- /dev/null +++ b/src/extensions/WETHVault.sol @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.9; + +import "@openzeppelin/contracts/access/Ownable.sol"; + +import "../interfaces/IWETH.sol"; + +contract WETHVault is Ownable { + IWETH public weth; + + error ErrInsufficientBalance(); + error ErrExternalCallFailed(address sender, bytes4 sig); + + constructor(address weth_, address owner_) { + weth = IWETH(weth_); + + if (owner_ != address(0)) { + _transferOwnership(owner_); + } + } + + fallback() external payable { } + receive() external payable { } + + function transferToVault(uint val) external { + weth.withdraw(val); + } + + function withdrawToOwner(uint val) external onlyOwner { + if (val > address(this).balance) { + revert ErrInsufficientBalance(); + } + + (bool success,) = payable(msg.sender).call{ value: val }(""); + if (!success) { + revert ErrExternalCallFailed(msg.sender, msg.sig); + } + } + + function setWeth(address weth_) external onlyOwner { + weth = IWETH(weth_); + } +} diff --git a/src/interfaces/IWETH.sol b/src/interfaces/IWETH.sol index 44871433..5c00275f 100644 --- a/src/interfaces/IWETH.sol +++ b/src/interfaces/IWETH.sol @@ -2,8 +2,12 @@ pragma solidity ^0.8.0; interface IWETH { + event Transfer(address indexed src, address indexed dst, uint wad); + function deposit() external payable; + function transfer(address dst, uint wad) external returns (bool); + function withdraw(uint256 _wad) external; function balanceOf(address) external view returns (uint256); diff --git a/src/mainchain/MainchainGatewayV3.sol b/src/mainchain/MainchainGatewayV3.sol index dd1fab10..c5e44709 100644 --- a/src/mainchain/MainchainGatewayV3.sol +++ b/src/mainchain/MainchainGatewayV3.sol @@ -6,18 +6,12 @@ import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import { IBridgeManager } from "../interfaces/bridge/IBridgeManager.sol"; import { IBridgeManagerCallback } from "../interfaces/bridge/IBridgeManagerCallback.sol"; import { HasContracts, ContractType } from "../extensions/collections/HasContracts.sol"; +import "../extensions/WETHVault.sol"; import "../extensions/WithdrawalLimitation.sol"; import "../libraries/Transfer.sol"; import "../interfaces/IMainchainGatewayV3.sol"; -contract MainchainGatewayV3 is - WithdrawalLimitation, - Initializable, - AccessControlEnumerable, - IMainchainGatewayV3, - HasContracts, - IBridgeManagerCallback -{ +contract MainchainGatewayV3 is WithdrawalLimitation, Initializable, AccessControlEnumerable, IMainchainGatewayV3, HasContracts, IBridgeManagerCallback { using Token for Token.Info; using Transfer for Transfer.Request; using Transfer for Transfer.Receipt; @@ -47,13 +41,14 @@ contract MainchainGatewayV3 is uint96 private _totalOperatorWeight; mapping(address operator => uint96 weight) private _operatorWeight; + WETHVault public wethVault; fallback() external payable { - _fallback(); + // _fallback(); } receive() external payable { - _fallback(); + // _fallback(); } /** @@ -115,10 +110,14 @@ contract MainchainGatewayV3 is _totalOperatorWeight = totalWeight; } + function initializeV4(address payable wethVault_) external reinitializer(4) { + wethVault = WETHVault(wethVault_); + } + /** * @dev Receives ether without doing anything. Use this function to topup native token. */ - function receiveEther() external payable {} + function receiveEther() external payable { } /** * @inheritdoc IMainchainGatewayV3 @@ -144,10 +143,7 @@ contract MainchainGatewayV3 is /** * @inheritdoc IMainchainGatewayV3 */ - function submitWithdrawal( - Transfer.Receipt calldata _receipt, - Signature[] calldata _signatures - ) external virtual whenNotPaused returns (bool _locked) { + function submitWithdrawal(Transfer.Receipt calldata _receipt, Signature[] calldata _signatures) external virtual whenNotPaused returns (bool _locked) { return _submitWithdrawal(_receipt, _signatures); } @@ -184,11 +180,7 @@ contract MainchainGatewayV3 is /** * @inheritdoc IMainchainGatewayV3 */ - function mapTokens( - address[] calldata _mainchainTokens, - address[] calldata _roninTokens, - Token.Standard[] calldata _standards - ) external virtual onlyAdmin { + function mapTokens(address[] calldata _mainchainTokens, address[] calldata _roninTokens, Token.Standard[] calldata _standards) external virtual onlyAdmin { if (_mainchainTokens.length == 0) revert ErrEmptyArray(); _mapTokens(_mainchainTokens, _roninTokens, _standards); } @@ -349,9 +341,13 @@ contract MainchainGatewayV3 is if (_token.erc != _request.info.erc) revert ErrInvalidTokenStandard(); _request.info.transferFrom(_requester, address(this), _request.tokenAddr); + // Withdraw if token is WETH + // The withdraw of WETH must go via `WethVault`, because `WETH.withdraw` only sends 2300 gas, which is insufficient when recipient is a proxy. if (_roninWeth == _request.tokenAddr) { - IWETH(_roninWeth).withdraw(_request.info.quantity); + IWETH(_roninWeth).transfer(address(wethVault), _request.info.quantity); + wethVault.transferToVault(_request.info.quantity); + wethVault.withdrawToOwner(_request.info.quantity); } } @@ -416,15 +412,24 @@ contract MainchainGatewayV3 is } /** - * @dev Receives ETH from WETH or creates deposit request. + * @dev Receives ETH from WETH or creates deposit request if sender is not WETH. */ - function _fallback() internal virtual whenNotPaused { - if (msg.sender != address(wrappedNativeToken)) { - Transfer.Request memory _request; - _request.recipientAddr = msg.sender; - _request.info.quantity = msg.value; - _requestDepositFor(_request, _request.recipientAddr); + function _fallback() internal virtual { + if (msg.sender == address(wrappedNativeToken)) { + return; } + + _createDepositOnFallback(); + } + + /** + * @dev Creates deposit request. + */ + function _createDepositOnFallback() internal virtual whenNotPaused { + Transfer.Request memory _request; + _request.recipientAddr = msg.sender; + _request.info.quantity = msg.value; + _requestDepositFor(_request, _request.recipientAddr); } /** @@ -484,10 +489,7 @@ contract MainchainGatewayV3 is /** * @inheritdoc IBridgeManagerCallback */ - function onBridgeOperatorsRemoved( - address[] calldata operators, - bool[] calldata removeds - ) external onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) { + function onBridgeOperatorsRemoved(address[] calldata operators, bool[] calldata removeds) external onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) { uint length = operators.length; if (length != removeds.length) revert ErrLengthMismatch(msg.sig); if (length == 0) { From 1c1435a04f4c62cdad7666b68413c9fe5fb8fde3 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 6 Mar 2024 15:19:53 +0700 Subject: [PATCH 028/180] test: config for wethVault and fix test --- script/GeneralConfig.sol | 2 ++ .../contracts/MainchainWethVaultDeploy.s.sol | 23 +++++++++++++++++ script/interfaces/ISharedArgument.sol | 6 +++++ script/utils/Contract.sol | 4 ++- test/bridge/integration/BaseIntegration.t.sol | 16 ++++++++++-- .../submitWithdrawal.MainchainGatewayV3.t.sol | 25 ++++++++++++++----- ...al.MainchainGatewayV3.weth.benchmark.t.sol | 21 +++------------- test/mocks/MockDiscardEther.sol | 16 ++++++++++++ 8 files changed, 87 insertions(+), 26 deletions(-) create mode 100644 script/contracts/MainchainWethVaultDeploy.s.sol create mode 100644 test/mocks/MockDiscardEther.sol diff --git a/script/GeneralConfig.sol b/script/GeneralConfig.sol index 2651f1f0..da6b26bb 100644 --- a/script/GeneralConfig.sol +++ b/script/GeneralConfig.sol @@ -57,6 +57,8 @@ contract GeneralConfig is BaseGeneralConfig, Utils { _contractNameMap[Contract.RoninPauseEnforcer.key()] = "PauseEnforcer"; _contractNameMap[Contract.MainchainPauseEnforcer.key()] = "PauseEnforcer"; + + _contractNameMap[Contract.MainchainWETHVault.key()] = "WETHVault"; } function _mapContractName(Contract contractEnum) internal { diff --git a/script/contracts/MainchainWethVaultDeploy.s.sol b/script/contracts/MainchainWethVaultDeploy.s.sol new file mode 100644 index 00000000..bdbaecfa --- /dev/null +++ b/script/contracts/MainchainWethVaultDeploy.s.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { WETHVault } from "@ronin/contracts/extensions/WETHVault.sol"; +import { Contract } from "../utils/Contract.sol"; +import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; +import { Migration } from "../Migration.s.sol"; + + +contract MainchainWethVaultDeploy is Migration { + function _defaultArguments() internal virtual override returns (bytes memory args) { + ISharedArgument.WETHVaultParam memory param = config.sharedArguments().mainchainWethVault; + + args = abi.encode( + param.weth, + param.owner + ); + } + + function run() public virtual returns (WETHVault) { + return WETHVault(_deployImmutable(Contract.MainchainWETHVault.key())); + } +} diff --git a/script/interfaces/ISharedArgument.sol b/script/interfaces/ISharedArgument.sol index 37971d4d..6c5b0719 100644 --- a/script/interfaces/ISharedArgument.sol +++ b/script/interfaces/ISharedArgument.sol @@ -106,11 +106,17 @@ interface ISharedArgument is IGeneralConfig { uint256[] governorPKs; } + struct WETHVaultParam { + address weth; + address owner; + } + struct SharedParameter { // mainchain BridgeManagerParam mainchainBridgeManager; MainchainGatewayV3Param mainchainGatewayV3; PauseEnforcerParam mainchainPauseEnforcer; + WETHVaultParam mainchainWethVault; // ronin BridgeManagerParam roninBridgeManager; RoninGatewayV3Param roninGatewayV3; diff --git a/script/utils/Contract.sol b/script/utils/Contract.sol index e94823f6..2cfecfe7 100644 --- a/script/utils/Contract.sol +++ b/script/utils/Contract.sol @@ -18,7 +18,8 @@ enum Contract { RoninBridgeManager, MainchainPauseEnforcer, MainchainGatewayV3, - MainchainBridgeManager + MainchainBridgeManager, + MainchainWETHVault } using { key, name } for Contract global; @@ -45,6 +46,7 @@ function name(Contract contractEnum) pure returns (string memory) { if (contractEnum == Contract.MainchainPauseEnforcer) return "PauseEnforcer"; if (contractEnum == Contract.MainchainGatewayV3) return "MainchainGatewayV3"; if (contractEnum == Contract.MainchainBridgeManager) return "MainchainBridgeManager"; + if (contractEnum == Contract.MainchainWETHVault) return "WETHVault"; revert("Contract: Unknown contract"); } diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index 0be51cd2..105fe476 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -16,6 +16,7 @@ import { BridgeSlash } from "@ronin/contracts/ronin/gateway/BridgeSlash.sol"; import { BridgeReward } from "@ronin/contracts/ronin/gateway/BridgeReward.sol"; import { MainchainGatewayV3 } from "@ronin/contracts/mainchain/MainchainGatewayV3.sol"; import { MainchainBridgeManager } from "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; +import { WETHVault } from "@ronin/contracts/extensions/WETHVault.sol"; import { MockERC20 } from "@ronin/contracts/mocks/token/MockERC20.sol"; import { MockERC721 } from "@ronin/contracts/mocks/token/MockERC721.sol"; @@ -48,6 +49,7 @@ import { RoninPauseEnforcerDeploy } from "@ronin/script/contracts/RoninPauseEnfo import { MainchainGatewayV3Deploy } from "@ronin/script/contracts/MainchainGatewayV3Deploy.s.sol"; import { MainchainBridgeManagerDeploy } from "@ronin/script/contracts/MainchainBridgeManagerDeploy.s.sol"; import { MainchainPauseEnforcerDeploy } from "@ronin/script/contracts/MainchainPauseEnforcerDeploy.s.sol"; +import { MainchainWethVaultDeploy } from "@ronin/script/contracts/MainchainWethVaultDeploy.s.sol"; import { WETHDeploy } from "@ronin/script/contracts/token/WETHDeploy.s.sol"; import { WRONDeploy } from "@ronin/script/contracts/token/WRONDeploy.s.sol"; import { AXSDeploy } from "@ronin/script/contracts/token/AXSDeploy.s.sol"; @@ -74,6 +76,7 @@ contract BaseIntegration_Test is Base_Test { PauseEnforcer _mainchainPauseEnforcer; MainchainGatewayV3 _mainchainGatewayV3; MainchainBridgeManager _mainchainBridgeManager; + WETHVault _mainchainWethVault; MockWrappedToken _roninWeth; MockWrappedToken _roninWron; @@ -135,6 +138,7 @@ contract BaseIntegration_Test is Base_Test { _mainchainPauseEnforcer = new MainchainPauseEnforcerDeploy().run(); _mainchainGatewayV3 = new MainchainGatewayV3Deploy().run(); _mainchainBridgeManager = new MainchainBridgeManagerDeploy().run(); + _mainchainWethVault = new MainchainWethVaultDeploy().run(); _mainchainWeth = new WETHDeploy().run(); _mainchainAxs = new AXSDeploy().run(); @@ -163,6 +167,7 @@ contract BaseIntegration_Test is Base_Test { _mainchainPauseEnforcerInitialize(); _constructForMainchainBridgeManager(); _mainchainGatewayV3Initialize(); + _constructForMainchainWethVault(); } function _getMainchainAndRoninTokens() internal view returns (address[] memory mainchainTokens, address[] memory roninTokens) { @@ -428,6 +433,13 @@ contract BaseIntegration_Test is Base_Test { } } + function _constructForMainchainWethVault() internal { + vm.startPrank(_config.getSender()); + _mainchainWethVault.setWeth(address(_mainchainWeth)); + _mainchainWethVault.transferOwnership(address(_mainchainGatewayV3)); + vm.stopPrank(); + } + function _mainchainGatewayV3Initialize() internal { (address[] memory mainchainTokens, address[] memory roninTokens) = _getMainchainAndRoninTokens(); uint256 tokenNum = mainchainTokens.length; @@ -486,13 +498,13 @@ contract BaseIntegration_Test is Base_Test { _mainchainGatewayV3.initializeV2(address(_mainchainBridgeManager)); _mainchainGatewayV3.initializeV3(_param.mainchainBridgeManager.bridgeOperators, _param.mainchainBridgeManager.voteWeights); + _mainchainGatewayV3.initializeV4(payable(address(_mainchainWethVault))); } function _mainchainPauseEnforcerInitialize() internal { _param.mainchainPauseEnforcer.target = address(_mainchainGatewayV3); ISharedArgument.PauseEnforcerParam memory param = _param.mainchainPauseEnforcer; - _mainchainPauseEnforcer.initialize(IPauseTarget(param.target), param.admin, param.sentries); } @@ -576,7 +588,7 @@ contract BaseIntegration_Test is Base_Test { LibTransfer.Receipt memory receipt, uint256[] memory signerPKs, bytes32 domainSeparator - ) internal pure returns (SignatureConsumer.Signature[] memory sigs) { + ) internal pure returns (SignatureConsumer.Signature[] memory sigs) { sigs = new SignatureConsumer.Signature[](signerPKs.length); for (uint256 i; i < signerPKs.length; i++) { diff --git a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.t.sol b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.t.sol index 49b71529..4c84f393 100644 --- a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.t.sol +++ b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.t.sol @@ -6,9 +6,10 @@ import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; import { Transfer } from "@ronin/contracts/libraries/Transfer.sol"; import { Token } from "@ronin/contracts/libraries/Token.sol"; import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; +import { MockDiscardEther } from "@ronin/test/mocks/MockDiscardEther.sol"; import "../../BaseIntegration.t.sol"; -contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test{ +contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test { using Transfer for Transfer.Receipt; Transfer.Receipt _withdrawalReceipt; @@ -30,10 +31,6 @@ contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test{ _withdrawalReceipt.info.erc = Token.Standard.ERC20; _withdrawalReceipt.info.id = 0; _withdrawalReceipt.info.quantity = 0; - - vm.deal(address(_mainchainGatewayV3), 10 ether); - vm.prank(address(_mainchainGatewayV3)); - _mainchainWeth.deposit{ value: 10 ether }(); } function test_submitWithdrawal_Native() public { @@ -41,6 +38,22 @@ contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test{ SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs, _domainSeparator); + vm.deal(address(_mainchainGatewayV3), 10 ether); + _mainchainGatewayV3.submitWithdrawal(_withdrawalReceipt, signatures); + } + + function test_submitWithdrawal_WETH() public { + MockDiscardEther notReceiveEtherRecipient = new MockDiscardEther(); + + _withdrawalReceipt.mainchain.addr = address(notReceiveEtherRecipient); + + vm.deal(address(_mainchainGatewayV3), 10 ether); + + _withdrawalReceipt.info.quantity = 10; + SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(_withdrawalReceipt, _param.test.operatorPKs, _domainSeparator); + + vm.expectEmit(address(_mainchainWeth)); + emit IWETH.Transfer(address(_mainchainGatewayV3), address(notReceiveEtherRecipient), _withdrawalReceipt.info.quantity); _mainchainGatewayV3.submitWithdrawal(_withdrawalReceipt, signatures); } @@ -65,4 +78,4 @@ contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test{ _mainchainGatewayV3.submitWithdrawal(_withdrawalReceipt, signatures); } - } +} diff --git a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.weth.benchmark.t.sol b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.weth.benchmark.t.sol index cf190f85..fc5cd777 100644 --- a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.weth.benchmark.t.sol +++ b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.weth.benchmark.t.sol @@ -6,6 +6,7 @@ import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; import { Transfer } from "@ronin/contracts/libraries/Transfer.sol"; import { Token } from "@ronin/contracts/libraries/Token.sol"; import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; +import { MockDiscardEther } from "@ronin/test/mocks/MockDiscardEther.sol"; import "../../BaseIntegration.t.sol"; contract SubmitWithdrawal_MainchainGatewayV3_Weth_Benchmark_Test is BaseIntegration_Test { @@ -19,7 +20,7 @@ contract SubmitWithdrawal_MainchainGatewayV3_Weth_Benchmark_Test is BaseIntegrat function setUp() public virtual override { super.setUp(); - DiscardEther notReceiveEtherRecipient = new DiscardEther(); + MockDiscardEther notReceiveEtherRecipient = new MockDiscardEther(); _domainSeparator = _mainchainGatewayV3.DOMAIN_SEPARATOR(); @@ -27,10 +28,10 @@ contract SubmitWithdrawal_MainchainGatewayV3_Weth_Benchmark_Test is BaseIntegrat _withdrawalReceipt.kind = Transfer.Kind.Withdrawal; _withdrawalReceipt.ronin.addr = makeAddr("requester"); _withdrawalReceipt.ronin.tokenAddr = address(_roninWeth); - _withdrawalReceipt.ronin.chainId =block.chainid; + _withdrawalReceipt.ronin.chainId = block.chainid; _withdrawalReceipt.mainchain.addr = address(notReceiveEtherRecipient); _withdrawalReceipt.mainchain.tokenAddr = address(_mainchainWeth); - _withdrawalReceipt.mainchain.chainId =block.chainid; + _withdrawalReceipt.mainchain.chainId = block.chainid; _withdrawalReceipt.info.erc = Token.Standard.ERC20; _withdrawalReceipt.info.id = 0; _withdrawalReceipt.info.quantity = 0; @@ -50,17 +51,3 @@ contract SubmitWithdrawal_MainchainGatewayV3_Weth_Benchmark_Test is BaseIntegrat _mainchainGatewayV3.submitWithdrawal(_withdrawalReceipt, _signatures); } } - -contract DiscardEther { - fallback() external payable { - _fallback(); - } - - receive() external payable { - _fallback(); - } - - function _fallback() internal { - revert("Not receive ether"); - } -} \ No newline at end of file diff --git a/test/mocks/MockDiscardEther.sol b/test/mocks/MockDiscardEther.sol new file mode 100644 index 00000000..6e7c11f6 --- /dev/null +++ b/test/mocks/MockDiscardEther.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +contract MockDiscardEther { + fallback() external payable { + _fallback(); + } + + receive() external payable { + _fallback(); + } + + function _fallback() internal view { + revert("Not receive ether"); + } +} From 0f1dc4790e761f6121f6c121051f295da58ab5e2 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 6 Mar 2024 15:22:57 +0700 Subject: [PATCH 029/180] nit: rename WETHVault to WethMediator --- script/GeneralConfig.sol | 2 +- ...s.sol => MainchainWethMediatorDeploy.s.sol} | 10 +++++----- script/interfaces/ISharedArgument.sol | 4 ++-- script/utils/Contract.sol | 4 ++-- .../{WETHVault.sol => WethMediator.sol} | 2 +- src/mainchain/MainchainGatewayV3.sol | 16 ++++++++-------- test/bridge/integration/BaseIntegration.t.sol | 18 +++++++++--------- 7 files changed, 28 insertions(+), 28 deletions(-) rename script/contracts/{MainchainWethVaultDeploy.s.sol => MainchainWethMediatorDeploy.s.sol} (51%) rename src/extensions/{WETHVault.sol => WethMediator.sol} (96%) diff --git a/script/GeneralConfig.sol b/script/GeneralConfig.sol index da6b26bb..8b6a4f16 100644 --- a/script/GeneralConfig.sol +++ b/script/GeneralConfig.sol @@ -58,7 +58,7 @@ contract GeneralConfig is BaseGeneralConfig, Utils { _contractNameMap[Contract.RoninPauseEnforcer.key()] = "PauseEnforcer"; _contractNameMap[Contract.MainchainPauseEnforcer.key()] = "PauseEnforcer"; - _contractNameMap[Contract.MainchainWETHVault.key()] = "WETHVault"; + _contractNameMap[Contract.MainchainWethMediator.key()] = "WethMediator"; } function _mapContractName(Contract contractEnum) internal { diff --git a/script/contracts/MainchainWethVaultDeploy.s.sol b/script/contracts/MainchainWethMediatorDeploy.s.sol similarity index 51% rename from script/contracts/MainchainWethVaultDeploy.s.sol rename to script/contracts/MainchainWethMediatorDeploy.s.sol index bdbaecfa..65d15b9b 100644 --- a/script/contracts/MainchainWethVaultDeploy.s.sol +++ b/script/contracts/MainchainWethMediatorDeploy.s.sol @@ -1,15 +1,15 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import { WETHVault } from "@ronin/contracts/extensions/WETHVault.sol"; +import { WethMediator } from "@ronin/contracts/extensions/WethMediator.sol"; import { Contract } from "../utils/Contract.sol"; import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; import { Migration } from "../Migration.s.sol"; -contract MainchainWethVaultDeploy is Migration { +contract MainchainWethMediatorDeploy is Migration { function _defaultArguments() internal virtual override returns (bytes memory args) { - ISharedArgument.WETHVaultParam memory param = config.sharedArguments().mainchainWethVault; + ISharedArgument.WethMediatorParam memory param = config.sharedArguments().mainchainWethMediator; args = abi.encode( param.weth, @@ -17,7 +17,7 @@ contract MainchainWethVaultDeploy is Migration { ); } - function run() public virtual returns (WETHVault) { - return WETHVault(_deployImmutable(Contract.MainchainWETHVault.key())); + function run() public virtual returns (WethMediator) { + return WethMediator(_deployImmutable(Contract.MainchainWethMediator.key())); } } diff --git a/script/interfaces/ISharedArgument.sol b/script/interfaces/ISharedArgument.sol index 6c5b0719..dc2e8090 100644 --- a/script/interfaces/ISharedArgument.sol +++ b/script/interfaces/ISharedArgument.sol @@ -106,7 +106,7 @@ interface ISharedArgument is IGeneralConfig { uint256[] governorPKs; } - struct WETHVaultParam { + struct WethMediatorParam { address weth; address owner; } @@ -116,7 +116,7 @@ interface ISharedArgument is IGeneralConfig { BridgeManagerParam mainchainBridgeManager; MainchainGatewayV3Param mainchainGatewayV3; PauseEnforcerParam mainchainPauseEnforcer; - WETHVaultParam mainchainWethVault; + WethMediatorParam mainchainWethMediator; // ronin BridgeManagerParam roninBridgeManager; RoninGatewayV3Param roninGatewayV3; diff --git a/script/utils/Contract.sol b/script/utils/Contract.sol index 2cfecfe7..a1c8e9c4 100644 --- a/script/utils/Contract.sol +++ b/script/utils/Contract.sol @@ -19,7 +19,7 @@ enum Contract { MainchainPauseEnforcer, MainchainGatewayV3, MainchainBridgeManager, - MainchainWETHVault + MainchainWethMediator } using { key, name } for Contract global; @@ -46,7 +46,7 @@ function name(Contract contractEnum) pure returns (string memory) { if (contractEnum == Contract.MainchainPauseEnforcer) return "PauseEnforcer"; if (contractEnum == Contract.MainchainGatewayV3) return "MainchainGatewayV3"; if (contractEnum == Contract.MainchainBridgeManager) return "MainchainBridgeManager"; - if (contractEnum == Contract.MainchainWETHVault) return "WETHVault"; + if (contractEnum == Contract.MainchainWethMediator) return "WethMediator"; revert("Contract: Unknown contract"); } diff --git a/src/extensions/WETHVault.sol b/src/extensions/WethMediator.sol similarity index 96% rename from src/extensions/WETHVault.sol rename to src/extensions/WethMediator.sol index 8ce38ec0..6cc6ee00 100644 --- a/src/extensions/WETHVault.sol +++ b/src/extensions/WethMediator.sol @@ -6,7 +6,7 @@ import "@openzeppelin/contracts/access/Ownable.sol"; import "../interfaces/IWETH.sol"; -contract WETHVault is Ownable { +contract WethMediator is Ownable { IWETH public weth; error ErrInsufficientBalance(); diff --git a/src/mainchain/MainchainGatewayV3.sol b/src/mainchain/MainchainGatewayV3.sol index c5e44709..f51333f7 100644 --- a/src/mainchain/MainchainGatewayV3.sol +++ b/src/mainchain/MainchainGatewayV3.sol @@ -6,7 +6,7 @@ import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import { IBridgeManager } from "../interfaces/bridge/IBridgeManager.sol"; import { IBridgeManagerCallback } from "../interfaces/bridge/IBridgeManagerCallback.sol"; import { HasContracts, ContractType } from "../extensions/collections/HasContracts.sol"; -import "../extensions/WETHVault.sol"; +import "../extensions/WethMediator.sol"; import "../extensions/WithdrawalLimitation.sol"; import "../libraries/Transfer.sol"; import "../interfaces/IMainchainGatewayV3.sol"; @@ -41,7 +41,7 @@ contract MainchainGatewayV3 is WithdrawalLimitation, Initializable, AccessContro uint96 private _totalOperatorWeight; mapping(address operator => uint96 weight) private _operatorWeight; - WETHVault public wethVault; + WethMediator public wethMediator; fallback() external payable { // _fallback(); @@ -110,8 +110,8 @@ contract MainchainGatewayV3 is WithdrawalLimitation, Initializable, AccessContro _totalOperatorWeight = totalWeight; } - function initializeV4(address payable wethVault_) external reinitializer(4) { - wethVault = WETHVault(wethVault_); + function initializeV4(address payable wethMediator_) external reinitializer(4) { + wethMediator = WethMediator(wethMediator_); } /** @@ -343,11 +343,11 @@ contract MainchainGatewayV3 is WithdrawalLimitation, Initializable, AccessContro _request.info.transferFrom(_requester, address(this), _request.tokenAddr); // Withdraw if token is WETH - // The withdraw of WETH must go via `WethVault`, because `WETH.withdraw` only sends 2300 gas, which is insufficient when recipient is a proxy. + // The withdraw of WETH must go via `WethMediator`, because `WETH.withdraw` only sends 2300 gas, which is insufficient when recipient is a proxy. if (_roninWeth == _request.tokenAddr) { - IWETH(_roninWeth).transfer(address(wethVault), _request.info.quantity); - wethVault.transferToVault(_request.info.quantity); - wethVault.withdrawToOwner(_request.info.quantity); + IWETH(_roninWeth).transfer(address(wethMediator), _request.info.quantity); + wethMediator.transferToVault(_request.info.quantity); + wethMediator.withdrawToOwner(_request.info.quantity); } } diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index 105fe476..e87e2293 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -16,7 +16,7 @@ import { BridgeSlash } from "@ronin/contracts/ronin/gateway/BridgeSlash.sol"; import { BridgeReward } from "@ronin/contracts/ronin/gateway/BridgeReward.sol"; import { MainchainGatewayV3 } from "@ronin/contracts/mainchain/MainchainGatewayV3.sol"; import { MainchainBridgeManager } from "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; -import { WETHVault } from "@ronin/contracts/extensions/WETHVault.sol"; +import { WethMediator } from "@ronin/contracts/extensions/WethMediator.sol"; import { MockERC20 } from "@ronin/contracts/mocks/token/MockERC20.sol"; import { MockERC721 } from "@ronin/contracts/mocks/token/MockERC721.sol"; @@ -49,7 +49,7 @@ import { RoninPauseEnforcerDeploy } from "@ronin/script/contracts/RoninPauseEnfo import { MainchainGatewayV3Deploy } from "@ronin/script/contracts/MainchainGatewayV3Deploy.s.sol"; import { MainchainBridgeManagerDeploy } from "@ronin/script/contracts/MainchainBridgeManagerDeploy.s.sol"; import { MainchainPauseEnforcerDeploy } from "@ronin/script/contracts/MainchainPauseEnforcerDeploy.s.sol"; -import { MainchainWethVaultDeploy } from "@ronin/script/contracts/MainchainWethVaultDeploy.s.sol"; +import { MainchainWethMediatorDeploy } from "@ronin/script/contracts/MainchainWethMediatorDeploy.s.sol"; import { WETHDeploy } from "@ronin/script/contracts/token/WETHDeploy.s.sol"; import { WRONDeploy } from "@ronin/script/contracts/token/WRONDeploy.s.sol"; import { AXSDeploy } from "@ronin/script/contracts/token/AXSDeploy.s.sol"; @@ -76,7 +76,7 @@ contract BaseIntegration_Test is Base_Test { PauseEnforcer _mainchainPauseEnforcer; MainchainGatewayV3 _mainchainGatewayV3; MainchainBridgeManager _mainchainBridgeManager; - WETHVault _mainchainWethVault; + WethMediator _mainchainWethMediator; MockWrappedToken _roninWeth; MockWrappedToken _roninWron; @@ -138,7 +138,7 @@ contract BaseIntegration_Test is Base_Test { _mainchainPauseEnforcer = new MainchainPauseEnforcerDeploy().run(); _mainchainGatewayV3 = new MainchainGatewayV3Deploy().run(); _mainchainBridgeManager = new MainchainBridgeManagerDeploy().run(); - _mainchainWethVault = new MainchainWethVaultDeploy().run(); + _mainchainWethMediator = new MainchainWethMediatorDeploy().run(); _mainchainWeth = new WETHDeploy().run(); _mainchainAxs = new AXSDeploy().run(); @@ -167,7 +167,7 @@ contract BaseIntegration_Test is Base_Test { _mainchainPauseEnforcerInitialize(); _constructForMainchainBridgeManager(); _mainchainGatewayV3Initialize(); - _constructForMainchainWethVault(); + _constructForMainchainWethMediator(); } function _getMainchainAndRoninTokens() internal view returns (address[] memory mainchainTokens, address[] memory roninTokens) { @@ -433,10 +433,10 @@ contract BaseIntegration_Test is Base_Test { } } - function _constructForMainchainWethVault() internal { + function _constructForMainchainWethMediator() internal { vm.startPrank(_config.getSender()); - _mainchainWethVault.setWeth(address(_mainchainWeth)); - _mainchainWethVault.transferOwnership(address(_mainchainGatewayV3)); + _mainchainWethMediator.setWeth(address(_mainchainWeth)); + _mainchainWethMediator.transferOwnership(address(_mainchainGatewayV3)); vm.stopPrank(); } @@ -498,7 +498,7 @@ contract BaseIntegration_Test is Base_Test { _mainchainGatewayV3.initializeV2(address(_mainchainBridgeManager)); _mainchainGatewayV3.initializeV3(_param.mainchainBridgeManager.bridgeOperators, _param.mainchainBridgeManager.voteWeights); - _mainchainGatewayV3.initializeV4(payable(address(_mainchainWethVault))); + _mainchainGatewayV3.initializeV4(payable(address(_mainchainWethMediator))); } function _mainchainPauseEnforcerInitialize() internal { From 60409395369c72e76716f52d1f989c123bed68c0 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 6 Mar 2024 15:25:11 +0700 Subject: [PATCH 030/180] nit: fix mock --- test/mocks/MockDiscardEther.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/mocks/MockDiscardEther.sol b/test/mocks/MockDiscardEther.sol index 6e7c11f6..bbf4befb 100644 --- a/test/mocks/MockDiscardEther.sol +++ b/test/mocks/MockDiscardEther.sol @@ -10,7 +10,7 @@ contract MockDiscardEther { _fallback(); } - function _fallback() internal view { + function _fallback() internal pure { revert("Not receive ether"); } } From 5dfec58379bbb2f670e533cdd3fea8d351925ce6 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 5 Mar 2024 23:01:29 +0700 Subject: [PATCH 031/180] feat(BridgeReward, BridgeTracking): allow syncReward multiple periods --- src/interfaces/bridge/IBridgeReward.sol | 12 ++--- src/ronin/gateway/BridgeReward.sol | 60 ++++++++++++------------ src/ronin/gateway/BridgeTracking.sol | 61 ++++++------------------- 3 files changed, 46 insertions(+), 87 deletions(-) diff --git a/src/interfaces/bridge/IBridgeReward.sol b/src/interfaces/bridge/IBridgeReward.sol index 404d5d9e..6569eb54 100644 --- a/src/interfaces/bridge/IBridgeReward.sol +++ b/src/interfaces/bridge/IBridgeReward.sol @@ -21,15 +21,9 @@ interface IBridgeReward is IBridgeRewardEvents { * * Requirements: * - This method is only called once each period. - * - The caller must be the bridge tracking contract or a bridge operator. - */ - function execSyncReward( - address[] calldata operators, - uint256[] calldata ballots, - uint256 totalBallot, - uint256 totalVote, - uint256 period - ) external; + * - The caller must be the bridge tracking contract + */ + function execSyncReward() external; /** * @dev Retrieve the total amount of rewards that have been topped up in the contract. diff --git a/src/ronin/gateway/BridgeReward.sol b/src/ronin/gateway/BridgeReward.sol index a70fde37..1da2b2d4 100644 --- a/src/ronin/gateway/BridgeReward.sol +++ b/src/ronin/gateway/BridgeReward.sol @@ -26,6 +26,8 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT TUint256Slot private constant $_TOTAL_REWARDS_TOPPED_UP = TUint256Slot.wrap(0x9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c64); /// @dev value is equal to keccak256("@ronin.dpos.gateway.BridgeReward.totalRewardScattered.slot") - 1 TUint256Slot private constant $_TOTAL_REWARDS_SCATTERED = TUint256Slot.wrap(0x3663384f6436b31a97d9c9a02f64ab8b73ead575c5b6224fa0800a6bd57f62f4); + /// @dev value is equal to keccak256("@ronin.dpos.gateway.BridgeReward.maxRewardingPeriodCount.slot") - 1 + TUint256Slot private constant $_MAX_REWARDING_PERIOD_COUNT = TUint256Slot.wrap(0xaf260ffaff563b9407c1c5fe4aec2be8632142d158c44bb0ce4d471cb4883b8c); address private immutable _self; @@ -62,6 +64,10 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT _setContract(ContractType.GOVERNANCE_ADMIN, address(0)); } + function initializeV2() external reinitializer(2) { + $_MAX_REWARDING_PERIOD_COUNT.store(5); + } + /** * @inheritdoc IBridgeReward */ @@ -72,21 +78,39 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT /** * @inheritdoc IBridgeReward */ - function syncReward(uint256 periodLength) external { + function syncReward(uint256 periodCount) external { if (!_isBridgeOperator(msg.sender)) revert ErrUnauthorizedCall(msg.sig); + uint256 latestRewardedPeriod = getLatestRewardedPeriod(); + uint256 currentPeriod = IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod(); + if (latestRewardedPeriod + periodCount > currentPeriod) revert ErrInvalidArguments(msg.sig); + if (currentPeriod <= latestRewardedPeriod) revert ErrInvalidArguments(msg.sig); + + _syncRewardBatch(latestRewardedPeriod, periodCount); + } + + /** + * @inheritdoc IBridgeReward + */ + function execSyncReward() external onlyContract(ContractType.BRIDGE_TRACKING) { uint256 latestRewardedPeriod = getLatestRewardedPeriod(); uint256 currentPeriod = IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod(); if (currentPeriod <= latestRewardedPeriod) revert ErrInvalidArguments(msg.sig); - if (latestRewardedPeriod + periodLength > currentPeriod) revert ErrInvalidArguments(msg.sig); - $_LATEST_REWARDED_PERIOD.addAssign(periodLength); + // Restrict number of period to reward in a transaction, to avoid consume too much gas + uint toRewardPeriodCount = currentPeriod - latestRewardedPeriod; + toRewardPeriodCount = Math.min(toRewardPeriodCount, $_MAX_REWARDING_PERIOD_COUNT); + _syncRewardBatch(latestRewardedPeriod, toRewardPeriodCount); + } + + function _syncRewardBatch(uint256 latestRewardedPeriod, uint256 periodCount) internal { address[] memory operators = IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)).getBridgeOperators(); IBridgeTracking bridgeTrackingContract = IBridgeTracking(getContract(ContractType.BRIDGE_TRACKING)); - for (uint256 i = 1; i <= periodLength; i++) { + for (uint256 i = 1; i <= periodCount; i++) { + $_LATEST_REWARDED_PERIOD.addAssign(1); _syncReward({ operators: operators, ballots: bridgeTrackingContract.getManyTotalBallots(latestRewardedPeriod, operators), @@ -97,32 +121,6 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT } } - /** - * @inheritdoc IBridgeReward - * - * @dev The `period` a.k.a. `latestSyncedPeriod` must equal to `latestRewardedPeriod` + 1. - */ - function execSyncReward( - address[] calldata operators, - uint256[] calldata ballots, - uint256 totalBallot, - uint256 totalVote, - uint256 period - ) external onlyContract(ContractType.BRIDGE_TRACKING) { - if (operators.length != ballots.length) revert ErrLengthMismatch(msg.sig); - if (operators.length == 0) return; - - // Only sync the period that is after the latest rewarded period, i.e. `latestSyncedPeriod == latestRewardedPeriod + 1`. - unchecked { - uint256 latestRewardedPeriod = getLatestRewardedPeriod(); - if (period < latestRewardedPeriod + 1) revert ErrInvalidArguments(msg.sig); - else if (period > latestRewardedPeriod + 1) revert ErrSyncTooFarPeriod(period, latestRewardedPeriod); - } - $_LATEST_REWARDED_PERIOD.store(period); - - _syncReward({ operators: operators, ballots: ballots, totalBallot: totalBallot, totalVote: totalVote, period: period }); - } - /** * @inheritdoc IBridgeReward */ @@ -167,7 +165,7 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT bool shouldSlash; uint256 sumRewards; - for (uint256 i; i < numBridgeOperators; ) { + for (uint256 i; i < numBridgeOperators;) { (reward, shouldSlash) = _calcRewardAndCheckSlashedStatus({ shouldShareEqually: shouldShareEqually, numBridgeOperators: numBridgeOperators, diff --git a/src/ronin/gateway/BridgeTracking.sol b/src/ronin/gateway/BridgeTracking.sol index c55ffa1b..f52a0f19 100644 --- a/src/ronin/gateway/BridgeTracking.sol +++ b/src/ronin/gateway/BridgeTracking.sol @@ -86,12 +86,7 @@ contract BridgeTracking is HasBridgeDeprecated, HasValidatorDeprecated, HasContr delete ______deprecatedValidator; } - function initializeV3( - address bridgeManager, - address bridgeSlash, - address bridgeReward, - address dposGA - ) external reinitializer(3) { + function initializeV3(address bridgeManager, address bridgeSlash, address bridgeReward, address dposGA) external reinitializer(3) { _setContract(ContractType.BRIDGE_MANAGER, bridgeManager); _setContract(ContractType.BRIDGE_SLASH, bridgeSlash); _setContract(ContractType.BRIDGE_REWARD, bridgeReward); @@ -143,21 +138,15 @@ contract BridgeTracking is HasBridgeDeprecated, HasValidatorDeprecated, HasContr /** * @inheritdoc IBridgeTracking */ - function getManyTotalBallots( - uint256 period, - address[] calldata operators - ) external view override returns (uint256[] memory _res) { + function getManyTotalBallots(uint256 period, address[] calldata operators) external view override returns (uint256[] memory _res) { _res = _getManyTotalBallots(period, operators); } - function _getManyTotalBallots( - uint256 period, - address[] memory operators - ) internal view returns (uint256[] memory res) { + function _getManyTotalBallots(uint256 period, address[] memory operators) internal view returns (uint256[] memory res) { uint256 length = operators.length; res = new uint256[](length); bool isBufferCounted = _isBufferCountedForPeriod(period); - for (uint i = 0; i < length; ) { + for (uint i = 0; i < length;) { res[i] = _totalBallotOf(period, operators[i], isBufferCounted); unchecked { @@ -176,10 +165,7 @@ contract BridgeTracking is HasBridgeDeprecated, HasValidatorDeprecated, HasContr /** * @inheritdoc IBridgeTracking */ - function handleVoteApproved( - VoteKind kind, - uint256 requestId - ) external override onlyContract(ContractType.BRIDGE) skipOnNotStarted { + function handleVoteApproved(VoteKind kind, uint256 requestId) external override onlyContract(ContractType.BRIDGE) skipOnNotStarted { ReceiptTrackingInfo storage _receiptInfo = _receiptTrackingInfo[kind][requestId]; // Only records for the receipt which not approved @@ -193,7 +179,7 @@ contract BridgeTracking is HasBridgeDeprecated, HasValidatorDeprecated, HasContr _bufferRequest.id = requestId; address[] storage _voters = _receiptInfo.voters; - for (uint i = 0; i < _voters.length; ) { + for (uint i = 0; i < _voters.length;) { _increaseBallot(kind, requestId, _voters[i], currentPeriod); unchecked { @@ -208,11 +194,7 @@ contract BridgeTracking is HasBridgeDeprecated, HasValidatorDeprecated, HasContr /** * @inheritdoc IBridgeTracking */ - function recordVote( - VoteKind kind, - uint256 requestId, - address operator - ) external override onlyContract(ContractType.BRIDGE) skipOnNotStarted { + function recordVote(VoteKind kind, uint256 requestId, address operator) external override onlyContract(ContractType.BRIDGE) skipOnNotStarted { uint256 period = IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod(); _trySyncBuffer(); ReceiptTrackingInfo storage _receiptInfo = _receiptTrackingInfo[kind][requestId]; @@ -239,23 +221,14 @@ contract BridgeTracking is HasBridgeDeprecated, HasValidatorDeprecated, HasContr address bridgeSlashContract = getContract(ContractType.BRIDGE_SLASH); (bool success, bytes memory returnOrRevertData) = bridgeSlashContract.call( - abi.encodeCall( - IBridgeSlash.execSlashBridgeOperators, - (allOperators, ballots, totalBallot_, totalVote_, lastSyncPeriod) - ) + abi.encodeCall(IBridgeSlash.execSlashBridgeOperators, (allOperators, ballots, totalBallot_, totalVote_, lastSyncPeriod)) ); if (!success) { - emit ExternalCallFailed( - bridgeSlashContract, - IBridgeSlash.execSlashBridgeOperators.selector, - returnOrRevertData - ); + emit ExternalCallFailed(bridgeSlashContract, IBridgeSlash.execSlashBridgeOperators.selector, returnOrRevertData); } address bridgeRewardContract = getContract(ContractType.BRIDGE_REWARD); - (success, returnOrRevertData) = bridgeRewardContract.call( - abi.encodeCall(IBridgeReward.execSyncReward, (allOperators, ballots, totalBallot_, totalVote_, lastSyncPeriod)) - ); + (success, returnOrRevertData) = bridgeRewardContract.call(abi.encodeCall(IBridgeReward.execSyncReward, ())); if (!success) { emit ExternalCallFailed(bridgeRewardContract, IBridgeReward.execSyncReward.selector, returnOrRevertData); } @@ -297,11 +270,7 @@ contract BridgeTracking is HasBridgeDeprecated, HasValidatorDeprecated, HasContr /** * @dev See `totalBallotOf`. */ - function _totalBallotOf( - uint256 period, - address operator, - bool mustCountLastStats - ) internal view returns (uint256 _totalBallot) { + function _totalBallotOf(uint256 period, address operator, bool mustCountLastStats) internal view returns (uint256 _totalBallot) { _totalBallot = _periodMetric[period].totalBallotOf[operator]; if (mustCountLastStats) { _totalBallot += _bufferMetric.data.totalBallotOf[operator]; @@ -327,7 +296,7 @@ contract BridgeTracking is HasBridgeDeprecated, HasValidatorDeprecated, HasContr _metric.totalBallot += _bufferMetric.data.totalBallot; // Copy voters info and voters' ballot - for (uint i = 0; i < _bufferMetric.data.voters.length; ) { + for (uint i = 0; i < _bufferMetric.data.voters.length;) { address voter = _bufferMetric.data.voters[i]; _metric.totalBallotOf[voter] += _bufferMetric.data.totalBallotOf[voter]; delete _bufferMetric.data.totalBallotOf[voter]; // need to manually delete each element, due to mapping @@ -338,7 +307,7 @@ contract BridgeTracking is HasBridgeDeprecated, HasValidatorDeprecated, HasContr } // Mark all receipts in the buffer as tracked. Keep total number of receipts and delete receipt details. - for (uint i = 0; i < _bufferMetric.requests.length; ) { + for (uint i = 0; i < _bufferMetric.requests.length;) { Request storage _bufferRequest = _bufferMetric.requests[i]; ReceiptTrackingInfo storage _receiptInfo = _receiptTrackingInfo[_bufferRequest.kind][_bufferRequest.id]; _receiptInfo.trackedPeriod = trackedPeriod; @@ -359,9 +328,7 @@ contract BridgeTracking is HasBridgeDeprecated, HasValidatorDeprecated, HasContr function _isBufferCountedForPeriod(uint256 queriedPeriod) internal view returns (bool) { IRoninValidatorSet validatorContract = IRoninValidatorSet(getContract(ContractType.VALIDATOR)); uint256 currentEpoch = validatorContract.epochOf(block.number); - (bool filled, uint256 periodOfNextTemporaryEpoch) = validatorContract.tryGetPeriodOfEpoch( - _bufferMetric.lastEpoch + 1 - ); + (bool filled, uint256 periodOfNextTemporaryEpoch) = validatorContract.tryGetPeriodOfEpoch(_bufferMetric.lastEpoch + 1); return filled && queriedPeriod == periodOfNextTemporaryEpoch && _bufferMetric.lastEpoch < currentEpoch; } } From 561dafd99376756564dcb21962e62e4f658fa3bd Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 6 Mar 2024 15:44:35 +0700 Subject: [PATCH 032/180] feat(Gateway): rename `Slashed` event to `BridgeSlashed` --- src/interfaces/bridge/events/IBridgeSlashEvents.sol | 2 +- src/ronin/gateway/BridgeSlash.sol | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/interfaces/bridge/events/IBridgeSlashEvents.sol b/src/interfaces/bridge/events/IBridgeSlashEvents.sol index 5e1bbd6e..2822b884 100644 --- a/src/interfaces/bridge/events/IBridgeSlashEvents.sol +++ b/src/interfaces/bridge/events/IBridgeSlashEvents.sol @@ -26,7 +26,7 @@ interface IBridgeSlashEvents { * @param period The period in which the operator is slashed. * @param slashUntilPeriod The period until which the operator is penalized. */ - event Slashed(Tier indexed tier, address indexed bridgeOperator, uint256 indexed period, uint256 slashUntilPeriod); + event BridgeSlashed(Tier indexed tier, address indexed bridgeOperator, uint256 indexed period, uint256 slashUntilPeriod); /** * @dev Emitted when a removal request is made for a bridge operator. diff --git a/src/ronin/gateway/BridgeSlash.sol b/src/ronin/gateway/BridgeSlash.sol index 3a39415b..e0f5374a 100644 --- a/src/ronin/gateway/BridgeSlash.sol +++ b/src/ronin/gateway/BridgeSlash.sol @@ -178,11 +178,11 @@ contract BridgeSlash is emit RemovalRequested(period, bridgeOperator); } - // Emit the Slashed event if the tier is not Tier 0 and bridge operator will not be removed. + // Emit the {BridgeSlashed} event if the tier is not Tier 0 and bridge operator will not be removed. // Update the slash until period number for the bridge operator if the tier is not Tier 0. if (tier != Tier.Tier0) { if (slashUntilPeriod != SLASH_PERMANENT_DURATION) { - emit Slashed(tier, bridgeOperator, period, slashUntilPeriod); + emit BridgeSlashed(tier, bridgeOperator, period, slashUntilPeriod); } // Store updated slash until period From 9f685a2858ee21736abe1f42a83351d3551c3fb5 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 6 Mar 2024 17:48:36 +0700 Subject: [PATCH 033/180] feat(BridgeManager): restrict min governors to exist --- .../BridgeManager.sol | 20 ++++++++++++++ src/interfaces/bridge/IBridgeManager.sol | 10 +++++++ .../bridge/events/IBridgeManagerEvents.sol | 5 ++++ src/libraries/AddressArrayUtils.sol | 4 +-- src/libraries/Uint96ArrayUtils.sol | 27 +++++++++++++++++++ src/mainchain/MainchainBridgeManager.sol | 10 ++----- src/ronin/gateway/RoninBridgeManager.sol | 26 +++++++----------- 7 files changed, 75 insertions(+), 27 deletions(-) create mode 100644 src/libraries/Uint96ArrayUtils.sol diff --git a/src/extensions/bridge-operator-governance/BridgeManager.sol b/src/extensions/bridge-operator-governance/BridgeManager.sol index a1541f33..f6bbb8ff 100644 --- a/src/extensions/bridge-operator-governance/BridgeManager.sol +++ b/src/extensions/bridge-operator-governance/BridgeManager.sol @@ -28,6 +28,8 @@ abstract contract BridgeManager is IBridgeManager, HasContracts, BridgeManagerQu mapping(address operator => uint96 weight) _operatorWeight; /// @dev Total weight of all governors / operators. uint256 _totalWeight; + /// @dev The minimum number of governors that must exist in the contract, to avoid the contract become non-accessible. + uint256 _minRequiredGovernor; } // keccak256(abi.encode(uint256(keccak256("ronin.storage.BridgeManagerStorageLocation")) - 1)) & ~bytes32(uint256(0xff)) @@ -71,6 +73,7 @@ abstract contract BridgeManager is IBridgeManager, HasContracts, BridgeManagerQu ); _addBridgeOperators(voteWeights, governors, bridgeOperators); + _setMinRequiredGovernor(3); } // ===================== CONFIG ======================== @@ -83,6 +86,20 @@ abstract contract BridgeManager is IBridgeManager, HasContracts, BridgeManagerQu _setContract(contractType, addr); } + /** + * @inheritdoc IBridgeManager + */ + function setMinRequiredGovernor(uint min) external override onlySelfCall { + _setMinRequiredGovernor(min); + } + + function _setMinRequiredGovernor(uint min) internal { + if (min < 3) revert ErrInvalidInput(); + BridgeManagerStorage storage $ = _getBridgeManagerStorage(); + $._minRequiredGovernor = min; + emit MinRequiredGovernorUpdated(min); + } + /** * @dev Internal function to require that the caller has governor role access. */ @@ -289,6 +306,9 @@ abstract contract BridgeManager is IBridgeManager, HasContracts, BridgeManagerQu // simply skip remove operations if inputs are empty. if (length == 0) return removeds; + if ($._governors.length - length < $._minRequiredGovernor) { + revert ErrBelowMinRequiredGovernors(); + } address iGovernor; address iOperator; diff --git a/src/interfaces/bridge/IBridgeManager.sol b/src/interfaces/bridge/IBridgeManager.sol index ccbe7d16..aa057dac 100644 --- a/src/interfaces/bridge/IBridgeManager.sol +++ b/src/interfaces/bridge/IBridgeManager.sol @@ -14,6 +14,10 @@ interface IBridgeManager is IBridgeManagerEvents { error ErrGovernorNotFound(address governor); /// @notice Error indicating that the msg.sender is not match the required governor error ErrGovernorNotMatch(address required, address sender); + /// @notice Error indicating that the governors list will go below minimum number of required governor. + error ErrBelowMinRequiredGovernors(); + /// @notice Common invalid input error + error ErrInvalidInput(); /** * @dev The domain separator used for computing hash digests in the contract. @@ -187,4 +191,10 @@ interface IBridgeManager is IBridgeManagerEvents { * @param newOperator The new address of the operator. */ function updateBridgeOperator(address currOperator, address newOperator) external; + + /** + * @dev Self-call to update the minimum required governor. + * @param min The minimum number, this must not less than 3. + */ + function setMinRequiredGovernor(uint min) external; } diff --git a/src/interfaces/bridge/events/IBridgeManagerEvents.sol b/src/interfaces/bridge/events/IBridgeManagerEvents.sol index 163d5dea..75748f6a 100644 --- a/src/interfaces/bridge/events/IBridgeManagerEvents.sol +++ b/src/interfaces/bridge/events/IBridgeManagerEvents.sol @@ -26,4 +26,9 @@ interface IBridgeManagerEvents { * @dev Emitted when a bridge operator is updated. */ event BridgeOperatorUpdated(address indexed governor, address indexed fromBridgeOperator, address indexed toBridgeOperator); + + /** + * @dev Emitted when the minimum number of required governors is updated. + */ + event MinRequiredGovernorUpdated(uint min); } diff --git a/src/libraries/AddressArrayUtils.sol b/src/libraries/AddressArrayUtils.sol index 9def728d..60aa7089 100644 --- a/src/libraries/AddressArrayUtils.sol +++ b/src/libraries/AddressArrayUtils.sol @@ -52,13 +52,13 @@ library AddressArrayUtils { c = new address[](lengthA + lengthB); } uint256 i; - for (; i < lengthA; ) { + for (; i < lengthA;) { c[i] = a[i]; unchecked { ++i; } } - for (uint256 j; j < lengthB; ) { + for (uint256 j; j < lengthB;) { c[i] = b[j]; unchecked { ++i; diff --git a/src/libraries/Uint96ArrayUtils.sol b/src/libraries/Uint96ArrayUtils.sol new file mode 100644 index 00000000..18f8d639 --- /dev/null +++ b/src/libraries/Uint96ArrayUtils.sol @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: UNLICENSED + +pragma solidity ^0.8.0; + +library Uint96ArrayUtils { + function extend(uint96[] memory a, uint96[] memory b) internal pure returns (uint96[] memory c) { + uint256 lengthA = a.length; + uint256 lengthB = b.length; + unchecked { + c = new uint96[](lengthA + lengthB); + } + uint256 i; + for (; i < lengthA;) { + c[i] = a[i]; + unchecked { + ++i; + } + } + for (uint256 j; j < lengthB;) { + c[i] = b[j]; + unchecked { + ++i; + ++j; + } + } + } +} diff --git a/src/mainchain/MainchainBridgeManager.sol b/src/mainchain/MainchainBridgeManager.sol index ff9934d5..fbd2c526 100644 --- a/src/mainchain/MainchainBridgeManager.sol +++ b/src/mainchain/MainchainBridgeManager.sol @@ -29,7 +29,7 @@ contract MainchainBridgeManager is BridgeManager, GovernanceRelay, GlobalGoverna CoreGovernance(DEFAULT_EXPIRY_DURATION) GlobalCoreGovernance(targetOptions, targets) BridgeManager(num, denom, roninChainId, bridgeContract, callbackRegisters, bridgeOperators, governors, voteWeights) - {} + { } /** * @dev See `GovernanceRelay-_relayProposal`. @@ -56,13 +56,7 @@ contract MainchainBridgeManager is BridgeManager, GovernanceRelay, GlobalGoverna Ballot.VoteType[] calldata supports_, Signature[] calldata signatures ) external onlyGovernor { - _relayGlobalProposal({ - globalProposal: globalProposal, - supports_: supports_, - signatures: signatures, - domainSeparator: DOMAIN_SEPARATOR, - creator: msg.sender - }); + _relayGlobalProposal({ globalProposal: globalProposal, supports_: supports_, signatures: signatures, domainSeparator: DOMAIN_SEPARATOR, creator: msg.sender }); } /** diff --git a/src/ronin/gateway/RoninBridgeManager.sol b/src/ronin/gateway/RoninBridgeManager.sol index 7c4084c7..3e1452bf 100644 --- a/src/ronin/gateway/RoninBridgeManager.sol +++ b/src/ronin/gateway/RoninBridgeManager.sol @@ -3,7 +3,11 @@ pragma solidity ^0.8.0; import { ContractType, RoleAccess, ErrUnauthorized, BridgeManager } from "../../extensions/bridge-operator-governance/BridgeManager.sol"; import { Ballot, GlobalProposal, Proposal, GovernanceProposal } from "../../extensions/sequential-governance/governance-proposal/GovernanceProposal.sol"; -import { CoreGovernance, GlobalCoreGovernance, GlobalGovernanceProposal } from "../../extensions/sequential-governance/governance-proposal/GlobalGovernanceProposal.sol"; +import { + CoreGovernance, + GlobalCoreGovernance, + GlobalGovernanceProposal +} from "../../extensions/sequential-governance/governance-proposal/GlobalGovernanceProposal.sol"; import { VoteStatusConsumer } from "../../interfaces/consumers/VoteStatusConsumer.sol"; import { ErrQueryForEmptyVote } from "../../utils/CommonErrors.sol"; @@ -25,7 +29,7 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan CoreGovernance(expiryDuration) GlobalCoreGovernance(targetOptions, targets) BridgeManager(num, denom, roninChainId, bridgeContract, callbackRegisters, bridgeOperators, governors, voteWeights) - {} + { } /** * CURRENT NETWORK @@ -101,21 +105,14 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan * - The method caller is governor. * */ - function castProposalVoteForCurrentNetwork( - Proposal.ProposalDetail calldata proposal, - Ballot.VoteType support - ) external onlyGovernor { + function castProposalVoteForCurrentNetwork(Proposal.ProposalDetail calldata proposal, Ballot.VoteType support) external onlyGovernor { _castProposalVoteForCurrentNetwork(msg.sender, proposal, support); } /** * @dev See `GovernanceProposal-_castProposalBySignatures`. */ - function castProposalBySignatures( - Proposal.ProposalDetail calldata proposal, - Ballot.VoteType[] calldata supports_, - Signature[] calldata signatures - ) external { + function castProposalBySignatures(Proposal.ProposalDetail calldata proposal, Ballot.VoteType[] calldata supports_, Signature[] calldata signatures) external { _castProposalBySignatures(proposal, supports_, signatures, DOMAIN_SEPARATOR); } @@ -176,12 +173,7 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan Ballot.VoteType[] calldata supports_, Signature[] calldata signatures ) external { - _castGlobalProposalBySignatures({ - globalProposal: globalProposal, - supports_: supports_, - signatures: signatures, - domainSeparator: DOMAIN_SEPARATOR - }); + _castGlobalProposalBySignatures({ globalProposal: globalProposal, supports_: supports_, signatures: signatures, domainSeparator: DOMAIN_SEPARATOR }); } /** From 93e10d02452828494a5501d1c7c02ef947c63e2a Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 6 Mar 2024 17:49:07 +0700 Subject: [PATCH 034/180] test: add test of below min required governors, fix other tests --- script/interfaces/ISharedArgument.sol | 1 + test/bridge/integration/BaseIntegration.t.sol | 39 ++++++++++++++++- .../bridge-manager/BridgeManager.t.sol | 20 +++++---- .../concrete/bridge-manager/constructor.t.sol | 2 +- .../bridge-manager/remove/remove.t.sol | 24 +++++++---- .../bridge-manager/BridgeManagerCRUD.t.sol | 41 +++++++++++++----- .../fuzz/bridge-manager/BridgeSlash.t.sol | 3 -- .../unit/fuzz/utils/BridgeManagerUtils.t.sol | 41 +++++++++++------- test/mocks/MockBridgeManager.sol | 42 +++++++++---------- 9 files changed, 147 insertions(+), 66 deletions(-) diff --git a/script/interfaces/ISharedArgument.sol b/script/interfaces/ISharedArgument.sol index 37971d4d..2d4e7374 100644 --- a/script/interfaces/ISharedArgument.sol +++ b/script/interfaces/ISharedArgument.sol @@ -18,6 +18,7 @@ interface ISharedArgument is IGeneralConfig { uint96[] voteWeights; GlobalProposal.TargetOption[] targetOptions; address[] targets; + uint256 minRequiredGovernor; } struct MainchainGatewayV3Param { diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index 0be51cd2..858140dd 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -28,6 +28,7 @@ import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/Signatu import { Ballot } from "@ronin/contracts/libraries/Ballot.sol"; import { Transfer as LibTransfer } from "@ronin/contracts/libraries/Transfer.sol"; import { GlobalCoreGovernance } from "@ronin/contracts/extensions/sequential-governance/GlobalCoreGovernance.sol"; +import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; import { IHasContracts } from "@ronin/contracts/interfaces/collections/IHasContracts.sol"; import { IBridgeManagerCallbackRegister } from "@ronin/contracts/interfaces/bridge/IBridgeManagerCallbackRegister.sol"; import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; @@ -298,6 +299,7 @@ contract BaseIntegration_Test is Base_Test { _param.roninBridgeManager.callbackRegisters = wrapAddress(address(_bridgeSlash)); _param.roninBridgeManager.targetOptions = options; _param.roninBridgeManager.targets = targets; + _param.roninBridgeManager.minRequiredGovernor = 3; ISharedArgument.BridgeManagerParam memory param = _param.roninBridgeManager; uint256 length = param.governors.length; @@ -355,6 +357,23 @@ contract BaseIntegration_Test is Base_Test { vm.prank(_param.roninBridgeManager.governors[0]); _roninBridgeManager.proposeGlobalProposalStructAndCastVotes(globalProposal, supports_, signatures); } + + { + // set min governors + GlobalProposal.GlobalProposalDetail memory globalProposal = _roninProposalUtils.createGlobalProposal({ + expiryTimestamp: block.timestamp + 10, + targetOption: GlobalProposal.TargetOption.BridgeManager, + value: 0, + calldata_: abi.encodeCall(IBridgeManager.setMinRequiredGovernor, (_param.roninBridgeManager.minRequiredGovernor)), + gasAmount: 500_000, + nonce: _roninBridgeManager.round(0) + 1 + }); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignaturesGlobal(globalProposal, _param.test.governorPKs); + + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.proposeGlobalProposalStructAndCastVotes(globalProposal, supports_, signatures); + } } function _constructForMainchainBridgeManager() internal { @@ -369,6 +388,7 @@ contract BaseIntegration_Test is Base_Test { _param.mainchainBridgeManager.callbackRegisters = getEmptyAddressArray(); _param.mainchainBridgeManager.targetOptions = options; _param.mainchainBridgeManager.targets = targets; + _param.mainchainBridgeManager.minRequiredGovernor = 3; ISharedArgument.BridgeManagerParam memory param = _param.mainchainBridgeManager; uint256 length = param.governors.length; @@ -426,6 +446,23 @@ contract BaseIntegration_Test is Base_Test { vm.prank(_param.roninBridgeManager.governors[0]); _mainchainBridgeManager.relayGlobalProposal(globalProposal, supports_, signatures); } + + { + // set min governors + GlobalProposal.GlobalProposalDetail memory globalProposal = _roninProposalUtils.createGlobalProposal({ + expiryTimestamp: block.timestamp + 10, + targetOption: GlobalProposal.TargetOption.BridgeManager, + value: 0, + calldata_: abi.encodeCall(IBridgeManager.setMinRequiredGovernor, (_param.roninBridgeManager.minRequiredGovernor)), + gasAmount: 500_000, + nonce: _mainchainBridgeManager.round(0) + 1 + }); + + SignatureConsumer.Signature[] memory signatures = _mainchainProposalUtils.generateSignaturesGlobal(globalProposal, _param.test.governorPKs); + + vm.prank(_param.roninBridgeManager.governors[0]); + _mainchainBridgeManager.relayGlobalProposal(globalProposal, supports_, signatures); + } } function _mainchainGatewayV3Initialize() internal { @@ -576,7 +613,7 @@ contract BaseIntegration_Test is Base_Test { LibTransfer.Receipt memory receipt, uint256[] memory signerPKs, bytes32 domainSeparator - ) internal pure returns (SignatureConsumer.Signature[] memory sigs) { + ) internal pure returns (SignatureConsumer.Signature[] memory sigs) { sigs = new SignatureConsumer.Signature[](signerPKs.length); for (uint256 i; i < signerPKs.length; i++) { diff --git a/test/bridge/unit/concrete/bridge-manager/BridgeManager.t.sol b/test/bridge/unit/concrete/bridge-manager/BridgeManager.t.sol index 78ed19fe..25498fb2 100644 --- a/test/bridge/unit/concrete/bridge-manager/BridgeManager.t.sol +++ b/test/bridge/unit/concrete/bridge-manager/BridgeManager.t.sol @@ -35,20 +35,26 @@ contract BridgeManager_Unit_Concrete_Test is Base_Test { } function setUp() public virtual { - address[] memory bridgeOperators = new address[](3); + address[] memory bridgeOperators = new address[](5); bridgeOperators[0] = address(0x10000); bridgeOperators[1] = address(0x10001); bridgeOperators[2] = address(0x10002); + bridgeOperators[3] = address(0x10003); + bridgeOperators[4] = address(0x10004); - address[] memory governors = new address[](3); + address[] memory governors = new address[](5); governors[0] = address(0x20000); governors[1] = address(0x20001); governors[2] = address(0x20002); + governors[3] = address(0x20003); + governors[4] = address(0x20004); - uint96[] memory voteWeights = new uint96[](3); + uint96[] memory voteWeights = new uint96[](5); voteWeights[0] = 100; voteWeights[1] = 100; voteWeights[2] = 100; + voteWeights[3] = 100; + voteWeights[4] = 100; for (uint i; i < bridgeOperators.length; i++) { _bridgeOperators.push(bridgeOperators[i]); @@ -56,18 +62,18 @@ contract BridgeManager_Unit_Concrete_Test is Base_Test { _voteWeights.push(voteWeights[i]); } - _totalWeight = 300; - _totalOperator = 3; + _totalWeight = 500; + _totalOperator = 5; _bridgeManager = new MockBridgeManager(bridgeOperators, governors, voteWeights); } function _generateNewOperators() internal pure returns (address[] memory operators, address[] memory governors, uint96[] memory weights) { operators = new address[](1); - operators[0] = address(0x10003); + operators[0] = address(0x10099); governors = new address[](1); - governors[0] = address(0x20003); + governors[0] = address(0x20099); weights = new uint96[](1); weights[0] = 100; diff --git a/test/bridge/unit/concrete/bridge-manager/constructor.t.sol b/test/bridge/unit/concrete/bridge-manager/constructor.t.sol index 06e48220..16dd066f 100644 --- a/test/bridge/unit/concrete/bridge-manager/constructor.t.sol +++ b/test/bridge/unit/concrete/bridge-manager/constructor.t.sol @@ -33,7 +33,7 @@ contract Constructor_BridgeManager_Unit_Concrete_Test is BridgeManager_Unit_Conc comparingWeights: _voteWeights, expectingWeights: voteWeights }); - assertEq(_bridgeManager.totalBridgeOperator(), 3); + assertEq(_bridgeManager.totalBridgeOperator(), 5); assertEq(_bridgeManager.getTotalWeight(), _totalWeight); } diff --git a/test/bridge/unit/concrete/bridge-manager/remove/remove.t.sol b/test/bridge/unit/concrete/bridge-manager/remove/remove.t.sol index 96318586..a37ea153 100644 --- a/test/bridge/unit/concrete/bridge-manager/remove/remove.t.sol +++ b/test/bridge/unit/concrete/bridge-manager/remove/remove.t.sol @@ -20,7 +20,7 @@ contract Remove_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { function test_RevertWhen_NotSelfCall() external { // Prepare data - (address[] memory removingOperators, , , , , ) = _generateRemovingOperators(1); + (address[] memory removingOperators,,,,,) = _generateRemovingOperators(1); // Make the caller not self-call. changePrank({ msgSender: _bridgeOperators[0] }); @@ -62,9 +62,8 @@ contract Remove_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { _bridgeManager.getGovernorOf(removingOperators[0]); // Compare after and before state - (address[] memory afterBridgeOperators, address[] memory afterGovernors, uint96[] memory afterVoteWeights) = _getBridgeMembersByGovernors( - remainingGovernors - ); + (address[] memory afterBridgeOperators, address[] memory afterGovernors, uint96[] memory afterVoteWeights) = + _getBridgeMembersByGovernors(remainingGovernors); _assertBridgeMembers({ comparingOperators: afterBridgeOperators, @@ -77,7 +76,7 @@ contract Remove_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { } function test_RevertWhen_TwoAddress_Duplicated() external { - (address[] memory removingOperators, address[] memory removingGovernors, uint96[] memory removingWeights, , , ) = _generateRemovingOperators(2); + (address[] memory removingOperators, address[] memory removingGovernors, uint96[] memory removingWeights,,,) = _generateRemovingOperators(2); removingOperators[1] = removingOperators[0]; removingGovernors[1] = removingGovernors[0]; @@ -122,9 +121,8 @@ contract Remove_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { } // Compare after and before state - (address[] memory afterBridgeOperators, address[] memory afterGovernors, uint96[] memory afterVoteWeights) = _getBridgeMembersByGovernors( - remainingGovernors - ); + (address[] memory afterBridgeOperators, address[] memory afterGovernors, uint96[] memory afterVoteWeights) = + _getBridgeMembersByGovernors(remainingGovernors); _assertBridgeMembers({ comparingOperators: afterBridgeOperators, @@ -135,4 +133,14 @@ contract Remove_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { expectingWeights: remainingWeights }); } + + function test_RevertWhen_ThreeAddress_BelowMinRequiredGovernor() external { + uint TO_REMOVE_NUM = 3; + + (address[] memory removingOperators,,,,,) = _generateRemovingOperators(TO_REMOVE_NUM); + + // Run the test. + vm.expectRevert(abi.encodeWithSelector(IBridgeManager.ErrBelowMinRequiredGovernors.selector)); + _bridgeManager.removeBridgeOperators(removingOperators); + } } diff --git a/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol b/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol index 74a35d36..18380c80 100644 --- a/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol +++ b/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol @@ -4,7 +4,9 @@ pragma solidity ^0.8.0; import { console } from "forge-std/console.sol"; import { IBridgeManager, BridgeManagerUtils } from "../utils/BridgeManagerUtils.t.sol"; import { RoninGatewayV3 } from "@ronin/contracts/ronin/gateway/RoninGatewayV3.sol"; -import { RoleAccess, ContractType, AddressArrayUtils, MockBridgeManager } from "@ronin/contracts/mocks/ronin/MockBridgeManager.sol"; +import { RoleAccess, ContractType, MockBridgeManager } from "@ronin/contracts/mocks/ronin/MockBridgeManager.sol"; +import "@ronin/contracts/libraries/Uint96ArrayUtils.sol"; +import "@ronin/contracts/libraries/AddressArrayUtils.sol"; import { ErrBridgeOperatorUpdateFailed, ErrBridgeOperatorAlreadyExisted, @@ -16,6 +18,7 @@ import { contract BridgeManagerCRUDTest is BridgeManagerUtils { using AddressArrayUtils for address[]; + using Uint96ArrayUtils for uint96[]; enum InputIndex { VoteWeights, @@ -30,6 +33,10 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { _label(); } + address[] private _initOperators; + address[] private _initGovernors; + uint96[] private _initWeights; + function testFail_MaliciousUpdateBridgeOperator() external { (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs(DEFAULT_R1, DEFAULT_R2, DEFAULT_R3, DEFAULT_NUM_BRIDGE_OPERATORS); @@ -60,7 +67,8 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { ) external virtual { vm.assume(caller != _bridgeManager); - (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs(r1, r2, r3, numBridgeOperators); + (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = + getValidAndNonExistingInputs(_bridgeManager, r1, r2, r3, numBridgeOperators); vm.expectRevert(abi.encodeWithSelector(ErrUnexpectedInternalCall.selector, IBridgeManager.addBridgeOperators.selector, ContractType.BRIDGE, caller)); @@ -71,11 +79,13 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { * @notice Checks whether bridge contract can add bridge operators. */ function test_AddBridgeOperators_CallerIsBridgeAdminOperator(uint256 r1, uint256 r2, uint256 r3, uint256 numBridgeOperators) external virtual { - (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs(r1, r2, r3, numBridgeOperators); + (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = + getValidAndNonExistingInputs(_bridgeManager, r1, r2, r3, numBridgeOperators); IBridgeManager bridgeManager = _addBridgeOperators(_bridgeManager, _bridgeManager, voteWeights, governors, bridgeOperators); - _invariantTest(bridgeManager, voteWeights, governors, bridgeOperators); + _invariantTest(bridgeManager, _initWeights.extend(voteWeights), _initGovernors.extend(governors), _initOperators.extend(bridgeOperators)); + // _invariantTest(bridgeManager, voteWeights, governors, bridgeOperators); } /** @@ -111,10 +121,16 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { * @notice Checks whether bridge contract can remove bridge operators. */ function test_RemoveBridgeOperators_CallerIsBridgeContract(uint256 r1, uint256 r2, uint256 r3, uint16 numBridgeOperators) external virtual { - (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs(r1, r2, r3, numBridgeOperators); + (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = + getValidAndNonExistingInputs(_bridgeManager, r1, r2, r3, numBridgeOperators); IBridgeManager bridgeManager = _addBridgeOperators(_bridgeManager, _bridgeManager, voteWeights, governors, bridgeOperators); - uint256 removeAmount = _randomize(voteWeights.length, 1, voteWeights.length); + + bridgeOperators = _initOperators.extend(bridgeOperators); + governors = _initGovernors.extend(governors); + voteWeights = _initWeights.extend(voteWeights); + + uint256 removeAmount = _randomize(voteWeights.length, 1, voteWeights.length - 3); // Keep at least 3 governors uint256 tailIdx = voteWeights.length - 1; uint256 r = _randomize(_triShuffle(r1, r2, r3), 0, tailIdx); @@ -158,7 +174,8 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { */ function testFuzz_UpdateBridgeOperator_CallerIsGovernor(uint256 r1, uint256 r2, uint256 r3, uint16 numBridgeOperators) external virtual { vm.skip(true); - (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs(r1, r2, r3, numBridgeOperators); + (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = + getValidAndNonExistingInputs(_bridgeManager, r1, r2, r3, numBridgeOperators); IBridgeManager bridgeManager = _addBridgeOperators(_bridgeManager, _bridgeManager, voteWeights, governors, bridgeOperators); uint256 randomSeed = _randomize(_triShuffle(r1, r2, r3), 0, voteWeights.length - 1); @@ -186,7 +203,8 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { */ function test_UpdateBridgeOperator_CallerIsNotGovernor(uint256 r1, uint256 r2, uint256 r3, uint16 numBridgeOperators) external virtual { vm.skip(true); - (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs(r1, r2, r3, numBridgeOperators); + (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = + getValidAndNonExistingInputs(_bridgeManager, r1, r2, r3, numBridgeOperators); IBridgeManager bridgeManager = _addBridgeOperators(_bridgeManager, _bridgeManager, voteWeights, governors, bridgeOperators); address unauthorizedCaller = makeAddr("UNAUTHORIZED_CALLER"); @@ -210,8 +228,11 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { _bridgeManager = address(new MockBridgeManager(bridgeOperators, governors, voteWeights)); // empty storage for testing - vm.prank(_bridgeManager); - IBridgeManager(_bridgeManager).removeBridgeOperators(bridgeOperators); + // vm.prank(_bridgeManager); + // IBridgeManager(_bridgeManager).removeBridgeOperators(bridgeOperators); + _initOperators = bridgeOperators; + _initGovernors = governors; + _initWeights = voteWeights; } function _label() internal virtual { diff --git a/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol b/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol index b166af7b..cef140fd 100644 --- a/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol +++ b/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol @@ -110,9 +110,6 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { uint256 numBridgeOperators, uint256 period ) external { - address[] memory currentOperators = IBridgeManager(_bridgeManagerContract).getBridgeOperators(); - vm.prank(_bridgeManagerContract, _bridgeManagerContract); - IBridgeManager(_bridgeManagerContract).removeBridgeOperators(currentOperators); // Assume the input values are not equal to the default values vm.assume(r1 != DEFAULT_R1 && r2 != DEFAULT_R2 && r3 != DEFAULT_R3); // Bound the period between 1 and the maximum value of uint64 diff --git a/test/bridge/unit/fuzz/utils/BridgeManagerUtils.t.sol b/test/bridge/unit/fuzz/utils/BridgeManagerUtils.t.sol index 6fae02cd..fb0c5de2 100644 --- a/test/bridge/unit/fuzz/utils/BridgeManagerUtils.t.sol +++ b/test/bridge/unit/fuzz/utils/BridgeManagerUtils.t.sol @@ -40,6 +40,17 @@ abstract contract BridgeManagerUtils is Randomizer { bridgeManager.addBridgeOperators(voteWeights, governors, bridgeOperators); } + function getValidAndNonExistingInputs( + address bridgeManager, + uint256 r1, + uint256 r2, + uint256 r3, + uint256 numBridgeOperators + ) public virtual returns (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) { + (bridgeOperators, governors, voteWeights) = getValidInputs(r1, r2, r3, numBridgeOperators); + _ensureNonExistingInputs(bridgeManager, bridgeOperators.extend(governors)); + } + function getValidInputs( uint256 r1, uint256 r2, @@ -104,20 +115,14 @@ abstract contract BridgeManagerUtils is Randomizer { modifiedInputIdx == 0 ? uintVoteWeights : modifiedInputIdx == 1 ? uintGovernors : uintBridgeOperators ) ); - (outputs, ) = abi.decode(returnData, (uint256[], uint256[])); + (outputs,) = abi.decode(returnData, (uint256[], uint256[])); } // point outputs to modified inputs assembly { - if iszero(modifiedInputIdx) { - voteWeights := outputs - } - if eq(modifiedInputIdx, 1) { - governors := outputs - } - if eq(modifiedInputIdx, 2) { - bridgeOperators := outputs - } + if iszero(modifiedInputIdx) { voteWeights := outputs } + if eq(modifiedInputIdx, 1) { governors := outputs } + if eq(modifiedInputIdx, 2) { bridgeOperators := outputs } } } @@ -137,7 +142,7 @@ abstract contract BridgeManagerUtils is Randomizer { // bound index to range [0, inputLength - 1] inputLength--; - for (uint256 i; i < duplicateAmount; ) { + for (uint256 i; i < duplicateAmount;) { r1 = _randomize(seed, 0, inputLength); r2 = _randomize(r1, 0, inputLength); vm.assume(r1 != r2); @@ -171,7 +176,7 @@ abstract contract BridgeManagerUtils is Randomizer { uint256 r; nullifyIndices = new uint256[](nullAmount); - for (uint256 i; i < nullAmount; ) { + for (uint256 i; i < nullAmount;) { r = _randomize(seed, 0, inputLength); delete inputs[r]; nullifyIndices[i] = r; @@ -211,12 +216,13 @@ abstract contract BridgeManagerUtils is Randomizer { _ensureNonZero(uintBridgeOperators); _ensureNonDuplicated(governors.extend(bridgeOperators)); + // _ensureNotExisted(governors.extend(bridgeOperators)); } function _ensureNonZero(uint256[] memory arr) internal pure { uint256 length = arr.length; - for (uint256 i; i < length; ) { + for (uint256 i; i < length;) { vm.assume(arr[i] != 0); unchecked { ++i; @@ -232,6 +238,13 @@ abstract contract BridgeManagerUtils is Randomizer { vm.assume(!addrs.hasDuplicate()); } + function _ensureNonExistingInputs(address bridgeManager, address[] memory addrs) internal view { + for (uint i; i < addrs.length; i++) { + vm.assume(!IBridgeManager(bridgeManager).isBridgeOperator(addrs[i])); + vm.assume(IBridgeManager(bridgeManager).getGovernorWeight(addrs[i]) == 0); + } + } + function _invariantTest( IBridgeManager bridgeManager, uint96[] memory voteWeights, @@ -244,7 +257,7 @@ abstract contract BridgeManagerUtils is Randomizer { assertEq(bridgeOperators.length, bridgeManager.totalBridgeOperator()); uint256 totalWeight; - for (uint256 i; i < voteWeights.length; ) { + for (uint256 i; i < voteWeights.length;) { totalWeight += voteWeights[i]; unchecked { ++i; diff --git a/test/mocks/MockBridgeManager.sol b/test/mocks/MockBridgeManager.sol index 8ff151d7..3fa77340 100644 --- a/test/mocks/MockBridgeManager.sol +++ b/test/mocks/MockBridgeManager.sol @@ -4,47 +4,45 @@ pragma solidity >=0.8.17 <0.9.0; import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; contract MockBridgeManager is IBridgeManager { - function DOMAIN_SEPARATOR() external view returns (bytes32) {} + function DOMAIN_SEPARATOR() external view returns (bytes32) { } function addBridgeOperators( uint96[] calldata voteWeights, address[] calldata governors, address[] calldata bridgeOperators - ) external returns (bool[] memory addeds) {} + ) external returns (bool[] memory addeds) { } - function getBridgeOperatorOf(address[] calldata gorvernors) external view returns (address[] memory bridgeOperators_) {} + function setMinRequiredGovernor(uint min) external { } - function getOperatorOf(address governor) external view returns (address operator) {} + function getBridgeOperatorOf(address[] calldata gorvernors) external view returns (address[] memory bridgeOperators_) { } - function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint96 weight) {} + function getOperatorOf(address governor) external view returns (address operator) { } - function getBridgeOperators() external view returns (address[] memory) {} + function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint96 weight) { } - function getFullBridgeOperatorInfos() - external - view - returns (address[] memory governors, address[] memory bridgeOperators, uint96[] memory weights) - {} + function getBridgeOperators() external view returns (address[] memory) { } - function getGovernorWeight(address governor) external view returns (uint96) {} + function getFullBridgeOperatorInfos() external view returns (address[] memory governors, address[] memory bridgeOperators, uint96[] memory weights) { } - function getGovernorWeights(address[] calldata governors) external view returns (uint96[] memory weights) {} + function getGovernorWeight(address governor) external view returns (uint96) { } - function getGovernors() external view returns (address[] memory) {} + function getGovernorWeights(address[] calldata governors) external view returns (uint96[] memory weights) { } - function getGovernorsOf(address[] calldata bridgeOperators) external view returns (address[] memory governors) {} + function getGovernors() external view returns (address[] memory) { } - function getGovernorOf(address operator) external view returns (address governor) {} + function getGovernorsOf(address[] calldata bridgeOperators) external view returns (address[] memory governors) { } - function getTotalWeight() external view returns (uint256) {} + function getGovernorOf(address operator) external view returns (address governor) { } - function isBridgeOperator(address addr) external view returns (bool) {} + function getTotalWeight() external view returns (uint256) { } - function removeBridgeOperators(address[] calldata bridgeOperators) external returns (bool[] memory removeds) {} + function isBridgeOperator(address addr) external view returns (bool) { } - function sumGovernorsWeight(address[] calldata governors) external view returns (uint256 sum) {} + function removeBridgeOperators(address[] calldata bridgeOperators) external returns (bool[] memory removeds) { } - function totalBridgeOperator() external view returns (uint256) {} + function sumGovernorsWeight(address[] calldata governors) external view returns (uint256 sum) { } - function updateBridgeOperator(address currOperator, address newOperator) external {} + function totalBridgeOperator() external view returns (uint256) { } + + function updateBridgeOperator(address currOperator, address newOperator) external { } } From 00181e4a37bb9071b5c9191cd10d52cfec3807a9 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Thu, 7 Mar 2024 13:25:44 +0700 Subject: [PATCH 035/180] test: fix getValidInputs in fuzz --- test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol b/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol index cef140fd..3f40d9fc 100644 --- a/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol +++ b/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol @@ -125,7 +125,8 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { MockBridgeManager(payable(_bridgeManagerContract)).registerCallbacks(registers); // Generate valid inputs for bridge operators - (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs( + (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidAndNonExistingInputs( + _bridgeManagerContract, r1, r2, r3, @@ -285,7 +286,7 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { } function _setUp() internal virtual { - _admin = vm.addr(1); + _admin = makeAddr("central-admin"); _validatorContract = address(new MockValidatorSet_ForFoundryTest()); (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs( DEFAULT_R1, From bc22560f1322259ce623a4759cb7b0ccc4d7ee8f Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 24 Jan 2024 18:23:47 +0700 Subject: [PATCH 036/180] feat(BridgeManager): cherry-pick proxylize --- .../MainchainBridgeManagerDeploy.s.sol | 32 +++++------ .../BridgeManager.sol | 33 ++++++++++-- .../BridgeManagerCallbackRegister.sol | 18 +++---- .../BridgeManagerQuorum.sol | 8 ++- .../sequential-governance/CoreGovernance.sol | 7 ++- .../GlobalCoreGovernance.sol | 7 ++- src/mainchain/MainchainBridgeManager.sol | 36 ++++++++++--- src/mocks/ronin/MockBridgeManager.sol | 10 ++-- src/mocks/ronin/MockRoninBridgeManager.sol | 54 +++++++++---------- src/ronin/gateway/RoninBridgeManager.sol | 16 +++--- test/bridge/integration/BaseIntegration.t.sol | 23 +++++++- 11 files changed, 162 insertions(+), 82 deletions(-) diff --git a/script/contracts/MainchainBridgeManagerDeploy.s.sol b/script/contracts/MainchainBridgeManagerDeploy.s.sol index 31cc13f3..de06f374 100644 --- a/script/contracts/MainchainBridgeManagerDeploy.s.sol +++ b/script/contracts/MainchainBridgeManagerDeploy.s.sol @@ -9,24 +9,24 @@ import { Migration } from "../Migration.s.sol"; import { MainchainGatewayV3Deploy } from "./MainchainGatewayV3Deploy.s.sol"; contract MainchainBridgeManagerDeploy is Migration { - function _defaultArguments() internal virtual override returns (bytes memory args) { - ISharedArgument.BridgeManagerParam memory param = config.sharedArguments().mainchainBridgeManager; + // function _defaultArguments() internal virtual override returns (bytes memory args) { + // ISharedArgument.BridgeManagerParam memory param = config.sharedArguments().mainchainBridgeManager; - args = abi.encode( - param.num, - param.denom, - param.roninChainId, - param.bridgeContract, - param.callbackRegisters, - param.bridgeOperators, - param.governors, - param.voteWeights, - param.targetOptions, - param.targets - ); - } + // args = abi.encode( + // param.num, + // param.denom, + // param.roninChainId, + // param.bridgeContract, + // param.callbackRegisters, + // param.bridgeOperators, + // param.governors, + // param.voteWeights, + // param.targetOptions, + // param.targets + // ); + // } function run() public virtual returns (MainchainBridgeManager) { - return MainchainBridgeManager(_deployImmutable(Contract.MainchainBridgeManager.key())); + return MainchainBridgeManager(_deployProxy(Contract.MainchainBridgeManager.key(), EMPTY_ARGS)); } } diff --git a/src/extensions/bridge-operator-governance/BridgeManager.sol b/src/extensions/bridge-operator-governance/BridgeManager.sol index f6bbb8ff..4041df46 100644 --- a/src/extensions/bridge-operator-governance/BridgeManager.sol +++ b/src/extensions/bridge-operator-governance/BridgeManager.sol @@ -38,7 +38,7 @@ abstract contract BridgeManager is IBridgeManager, HasContracts, BridgeManagerQu /** * @inheritdoc IBridgeManager */ - bytes32 public immutable DOMAIN_SEPARATOR; + bytes32 public DOMAIN_SEPARATOR; function _getBridgeManagerStorage() private pure returns (BridgeManagerStorage storage $) { assembly { @@ -51,7 +51,31 @@ abstract contract BridgeManager is IBridgeManager, HasContracts, BridgeManagerQu _; } - constructor( + // constructor( + // uint256 num, + // uint256 denom, + // uint256 roninChainId, + // address bridgeContract, + // address[] memory callbackRegisters, + // address[] memory bridgeOperators, + // address[] memory governors, + // uint96[] memory voteWeights + // ) payable BridgeManagerQuorum(num, denom) BridgeManagerCallbackRegister(callbackRegisters) { + // // _setContract(ContractType.BRIDGE, bridgeContract); + + // // DOMAIN_SEPARATOR = keccak256( + // // abi.encode( + // // keccak256("EIP712Domain(string name,string version,bytes32 salt)"), + // // keccak256("BridgeAdmin"), // name hash + // // keccak256("2"), // version hash + // // keccak256(abi.encode("BRIDGE_ADMIN", roninChainId)) // salt + // // ) + // // ); + + // // _addBridgeOperators(voteWeights, governors, bridgeOperators); + // } + + function __init( uint256 num, uint256 denom, uint256 roninChainId, @@ -60,7 +84,10 @@ abstract contract BridgeManager is IBridgeManager, HasContracts, BridgeManagerQu address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights - ) payable BridgeManagerQuorum(num, denom) BridgeManagerCallbackRegister(callbackRegisters) { + ) internal { + BridgeManagerQuorum.__init(num, denom); + BridgeManagerCallbackRegister.__init(callbackRegisters); + _setContract(ContractType.BRIDGE, bridgeContract); DOMAIN_SEPARATOR = keccak256( diff --git a/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol b/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol index 32efcef6..f17f6daa 100644 --- a/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol +++ b/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol @@ -19,7 +19,11 @@ abstract contract BridgeManagerCallbackRegister is IdentityGuard, IBridgeManager */ bytes32 private constant CALLBACK_REGISTERS_SLOT = 0x5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd976240; - constructor(address[] memory callbackRegisters) payable { + // constructor(address[] memory callbackRegisters) payable { + // // _registerCallbacks(callbackRegisters); + // } + + function __init(address[] memory callbackRegisters) internal { _registerCallbacks(callbackRegisters); } @@ -33,9 +37,7 @@ abstract contract BridgeManagerCallbackRegister is IdentityGuard, IBridgeManager /** * @inheritdoc IBridgeManagerCallbackRegister */ - function unregisterCallbacks( - address[] calldata registers - ) external onlySelfCall returns (bool[] memory unregistereds) { + function unregisterCallbacks(address[] calldata registers) external onlySelfCall returns (bool[] memory unregistereds) { unregistereds = _unregisterCallbacks(registers); } @@ -51,9 +53,7 @@ abstract contract BridgeManagerCallbackRegister is IdentityGuard, IBridgeManager * @param registers The array of callback addresses to register. * @return registereds An array indicating the success status of each registration. */ - function _registerCallbacks( - address[] memory registers - ) internal nonDuplicate(registers) returns (bool[] memory registereds) { + function _registerCallbacks(address[] memory registers) internal nonDuplicate(registers) returns (bool[] memory registereds) { uint256 length = registers.length; registereds = new bool[](length); if (length == 0) return registereds; @@ -81,9 +81,7 @@ abstract contract BridgeManagerCallbackRegister is IdentityGuard, IBridgeManager * @param registers The array of callback addresses to unregister. * @return unregistereds An array indicating the success status of each unregistration. */ - function _unregisterCallbacks( - address[] memory registers - ) internal nonDuplicate(registers) returns (bool[] memory unregistereds) { + function _unregisterCallbacks(address[] memory registers) internal nonDuplicate(registers) returns (bool[] memory unregistereds) { uint256 length = registers.length; unregistereds = new bool[](length); EnumerableSet.AddressSet storage _callbackRegisters = _getCallbackRegisters(); diff --git a/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol b/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol index 705656d9..bc7864c9 100644 --- a/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol +++ b/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol @@ -21,7 +21,13 @@ abstract contract BridgeManagerQuorum is IQuorum, IdentityGuard { } } - constructor(uint256 num, uint256 denom) { + // constructor(uint256 num, uint256 denom) { + // // BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage(); + // // $._nonce = 1; + // // _setThreshold(num, denom); + // } + + function __init(uint256 num, uint256 denom) internal { BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage(); $._nonce = 1; diff --git a/src/extensions/sequential-governance/CoreGovernance.sol b/src/extensions/sequential-governance/CoreGovernance.sol index 93e03c2f..4c7529b1 100644 --- a/src/extensions/sequential-governance/CoreGovernance.sol +++ b/src/extensions/sequential-governance/CoreGovernance.sol @@ -63,10 +63,15 @@ abstract contract CoreGovernance is SignatureConsumer, VoteStatusConsumer, Chain uint256 internal _proposalExpiryDuration; - constructor(uint256 _expiryDuration) { + // constructor(uint256 _expiryDuration) { + // // _setProposalExpiryDuration(_expiryDuration); + // } + +function __init(uint256 _expiryDuration) internal { _setProposalExpiryDuration(_expiryDuration); } + /** * @dev Creates new voting round by calculating the `_round` number of chain `_chainId`. * Increases the `_round` number if the previous one is not expired. Delete the previous proposal diff --git a/src/extensions/sequential-governance/GlobalCoreGovernance.sol b/src/extensions/sequential-governance/GlobalCoreGovernance.sol index 73e1fbeb..b6a2acad 100644 --- a/src/extensions/sequential-governance/GlobalCoreGovernance.sol +++ b/src/extensions/sequential-governance/GlobalCoreGovernance.sol @@ -24,7 +24,12 @@ abstract contract GlobalCoreGovernance is CoreGovernance { /// @dev Emitted when the target options are updated event TargetOptionUpdated(GlobalProposal.TargetOption indexed targetOption, address indexed addr); - constructor(GlobalProposal.TargetOption[] memory targetOptions, address[] memory addrs) { + // constructor(GlobalProposal.TargetOption[] memory targetOptions, address[] memory addrs) { + // // _updateTargetOption(GlobalProposal.TargetOption.BridgeManager, address(this)); + // // _updateManyTargetOption(targetOptions, addrs); + // } + + function __init(GlobalProposal.TargetOption[] memory targetOptions, address[] memory addrs) internal { _updateTargetOption(GlobalProposal.TargetOption.BridgeManager, address(this)); _updateManyTargetOption(targetOptions, addrs); } diff --git a/src/mainchain/MainchainBridgeManager.sol b/src/mainchain/MainchainBridgeManager.sol index fbd2c526..a4ec2b8c 100644 --- a/src/mainchain/MainchainBridgeManager.sol +++ b/src/mainchain/MainchainBridgeManager.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; +import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import { CoreGovernance } from "../extensions/sequential-governance/CoreGovernance.sol"; import { GlobalCoreGovernance, GlobalGovernanceRelay } from "../extensions/sequential-governance/governance-relay/GlobalGovernanceRelay.sol"; import { GovernanceRelay } from "../extensions/sequential-governance/governance-relay/GovernanceRelay.sol"; @@ -10,10 +11,30 @@ import { Proposal } from "../libraries/Proposal.sol"; import { GlobalProposal } from "../libraries/GlobalProposal.sol"; import "../utils/CommonErrors.sol"; -contract MainchainBridgeManager is BridgeManager, GovernanceRelay, GlobalGovernanceRelay { +contract MainchainBridgeManager is Initializable, BridgeManager, GovernanceRelay, GlobalGovernanceRelay { uint256 private constant DEFAULT_EXPIRY_DURATION = 1 << 255; - constructor( + constructor() + // uint256 num, + // uint256 denom, + // uint256 roninChainId, + // address bridgeContract, + // address[] memory callbackRegisters, + // address[] memory bridgeOperators, + // address[] memory governors, + // uint96[] memory voteWeights, + // GlobalProposal.TargetOption[] memory targetOptions, + // address[] memory targets + // ) + // payable + // CoreGovernance(DEFAULT_EXPIRY_DURATION) + // GlobalCoreGovernance(targetOptions, targets) + // BridgeManager(num, denom, roninChainId, bridgeContract, callbackRegisters, bridgeOperators, governors, voteWeights) + { + _disableInitializers(); + } + + function initialize( uint256 num, uint256 denom, uint256 roninChainId, @@ -24,12 +45,11 @@ contract MainchainBridgeManager is BridgeManager, GovernanceRelay, GlobalGoverna uint96[] memory voteWeights, GlobalProposal.TargetOption[] memory targetOptions, address[] memory targets - ) - payable - CoreGovernance(DEFAULT_EXPIRY_DURATION) - GlobalCoreGovernance(targetOptions, targets) - BridgeManager(num, denom, roninChainId, bridgeContract, callbackRegisters, bridgeOperators, governors, voteWeights) - { } + ) external initializer { + CoreGovernance.__init(DEFAULT_EXPIRY_DURATION); + GlobalCoreGovernance.__init(targetOptions, targets); + BridgeManager.__init(num, denom, roninChainId, bridgeContract, callbackRegisters, bridgeOperators, governors, voteWeights); + } /** * @dev See `GovernanceRelay-_relayProposal`. diff --git a/src/mocks/ronin/MockBridgeManager.sol b/src/mocks/ronin/MockBridgeManager.sol index a7dbe01a..84345bb7 100644 --- a/src/mocks/ronin/MockBridgeManager.sol +++ b/src/mocks/ronin/MockBridgeManager.sol @@ -4,11 +4,11 @@ pragma solidity ^0.8.0; import { RoleAccess, ContractType, AddressArrayUtils, IBridgeManager, BridgeManager } from "../../extensions/bridge-operator-governance/BridgeManager.sol"; contract MockBridgeManager is BridgeManager { - constructor( - address[] memory bridgeOperators, - address[] memory governors, - uint96[] memory voteWeights - ) payable BridgeManager(0, 0, 0, address(0), _getEmptyAddressArray(), bridgeOperators, governors, voteWeights) {} + // constructor( + // address[] memory bridgeOperators, + // address[] memory governors, + // uint96[] memory voteWeights + // ) payable BridgeManager(0, 0, 0, address(0), _getEmptyAddressArray(), bridgeOperators, governors, voteWeights) {} function _getEmptyAddressArray() internal pure returns (address[] memory arr) {} } diff --git a/src/mocks/ronin/MockRoninBridgeManager.sol b/src/mocks/ronin/MockRoninBridgeManager.sol index 4d7daa76..867caa19 100644 --- a/src/mocks/ronin/MockRoninBridgeManager.sol +++ b/src/mocks/ronin/MockRoninBridgeManager.sol @@ -5,31 +5,31 @@ import { RoninBridgeManager } from "../../ronin/gateway/RoninBridgeManager.sol"; import { GlobalProposal } from "../../extensions/sequential-governance/governance-proposal/GovernanceProposal.sol"; contract MockRoninBridgeManager is RoninBridgeManager { - constructor( - uint256 num, - uint256 denom, - uint256 roninChainId, - uint256 expiryDuration, - address bridgeContract, - address[] memory callbackRegisters, - address[] memory bridgeOperators, - address[] memory governors, - uint96[] memory voteWeights, - GlobalProposal.TargetOption[] memory targetOptions, - address[] memory targets - ) - RoninBridgeManager( - num, - denom, - roninChainId, - expiryDuration, - bridgeContract, - callbackRegisters, - bridgeOperators, - governors, - voteWeights, - targetOptions, - targets - ) - {} + // constructor( + // uint256 num, + // uint256 denom, + // uint256 roninChainId, + // uint256 expiryDuration, + // address bridgeContract, + // address[] memory callbackRegisters, + // address[] memory bridgeOperators, + // address[] memory governors, + // uint96[] memory voteWeights, + // GlobalProposal.TargetOption[] memory targetOptions, + // address[] memory targets + // ) + // RoninBridgeManager( + // num, + // denom, + // roninChainId, + // expiryDuration, + // bridgeContract, + // callbackRegisters, + // bridgeOperators, + // governors, + // voteWeights, + // targetOptions, + // targets + // ) + // {} } diff --git a/src/ronin/gateway/RoninBridgeManager.sol b/src/ronin/gateway/RoninBridgeManager.sol index 3e1452bf..f171a489 100644 --- a/src/ronin/gateway/RoninBridgeManager.sol +++ b/src/ronin/gateway/RoninBridgeManager.sol @@ -12,7 +12,8 @@ import { VoteStatusConsumer } from "../../interfaces/consumers/VoteStatusConsume import { ErrQueryForEmptyVote } from "../../utils/CommonErrors.sol"; contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernanceProposal { - constructor( + + function initialize( uint256 num, uint256 denom, uint256 roninChainId, @@ -23,13 +24,12 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan address[] memory governors, uint96[] memory voteWeights, GlobalProposal.TargetOption[] memory targetOptions, - address[] memory targets - ) - payable - CoreGovernance(expiryDuration) - GlobalCoreGovernance(targetOptions, targets) - BridgeManager(num, denom, roninChainId, bridgeContract, callbackRegisters, bridgeOperators, governors, voteWeights) - { } + address[] memory targets) external + { + CoreGovernance.__init(expiryDuration); + GlobalCoreGovernance.__init(targetOptions, targets); + BridgeManager.__init(num, denom, roninChainId, bridgeContract, callbackRegisters, bridgeOperators, governors, voteWeights); + } /** * CURRENT NETWORK diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index 858140dd..faad52fa 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -100,7 +100,7 @@ contract BaseIntegration_Test is Base_Test { _deployContractsOnRonin(); _deployContractsOnMainchain(); - _initializeRonin(); + // _initializeRonin(); _initializeMainchain(); _changeAdminOnRonin(); @@ -161,7 +161,9 @@ contract BaseIntegration_Test is Base_Test { } function _initializeMainchain() internal { - _mainchainPauseEnforcerInitialize(); + _config.switchTo(Network.EthLocal.key()); + + _mainchainBridgeManagerInitialize(); _constructForMainchainBridgeManager(); _mainchainGatewayV3Initialize(); } @@ -465,6 +467,23 @@ contract BaseIntegration_Test is Base_Test { } } + function _mainchainBridgeManagerInitialize() internal { + ISharedArgument.BridgeManagerParam memory param = _param.mainchainBridgeManager; + + _mainchainBridgeManager.initialize( + param.num, + param.denom, + param.roninChainId, + param.bridgeContract, + param.callbackRegisters, + param.bridgeOperators, + param.governors, + param.voteWeights, + param.targetOptions, + param.targets + ); + } + function _mainchainGatewayV3Initialize() internal { (address[] memory mainchainTokens, address[] memory roninTokens) = _getMainchainAndRoninTokens(); uint256 tokenNum = mainchainTokens.length; From ca87b383fe31e82f20e10d5975277f54703dbfaa Mon Sep 17 00:00:00 2001 From: nxqbao Date: Thu, 7 Mar 2024 11:19:30 +0700 Subject: [PATCH 037/180] test: fix test compiler errors --- src/mocks/ronin/MockBridgeManager.sol | 6 ++++- test/bridge/integration/BaseIntegration.t.sol | 5 ++--- .../bridge-manager/BridgeManager.t.sol | 22 +++++++++++++------ .../bridge-manager/BridgeManagerCRUD.t.sol | 14 +++++++----- .../fuzz/bridge-manager/BridgeReward.t.sol | 5 ++++- .../fuzz/bridge-manager/BridgeSlash.t.sol | 6 ++++- 6 files changed, 40 insertions(+), 18 deletions(-) diff --git a/src/mocks/ronin/MockBridgeManager.sol b/src/mocks/ronin/MockBridgeManager.sol index 84345bb7..3da4a740 100644 --- a/src/mocks/ronin/MockBridgeManager.sol +++ b/src/mocks/ronin/MockBridgeManager.sol @@ -10,5 +10,9 @@ contract MockBridgeManager is BridgeManager { // uint96[] memory voteWeights // ) payable BridgeManager(0, 0, 0, address(0), _getEmptyAddressArray(), bridgeOperators, governors, voteWeights) {} - function _getEmptyAddressArray() internal pure returns (address[] memory arr) {} + function initialize(address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) external { + BridgeManager.__init(0, 0, 0, address(0), _getEmptyAddressArray(), bridgeOperators, governors, voteWeights); + } + + function _getEmptyAddressArray() internal pure returns (address[] memory arr) { } } diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index faad52fa..de403190 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -100,7 +100,7 @@ contract BaseIntegration_Test is Base_Test { _deployContractsOnRonin(); _deployContractsOnMainchain(); - // _initializeRonin(); + _initializeRonin(); _initializeMainchain(); _changeAdminOnRonin(); @@ -161,8 +161,7 @@ contract BaseIntegration_Test is Base_Test { } function _initializeMainchain() internal { - _config.switchTo(Network.EthLocal.key()); - + _mainchainPauseEnforcerInitialize(); _mainchainBridgeManagerInitialize(); _constructForMainchainBridgeManager(); _mainchainGatewayV3Initialize(); diff --git a/test/bridge/unit/concrete/bridge-manager/BridgeManager.t.sol b/test/bridge/unit/concrete/bridge-manager/BridgeManager.t.sol index 25498fb2..f11f5dd0 100644 --- a/test/bridge/unit/concrete/bridge-manager/BridgeManager.t.sol +++ b/test/bridge/unit/concrete/bridge-manager/BridgeManager.t.sol @@ -5,6 +5,7 @@ import { Base_Test } from "@ronin/test/Base.t.sol"; import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; import { MockBridgeManager } from "@ronin/contracts/mocks/ronin/MockBridgeManager.sol"; +import { TransparentUpgradeableProxyV2 } from "@ronin/contracts/extensions/TransparentUpgradeableProxyV2.sol"; contract BridgeManager_Unit_Concrete_Test is Base_Test { IBridgeManager internal _bridgeManager; @@ -13,6 +14,7 @@ contract BridgeManager_Unit_Concrete_Test is Base_Test { uint96[] internal _voteWeights; uint256 internal _totalWeight; uint256 internal _totalOperator; + address internal _admin; modifier assertStateNotChange() { // Get before test state @@ -65,7 +67,13 @@ contract BridgeManager_Unit_Concrete_Test is Base_Test { _totalWeight = 500; _totalOperator = 5; - _bridgeManager = new MockBridgeManager(bridgeOperators, governors, voteWeights); + _admin = makeAddr("bridgeManagerAdmin"); + address bridgeManagerLogic = address(new MockBridgeManager()); + _bridgeManager = MockBridgeManager( + address( + new TransparentUpgradeableProxyV2(bridgeManagerLogic, _admin, abi.encodeCall(MockBridgeManager.initialize, (bridgeOperators, governors, voteWeights))) + ) + ); } function _generateNewOperators() internal pure returns (address[] memory operators, address[] memory governors, uint96[] memory weights) { @@ -79,9 +87,7 @@ contract BridgeManager_Unit_Concrete_Test is Base_Test { weights[0] = 100; } - function _generateRemovingOperators( - uint removingNumber - ) + function _generateRemovingOperators(uint removingNumber) internal view returns ( @@ -129,9 +135,11 @@ contract BridgeManager_Unit_Concrete_Test is Base_Test { return _getBridgeMembersByGovernors(governors_); } - function _getBridgeMembersByGovernors( - address[] memory queryingGovernors - ) internal view returns (address[] memory operators, address[] memory governors, uint96[] memory weights) { + function _getBridgeMembersByGovernors(address[] memory queryingGovernors) + internal + view + returns (address[] memory operators, address[] memory governors, uint96[] memory weights) + { governors = queryingGovernors; operators = new address[](queryingGovernors.length); diff --git a/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol b/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol index 18380c80..e0bbf0cc 100644 --- a/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol +++ b/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol @@ -5,6 +5,7 @@ import { console } from "forge-std/console.sol"; import { IBridgeManager, BridgeManagerUtils } from "../utils/BridgeManagerUtils.t.sol"; import { RoninGatewayV3 } from "@ronin/contracts/ronin/gateway/RoninGatewayV3.sol"; import { RoleAccess, ContractType, MockBridgeManager } from "@ronin/contracts/mocks/ronin/MockBridgeManager.sol"; +import { TransparentUpgradeableProxyV2 } from "@ronin/contracts/extensions/TransparentUpgradeableProxyV2.sol"; import "@ronin/contracts/libraries/Uint96ArrayUtils.sol"; import "@ronin/contracts/libraries/AddressArrayUtils.sol"; import { @@ -38,17 +39,15 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { uint96[] private _initWeights; function testFail_MaliciousUpdateBridgeOperator() external { - (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = + (address[] memory bridgeOperators, address[] memory governors, ) = getValidInputs(DEFAULT_R1, DEFAULT_R2, DEFAULT_R3, DEFAULT_NUM_BRIDGE_OPERATORS); - _bridgeManager = address(new MockBridgeManager(bridgeOperators, governors, voteWeights)); - MockBridgeManager bridgeManager = MockBridgeManager(_bridgeManager); vm.startPrank(governors[0]); address lastOperator; for (uint256 i = 1; i < bridgeOperators.length; ++i) { lastOperator = bridgeOperators[i]; - bridgeManager.updateBridgeOperator(bridgeOperators[0], lastOperator); + MockBridgeManager(_bridgeManager).updateBridgeOperator(bridgeOperators[0], lastOperator); vm.expectRevert(abi.encodeWithSelector(ErrBridgeOperatorUpdateFailed.selector, lastOperator)); } @@ -225,7 +224,12 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { function _setUp() internal virtual { (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs(DEFAULT_R1, DEFAULT_R2, DEFAULT_R3, DEFAULT_NUM_BRIDGE_OPERATORS); - _bridgeManager = address(new MockBridgeManager(bridgeOperators, governors, voteWeights)); + + address admin = makeAddr("bridgeManagerAdmin"); + address bridgeManagerLogic = address(new MockBridgeManager()); + _bridgeManager = address( + new TransparentUpgradeableProxyV2(bridgeManagerLogic, admin, abi.encodeCall(MockBridgeManager.initialize, (bridgeOperators, governors, voteWeights))) + ); // empty storage for testing // vm.prank(_bridgeManager); diff --git a/test/bridge/unit/fuzz/bridge-manager/BridgeReward.t.sol b/test/bridge/unit/fuzz/bridge-manager/BridgeReward.t.sol index 95f33eb3..3c6c1120 100644 --- a/test/bridge/unit/fuzz/bridge-manager/BridgeReward.t.sol +++ b/test/bridge/unit/fuzz/bridge-manager/BridgeReward.t.sol @@ -223,7 +223,10 @@ contract BridgeRewardTest is Base_Test, IBridgeRewardEvents, BridgeManagerUtils _defaultBridgeManagerInputs = abi.encode(bridgeOperators, governors, voteWeights); - _bridgeManagerContract = address(new MockBridgeManager(bridgeOperators, governors, voteWeights)); + address bridgeManagerLogic = address(new MockBridgeManager()); + _bridgeManagerContract = address( + new TransparentUpgradeableProxy(bridgeManagerLogic, _admin, abi.encodeCall(MockBridgeManager.initialize, (bridgeOperators, governors, voteWeights))) + ); _bridgeTrackingLogic = address(new BridgeTracking()); _bridgeTrackingContract = address(new TransparentUpgradeableProxy(_bridgeTrackingLogic, _admin, "")); diff --git a/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol b/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol index 3f40d9fc..ec6d8b1a 100644 --- a/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol +++ b/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol @@ -295,7 +295,11 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { DEFAULT_NUM_BRIDGE_OPERATORS ); _defaultBridgeManagerInputs = abi.encode(bridgeOperators, governors, voteWeights); - _bridgeManagerContract = address(new MockBridgeManager(bridgeOperators, governors, voteWeights)); + + address bridgeManagerLogic = address(new MockBridgeManager()); + _bridgeManagerContract = address( + new TransparentUpgradeableProxyV2(bridgeManagerLogic, _admin, abi.encodeCall(MockBridgeManager.initialize, (bridgeOperators, governors, voteWeights))) + ); _gatewayLogic = address(new RoninGatewayV3()); _gatewayContract = address(new TransparentUpgradeableProxyV2(_gatewayLogic, _admin, "")); From 7d3c52ff0fda89ecdfc40bcaebd65bd3d9691426 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Thu, 7 Mar 2024 12:58:04 +0700 Subject: [PATCH 038/180] test: handle setup manager as proxy --- .../MainchainBridgeManagerDeploy.s.sol | 35 ++++++++++--------- .../contracts/RoninBridgeManagerDeploy.s.sol | 29 ++++++++------- src/mocks/ronin/MockBridgeManager.sol | 6 ---- test/bridge/integration/BaseIntegration.t.sol | 1 - .../bridge-manager/BridgeManagerCRUD.t.sol | 3 -- .../fuzz/bridge-manager/BridgeReward.t.sol | 5 +-- .../fuzz/bridge-manager/BridgeSlash.t.sol | 5 +-- 7 files changed, 41 insertions(+), 43 deletions(-) diff --git a/script/contracts/MainchainBridgeManagerDeploy.s.sol b/script/contracts/MainchainBridgeManagerDeploy.s.sol index de06f374..c91bb2e9 100644 --- a/script/contracts/MainchainBridgeManagerDeploy.s.sol +++ b/script/contracts/MainchainBridgeManagerDeploy.s.sol @@ -9,24 +9,27 @@ import { Migration } from "../Migration.s.sol"; import { MainchainGatewayV3Deploy } from "./MainchainGatewayV3Deploy.s.sol"; contract MainchainBridgeManagerDeploy is Migration { - // function _defaultArguments() internal virtual override returns (bytes memory args) { - // ISharedArgument.BridgeManagerParam memory param = config.sharedArguments().mainchainBridgeManager; + function _defaultArguments() internal virtual override returns (bytes memory args) { + ISharedArgument.BridgeManagerParam memory param = config.sharedArguments().mainchainBridgeManager; - // args = abi.encode( - // param.num, - // param.denom, - // param.roninChainId, - // param.bridgeContract, - // param.callbackRegisters, - // param.bridgeOperators, - // param.governors, - // param.voteWeights, - // param.targetOptions, - // param.targets - // ); - // } + args = abi.encodeCall( + MainchainBridgeManager.initialize, + ( + param.num, + param.denom, + param.roninChainId, + param.bridgeContract, + param.callbackRegisters, + param.bridgeOperators, + param.governors, + param.voteWeights, + param.targetOptions, + param.targets + ) + ); + } function run() public virtual returns (MainchainBridgeManager) { - return MainchainBridgeManager(_deployProxy(Contract.MainchainBridgeManager.key(), EMPTY_ARGS)); + return MainchainBridgeManager(_deployProxy(Contract.MainchainBridgeManager.key())); } } diff --git a/script/contracts/RoninBridgeManagerDeploy.s.sol b/script/contracts/RoninBridgeManagerDeploy.s.sol index b53aa864..6666dc38 100644 --- a/script/contracts/RoninBridgeManagerDeploy.s.sol +++ b/script/contracts/RoninBridgeManagerDeploy.s.sol @@ -13,22 +13,25 @@ contract RoninBridgeManagerDeploy is Migration { function _defaultArguments() internal virtual override returns (bytes memory args) { ISharedArgument.BridgeManagerParam memory param = config.sharedArguments().roninBridgeManager; - args = abi.encode( - param.num, - param.denom, - param.roninChainId, - param.expiryDuration, - param.bridgeContract, - param.callbackRegisters, - param.bridgeOperators, - param.governors, - param.voteWeights, - param.targetOptions, - param.targets + args = abi.encodeCall( + RoninBridgeManager.initialize, + ( + param.num, + param.denom, + param.roninChainId, + param.expiryDuration, + param.bridgeContract, + param.callbackRegisters, + param.bridgeOperators, + param.governors, + param.voteWeights, + param.targetOptions, + param.targets + ) ); } function run() public virtual returns (RoninBridgeManager) { - return RoninBridgeManager(_deployImmutable(Contract.RoninBridgeManager.key())); + return RoninBridgeManager(_deployProxy(Contract.RoninBridgeManager.key())); } } diff --git a/src/mocks/ronin/MockBridgeManager.sol b/src/mocks/ronin/MockBridgeManager.sol index 3da4a740..7febb328 100644 --- a/src/mocks/ronin/MockBridgeManager.sol +++ b/src/mocks/ronin/MockBridgeManager.sol @@ -4,12 +4,6 @@ pragma solidity ^0.8.0; import { RoleAccess, ContractType, AddressArrayUtils, IBridgeManager, BridgeManager } from "../../extensions/bridge-operator-governance/BridgeManager.sol"; contract MockBridgeManager is BridgeManager { - // constructor( - // address[] memory bridgeOperators, - // address[] memory governors, - // uint96[] memory voteWeights - // ) payable BridgeManager(0, 0, 0, address(0), _getEmptyAddressArray(), bridgeOperators, governors, voteWeights) {} - function initialize(address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) external { BridgeManager.__init(0, 0, 0, address(0), _getEmptyAddressArray(), bridgeOperators, governors, voteWeights); } diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index de403190..3e26bf44 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -162,7 +162,6 @@ contract BaseIntegration_Test is Base_Test { function _initializeMainchain() internal { _mainchainPauseEnforcerInitialize(); - _mainchainBridgeManagerInitialize(); _constructForMainchainBridgeManager(); _mainchainGatewayV3Initialize(); } diff --git a/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol b/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol index e0bbf0cc..ea79881f 100644 --- a/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol +++ b/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol @@ -231,9 +231,6 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { new TransparentUpgradeableProxyV2(bridgeManagerLogic, admin, abi.encodeCall(MockBridgeManager.initialize, (bridgeOperators, governors, voteWeights))) ); - // empty storage for testing - // vm.prank(_bridgeManager); - // IBridgeManager(_bridgeManager).removeBridgeOperators(bridgeOperators); _initOperators = bridgeOperators; _initGovernors = governors; _initWeights = voteWeights; diff --git a/test/bridge/unit/fuzz/bridge-manager/BridgeReward.t.sol b/test/bridge/unit/fuzz/bridge-manager/BridgeReward.t.sol index 3c6c1120..9514e0fb 100644 --- a/test/bridge/unit/fuzz/bridge-manager/BridgeReward.t.sol +++ b/test/bridge/unit/fuzz/bridge-manager/BridgeReward.t.sol @@ -22,6 +22,7 @@ contract BridgeRewardTest is Base_Test, IBridgeRewardEvents, BridgeManagerUtils address internal _admin; address internal _validatorContract; address internal _bridgeRewardLogic; + address internal _bridgeManagerLogic; address internal _bridgeManagerContract; address internal _bridgeRewardContract; address internal _bridgeSlashLogic; @@ -223,9 +224,9 @@ contract BridgeRewardTest is Base_Test, IBridgeRewardEvents, BridgeManagerUtils _defaultBridgeManagerInputs = abi.encode(bridgeOperators, governors, voteWeights); - address bridgeManagerLogic = address(new MockBridgeManager()); + _bridgeManagerLogic = address(new MockBridgeManager()); _bridgeManagerContract = address( - new TransparentUpgradeableProxy(bridgeManagerLogic, _admin, abi.encodeCall(MockBridgeManager.initialize, (bridgeOperators, governors, voteWeights))) + new TransparentUpgradeableProxy(_bridgeManagerLogic, _admin, abi.encodeCall(MockBridgeManager.initialize, (bridgeOperators, governors, voteWeights))) ); _bridgeTrackingLogic = address(new BridgeTracking()); diff --git a/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol b/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol index ec6d8b1a..995cb5b1 100644 --- a/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol +++ b/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol @@ -27,6 +27,7 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { /// @dev immutable contracts address internal _admin; address internal _validatorContract; + address internal _bridgeManagerLogic; address internal _bridgeManagerContract; /// @dev proxy contracts address internal _gatewayLogic; @@ -296,9 +297,9 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { ); _defaultBridgeManagerInputs = abi.encode(bridgeOperators, governors, voteWeights); - address bridgeManagerLogic = address(new MockBridgeManager()); + _bridgeManagerLogic = address(new MockBridgeManager()); _bridgeManagerContract = address( - new TransparentUpgradeableProxyV2(bridgeManagerLogic, _admin, abi.encodeCall(MockBridgeManager.initialize, (bridgeOperators, governors, voteWeights))) + new TransparentUpgradeableProxyV2(_bridgeManagerLogic, _admin, abi.encodeCall(MockBridgeManager.initialize, (bridgeOperators, governors, voteWeights))) ); _gatewayLogic = address(new RoninGatewayV3()); From 995e6e05eb716356baf1d280716ce5cf6e479c53 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Thu, 7 Mar 2024 13:13:31 +0700 Subject: [PATCH 039/180] fix(BridgeManager): fix convention of init --- .../BridgeManager.sol | 43 +++++---------- .../BridgeManagerCallbackRegister.sol | 6 +-- .../BridgeManagerQuorum.sol | 8 +-- .../sequential-governance/CoreGovernance.sol | 37 +++++-------- .../GlobalCoreGovernance.sol | 53 ++++++------------- src/mainchain/MainchainBridgeManager.sol | 24 ++------- src/mocks/ronin/MockBridgeManager.sol | 2 +- src/mocks/ronin/MockRoninBridgeManager.sol | 30 +---------- src/ronin/gateway/RoninBridgeManager.sol | 6 +-- 9 files changed, 54 insertions(+), 155 deletions(-) diff --git a/src/extensions/bridge-operator-governance/BridgeManager.sol b/src/extensions/bridge-operator-governance/BridgeManager.sol index 4041df46..243505da 100644 --- a/src/extensions/bridge-operator-governance/BridgeManager.sol +++ b/src/extensions/bridge-operator-governance/BridgeManager.sol @@ -38,7 +38,7 @@ abstract contract BridgeManager is IBridgeManager, HasContracts, BridgeManagerQu /** * @inheritdoc IBridgeManager */ - bytes32 public DOMAIN_SEPARATOR; + bytes32 public DOMAIN_SEPARATOR; function _getBridgeManagerStorage() private pure returns (BridgeManagerStorage storage $) { assembly { @@ -51,31 +51,7 @@ abstract contract BridgeManager is IBridgeManager, HasContracts, BridgeManagerQu _; } - // constructor( - // uint256 num, - // uint256 denom, - // uint256 roninChainId, - // address bridgeContract, - // address[] memory callbackRegisters, - // address[] memory bridgeOperators, - // address[] memory governors, - // uint96[] memory voteWeights - // ) payable BridgeManagerQuorum(num, denom) BridgeManagerCallbackRegister(callbackRegisters) { - // // _setContract(ContractType.BRIDGE, bridgeContract); - - // // DOMAIN_SEPARATOR = keccak256( - // // abi.encode( - // // keccak256("EIP712Domain(string name,string version,bytes32 salt)"), - // // keccak256("BridgeAdmin"), // name hash - // // keccak256("2"), // version hash - // // keccak256(abi.encode("BRIDGE_ADMIN", roninChainId)) // salt - // // ) - // // ); - - // // _addBridgeOperators(voteWeights, governors, bridgeOperators); - // } - - function __init( + function __BridgeManager_init( uint256 num, uint256 denom, uint256 roninChainId, @@ -84,10 +60,19 @@ abstract contract BridgeManager is IBridgeManager, HasContracts, BridgeManagerQu address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights - ) internal { - BridgeManagerQuorum.__init(num, denom); - BridgeManagerCallbackRegister.__init(callbackRegisters); + ) internal { + __BridgeManagerQuorum_init_unchained(num, denom); + __BridgeManagerCallbackRegister_init_unchained(callbackRegisters); + __BridgeManager_init_unchained(roninChainId, bridgeContract, bridgeOperators, governors, voteWeights); + } + function __BridgeManager_init_unchained( + uint256 roninChainId, + address bridgeContract, + address[] memory bridgeOperators, + address[] memory governors, + uint96[] memory voteWeights + ) internal { _setContract(ContractType.BRIDGE, bridgeContract); DOMAIN_SEPARATOR = keccak256( diff --git a/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol b/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol index f17f6daa..a7daf6e7 100644 --- a/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol +++ b/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol @@ -19,11 +19,7 @@ abstract contract BridgeManagerCallbackRegister is IdentityGuard, IBridgeManager */ bytes32 private constant CALLBACK_REGISTERS_SLOT = 0x5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd976240; - // constructor(address[] memory callbackRegisters) payable { - // // _registerCallbacks(callbackRegisters); - // } - - function __init(address[] memory callbackRegisters) internal { + function __BridgeManagerCallbackRegister_init_unchained(address[] memory callbackRegisters) internal { _registerCallbacks(callbackRegisters); } diff --git a/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol b/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol index bc7864c9..689e3c6b 100644 --- a/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol +++ b/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol @@ -21,13 +21,7 @@ abstract contract BridgeManagerQuorum is IQuorum, IdentityGuard { } } - // constructor(uint256 num, uint256 denom) { - // // BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage(); - // // $._nonce = 1; - // // _setThreshold(num, denom); - // } - - function __init(uint256 num, uint256 denom) internal { + function __BridgeManagerQuorum_init_unchained(uint256 num, uint256 denom) internal { BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage(); $._nonce = 1; diff --git a/src/extensions/sequential-governance/CoreGovernance.sol b/src/extensions/sequential-governance/CoreGovernance.sol index 4c7529b1..e268b69e 100644 --- a/src/extensions/sequential-governance/CoreGovernance.sol +++ b/src/extensions/sequential-governance/CoreGovernance.sol @@ -35,13 +35,7 @@ abstract contract CoreGovernance is SignatureConsumer, VoteStatusConsumer, Chain } /// @dev Emitted when a proposal is created - event ProposalCreated( - uint256 indexed chainId, - uint256 indexed round, - bytes32 indexed proposalHash, - Proposal.ProposalDetail proposal, - address creator - ); + event ProposalCreated(uint256 indexed chainId, uint256 indexed round, bytes32 indexed proposalHash, Proposal.ProposalDetail proposal, address creator); /// @dev Emitted when the proposal is voted event ProposalVoted(bytes32 indexed proposalHash, address indexed voter, Ballot.VoteType support, uint256 weight); /// @dev Emitted when the proposal is approved @@ -63,14 +57,13 @@ abstract contract CoreGovernance is SignatureConsumer, VoteStatusConsumer, Chain uint256 internal _proposalExpiryDuration; - // constructor(uint256 _expiryDuration) { - // // _setProposalExpiryDuration(_expiryDuration); - // } - -function __init(uint256 _expiryDuration) internal { - _setProposalExpiryDuration(_expiryDuration); + function __CoreGovernance_init(uint256 expiryDuration) internal { + __CoreGovernance_init_unchained(expiryDuration); } + function __CoreGovernance_init_unchained(uint256 expiryDuration) internal { + _setProposalExpiryDuration(expiryDuration); + } /** * @dev Creates new voting round by calculating the `_round` number of chain `_chainId`. @@ -142,10 +135,7 @@ function __init(uint256 _expiryDuration) internal { * Emits the `ProposalCreated` event. * */ - function _proposeProposalStruct( - Proposal.ProposalDetail memory proposal, - address creator - ) internal virtual returns (uint256 round_) { + function _proposeProposalStruct(Proposal.ProposalDetail memory proposal, address creator) internal virtual returns (uint256 round_) { uint256 chainId = proposal.chainId; if (chainId == 0) revert ErrInvalidChainId(msg.sig, 0, block.chainid); proposal.validate(_proposalExpiryDuration); @@ -205,7 +195,9 @@ function __init(uint256 _expiryDuration) internal { } else if (support == Ballot.VoteType.Against) { _vote.againstVoteds.push(voter); _againstVoteWeight = _vote.againstVoteWeight += voterWeight; - } else revert ErrUnsupportedVoteType(msg.sig); + } else { + revert ErrUnsupportedVoteType(msg.sig); + } if (_forVoteWeight >= minimumForVoteWeight) { done = true; @@ -228,15 +220,12 @@ function __init(uint256 _expiryDuration) internal { * before or it will emit an unexpected event of `ProposalExpired`. */ function _tryDeleteExpiredVotingRound(ProposalVote storage proposalVote) internal returns (bool isExpired) { - isExpired = - _getChainType() == ChainType.RoninChain && - proposalVote.status == VoteStatus.Pending && - proposalVote.expiryTimestamp <= block.timestamp; + isExpired = _getChainType() == ChainType.RoninChain && proposalVote.status == VoteStatus.Pending && proposalVote.expiryTimestamp <= block.timestamp; if (isExpired) { emit ProposalExpired(proposalVote.hash); - for (uint256 _i; _i < proposalVote.forVoteds.length; ) { + for (uint256 _i; _i < proposalVote.forVoteds.length;) { delete proposalVote.voted[proposalVote.forVoteds[_i]]; delete proposalVote.sig[proposalVote.forVoteds[_i]]; @@ -244,7 +233,7 @@ function __init(uint256 _expiryDuration) internal { ++_i; } } - for (uint256 _i; _i < proposalVote.againstVoteds.length; ) { + for (uint256 _i; _i < proposalVote.againstVoteds.length;) { delete proposalVote.voted[proposalVote.againstVoteds[_i]]; delete proposalVote.sig[proposalVote.againstVoteds[_i]]; diff --git a/src/extensions/sequential-governance/GlobalCoreGovernance.sol b/src/extensions/sequential-governance/GlobalCoreGovernance.sol index b6a2acad..1b43eca7 100644 --- a/src/extensions/sequential-governance/GlobalCoreGovernance.sol +++ b/src/extensions/sequential-governance/GlobalCoreGovernance.sol @@ -24,12 +24,11 @@ abstract contract GlobalCoreGovernance is CoreGovernance { /// @dev Emitted when the target options are updated event TargetOptionUpdated(GlobalProposal.TargetOption indexed targetOption, address indexed addr); - // constructor(GlobalProposal.TargetOption[] memory targetOptions, address[] memory addrs) { - // // _updateTargetOption(GlobalProposal.TargetOption.BridgeManager, address(this)); - // // _updateManyTargetOption(targetOptions, addrs); - // } + function __GlobalCoreGovernance_init(GlobalProposal.TargetOption[] memory targetOptions, address[] memory addrs) internal { + __GlobalCoreGovernance_init_unchained(targetOptions, addrs); + } - function __init(GlobalProposal.TargetOption[] memory targetOptions, address[] memory addrs) internal { + function __GlobalCoreGovernance_init_unchained(GlobalProposal.TargetOption[] memory targetOptions, address[] memory addrs) internal { _updateTargetOption(GlobalProposal.TargetOption.BridgeManager, address(this)); _updateManyTargetOption(targetOptions, addrs); } @@ -49,17 +48,9 @@ abstract contract GlobalCoreGovernance is CoreGovernance { address creator ) internal virtual { uint256 round_ = _createVotingRound(0); - GlobalProposal.GlobalProposalDetail memory globalProposal = GlobalProposal.GlobalProposalDetail( - round_, - expiryTimestamp, - targetOptions, - values, - calldatas, - gasAmounts - ); - Proposal.ProposalDetail memory proposal = globalProposal.intoProposalDetail( - _resolveTargets({ targetOptions: targetOptions, strict: true }) - ); + GlobalProposal.GlobalProposalDetail memory globalProposal = + GlobalProposal.GlobalProposalDetail(round_, expiryTimestamp, targetOptions, values, calldatas, gasAmounts); + Proposal.ProposalDetail memory proposal = globalProposal.intoProposalDetail(_resolveTargets({ targetOptions: targetOptions, strict: true })); proposal.validate(_proposalExpiryDuration); bytes32 proposalHash = proposal.hash(); @@ -80,9 +71,7 @@ abstract contract GlobalCoreGovernance is CoreGovernance { GlobalProposal.GlobalProposalDetail memory globalProposal, address creator ) internal virtual returns (Proposal.ProposalDetail memory proposal) { - proposal = globalProposal.intoProposalDetail( - _resolveTargets({ targetOptions: globalProposal.targetOptions, strict: true }) - ); + proposal = globalProposal.intoProposalDetail(_resolveTargets({ targetOptions: globalProposal.targetOptions, strict: true })); proposal.validate(_proposalExpiryDuration); bytes32 proposalHash = proposal.hash(); @@ -96,9 +85,7 @@ abstract contract GlobalCoreGovernance is CoreGovernance { /** * @dev Returns corresponding address of target options. Return address(0) on non-existent target. */ - function resolveTargets( - GlobalProposal.TargetOption[] calldata targetOptions - ) external view returns (address[] memory targets) { + function resolveTargets(GlobalProposal.TargetOption[] calldata targetOptions) external view returns (address[] memory targets) { return _resolveTargets({ targetOptions: targetOptions, strict: false }); } @@ -107,13 +94,10 @@ abstract contract GlobalCoreGovernance is CoreGovernance { * * @param strict When the param is set to `true`, revert on non-existent target. */ - function _resolveTargets( - GlobalProposal.TargetOption[] memory targetOptions, - bool strict - ) internal view returns (address[] memory targets) { + function _resolveTargets(GlobalProposal.TargetOption[] memory targetOptions, bool strict) internal view returns (address[] memory targets) { targets = new address[](targetOptions.length); - for (uint256 i; i < targetOptions.length; ) { + for (uint256 i; i < targetOptions.length;) { targets[i] = _targetOptionsMap[targetOptions[i]]; if (strict && targets[i] == address(0)) revert ErrInvalidArguments(msg.sig); unchecked { @@ -127,11 +111,9 @@ abstract contract GlobalCoreGovernance is CoreGovernance { * * Requirement: * - Only allow self-call through proposal. - * */ - function updateManyTargetOption( - GlobalProposal.TargetOption[] memory targetOptions, - address[] memory targets - ) external { + * + */ + function updateManyTargetOption(GlobalProposal.TargetOption[] memory targetOptions, address[] memory targets) external { // HACK: Cannot reuse the existing library due to too deep stack if (msg.sender != address(this)) revert ErrOnlySelfCall(msg.sig); _updateManyTargetOption(targetOptions, targets); @@ -140,11 +122,8 @@ abstract contract GlobalCoreGovernance is CoreGovernance { /** * @dev Updates list of `targetOptions` to `targets`. */ - function _updateManyTargetOption( - GlobalProposal.TargetOption[] memory targetOptions, - address[] memory targets - ) internal { - for (uint256 i; i < targetOptions.length; ) { + function _updateManyTargetOption(GlobalProposal.TargetOption[] memory targetOptions, address[] memory targets) internal { + for (uint256 i; i < targetOptions.length;) { if (targets[i] == address(this)) revert ErrInvalidArguments(msg.sig); _updateTargetOption(targetOptions[i], targets[i]); unchecked { diff --git a/src/mainchain/MainchainBridgeManager.sol b/src/mainchain/MainchainBridgeManager.sol index a4ec2b8c..de640d37 100644 --- a/src/mainchain/MainchainBridgeManager.sol +++ b/src/mainchain/MainchainBridgeManager.sol @@ -14,23 +14,7 @@ import "../utils/CommonErrors.sol"; contract MainchainBridgeManager is Initializable, BridgeManager, GovernanceRelay, GlobalGovernanceRelay { uint256 private constant DEFAULT_EXPIRY_DURATION = 1 << 255; - constructor() - // uint256 num, - // uint256 denom, - // uint256 roninChainId, - // address bridgeContract, - // address[] memory callbackRegisters, - // address[] memory bridgeOperators, - // address[] memory governors, - // uint96[] memory voteWeights, - // GlobalProposal.TargetOption[] memory targetOptions, - // address[] memory targets - // ) - // payable - // CoreGovernance(DEFAULT_EXPIRY_DURATION) - // GlobalCoreGovernance(targetOptions, targets) - // BridgeManager(num, denom, roninChainId, bridgeContract, callbackRegisters, bridgeOperators, governors, voteWeights) - { + constructor() { _disableInitializers(); } @@ -46,9 +30,9 @@ contract MainchainBridgeManager is Initializable, BridgeManager, GovernanceRelay GlobalProposal.TargetOption[] memory targetOptions, address[] memory targets ) external initializer { - CoreGovernance.__init(DEFAULT_EXPIRY_DURATION); - GlobalCoreGovernance.__init(targetOptions, targets); - BridgeManager.__init(num, denom, roninChainId, bridgeContract, callbackRegisters, bridgeOperators, governors, voteWeights); + __CoreGovernance_init(DEFAULT_EXPIRY_DURATION); + __GlobalCoreGovernance_init(targetOptions, targets); + __BridgeManager_init(num, denom, roninChainId, bridgeContract, callbackRegisters, bridgeOperators, governors, voteWeights); } /** diff --git a/src/mocks/ronin/MockBridgeManager.sol b/src/mocks/ronin/MockBridgeManager.sol index 7febb328..a021eb0e 100644 --- a/src/mocks/ronin/MockBridgeManager.sol +++ b/src/mocks/ronin/MockBridgeManager.sol @@ -5,7 +5,7 @@ import { RoleAccess, ContractType, AddressArrayUtils, IBridgeManager, BridgeMana contract MockBridgeManager is BridgeManager { function initialize(address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) external { - BridgeManager.__init(0, 0, 0, address(0), _getEmptyAddressArray(), bridgeOperators, governors, voteWeights); + __BridgeManager_init(0, 0, 0, address(0), _getEmptyAddressArray(), bridgeOperators, governors, voteWeights); } function _getEmptyAddressArray() internal pure returns (address[] memory arr) { } diff --git a/src/mocks/ronin/MockRoninBridgeManager.sol b/src/mocks/ronin/MockRoninBridgeManager.sol index 867caa19..f4084af6 100644 --- a/src/mocks/ronin/MockRoninBridgeManager.sol +++ b/src/mocks/ronin/MockRoninBridgeManager.sol @@ -4,32 +4,4 @@ pragma solidity ^0.8.0; import { RoninBridgeManager } from "../../ronin/gateway/RoninBridgeManager.sol"; import { GlobalProposal } from "../../extensions/sequential-governance/governance-proposal/GovernanceProposal.sol"; -contract MockRoninBridgeManager is RoninBridgeManager { - // constructor( - // uint256 num, - // uint256 denom, - // uint256 roninChainId, - // uint256 expiryDuration, - // address bridgeContract, - // address[] memory callbackRegisters, - // address[] memory bridgeOperators, - // address[] memory governors, - // uint96[] memory voteWeights, - // GlobalProposal.TargetOption[] memory targetOptions, - // address[] memory targets - // ) - // RoninBridgeManager( - // num, - // denom, - // roninChainId, - // expiryDuration, - // bridgeContract, - // callbackRegisters, - // bridgeOperators, - // governors, - // voteWeights, - // targetOptions, - // targets - // ) - // {} -} +contract MockRoninBridgeManager is RoninBridgeManager { } diff --git a/src/ronin/gateway/RoninBridgeManager.sol b/src/ronin/gateway/RoninBridgeManager.sol index f171a489..38d135da 100644 --- a/src/ronin/gateway/RoninBridgeManager.sol +++ b/src/ronin/gateway/RoninBridgeManager.sol @@ -26,9 +26,9 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan GlobalProposal.TargetOption[] memory targetOptions, address[] memory targets) external { - CoreGovernance.__init(expiryDuration); - GlobalCoreGovernance.__init(targetOptions, targets); - BridgeManager.__init(num, denom, roninChainId, bridgeContract, callbackRegisters, bridgeOperators, governors, voteWeights); + __CoreGovernance_init(expiryDuration); + __GlobalCoreGovernance_init(targetOptions, targets); + __BridgeManager_init(num, denom, roninChainId, bridgeContract, callbackRegisters, bridgeOperators, governors, voteWeights); } /** From 03936f2593b80b048fd15f19e2a7b286e16b08e8 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Thu, 7 Mar 2024 13:41:29 +0700 Subject: [PATCH 040/180] fix(BridgeManager): add `onlyInitializing` modifier --- .../BridgeManager.sol | 23 +++++++++++-------- .../BridgeManagerCallbackRegister.sol | 5 ++-- .../BridgeManagerQuorum.sol | 17 +++++++------- .../sequential-governance/CoreGovernance.sol | 7 +++--- .../GlobalCoreGovernance.sol | 4 ++-- src/mainchain/MainchainBridgeManager.sol | 7 +----- src/mocks/ronin/MockBridgeManager.sol | 2 +- 7 files changed, 34 insertions(+), 31 deletions(-) diff --git a/src/extensions/bridge-operator-governance/BridgeManager.sol b/src/extensions/bridge-operator-governance/BridgeManager.sol index 243505da..2335b023 100644 --- a/src/extensions/bridge-operator-governance/BridgeManager.sol +++ b/src/extensions/bridge-operator-governance/BridgeManager.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.23; +import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import { IBridgeManagerCallback, BridgeManagerCallbackRegister } from "./BridgeManagerCallbackRegister.sol"; import { IHasContracts, HasContracts } from "../../extensions/collections/HasContracts.sol"; @@ -13,7 +14,7 @@ import { TUint256Slot } from "../../types/Types.sol"; import "../../utils/CommonErrors.sol"; import "./BridgeManagerQuorum.sol"; -abstract contract BridgeManager is IBridgeManager, HasContracts, BridgeManagerQuorum, BridgeManagerCallbackRegister { +abstract contract BridgeManager is IBridgeManager, Initializable, HasContracts, BridgeManagerQuorum, BridgeManagerCallbackRegister { using AddressArrayUtils for address[]; using EnumerableSet for EnumerableSet.AddressSet; @@ -40,17 +41,15 @@ abstract contract BridgeManager is IBridgeManager, HasContracts, BridgeManagerQu */ bytes32 public DOMAIN_SEPARATOR; - function _getBridgeManagerStorage() private pure returns (BridgeManagerStorage storage $) { - assembly { - $.slot := $$_BridgeManagerStorageLocation - } - } - modifier onlyGovernor() virtual { _requireGovernor(msg.sender); _; } + constructor() { + _disableInitializers(); + } + function __BridgeManager_init( uint256 num, uint256 denom, @@ -60,7 +59,7 @@ abstract contract BridgeManager is IBridgeManager, HasContracts, BridgeManagerQu address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights - ) internal { + ) internal onlyInitializing { __BridgeManagerQuorum_init_unchained(num, denom); __BridgeManagerCallbackRegister_init_unchained(callbackRegisters); __BridgeManager_init_unchained(roninChainId, bridgeContract, bridgeOperators, governors, voteWeights); @@ -72,7 +71,7 @@ abstract contract BridgeManager is IBridgeManager, HasContracts, BridgeManagerQu address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights - ) internal { + ) internal onlyInitializing { _setContract(ContractType.BRIDGE, bridgeContract); DOMAIN_SEPARATOR = keccak256( @@ -88,6 +87,12 @@ abstract contract BridgeManager is IBridgeManager, HasContracts, BridgeManagerQu _setMinRequiredGovernor(3); } + function _getBridgeManagerStorage() private pure returns (BridgeManagerStorage storage $) { + assembly { + $.slot := $$_BridgeManagerStorageLocation + } + } + // ===================== CONFIG ======================== /** diff --git a/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol b/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol index a7daf6e7..a2145129 100644 --- a/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol +++ b/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; +import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import { IBridgeManagerCallbackRegister } from "../../interfaces/bridge/IBridgeManagerCallbackRegister.sol"; import { IBridgeManagerCallback } from "../../interfaces/bridge/IBridgeManagerCallback.sol"; @@ -10,7 +11,7 @@ import { TransparentUpgradeableProxyV2, IdentityGuard } from "../../utils/Identi * @title BridgeManagerCallbackRegister * @dev A contract that manages callback registrations and execution for a bridge. */ -abstract contract BridgeManagerCallbackRegister is IdentityGuard, IBridgeManagerCallbackRegister { +abstract contract BridgeManagerCallbackRegister is Initializable, IdentityGuard, IBridgeManagerCallbackRegister { using EnumerableSet for EnumerableSet.AddressSet; /** @@ -19,7 +20,7 @@ abstract contract BridgeManagerCallbackRegister is IdentityGuard, IBridgeManager */ bytes32 private constant CALLBACK_REGISTERS_SLOT = 0x5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd976240; - function __BridgeManagerCallbackRegister_init_unchained(address[] memory callbackRegisters) internal { + function __BridgeManagerCallbackRegister_init_unchained(address[] memory callbackRegisters) internal onlyInitializing { _registerCallbacks(callbackRegisters); } diff --git a/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol b/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol index 689e3c6b..ba92ddb9 100644 --- a/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol +++ b/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol @@ -1,11 +1,12 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.23; +import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import { IQuorum } from "../../interfaces/IQuorum.sol"; import { IdentityGuard } from "../../utils/IdentityGuard.sol"; import "../../utils/CommonErrors.sol"; -abstract contract BridgeManagerQuorum is IQuorum, IdentityGuard { +abstract contract BridgeManagerQuorum is IQuorum, Initializable, IdentityGuard { struct BridgeManagerQuorumStorage { uint256 _nonce; uint256 _numerator; @@ -15,19 +16,19 @@ abstract contract BridgeManagerQuorum is IQuorum, IdentityGuard { // keccak256(abi.encode(uint256(keccak256("ronin.storage.BridgeManagerQuorumStorage")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant $$_BridgeManagerQuorumStorage = 0xf3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00; - function _getBridgeManagerQuorumStorage() private pure returns (BridgeManagerQuorumStorage storage $) { - assembly { - $.slot := $$_BridgeManagerQuorumStorage - } - } - - function __BridgeManagerQuorum_init_unchained(uint256 num, uint256 denom) internal { + function __BridgeManagerQuorum_init_unchained(uint256 num, uint256 denom) internal onlyInitializing { BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage(); $._nonce = 1; _setThreshold(num, denom); } + function _getBridgeManagerQuorumStorage() private pure returns (BridgeManagerQuorumStorage storage $) { + assembly { + $.slot := $$_BridgeManagerQuorumStorage + } + } + /** * @inheritdoc IQuorum */ diff --git a/src/extensions/sequential-governance/CoreGovernance.sol b/src/extensions/sequential-governance/CoreGovernance.sol index e268b69e..944905f7 100644 --- a/src/extensions/sequential-governance/CoreGovernance.sol +++ b/src/extensions/sequential-governance/CoreGovernance.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; +import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "../../libraries/Proposal.sol"; import "../../libraries/GlobalProposal.sol"; import "../../utils/CommonErrors.sol"; @@ -9,7 +10,7 @@ import "../../interfaces/consumers/ChainTypeConsumer.sol"; import "../../interfaces/consumers/SignatureConsumer.sol"; import "../../interfaces/consumers/VoteStatusConsumer.sol"; -abstract contract CoreGovernance is SignatureConsumer, VoteStatusConsumer, ChainTypeConsumer { +abstract contract CoreGovernance is Initializable, SignatureConsumer, VoteStatusConsumer, ChainTypeConsumer { using Proposal for Proposal.ProposalDetail; /** @@ -57,11 +58,11 @@ abstract contract CoreGovernance is SignatureConsumer, VoteStatusConsumer, Chain uint256 internal _proposalExpiryDuration; - function __CoreGovernance_init(uint256 expiryDuration) internal { + function __CoreGovernance_init(uint256 expiryDuration) internal onlyInitializing { __CoreGovernance_init_unchained(expiryDuration); } - function __CoreGovernance_init_unchained(uint256 expiryDuration) internal { + function __CoreGovernance_init_unchained(uint256 expiryDuration) internal onlyInitializing { _setProposalExpiryDuration(expiryDuration); } diff --git a/src/extensions/sequential-governance/GlobalCoreGovernance.sol b/src/extensions/sequential-governance/GlobalCoreGovernance.sol index 1b43eca7..b5ead07b 100644 --- a/src/extensions/sequential-governance/GlobalCoreGovernance.sol +++ b/src/extensions/sequential-governance/GlobalCoreGovernance.sol @@ -24,11 +24,11 @@ abstract contract GlobalCoreGovernance is CoreGovernance { /// @dev Emitted when the target options are updated event TargetOptionUpdated(GlobalProposal.TargetOption indexed targetOption, address indexed addr); - function __GlobalCoreGovernance_init(GlobalProposal.TargetOption[] memory targetOptions, address[] memory addrs) internal { + function __GlobalCoreGovernance_init(GlobalProposal.TargetOption[] memory targetOptions, address[] memory addrs) internal onlyInitializing { __GlobalCoreGovernance_init_unchained(targetOptions, addrs); } - function __GlobalCoreGovernance_init_unchained(GlobalProposal.TargetOption[] memory targetOptions, address[] memory addrs) internal { + function __GlobalCoreGovernance_init_unchained(GlobalProposal.TargetOption[] memory targetOptions, address[] memory addrs) internal onlyInitializing { _updateTargetOption(GlobalProposal.TargetOption.BridgeManager, address(this)); _updateManyTargetOption(targetOptions, addrs); } diff --git a/src/mainchain/MainchainBridgeManager.sol b/src/mainchain/MainchainBridgeManager.sol index de640d37..7c63d831 100644 --- a/src/mainchain/MainchainBridgeManager.sol +++ b/src/mainchain/MainchainBridgeManager.sol @@ -1,7 +1,6 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import { CoreGovernance } from "../extensions/sequential-governance/CoreGovernance.sol"; import { GlobalCoreGovernance, GlobalGovernanceRelay } from "../extensions/sequential-governance/governance-relay/GlobalGovernanceRelay.sol"; import { GovernanceRelay } from "../extensions/sequential-governance/governance-relay/GovernanceRelay.sol"; @@ -11,13 +10,9 @@ import { Proposal } from "../libraries/Proposal.sol"; import { GlobalProposal } from "../libraries/GlobalProposal.sol"; import "../utils/CommonErrors.sol"; -contract MainchainBridgeManager is Initializable, BridgeManager, GovernanceRelay, GlobalGovernanceRelay { +contract MainchainBridgeManager is BridgeManager, GovernanceRelay, GlobalGovernanceRelay { uint256 private constant DEFAULT_EXPIRY_DURATION = 1 << 255; - constructor() { - _disableInitializers(); - } - function initialize( uint256 num, uint256 denom, diff --git a/src/mocks/ronin/MockBridgeManager.sol b/src/mocks/ronin/MockBridgeManager.sol index a021eb0e..6c0e746d 100644 --- a/src/mocks/ronin/MockBridgeManager.sol +++ b/src/mocks/ronin/MockBridgeManager.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; import { RoleAccess, ContractType, AddressArrayUtils, IBridgeManager, BridgeManager } from "../../extensions/bridge-operator-governance/BridgeManager.sol"; contract MockBridgeManager is BridgeManager { - function initialize(address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) external { + function initialize(address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) external initializer { __BridgeManager_init(0, 0, 0, address(0), _getEmptyAddressArray(), bridgeOperators, governors, voteWeights); } From 8e91d621586f4ff22eab3aef88dfe3f01f075ebf Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 11 Mar 2024 13:57:53 +0700 Subject: [PATCH 041/180] fix(BridgeReward): fix syntax error --- src/ronin/gateway/BridgeReward.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ronin/gateway/BridgeReward.sol b/src/ronin/gateway/BridgeReward.sol index 1da2b2d4..702daedc 100644 --- a/src/ronin/gateway/BridgeReward.sol +++ b/src/ronin/gateway/BridgeReward.sol @@ -100,7 +100,7 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT // Restrict number of period to reward in a transaction, to avoid consume too much gas uint toRewardPeriodCount = currentPeriod - latestRewardedPeriod; - toRewardPeriodCount = Math.min(toRewardPeriodCount, $_MAX_REWARDING_PERIOD_COUNT); + toRewardPeriodCount = Math.min(toRewardPeriodCount, $_MAX_REWARDING_PERIOD_COUNT.load()); _syncRewardBatch(latestRewardedPeriod, toRewardPeriodCount); } From eab45382a6ef45c687da07f83b4db73731bccafe Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 11 Mar 2024 13:59:37 +0700 Subject: [PATCH 042/180] feat(BridgeReward): rename public methods --- lib/foundry-deployment-kit | 2 +- src/interfaces/bridge/IBridgeReward.sol | 4 ++-- src/ronin/gateway/BridgeReward.sol | 4 ++-- src/ronin/gateway/BridgeTracking.sol | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/foundry-deployment-kit b/lib/foundry-deployment-kit index 3aa1ca23..8c728424 160000 --- a/lib/foundry-deployment-kit +++ b/lib/foundry-deployment-kit @@ -1 +1 @@ -Subproject commit 3aa1ca23adaa55a2e04818b0dced14947e4e5c28 +Subproject commit 8c728424858f8c8358f2e0f9374a6ea581f46486 diff --git a/src/interfaces/bridge/IBridgeReward.sol b/src/interfaces/bridge/IBridgeReward.sol index 6569eb54..9d5e314d 100644 --- a/src/interfaces/bridge/IBridgeReward.sol +++ b/src/interfaces/bridge/IBridgeReward.sol @@ -9,7 +9,7 @@ interface IBridgeReward is IBridgeRewardEvents { * @dev This function allows bridge operators to manually synchronize the reward for a given period length. * @param periodLength The length of the reward period for which synchronization is requested. */ - function syncReward(uint256 periodLength) external; + function syncRewardManual(uint256 periodLength) external; /** * @dev Receives RON from any address. @@ -23,7 +23,7 @@ interface IBridgeReward is IBridgeRewardEvents { * - This method is only called once each period. * - The caller must be the bridge tracking contract */ - function execSyncReward() external; + function execSyncRewardAuto() external; /** * @dev Retrieve the total amount of rewards that have been topped up in the contract. diff --git a/src/ronin/gateway/BridgeReward.sol b/src/ronin/gateway/BridgeReward.sol index 702daedc..39e1a115 100644 --- a/src/ronin/gateway/BridgeReward.sol +++ b/src/ronin/gateway/BridgeReward.sol @@ -78,7 +78,7 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT /** * @inheritdoc IBridgeReward */ - function syncReward(uint256 periodCount) external { + function syncRewardManual(uint256 periodCount) external { if (!_isBridgeOperator(msg.sender)) revert ErrUnauthorizedCall(msg.sig); uint256 latestRewardedPeriod = getLatestRewardedPeriod(); @@ -92,7 +92,7 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT /** * @inheritdoc IBridgeReward */ - function execSyncReward() external onlyContract(ContractType.BRIDGE_TRACKING) { + function execSyncRewardAuto() external onlyContract(ContractType.BRIDGE_TRACKING) { uint256 latestRewardedPeriod = getLatestRewardedPeriod(); uint256 currentPeriod = IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod(); diff --git a/src/ronin/gateway/BridgeTracking.sol b/src/ronin/gateway/BridgeTracking.sol index f52a0f19..b446c21a 100644 --- a/src/ronin/gateway/BridgeTracking.sol +++ b/src/ronin/gateway/BridgeTracking.sol @@ -228,9 +228,9 @@ contract BridgeTracking is HasBridgeDeprecated, HasValidatorDeprecated, HasContr } address bridgeRewardContract = getContract(ContractType.BRIDGE_REWARD); - (success, returnOrRevertData) = bridgeRewardContract.call(abi.encodeCall(IBridgeReward.execSyncReward, ())); + (success, returnOrRevertData) = bridgeRewardContract.call(abi.encodeCall(IBridgeReward.execSyncRewardAuto, ())); if (!success) { - emit ExternalCallFailed(bridgeRewardContract, IBridgeReward.execSyncReward.selector, returnOrRevertData); + emit ExternalCallFailed(bridgeRewardContract, IBridgeReward.execSyncRewardAuto.selector, returnOrRevertData); } } } From 3d137ae35abead94e9721c32c180b4fd1a98c0dd Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 11 Mar 2024 17:25:13 +0700 Subject: [PATCH 043/180] feat(BridgeReward): rework the reward methods, reduce duplication --- src/interfaces/bridge/IBridgeReward.sol | 6 +- .../bridge/events/IBridgeRewardEvents.sol | 3 + src/ronin/gateway/BridgeReward.sol | 60 +++++++++++-------- src/ronin/gateway/BridgeTracking.sol | 10 ++-- 4 files changed, 46 insertions(+), 33 deletions(-) diff --git a/src/interfaces/bridge/IBridgeReward.sol b/src/interfaces/bridge/IBridgeReward.sol index 9d5e314d..f3668fc9 100644 --- a/src/interfaces/bridge/IBridgeReward.sol +++ b/src/interfaces/bridge/IBridgeReward.sol @@ -7,9 +7,9 @@ import { IBridgeRewardEvents } from "./events/IBridgeRewardEvents.sol"; interface IBridgeReward is IBridgeRewardEvents { /** * @dev This function allows bridge operators to manually synchronize the reward for a given period length. - * @param periodLength The length of the reward period for which synchronization is requested. + * @param periodCount The length of the reward period for which synchronization is requested. */ - function syncRewardManual(uint256 periodLength) external; + function syncRewardManual(uint256 periodCount) external; /** * @dev Receives RON from any address. @@ -23,7 +23,7 @@ interface IBridgeReward is IBridgeRewardEvents { * - This method is only called once each period. * - The caller must be the bridge tracking contract */ - function execSyncRewardAuto() external; + function execSyncRewardAuto(uint256 currentPeriod) external; /** * @dev Retrieve the total amount of rewards that have been topped up in the contract. diff --git a/src/interfaces/bridge/events/IBridgeRewardEvents.sol b/src/interfaces/bridge/events/IBridgeRewardEvents.sol index 5179e071..ea737cc2 100644 --- a/src/interfaces/bridge/events/IBridgeRewardEvents.sol +++ b/src/interfaces/bridge/events/IBridgeRewardEvents.sol @@ -29,4 +29,7 @@ interface IBridgeRewardEvents { event BridgeRewardScatterFailed(uint256 indexed period, address operator, uint256 amount); /// @dev Event emitted when the requesting period to sync is too far. event BridgeRewardSyncTooFarPeriod(uint256 requestingPeriod, uint256 latestPeriod); + + error ErrPeriodNotHappen(bytes4 msgSig, uint256 currentPeriod, uint256 latestRewardedPeriod, uint256 periodCount); + error ErrPeriodAlreadyRewarded(bytes4 msgSig, uint256 currentPeriod, uint256 latestRewardedPeriod); } diff --git a/src/ronin/gateway/BridgeReward.sol b/src/ronin/gateway/BridgeReward.sol index 39e1a115..42a90678 100644 --- a/src/ronin/gateway/BridgeReward.sol +++ b/src/ronin/gateway/BridgeReward.sol @@ -80,47 +80,57 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT */ function syncRewardManual(uint256 periodCount) external { if (!_isBridgeOperator(msg.sender)) revert ErrUnauthorizedCall(msg.sig); + uint256 currPd = IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod(); - uint256 latestRewardedPeriod = getLatestRewardedPeriod(); - uint256 currentPeriod = IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod(); - if (latestRewardedPeriod + periodCount > currentPeriod) revert ErrInvalidArguments(msg.sig); - if (currentPeriod <= latestRewardedPeriod) revert ErrInvalidArguments(msg.sig); - - _syncRewardBatch(latestRewardedPeriod, periodCount); + _syncRewardBatch({ currPd: currPd, pdCount: periodCount }); } /** * @inheritdoc IBridgeReward */ - function execSyncRewardAuto() external onlyContract(ContractType.BRIDGE_TRACKING) { - uint256 latestRewardedPeriod = getLatestRewardedPeriod(); - uint256 currentPeriod = IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod(); - - if (currentPeriod <= latestRewardedPeriod) revert ErrInvalidArguments(msg.sig); - - // Restrict number of period to reward in a transaction, to avoid consume too much gas - uint toRewardPeriodCount = currentPeriod - latestRewardedPeriod; - toRewardPeriodCount = Math.min(toRewardPeriodCount, $_MAX_REWARDING_PERIOD_COUNT.load()); - - _syncRewardBatch(latestRewardedPeriod, toRewardPeriodCount); + function execSyncRewardAuto(uint256 currentPeriod) external onlyContract(ContractType.BRIDGE_TRACKING) { + _syncRewardBatch({ currPd: currentPeriod, pdCount: 0 }); } - function _syncRewardBatch(uint256 latestRewardedPeriod, uint256 periodCount) internal { + /** + * @dev Sync bridge reward for multiple periods, always assert `latestRewardedPeriod + periodCount <= currentPeriod`. + * @param pdCount Number of periods to settle reward. Leave this as 0 to calculate. + */ + function _syncRewardBatch(uint256 currPd, uint256 pdCount) internal { + uint256 lastRewardPd = getLatestRewardedPeriod(); + if (pdCount == 0) { + // Unchecked the subtraction to avoid underflow. The result will be checked in the next assertion. + unchecked { + // Restrict number of period to reward in a transaction, to avoid consume too much gas + uint toSettlePdCount = currPd - lastRewardPd; + pdCount = Math.min(toSettlePdCount, $_MAX_REWARDING_PERIOD_COUNT.load()); + } + } + _assertPeriod({ currPd: currPd, pdCount: pdCount, lastRewardPd: lastRewardPd }); + address[] memory operators = IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)).getBridgeOperators(); IBridgeTracking bridgeTrackingContract = IBridgeTracking(getContract(ContractType.BRIDGE_TRACKING)); - for (uint256 i = 1; i <= periodCount; i++) { + for (uint256 i = 1; i <= pdCount; i++) { $_LATEST_REWARDED_PERIOD.addAssign(1); - _syncReward({ + _settleReward({ operators: operators, - ballots: bridgeTrackingContract.getManyTotalBallots(latestRewardedPeriod, operators), - totalBallot: bridgeTrackingContract.totalBallot(latestRewardedPeriod), - totalVote: bridgeTrackingContract.totalVote(latestRewardedPeriod), - period: latestRewardedPeriod + i + ballots: bridgeTrackingContract.getManyTotalBallots(lastRewardPd, operators), + totalBallot: bridgeTrackingContract.totalBallot(lastRewardPd), + totalVote: bridgeTrackingContract.totalVote(lastRewardPd), + period: lastRewardPd + i }); } } + function _assertPeriod(uint256 currPd, uint256 pdCount, uint256 lastRewardPd) internal { + // Not settle the periods that not happen yet. + if (currPd < lastRewardPd + pdCount) revert ErrPeriodNotHappen(msg.sig, currPd, lastRewardPd, pdCount); + + // Not settle the period that already rewarded. + if (currPd <= lastRewardPd) revert ErrPeriodAlreadyRewarded(msg.sig, currPd, lastRewardPd); + } + /** * @inheritdoc IBridgeReward */ @@ -154,7 +164,7 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT * @param totalVote The total number of votes recorded for the period. * @param period The period for which the rewards are being synchronized. */ - function _syncReward(address[] memory operators, uint256[] memory ballots, uint256 totalBallot, uint256 totalVote, uint256 period) internal { + function _settleReward(address[] memory operators, uint256[] memory ballots, uint256 totalBallot, uint256 totalVote, uint256 period) internal { uint256 numBridgeOperators = operators.length; uint256 rewardPerPeriod = getRewardPerPeriod(); uint256[] memory slashedDurationList = _getSlashInfo(operators); diff --git a/src/ronin/gateway/BridgeTracking.sol b/src/ronin/gateway/BridgeTracking.sol index b446c21a..7dd21a1f 100644 --- a/src/ronin/gateway/BridgeTracking.sol +++ b/src/ronin/gateway/BridgeTracking.sol @@ -195,7 +195,7 @@ contract BridgeTracking is HasBridgeDeprecated, HasValidatorDeprecated, HasContr * @inheritdoc IBridgeTracking */ function recordVote(VoteKind kind, uint256 requestId, address operator) external override onlyContract(ContractType.BRIDGE) skipOnNotStarted { - uint256 period = IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod(); + uint256 currPd = IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod(); _trySyncBuffer(); ReceiptTrackingInfo storage _receiptInfo = _receiptTrackingInfo[kind][requestId]; @@ -206,12 +206,12 @@ contract BridgeTracking is HasBridgeDeprecated, HasValidatorDeprecated, HasContr return; } - _increaseBallot(kind, requestId, operator, period); + _increaseBallot(kind, requestId, operator, currPd); uint256 lastSyncPeriod = _lastSyncPeriod; // When switching to new period, wrap up vote info, then slash and distribute reward accordingly. - if (lastSyncPeriod < period) { - _lastSyncPeriod = period; + if (lastSyncPeriod < currPd) { + _lastSyncPeriod = currPd; address[] memory allOperators = IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)).getBridgeOperators(); uint256[] memory ballots = _getManyTotalBallots(lastSyncPeriod, allOperators); @@ -228,7 +228,7 @@ contract BridgeTracking is HasBridgeDeprecated, HasValidatorDeprecated, HasContr } address bridgeRewardContract = getContract(ContractType.BRIDGE_REWARD); - (success, returnOrRevertData) = bridgeRewardContract.call(abi.encodeCall(IBridgeReward.execSyncRewardAuto, ())); + (success, returnOrRevertData) = bridgeRewardContract.call(abi.encodeCall(IBridgeReward.execSyncRewardAuto, (currPd))); if (!success) { emit ExternalCallFailed(bridgeRewardContract, IBridgeReward.execSyncRewardAuto.selector, returnOrRevertData); } From 71214907694cba92e068312c0785001304bb6780 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 12 Mar 2024 16:35:38 +0700 Subject: [PATCH 044/180] fix(BridgeReward): rework the emitted period num --- .../bridge/events/IBridgeRewardEvents.sol | 5 +- src/ronin/gateway/BridgeReward.sol | 71 ++++++++++++------- 2 files changed, 49 insertions(+), 27 deletions(-) diff --git a/src/interfaces/bridge/events/IBridgeRewardEvents.sol b/src/interfaces/bridge/events/IBridgeRewardEvents.sol index ea737cc2..440a44e3 100644 --- a/src/interfaces/bridge/events/IBridgeRewardEvents.sol +++ b/src/interfaces/bridge/events/IBridgeRewardEvents.sol @@ -30,6 +30,7 @@ interface IBridgeRewardEvents { /// @dev Event emitted when the requesting period to sync is too far. event BridgeRewardSyncTooFarPeriod(uint256 requestingPeriod, uint256 latestPeriod); - error ErrPeriodNotHappen(bytes4 msgSig, uint256 currentPeriod, uint256 latestRewardedPeriod, uint256 periodCount); - error ErrPeriodAlreadyRewarded(bytes4 msgSig, uint256 currentPeriod, uint256 latestRewardedPeriod); + error ErrPeriodNotHappen(uint256 currentPeriod, uint256 latestRewardedPeriod, uint256 periodCount); + error ErrPeriodAlreadyRewarded(uint256 currentPeriod, uint256 latestRewardedPeriod); + error ErrPeriodCountIsZero(); } diff --git a/src/ronin/gateway/BridgeReward.sol b/src/ronin/gateway/BridgeReward.sol index 42a90678..52d42093 100644 --- a/src/ronin/gateway/BridgeReward.sol +++ b/src/ronin/gateway/BridgeReward.sol @@ -56,7 +56,7 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT /** * @dev Helper for running upgrade script, required to only revoked once by the DPoS's governance admin. - * The following must be assured after initializing REP2: `_lastSyncPeriod` == `{BridgeReward}.latestRewardedPeriod` == `currentPeriod()` + * The following must be assured after initializing REP2: `{BridgeTracking}._lastSyncPeriod` == `{BridgeReward}.latestRewardedPeriod` == `currentPeriod()` */ function initializeREP2() external onlyContract(ContractType.GOVERNANCE_ADMIN) { require(getLatestRewardedPeriod() == type(uint256).max, "already init rep 2"); @@ -66,6 +66,7 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT function initializeV2() external reinitializer(2) { $_MAX_REWARDING_PERIOD_COUNT.store(5); + $_LATEST_REWARDED_PERIOD.store(getLatestRewardedPeriod() - 1); } /** @@ -94,41 +95,66 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT /** * @dev Sync bridge reward for multiple periods, always assert `latestRewardedPeriod + periodCount <= currentPeriod`. - * @param pdCount Number of periods to settle reward. Leave this as 0 to calculate. + * @param pdCount Number of periods to settle reward. Leave this as 0 to auto calculate. */ function _syncRewardBatch(uint256 currPd, uint256 pdCount) internal { uint256 lastRewardPd = getLatestRewardedPeriod(); if (pdCount == 0) { - // Unchecked the subtraction to avoid underflow. The result will be checked in the next assertion. - unchecked { - // Restrict number of period to reward in a transaction, to avoid consume too much gas - uint toSettlePdCount = currPd - lastRewardPd; - pdCount = Math.min(toSettlePdCount, $_MAX_REWARDING_PERIOD_COUNT.load()); + uint toSettlePdCount; + if (currPd > lastRewardPd) { + toSettlePdCount = currPd - lastRewardPd - 1; } + + // Restrict number of period to reward in a transaction, to avoid consume too much gas + pdCount = Math.min(toSettlePdCount, $_MAX_REWARDING_PERIOD_COUNT.load()); } + _assertPeriod({ currPd: currPd, pdCount: pdCount, lastRewardPd: lastRewardPd }); address[] memory operators = IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)).getBridgeOperators(); IBridgeTracking bridgeTrackingContract = IBridgeTracking(getContract(ContractType.BRIDGE_TRACKING)); - for (uint256 i = 1; i <= pdCount; i++) { - $_LATEST_REWARDED_PERIOD.addAssign(1); + for (uint256 i = 0; i < pdCount; i++) { + ++lastRewardPd; _settleReward({ operators: operators, ballots: bridgeTrackingContract.getManyTotalBallots(lastRewardPd, operators), totalBallot: bridgeTrackingContract.totalBallot(lastRewardPd), totalVote: bridgeTrackingContract.totalVote(lastRewardPd), - period: lastRewardPd + i + period: lastRewardPd }); } } - function _assertPeriod(uint256 currPd, uint256 pdCount, uint256 lastRewardPd) internal { - // Not settle the periods that not happen yet. - if (currPd < lastRewardPd + pdCount) revert ErrPeriodNotHappen(msg.sig, currPd, lastRewardPd, pdCount); + /** + * @dev + * Before the last valid rewarding: + * |----------|------------------|------------------------------|-----------------| + * ^ ^ ^ + * Validator.current + * Reward.lastReward + * Tracking.lastSync + * Tracking.ballotInfo + * Slash.slashInfo + * + * + * After the last valid rewarding, the lastRewardedPeriod always slower than currentPeriod: + * |----------|------------------|------------------------------|-----------------| + * ^ ^ + * Validator.current + * Reward.lastReward + * Tracking.lastSync + * Tracking.ballotInfo + * Slash.slashInfo + */ + function _assertPeriod(uint256 currPd, uint256 pdCount, uint256 lastRewardPd) internal pure { + if (pdCount == 0) revert ErrPeriodCountIsZero(); // Not settle the period that already rewarded. - if (currPd <= lastRewardPd) revert ErrPeriodAlreadyRewarded(msg.sig, currPd, lastRewardPd); + if (currPd <= lastRewardPd + 1) revert ErrPeriodAlreadyRewarded(currPd, lastRewardPd); + + // Not settle the periods that not happen yet. + if (currPd <= lastRewardPd + pdCount) revert ErrPeriodNotHappen(currPd, lastRewardPd, pdCount); } /** @@ -166,6 +192,8 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT */ function _settleReward(address[] memory operators, uint256[] memory ballots, uint256 totalBallot, uint256 totalVote, uint256 period) internal { uint256 numBridgeOperators = operators.length; + if (numBridgeOperators != ballots.length) revert ErrLengthMismatch(msg.sig); + uint256 rewardPerPeriod = getRewardPerPeriod(); uint256[] memory slashedDurationList = _getSlashInfo(operators); // Validate should share the reward equally @@ -175,7 +203,7 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT bool shouldSlash; uint256 sumRewards; - for (uint256 i; i < numBridgeOperators;) { + for (uint256 i; i < numBridgeOperators; i++) { (reward, shouldSlash) = _calcRewardAndCheckSlashedStatus({ shouldShareEqually: shouldShareEqually, numBridgeOperators: numBridgeOperators, @@ -188,13 +216,10 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT sumRewards += shouldSlash ? 0 : reward; _updateRewardAndTransfer({ period: period, operator: operators[i], reward: reward, shouldSlash: shouldSlash }); - - unchecked { - ++i; - } } $_TOTAL_REWARDS_SCATTERED.addAssign(sumRewards); + $_LATEST_REWARDED_PERIOD.store(period); } /** @@ -239,13 +264,9 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT /** * @dev Internal function to check if a specific period should be considered as slashed based on the slash duration. - * @param period The period to check if it should be slashed. - * @param slashDuration The duration until which periods should be considered as slashed. - * @return shouldSlashed A boolean indicating whether the specified period should be slashed. - * @notice This function is used internally to determine if a particular period should be marked as slashed based on the slash duration. */ - function _shouldSlashedThisPeriod(uint256 period, uint256 slashDuration) internal pure returns (bool) { - return period <= slashDuration; + function _shouldSlashedThisPeriod(uint256 period, uint256 slashUntil) internal pure returns (bool) { + return period <= slashUntil; } /** From ad79b6ff4fa012ff243a882487fd08258ce92f37 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 12 Mar 2024 16:36:02 +0700 Subject: [PATCH 045/180] test(BridgeReward): rework the whole test suite of bridge reward --- .../concrete/bridge-reward/BridgeReward.t.sol | 46 +++- .../concrete/bridge-reward/assertPeriod.t.sol | 76 ++++++ .../execSyncReward/execSyncReward.t.sol | 238 ++---------------- .../bridge-reward/execSyncRewardAuto.t.sol | 125 +++++++++ .../bridge-reward/syncRewardManual.t.sol | 60 +++++ test/harness/BridgeRewardHarness.sol | 19 ++ test/mocks/MockBridgeManager.sol | 86 +++++-- test/mocks/MockBridgeSlash.sol | 2 +- test/mocks/MockBridgeTracking.sol | 4 +- 9 files changed, 403 insertions(+), 253 deletions(-) create mode 100644 test/bridge/unit/concrete/bridge-reward/assertPeriod.t.sol create mode 100644 test/bridge/unit/concrete/bridge-reward/execSyncRewardAuto.t.sol create mode 100644 test/bridge/unit/concrete/bridge-reward/syncRewardManual.t.sol create mode 100644 test/harness/BridgeRewardHarness.sol diff --git a/test/bridge/unit/concrete/bridge-reward/BridgeReward.t.sol b/test/bridge/unit/concrete/bridge-reward/BridgeReward.t.sol index 529ae34f..c1cb817e 100644 --- a/test/bridge/unit/concrete/bridge-reward/BridgeReward.t.sol +++ b/test/bridge/unit/concrete/bridge-reward/BridgeReward.t.sol @@ -17,33 +17,37 @@ import { MockBridgeSlash } from "@ronin/test/mocks/MockBridgeSlash.sol"; import { MockValidatorSet_ForFoundryTest } from "@ronin/test/mocks/MockValidatorSet_ForFoundryTest.sol"; import { Users } from "@ronin/test/utils/Types.sol"; +import "@ronin/test/harness/BridgeRewardHarness.sol"; + contract BridgeReward_Unit_Concrete_Test is Base_Test { - BridgeReward internal _bridgeReward; + BridgeRewardHarness internal _bridgeReward; address internal _proxyAdmin; uint256 internal _rewardPerPeriod; - IBridgeTracking internal _bridgeTracking; - IBridgeManager internal _bridgeManager; - IBridgeSlash internal _bridgeSlash; + MockBridgeTracking internal _bridgeTracking; + MockBridgeManager internal _bridgeManager; + MockBridgeSlash internal _bridgeSlash; MockValidatorSet_ForFoundryTest internal _validatorSetContract; Users internal _users; + address _operator; + address _governor; + uint96 _weight; + function setUp() public virtual { // Create users for testing. _users = Users({ alice: createUser("Alice") }); + _operator = makeAddr("operator"); + _governor = makeAddr("governor"); _proxyAdmin = vm.addr(1); _rewardPerPeriod = 50_000; - address bridgeRewardImpl = address(new BridgeReward()); + address bridgeRewardImpl = address(new BridgeRewardHarness()); // Deploy the dependencies and mocks for testing contract - _bridgeReward = BridgeReward( - address( - new TransparentUpgradeableProxyV2{ value: _rewardPerPeriod * 1_000_000 }(bridgeRewardImpl, _proxyAdmin, "") - ) - ); + _bridgeReward = BridgeRewardHarness(address(new TransparentUpgradeableProxyV2{ value: _rewardPerPeriod * 1_000_000 }(bridgeRewardImpl, _proxyAdmin, ""))); _bridgeTracking = new MockBridgeTracking(); _bridgeManager = new MockBridgeManager(); _bridgeSlash = new MockBridgeSlash(); @@ -63,6 +67,7 @@ contract BridgeReward_Unit_Concrete_Test is Base_Test { vm.prank(makeAccount("dposGA").addr); _bridgeReward.initializeREP2(); + _bridgeReward.initializeV2(); // Label the base test contracts. vm.label({ account: address(_bridgeReward), newLabel: "Bridge Reward" }); @@ -79,4 +84,25 @@ contract BridgeReward_Unit_Concrete_Test is Base_Test { vm.deal({ account: user, newBalance: 100 ether }); return user; } + + function _generateInput_shareRewardProportionally() + internal + pure + returns (address[] memory operators, uint256[] memory ballots, uint256 totalBallot, uint256 totalVote) + { + operators = new address[](4); + operators[0] = address(0x10000); + operators[1] = address(0x10001); + operators[2] = address(0x10002); + operators[3] = address(0x10003); + + ballots = new uint256[](4); + ballots[0] = 10; + ballots[1] = 20; + ballots[2] = 30; + ballots[3] = 40; + + totalBallot = 100; + totalVote = 40; + } } diff --git a/test/bridge/unit/concrete/bridge-reward/assertPeriod.t.sol b/test/bridge/unit/concrete/bridge-reward/assertPeriod.t.sol new file mode 100644 index 00000000..f9edb682 --- /dev/null +++ b/test/bridge/unit/concrete/bridge-reward/assertPeriod.t.sol @@ -0,0 +1,76 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity >=0.8.17 <0.9.0; + +import { console2 } from "forge-std/console2.sol"; +import { StdStyle } from "forge-std/StdStyle.sol"; + +import "@ronin/contracts/utils/CommonErrors.sol"; +import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; +import { IBridgeReward } from "@ronin/contracts/interfaces/bridge/IBridgeReward.sol"; +import { IBridgeRewardEvents } from "@ronin/contracts/interfaces/bridge/events/IBridgeRewardEvents.sol"; +import { BridgeReward } from "@ronin/contracts/ronin/gateway/BridgeReward.sol"; +import { BridgeTrackingHelper } from "@ronin/contracts/extensions/bridge-operator-governance/BridgeTrackingHelper.sol"; + +import "./BridgeReward.t.sol"; + +contract AssertPeriod_Unit_Concrete_Test is + BridgeReward_Unit_Concrete_Test, + IBridgeRewardEvents, + BridgeTrackingHelper // Need to inherits this to access event +{ + function setUp() public virtual override { + BridgeReward_Unit_Concrete_Test.setUp(); + vm.startPrank({ msgSender: address(_bridgeTracking) }); + } + + function test_RevertWhen_assertPeriod_PeriodCountIsZero() external { + vm.expectRevert(abi.encodeWithSelector(ErrPeriodCountIsZero.selector)); + _bridgeReward.exposed_assertPeriod({ lastRewardPd: 1, pdCount: 0, currPd: 1 }); + } + + function test_RevertWhen_assertPeriod_PeriodIsAlreadyRewarded() external { + vm.expectRevert(abi.encodeWithSelector(ErrPeriodAlreadyRewarded.selector, 38, 37)); + _bridgeReward.exposed_assertPeriod({ lastRewardPd: 37, pdCount: 1, currPd: 38 }); + } + + function test_RevertWhen_assertPeriod_PeriodIsAlreadyRewarded_Multi() external { + vm.expectRevert(abi.encodeWithSelector(ErrPeriodAlreadyRewarded.selector, 37, 37)); + _bridgeReward.exposed_assertPeriod({ lastRewardPd: 37, pdCount: 2, currPd: 37 }); + } + + function test_RevertWhen_assertPeriod_PeriodIsAlreadyRewarded_LongAgo() external { + vm.expectRevert(abi.encodeWithSelector(ErrPeriodAlreadyRewarded.selector, 30, 37)); + _bridgeReward.exposed_assertPeriod({ lastRewardPd: 37, pdCount: 2, currPd: 30 }); + } + + function test_RevertWhen_assertPeriod_PeriodNotHappen_1() external { + vm.expectRevert(abi.encodeWithSelector(ErrPeriodNotHappen.selector, 37, 35, 2)); + _bridgeReward.exposed_assertPeriod({ lastRewardPd: 35, pdCount: 2, currPd: 37 }); + } + + function test_RevertWhen_assertPeriod_PeriodNotHappen_2() external { + vm.expectRevert(abi.encodeWithSelector(ErrPeriodNotHappen.selector, 37, 34, 3)); + _bridgeReward.exposed_assertPeriod({ lastRewardPd: 34, pdCount: 3, currPd: 37 }); + } + + function test_RevertWhen_assertPeriod_PeriodNotHappen_CountTooBig() external { + vm.expectRevert(abi.encodeWithSelector(ErrPeriodNotHappen.selector, 37, 34, 3000000)); + _bridgeReward.exposed_assertPeriod({ lastRewardPd: 34, pdCount: 3000000, currPd: 37 }); + } + + function test_assertPeriod_Passed_WhenRequest1CurrentPeriod_UpToCurrent() external view { + _bridgeReward.exposed_assertPeriod({ lastRewardPd: 35, pdCount: 1, currPd: 37 }); + } + + function test_assertPeriod_Passed_WhenRequest2CurrentPeriod_UpToCurrent() external view { + _bridgeReward.exposed_assertPeriod({ lastRewardPd: 34, pdCount: 2, currPd: 37 }); + } + + function test_assertPeriod_Passed_WhenRequest1CurrentPeriod_NotUpToCurrent() external view { + _bridgeReward.exposed_assertPeriod({ lastRewardPd: 34, pdCount: 1, currPd: 37 }); + } + + function test_assertPeriod_Passed_WhenRequest3CurrentPeriod_NotUpToCurrent() external view { + _bridgeReward.exposed_assertPeriod({ lastRewardPd: 33, pdCount: 3, currPd: 37 }); + } +} diff --git a/test/bridge/unit/concrete/bridge-reward/execSyncReward/execSyncReward.t.sol b/test/bridge/unit/concrete/bridge-reward/execSyncReward/execSyncReward.t.sol index c6e5794a..2464b4af 100644 --- a/test/bridge/unit/concrete/bridge-reward/execSyncReward/execSyncReward.t.sol +++ b/test/bridge/unit/concrete/bridge-reward/execSyncReward/execSyncReward.t.sol @@ -11,9 +11,9 @@ import { IBridgeRewardEvents } from "@ronin/contracts/interfaces/bridge/events/I import { BridgeReward } from "@ronin/contracts/ronin/gateway/BridgeReward.sol"; import { BridgeTrackingHelper } from "@ronin/contracts/extensions/bridge-operator-governance/BridgeTrackingHelper.sol"; -import { BridgeReward_Unit_Concrete_Test } from "../BridgeReward.t.sol"; +import "../BridgeReward.t.sol"; -contract Add_Unit_Concrete_Test is +contract SettleReward_Unit_Concrete_Test is BridgeReward_Unit_Concrete_Test, IBridgeRewardEvents, BridgeTrackingHelper // Need to inherits this to access event @@ -23,41 +23,8 @@ contract Add_Unit_Concrete_Test is vm.startPrank({ msgSender: address(_bridgeTracking) }); } - function test_RevertWhen_NotCalledByBridgeTracking() external { - ( - address[] memory operators, - uint256[] memory ballots, - uint256 totalBallot, - uint256 totalVote - ) = _generateInput_execSyncReward(); - - uint256 period = _validatorSetContract.currentPeriod() + 1; - - changePrank(_users.alice); - vm.expectRevert( - abi.encodeWithSelector( - ErrUnexpectedInternalCall.selector, - IBridgeReward.execSyncReward.selector, - ContractType.BRIDGE_TRACKING, - _users.alice - ) - ); - _bridgeReward.execSyncReward({ - operators: operators, - ballots: ballots, - totalBallot: totalBallot, - totalVote: totalVote, - period: period - }); - } - function test_RevertWhen_OperatorsLengthIsZero() external { - ( - address[] memory operators, - uint256[] memory ballots, - uint256 totalBallot, - uint256 totalVote - ) = _generateInput_execSyncReward(); + (address[] memory operators, uint256[] memory ballots, uint256 totalBallot, uint256 totalVote) = _generateInput_shareRewardProportionally(); uint256 period = _validatorSetContract.currentPeriod() + 1; assembly ("memory-safe") { @@ -66,96 +33,30 @@ contract Add_Unit_Concrete_Test is } // TODO: test tx not emit event - _bridgeReward.execSyncReward({ - operators: operators, - ballots: ballots, - totalBallot: totalBallot, - totalVote: totalVote, - period: period - }); + _bridgeReward.exposed_settleReward({ operators: operators, ballots: ballots, totalBallot: totalBallot, totalVote: totalVote, period: period }); } function test_RevertWhen_TwoInputArraysLengthsDiffer() external { - ( - address[] memory operators, - uint256[] memory ballots, - uint256 totalBallot, - uint256 totalVote - ) = _generateInput_execSyncReward(); + (address[] memory operators, uint256[] memory ballots, uint256 totalBallot, uint256 totalVote) = _generateInput_shareRewardProportionally(); uint256 period = _validatorSetContract.currentPeriod() + 1; assembly ("memory-safe") { mstore(operators, 1) } - vm.expectRevert(abi.encodeWithSelector(ErrLengthMismatch.selector, IBridgeReward.execSyncReward.selector)); - _bridgeReward.execSyncReward({ - operators: operators, - ballots: ballots, - totalBallot: totalBallot, - totalVote: totalVote, - period: period - }); + vm.expectRevert(abi.encodeWithSelector(ErrLengthMismatch.selector, BridgeRewardHarness.exposed_settleReward.selector)); + _bridgeReward.exposed_settleReward({ operators: operators, ballots: ballots, totalBallot: totalBallot, totalVote: totalVote, period: period }); assembly ("memory-safe") { mstore(operators, 0) } - vm.expectRevert(abi.encodeWithSelector(ErrLengthMismatch.selector, IBridgeReward.execSyncReward.selector)); - _bridgeReward.execSyncReward({ - operators: operators, - ballots: ballots, - totalBallot: totalBallot, - totalVote: totalVote, - period: period - }); - } - - function test_RevertWhen_AlreadyRewardedPeriod() external { - ( - address[] memory operators, - uint256[] memory ballots, - uint256 totalBallot, - uint256 totalVote - ) = _generateInput_execSyncReward(); - uint256 period = _validatorSetContract.currentPeriod() - 1; - - vm.expectRevert(abi.encodeWithSelector(ErrInvalidArguments.selector, IBridgeReward.execSyncReward.selector)); - _bridgeReward.execSyncReward({ - operators: operators, - ballots: ballots, - totalBallot: totalBallot, - totalVote: totalVote, - period: period - }); - } - function test_RevertWhen_PeriodTooFar() external { - ( - address[] memory operators, - uint256[] memory ballots, - uint256 totalBallot, - uint256 totalVote - ) = _generateInput_execSyncReward(); - uint256 latestPeriod = _validatorSetContract.currentPeriod() - 1; - uint256 requestingPeriod = latestPeriod + 10; - - vm.expectRevert(abi.encodeWithSelector(ErrSyncTooFarPeriod.selector, requestingPeriod, latestPeriod)); - _bridgeReward.execSyncReward({ - operators: operators, - ballots: ballots, - totalBallot: totalBallot, - totalVote: totalVote, - period: requestingPeriod - }); + vm.expectRevert(abi.encodeWithSelector(ErrLengthMismatch.selector, BridgeRewardHarness.exposed_settleReward.selector)); + _bridgeReward.exposed_settleReward({ operators: operators, ballots: ballots, totalBallot: totalBallot, totalVote: totalVote, period: period }); } - function test_execSyncReward_ShareEqually_WhenDataCorrupts_NotTopUpFund() external { - ( - address[] memory operators, - uint256[] memory ballots, - uint256 totalBallot, - uint256 totalVote - ) = _generateInput_execSyncReward(); + function test_settleReward_ShareEqually_WhenDataCorrupts_NotTopUpFund() external { + (address[] memory operators, uint256[] memory ballots, uint256 totalBallot, uint256 totalVote) = _generateInput_shareRewardProportionally(); uint256 period = _validatorSetContract.currentPeriod(); ballots[0] = 100_000; @@ -170,24 +71,13 @@ contract Add_Unit_Concrete_Test is emit BridgeRewardScatterFailed(period, operators[i], _rewardPerPeriod / operators.length); } - _bridgeReward.execSyncReward({ - operators: operators, - ballots: ballots, - totalBallot: totalBallot, - totalVote: totalVote, - period: period - }); + _bridgeReward.exposed_settleReward({ operators: operators, ballots: ballots, totalBallot: totalBallot, totalVote: totalVote, period: period }); assertEq(_bridgeReward.getLatestRewardedPeriod(), period); } - function test_execSyncReward_ShareEqually_WhenDataCorrupts_HaveEnoughFund_OneAbnormalBallot() external { - ( - address[] memory operators, - uint256[] memory ballots, - uint256 totalBallot, - uint256 totalVote - ) = _generateInput_execSyncReward(); + function test_settleReward_ShareEqually_WhenDataCorrupts_HaveEnoughFund_OneAbnormalBallot() external { + (address[] memory operators, uint256[] memory ballots, uint256 totalBallot, uint256 totalVote) = _generateInput_shareRewardProportionally(); uint256 period = _validatorSetContract.currentPeriod(); ballots[0] = 100_000; @@ -199,23 +89,12 @@ contract Add_Unit_Concrete_Test is emit BridgeRewardScattered(period, operators[i], _rewardPerPeriod / operators.length); } - _bridgeReward.execSyncReward({ - operators: operators, - ballots: ballots, - totalBallot: totalBallot, - totalVote: totalVote, - period: period - }); + _bridgeReward.exposed_settleReward({ operators: operators, ballots: ballots, totalBallot: totalBallot, totalVote: totalVote, period: period }); assertEq(_bridgeReward.getLatestRewardedPeriod(), period); } - function test_execSyncReward_ShareEqually_WhenDataCorrupts_HaveEnoughFund_AbnormalTotalBallot() external { - ( - address[] memory operators, - uint256[] memory ballots, - uint256 totalBallot, - uint256 totalVote - ) = _generateInput_execSyncReward(); + function test_settleReward_ShareEqually_WhenDataCorrupts_HaveEnoughFund_AbnormalTotalBallot() external { + (address[] memory operators, uint256[] memory ballots, uint256 totalBallot, uint256 totalVote) = _generateInput_shareRewardProportionally(); uint256 period = _validatorSetContract.currentPeriod(); // Reduce number of total ballot @@ -228,22 +107,11 @@ contract Add_Unit_Concrete_Test is emit BridgeRewardScattered(period, operators[i], _rewardPerPeriod / operators.length); } - _bridgeReward.execSyncReward({ - operators: operators, - ballots: ballots, - totalBallot: totalBallot, - totalVote: totalVote, - period: period - }); + _bridgeReward.exposed_settleReward({ operators: operators, ballots: ballots, totalBallot: totalBallot, totalVote: totalVote, period: period }); } - function test_execSyncReward_ShareEqually_WhenNoVote() external { - ( - address[] memory operators, - uint256[] memory ballots, - uint256 totalBallot, - uint256 totalVote - ) = _generateInput_execSyncReward(); + function test_settleReward_ShareEqually_WhenNoVote() external { + (address[] memory operators, uint256[] memory ballots, uint256 totalBallot, uint256 totalVote) = _generateInput_shareRewardProportionally(); uint256 period = _validatorSetContract.currentPeriod(); ballots[0] = 0; @@ -258,23 +126,12 @@ contract Add_Unit_Concrete_Test is emit BridgeRewardScattered(period, operators[i], _rewardPerPeriod / operators.length); } - _bridgeReward.execSyncReward({ - operators: operators, - ballots: ballots, - totalBallot: totalBallot, - totalVote: totalVote, - period: period - }); + _bridgeReward.exposed_settleReward({ operators: operators, ballots: ballots, totalBallot: totalBallot, totalVote: totalVote, period: period }); assertEq(_bridgeReward.getLatestRewardedPeriod(), period); } - function test_execSyncReward_SharePropotionally() public { - ( - address[] memory operators, - uint256[] memory ballots, - uint256 totalBallot, - uint256 totalVote - ) = _generateInput_execSyncReward(); + function test_settleReward_SharePropotionally() public { + (address[] memory operators, uint256[] memory ballots, uint256 totalBallot, uint256 totalVote) = _generateInput_shareRewardProportionally(); uint256 period = _validatorSetContract.currentPeriod(); for (uint i; i < operators.length; i++) { @@ -282,54 +139,7 @@ contract Add_Unit_Concrete_Test is emit BridgeRewardScattered(period, operators[i], (_rewardPerPeriod * ballots[i]) / totalBallot); } - _bridgeReward.execSyncReward({ - operators: operators, - ballots: ballots, - totalBallot: totalBallot, - totalVote: totalVote, - period: period - }); + _bridgeReward.exposed_settleReward({ operators: operators, ballots: ballots, totalBallot: totalBallot, totalVote: totalVote, period: period }); assertEq(_bridgeReward.getLatestRewardedPeriod(), period); } - - function test_RevertWhen_SharePropotionally_ThenShareAgain() external { - test_execSyncReward_SharePropotionally(); - - ( - address[] memory operators, - uint256[] memory ballots, - uint256 totalBallot, - uint256 totalVote - ) = _generateInput_execSyncReward(); - uint256 period = _validatorSetContract.currentPeriod(); - vm.expectRevert(abi.encodeWithSelector(ErrInvalidArguments.selector, IBridgeReward.execSyncReward.selector)); - _bridgeReward.execSyncReward({ - operators: operators, - ballots: ballots, - totalBallot: totalBallot, - totalVote: totalVote, - period: period - }); - } - - function _generateInput_execSyncReward() - internal - pure - returns (address[] memory operators, uint256[] memory ballots, uint256 totalBallot, uint256 totalVote) - { - operators = new address[](4); - operators[0] = address(0x10000); - operators[1] = address(0x10001); - operators[2] = address(0x10002); - operators[3] = address(0x10003); - - ballots = new uint256[](4); - ballots[0] = 10; - ballots[1] = 20; - ballots[2] = 30; - ballots[3] = 40; - - totalBallot = 100; - totalVote = 40; - } } diff --git a/test/bridge/unit/concrete/bridge-reward/execSyncRewardAuto.t.sol b/test/bridge/unit/concrete/bridge-reward/execSyncRewardAuto.t.sol new file mode 100644 index 00000000..02a4548f --- /dev/null +++ b/test/bridge/unit/concrete/bridge-reward/execSyncRewardAuto.t.sol @@ -0,0 +1,125 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity >=0.8.17 <0.9.0; + +import { console2 } from "forge-std/console2.sol"; +import { StdStyle } from "forge-std/StdStyle.sol"; + +import "@ronin/contracts/utils/CommonErrors.sol"; +import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; +import { IBridgeReward } from "@ronin/contracts/interfaces/bridge/IBridgeReward.sol"; +import { IBridgeRewardEvents } from "@ronin/contracts/interfaces/bridge/events/IBridgeRewardEvents.sol"; +import { BridgeReward } from "@ronin/contracts/ronin/gateway/BridgeReward.sol"; +import { BridgeTrackingHelper } from "@ronin/contracts/extensions/bridge-operator-governance/BridgeTrackingHelper.sol"; + +import { BridgeReward_Unit_Concrete_Test } from "./BridgeReward.t.sol"; + +contract ExecSyncRewardAuto_Unit_Concrete_Test is + BridgeReward_Unit_Concrete_Test, + IBridgeRewardEvents, + BridgeTrackingHelper // Need to inherits this to access event +{ + function setUp() public virtual override { + BridgeReward_Unit_Concrete_Test.setUp(); + vm.startPrank({ msgSender: address(_bridgeTracking) }); + } + + function test_RevertWhen_NotCalledByBridgeTracking() external { + uint256 period = _validatorSetContract.currentPeriod() + 1; + + changePrank(_users.alice); + vm.expectRevert( + abi.encodeWithSelector(ErrUnexpectedInternalCall.selector, IBridgeReward.execSyncRewardAuto.selector, ContractType.BRIDGE_TRACKING, _users.alice) + ); + _bridgeReward.execSyncRewardAuto({ currentPeriod: period }); + } + + function test_syncRewardAuto_1Period_ShareProportionally() public { + (address[] memory operators, uint256[] memory ballots, uint256 totalBallot, uint256 totalVote) = _generateInput_shareRewardProportionally(); + uint256 nowPd = _validatorSetContract.currentPeriod(); + uint256 settlePd = nowPd - 1; + + _bridgeManager.cheat_setOperators(operators); + _bridgeTracking.cheat_setPeriodTracking(settlePd, operators, ballots, totalVote); + _bridgeSlash.cheat_setSlash(operators, new uint256[](operators.length)); + + for (uint i; i < operators.length; i++) { + vm.expectEmit({ emitter: address(_bridgeReward) }); + emit BridgeRewardScattered(settlePd, operators[i], (_rewardPerPeriod * ballots[i]) / totalBallot); + } + + _bridgeReward.execSyncRewardAuto({ currentPeriod: nowPd }); + assertEq(_bridgeReward.getLatestRewardedPeriod(), settlePd); + } + + function test_syncRewardAuto_3Period_ShareProportionally() public { + (address[] memory operators, uint256[] memory ballots, uint256 totalBallot, uint256 totalVote) = _generateInput_shareRewardProportionally(); + uint256 pdGap = 3; + uint256 pdCount = pdGap; + + uint256 period = _validatorSetContract.currentPeriod(); + uint256 nowPd = period + pdCount - 1; + uint256 settlePd = period - 1; + _validatorSetContract.setCurrentPeriod(nowPd); + + _bridgeManager.cheat_setOperators(operators); + _bridgeSlash.cheat_setSlash(operators, new uint256[](operators.length)); + + for (uint i; i < pdCount; i++) { + _bridgeTracking.cheat_setPeriodTracking(settlePd + i, operators, ballots, totalVote); + } + + for (uint i; i < pdCount; i++) { + for (uint k; k < operators.length; k++) { + vm.expectEmit({ emitter: address(_bridgeReward) }); + emit BridgeRewardScattered(settlePd + i, operators[k], (_rewardPerPeriod * ballots[k]) / totalBallot); + } + } + + _bridgeReward.execSyncRewardAuto({ currentPeriod: nowPd }); + assertEq(_bridgeReward.getLatestRewardedPeriod(), settlePd + pdCount - 1); + } + + function test_syncRewardAuto_MoreThan5Period_ShareProportionally() public { + (address[] memory operators, uint256[] memory ballots, uint256 totalBallot, uint256 totalVote) = _generateInput_shareRewardProportionally(); + uint256 pdGap = 7; + uint256 pdCount = 5; + + uint256 period = _validatorSetContract.currentPeriod(); + uint256 nowPd = period + pdGap - 1; + uint256 settlePd = period - 1; + _validatorSetContract.setCurrentPeriod(nowPd); + + _bridgeManager.cheat_setOperators(operators); + _bridgeSlash.cheat_setSlash(operators, new uint256[](operators.length)); + + for (uint i; i < pdGap; i++) { + _bridgeTracking.cheat_setPeriodTracking(settlePd + i, operators, ballots, totalVote); + } + + // Settle reward for first 5 periods + for (uint i = 0; i < pdCount; i++) { + for (uint k; k < operators.length; k++) { + vm.expectEmit({ emitter: address(_bridgeReward) }); + emit BridgeRewardScattered(settlePd + i, operators[k], (_rewardPerPeriod * ballots[k]) / totalBallot); + } + } + + _bridgeReward.execSyncRewardAuto({ currentPeriod: nowPd }); + settlePd = settlePd + pdCount - 1; + assertEq(_bridgeReward.getLatestRewardedPeriod(), settlePd); + + // Settle reward for the remaining periods + pdGap -= pdCount; + pdCount = pdGap; + settlePd += 1; + for (uint i; i < pdCount; i++) { + for (uint k; k < operators.length; k++) { + vm.expectEmit({ emitter: address(_bridgeReward) }); + emit BridgeRewardScattered(settlePd + i, operators[k], (_rewardPerPeriod * ballots[k]) / totalBallot); + } + } + + _bridgeReward.execSyncRewardAuto({ currentPeriod: nowPd }); + assertEq(_bridgeReward.getLatestRewardedPeriod(), nowPd - 1); + } +} diff --git a/test/bridge/unit/concrete/bridge-reward/syncRewardManual.t.sol b/test/bridge/unit/concrete/bridge-reward/syncRewardManual.t.sol new file mode 100644 index 00000000..7ead6e3c --- /dev/null +++ b/test/bridge/unit/concrete/bridge-reward/syncRewardManual.t.sol @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity >=0.8.17 <0.9.0; + +import { console2 } from "forge-std/console2.sol"; +import { StdStyle } from "forge-std/StdStyle.sol"; + +import "@ronin/contracts/utils/CommonErrors.sol"; +import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; +import { IBridgeReward } from "@ronin/contracts/interfaces/bridge/IBridgeReward.sol"; +import { IBridgeRewardEvents } from "@ronin/contracts/interfaces/bridge/events/IBridgeRewardEvents.sol"; +import { BridgeReward } from "@ronin/contracts/ronin/gateway/BridgeReward.sol"; +import { BridgeTrackingHelper } from "@ronin/contracts/extensions/bridge-operator-governance/BridgeTrackingHelper.sol"; +import { MockBridgeManager } from "@ronin/test/mocks/MockBridgeManager.sol"; + +import { BridgeReward_Unit_Concrete_Test } from "./BridgeReward.t.sol"; + +contract SyncRewardManual_Unit_Concrete_Test is + BridgeReward_Unit_Concrete_Test, + IBridgeRewardEvents, + BridgeTrackingHelper // Need to inherits this to access event +{ + function setUp() public virtual override { + BridgeReward_Unit_Concrete_Test.setUp(); + MockBridgeManager(address(_bridgeManager)).addOperator({ governor: _governor, operator: _operator, weight: 100 }); + vm.startPrank({ msgSender: address(_operator) }); + } + + function test_RevertWhen_NotCalledByBridgeOperator() external { + vm.stopPrank(); + vm.startPrank(_users.alice); + vm.expectRevert(abi.encodeWithSelector(ErrUnauthorizedCall.selector, IBridgeReward.syncRewardManual.selector)); + _bridgeReward.syncRewardManual({ periodCount: 1 }); + } + + function test_RevertWhen_PeriodTooFar() public { + uint256 currPd = _validatorSetContract.currentPeriod(); + uint256 lastRewardPd = currPd - 2; + + vm.expectRevert(abi.encodeWithSelector(ErrPeriodNotHappen.selector, currPd, lastRewardPd, 2)); + _bridgeReward.syncRewardManual({ periodCount: 2 }); + } + + function test_syncRewardManual_ShareProportionally() public { + (address[] memory operators, uint256[] memory ballots, uint256 totalBallot, uint256 totalVote) = _generateInput_shareRewardProportionally(); + uint256 nowPd = _validatorSetContract.currentPeriod(); + uint256 settlePd = nowPd - 1; + + _bridgeManager.cheat_setOperators(operators); + _bridgeTracking.cheat_setPeriodTracking(settlePd, operators, ballots, totalVote); + _bridgeSlash.cheat_setSlash(operators, new uint256[](operators.length)); + + for (uint i; i < operators.length; i++) { + vm.expectEmit({ emitter: address(_bridgeReward) }); + emit BridgeRewardScattered(settlePd, operators[i], (_rewardPerPeriod * ballots[i]) / totalBallot); + } + + _bridgeReward.syncRewardManual({ periodCount: 1 }); + assertEq(_bridgeReward.getLatestRewardedPeriod(), settlePd); + } +} diff --git a/test/harness/BridgeRewardHarness.sol b/test/harness/BridgeRewardHarness.sol new file mode 100644 index 00000000..034304fd --- /dev/null +++ b/test/harness/BridgeRewardHarness.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.23; + +import { BridgeReward } from "@ronin/contracts/ronin/gateway/BridgeReward.sol"; + +contract BridgeRewardHarness is BridgeReward { + function exposed_syncRewardBatch(uint256 currPd, uint256 pdCount) external { + _syncRewardBatch(currPd, pdCount); + } + + function exposed_assertPeriod(uint256 currPd, uint256 pdCount, uint256 lastRewardPd) external pure { + _assertPeriod(currPd, pdCount, lastRewardPd); + } + + function exposed_settleReward(address[] calldata operators, uint256[] calldata ballots, uint256 totalBallot, uint256 totalVote, uint256 period) external { + _settleReward(operators, ballots, totalBallot, totalVote, period); + } +} diff --git a/test/mocks/MockBridgeManager.sol b/test/mocks/MockBridgeManager.sol index 8ff151d7..dfb00a31 100644 --- a/test/mocks/MockBridgeManager.sol +++ b/test/mocks/MockBridgeManager.sol @@ -4,47 +4,81 @@ pragma solidity >=0.8.17 <0.9.0; import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; contract MockBridgeManager is IBridgeManager { - function DOMAIN_SEPARATOR() external view returns (bytes32) {} + mapping(address => bool) private _governors; + mapping(address => bool) private _operators; + mapping(address => uint96) private _weights; + address[] private _operatorList; - function addBridgeOperators( - uint96[] calldata voteWeights, - address[] calldata governors, - address[] calldata bridgeOperators - ) external returns (bool[] memory addeds) {} + function DOMAIN_SEPARATOR() external view returns (bytes32) { } - function getBridgeOperatorOf(address[] calldata gorvernors) external view returns (address[] memory bridgeOperators_) {} + function cheat_setOperators(address[] calldata operators) external { + for (uint i; i < _operatorList.length; i++) { + address iOperator = _operatorList[i]; + delete _operators[iOperator]; + delete _governors[iOperator]; + delete _weights[iOperator]; + } + delete _operatorList; - function getOperatorOf(address governor) external view returns (address operator) {} + for (uint i; i < operators.length; i++) { + address iOperator = operators[i]; + _operatorList.push(iOperator); + _operators[iOperator] = true; + _governors[iOperator] = true; + _weights[iOperator] = 100; + } + } - function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint96 weight) {} + function addBridgeOperators(uint96[] calldata weights, address[] calldata governors, address[] calldata operators) external returns (bool[] memory addeds) { + for (uint i; i < weights.length; i++) { + _governors[governors[i]] = true; + _operators[operators[i]] = true; + _weights[governors[i]] = weights[i]; + _weights[operators[i]] = weights[i]; + addeds[i] = true; + } + } - function getBridgeOperators() external view returns (address[] memory) {} + function addOperator(uint96 weight, address governor, address operator) external { + _governors[governor] = true; + _operators[operator] = true; + _weights[governor] = weight; + _weights[operator] = weight; + } - function getFullBridgeOperatorInfos() - external - view - returns (address[] memory governors, address[] memory bridgeOperators, uint96[] memory weights) - {} + function getBridgeOperatorOf(address[] calldata gorvernors) external view returns (address[] memory bridgeOperators_) { } - function getGovernorWeight(address governor) external view returns (uint96) {} + function getOperatorOf(address governor) external view returns (address operator) { } - function getGovernorWeights(address[] calldata governors) external view returns (uint96[] memory weights) {} + function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint96 weight) { } - function getGovernors() external view returns (address[] memory) {} + function getBridgeOperators() external view returns (address[] memory) { + return _operatorList; + } - function getGovernorsOf(address[] calldata bridgeOperators) external view returns (address[] memory governors) {} + function getFullBridgeOperatorInfos() external view returns (address[] memory governors, address[] memory bridgeOperators, uint96[] memory weights) { } - function getGovernorOf(address operator) external view returns (address governor) {} + function getGovernorWeight(address governor) external view returns (uint96) { } - function getTotalWeight() external view returns (uint256) {} + function getGovernorWeights(address[] calldata governors) external view returns (uint96[] memory weights) { } - function isBridgeOperator(address addr) external view returns (bool) {} + function getGovernors() external view returns (address[] memory) { } - function removeBridgeOperators(address[] calldata bridgeOperators) external returns (bool[] memory removeds) {} + function getGovernorsOf(address[] calldata bridgeOperators) external view returns (address[] memory governors) { } - function sumGovernorsWeight(address[] calldata governors) external view returns (uint256 sum) {} + function getGovernorOf(address operator) external view returns (address governor) { } - function totalBridgeOperator() external view returns (uint256) {} + function getTotalWeight() external view returns (uint256) { } - function updateBridgeOperator(address currOperator, address newOperator) external {} + function isBridgeOperator(address addr) external view returns (bool) { + return _weights[addr] > 0; + } + + function removeBridgeOperators(address[] calldata bridgeOperators) external returns (bool[] memory removeds) { } + + function sumGovernorsWeight(address[] calldata governors) external view returns (uint256 sum) { } + + function totalBridgeOperator() external view returns (uint256) { } + + function updateBridgeOperator(address currOperator, address newOperator) external { } } diff --git a/test/mocks/MockBridgeSlash.sol b/test/mocks/MockBridgeSlash.sol index af48554e..462aa12f 100644 --- a/test/mocks/MockBridgeSlash.sol +++ b/test/mocks/MockBridgeSlash.sol @@ -36,7 +36,7 @@ contract MockBridgeSlash is IBridgeSlash { } function cheat_setSlash(address[] calldata operators, uint256[] calldata untilPeriods) external { - require(operators.length != untilPeriods.length, "invalid length"); + require(operators.length == untilPeriods.length, "invalid length"); for (uint i; i < operators.length; i++) { _slashMap[operators[i]] = untilPeriods[i]; diff --git a/test/mocks/MockBridgeTracking.sol b/test/mocks/MockBridgeTracking.sol index 96f7ec4f..e279d409 100644 --- a/test/mocks/MockBridgeTracking.sol +++ b/test/mocks/MockBridgeTracking.sol @@ -13,13 +13,13 @@ contract MockBridgeTracking is IBridgeTracking { // Mapping from period number => period tracking mapping(uint256 => PeriodTracking) _tracks; - function setPeriodTracking( + function cheat_setPeriodTracking( uint256 period, address[] memory operators, uint256[] calldata ballots, uint256 totalVote_ ) external { - require(operators.length != ballots.length, "mismatch length"); + require(operators.length == ballots.length, "mismatch length"); PeriodTracking storage _sTrack = _tracks[period]; _sTrack.operators = operators; _sTrack.totalVote = totalVote_; From fe5b9bb4c0a240960561be9169014819d9759f70 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 12 Mar 2024 16:38:18 +0700 Subject: [PATCH 046/180] test: rename file --- .../{BridgeReward.t.sol => BridgeReward_Unit_Concrete.t.sol} | 0 test/bridge/unit/concrete/bridge-reward/assertPeriod.t.sol | 2 +- .../bridge/unit/concrete/bridge-reward/execSyncRewardAuto.t.sol | 2 +- .../execSyncReward.t.sol => settleReward/settleReward.t.sol} | 2 +- .../execSyncReward.tree => settleReward/settleReward.tree} | 0 test/bridge/unit/concrete/bridge-reward/syncRewardManual.t.sol | 2 +- 6 files changed, 4 insertions(+), 4 deletions(-) rename test/bridge/unit/concrete/bridge-reward/{BridgeReward.t.sol => BridgeReward_Unit_Concrete.t.sol} (100%) rename test/bridge/unit/concrete/bridge-reward/{execSyncReward/execSyncReward.t.sol => settleReward/settleReward.t.sol} (99%) rename test/bridge/unit/concrete/bridge-reward/{execSyncReward/execSyncReward.tree => settleReward/settleReward.tree} (100%) diff --git a/test/bridge/unit/concrete/bridge-reward/BridgeReward.t.sol b/test/bridge/unit/concrete/bridge-reward/BridgeReward_Unit_Concrete.t.sol similarity index 100% rename from test/bridge/unit/concrete/bridge-reward/BridgeReward.t.sol rename to test/bridge/unit/concrete/bridge-reward/BridgeReward_Unit_Concrete.t.sol diff --git a/test/bridge/unit/concrete/bridge-reward/assertPeriod.t.sol b/test/bridge/unit/concrete/bridge-reward/assertPeriod.t.sol index f9edb682..49b53ca4 100644 --- a/test/bridge/unit/concrete/bridge-reward/assertPeriod.t.sol +++ b/test/bridge/unit/concrete/bridge-reward/assertPeriod.t.sol @@ -11,7 +11,7 @@ import { IBridgeRewardEvents } from "@ronin/contracts/interfaces/bridge/events/I import { BridgeReward } from "@ronin/contracts/ronin/gateway/BridgeReward.sol"; import { BridgeTrackingHelper } from "@ronin/contracts/extensions/bridge-operator-governance/BridgeTrackingHelper.sol"; -import "./BridgeReward.t.sol"; +import "./BridgeReward_Unit_Concrete.t.sol"; contract AssertPeriod_Unit_Concrete_Test is BridgeReward_Unit_Concrete_Test, diff --git a/test/bridge/unit/concrete/bridge-reward/execSyncRewardAuto.t.sol b/test/bridge/unit/concrete/bridge-reward/execSyncRewardAuto.t.sol index 02a4548f..a11acc7c 100644 --- a/test/bridge/unit/concrete/bridge-reward/execSyncRewardAuto.t.sol +++ b/test/bridge/unit/concrete/bridge-reward/execSyncRewardAuto.t.sol @@ -11,7 +11,7 @@ import { IBridgeRewardEvents } from "@ronin/contracts/interfaces/bridge/events/I import { BridgeReward } from "@ronin/contracts/ronin/gateway/BridgeReward.sol"; import { BridgeTrackingHelper } from "@ronin/contracts/extensions/bridge-operator-governance/BridgeTrackingHelper.sol"; -import { BridgeReward_Unit_Concrete_Test } from "./BridgeReward.t.sol"; +import { BridgeReward_Unit_Concrete_Test } from "./BridgeReward_Unit_Concrete.t.sol"; contract ExecSyncRewardAuto_Unit_Concrete_Test is BridgeReward_Unit_Concrete_Test, diff --git a/test/bridge/unit/concrete/bridge-reward/execSyncReward/execSyncReward.t.sol b/test/bridge/unit/concrete/bridge-reward/settleReward/settleReward.t.sol similarity index 99% rename from test/bridge/unit/concrete/bridge-reward/execSyncReward/execSyncReward.t.sol rename to test/bridge/unit/concrete/bridge-reward/settleReward/settleReward.t.sol index 2464b4af..cc5feddc 100644 --- a/test/bridge/unit/concrete/bridge-reward/execSyncReward/execSyncReward.t.sol +++ b/test/bridge/unit/concrete/bridge-reward/settleReward/settleReward.t.sol @@ -11,7 +11,7 @@ import { IBridgeRewardEvents } from "@ronin/contracts/interfaces/bridge/events/I import { BridgeReward } from "@ronin/contracts/ronin/gateway/BridgeReward.sol"; import { BridgeTrackingHelper } from "@ronin/contracts/extensions/bridge-operator-governance/BridgeTrackingHelper.sol"; -import "../BridgeReward.t.sol"; +import "../BridgeReward_Unit_Concrete.t.sol"; contract SettleReward_Unit_Concrete_Test is BridgeReward_Unit_Concrete_Test, diff --git a/test/bridge/unit/concrete/bridge-reward/execSyncReward/execSyncReward.tree b/test/bridge/unit/concrete/bridge-reward/settleReward/settleReward.tree similarity index 100% rename from test/bridge/unit/concrete/bridge-reward/execSyncReward/execSyncReward.tree rename to test/bridge/unit/concrete/bridge-reward/settleReward/settleReward.tree diff --git a/test/bridge/unit/concrete/bridge-reward/syncRewardManual.t.sol b/test/bridge/unit/concrete/bridge-reward/syncRewardManual.t.sol index 7ead6e3c..cb5479f7 100644 --- a/test/bridge/unit/concrete/bridge-reward/syncRewardManual.t.sol +++ b/test/bridge/unit/concrete/bridge-reward/syncRewardManual.t.sol @@ -12,7 +12,7 @@ import { BridgeReward } from "@ronin/contracts/ronin/gateway/BridgeReward.sol"; import { BridgeTrackingHelper } from "@ronin/contracts/extensions/bridge-operator-governance/BridgeTrackingHelper.sol"; import { MockBridgeManager } from "@ronin/test/mocks/MockBridgeManager.sol"; -import { BridgeReward_Unit_Concrete_Test } from "./BridgeReward.t.sol"; +import { BridgeReward_Unit_Concrete_Test } from "./BridgeReward_Unit_Concrete.t.sol"; contract SyncRewardManual_Unit_Concrete_Test is BridgeReward_Unit_Concrete_Test, From 7af74901648553fa77cf85309eb400add86e1053 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 12 Mar 2024 16:49:01 +0700 Subject: [PATCH 047/180] fix(BridgeReward): fix specs --- src/ronin/gateway/BridgeReward.sol | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/ronin/gateway/BridgeReward.sol b/src/ronin/gateway/BridgeReward.sol index 52d42093..9798bcc0 100644 --- a/src/ronin/gateway/BridgeReward.sol +++ b/src/ronin/gateway/BridgeReward.sol @@ -56,7 +56,12 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT /** * @dev Helper for running upgrade script, required to only revoked once by the DPoS's governance admin. - * The following must be assured after initializing REP2: `{BridgeTracking}._lastSyncPeriod` == `{BridgeReward}.latestRewardedPeriod` == `currentPeriod()` + * The following must be assured after initializing REP2: + * ``` + * {BridgeTracking}._lastSyncPeriod + * == {BridgeReward}.latestRewardedPeriod + * == {RoninValidatorSet}.currentPeriod() + * ``` */ function initializeREP2() external onlyContract(ContractType.GOVERNANCE_ADMIN) { require(getLatestRewardedPeriod() == type(uint256).max, "already init rep 2"); @@ -64,6 +69,14 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT _setContract(ContractType.GOVERNANCE_ADMIN, address(0)); } + /** + @dev The following must be assured after initializing V2: + * ``` + * {BridgeTracking}._lastSyncPeriod + * == {RoninValidatorSet}.currentPeriod() + * == {BridgeReward}.latestRewardedPeriod + 1 + * ``` + */ function initializeV2() external reinitializer(2) { $_MAX_REWARDING_PERIOD_COUNT.store(5); $_LATEST_REWARDED_PERIOD.store(getLatestRewardedPeriod() - 1); @@ -94,7 +107,7 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT } /** - * @dev Sync bridge reward for multiple periods, always assert `latestRewardedPeriod + periodCount <= currentPeriod`. + * @dev Sync bridge reward for multiple periods, always assert `latestRewardedPeriod + periodCount < currentPeriod`. * @param pdCount Number of periods to settle reward. Leave this as 0 to auto calculate. */ function _syncRewardBatch(uint256 currPd, uint256 pdCount) internal { From 5078d3ecf92bfa4315dfe32720715eb878dbc59b Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 13 Mar 2024 11:52:25 +0700 Subject: [PATCH 048/180] fix(Token): nit prettier Token lib --- src/libraries/Token.sol | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/libraries/Token.sol b/src/libraries/Token.sol index 49e2fa77..c8cb6b57 100644 --- a/src/libraries/Token.sol +++ b/src/libraries/Token.sol @@ -71,8 +71,10 @@ library Token { */ function validate(Info memory _info) internal pure { if ( - !((_info.erc == Standard.ERC20 && _info.quantity > 0 && _info.id == 0) || - (_info.erc == Standard.ERC721 && _info.quantity == 0)) + !( + (_info.erc == Standard.ERC20 && _info.quantity > 0 && _info.id == 0) + || (_info.erc == Standard.ERC721 && _info.quantity == 0) + ) ) revert ErrInvalidInfo(); } @@ -91,8 +93,10 @@ library Token { _success = _success && (_data.length == 0 || abi.decode(_data, (bool))); } else if (_info.erc == Standard.ERC721) { // bytes4(keccak256("transferFrom(address,address,uint256)")) - (_success, ) = _token.call(abi.encodeWithSelector(0x23b872dd, _from, _to, _info.id)); - } else revert ErrUnsupportedStandard(); + (_success,) = _token.call(abi.encodeWithSelector(0x23b872dd, _from, _to, _info.id)); + } else { + revert ErrUnsupportedStandard(); + } if (!_success) revert ErrTokenCouldNotTransferFrom(_info, _from, _to, _token); } @@ -101,7 +105,7 @@ library Token { * @dev Transfers ERC721 token and returns the result. */ function tryTransferERC721(address _token, address _to, uint256 _id) internal returns (bool _success) { - (_success, ) = _token.call(abi.encodeWithSelector(IERC721.transferFrom.selector, address(this), _to, _id)); + (_success,) = _token.call(abi.encodeWithSelector(IERC721.transferFrom.selector, address(this), _to, _id)); } /** @@ -122,7 +126,9 @@ library Token { _success = tryTransferERC20(_token, _to, _info.quantity); } else if (_info.erc == Standard.ERC721) { _success = tryTransferERC721(_token, _to, _info.id); - } else revert ErrUnsupportedStandard(); + } else { + revert ErrUnsupportedStandard(); + } if (!_success) revert ErrTokenCouldNotTransfer(_info, _to, _token); } @@ -133,12 +139,9 @@ library Token { * @notice Prioritizes transfer native token if the token is wrapped. * */ - function handleAssetTransfer( - Info memory _info, - address payable _to, - address _token, - IWETH _wrappedNativeToken - ) internal { + function handleAssetTransfer(Info memory _info, address payable _to, address _token, IWETH _wrappedNativeToken) + internal + { bool _success; if (_token == address(_wrappedNativeToken)) { // Try sending the native token before transferring the wrapped token @@ -151,7 +154,7 @@ library Token { if (_balance < _info.quantity) { // bytes4(keccak256("mint(address,uint256)")) - (_success, ) = _token.call(abi.encodeWithSelector(0x40c10f19, address(this), _info.quantity - _balance)); + (_success,) = _token.call(abi.encodeWithSelector(0x40c10f19, address(this), _info.quantity - _balance)); if (!_success) revert ErrERC20MintingFailed(); } @@ -159,10 +162,12 @@ library Token { } else if (_info.erc == Token.Standard.ERC721) { if (!tryTransferERC721(_token, _to, _info.id)) { // bytes4(keccak256("mint(address,uint256)")) - (_success, ) = _token.call(abi.encodeWithSelector(0x40c10f19, _to, _info.id)); + (_success,) = _token.call(abi.encodeWithSelector(0x40c10f19, _to, _info.id)); if (!_success) revert ErrERC721MintingFailed(); } - } else revert ErrUnsupportedStandard(); + } else { + revert ErrUnsupportedStandard(); + } } struct Owner { From cb1706fc99eab7cbcf871974c4e61466ec98e68d Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 13 Mar 2024 12:08:12 +0700 Subject: [PATCH 049/180] fix(Token): rename `_` for internal lib --- src/libraries/Token.sol | 98 ++++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/src/libraries/Token.sol b/src/libraries/Token.sol index c8cb6b57..5a0c4b33 100644 --- a/src/libraries/Token.sol +++ b/src/libraries/Token.sol @@ -54,14 +54,14 @@ library Token { /** * @dev Returns token info struct hash. */ - function hash(Info memory _info) internal pure returns (bytes32 digest) { + function hash(Info memory self) internal pure returns (bytes32 digest) { // keccak256(abi.encode(INFO_TYPE_HASH, _info.erc, _info.id, _info.quantity)) assembly { let ptr := mload(0x40) mstore(ptr, INFO_TYPE_HASH) - mstore(add(ptr, 0x20), mload(_info)) // _info.erc - mstore(add(ptr, 0x40), mload(add(_info, 0x20))) // _info.id - mstore(add(ptr, 0x60), mload(add(_info, 0x40))) // _info.quantity + mstore(add(ptr, 0x20), mload(self)) // _info.erc + mstore(add(ptr, 0x40), mload(add(self, 0x20))) // _info.id + mstore(add(ptr, 0x60), mload(add(self, 0x40))) // _info.quantity digest := keccak256(ptr, 0x80) } } @@ -69,11 +69,11 @@ library Token { /** * @dev Validates the token info. */ - function validate(Info memory _info) internal pure { + function validate(Info memory self) internal pure { if ( !( - (_info.erc == Standard.ERC20 && _info.quantity > 0 && _info.id == 0) - || (_info.erc == Standard.ERC721 && _info.quantity == 0) + (self.erc == Standard.ERC20 && self.quantity > 0 && self.id == 0) + || (self.erc == Standard.ERC721 && self.quantity == 0) ) ) revert ErrInvalidInfo(); } @@ -85,52 +85,52 @@ library Token { * - The `_from` address must approve for the contract using this library. * */ - function transferFrom(Info memory _info, address _from, address _to, address _token) internal { - bool _success; - bytes memory _data; - if (_info.erc == Standard.ERC20) { - (_success, _data) = _token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, _from, _to, _info.quantity)); - _success = _success && (_data.length == 0 || abi.decode(_data, (bool))); - } else if (_info.erc == Standard.ERC721) { + function transferFrom(Info memory self, address from, address to, address token) internal { + bool success; + bytes memory data; + if (self.erc == Standard.ERC20) { + (success, data) = token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, self.quantity)); + success = success && (data.length == 0 || abi.decode(data, (bool))); + } else if (self.erc == Standard.ERC721) { // bytes4(keccak256("transferFrom(address,address,uint256)")) - (_success,) = _token.call(abi.encodeWithSelector(0x23b872dd, _from, _to, _info.id)); + (success,) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, self.id)); } else { revert ErrUnsupportedStandard(); } - if (!_success) revert ErrTokenCouldNotTransferFrom(_info, _from, _to, _token); + if (!success) revert ErrTokenCouldNotTransferFrom(self, from, to, token); } /** * @dev Transfers ERC721 token and returns the result. */ - function tryTransferERC721(address _token, address _to, uint256 _id) internal returns (bool _success) { - (_success,) = _token.call(abi.encodeWithSelector(IERC721.transferFrom.selector, address(this), _to, _id)); + function tryTransferERC721(address token, address to, uint256 id) internal returns (bool success) { + (success,) = token.call(abi.encodeWithSelector(IERC721.transferFrom.selector, address(this), to, id)); } /** * @dev Transfers ERC20 token and returns the result. */ - function tryTransferERC20(address _token, address _to, uint256 _quantity) internal returns (bool _success) { - bytes memory _data; - (_success, _data) = _token.call(abi.encodeWithSelector(IERC20.transfer.selector, _to, _quantity)); - _success = _success && (_data.length == 0 || abi.decode(_data, (bool))); + function tryTransferERC20(address token, address to, uint256 quantity) internal returns (bool success) { + bytes memory data; + (success, data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, quantity)); + success = success && (data.length == 0 || abi.decode(data, (bool))); } /** * @dev Transfer assets from current address to `_to` address. */ - function transfer(Info memory _info, address _to, address _token) internal { - bool _success; - if (_info.erc == Standard.ERC20) { - _success = tryTransferERC20(_token, _to, _info.quantity); - } else if (_info.erc == Standard.ERC721) { - _success = tryTransferERC721(_token, _to, _info.id); + function transfer(Info memory self, address to, address token) internal { + bool success; + if (self.erc == Standard.ERC20) { + success = tryTransferERC20(token, to, self.quantity); + } else if (self.erc == Standard.ERC721) { + success = tryTransferERC721(token, to, self.id); } else { revert ErrUnsupportedStandard(); } - if (!_success) revert ErrTokenCouldNotTransfer(_info, _to, _token); + if (!success) revert ErrTokenCouldNotTransfer(self, to, token); } /** @@ -139,31 +139,31 @@ library Token { * @notice Prioritizes transfer native token if the token is wrapped. * */ - function handleAssetTransfer(Info memory _info, address payable _to, address _token, IWETH _wrappedNativeToken) + function handleAssetTransfer(Info memory self, address payable to, address token, IWETH wrappedNativeToken) internal { - bool _success; - if (_token == address(_wrappedNativeToken)) { + bool success; + if (token == address(wrappedNativeToken)) { // Try sending the native token before transferring the wrapped token - if (!_to.send(_info.quantity)) { - _wrappedNativeToken.deposit{ value: _info.quantity }(); - transfer(_info, _to, _token); + if (!to.send(self.quantity)) { + wrappedNativeToken.deposit{ value: self.quantity }(); + transfer(self, to, token); } - } else if (_info.erc == Token.Standard.ERC20) { - uint256 _balance = IERC20(_token).balanceOf(address(this)); + } else if (self.erc == Token.Standard.ERC20) { + uint256 _balance = IERC20(token).balanceOf(address(this)); - if (_balance < _info.quantity) { + if (_balance < self.quantity) { // bytes4(keccak256("mint(address,uint256)")) - (_success,) = _token.call(abi.encodeWithSelector(0x40c10f19, address(this), _info.quantity - _balance)); - if (!_success) revert ErrERC20MintingFailed(); + (success,) = token.call(abi.encodeWithSelector(0x40c10f19, address(this), self.quantity - _balance)); + if (!success) revert ErrERC20MintingFailed(); } - transfer(_info, _to, _token); - } else if (_info.erc == Token.Standard.ERC721) { - if (!tryTransferERC721(_token, _to, _info.id)) { + transfer(self, to, token); + } else if (self.erc == Token.Standard.ERC721) { + if (!tryTransferERC721(token, to, self.id)) { // bytes4(keccak256("mint(address,uint256)")) - (_success,) = _token.call(abi.encodeWithSelector(0x40c10f19, _to, _info.id)); - if (!_success) revert ErrERC721MintingFailed(); + (success,) = token.call(abi.encodeWithSelector(0x40c10f19, to, self.id)); + if (!success) revert ErrERC721MintingFailed(); } } else { revert ErrUnsupportedStandard(); @@ -182,14 +182,14 @@ library Token { /** * @dev Returns ownership struct hash. */ - function hash(Owner memory _owner) internal pure returns (bytes32 digest) { + function hash(Owner memory owner) internal pure returns (bytes32 digest) { // keccak256(abi.encode(OWNER_TYPE_HASH, _owner.addr, _owner.tokenAddr, _owner.chainId)) assembly { let ptr := mload(0x40) mstore(ptr, OWNER_TYPE_HASH) - mstore(add(ptr, 0x20), mload(_owner)) // _owner.addr - mstore(add(ptr, 0x40), mload(add(_owner, 0x20))) // _owner.tokenAddr - mstore(add(ptr, 0x60), mload(add(_owner, 0x40))) // _owner.chainId + mstore(add(ptr, 0x20), mload(owner)) // _owner.addr + mstore(add(ptr, 0x40), mload(add(owner, 0x20))) // _owner.tokenAddr + mstore(add(ptr, 0x60), mload(add(owner, 0x40))) // _owner.chainId digest := keccak256(ptr, 0x80) } } From 079fa6171f13cc9d46e8a2bb7234683eb901fdf3 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 13 Mar 2024 12:17:19 +0700 Subject: [PATCH 050/180] fix(Owner): move TokenOwner to a separate lib --- src/libraries/LibTokenOwner.sol | 28 +++++++++++++++++++ src/libraries/Token.sol | 24 ---------------- src/libraries/Transfer.sol | 13 +++++---- .../updateOperator.RoninBridgeManager.t.sol | 5 ++-- .../emergencyAction.PauseEnforcer.t.sol | 9 +++--- .../depositVote.RoninGatewayV3.t.sol | 5 ++-- 6 files changed, 47 insertions(+), 37 deletions(-) create mode 100644 src/libraries/LibTokenOwner.sol diff --git a/src/libraries/LibTokenOwner.sol b/src/libraries/LibTokenOwner.sol new file mode 100644 index 00000000..7f47b9b9 --- /dev/null +++ b/src/libraries/LibTokenOwner.sol @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +struct TokenOwner { + address addr; + address tokenAddr; + uint256 chainId; +} + +library LibTokenOwner { + // keccak256("TokenOwner(address addr,address tokenAddr,uint256 chainId)"); + bytes32 public constant OWNER_TYPE_HASH = 0x353bdd8d69b9e3185b3972e08b03845c0c14a21a390215302776a7a34b0e8764; + + /** + * @dev Returns ownership struct hash. + */ + function hash(TokenOwner memory owner) internal pure returns (bytes32 digest) { + // keccak256(abi.encode(OWNER_TYPE_HASH, owner.addr, owner.tokenAddr, owner.chainId)) + assembly { + let ptr := mload(0x40) + mstore(ptr, OWNER_TYPE_HASH) + mstore(add(ptr, 0x20), mload(owner)) // owner.addr + mstore(add(ptr, 0x40), mload(add(owner, 0x20))) // owner.tokenAddr + mstore(add(ptr, 0x60), mload(add(owner, 0x40))) // owner.chainId + digest := keccak256(ptr, 0x80) + } + } +} diff --git a/src/libraries/Token.sol b/src/libraries/Token.sol index 5a0c4b33..7f1a379b 100644 --- a/src/libraries/Token.sol +++ b/src/libraries/Token.sol @@ -169,28 +169,4 @@ library Token { revert ErrUnsupportedStandard(); } } - - struct Owner { - address addr; - address tokenAddr; - uint256 chainId; - } - - // keccak256("TokenOwner(address addr,address tokenAddr,uint256 chainId)"); - bytes32 public constant OWNER_TYPE_HASH = 0x353bdd8d69b9e3185b3972e08b03845c0c14a21a390215302776a7a34b0e8764; - - /** - * @dev Returns ownership struct hash. - */ - function hash(Owner memory owner) internal pure returns (bytes32 digest) { - // keccak256(abi.encode(OWNER_TYPE_HASH, _owner.addr, _owner.tokenAddr, _owner.chainId)) - assembly { - let ptr := mload(0x40) - mstore(ptr, OWNER_TYPE_HASH) - mstore(add(ptr, 0x20), mload(owner)) // _owner.addr - mstore(add(ptr, 0x40), mload(add(owner, 0x20))) // _owner.tokenAddr - mstore(add(ptr, 0x60), mload(add(owner, 0x40))) // _owner.chainId - digest := keccak256(ptr, 0x80) - } - } } diff --git a/src/libraries/Transfer.sol b/src/libraries/Transfer.sol index 5c77c9d6..8dcaea36 100644 --- a/src/libraries/Transfer.sol +++ b/src/libraries/Transfer.sol @@ -4,9 +4,12 @@ pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./Token.sol"; +import "./LibTokenOwner.sol"; library Transfer { using ECDSA for bytes32; + using LibTokenOwner for TokenOwner; + using Token for Token.Info; enum Kind { Deposit, @@ -68,8 +71,8 @@ library Transfer { struct Receipt { uint256 id; Kind kind; - Token.Owner mainchain; - Token.Owner ronin; + TokenOwner mainchain; + TokenOwner ronin; Token.Info info; } @@ -80,9 +83,9 @@ library Transfer { * @dev Returns token info struct hash. */ function hash(Receipt memory _receipt) internal pure returns (bytes32 digest) { - bytes32 hashedReceiptMainchain = Token.hash(_receipt.mainchain); - bytes32 hashedReceiptRonin = Token.hash(_receipt.ronin); - bytes32 hashedReceiptInfo = Token.hash(_receipt.info); + bytes32 hashedReceiptMainchain = _receipt.mainchain.hash(); + bytes32 hashedReceiptRonin = _receipt.ronin.hash(); + bytes32 hashedReceiptInfo = _receipt.info.hash(); /* * return diff --git a/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol index 4b74f5f6..f24f50c4 100644 --- a/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol @@ -4,6 +4,7 @@ pragma solidity ^0.8.19; import { console2 as console } from "forge-std/console2.sol"; import { Transfer } from "@ronin/contracts/libraries/Transfer.sol"; import { Token } from "@ronin/contracts/libraries/Token.sol"; +import { LibTokenOwner, TokenOwner } from "@ronin/contracts/libraries/LibTokenOwner.sol"; import "../../BaseIntegration.t.sol"; contract UpdateOperator_RoninBridgeManager_Test is BaseIntegration_Test { @@ -23,8 +24,8 @@ contract UpdateOperator_RoninBridgeManager_Test is BaseIntegration_Test { Transfer.Receipt memory sampleReceipt = Transfer.Receipt({ id: 0, kind: Transfer.Kind.Deposit, - ronin: Token.Owner({ addr: makeAddr("recipient"), tokenAddr: address(_roninWeth), chainId: block.chainid }), - mainchain: Token.Owner({ addr: makeAddr("requester"), tokenAddr: address(_mainchainWeth), chainId: block.chainid }), + ronin: TokenOwner({ addr: makeAddr("recipient"), tokenAddr: address(_roninWeth), chainId: block.chainid }), + mainchain: TokenOwner({ addr: makeAddr("requester"), tokenAddr: address(_mainchainWeth), chainId: block.chainid }), info: Token.Info({ erc: Token.Standard.ERC20, id: 0, quantity: 100 }) }); diff --git a/test/bridge/integration/pause-enforcer/emergencyAction.PauseEnforcer.t.sol b/test/bridge/integration/pause-enforcer/emergencyAction.PauseEnforcer.t.sol index fec87e77..46fce001 100644 --- a/test/bridge/integration/pause-enforcer/emergencyAction.PauseEnforcer.t.sol +++ b/test/bridge/integration/pause-enforcer/emergencyAction.PauseEnforcer.t.sol @@ -3,6 +3,7 @@ pragma solidity ^0.8.19; import { Transfer } from "@ronin/contracts/libraries/Transfer.sol"; import { GatewayV3 } from "@ronin/contracts/extensions/GatewayV3.sol"; +import { LibTokenOwner, TokenOwner } from "@ronin/contracts/libraries/LibTokenOwner.sol"; import "../BaseIntegration.t.sol"; contract EmergencyAction_PauseEnforcer_Test is BaseIntegration_Test { @@ -27,8 +28,8 @@ contract EmergencyAction_PauseEnforcer_Test is BaseIntegration_Test { Transfer.Receipt memory receipt = Transfer.Receipt({ id: 0, kind: Transfer.Kind.Deposit, - ronin: Token.Owner({ addr: makeAddr("recipient"), tokenAddr: address(_roninWeth), chainId: block.chainid }), - mainchain: Token.Owner({ addr: makeAddr("requester"), tokenAddr: address(_mainchainWeth), chainId: block.chainid }), + ronin: TokenOwner({ addr: makeAddr("recipient"), tokenAddr: address(_roninWeth), chainId: block.chainid }), + mainchain: TokenOwner({ addr: makeAddr("requester"), tokenAddr: address(_mainchainWeth), chainId: block.chainid }), info: Token.Info({ erc: Token.Standard.ERC20, id: 0, quantity: 100 }) }); @@ -64,8 +65,8 @@ contract EmergencyAction_PauseEnforcer_Test is BaseIntegration_Test { Transfer.Receipt memory receipt = Transfer.Receipt({ id: 0, kind: Transfer.Kind.Deposit, - ronin: Token.Owner({ addr: makeAddr("recipient"), tokenAddr: address(_roninWeth), chainId: block.chainid }), - mainchain: Token.Owner({ addr: makeAddr("requester"), tokenAddr: address(_mainchainWeth), chainId: block.chainid }), + ronin: TokenOwner({ addr: makeAddr("recipient"), tokenAddr: address(_roninWeth), chainId: block.chainid }), + mainchain: TokenOwner({ addr: makeAddr("requester"), tokenAddr: address(_mainchainWeth), chainId: block.chainid }), info: Token.Info({ erc: Token.Standard.ERC20, id: 0, quantity: 100 }) }); diff --git a/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol b/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol index 055a1050..6daaa4c2 100644 --- a/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol +++ b/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol @@ -8,6 +8,7 @@ import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; import { IsolatedGovernance } from "@ronin/contracts/libraries/IsolatedGovernance.sol"; import { VoteStatusConsumer } from "@ronin/contracts/interfaces/consumers/VoteStatusConsumer.sol"; import { MockRoninGatewayV3Extended } from "@ronin/contracts/mocks/ronin/MockRoninGatewayV3Extended.sol"; +import { LibTokenOwner, TokenOwner } from "@ronin/contracts/libraries/LibTokenOwner.sol"; import "../BaseIntegration.t.sol"; contract DepositVote_RoninGatewayV3_Test is BaseIntegration_Test { @@ -24,8 +25,8 @@ contract DepositVote_RoninGatewayV3_Test is BaseIntegration_Test { Transfer.Receipt memory receipt = Transfer.Receipt({ id: 0, kind: Transfer.Kind.Deposit, - ronin: Token.Owner({ addr: makeAddr("recipient"), tokenAddr: address(_roninWeth), chainId: block.chainid }), - mainchain: Token.Owner({ addr: makeAddr("requester"), tokenAddr: address(_mainchainWeth), chainId: block.chainid }), + ronin: TokenOwner({ addr: makeAddr("recipient"), tokenAddr: address(_roninWeth), chainId: block.chainid }), + mainchain: TokenOwner({ addr: makeAddr("requester"), tokenAddr: address(_mainchainWeth), chainId: block.chainid }), info: Token.Info({ erc: Token.Standard.ERC20, id: 0, quantity: 100 }) }); From c7751f5a991cd9d23c76663df9e758c7cc59d34c Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 13 Mar 2024 12:33:10 +0700 Subject: [PATCH 051/180] fix(Info): move to LibTokenInfo --- lib/foundry-deployment-kit | 2 +- .../20231218-maptoken-mainchain.s.sol | 8 +-- .../20231218-maptoken-roninchain.s.sol | 8 +-- .../20240115-maptoken-mainchain.s.sol | 14 ++--- .../20240115-maptoken-roninchain.s.sol | 10 ++-- .../20240131-maptoken-pixel-mainchain.s.sol | 12 ++-- .../20240131-maptoken-pixel-roninchain.s.sol | 10 ++-- .../20240206-maptoken-banana-mainchain.s.sol | 16 ++--- .../20240206-maptoken-banana-roninchain.s.sol | 14 ++--- script/Migration.s.sol | 2 +- script/interfaces/ISharedArgument.sol | 6 +- src/extensions/MinimumWithdrawal.sol | 2 +- src/interfaces/IMainchainGatewayV3.sol | 6 +- src/interfaces/IRoninGatewayV3.sol | 4 +- .../consumers/MappedTokenConsumer.sol | 4 +- src/libraries/{Token.sol => LibTokenInfo.sol} | 58 +++++++++---------- src/libraries/Transfer.sol | 8 +-- src/mainchain/MainchainGatewayV3.sol | 22 +++---- src/ronin/gateway/RoninGatewayV3.sol | 8 +-- test/bridge/integration/BaseIntegration.t.sol | 10 ++-- .../updateOperator.RoninBridgeManager.t.sol | 4 +- ...requestDepositFor.MainchainGatewayV3.t.sol | 6 +- .../submitWithdrawal.MainchainGatewayV3.t.sol | 8 +-- .../emergencyAction.PauseEnforcer.t.sol | 4 +- .../depositVote.RoninGatewayV3.t.sol | 4 +- test/helpers/ProposalUtils.t.sol | 2 +- 26 files changed, 126 insertions(+), 126 deletions(-) rename src/libraries/{Token.sol => LibTokenInfo.sol} (78%) diff --git a/lib/foundry-deployment-kit b/lib/foundry-deployment-kit index 3aa1ca23..8c728424 160000 --- a/lib/foundry-deployment-kit +++ b/lib/foundry-deployment-kit @@ -1 +1 @@ -Subproject commit 3aa1ca23adaa55a2e04818b0dced14947e4e5c28 +Subproject commit 8c728424858f8c8358f2e0f9374a6ea581f46486 diff --git a/script/20231218-maptoken/20231218-maptoken-mainchain.s.sol b/script/20231218-maptoken/20231218-maptoken-mainchain.s.sol index e7a72225..18e251ff 100644 --- a/script/20231218-maptoken/20231218-maptoken-mainchain.s.sol +++ b/script/20231218-maptoken/20231218-maptoken-mainchain.s.sol @@ -7,7 +7,7 @@ import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; import { IMainchainGatewayV3 } from "@ronin/contracts/interfaces/IMainchainGatewayV3.sol"; import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; -import { Token } from "@ronin/contracts/libraries/Token.sol"; +import { LibTokenInfo, TokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; import { Contract } from "../utils/Contract.sol"; import { BridgeMigration } from "../BridgeMigration.sol"; import { Network } from "../utils/Network.sol"; @@ -41,8 +41,8 @@ contract Migration__20231215_MapTokenMainchain is BridgeMigration { mainchainTokens[0] = _aggMainchainToken; address[] memory roninTokens = new address[](1); roninTokens[0] = _aggRoninToken; - Token.Standard[] memory standards = new Token.Standard[](1); - standards[0] = Token.Standard.ERC20; + TokenStandard[] memory standards = new TokenStandard[](1); + standards[0] = TokenStandard.ERC20; uint256[][4] memory thresholds; // highTierThreshold thresholds[0] = new uint256[](1); @@ -60,7 +60,7 @@ contract Migration__20231215_MapTokenMainchain is BridgeMigration { // function mapTokensAndThresholds( // address[] calldata _mainchainTokens, // address[] calldata _roninTokens, - // Token.Standard[] calldata _standards, + // TokenStandard[] calldata _standards, // uint256[][4] calldata _thresholds // ) diff --git a/script/20231218-maptoken/20231218-maptoken-roninchain.s.sol b/script/20231218-maptoken/20231218-maptoken-roninchain.s.sol index 5621946c..f0330137 100644 --- a/script/20231218-maptoken/20231218-maptoken-roninchain.s.sol +++ b/script/20231218-maptoken/20231218-maptoken-roninchain.s.sol @@ -6,7 +6,7 @@ import { StdStyle } from "forge-std/StdStyle.sol"; import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; import { IRoninGatewayV3 } from "@ronin/contracts/interfaces/IRoninGatewayV3.sol"; -import { Token } from "@ronin/contracts/libraries/Token.sol"; +import { LibTokenInfo, TokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; import { Contract } from "../utils/Contract.sol"; import { BridgeMigration } from "../BridgeMigration.sol"; import { Network } from "../utils/Network.sol"; @@ -32,14 +32,14 @@ contract Migration__20231215_MapTokenRoninchain is BridgeMigration { mainchainTokens[0] = _aggMainchainToken; uint256[] memory chainIds = new uint256[](1); chainIds[0] = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); - Token.Standard[] memory standards = new Token.Standard[](1); - standards[0] = Token.Standard.ERC20; + TokenStandard[] memory standards = new TokenStandard[](1); + standards[0] = TokenStandard.ERC20; // function mapTokens( // address[] calldata _roninTokens, // address[] calldata _mainchainTokens, // uint256[] calldata chainIds, - // Token.Standard[] calldata _standards + // TokenStandard[] calldata _standards // ) bytes memory innerData = abi.encodeCall(IRoninGatewayV3.mapTokens, (roninTokens, mainchainTokens, chainIds, standards)); diff --git a/script/20240115-mappixeltoken/20240115-maptoken-mainchain.s.sol b/script/20240115-mappixeltoken/20240115-maptoken-mainchain.s.sol index 649d8e6a..8d97b4f3 100644 --- a/script/20240115-mappixeltoken/20240115-maptoken-mainchain.s.sol +++ b/script/20240115-mappixeltoken/20240115-maptoken-mainchain.s.sol @@ -8,7 +8,7 @@ import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeMa import { IMainchainGatewayV3 } from "@ronin/contracts/interfaces/IMainchainGatewayV3.sol"; import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; -import { Token } from "@ronin/contracts/libraries/Token.sol"; +import { LibTokenInfo, TokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; import { Contract } from "../utils/Contract.sol"; import { BridgeMigration } from "../BridgeMigration.sol"; import { Network } from "../utils/Network.sol"; @@ -56,16 +56,16 @@ contract Migration__MapTokenMainchain is BridgeMigration { function _mapFarmlandToken() internal pure returns (bytes memory) { address[] memory mainchainTokens = new address[](1); address[] memory roninTokens = new address[](1); - Token.Standard[] memory standards = new Token.Standard[](1); + TokenStandard[] memory standards = new TokenStandard[](1); mainchainTokens[0] = _farmlandMainchainToken; roninTokens[0] = _farmlandRoninToken; - standards[0] = Token.Standard.ERC721; + standards[0] = TokenStandard.ERC721; // function mapTokens( // address[] calldata _mainchainTokens, // address[] calldata _roninTokens, - // Token.Standard[] calldata _standards + // TokenStandard[] calldata _standards // ) bytes memory innerData = abi.encodeCall(IMainchainGatewayV3.mapTokens, ( @@ -79,7 +79,7 @@ contract Migration__MapTokenMainchain is BridgeMigration { function _mapPixelToken() internal pure returns (bytes memory) { address[] memory mainchainTokens = new address[](1); address[] memory roninTokens = new address[](1); - Token.Standard[] memory standards = new Token.Standard[](1); + TokenStandard[] memory standards = new TokenStandard[](1); uint256[][4] memory thresholds; // highTierThreshold @@ -97,12 +97,12 @@ contract Migration__MapTokenMainchain is BridgeMigration { mainchainTokens[0] = _farmlandMainchainToken; roninTokens[0] = _farmlandRoninToken; - standards[0] = Token.Standard.ERC20; + standards[0] = TokenStandard.ERC20; // function mapTokensAndThresholds( // address[] calldata _mainchainTokens, // address[] calldata _roninTokens, - // Token.Standard[] calldata _standards, + // TokenStandard[] calldata _standards, // uint256[][4] calldata _thresholds // ) diff --git a/script/20240115-mappixeltoken/20240115-maptoken-roninchain.s.sol b/script/20240115-mappixeltoken/20240115-maptoken-roninchain.s.sol index 3b7d548b..ad5e1bd4 100644 --- a/script/20240115-mappixeltoken/20240115-maptoken-roninchain.s.sol +++ b/script/20240115-mappixeltoken/20240115-maptoken-roninchain.s.sol @@ -7,7 +7,7 @@ import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; import { IRoninGatewayV3 } from "@ronin/contracts/interfaces/IRoninGatewayV3.sol"; import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; -import { Token } from "@ronin/contracts/libraries/Token.sol"; +import { LibTokenInfo, TokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; import { Contract } from "../utils/Contract.sol"; import { BridgeMigration } from "../BridgeMigration.sol"; import { Network } from "../utils/Network.sol"; @@ -40,23 +40,23 @@ contract Migration__MapTokenRoninchain is BridgeMigration { address[] memory mainchainTokens = new address[](2); address[] memory roninTokens = new address[](2); uint256[] memory chainIds = new uint256[](2); - Token.Standard[] memory standards = new Token.Standard[](2); + TokenStandard[] memory standards = new TokenStandard[](2); mainchainTokens[0] = _farmlandMainchainToken; roninTokens[0] = _farmlandRoninToken; chainIds[0] = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); - standards[0] = Token.Standard.ERC721; + standards[0] = TokenStandard.ERC721; mainchainTokens[1] = _pixelMainchainToken; roninTokens[1] = _pixelRoninToken; chainIds[1] = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); - standards[1] = Token.Standard.ERC20; + standards[1] = TokenStandard.ERC20; // function mapTokens( // address[] calldata _roninTokens, // address[] calldata _mainchainTokens, // uint256[] calldata chainIds, - // Token.Standard[] calldata _standards + // TokenStandard[] calldata _standards // ) bytes memory innerData = abi.encodeCall(IRoninGatewayV3.mapTokens, ( diff --git a/script/20240131-maptoken-pixel/20240131-maptoken-pixel-mainchain.s.sol b/script/20240131-maptoken-pixel/20240131-maptoken-pixel-mainchain.s.sol index 1101126e..afa5e744 100644 --- a/script/20240131-maptoken-pixel/20240131-maptoken-pixel-mainchain.s.sol +++ b/script/20240131-maptoken-pixel/20240131-maptoken-pixel-mainchain.s.sol @@ -7,7 +7,7 @@ import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; import { IMainchainGatewayV3 } from "@ronin/contracts/interfaces/IMainchainGatewayV3.sol"; import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; -import { Token } from "@ronin/contracts/libraries/Token.sol"; +import { LibTokenInfo, TokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; import { Contract } from "../utils/Contract.sol"; import { BridgeMigration } from "../BridgeMigration.sol"; import { Network } from "../utils/Network.sol"; @@ -39,7 +39,7 @@ contract Migration__20240131_MapTokenPixelMainchain is BridgeMigration, Migratio function run() public { address[] memory mainchainTokens = new address[](1); address[] memory roninTokens = new address[](1); - Token.Standard[] memory standards = new Token.Standard[](1); + TokenStandard[] memory standards = new TokenStandard[](1); uint256[][4] memory thresholds; uint256 expiredTime = block.timestamp + 10 days; @@ -52,7 +52,7 @@ contract Migration__20240131_MapTokenPixelMainchain is BridgeMigration, Migratio mainchainTokens[0] = _pixelMainchainToken; roninTokens[0] = _pixelRoninToken; - standards[0] = Token.Standard.ERC20; + standards[0] = TokenStandard.ERC20; // highTierThreshold thresholds[0] = new uint256[](1); thresholds[0][0] = _highTierThreshold; @@ -69,7 +69,7 @@ contract Migration__20240131_MapTokenPixelMainchain is BridgeMigration, Migratio // function mapTokensAndThresholds( // address[] calldata _mainchainTokens, // address[] calldata _roninTokens, - // Token.Standard[] calldata _standards, + // TokenStandard[] calldata _standards, // uint256[][4] calldata _thresholds // ) @@ -91,12 +91,12 @@ contract Migration__20240131_MapTokenPixelMainchain is BridgeMigration, Migratio mainchainTokens[0] = _farmlandMainchainToken; roninTokens[0] = _farmlandRoninToken; - standards[0] = Token.Standard.ERC721; + standards[0] = TokenStandard.ERC721; // function mapTokens( // address[] calldata _mainchainTokens, // address[] calldata _roninTokens, - // Token.Standard[] calldata _standards + // TokenStandard[] calldata _standards // ) external; innerData = abi.encodeCall(IMainchainGatewayV3.mapTokens, ( diff --git a/script/20240131-maptoken-pixel/20240131-maptoken-pixel-roninchain.s.sol b/script/20240131-maptoken-pixel/20240131-maptoken-pixel-roninchain.s.sol index 607a728f..548ee6e3 100644 --- a/script/20240131-maptoken-pixel/20240131-maptoken-pixel-roninchain.s.sol +++ b/script/20240131-maptoken-pixel/20240131-maptoken-pixel-roninchain.s.sol @@ -8,7 +8,7 @@ import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; import { IRoninGatewayV3 } from "@ronin/contracts/interfaces/IRoninGatewayV3.sol"; import { MinimumWithdrawal } from "@ronin/contracts/extensions/MinimumWithdrawal.sol"; -import { Token } from "@ronin/contracts/libraries/Token.sol"; +import { LibTokenInfo, TokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; import { Ballot } from "@ronin/contracts/libraries/Ballot.sol"; import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; @@ -48,7 +48,7 @@ contract Migration__20240131_MapTokenPixelRoninchain is BridgeMigration, Migrati address[] memory roninTokens = new address[](2); address[] memory mainchainTokens = new address[](2); uint256[] memory chainIds = new uint256[](2); - Token.Standard[] memory standards = new Token.Standard[](2); + TokenStandard[] memory standards = new TokenStandard[](2); uint256 expiredTime = block.timestamp + 10 days; address[] memory targets = new address[](4); @@ -61,18 +61,18 @@ contract Migration__20240131_MapTokenPixelRoninchain is BridgeMigration, Migrati roninTokens[0] = _pixelRoninToken; mainchainTokens[0] = _pixelMainchainToken; chainIds[0] = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); - standards[0] = Token.Standard.ERC20; + standards[0] = TokenStandard.ERC20; roninTokens[1] = _farmlandRoninToken; mainchainTokens[1] = _farmlandMainchainToken; chainIds[1] = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); - standards[1] = Token.Standard.ERC721; + standards[1] = TokenStandard.ERC721; // function mapTokens( // address[] calldata _roninTokens, // address[] calldata _mainchainTokens, // uint256[] calldata chainIds, - // Token.Standard[] calldata _standards + // TokenStandard[] calldata _standards // ) bytes memory innerData = abi.encodeCall(IRoninGatewayV3.mapTokens, ( roninTokens, diff --git a/script/20240206-maptoken-banana/20240206-maptoken-banana-mainchain.s.sol b/script/20240206-maptoken-banana/20240206-maptoken-banana-mainchain.s.sol index 4a7da82a..d1d2c8a0 100644 --- a/script/20240206-maptoken-banana/20240206-maptoken-banana-mainchain.s.sol +++ b/script/20240206-maptoken-banana/20240206-maptoken-banana-mainchain.s.sol @@ -7,7 +7,7 @@ import {BaseMigration} from "foundry-deployment-kit/BaseMigration.s.sol"; import {RoninBridgeManager} from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; import {IMainchainGatewayV3} from "@ronin/contracts/interfaces/IMainchainGatewayV3.sol"; import {GlobalProposal} from "@ronin/contracts/libraries/GlobalProposal.sol"; -import {Token} from "@ronin/contracts/libraries/Token.sol"; +import {LibTokenInfo, TokenStandard} from "@ronin/contracts/libraries/LibTokenInfo.sol"; import {Contract} from "../utils/Contract.sol"; import {BridgeMigration} from "../BridgeMigration.sol"; import {Network} from "../utils/Network.sol"; @@ -43,7 +43,7 @@ contract Migration__20240206_MapTokenBananaMainchain is function run() public onlyOn(DefaultNetwork.RoninMainnet.key()) { address[] memory mainchainTokens = new address[](1); address[] memory roninTokens = new address[](1); - Token.Standard[] memory standards = new Token.Standard[](1); + TokenStandard[] memory standards = new TokenStandard[](1); uint256[][4] memory thresholds; uint256 expiredTime = block.timestamp + 10 days; @@ -56,7 +56,7 @@ contract Migration__20240206_MapTokenBananaMainchain is mainchainTokens[0] = _bananaMainchainToken; roninTokens[0] = _bananaRoninToken; - standards[0] = Token.Standard.ERC20; + standards[0] = TokenStandard.ERC20; // highTierThreshold thresholds[0] = new uint256[](1); thresholds[0][0] = _highTierThreshold; @@ -73,7 +73,7 @@ contract Migration__20240206_MapTokenBananaMainchain is // function mapTokens( // address[] calldata _mainchainTokens, // address[] calldata _roninTokens, - // Token.Standard[] calldata _standards + // TokenStandard[] calldata _standards // ) bytes memory innerData = abi.encodeCall(IMainchainGatewayV3.mapTokensAndThresholds, (mainchainTokens, roninTokens, standards, thresholds)); @@ -89,12 +89,12 @@ contract Migration__20240206_MapTokenBananaMainchain is mainchainTokens[0] = _genkaiMainchainToken; roninTokens[0] = _genkaiRoninToken; - standards[0] = Token.Standard.ERC721; + standards[0] = TokenStandard.ERC721; // function mapTokens( // address[] calldata _mainchainTokens, // address[] calldata _roninTokens, - // Token.Standard[] calldata _standards + // TokenStandard[] calldata _standards // ) external; innerData = abi.encodeCall(IMainchainGatewayV3.mapTokens, (mainchainTokens, roninTokens, standards)); @@ -110,12 +110,12 @@ contract Migration__20240206_MapTokenBananaMainchain is mainchainTokens[0] = _VxMainchainToken; roninTokens[0] = _VxRoninToken; - standards[0] = Token.Standard.ERC721; + standards[0] = TokenStandard.ERC721; // function mapTokens( // address[] calldata _mainchainTokens, // address[] calldata _roninTokens, - // Token.Standard[] calldata _standards + // TokenStandard[] calldata _standards // ) external; innerData = abi.encodeCall(IMainchainGatewayV3.mapTokens, (mainchainTokens, roninTokens, standards)); diff --git a/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol b/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol index 375fc17b..398640d0 100644 --- a/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol +++ b/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol @@ -9,7 +9,7 @@ import {DefaultNetwork} from "foundry-deployment-kit/utils/DefaultNetwork.sol"; import {RoninBridgeManager} from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; import {IRoninGatewayV3} from "@ronin/contracts/interfaces/IRoninGatewayV3.sol"; import {MinimumWithdrawal} from "@ronin/contracts/extensions/MinimumWithdrawal.sol"; -import {Token} from "@ronin/contracts/libraries/Token.sol"; +import {LibTokenInfo, TokenStandard} from "@ronin/contracts/libraries/LibTokenInfo.sol"; import {Ballot} from "@ronin/contracts/libraries/Ballot.sol"; import {GlobalProposal} from "@ronin/contracts/libraries/GlobalProposal.sol"; import {Proposal} from "@ronin/contracts/libraries/Proposal.sol"; @@ -64,7 +64,7 @@ contract Migration__20240206_MapTokenBananaRoninChain is address[] memory roninTokens = new address[](3); address[] memory mainchainTokens = new address[](3); uint256[] memory chainIds = new uint256[](3); - Token.Standard[] memory standards = new Token.Standard[](3); + TokenStandard[] memory standards = new TokenStandard[](3); uint256 expiredTime = block.timestamp + 10 days; address[] memory targets = new address[](4); @@ -77,23 +77,23 @@ contract Migration__20240206_MapTokenBananaRoninChain is roninTokens[0] = _bananaRoninToken; mainchainTokens[0] = _bananaMainchainToken; chainIds[0] = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); - standards[0] = Token.Standard.ERC20; + standards[0] = TokenStandard.ERC20; roninTokens[1] = _VxRoninToken; mainchainTokens[1] = _VxMainchainToken; chainIds[1] = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); - standards[1] = Token.Standard.ERC721; + standards[1] = TokenStandard.ERC721; roninTokens[2] = _genkaiRoninToken; mainchainTokens[2] = _genkaiMainchainToken; chainIds[2] = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); - standards[2] = Token.Standard.ERC721; + standards[2] = TokenStandard.ERC721; // function mapTokens( // address[] calldata _roninTokens, // address[] calldata _mainchainTokens, // uint256[] calldata chainIds, - // Token.Standard[] calldata _standards + // TokenStandard[] calldata _standards // ) bytes memory innerData = abi.encodeCall(IRoninGatewayV3.mapTokens, (roninTokens, mainchainTokens, chainIds, standards)); @@ -117,7 +117,7 @@ contract Migration__20240206_MapTokenBananaRoninChain is roninTokensToSetMinThreshold[1] = pixelRoninToken; minThresholds[1] = pixelMinThreshold; - + roninTokensToSetMinThreshold[2] = pixelMainchainToken; minThresholds[2] = 0; diff --git a/script/Migration.s.sol b/script/Migration.s.sol index ecec4fa8..fdd1b1ad 100644 --- a/script/Migration.s.sol +++ b/script/Migration.s.sol @@ -9,7 +9,7 @@ import { Network } from "./utils/Network.sol"; import { Utils } from "./utils/Utils.sol"; import { Contract } from "./utils/Contract.sol"; import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; -import { Token } from "@ronin/contracts/libraries/Token.sol"; +import { LibTokenInfo, TokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; import { LibArray } from "./libraries/LibArray.sol"; contract Migration is BaseMigrationV2, Utils { diff --git a/script/interfaces/ISharedArgument.sol b/script/interfaces/ISharedArgument.sol index 37971d4d..f8f9f806 100644 --- a/script/interfaces/ISharedArgument.sol +++ b/script/interfaces/ISharedArgument.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.23; import { IGeneralConfig } from "foundry-deployment-kit/interfaces/IGeneralConfig.sol"; import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; -import { Token } from "@ronin/contracts/libraries/Token.sol"; +import { LibTokenInfo, TokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; interface ISharedArgument is IGeneralConfig { struct BridgeManagerParam { @@ -36,7 +36,7 @@ interface ISharedArgument is IGeneralConfig { // thresholds[2]: unlockFeePercentages // thresholds[3]: dailyWithdrawalLimit uint256[][4] thresholds; - Token.Standard[] standards; + TokenStandard[] standards; } struct RoninGatewayV3Param { @@ -52,7 +52,7 @@ interface ISharedArgument is IGeneralConfig { // packedNumbers[0]: chainIds // packedNumbers[1]: minimumThresholds uint256[][2] packedNumbers; - Token.Standard[] standards; + TokenStandard[] standards; } struct BridgeSlashParam { diff --git a/src/extensions/MinimumWithdrawal.sol b/src/extensions/MinimumWithdrawal.sol index fa717926..9b0cc4dd 100644 --- a/src/extensions/MinimumWithdrawal.sol +++ b/src/extensions/MinimumWithdrawal.sol @@ -61,7 +61,7 @@ abstract contract MinimumWithdrawal is HasProxyAdmin { * @dev Checks whether the request is larger than or equal to the minimum threshold. */ function _checkWithdrawal(Transfer.Request calldata _request) internal view { - if (_request.info.erc == Token.Standard.ERC20 && _request.info.quantity < minimumThreshold[_request.tokenAddr]) { + if (_request.info.erc == TokenStandard.ERC20 && _request.info.quantity < minimumThreshold[_request.tokenAddr]) { revert ErrQueryForTooSmallQuantity(); } } diff --git a/src/interfaces/IMainchainGatewayV3.sol b/src/interfaces/IMainchainGatewayV3.sol index 5613d096..41b0b87d 100644 --- a/src/interfaces/IMainchainGatewayV3.sol +++ b/src/interfaces/IMainchainGatewayV3.sol @@ -32,7 +32,7 @@ interface IMainchainGatewayV3 is SignatureConsumer, MappedTokenConsumer { /// @dev Emitted when the assets are withdrawn event Withdrew(bytes32 receiptHash, Transfer.Receipt receipt); /// @dev Emitted when the tokens are mapped - event TokenMapped(address[] mainchainTokens, address[] roninTokens, Token.Standard[] standards); + event TokenMapped(address[] mainchainTokens, address[] roninTokens, TokenStandard[] standards); /// @dev Emitted when the wrapped native token contract is updated event WrappedNativeTokenContractUpdated(IWETH weth); /// @dev Emitted when the withdrawal is locked @@ -112,7 +112,7 @@ interface IMainchainGatewayV3 is SignatureConsumer, MappedTokenConsumer { function mapTokens( address[] calldata _mainchainTokens, address[] calldata _roninTokens, - Token.Standard[] calldata _standards + TokenStandard[] calldata _standards ) external; /** @@ -128,7 +128,7 @@ interface IMainchainGatewayV3 is SignatureConsumer, MappedTokenConsumer { function mapTokensAndThresholds( address[] calldata _mainchainTokens, address[] calldata _roninTokens, - Token.Standard[] calldata _standards, + TokenStandard[] calldata _standards, uint256[][4] calldata _thresholds ) external; diff --git a/src/interfaces/IRoninGatewayV3.sol b/src/interfaces/IRoninGatewayV3.sol index 7e72bcfa..7e6d6fa9 100644 --- a/src/interfaces/IRoninGatewayV3.sol +++ b/src/interfaces/IRoninGatewayV3.sol @@ -29,7 +29,7 @@ interface IRoninGatewayV3 is MappedTokenConsumer { /// @dev Emitted when the withdrawal signatures is requested event WithdrawalSignaturesRequested(bytes32 receiptHash, Transfer.Receipt); /// @dev Emitted when the tokens are mapped - event TokenMapped(address[] roninTokens, address[] mainchainTokens, uint256[] chainIds, Token.Standard[] standards); + event TokenMapped(address[] roninTokens, address[] mainchainTokens, uint256[] chainIds, TokenStandard[] standards); /// @dev Emitted when the threshold is updated event TrustedThresholdUpdated( uint256 indexed nonce, @@ -144,7 +144,7 @@ interface IRoninGatewayV3 is MappedTokenConsumer { address[] calldata _roninTokens, address[] calldata _mainchainTokens, uint256[] calldata chainIds, - Token.Standard[] calldata _standards + TokenStandard[] calldata _standards ) external; /** diff --git a/src/interfaces/consumers/MappedTokenConsumer.sol b/src/interfaces/consumers/MappedTokenConsumer.sol index ca0f57eb..c83d96c7 100644 --- a/src/interfaces/consumers/MappedTokenConsumer.sol +++ b/src/interfaces/consumers/MappedTokenConsumer.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../../libraries/Token.sol"; +import "../../libraries/LibTokenInfo.sol"; interface MappedTokenConsumer { struct MappedToken { - Token.Standard erc; + TokenStandard erc; address tokenAddr; } } diff --git a/src/libraries/Token.sol b/src/libraries/LibTokenInfo.sol similarity index 78% rename from src/libraries/Token.sol rename to src/libraries/LibTokenInfo.sol index 7f1a379b..a5a1da17 100644 --- a/src/libraries/Token.sol +++ b/src/libraries/LibTokenInfo.sol @@ -5,7 +5,20 @@ import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "../interfaces/IWETH.sol"; -library Token { +enum TokenStandard { + ERC20, + ERC721 +} + +struct TokenInfo { + TokenStandard erc; + // For ERC20: the id must be 0 and the quantity is larger than 0. + // For ERC721: the quantity must be 0. + uint256 id; + uint256 quantity; +} + +library LibTokenInfo { /// @dev Error indicating that the provided information is invalid. error ErrInvalidInfo(); @@ -24,7 +37,7 @@ library Token { * @param to Receiver of the token value. * @param token Address of the token. */ - error ErrTokenCouldNotTransfer(Info tokenInfo, address to, address token); + error ErrTokenCouldNotTransfer(TokenInfo tokenInfo, address to, address token); /** * @dev Error indicating that the `transferFrom` has failed. @@ -33,20 +46,7 @@ library Token { * @param to Receiver of the token value. * @param token Address of the token. */ - error ErrTokenCouldNotTransferFrom(Info tokenInfo, address from, address to, address token); - - enum Standard { - ERC20, - ERC721 - } - - struct Info { - Standard erc; - // For ERC20: the id must be 0 and the quantity is larger than 0. - // For ERC721: the quantity must be 0. - uint256 id; - uint256 quantity; - } + error ErrTokenCouldNotTransferFrom(TokenInfo tokenInfo, address from, address to, address token); // keccak256("TokenInfo(uint8 erc,uint256 id,uint256 quantity)"); bytes32 public constant INFO_TYPE_HASH = 0x1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d; @@ -54,7 +54,7 @@ library Token { /** * @dev Returns token info struct hash. */ - function hash(Info memory self) internal pure returns (bytes32 digest) { + function hash(TokenInfo memory self) internal pure returns (bytes32 digest) { // keccak256(abi.encode(INFO_TYPE_HASH, _info.erc, _info.id, _info.quantity)) assembly { let ptr := mload(0x40) @@ -69,11 +69,11 @@ library Token { /** * @dev Validates the token info. */ - function validate(Info memory self) internal pure { + function validate(TokenInfo memory self) internal pure { if ( !( - (self.erc == Standard.ERC20 && self.quantity > 0 && self.id == 0) - || (self.erc == Standard.ERC721 && self.quantity == 0) + (self.erc == TokenStandard.ERC20 && self.quantity > 0 && self.id == 0) + || (self.erc == TokenStandard.ERC721 && self.quantity == 0) ) ) revert ErrInvalidInfo(); } @@ -85,13 +85,13 @@ library Token { * - The `_from` address must approve for the contract using this library. * */ - function transferFrom(Info memory self, address from, address to, address token) internal { + function transferFrom(TokenInfo memory self, address from, address to, address token) internal { bool success; bytes memory data; - if (self.erc == Standard.ERC20) { + if (self.erc == TokenStandard.ERC20) { (success, data) = token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, self.quantity)); success = success && (data.length == 0 || abi.decode(data, (bool))); - } else if (self.erc == Standard.ERC721) { + } else if (self.erc == TokenStandard.ERC721) { // bytes4(keccak256("transferFrom(address,address,uint256)")) (success,) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, self.id)); } else { @@ -120,11 +120,11 @@ library Token { /** * @dev Transfer assets from current address to `_to` address. */ - function transfer(Info memory self, address to, address token) internal { + function transfer(TokenInfo memory self, address to, address token) internal { bool success; - if (self.erc == Standard.ERC20) { + if (self.erc == TokenStandard.ERC20) { success = tryTransferERC20(token, to, self.quantity); - } else if (self.erc == Standard.ERC721) { + } else if (self.erc == TokenStandard.ERC721) { success = tryTransferERC721(token, to, self.id); } else { revert ErrUnsupportedStandard(); @@ -139,7 +139,7 @@ library Token { * @notice Prioritizes transfer native token if the token is wrapped. * */ - function handleAssetTransfer(Info memory self, address payable to, address token, IWETH wrappedNativeToken) + function handleAssetTransfer(TokenInfo memory self, address payable to, address token, IWETH wrappedNativeToken) internal { bool success; @@ -149,7 +149,7 @@ library Token { wrappedNativeToken.deposit{ value: self.quantity }(); transfer(self, to, token); } - } else if (self.erc == Token.Standard.ERC20) { + } else if (self.erc == TokenStandard.ERC20) { uint256 _balance = IERC20(token).balanceOf(address(this)); if (_balance < self.quantity) { @@ -159,7 +159,7 @@ library Token { } transfer(self, to, token); - } else if (self.erc == Token.Standard.ERC721) { + } else if (self.erc == TokenStandard.ERC721) { if (!tryTransferERC721(token, to, self.id)) { // bytes4(keccak256("mint(address,uint256)")) (success,) = token.call(abi.encodeWithSelector(0x40c10f19, to, self.id)); diff --git a/src/libraries/Transfer.sol b/src/libraries/Transfer.sol index 8dcaea36..b4d6dc83 100644 --- a/src/libraries/Transfer.sol +++ b/src/libraries/Transfer.sol @@ -3,13 +3,13 @@ pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import "./Token.sol"; +import "./LibTokenInfo.sol"; import "./LibTokenOwner.sol"; library Transfer { using ECDSA for bytes32; using LibTokenOwner for TokenOwner; - using Token for Token.Info; + using LibTokenInfo for TokenInfo; enum Kind { Deposit, @@ -23,7 +23,7 @@ library Transfer { // Token address to deposit/withdraw // Value 0: native token address tokenAddr; - Token.Info info; + TokenInfo info; } /** @@ -73,7 +73,7 @@ library Transfer { Kind kind; TokenOwner mainchain; TokenOwner ronin; - Token.Info info; + TokenInfo info; } // keccak256("Receipt(uint256 id,uint8 kind,TokenOwner mainchain,TokenOwner ronin,TokenInfo info)TokenInfo(uint8 erc,uint256 id,uint256 quantity)TokenOwner(address addr,address tokenAddr,uint256 chainId)"); diff --git a/src/mainchain/MainchainGatewayV3.sol b/src/mainchain/MainchainGatewayV3.sol index 68be6019..8ff6b3ea 100644 --- a/src/mainchain/MainchainGatewayV3.sol +++ b/src/mainchain/MainchainGatewayV3.sol @@ -17,7 +17,7 @@ contract MainchainGatewayV3 is IMainchainGatewayV3, HasContracts { - using Token for Token.Info; + using LibTokenInfo for TokenInfo; using Transfer for Transfer.Request; using Transfer for Transfer.Receipt; @@ -71,7 +71,7 @@ contract MainchainGatewayV3 is // _thresholds[2]: unlockFeePercentages // _thresholds[3]: dailyWithdrawalLimit uint256[][4] calldata _thresholds, - Token.Standard[] calldata _standards + TokenStandard[] calldata _standards ) external payable virtual initializer { _setupRole(DEFAULT_ADMIN_ROLE, _roleSetter); roninChainId = _roninChainId; @@ -159,10 +159,10 @@ contract MainchainGatewayV3 is emit WithdrawalUnlocked(_receiptHash, _receipt); address _token = _receipt.mainchain.tokenAddr; - if (_receipt.info.erc == Token.Standard.ERC20) { - Token.Info memory _feeInfo = _receipt.info; + if (_receipt.info.erc == TokenStandard.ERC20) { + TokenInfo memory _feeInfo = _receipt.info; _feeInfo.quantity = _computeFeePercentage(_receipt.info.quantity, unlockFeePercentages[_token]); - Token.Info memory _withdrawInfo = _receipt.info; + TokenInfo memory _withdrawInfo = _receipt.info; _withdrawInfo.quantity = _receipt.info.quantity - _feeInfo.quantity; _feeInfo.handleAssetTransfer(payable(msg.sender), _token, wrappedNativeToken); @@ -180,7 +180,7 @@ contract MainchainGatewayV3 is function mapTokens( address[] calldata _mainchainTokens, address[] calldata _roninTokens, - Token.Standard[] calldata _standards + TokenStandard[] calldata _standards ) external virtual onlyAdmin { if (_mainchainTokens.length == 0) revert ErrEmptyArray(); _mapTokens(_mainchainTokens, _roninTokens, _standards); @@ -192,7 +192,7 @@ contract MainchainGatewayV3 is function mapTokensAndThresholds( address[] calldata _mainchainTokens, address[] calldata _roninTokens, - Token.Standard[] calldata _standards, + TokenStandard[] calldata _standards, // _thresholds[0]: highTierThreshold // _thresholds[1]: lockedThreshold // _thresholds[2]: unlockFeePercentages @@ -227,7 +227,7 @@ contract MainchainGatewayV3 is function _mapTokens( address[] calldata _mainchainTokens, address[] calldata _roninTokens, - Token.Standard[] calldata _standards + TokenStandard[] calldata _standards ) internal virtual { if (!(_mainchainTokens.length == _roninTokens.length && _mainchainTokens.length == _standards.length)) { revert ErrLengthMismatch(msg.sig); @@ -281,7 +281,7 @@ contract MainchainGatewayV3 is if (withdrawalHash[_id] != 0) revert ErrQueryForProcessedWithdrawal(); - if (!(_receipt.info.erc == Token.Standard.ERC721 || !_reachedWithdrawalLimit(_tokenAddr, _quantity))) { + if (!(_receipt.info.erc == TokenStandard.ERC721 || !_reachedWithdrawalLimit(_tokenAddr, _quantity))) { revert ErrReachedDailyWithdrawalLimit(); } @@ -376,14 +376,14 @@ contract MainchainGatewayV3 is /** * @dev Returns the minimum vote weight for the token. */ - function _computeMinVoteWeight(Token.Standard _erc, address _token, uint256 _quantity) + function _computeMinVoteWeight(TokenStandard _erc, address _token, uint256 _quantity) internal virtual returns (uint256 _weight, bool _locked) { uint256 _totalWeight = _getTotalWeight(); _weight = _minimumVoteWeight(_totalWeight); - if (_erc == Token.Standard.ERC20) { + if (_erc == TokenStandard.ERC20) { if (highTierThreshold[_token] <= _quantity) { _weight = _highTierVoteWeight(_totalWeight); } diff --git a/src/ronin/gateway/RoninGatewayV3.sol b/src/ronin/gateway/RoninGatewayV3.sol index 6a11782c..d3eed9a1 100644 --- a/src/ronin/gateway/RoninGatewayV3.sol +++ b/src/ronin/gateway/RoninGatewayV3.sol @@ -24,7 +24,7 @@ contract RoninGatewayV3 is IRoninGatewayV3, HasContracts { - using Token for Token.Info; + using LibTokenInfo for TokenInfo; using Transfer for Transfer.Request; using Transfer for Transfer.Receipt; using IsolatedGovernance for IsolatedGovernance.Vote; @@ -95,7 +95,7 @@ contract RoninGatewayV3 is // _packedNumbers[0]: chainIds // _packedNumbers[1]: minimumThresholds uint256[][2] calldata _packedNumbers, - Token.Standard[] calldata _standards + TokenStandard[] calldata _standards ) external virtual initializer { _setupRole(DEFAULT_ADMIN_ROLE, _roleSetter); _setThreshold(_numerator, _denominator); @@ -288,7 +288,7 @@ contract RoninGatewayV3 is address[] calldata _roninTokens, address[] calldata _mainchainTokens, uint256[] calldata _chainIds, - Token.Standard[] calldata _standards + TokenStandard[] calldata _standards ) external onlyAdmin { if (_roninTokens.length == 0) revert ErrLengthMismatch(msg.sig); _mapTokens(_roninTokens, _mainchainTokens, _chainIds, _standards); @@ -336,7 +336,7 @@ contract RoninGatewayV3 is address[] calldata _roninTokens, address[] calldata _mainchainTokens, uint256[] calldata _chainIds, - Token.Standard[] calldata _standards + TokenStandard[] calldata _standards ) internal { if (!(_roninTokens.length == _mainchainTokens.length && _roninTokens.length == _chainIds.length)) revert ErrLengthMismatch(msg.sig); diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index 8dbabc08..862e6c88 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -22,7 +22,7 @@ import { MockERC721 } from "@ronin/contracts/mocks/token/MockERC721.sol"; import { MockWrappedToken } from "@ronin/contracts/mocks/token/MockWrappedToken.sol"; import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; import { Proposal } from "@ronin/contracts/libraries/Proposal.sol"; -import { Token } from "@ronin/contracts/libraries/Token.sol"; +import { LibTokenInfo, TokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; import { IWETH } from "@ronin/contracts/interfaces/IWETH.sol"; import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; import { Ballot } from "@ronin/contracts/libraries/Ballot.sol"; @@ -232,13 +232,13 @@ contract BaseIntegration_Test is Base_Test { uint256 tokenNum = mainchainTokens.length; // reserve slot for ERC721Tokens uint256[] memory minimumThreshold = new uint256[](tokenNum); uint256[] memory chainIds = new uint256[](tokenNum); - Token.Standard[] memory standards = new Token.Standard[](tokenNum); + TokenStandard[] memory standards = new TokenStandard[](tokenNum); for (uint256 i; i < tokenNum; i++) { bool isERC721 = i == mainchainTokens.length - 1; // last item is ERC721 minimumThreshold[i] = 20; chainIds[i] = block.chainid; - standards[i] = isERC721 ? Token.Standard.ERC721 : Token.Standard.ERC20; + standards[i] = isERC721 ? TokenStandard.ERC721 : TokenStandard.ERC20; } // Ronin Gateway V3 @@ -432,7 +432,7 @@ contract BaseIntegration_Test is Base_Test { uint256[] memory lockedThreshold = new uint256[](tokenNum); uint256[] memory unlockFeePercentages = new uint256[](tokenNum); uint256[] memory dailyWithdrawalLimits = new uint256[](tokenNum); - Token.Standard[] memory standards = new Token.Standard[](tokenNum); + TokenStandard[] memory standards = new TokenStandard[](tokenNum); for (uint256 i; i < tokenNum; i++) { bool isERC721 = i == mainchainTokens.length - 1; // last item is ERC721 @@ -441,7 +441,7 @@ contract BaseIntegration_Test is Base_Test { lockedThreshold[i] = 20; unlockFeePercentages[i] = 100_000; dailyWithdrawalLimits[i] = 12; - standards[i] = isERC721 ? Token.Standard.ERC721 : Token.Standard.ERC20; + standards[i] = isERC721 ? TokenStandard.ERC721 : TokenStandard.ERC20; } // Mainchain Gateway V3 diff --git a/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol index f24f50c4..bcabe4ea 100644 --- a/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; import { console2 as console } from "forge-std/console2.sol"; import { Transfer } from "@ronin/contracts/libraries/Transfer.sol"; -import { Token } from "@ronin/contracts/libraries/Token.sol"; +import { LibTokenInfo, TokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; import { LibTokenOwner, TokenOwner } from "@ronin/contracts/libraries/LibTokenOwner.sol"; import "../../BaseIntegration.t.sol"; @@ -26,7 +26,7 @@ contract UpdateOperator_RoninBridgeManager_Test is BaseIntegration_Test { kind: Transfer.Kind.Deposit, ronin: TokenOwner({ addr: makeAddr("recipient"), tokenAddr: address(_roninWeth), chainId: block.chainid }), mainchain: TokenOwner({ addr: makeAddr("requester"), tokenAddr: address(_mainchainWeth), chainId: block.chainid }), - info: Token.Info({ erc: Token.Standard.ERC20, id: 0, quantity: 100 }) + info: TokenInfo({ erc: TokenStandard.ERC20, id: 0, quantity: 100 }) }); for (uint256 i; i < 50; i++) { diff --git a/test/bridge/integration/mainchain-gateway/requestDepositFor.MainchainGatewayV3.t.sol b/test/bridge/integration/mainchain-gateway/requestDepositFor.MainchainGatewayV3.t.sol index b48f8d3b..8c48cf6d 100644 --- a/test/bridge/integration/mainchain-gateway/requestDepositFor.MainchainGatewayV3.t.sol +++ b/test/bridge/integration/mainchain-gateway/requestDepositFor.MainchainGatewayV3.t.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; import { console2 as console } from "forge-std/console2.sol"; import { Transfer as LibTransfer } from "@ronin/contracts/libraries/Transfer.sol"; -import { Token } from "@ronin/contracts/libraries/Token.sol"; +import { LibTokenInfo, TokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; import "../BaseIntegration.t.sol"; @@ -34,7 +34,7 @@ contract RequestDepositFor_MainchainGatewayV3_Test is BaseIntegration_Test { _depositRequest.recipientAddr = makeAddr("recipient"); _depositRequest.tokenAddr = address(0); - _depositRequest.info.erc = Token.Standard.ERC20; + _depositRequest.info.erc = TokenStandard.ERC20; _depositRequest.info.id = 0; _depositRequest.info.quantity = _quantity; @@ -90,7 +90,7 @@ contract RequestDepositFor_MainchainGatewayV3_Test is BaseIntegration_Test { _mainchainMockERC721.approve(address(_mainchainGatewayV3), tokenId); _depositRequest.tokenAddr = address(_mainchainMockERC721); - _depositRequest.info.erc = Token.Standard.ERC721; + _depositRequest.info.erc = TokenStandard.ERC721; _depositRequest.info.id = tokenId; _depositRequest.info.quantity = 0; diff --git a/test/bridge/integration/mainchain-gateway/submitWithdrawal.MainchainGatewayV3.t.sol b/test/bridge/integration/mainchain-gateway/submitWithdrawal.MainchainGatewayV3.t.sol index fd18b7db..e00d6486 100644 --- a/test/bridge/integration/mainchain-gateway/submitWithdrawal.MainchainGatewayV3.t.sol +++ b/test/bridge/integration/mainchain-gateway/submitWithdrawal.MainchainGatewayV3.t.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; import { console2 as console } from "forge-std/console2.sol"; import { Transfer as LibTransfer } from "@ronin/contracts/libraries/Transfer.sol"; -import { Token } from "@ronin/contracts/libraries/Token.sol"; +import { LibTokenInfo, TokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; import { IMainchainGatewayV3 } from "@ronin/contracts/interfaces/IMainchainGatewayV3.sol"; import "../BaseIntegration.t.sol"; @@ -43,7 +43,7 @@ contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test { _withdrawalReceipt.mainchain.addr = makeAddr("recipient"); _withdrawalReceipt.mainchain.tokenAddr = address(_mainchainWeth); _withdrawalReceipt.mainchain.chainId = block.chainid; - _withdrawalReceipt.info.erc = Token.Standard.ERC20; + _withdrawalReceipt.info.erc = TokenStandard.ERC20; _withdrawalReceipt.info.id = 0; _withdrawalReceipt.info.quantity = 10; @@ -187,7 +187,7 @@ contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test { _withdrawalReceipt.mainchain.tokenAddr = address(_mainchainMockERC721); _withdrawalReceipt.ronin.tokenAddr = address(_roninMockERC721); _withdrawalReceipt.info.id = tokenId; - _withdrawalReceipt.info.erc = Token.Standard.ERC721; + _withdrawalReceipt.info.erc = TokenStandard.ERC721; _withdrawalReceipt.info.quantity = 0; SignatureConsumer.Signature[] memory signatures = @@ -215,7 +215,7 @@ contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test { _withdrawalReceipt.mainchain.tokenAddr = address(_mainchainMockERC721); _withdrawalReceipt.ronin.tokenAddr = address(_roninMockERC721); _withdrawalReceipt.info.id = tokenId; - _withdrawalReceipt.info.erc = Token.Standard.ERC721; + _withdrawalReceipt.info.erc = TokenStandard.ERC721; _withdrawalReceipt.info.quantity = 0; SignatureConsumer.Signature[] memory signatures = diff --git a/test/bridge/integration/pause-enforcer/emergencyAction.PauseEnforcer.t.sol b/test/bridge/integration/pause-enforcer/emergencyAction.PauseEnforcer.t.sol index 46fce001..d73a68b1 100644 --- a/test/bridge/integration/pause-enforcer/emergencyAction.PauseEnforcer.t.sol +++ b/test/bridge/integration/pause-enforcer/emergencyAction.PauseEnforcer.t.sol @@ -30,7 +30,7 @@ contract EmergencyAction_PauseEnforcer_Test is BaseIntegration_Test { kind: Transfer.Kind.Deposit, ronin: TokenOwner({ addr: makeAddr("recipient"), tokenAddr: address(_roninWeth), chainId: block.chainid }), mainchain: TokenOwner({ addr: makeAddr("requester"), tokenAddr: address(_mainchainWeth), chainId: block.chainid }), - info: Token.Info({ erc: Token.Standard.ERC20, id: 0, quantity: 100 }) + info: TokenInfo({ erc: TokenStandard.ERC20, id: 0, quantity: 100 }) }); vm.expectRevert("Pausable: paused"); @@ -67,7 +67,7 @@ contract EmergencyAction_PauseEnforcer_Test is BaseIntegration_Test { kind: Transfer.Kind.Deposit, ronin: TokenOwner({ addr: makeAddr("recipient"), tokenAddr: address(_roninWeth), chainId: block.chainid }), mainchain: TokenOwner({ addr: makeAddr("requester"), tokenAddr: address(_mainchainWeth), chainId: block.chainid }), - info: Token.Info({ erc: Token.Standard.ERC20, id: 0, quantity: 100 }) + info: TokenInfo({ erc: TokenStandard.ERC20, id: 0, quantity: 100 }) }); uint256 numOperatorsForVoteExecuted = diff --git a/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol b/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol index 6daaa4c2..fa9288c7 100644 --- a/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol +++ b/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; import { console2 as console } from "forge-std/console2.sol"; import { Transfer } from "@ronin/contracts/libraries/Transfer.sol"; -import { Token } from "@ronin/contracts/libraries/Token.sol"; +import { LibTokenInfo, TokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; import { IsolatedGovernance } from "@ronin/contracts/libraries/IsolatedGovernance.sol"; import { VoteStatusConsumer } from "@ronin/contracts/interfaces/consumers/VoteStatusConsumer.sol"; @@ -27,7 +27,7 @@ contract DepositVote_RoninGatewayV3_Test is BaseIntegration_Test { kind: Transfer.Kind.Deposit, ronin: TokenOwner({ addr: makeAddr("recipient"), tokenAddr: address(_roninWeth), chainId: block.chainid }), mainchain: TokenOwner({ addr: makeAddr("requester"), tokenAddr: address(_mainchainWeth), chainId: block.chainid }), - info: Token.Info({ erc: Token.Standard.ERC20, id: 0, quantity: 100 }) + info: TokenInfo({ erc: TokenStandard.ERC20, id: 0, quantity: 100 }) }); _depositReceipts.push(receipt); diff --git a/test/helpers/ProposalUtils.t.sol b/test/helpers/ProposalUtils.t.sol index 4e06b0b5..f7e3e145 100644 --- a/test/helpers/ProposalUtils.t.sol +++ b/test/helpers/ProposalUtils.t.sol @@ -5,7 +5,7 @@ import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import { Test } from "forge-std/Test.sol"; import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; import { Proposal } from "@ronin/contracts/libraries/Proposal.sol"; -import { Token } from "@ronin/contracts/libraries/Token.sol"; +import { LibTokenInfo, TokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; import { Ballot } from "@ronin/contracts/libraries/Ballot.sol"; import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; import { Utils } from "script/utils/Utils.sol"; From d4c7a9b36c4ffc4fab2c6ab46b0f6af140dc9213 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 13 Mar 2024 12:42:14 +0700 Subject: [PATCH 052/180] fix(Info): add two array fields for info --- src/libraries/LibTokenInfo.sol | 2 ++ .../updateOperator.RoninBridgeManager.t.sol | 8 +++++++- .../emergencyAction.PauseEnforcer.t.sol | 16 ++++++++++++++-- .../depositVote.RoninGatewayV3.t.sol | 8 +++++++- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/libraries/LibTokenInfo.sol b/src/libraries/LibTokenInfo.sol index a5a1da17..edf2c50f 100644 --- a/src/libraries/LibTokenInfo.sol +++ b/src/libraries/LibTokenInfo.sol @@ -16,6 +16,8 @@ struct TokenInfo { // For ERC721: the quantity must be 0. uint256 id; uint256 quantity; + uint256[] ids; + uint256[] quantities; } library LibTokenInfo { diff --git a/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol index bcabe4ea..785f517c 100644 --- a/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol @@ -26,7 +26,13 @@ contract UpdateOperator_RoninBridgeManager_Test is BaseIntegration_Test { kind: Transfer.Kind.Deposit, ronin: TokenOwner({ addr: makeAddr("recipient"), tokenAddr: address(_roninWeth), chainId: block.chainid }), mainchain: TokenOwner({ addr: makeAddr("requester"), tokenAddr: address(_mainchainWeth), chainId: block.chainid }), - info: TokenInfo({ erc: TokenStandard.ERC20, id: 0, quantity: 100 }) + info: TokenInfo({ + erc: TokenStandard.ERC20, + id: 0, + quantity: 100, + ids: new uint256[](0), + quantities: new uint256[](0) + }) }); for (uint256 i; i < 50; i++) { diff --git a/test/bridge/integration/pause-enforcer/emergencyAction.PauseEnforcer.t.sol b/test/bridge/integration/pause-enforcer/emergencyAction.PauseEnforcer.t.sol index d73a68b1..84d8da3c 100644 --- a/test/bridge/integration/pause-enforcer/emergencyAction.PauseEnforcer.t.sol +++ b/test/bridge/integration/pause-enforcer/emergencyAction.PauseEnforcer.t.sol @@ -30,7 +30,13 @@ contract EmergencyAction_PauseEnforcer_Test is BaseIntegration_Test { kind: Transfer.Kind.Deposit, ronin: TokenOwner({ addr: makeAddr("recipient"), tokenAddr: address(_roninWeth), chainId: block.chainid }), mainchain: TokenOwner({ addr: makeAddr("requester"), tokenAddr: address(_mainchainWeth), chainId: block.chainid }), - info: TokenInfo({ erc: TokenStandard.ERC20, id: 0, quantity: 100 }) + info: TokenInfo({ + erc: TokenStandard.ERC20, + id: 0, + quantity: 100, + ids: new uint256[](0), + quantities: new uint256[](0) + }) }); vm.expectRevert("Pausable: paused"); @@ -67,7 +73,13 @@ contract EmergencyAction_PauseEnforcer_Test is BaseIntegration_Test { kind: Transfer.Kind.Deposit, ronin: TokenOwner({ addr: makeAddr("recipient"), tokenAddr: address(_roninWeth), chainId: block.chainid }), mainchain: TokenOwner({ addr: makeAddr("requester"), tokenAddr: address(_mainchainWeth), chainId: block.chainid }), - info: TokenInfo({ erc: TokenStandard.ERC20, id: 0, quantity: 100 }) + info: TokenInfo({ + erc: TokenStandard.ERC20, + id: 0, + quantity: 100, + ids: new uint256[](0), + quantities: new uint256[](0) + }) }); uint256 numOperatorsForVoteExecuted = diff --git a/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol b/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol index fa9288c7..14af2f15 100644 --- a/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol +++ b/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol @@ -27,7 +27,13 @@ contract DepositVote_RoninGatewayV3_Test is BaseIntegration_Test { kind: Transfer.Kind.Deposit, ronin: TokenOwner({ addr: makeAddr("recipient"), tokenAddr: address(_roninWeth), chainId: block.chainid }), mainchain: TokenOwner({ addr: makeAddr("requester"), tokenAddr: address(_mainchainWeth), chainId: block.chainid }), - info: TokenInfo({ erc: TokenStandard.ERC20, id: 0, quantity: 100 }) + info: TokenInfo({ + erc: TokenStandard.ERC20, + id: 0, + quantity: 100, + ids: new uint256[](0), + quantities: new uint256[](0) + }) }); _depositReceipts.push(receipt); From 77396ac98027439e8d5e0a23691ed2c80d45d81f Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 13 Mar 2024 12:54:55 +0700 Subject: [PATCH 053/180] fix(Info): validate erc1155 and erc721 batch --- src/libraries/LibTokenInfo.sol | 61 ++++++++++++++++++++++++++++++---- 1 file changed, 54 insertions(+), 7 deletions(-) diff --git a/src/libraries/LibTokenInfo.sol b/src/libraries/LibTokenInfo.sol index edf2c50f..516ac971 100644 --- a/src/libraries/LibTokenInfo.sol +++ b/src/libraries/LibTokenInfo.sol @@ -7,7 +7,9 @@ import "../interfaces/IWETH.sol"; enum TokenStandard { ERC20, - ERC721 + ERC721, + ERC721Batch, + ERC1155 } struct TokenInfo { @@ -68,18 +70,63 @@ library LibTokenInfo { } } + /** + * + * VALIDATE + * + */ + /** * @dev Validates the token info. */ function validate(TokenInfo memory self) internal pure { - if ( - !( - (self.erc == TokenStandard.ERC20 && self.quantity > 0 && self.id == 0) - || (self.erc == TokenStandard.ERC721 && self.quantity == 0) - ) - ) revert ErrInvalidInfo(); + if (!(_validateERC20(self) || _validateERC721(self)) || _validateERC721Batch(self) || _validateERC1155(self)) { + revert ErrInvalidInfo(); + } + } + + function _validateERC20(TokenInfo memory self) private pure returns (bool) { + return (self.erc == TokenStandard.ERC20 && self.quantity > 0 && self.id == 0); + } + + function _validateERC721(TokenInfo memory self) private pure returns (bool) { + return (self.erc == TokenStandard.ERC721 && self.quantity == 0); + } + + function _validateERC721Batch(TokenInfo memory self) private pure returns (bool res) { + uint256 length = self.ids.length; + + res = self.erc == TokenStandard.ERC721Batch && _validateBatch(self); + + for (uint256 i; i < length; ++i) { + if (self.quantities[i] != 0) { + return false; + } + } + } + + function _validateERC1155(TokenInfo memory self) private pure returns (bool res) { + uint256 length = self.ids.length; + res = self.erc == TokenStandard.ERC1155 && _validateBatch(self); + + for (uint256 i; i < length; ++i) { + if (self.quantities[i] == 0) { + return false; + } + } } + function _validateBatch(TokenInfo memory self) private pure returns (bool res) { + return self.quantity == 0 && self.id == 0 && self.ids.length > 0 && self.quantities.length > 0 + && self.ids.length == self.quantities.length; + } + + /** + * + * TRANSFER + * + */ + /** * @dev Transfer asset from. * From 8d0becbb62d6a4060d59bacd20162ffc05664b96 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 13 Mar 2024 13:07:28 +0700 Subject: [PATCH 054/180] fix(Info): add router --- src/libraries/LibTokenInfo.sol | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/libraries/LibTokenInfo.sol b/src/libraries/LibTokenInfo.sol index 516ac971..e474dfd4 100644 --- a/src/libraries/LibTokenInfo.sol +++ b/src/libraries/LibTokenInfo.sol @@ -55,6 +55,25 @@ library LibTokenInfo { // keccak256("TokenInfo(uint8 erc,uint256 id,uint256 quantity)"); bytes32 public constant INFO_TYPE_HASH = 0x1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d; + /** + * + * ROUTER + * + */ + function _isStandardSingle(TokenStandard standard) private pure returns (bool) { + return standard == TokenStandard.ERC20 || standard == TokenStandard.ERC721; + } + + function _isStandardBatch(TokenStandard standard) private pure returns (bool) { + return standard == TokenStandard.ERC721Batch || standard == TokenStandard.ERC1155; + } + + /** + * + * HASH + * + */ + /** * @dev Returns token info struct hash. */ From 68b9c8650cc240388750d19d55b3002555500a05 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 13 Mar 2024 13:07:49 +0700 Subject: [PATCH 055/180] fix(Info): restrict scope of tryTransfer to private --- src/libraries/LibTokenInfo.sol | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libraries/LibTokenInfo.sol b/src/libraries/LibTokenInfo.sol index e474dfd4..32b3a165 100644 --- a/src/libraries/LibTokenInfo.sol +++ b/src/libraries/LibTokenInfo.sol @@ -172,14 +172,14 @@ library LibTokenInfo { /** * @dev Transfers ERC721 token and returns the result. */ - function tryTransferERC721(address token, address to, uint256 id) internal returns (bool success) { + function _tryTransferERC721(address token, address to, uint256 id) private returns (bool success) { (success,) = token.call(abi.encodeWithSelector(IERC721.transferFrom.selector, address(this), to, id)); } /** * @dev Transfers ERC20 token and returns the result. */ - function tryTransferERC20(address token, address to, uint256 quantity) internal returns (bool success) { + function _tryTransferERC20(address token, address to, uint256 quantity) private returns (bool success) { bytes memory data; (success, data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, quantity)); success = success && (data.length == 0 || abi.decode(data, (bool))); @@ -191,9 +191,9 @@ library LibTokenInfo { function transfer(TokenInfo memory self, address to, address token) internal { bool success; if (self.erc == TokenStandard.ERC20) { - success = tryTransferERC20(token, to, self.quantity); + success = _tryTransferERC20(token, to, self.quantity); } else if (self.erc == TokenStandard.ERC721) { - success = tryTransferERC721(token, to, self.id); + success = _tryTransferERC721(token, to, self.id); } else { revert ErrUnsupportedStandard(); } @@ -228,7 +228,7 @@ library LibTokenInfo { transfer(self, to, token); } else if (self.erc == TokenStandard.ERC721) { - if (!tryTransferERC721(token, to, self.id)) { + if (!_tryTransferERC721(token, to, self.id)) { // bytes4(keccak256("mint(address,uint256)")) (success,) = token.call(abi.encodeWithSelector(0x40c10f19, to, self.id)); if (!success) revert ErrERC721MintingFailed(); From 6efc05aa6c3cabfd18abc09b23851fc33a60b04e Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 13 Mar 2024 13:39:22 +0700 Subject: [PATCH 056/180] feat(Info): support hash batch --- src/libraries/LibTokenInfo.sol | 44 +++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/src/libraries/LibTokenInfo.sol b/src/libraries/LibTokenInfo.sol index 32b3a165..6ef51ad7 100644 --- a/src/libraries/LibTokenInfo.sol +++ b/src/libraries/LibTokenInfo.sol @@ -52,9 +52,6 @@ library LibTokenInfo { */ error ErrTokenCouldNotTransferFrom(TokenInfo tokenInfo, address from, address to, address token); - // keccak256("TokenInfo(uint8 erc,uint256 id,uint256 quantity)"); - bytes32 public constant INFO_TYPE_HASH = 0x1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d; - /** * * ROUTER @@ -74,17 +71,48 @@ library LibTokenInfo { * */ + // keccak256("TokenInfo(uint8 erc,uint256 id,uint256 quantity)"); + bytes32 public constant INFO_TYPE_HASH_SINGLE = 0x1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d; + + // keccak256("TokenInfo(uint8 erc,uint256[] id,uint256[] quantity)"); + bytes32 public constant INFO_TYPE_HASH_BATCH = 0xe0d9a8bb18cfc29aa6e46b1293275ca79aeaaf28ac63b66dcb6ebce2f127f5a0; + /** * @dev Returns token info struct hash. */ function hash(TokenInfo memory self) internal pure returns (bytes32 digest) { - // keccak256(abi.encode(INFO_TYPE_HASH, _info.erc, _info.id, _info.quantity)) + if (_isStandardSingle(self.erc)) return _hashSingle(self); + if (_isStandardBatch(self.erc)) return _hashBatch(self); + revert ErrUnsupportedStandard(); + } + + function _hashSingle(TokenInfo memory self) internal pure returns (bytes32 digest) { + // keccak256(abi.encode(INFO_TYPE_HASH_SINGLE, info.erc, info.id, info.quantity)) + assembly { + let ptr := mload(0x40) + mstore(ptr, INFO_TYPE_HASH_SINGLE) + mstore(add(ptr, 0x20), mload(self)) // info.erc + mstore(add(ptr, 0x40), mload(add(self, 0x20))) // info.id + mstore(add(ptr, 0x60), mload(add(self, 0x40))) // info.quantity + digest := keccak256(ptr, 0x80) + } + } + + function _hashBatch(TokenInfo memory self) internal pure returns (bytes32 digest) { + // keccak256(abi.encode(INFO_TYPE_HASH_BATCH, info.erc, info.ids, info.quantities)) assembly { let ptr := mload(0x40) - mstore(ptr, INFO_TYPE_HASH) - mstore(add(ptr, 0x20), mload(self)) // _info.erc - mstore(add(ptr, 0x40), mload(add(self, 0x20))) // _info.id - mstore(add(ptr, 0x60), mload(add(self, 0x40))) // _info.quantity + mstore(ptr, INFO_TYPE_HASH_SINGLE) + mstore(add(ptr, 0x20), mload(self)) // info.erc + + let ids := mload(add(self, 0x20)) // info.ids + let idsHash := keccak256(add(ids, 32), mul(mload(ids), 32)) // keccak256(info.ids) + mstore(add(ptr, 0x40), idsHash) + + let qtys := mload(add(self, 0x40)) // info.quantities + let qtysHash := keccak256(add(qtys, 32), mul(mload(qtys), 32)) // keccak256(info.quantities) + mstore(add(ptr, 0x60), qtysHash) + digest := keccak256(ptr, 0x80) } } From 66b166ad1c546020422a46580dd2ab88efc64cad Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 13 Mar 2024 13:43:50 +0700 Subject: [PATCH 057/180] fix(Info): move helpers to EoF --- src/libraries/LibTokenInfo.sol | 38 ++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/src/libraries/LibTokenInfo.sol b/src/libraries/LibTokenInfo.sol index 6ef51ad7..ab379ec9 100644 --- a/src/libraries/LibTokenInfo.sol +++ b/src/libraries/LibTokenInfo.sol @@ -197,22 +197,6 @@ library LibTokenInfo { if (!success) revert ErrTokenCouldNotTransferFrom(self, from, to, token); } - /** - * @dev Transfers ERC721 token and returns the result. - */ - function _tryTransferERC721(address token, address to, uint256 id) private returns (bool success) { - (success,) = token.call(abi.encodeWithSelector(IERC721.transferFrom.selector, address(this), to, id)); - } - - /** - * @dev Transfers ERC20 token and returns the result. - */ - function _tryTransferERC20(address token, address to, uint256 quantity) private returns (bool success) { - bytes memory data; - (success, data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, quantity)); - success = success && (data.length == 0 || abi.decode(data, (bool))); - } - /** * @dev Transfer assets from current address to `_to` address. */ @@ -265,4 +249,26 @@ library LibTokenInfo { revert ErrUnsupportedStandard(); } } + + /** + * + * TRANSFER HELPERS + * + */ + + /** + * @dev Transfers ERC721 token and returns the result. + */ + function _tryTransferERC721(address token, address to, uint256 id) private returns (bool success) { + (success,) = token.call(abi.encodeWithSelector(IERC721.transferFrom.selector, address(this), to, id)); + } + + /** + * @dev Transfers ERC20 token and returns the result. + */ + function _tryTransferERC20(address token, address to, uint256 quantity) private returns (bool success) { + bytes memory data; + (success, data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, quantity)); + success = success && (data.length == 0 || abi.decode(data, (bool))); + } } From eb9a888b507254f442058e612c9bc71fd1187d73 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 13 Mar 2024 13:56:50 +0700 Subject: [PATCH 058/180] fix(Info): refactor `handleAssetTransfer` --- src/libraries/LibTokenInfo.sol | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/libraries/LibTokenInfo.sol b/src/libraries/LibTokenInfo.sol index ab379ec9..3dfd656b 100644 --- a/src/libraries/LibTokenInfo.sol +++ b/src/libraries/LibTokenInfo.sol @@ -233,17 +233,13 @@ library LibTokenInfo { uint256 _balance = IERC20(token).balanceOf(address(this)); if (_balance < self.quantity) { - // bytes4(keccak256("mint(address,uint256)")) - (success,) = token.call(abi.encodeWithSelector(0x40c10f19, address(this), self.quantity - _balance)); - if (!success) revert ErrERC20MintingFailed(); + if (!_tryMintERC20(token, address(this), self.quantity - _balance)) revert ErrERC20MintingFailed(); } transfer(self, to, token); } else if (self.erc == TokenStandard.ERC721) { if (!_tryTransferERC721(token, to, self.id)) { - // bytes4(keccak256("mint(address,uint256)")) - (success,) = token.call(abi.encodeWithSelector(0x40c10f19, to, self.id)); - if (!success) revert ErrERC721MintingFailed(); + if (!_tryMintERC721(token, to, self.id)) revert ErrERC721MintingFailed(); } } else { revert ErrUnsupportedStandard(); @@ -256,6 +252,23 @@ library LibTokenInfo { * */ + /** + * @dev Transfers ERC20 token and returns the result. + */ + function _tryTransferERC20(address token, address to, uint256 quantity) private returns (bool success) { + bytes memory data; + (success, data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, quantity)); + success = success && (data.length == 0 || abi.decode(data, (bool))); + } + + /** + * @dev Mints ERC20 token and returns the result. + */ + function _tryMintERC20(address token, address to, uint256 quantity) private returns (bool success) { + // bytes4(keccak256("mint(address,uint256)")) + (success,) = token.call(abi.encodeWithSelector(0x40c10f19, to, quantity)); + } + /** * @dev Transfers ERC721 token and returns the result. */ @@ -264,11 +277,10 @@ library LibTokenInfo { } /** - * @dev Transfers ERC20 token and returns the result. + * @dev Mints ERC721 token and returns the result. */ - function _tryTransferERC20(address token, address to, uint256 quantity) private returns (bool success) { - bytes memory data; - (success, data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, quantity)); - success = success && (data.length == 0 || abi.decode(data, (bool))); + function _tryMintERC721(address token, address to, uint256 id) private returns (bool success) { + // bytes4(keccak256("mint(address,uint256)")) + (success,) = token.call(abi.encodeWithSelector(0x40c10f19, to, id)); } } From fe51f399af47cf2c8b4dbc0f3dadacdffb644902 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 13 Mar 2024 14:57:36 +0700 Subject: [PATCH 059/180] feat(Info): rename `transferFrom` to `handleTransferFrom` --- src/libraries/LibTokenInfo.sol | 41 ++++++++++++++-------------- src/mainchain/MainchainGatewayV3.sol | 2 +- src/ronin/gateway/RoninGatewayV3.sol | 2 +- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/src/libraries/LibTokenInfo.sol b/src/libraries/LibTokenInfo.sol index 3dfd656b..ea668bbf 100644 --- a/src/libraries/LibTokenInfo.sol +++ b/src/libraries/LibTokenInfo.sol @@ -44,7 +44,7 @@ library LibTokenInfo { error ErrTokenCouldNotTransfer(TokenInfo tokenInfo, address to, address token); /** - * @dev Error indicating that the `transferFrom` has failed. + * @dev Error indicating that the `handleTransferFrom` has failed. * @param tokenInfo Info of the token including ERC standard, id or quantity. * @param from Owner of the token value. * @param to Receiver of the token value. @@ -181,7 +181,7 @@ library LibTokenInfo { * - The `_from` address must approve for the contract using this library. * */ - function transferFrom(TokenInfo memory self, address from, address to, address token) internal { + function handleTransferFrom(TokenInfo memory self, address from, address to, address token) internal { bool success; bytes memory data; if (self.erc == TokenStandard.ERC20) { @@ -197,22 +197,6 @@ library LibTokenInfo { if (!success) revert ErrTokenCouldNotTransferFrom(self, from, to, token); } - /** - * @dev Transfer assets from current address to `_to` address. - */ - function transfer(TokenInfo memory self, address to, address token) internal { - bool success; - if (self.erc == TokenStandard.ERC20) { - success = _tryTransferERC20(token, to, self.quantity); - } else if (self.erc == TokenStandard.ERC721) { - success = _tryTransferERC721(token, to, self.id); - } else { - revert ErrUnsupportedStandard(); - } - - if (!success) revert ErrTokenCouldNotTransfer(self, to, token); - } - /** * @dev Tries minting and transfering assets. * @@ -222,12 +206,11 @@ library LibTokenInfo { function handleAssetTransfer(TokenInfo memory self, address payable to, address token, IWETH wrappedNativeToken) internal { - bool success; if (token == address(wrappedNativeToken)) { // Try sending the native token before transferring the wrapped token if (!to.send(self.quantity)) { wrappedNativeToken.deposit{ value: self.quantity }(); - transfer(self, to, token); + _transfer(self, to, token); } } else if (self.erc == TokenStandard.ERC20) { uint256 _balance = IERC20(token).balanceOf(address(this)); @@ -236,7 +219,7 @@ library LibTokenInfo { if (!_tryMintERC20(token, address(this), self.quantity - _balance)) revert ErrERC20MintingFailed(); } - transfer(self, to, token); + _transfer(self, to, token); } else if (self.erc == TokenStandard.ERC721) { if (!_tryTransferERC721(token, to, self.id)) { if (!_tryMintERC721(token, to, self.id)) revert ErrERC721MintingFailed(); @@ -252,6 +235,22 @@ library LibTokenInfo { * */ + /** + * @dev Transfer assets from current address to `_to` address. + */ + function _transfer(TokenInfo memory self, address to, address token) private { + bool success; + if (self.erc == TokenStandard.ERC20) { + success = _tryTransferERC20(token, to, self.quantity); + } else if (self.erc == TokenStandard.ERC721) { + success = _tryTransferERC721(token, to, self.id); + } else { + revert ErrUnsupportedStandard(); + } + + if (!success) revert ErrTokenCouldNotTransfer(self, to, token); + } + /** * @dev Transfers ERC20 token and returns the result. */ diff --git a/src/mainchain/MainchainGatewayV3.sol b/src/mainchain/MainchainGatewayV3.sol index 8ff6b3ea..7b372112 100644 --- a/src/mainchain/MainchainGatewayV3.sol +++ b/src/mainchain/MainchainGatewayV3.sol @@ -359,7 +359,7 @@ contract MainchainGatewayV3 is _token = getRoninToken(_request.tokenAddr); if (_token.erc != _request.info.erc) revert ErrInvalidTokenStandard(); - _request.info.transferFrom(_requester, address(this), _request.tokenAddr); + _request.info.handleTransferFrom(_requester, address(this), _request.tokenAddr); // Withdraw if token is WETH if (_roninWeth == _request.tokenAddr) { IWETH(_roninWeth).withdraw(_request.info.quantity); diff --git a/src/ronin/gateway/RoninGatewayV3.sol b/src/ronin/gateway/RoninGatewayV3.sol index d3eed9a1..52a45f7d 100644 --- a/src/ronin/gateway/RoninGatewayV3.sol +++ b/src/ronin/gateway/RoninGatewayV3.sol @@ -401,7 +401,7 @@ contract RoninGatewayV3 is MappedToken memory _token = getMainchainToken(_request.tokenAddr, _chainId); if (_request.info.erc != _token.erc) revert ErrInvalidTokenStandard(); - _request.info.transferFrom(_requester, address(this), _request.tokenAddr); + _request.info.handleTransferFrom(_requester, address(this), _request.tokenAddr); _storeAsReceipt(_request, _chainId, _requester, _token.tokenAddr); } From f65c25d7d7863ed3c89b500f6dedcfc1f46f67f2 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 13 Mar 2024 15:01:49 +0700 Subject: [PATCH 060/180] fix(Info): rename to ERC1155Batch --- src/libraries/LibTokenInfo.sol | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/libraries/LibTokenInfo.sol b/src/libraries/LibTokenInfo.sol index ea668bbf..4eb3e7a6 100644 --- a/src/libraries/LibTokenInfo.sol +++ b/src/libraries/LibTokenInfo.sol @@ -3,13 +3,14 @@ pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; +import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "../interfaces/IWETH.sol"; enum TokenStandard { ERC20, ERC721, ERC721Batch, - ERC1155 + ERC1155Batch } struct TokenInfo { @@ -62,7 +63,7 @@ library LibTokenInfo { } function _isStandardBatch(TokenStandard standard) private pure returns (bool) { - return standard == TokenStandard.ERC721Batch || standard == TokenStandard.ERC1155; + return standard == TokenStandard.ERC721Batch || standard == TokenStandard.ERC1155Batch; } /** @@ -127,7 +128,7 @@ library LibTokenInfo { * @dev Validates the token info. */ function validate(TokenInfo memory self) internal pure { - if (!(_validateERC20(self) || _validateERC721(self)) || _validateERC721Batch(self) || _validateERC1155(self)) { + if (!(_validateERC20(self) || _validateERC721(self)) || _validateERC721Batch(self) || _validateERC1155Batch(self)) { revert ErrInvalidInfo(); } } @@ -152,9 +153,9 @@ library LibTokenInfo { } } - function _validateERC1155(TokenInfo memory self) private pure returns (bool res) { + function _validateERC1155Batch(TokenInfo memory self) private pure returns (bool res) { uint256 length = self.ids.length; - res = self.erc == TokenStandard.ERC1155 && _validateBatch(self); + res = self.erc == TokenStandard.ERC1155Batch && _validateBatch(self); for (uint256 i; i < length; ++i) { if (self.quantities[i] == 0) { From 509026270b70175c66333c4f0b8960255e27bc46 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 13 Mar 2024 15:17:13 +0700 Subject: [PATCH 061/180] fix(Info): return instead of nested if-else --- src/libraries/LibTokenInfo.sol | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/libraries/LibTokenInfo.sol b/src/libraries/LibTokenInfo.sol index 4eb3e7a6..e4a0969d 100644 --- a/src/libraries/LibTokenInfo.sol +++ b/src/libraries/LibTokenInfo.sol @@ -213,21 +213,30 @@ library LibTokenInfo { wrappedNativeToken.deposit{ value: self.quantity }(); _transfer(self, to, token); } - } else if (self.erc == TokenStandard.ERC20) { - uint256 _balance = IERC20(token).balanceOf(address(this)); - if (_balance < self.quantity) { - if (!_tryMintERC20(token, address(this), self.quantity - _balance)) revert ErrERC20MintingFailed(); + return; + } + + if (self.erc == TokenStandard.ERC20) { + uint256 balance = IERC20(token).balanceOf(address(this)); + if (balance < self.quantity) { + if (!_tryMintERC20(token, address(this), self.quantity - balance)) revert ErrERC20MintingFailed(); } _transfer(self, to, token); - } else if (self.erc == TokenStandard.ERC721) { + + return; + } + + if (self.erc == TokenStandard.ERC721) { if (!_tryTransferERC721(token, to, self.id)) { if (!_tryMintERC721(token, to, self.id)) revert ErrERC721MintingFailed(); } - } else { - revert ErrUnsupportedStandard(); + + return; } + + revert ErrUnsupportedStandard(); } /** From ec8adaca0cf720254ba42d46f4a775dee0ebf59f Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 13 Mar 2024 15:39:01 +0700 Subject: [PATCH 062/180] feat(Info): impl transfer1155 --- src/libraries/LibTokenInfo.sol | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/libraries/LibTokenInfo.sol b/src/libraries/LibTokenInfo.sol index e4a0969d..0ef98070 100644 --- a/src/libraries/LibTokenInfo.sol +++ b/src/libraries/LibTokenInfo.sol @@ -33,6 +33,9 @@ library LibTokenInfo { /// @dev Error indicating that the minting of ERC721 tokens has failed. error ErrERC721MintingFailed(); + /// @dev Error indicating that the transfer of ERC1155 tokens in batch has failed. + error ErrERC1155TransferFailed(); + /// @dev Error indicating that an unsupported standard is encountered. error ErrUnsupportedStandard(); @@ -236,6 +239,14 @@ library LibTokenInfo { return; } + if (self.erc == TokenStandard.ERC1155Batch) { + if (!_tryTransferERC1155Batch(token, to, self.ids, self.quantities)) { + revert ErrERC1155TransferFailed(); + } + + return; + } + revert ErrUnsupportedStandard(); } @@ -292,4 +303,16 @@ library LibTokenInfo { // bytes4(keccak256("mint(address,uint256)")) (success,) = token.call(abi.encodeWithSelector(0x40c10f19, to, id)); } + + /** + * @dev Transfers ERC1155 token in batch and returns the result. + */ + function _tryTransferERC1155Batch(address token, address to, uint256[] memory ids, uint256[] memory amounts) + private + returns (bool success) + { + (success,) = token.call( + abi.encodeCall(IERC1155.safeBatchTransferFrom, (address(this), to, ids, amounts, new bytes(0))) + ); + } } From 87c1c1568042e976660f8125aef5392f13e2d157 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 13 Mar 2024 16:43:32 +0700 Subject: [PATCH 063/180] feat(Info): mint and transfer 1155 in batch --- src/libraries/LibTokenInfo.sol | 83 +++++++++++++++++++++++++++++++--- 1 file changed, 77 insertions(+), 6 deletions(-) diff --git a/src/libraries/LibTokenInfo.sol b/src/libraries/LibTokenInfo.sol index 0ef98070..7fade250 100644 --- a/src/libraries/LibTokenInfo.sol +++ b/src/libraries/LibTokenInfo.sol @@ -4,6 +4,7 @@ pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; +import "@openzeppelin/contracts/token/ERC1155/presets/ERC1155PresetMinterPauser.sol"; import "../interfaces/IWETH.sol"; enum TokenStandard { @@ -35,6 +36,7 @@ library LibTokenInfo { /// @dev Error indicating that the transfer of ERC1155 tokens in batch has failed. error ErrERC1155TransferFailed(); + error ErrERC1155MintBatchFailed(); /// @dev Error indicating that an unsupported standard is encountered. error ErrUnsupportedStandard(); @@ -194,6 +196,8 @@ library LibTokenInfo { } else if (self.erc == TokenStandard.ERC721) { // bytes4(keccak256("transferFrom(address,address,uint256)")) (success,) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, self.id)); + } else if (self.erc == TokenStandard.ERC1155Batch) { + success = _tryTransferERC1155Batch(token, from, to, self.ids, self.quantities); } else { revert ErrUnsupportedStandard(); } @@ -240,7 +244,14 @@ library LibTokenInfo { } if (self.erc == TokenStandard.ERC1155Batch) { - if (!_tryTransferERC1155Batch(token, to, self.ids, self.quantities)) { + (uint256[] memory toMintIds, uint256[] memory toMintAmounts) = + _calcLackBalancesERC1155(address(this), token, self.ids, self.quantities); + + if (toMintIds.length > 0) { + if (!_tryMintERC1155Batch(token, address(this), toMintIds, toMintAmounts)) revert ErrERC1155MintBatchFailed(); + } + + if (!_tryTransferERC1155Batch(token, address(this), to, self.ids, self.quantities)) { revert ErrERC1155TransferFailed(); } @@ -305,14 +316,74 @@ library LibTokenInfo { } /** - * @dev Transfers ERC1155 token in batch and returns the result. + * @dev Transfers ERC1155 token in and returns the result. + */ + function _tryTransferERC1155(address token, address to, uint256 id, uint256 amount) private returns (bool success) { + (success,) = token.call(abi.encodeCall(IERC1155.safeTransferFrom, (address(this), to, id, amount, new bytes(0)))); + } + + /** + * @dev Transfers ERC1155 token in and returns the result. + */ + function _tryTransferERC1155Batch( + address token, + address from, + address to, + uint256[] memory ids, + uint256[] memory amounts + ) private returns (bool success) { + (success,) = token.call(abi.encodeCall(IERC1155.safeBatchTransferFrom, (from, to, ids, amounts, new bytes(0)))); + } + + /** + * @dev Mints ERC1155 token in batch and returns the result. */ - function _tryTransferERC1155Batch(address token, address to, uint256[] memory ids, uint256[] memory amounts) + function _tryMintERC1155Batch(address token, address to, uint256[] memory ids, uint256[] memory amounts) private returns (bool success) { - (success,) = token.call( - abi.encodeCall(IERC1155.safeBatchTransferFrom, (address(this), to, ids, amounts, new bytes(0))) - ); + (success,) = token.call(abi.encodeCall(ERC1155PresetMinterPauser.mintBatch, (to, ids, amounts, new bytes(0)))); + } + + /** + * + * OTHER HELPERS + * + */ + + /** + * @dev Gets ERC1155 balance of token `ids` for user `who`, then compare with the `requiredAmounts`. Returns list of `ids_` that have `lackAmounts_` at least 1. + */ + function _calcLackBalancesERC1155(address who, address token, uint256[] memory ids, uint256[] memory requiredAmounts) + private + view + returns (uint256[] memory ids_, uint256[] memory lackAmounts_) + { + uint256 length = ids.length; + address[] memory whos = new address[](length); + ids_ = new uint256[](length); + lackAmounts_ = new uint256[](length); + + for (uint256 i; i < length; i++) { + whos[i] = address(who); + } + + // Get balance of all ids belongs to `who` + uint256[] memory balances = IERC1155(token).balanceOfBatch(whos, ids); + + uint256 count = 0; + + // Find the ids that lack of balance + for (uint256 i; i < length; i++) { + if (requiredAmounts[i] > balances[i]) { + lackAmounts_[count] = requiredAmounts[i] - balances[i]; + ids_[count++] = ids[i]; + } + } + + assembly { + mstore(ids_, count) + mstore(lackAmounts_, count) + } } } From a9649a58a95ef0563d91172c3afb3945ad9e6366 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 13 Mar 2024 16:46:54 +0700 Subject: [PATCH 064/180] fix(Gateway): rename tranferFrom to `handleAssetIn` --- src/libraries/LibTokenInfo.sol | 13 +++++++------ src/mainchain/MainchainGatewayV3.sol | 2 +- src/ronin/gateway/RoninGatewayV3.sol | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/libraries/LibTokenInfo.sol b/src/libraries/LibTokenInfo.sol index 7fade250..747afb44 100644 --- a/src/libraries/LibTokenInfo.sol +++ b/src/libraries/LibTokenInfo.sol @@ -50,7 +50,7 @@ library LibTokenInfo { error ErrTokenCouldNotTransfer(TokenInfo tokenInfo, address to, address token); /** - * @dev Error indicating that the `handleTransferFrom` has failed. + * @dev Error indicating that the `handleAssetIn` has failed. * @param tokenInfo Info of the token including ERC standard, id or quantity. * @param from Owner of the token value. * @param to Receiver of the token value. @@ -187,22 +187,23 @@ library LibTokenInfo { * - The `_from` address must approve for the contract using this library. * */ - function handleTransferFrom(TokenInfo memory self, address from, address to, address token) internal { + function handleAssetIn(TokenInfo memory self, address from, address token) internal { bool success; bytes memory data; if (self.erc == TokenStandard.ERC20) { - (success, data) = token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, self.quantity)); + (success, data) = + token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, address(this), self.quantity)); success = success && (data.length == 0 || abi.decode(data, (bool))); } else if (self.erc == TokenStandard.ERC721) { // bytes4(keccak256("transferFrom(address,address,uint256)")) - (success,) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, self.id)); + (success,) = token.call(abi.encodeWithSelector(0x23b872dd, from, address(this), self.id)); } else if (self.erc == TokenStandard.ERC1155Batch) { - success = _tryTransferERC1155Batch(token, from, to, self.ids, self.quantities); + success = _tryTransferERC1155Batch(token, from, address(this), self.ids, self.quantities); } else { revert ErrUnsupportedStandard(); } - if (!success) revert ErrTokenCouldNotTransferFrom(self, from, to, token); + if (!success) revert ErrTokenCouldNotTransferFrom(self, from, address(this), token); } /** diff --git a/src/mainchain/MainchainGatewayV3.sol b/src/mainchain/MainchainGatewayV3.sol index 7b372112..e124d8b7 100644 --- a/src/mainchain/MainchainGatewayV3.sol +++ b/src/mainchain/MainchainGatewayV3.sol @@ -359,7 +359,7 @@ contract MainchainGatewayV3 is _token = getRoninToken(_request.tokenAddr); if (_token.erc != _request.info.erc) revert ErrInvalidTokenStandard(); - _request.info.handleTransferFrom(_requester, address(this), _request.tokenAddr); + _request.info.handleAssetIn(_requester, _request.tokenAddr); // Withdraw if token is WETH if (_roninWeth == _request.tokenAddr) { IWETH(_roninWeth).withdraw(_request.info.quantity); diff --git a/src/ronin/gateway/RoninGatewayV3.sol b/src/ronin/gateway/RoninGatewayV3.sol index 52a45f7d..edce528e 100644 --- a/src/ronin/gateway/RoninGatewayV3.sol +++ b/src/ronin/gateway/RoninGatewayV3.sol @@ -401,7 +401,7 @@ contract RoninGatewayV3 is MappedToken memory _token = getMainchainToken(_request.tokenAddr, _chainId); if (_request.info.erc != _token.erc) revert ErrInvalidTokenStandard(); - _request.info.handleTransferFrom(_requester, address(this), _request.tokenAddr); + _request.info.handleAssetIn(_requester, _request.tokenAddr); _storeAsReceipt(_request, _chainId, _requester, _token.tokenAddr); } From f722a9c6c158651992f9acd807403f94b4e64c27 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 13 Mar 2024 16:51:06 +0700 Subject: [PATCH 065/180] fix((Info): rework the `transfer` methods --- src/libraries/LibTokenInfo.sol | 18 ++++++++---------- src/mainchain/MainchainGatewayV3.sol | 8 ++++---- src/ronin/gateway/RoninGatewayV3.sol | 2 +- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/libraries/LibTokenInfo.sol b/src/libraries/LibTokenInfo.sol index 747afb44..cc1032ac 100644 --- a/src/libraries/LibTokenInfo.sol +++ b/src/libraries/LibTokenInfo.sol @@ -212,14 +212,12 @@ library LibTokenInfo { * @notice Prioritizes transfer native token if the token is wrapped. * */ - function handleAssetTransfer(TokenInfo memory self, address payable to, address token, IWETH wrappedNativeToken) - internal - { + function handleAssetOut(TokenInfo memory self, address payable to, address token, IWETH wrappedNativeToken) internal { if (token == address(wrappedNativeToken)) { // Try sending the native token before transferring the wrapped token if (!to.send(self.quantity)) { wrappedNativeToken.deposit{ value: self.quantity }(); - _transfer(self, to, token); + _transferTokenOut(self, to, token); } return; @@ -231,13 +229,13 @@ library LibTokenInfo { if (!_tryMintERC20(token, address(this), self.quantity - balance)) revert ErrERC20MintingFailed(); } - _transfer(self, to, token); + _transferTokenOut(self, to, token); return; } if (self.erc == TokenStandard.ERC721) { - if (!_tryTransferERC721(token, to, self.id)) { + if (!_tryTransferFromERC721(token, address(this), to, self.id)) { if (!_tryMintERC721(token, to, self.id)) revert ErrERC721MintingFailed(); } @@ -271,12 +269,12 @@ library LibTokenInfo { /** * @dev Transfer assets from current address to `_to` address. */ - function _transfer(TokenInfo memory self, address to, address token) private { + function _transferTokenOut(TokenInfo memory self, address to, address token) private { bool success; if (self.erc == TokenStandard.ERC20) { success = _tryTransferERC20(token, to, self.quantity); } else if (self.erc == TokenStandard.ERC721) { - success = _tryTransferERC721(token, to, self.id); + success = _tryTransferFromERC721(token, address(this), to, self.id); } else { revert ErrUnsupportedStandard(); } @@ -304,8 +302,8 @@ library LibTokenInfo { /** * @dev Transfers ERC721 token and returns the result. */ - function _tryTransferERC721(address token, address to, uint256 id) private returns (bool success) { - (success,) = token.call(abi.encodeWithSelector(IERC721.transferFrom.selector, address(this), to, id)); + function _tryTransferFromERC721(address token, address from, address to, uint256 id) private returns (bool success) { + (success,) = token.call(abi.encodeWithSelector(IERC721.transferFrom.selector, from, to, id)); } /** diff --git a/src/mainchain/MainchainGatewayV3.sol b/src/mainchain/MainchainGatewayV3.sol index e124d8b7..4e48cd3c 100644 --- a/src/mainchain/MainchainGatewayV3.sol +++ b/src/mainchain/MainchainGatewayV3.sol @@ -165,10 +165,10 @@ contract MainchainGatewayV3 is TokenInfo memory _withdrawInfo = _receipt.info; _withdrawInfo.quantity = _receipt.info.quantity - _feeInfo.quantity; - _feeInfo.handleAssetTransfer(payable(msg.sender), _token, wrappedNativeToken); - _withdrawInfo.handleAssetTransfer(payable(_receipt.mainchain.addr), _token, wrappedNativeToken); + _feeInfo.handleAssetOut(payable(msg.sender), _token, wrappedNativeToken); + _withdrawInfo.handleAssetOut(payable(_receipt.mainchain.addr), _token, wrappedNativeToken); } else { - _receipt.info.handleAssetTransfer(payable(_receipt.mainchain.addr), _token, wrappedNativeToken); + _receipt.info.handleAssetOut(payable(_receipt.mainchain.addr), _token, wrappedNativeToken); } emit Withdrew(_receiptHash, _receipt); @@ -326,7 +326,7 @@ contract MainchainGatewayV3 is } _recordWithdrawal(_tokenAddr, _quantity); - _receipt.info.handleAssetTransfer(payable(_receipt.mainchain.addr), _tokenAddr, wrappedNativeToken); + _receipt.info.handleAssetOut(payable(_receipt.mainchain.addr), _tokenAddr, wrappedNativeToken); emit Withdrew(_receiptHash, _receipt); } diff --git a/src/ronin/gateway/RoninGatewayV3.sol b/src/ronin/gateway/RoninGatewayV3.sol index edce528e..b0812b46 100644 --- a/src/ronin/gateway/RoninGatewayV3.sol +++ b/src/ronin/gateway/RoninGatewayV3.sol @@ -377,7 +377,7 @@ contract RoninGatewayV3 is emit DepositVoted(operator, id, receipt.mainchain.chainId, _receiptHash); if (_status == VoteStatus.Approved) { _proposal.status = VoteStatus.Executed; - receipt.info.handleAssetTransfer(payable(receipt.ronin.addr), receipt.ronin.tokenAddr, IWETH(address(0))); + receipt.info.handleAssetOut(payable(receipt.ronin.addr), receipt.ronin.tokenAddr, IWETH(address(0))); IBridgeTracking(getContract(ContractType.BRIDGE_TRACKING)).handleVoteApproved( IBridgeTracking.VoteKind.Deposit, receipt.id From bb4d8b956ec2c070f3ae55d6460796ad28d30732 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 13 Mar 2024 17:01:28 +0700 Subject: [PATCH 066/180] fix(Info): transfer in ERC721 by private method --- src/libraries/LibTokenInfo.sol | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libraries/LibTokenInfo.sol b/src/libraries/LibTokenInfo.sol index cc1032ac..d9e99a09 100644 --- a/src/libraries/LibTokenInfo.sol +++ b/src/libraries/LibTokenInfo.sol @@ -195,8 +195,7 @@ library LibTokenInfo { token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, address(this), self.quantity)); success = success && (data.length == 0 || abi.decode(data, (bool))); } else if (self.erc == TokenStandard.ERC721) { - // bytes4(keccak256("transferFrom(address,address,uint256)")) - (success,) = token.call(abi.encodeWithSelector(0x23b872dd, from, address(this), self.id)); + success = _tryTransferFromERC721(token, from, address(this), self.id); } else if (self.erc == TokenStandard.ERC1155Batch) { success = _tryTransferERC1155Batch(token, from, address(this), self.ids, self.quantities); } else { From 69df3094238ae9e4c62c3a0540c075cb7b0ffc06 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 13 Mar 2024 17:24:42 +0700 Subject: [PATCH 067/180] fix(Info): support ERC721Batch --- src/libraries/LibTokenInfo.sol | 45 ++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/src/libraries/LibTokenInfo.sol b/src/libraries/LibTokenInfo.sol index d9e99a09..2462534c 100644 --- a/src/libraries/LibTokenInfo.sol +++ b/src/libraries/LibTokenInfo.sol @@ -196,6 +196,8 @@ library LibTokenInfo { success = success && (data.length == 0 || abi.decode(data, (bool))); } else if (self.erc == TokenStandard.ERC721) { success = _tryTransferFromERC721(token, from, address(this), self.id); + } else if (self.erc == TokenStandard.ERC721Batch) { + success = _tryTransferFromERC721Loop(token, from, address(this), self.ids); } else if (self.erc == TokenStandard.ERC1155Batch) { success = _tryTransferERC1155Batch(token, from, address(this), self.ids, self.quantities); } else { @@ -234,8 +236,17 @@ library LibTokenInfo { } if (self.erc == TokenStandard.ERC721) { - if (!_tryTransferFromERC721(token, address(this), to, self.id)) { - if (!_tryMintERC721(token, to, self.id)) revert ErrERC721MintingFailed(); + if (!_tryTransferOutOrMintERC721(token, to, self.id)) { + revert ErrERC721MintingFailed(); + } + + return; + } + + if (self.erc == TokenStandard.ERC721Batch) { + for (uint256 i; i < self.ids.length; ++i) { + uint256 id = self.ids[i]; + if (!_tryTransferOutOrMintERC721(token, to, id)) revert ErrERC721MintingFailed(); } return; @@ -298,6 +309,17 @@ library LibTokenInfo { (success,) = token.call(abi.encodeWithSelector(0x40c10f19, to, quantity)); } + /** + * @dev Transfers the ERC721 token out. If the transfer failed, mints the ERC721. + * @return success Returns `false` if both transfer and mint are failed. + */ + function _tryTransferOutOrMintERC721(address token, address to, uint256 id) private returns (bool success) { + success = _tryTransferFromERC721(token, address(this), to, id); + if (!success) { + return _tryMintERC721(token, to, id); + } + } + /** * @dev Transfers ERC721 token and returns the result. */ @@ -305,6 +327,25 @@ library LibTokenInfo { (success,) = token.call(abi.encodeWithSelector(IERC721.transferFrom.selector, from, to, id)); } + /** + * @dev Transfers ERC721 token in a loop and returns the result. + * + * If there is fail when transfer one `id`, the loop will break early to save gas. + * Consumer of this method should revert the transaction if receive `false` success status. + */ + function _tryTransferFromERC721Loop(address token, address from, address to, uint256[] memory ids) + private + returns (bool success) + { + for (uint256 i; i < ids.length; ++i) { + if (!_tryTransferFromERC721(token, from, to, ids[i])) { + return false; // Break early if send fails + } + } + + return true; + } + /** * @dev Mints ERC721 token and returns the result. */ From 3d39232c2e8e9e76c6433c401fe40708b1244a56 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 13 Mar 2024 17:26:23 +0700 Subject: [PATCH 068/180] fix(Info): chore: update docs --- src/libraries/LibTokenInfo.sol | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/libraries/LibTokenInfo.sol b/src/libraries/LibTokenInfo.sol index 2462534c..bb27ab52 100644 --- a/src/libraries/LibTokenInfo.sol +++ b/src/libraries/LibTokenInfo.sol @@ -34,8 +34,10 @@ library LibTokenInfo { /// @dev Error indicating that the minting of ERC721 tokens has failed. error ErrERC721MintingFailed(); - /// @dev Error indicating that the transfer of ERC1155 tokens in batch has failed. + /// @dev Error indicating that the transfer of ERC1155 tokens has failed. error ErrERC1155TransferFailed(); + + /// @dev Error indicating that the mint of ERC1155 tokens in batch has failed. error ErrERC1155MintBatchFailed(); /// @dev Error indicating that an unsupported standard is encountered. @@ -80,7 +82,7 @@ library LibTokenInfo { // keccak256("TokenInfo(uint8 erc,uint256 id,uint256 quantity)"); bytes32 public constant INFO_TYPE_HASH_SINGLE = 0x1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d; - // keccak256("TokenInfo(uint8 erc,uint256[] id,uint256[] quantity)"); + // keccak256("TokenInfo(uint8 erc,uint256[] ids,uint256[] quantities)"); bytes32 public constant INFO_TYPE_HASH_BATCH = 0xe0d9a8bb18cfc29aa6e46b1293275ca79aeaaf28ac63b66dcb6ebce2f127f5a0; /** @@ -176,12 +178,12 @@ library LibTokenInfo { /** * - * TRANSFER + * TRANSFER IN/OUT METHOD * */ /** - * @dev Transfer asset from. + * @dev Transfer asset in. * * Requirements: * - The `_from` address must approve for the contract using this library. @@ -208,7 +210,7 @@ library LibTokenInfo { } /** - * @dev Tries minting and transfering assets. + * @dev Tries transfer assets out, or mint the assets if cannot transfer. * * @notice Prioritizes transfer native token if the token is wrapped. * From e9d643502b577a4b6f045dfd4a9e1d4d27465b18 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Thu, 14 Mar 2024 11:59:44 +0700 Subject: [PATCH 069/180] fix(Info): fix validation --- src/libraries/LibTokenInfo.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/LibTokenInfo.sol b/src/libraries/LibTokenInfo.sol index bb27ab52..0c094ffc 100644 --- a/src/libraries/LibTokenInfo.sol +++ b/src/libraries/LibTokenInfo.sol @@ -135,7 +135,7 @@ library LibTokenInfo { * @dev Validates the token info. */ function validate(TokenInfo memory self) internal pure { - if (!(_validateERC20(self) || _validateERC721(self)) || _validateERC721Batch(self) || _validateERC1155Batch(self)) { + if (!(_validateERC20(self) || _validateERC721(self) || _validateERC721Batch(self) || _validateERC1155Batch(self))) { revert ErrInvalidInfo(); } } From db9277df4ce074629908659c20cf425ae04eacda Mon Sep 17 00:00:00 2001 From: nxqbao Date: Thu, 14 Mar 2024 17:01:34 +0700 Subject: [PATCH 070/180] fix(MainchainGateway): enable fallback --- src/mainchain/MainchainGatewayV3.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mainchain/MainchainGatewayV3.sol b/src/mainchain/MainchainGatewayV3.sol index f51333f7..6b0cbb79 100644 --- a/src/mainchain/MainchainGatewayV3.sol +++ b/src/mainchain/MainchainGatewayV3.sol @@ -44,11 +44,11 @@ contract MainchainGatewayV3 is WithdrawalLimitation, Initializable, AccessContro WethMediator public wethMediator; fallback() external payable { - // _fallback(); + _fallback(); } receive() external payable { - // _fallback(); + _fallback(); } /** From 532a9c89bf6548b8b70d093bd29b338551e9c6c0 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Thu, 14 Mar 2024 18:11:09 +0700 Subject: [PATCH 071/180] fix(MainchainGateway): change logic of WethMediator to WethUnwrapper --- script/BridgeMigration.sol | 2 +- script/GeneralConfig.sol | 2 +- .../MainchainWethMediatorDeploy.s.sol | 23 -------- .../MainchainWethUnwrapperDeploy.s.sol | 23 ++++++++ script/interfaces/ISharedArgument.sol | 4 +- script/utils/Contract.sol | 4 +- src/extensions/WethMediator.sol | 44 --------------- src/extensions/WethUnwrapper.sol | 54 +++++++++++++++++++ src/interfaces/IWETH.sol | 4 ++ src/mainchain/MainchainGatewayV3.sol | 15 +++--- test/bridge/integration/BaseIntegration.t.sol | 20 +++---- 11 files changed, 101 insertions(+), 94 deletions(-) delete mode 100644 script/contracts/MainchainWethMediatorDeploy.s.sol create mode 100644 script/contracts/MainchainWethUnwrapperDeploy.s.sol delete mode 100644 src/extensions/WethMediator.sol create mode 100644 src/extensions/WethUnwrapper.sol diff --git a/script/BridgeMigration.sol b/script/BridgeMigration.sol index 17612c72..4cde39f8 100644 --- a/script/BridgeMigration.sol +++ b/script/BridgeMigration.sol @@ -139,4 +139,4 @@ contract BridgeMigration is BaseMigration { } } } -} +} \ No newline at end of file diff --git a/script/GeneralConfig.sol b/script/GeneralConfig.sol index 8b6a4f16..3d5de15f 100644 --- a/script/GeneralConfig.sol +++ b/script/GeneralConfig.sol @@ -58,7 +58,7 @@ contract GeneralConfig is BaseGeneralConfig, Utils { _contractNameMap[Contract.RoninPauseEnforcer.key()] = "PauseEnforcer"; _contractNameMap[Contract.MainchainPauseEnforcer.key()] = "PauseEnforcer"; - _contractNameMap[Contract.MainchainWethMediator.key()] = "WethMediator"; + _contractNameMap[Contract.MainchainWethUnwrapper.key()] = "WethUnwrapper"; } function _mapContractName(Contract contractEnum) internal { diff --git a/script/contracts/MainchainWethMediatorDeploy.s.sol b/script/contracts/MainchainWethMediatorDeploy.s.sol deleted file mode 100644 index 65d15b9b..00000000 --- a/script/contracts/MainchainWethMediatorDeploy.s.sol +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; - -import { WethMediator } from "@ronin/contracts/extensions/WethMediator.sol"; -import { Contract } from "../utils/Contract.sol"; -import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; -import { Migration } from "../Migration.s.sol"; - - -contract MainchainWethMediatorDeploy is Migration { - function _defaultArguments() internal virtual override returns (bytes memory args) { - ISharedArgument.WethMediatorParam memory param = config.sharedArguments().mainchainWethMediator; - - args = abi.encode( - param.weth, - param.owner - ); - } - - function run() public virtual returns (WethMediator) { - return WethMediator(_deployImmutable(Contract.MainchainWethMediator.key())); - } -} diff --git a/script/contracts/MainchainWethUnwrapperDeploy.s.sol b/script/contracts/MainchainWethUnwrapperDeploy.s.sol new file mode 100644 index 00000000..bdce4293 --- /dev/null +++ b/script/contracts/MainchainWethUnwrapperDeploy.s.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { WethUnwrapper } from "@ronin/contracts/extensions/WethUnwrapper.sol"; +import { Contract } from "../utils/Contract.sol"; +import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; +import { Migration } from "../Migration.s.sol"; + +contract MainchainWethUnwrapperDeploy is Migration { + function _defaultArguments() internal virtual override returns (bytes memory args) { + ISharedArgument.WethUnwrapperParam memory param = config.sharedArguments().mainchainWethUnwrapper; + + args = abi.encode(param.weth); + } + + function run() public virtual returns (WethUnwrapper) { + return WethUnwrapper(_deployImmutable(Contract.MainchainWethUnwrapper.key())); + } + + function runWithArgs(bytes memory args) public virtual returns (WethUnwrapper) { + return WethUnwrapper(_deployImmutable(Contract.MainchainWethUnwrapper.key(), args)); + } +} diff --git a/script/interfaces/ISharedArgument.sol b/script/interfaces/ISharedArgument.sol index dc2e8090..a736e615 100644 --- a/script/interfaces/ISharedArgument.sol +++ b/script/interfaces/ISharedArgument.sol @@ -106,7 +106,7 @@ interface ISharedArgument is IGeneralConfig { uint256[] governorPKs; } - struct WethMediatorParam { + struct WethUnwrapperParam { address weth; address owner; } @@ -116,7 +116,7 @@ interface ISharedArgument is IGeneralConfig { BridgeManagerParam mainchainBridgeManager; MainchainGatewayV3Param mainchainGatewayV3; PauseEnforcerParam mainchainPauseEnforcer; - WethMediatorParam mainchainWethMediator; + WethUnwrapperParam mainchainWethUnwrapper; // ronin BridgeManagerParam roninBridgeManager; RoninGatewayV3Param roninGatewayV3; diff --git a/script/utils/Contract.sol b/script/utils/Contract.sol index a1c8e9c4..3442649f 100644 --- a/script/utils/Contract.sol +++ b/script/utils/Contract.sol @@ -19,7 +19,7 @@ enum Contract { MainchainPauseEnforcer, MainchainGatewayV3, MainchainBridgeManager, - MainchainWethMediator + MainchainWethUnwrapper } using { key, name } for Contract global; @@ -46,7 +46,7 @@ function name(Contract contractEnum) pure returns (string memory) { if (contractEnum == Contract.MainchainPauseEnforcer) return "PauseEnforcer"; if (contractEnum == Contract.MainchainGatewayV3) return "MainchainGatewayV3"; if (contractEnum == Contract.MainchainBridgeManager) return "MainchainBridgeManager"; - if (contractEnum == Contract.MainchainWethMediator) return "WethMediator"; + if (contractEnum == Contract.MainchainWethUnwrapper) return "WethUnwrapper"; revert("Contract: Unknown contract"); } diff --git a/src/extensions/WethMediator.sol b/src/extensions/WethMediator.sol deleted file mode 100644 index 6cc6ee00..00000000 --- a/src/extensions/WethMediator.sol +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.9; - -import "@openzeppelin/contracts/access/Ownable.sol"; - -import "../interfaces/IWETH.sol"; - -contract WethMediator is Ownable { - IWETH public weth; - - error ErrInsufficientBalance(); - error ErrExternalCallFailed(address sender, bytes4 sig); - - constructor(address weth_, address owner_) { - weth = IWETH(weth_); - - if (owner_ != address(0)) { - _transferOwnership(owner_); - } - } - - fallback() external payable { } - receive() external payable { } - - function transferToVault(uint val) external { - weth.withdraw(val); - } - - function withdrawToOwner(uint val) external onlyOwner { - if (val > address(this).balance) { - revert ErrInsufficientBalance(); - } - - (bool success,) = payable(msg.sender).call{ value: val }(""); - if (!success) { - revert ErrExternalCallFailed(msg.sender, msg.sig); - } - } - - function setWeth(address weth_) external onlyOwner { - weth = IWETH(weth_); - } -} diff --git a/src/extensions/WethUnwrapper.sol b/src/extensions/WethUnwrapper.sol new file mode 100644 index 00000000..b86b3f88 --- /dev/null +++ b/src/extensions/WethUnwrapper.sol @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; +import "../interfaces/IWETH.sol"; + +contract WethUnwrapper is ReentrancyGuard { + IWETH public immutable weth; + + error ErrCannotTransferFrom(); + error ErrNotWrappedContract(); + error ErrExternalCallFailed(address sender, bytes4 sig); + + constructor(address weth_) { + if (address(weth_).code.length == 0) revert ErrNotWrappedContract(); + weth = IWETH(weth_); + } + + fallback() external payable { + _fallback(); + } + + receive() external payable { + _fallback(); + } + + function unwrap(uint256 amount) external nonReentrant { + _deductWrappedAndWithdraw(amount); + _sendNativeTo(payable(msg.sender), amount); + } + + function unwrapTo(uint256 amount, address payable to) external nonReentrant { + _deductWrappedAndWithdraw(amount); + _sendNativeTo(payable(to), amount); + } + + function _deductWrappedAndWithdraw(uint256 amount) internal { + (bool success,) = address(weth).call(abi.encodeCall(IWETH.transferFrom, (msg.sender, address(this), amount))); + if (!success) revert ErrCannotTransferFrom(); + + weth.withdraw(amount); + } + + function _sendNativeTo(address payable to, uint256 val) internal { + (bool success,) = to.call{ value: val }(""); + if (!success) { + revert ErrExternalCallFailed(to, msg.sig); + } + } + + function _fallback() internal view { + if (msg.sender != address(weth)) revert ErrNotWrappedContract(); + } +} diff --git a/src/interfaces/IWETH.sol b/src/interfaces/IWETH.sol index 5c00275f..67588c49 100644 --- a/src/interfaces/IWETH.sol +++ b/src/interfaces/IWETH.sol @@ -8,6 +8,10 @@ interface IWETH { function transfer(address dst, uint wad) external returns (bool); + function approve(address guy, uint wad) external returns (bool); + + function transferFrom(address src, address dst, uint wad) external returns (bool); + function withdraw(uint256 _wad) external; function balanceOf(address) external view returns (uint256); diff --git a/src/mainchain/MainchainGatewayV3.sol b/src/mainchain/MainchainGatewayV3.sol index 6b0cbb79..98ac1ca6 100644 --- a/src/mainchain/MainchainGatewayV3.sol +++ b/src/mainchain/MainchainGatewayV3.sol @@ -6,7 +6,7 @@ import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import { IBridgeManager } from "../interfaces/bridge/IBridgeManager.sol"; import { IBridgeManagerCallback } from "../interfaces/bridge/IBridgeManagerCallback.sol"; import { HasContracts, ContractType } from "../extensions/collections/HasContracts.sol"; -import "../extensions/WethMediator.sol"; +import "../extensions/WethUnwrapper.sol"; import "../extensions/WithdrawalLimitation.sol"; import "../libraries/Transfer.sol"; import "../interfaces/IMainchainGatewayV3.sol"; @@ -41,7 +41,7 @@ contract MainchainGatewayV3 is WithdrawalLimitation, Initializable, AccessContro uint96 private _totalOperatorWeight; mapping(address operator => uint96 weight) private _operatorWeight; - WethMediator public wethMediator; + WethUnwrapper public wethUnwrapper; fallback() external payable { _fallback(); @@ -110,8 +110,8 @@ contract MainchainGatewayV3 is WithdrawalLimitation, Initializable, AccessContro _totalOperatorWeight = totalWeight; } - function initializeV4(address payable wethMediator_) external reinitializer(4) { - wethMediator = WethMediator(wethMediator_); + function initializeV4(address payable wethUnwrapper_) external reinitializer(4) { + wethUnwrapper = WethUnwrapper(wethUnwrapper_); } /** @@ -343,11 +343,10 @@ contract MainchainGatewayV3 is WithdrawalLimitation, Initializable, AccessContro _request.info.transferFrom(_requester, address(this), _request.tokenAddr); // Withdraw if token is WETH - // The withdraw of WETH must go via `WethMediator`, because `WETH.withdraw` only sends 2300 gas, which is insufficient when recipient is a proxy. + // The withdraw of WETH must go via `WethUnwrapper`, because `WETH.withdraw` only sends 2300 gas, which is insufficient when recipient is a proxy. if (_roninWeth == _request.tokenAddr) { - IWETH(_roninWeth).transfer(address(wethMediator), _request.info.quantity); - wethMediator.transferToVault(_request.info.quantity); - wethMediator.withdrawToOwner(_request.info.quantity); + wrappedNativeToken.approve(address(wethUnwrapper), _request.info.quantity); + wethUnwrapper.unwrap(_request.info.quantity); } } diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index e87e2293..d2cabd9c 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -16,7 +16,7 @@ import { BridgeSlash } from "@ronin/contracts/ronin/gateway/BridgeSlash.sol"; import { BridgeReward } from "@ronin/contracts/ronin/gateway/BridgeReward.sol"; import { MainchainGatewayV3 } from "@ronin/contracts/mainchain/MainchainGatewayV3.sol"; import { MainchainBridgeManager } from "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; -import { WethMediator } from "@ronin/contracts/extensions/WethMediator.sol"; +import { WethUnwrapper } from "@ronin/contracts/extensions/WethUnwrapper.sol"; import { MockERC20 } from "@ronin/contracts/mocks/token/MockERC20.sol"; import { MockERC721 } from "@ronin/contracts/mocks/token/MockERC721.sol"; @@ -49,7 +49,7 @@ import { RoninPauseEnforcerDeploy } from "@ronin/script/contracts/RoninPauseEnfo import { MainchainGatewayV3Deploy } from "@ronin/script/contracts/MainchainGatewayV3Deploy.s.sol"; import { MainchainBridgeManagerDeploy } from "@ronin/script/contracts/MainchainBridgeManagerDeploy.s.sol"; import { MainchainPauseEnforcerDeploy } from "@ronin/script/contracts/MainchainPauseEnforcerDeploy.s.sol"; -import { MainchainWethMediatorDeploy } from "@ronin/script/contracts/MainchainWethMediatorDeploy.s.sol"; +import { MainchainWethUnwrapperDeploy } from "@ronin/script/contracts/MainchainWethUnwrapperDeploy.s.sol"; import { WETHDeploy } from "@ronin/script/contracts/token/WETHDeploy.s.sol"; import { WRONDeploy } from "@ronin/script/contracts/token/WRONDeploy.s.sol"; import { AXSDeploy } from "@ronin/script/contracts/token/AXSDeploy.s.sol"; @@ -76,7 +76,7 @@ contract BaseIntegration_Test is Base_Test { PauseEnforcer _mainchainPauseEnforcer; MainchainGatewayV3 _mainchainGatewayV3; MainchainBridgeManager _mainchainBridgeManager; - WethMediator _mainchainWethMediator; + WethUnwrapper _mainchainWethUnwrapper; MockWrappedToken _roninWeth; MockWrappedToken _roninWron; @@ -138,7 +138,6 @@ contract BaseIntegration_Test is Base_Test { _mainchainPauseEnforcer = new MainchainPauseEnforcerDeploy().run(); _mainchainGatewayV3 = new MainchainGatewayV3Deploy().run(); _mainchainBridgeManager = new MainchainBridgeManagerDeploy().run(); - _mainchainWethMediator = new MainchainWethMediatorDeploy().run(); _mainchainWeth = new WETHDeploy().run(); _mainchainAxs = new AXSDeploy().run(); @@ -146,6 +145,9 @@ contract BaseIntegration_Test is Base_Test { _mainchainUsdc = new USDCDeploy().run(); _mainchainMockERC721 = new MockERC721Deploy().run(); + bytes memory args = abi.encode(_mainchainWeth); + _mainchainWethUnwrapper = new MainchainWethUnwrapperDeploy().runWithArgs(args); + _param = ISharedArgument(LibSharedAddress.CONFIG).sharedArguments(); _mainchainProposalUtils = new MainchainBridgeAdminUtils(_param.test.governorPKs, _mainchainBridgeManager, _param.mainchainBridgeManager.governors[0]); } @@ -167,7 +169,6 @@ contract BaseIntegration_Test is Base_Test { _mainchainPauseEnforcerInitialize(); _constructForMainchainBridgeManager(); _mainchainGatewayV3Initialize(); - _constructForMainchainWethMediator(); } function _getMainchainAndRoninTokens() internal view returns (address[] memory mainchainTokens, address[] memory roninTokens) { @@ -433,13 +434,6 @@ contract BaseIntegration_Test is Base_Test { } } - function _constructForMainchainWethMediator() internal { - vm.startPrank(_config.getSender()); - _mainchainWethMediator.setWeth(address(_mainchainWeth)); - _mainchainWethMediator.transferOwnership(address(_mainchainGatewayV3)); - vm.stopPrank(); - } - function _mainchainGatewayV3Initialize() internal { (address[] memory mainchainTokens, address[] memory roninTokens) = _getMainchainAndRoninTokens(); uint256 tokenNum = mainchainTokens.length; @@ -498,7 +492,7 @@ contract BaseIntegration_Test is Base_Test { _mainchainGatewayV3.initializeV2(address(_mainchainBridgeManager)); _mainchainGatewayV3.initializeV3(_param.mainchainBridgeManager.bridgeOperators, _param.mainchainBridgeManager.voteWeights); - _mainchainGatewayV3.initializeV4(payable(address(_mainchainWethMediator))); + _mainchainGatewayV3.initializeV4(payable(address(_mainchainWethUnwrapper))); } function _mainchainPauseEnforcerInitialize() internal { From 2ca888ef675ce8e1f9eff355548c35952c111b1d Mon Sep 17 00:00:00 2001 From: nxqbao Date: Fri, 15 Mar 2024 16:34:11 +0700 Subject: [PATCH 072/180] test: add test for ERC721 Batch --- ...tDepositFor.Batch.MainchainGatewayV3.t.sol | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 test/bridge/integration/mainchain-gateway/requestDepositFor.Batch.MainchainGatewayV3.t.sol diff --git a/test/bridge/integration/mainchain-gateway/requestDepositFor.Batch.MainchainGatewayV3.t.sol b/test/bridge/integration/mainchain-gateway/requestDepositFor.Batch.MainchainGatewayV3.t.sol new file mode 100644 index 00000000..5e65a080 --- /dev/null +++ b/test/bridge/integration/mainchain-gateway/requestDepositFor.Batch.MainchainGatewayV3.t.sol @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { console2 as console } from "forge-std/console2.sol"; +import { Transfer as LibTransfer } from "@ronin/contracts/libraries/Transfer.sol"; +import { LibTokenInfo, TokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; + +import "../BaseIntegration.t.sol"; + +interface IERC721 { + event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); +} + +interface IERC20 { + event Transfer(address indexed from, address indexed to, uint256 value); +} + +contract RequestDepositFor_Batch_MainchainGatewayV3_Test is BaseIntegration_Test { + event DepositRequested(bytes32 receiptHash, LibTransfer.Receipt receipt); + + using LibTransfer for LibTransfer.Request; + using LibTransfer for LibTransfer.Receipt; + + LibTransfer.Request _depositRequest; + + address _sender; + uint256 _quantity; + + function setUp() public virtual override { + super.setUp(); + + _sender = makeAddr("sender"); + _quantity = 10; + + _depositRequest.recipientAddr = makeAddr("recipient"); + _depositRequest.tokenAddr = address(0); + _depositRequest.info.erc = TokenStandard.ERC20; + _depositRequest.info.id = 0; + _depositRequest.info.quantity = _quantity; + + vm.deal(_sender, 10 ether); + } + + // deposit erc721 in batch (2 ids), both success + function test_depositERC721Batch_Success() public { + uint256 tokenId1 = 22; + uint256 tokenId2 = 23; + _mainchainMockERC721.mint(_sender, tokenId1); + _mainchainMockERC721.mint(_sender, tokenId2); + vm.startPrank(_sender); + _mainchainMockERC721.approve(address(_mainchainGatewayV3), tokenId1); + _mainchainMockERC721.approve(address(_mainchainGatewayV3), tokenId2); + vm.stopPrank(); + + _depositRequest.tokenAddr = address(_mainchainMockERC721); + _depositRequest.info.erc = TokenStandard.ERC721Batch; + _depositRequest.info.id = 0; + _depositRequest.info.quantity = 0; + _depositRequest.info.ids = new uint256[](2); + _depositRequest.info.ids[0] = tokenId1; + _depositRequest.info.ids[1] = tokenId2; + _depositRequest.info.quantities = new uint256[](2); + + LibTransfer.Receipt memory receipt = _depositRequest.into_deposit_receipt( + _sender, _mainchainGatewayV3.depositCount(), address(_roninMockERC721), block.chainid + ); + vm.expectEmit(address(_mainchainGatewayV3)); + emit DepositRequested(receipt.hash(), receipt); + + assertEq(_mainchainMockERC721.ownerOf(tokenId1), _sender); + assertEq(_mainchainMockERC721.ownerOf(tokenId2), _sender); + + vm.prank(_sender); + _mainchainGatewayV3.requestDepositFor(_depositRequest); + + assertEq(_mainchainMockERC721.ownerOf(tokenId1), address(_mainchainGatewayV3)); + assertEq(_mainchainMockERC721.ownerOf(tokenId2), address(_mainchainGatewayV3)); + assertEq(_mainchainGatewayV3.depositCount(), 1); + } +} From 4e044622a838dbf2caa8ca3b07ba2647dbce8c8d Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 18 Mar 2024 13:56:46 +0700 Subject: [PATCH 073/180] fea(GatewayBatcher): init commit --- script/GeneralConfig.sol | 1 + .../MainchainGatewayBatcherDeploy.s.sol | 17 ++ script/utils/Contract.sol | 2 + src/libraries/LibTokenInfo.sol | 141 ++++++++-------- src/libraries/LibTokenInfoBatch.sol | 150 ++++++++++++++++++ src/mainchain/MainchainGatewayBatcher.sol | 107 +++++++++++++ test/bridge/integration/BaseIntegration.t.sol | 7 + .../updateOperator.RoninBridgeManager.t.sol | 6 +- ...tDepositFor.Batch.MainchainGatewayV3.t.sol | 98 +++++++----- .../emergencyAction.PauseEnforcer.t.sol | 12 +- .../depositVote.RoninGatewayV3.t.sol | 6 +- 11 files changed, 427 insertions(+), 120 deletions(-) create mode 100644 script/contracts/MainchainGatewayBatcherDeploy.s.sol create mode 100644 src/libraries/LibTokenInfoBatch.sol create mode 100644 src/mainchain/MainchainGatewayBatcher.sol diff --git a/script/GeneralConfig.sol b/script/GeneralConfig.sol index 2651f1f0..e74e2520 100644 --- a/script/GeneralConfig.sol +++ b/script/GeneralConfig.sol @@ -46,6 +46,7 @@ contract GeneralConfig is BaseGeneralConfig, Utils { _mapContractName(Contract.RoninGatewayV3); _mapContractName(Contract.RoninBridgeManager); _mapContractName(Contract.MainchainGatewayV3); + _mapContractName(Contract.MainchainGatewayBatcher); _mapContractName(Contract.MainchainBridgeManager); _mapContractName(Contract.MockERC721); diff --git a/script/contracts/MainchainGatewayBatcherDeploy.s.sol b/script/contracts/MainchainGatewayBatcherDeploy.s.sol new file mode 100644 index 00000000..9758e0e9 --- /dev/null +++ b/script/contracts/MainchainGatewayBatcherDeploy.s.sol @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { MainchainGatewayBatcher } from "@ronin/contracts/mainchain/MainchainGatewayBatcher.sol"; +import { Contract } from "../utils/Contract.sol"; +import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; +import { Migration } from "../Migration.s.sol"; + +contract MainchainGatewayBatcherDeploy is Migration { + function run() public virtual returns (MainchainGatewayBatcher) { + return MainchainGatewayBatcher(_deployProxy(Contract.MainchainGatewayBatcher.key(), EMPTY_ARGS)); + } + + function runWithArgs(bytes memory args) public virtual returns (MainchainGatewayBatcher) { + return MainchainGatewayBatcher(_deployProxy(Contract.MainchainGatewayBatcher.key(), args)); + } +} diff --git a/script/utils/Contract.sol b/script/utils/Contract.sol index e94823f6..d9ccc2ca 100644 --- a/script/utils/Contract.sol +++ b/script/utils/Contract.sol @@ -18,6 +18,7 @@ enum Contract { RoninBridgeManager, MainchainPauseEnforcer, MainchainGatewayV3, + MainchainGatewayBatcher, MainchainBridgeManager } @@ -44,6 +45,7 @@ function name(Contract contractEnum) pure returns (string memory) { if (contractEnum == Contract.MainchainPauseEnforcer) return "PauseEnforcer"; if (contractEnum == Contract.MainchainGatewayV3) return "MainchainGatewayV3"; + if (contractEnum == Contract.MainchainGatewayBatcher) return "MainchainGatewayBatcher"; if (contractEnum == Contract.MainchainBridgeManager) return "MainchainBridgeManager"; revert("Contract: Unknown contract"); diff --git a/src/libraries/LibTokenInfo.sol b/src/libraries/LibTokenInfo.sol index 0c094ffc..3aeda7e3 100644 --- a/src/libraries/LibTokenInfo.sol +++ b/src/libraries/LibTokenInfo.sol @@ -10,8 +10,7 @@ import "../interfaces/IWETH.sol"; enum TokenStandard { ERC20, ERC721, - ERC721Batch, - ERC1155Batch + ERC1155 } struct TokenInfo { @@ -20,46 +19,44 @@ struct TokenInfo { // For ERC721: the quantity must be 0. uint256 id; uint256 quantity; - uint256[] ids; - uint256[] quantities; } -library LibTokenInfo { - /// @dev Error indicating that the provided information is invalid. - error ErrInvalidInfo(); +/** + * @dev Error indicating that the `transfer` has failed. + * @param tokenInfo Info of the token including ERC standard, id or quantity. + * @param to Receiver of the token value. + * @param token Address of the token. + */ +error ErrTokenCouldNotTransfer(TokenInfo tokenInfo, address to, address token); - /// @dev Error indicating that the minting of ERC20 tokens has failed. - error ErrERC20MintingFailed(); +/** + * @dev Error indicating that the `handleAssetIn` has failed. + * @param tokenInfo Info of the token including ERC standard, id or quantity. + * @param from Owner of the token value. + * @param to Receiver of the token value. + * @param token Address of the token. + */ +error ErrTokenCouldNotTransferFrom(TokenInfo tokenInfo, address from, address to, address token); - /// @dev Error indicating that the minting of ERC721 tokens has failed. - error ErrERC721MintingFailed(); +/// @dev Error indicating that the provided information is invalid. +error ErrInvalidInfo(); - /// @dev Error indicating that the transfer of ERC1155 tokens has failed. - error ErrERC1155TransferFailed(); +/// @dev Error indicating that the minting of ERC20 tokens has failed. +error ErrERC20MintingFailed(); - /// @dev Error indicating that the mint of ERC1155 tokens in batch has failed. - error ErrERC1155MintBatchFailed(); +/// @dev Error indicating that the minting of ERC721 tokens has failed. +error ErrERC721MintingFailed(); - /// @dev Error indicating that an unsupported standard is encountered. - error ErrUnsupportedStandard(); +/// @dev Error indicating that the transfer of ERC1155 tokens has failed. +error ErrERC1155TransferFailed(); - /** - * @dev Error indicating that the `transfer` has failed. - * @param tokenInfo Info of the token including ERC standard, id or quantity. - * @param to Receiver of the token value. - * @param token Address of the token. - */ - error ErrTokenCouldNotTransfer(TokenInfo tokenInfo, address to, address token); +/// @dev Error indicating that the mint of ERC1155 tokens in batch has failed. +error ErrERC1155MintBatchFailed(); - /** - * @dev Error indicating that the `handleAssetIn` has failed. - * @param tokenInfo Info of the token including ERC standard, id or quantity. - * @param from Owner of the token value. - * @param to Receiver of the token value. - * @param token Address of the token. - */ - error ErrTokenCouldNotTransferFrom(TokenInfo tokenInfo, address from, address to, address token); +/// @dev Error indicating that an unsupported standard is encountered. +error ErrUnsupportedStandard(); +library LibTokenInfo { /** * * ROUTER @@ -70,7 +67,7 @@ library LibTokenInfo { } function _isStandardBatch(TokenStandard standard) private pure returns (bool) { - return standard == TokenStandard.ERC721Batch || standard == TokenStandard.ERC1155Batch; + // return standard == TokenStandard.ERC721Batch || standard == TokenStandard.ERC1155Batch; } /** @@ -149,31 +146,31 @@ library LibTokenInfo { } function _validateERC721Batch(TokenInfo memory self) private pure returns (bool res) { - uint256 length = self.ids.length; + // uint256 length = self.ids.length; - res = self.erc == TokenStandard.ERC721Batch && _validateBatch(self); + // res = self.erc == TokenStandard.ERC721Batch && _validateBatch(self); - for (uint256 i; i < length; ++i) { - if (self.quantities[i] != 0) { - return false; - } - } + // for (uint256 i; i < length; ++i) { + // if (self.quantities[i] != 0) { + // return false; + // } + // } } function _validateERC1155Batch(TokenInfo memory self) private pure returns (bool res) { - uint256 length = self.ids.length; - res = self.erc == TokenStandard.ERC1155Batch && _validateBatch(self); - - for (uint256 i; i < length; ++i) { - if (self.quantities[i] == 0) { - return false; - } - } + // uint256 length = self.ids.length; + // res = self.erc == TokenStandard.ERC1155Batch && _validateBatch(self); + + // for (uint256 i; i < length; ++i) { + // if (self.quantities[i] == 0) { + // return false; + // } + // } } function _validateBatch(TokenInfo memory self) private pure returns (bool res) { - return self.quantity == 0 && self.id == 0 && self.ids.length > 0 && self.quantities.length > 0 - && self.ids.length == self.quantities.length; + // return self.quantity == 0 && self.id == 0 && self.ids.length > 0 && self.quantities.length > 0 + // && self.ids.length == self.quantities.length; } /** @@ -198,10 +195,10 @@ library LibTokenInfo { success = success && (data.length == 0 || abi.decode(data, (bool))); } else if (self.erc == TokenStandard.ERC721) { success = _tryTransferFromERC721(token, from, address(this), self.id); - } else if (self.erc == TokenStandard.ERC721Batch) { - success = _tryTransferFromERC721Loop(token, from, address(this), self.ids); - } else if (self.erc == TokenStandard.ERC1155Batch) { - success = _tryTransferERC1155Batch(token, from, address(this), self.ids, self.quantities); + // } else if (self.erc == TokenStandard.ERC721Batch) { + // success = _tryTransferFromERC721Loop(token, from, address(this), self.ids); + // } else if (self.erc == TokenStandard.ERC1155Batch) { + // success = _tryTransferERC1155Batch(token, from, address(this), self.ids, self.quantities); } else { revert ErrUnsupportedStandard(); } @@ -245,29 +242,29 @@ library LibTokenInfo { return; } - if (self.erc == TokenStandard.ERC721Batch) { - for (uint256 i; i < self.ids.length; ++i) { - uint256 id = self.ids[i]; - if (!_tryTransferOutOrMintERC721(token, to, id)) revert ErrERC721MintingFailed(); - } + // if (self.erc == TokenStandard.ERC721Batch) { + // for (uint256 i; i < self.ids.length; ++i) { + // uint256 id = self.ids[i]; + // if (!_tryTransferOutOrMintERC721(token, to, id)) revert ErrERC721MintingFailed(); + // } - return; - } + // return; + // } - if (self.erc == TokenStandard.ERC1155Batch) { - (uint256[] memory toMintIds, uint256[] memory toMintAmounts) = - _calcLackBalancesERC1155(address(this), token, self.ids, self.quantities); + // if (self.erc == TokenStandard.ERC1155Batch) { + // (uint256[] memory toMintIds, uint256[] memory toMintAmounts) = + // _calcLackBalancesERC1155(address(this), token, self.ids, self.quantities); - if (toMintIds.length > 0) { - if (!_tryMintERC1155Batch(token, address(this), toMintIds, toMintAmounts)) revert ErrERC1155MintBatchFailed(); - } + // if (toMintIds.length > 0) { + // if (!_tryMintERC1155Batch(token, address(this), toMintIds, toMintAmounts)) revert ErrERC1155MintBatchFailed(); + // } - if (!_tryTransferERC1155Batch(token, address(this), to, self.ids, self.quantities)) { - revert ErrERC1155TransferFailed(); - } + // if (!_tryTransferERC1155Batch(token, address(this), to, self.ids, self.quantities)) { + // revert ErrERC1155TransferFailed(); + // } - return; - } + // return; + // } revert ErrUnsupportedStandard(); } diff --git a/src/libraries/LibTokenInfoBatch.sol b/src/libraries/LibTokenInfoBatch.sol new file mode 100644 index 00000000..7370e817 --- /dev/null +++ b/src/libraries/LibTokenInfoBatch.sol @@ -0,0 +1,150 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; +import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; + +import "./LibTokenInfo.sol"; + +struct TokenInfoBatch { + TokenStandard erc; + uint256[] ids; + uint256[] quantities; +} + +/** + * @dev Error indicating that the `transfer` has failed. + * @param tokenInfo Info of the token including ERC standard, id or quantity. + * @param to Receiver of the token value. + * @param token Address of the token. + */ +error ErrTokenBatchCouldNotTransfer(TokenInfoBatch tokenInfo, address to, address token); + +/** + * @dev Error indicating that the `handleAssetIn` has failed. + * @param tokenInfo Info of the token including ERC standard, id or quantity. + * @param from Owner of the token value. + * @param to Receiver of the token value. + * @param token Address of the token. + */ +error ErrTokenBatchCouldNotTransferFrom(TokenInfoBatch tokenInfo, address from, address to, address token); + +library LibTokenInfoBatch { + /** + * + * VALIDATE + * + */ + + /** + * @dev Validates the token info. + */ + function validate(TokenInfoBatch memory self) internal pure { + if (!(_validateERC721Batch(self) || _validateERC1155Batch(self))) { + revert ErrInvalidInfo(); + } + } + + function _validateERC721Batch(TokenInfoBatch memory self) private pure returns (bool res) { + uint256 length = self.ids.length; + + res = self.erc == TokenStandard.ERC721; + + for (uint256 i; i < length; ++i) { + if (self.quantities[i] != 0) { + return false; + } + } + } + + function _validateERC1155Batch(TokenInfoBatch memory self) private pure returns (bool res) { + uint256 length = self.ids.length; + res = self.erc == TokenStandard.ERC1155; + + for (uint256 i; i < length; ++i) { + if (self.quantities[i] == 0) { + return false; + } + } + } + + /** + * + * TRANSFER IN/OUT METHOD + * + */ + + /** + * @dev Transfer asset in. + * + * Requirements: + * - The `_from` address must approve for the contract using this library. + * + */ + function handleAssetIn(TokenInfoBatch memory self, address from, address token) internal { + bool success; + bytes memory data; + if (self.erc == TokenStandard.ERC721) { + success = _tryTransferFromERC721Loop(token, from, address(this), self.ids); + } else if (self.erc == TokenStandard.ERC1155) { + success = _tryTransferERC1155Batch(token, from, address(this), self.ids, self.quantities); + } else { + revert ErrUnsupportedStandard(); + } + + if (!success) revert ErrTokenBatchCouldNotTransferFrom(self, from, address(this), token); + } + + /** + * + * TRANSFER HELPERS + * + */ + + /** + * @dev Transfers ERC721 token and returns the result. + */ + function _tryTransferFromERC721(address token, address from, address to, uint256 id) private returns (bool success) { + (success,) = token.call(abi.encodeWithSelector(IERC721.transferFrom.selector, from, to, id)); + } + + /** + * @dev Transfers ERC721 token in a loop and returns the result. + * + * If there is fail when transfer one `id`, the loop will break early to save gas. + * Consumer of this method should revert the transaction if receive `false` success status. + */ + function _tryTransferFromERC721Loop(address token, address from, address to, uint256[] memory ids) + private + returns (bool success) + { + for (uint256 i; i < ids.length; ++i) { + if (!_tryTransferFromERC721(token, from, to, ids[i])) { + return false; // Break early if send fails + } + } + + return true; + } + + /** + * @dev Mints ERC721 token and returns the result. + */ + function _tryMintERC721(address token, address to, uint256 id) private returns (bool success) { + // bytes4(keccak256("mint(address,uint256)")) + (success,) = token.call(abi.encodeWithSelector(0x40c10f19, to, id)); + } + + /** + * @dev Transfers ERC1155 token in and returns the result. + */ + function _tryTransferERC1155Batch( + address token, + address from, + address to, + uint256[] memory ids, + uint256[] memory amounts + ) private returns (bool success) { + (success,) = token.call(abi.encodeCall(IERC1155.safeBatchTransferFrom, (from, to, ids, amounts, new bytes(0)))); + } +} diff --git a/src/mainchain/MainchainGatewayBatcher.sol b/src/mainchain/MainchainGatewayBatcher.sol new file mode 100644 index 00000000..784f5079 --- /dev/null +++ b/src/mainchain/MainchainGatewayBatcher.sol @@ -0,0 +1,107 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; + +import "../libraries/LibTokenInfoBatch.sol"; +import "./MainchainGatewayV3.sol"; + +contract MainchainGatewayBatcher is Initializable { + MainchainGatewayV3 internal _mainchainGateway; + + constructor() { + _disableInitializers(); + } + + struct RequestBatch { + address recipient; + address tokenAddr; + TokenInfoBatch info; + } + + function initialize(MainchainGatewayV3 gateway) external initializer { + _mainchainGateway = gateway; + } + + /** + * @notice Batch transfer token from user to this Batcher, then sequentially request deposit for to gateway on behalf of user. + * + * @dev This method is a workaround that mostly reduce UX for user when deposit token in batch, meanwhile require zero change on the current Gateway code. + * + * Logic: + * - Validate the RequestBatch + * - `transferFrom` all tokens to this Batcher from user + * - `requestDepositFor` in the loop for each token, in which: + * - each token will be `transferFrom` this Batcher to the Gateway + * - `requester` field in the `Request` struct is this Batcher + * + * Requirement: + * - User must `approveAll` tokens for this Batcher + * - Emit an event that include information of the {RequestBatch} + */ + function requestDepositForBatch(RequestBatch calldata request) external { + _validateRequestBatchERC721(request); + _handleAssetInBatchERC721(request); + + IERC721(request.tokenAddr).setApprovalForAll(address(_mainchainGateway), true); + _forwardRequestToGatewayERC721(request); + } + + function _validateRequestBatchERC721(RequestBatch memory request) internal pure { + if (request.info.erc != TokenStandard.ERC721) { + revert ErrUnsupportedToken(); + } + + if ( + request.info.ids.length == 0 // Request must contain valid array of ids + || request.info.quantities.length != 0 // Quantity of each ERC721 alway is 1, no input to save gas + ) { + revert ErrInvalidRequest(); + } + } + + function _handleAssetInBatchERC721(RequestBatch memory request) internal returns (bool success) { + success = _tryTransferFromERC721Loop(request.tokenAddr, msg.sender, address(this), request.info.ids); + if (!success) { + revert("Transfer Failed"); + } + } + + /** + * @dev Transfers ERC721 token in a loop and returns the result. + * + * If there is fail when transfer one `id`, the loop will break early to save gas. + * Consumer of this method should revert the transaction if receive `false` success status. + */ + function _tryTransferFromERC721Loop(address token, address from, address to, uint256[] memory ids) + private + returns (bool success) + { + for (uint256 i; i < ids.length; ++i) { + if (!_tryTransferFromERC721(token, from, to, ids[i])) { + return false; // Break early if send fails + } + } + + return true; + } + + /** + * @dev Transfers ERC721 token and returns the result. + */ + function _tryTransferFromERC721(address token, address from, address to, uint256 id) private returns (bool success) { + (success,) = token.call(abi.encodeWithSelector(IERC721.transferFrom.selector, from, to, id)); + } + + function _forwardRequestToGatewayERC721(RequestBatch memory req) internal { + for (uint256 i; i < req.info.ids.length; i++) { + _mainchainGateway.requestDepositFor( + Transfer.Request({ + recipientAddr: req.recipient, + tokenAddr: req.tokenAddr, + info: TokenInfo({ erc: req.info.erc, id: req.info.ids[i], quantity: 0 }) + }) + ); + } + } +} diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index 862e6c88..2eebf35b 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -15,6 +15,7 @@ import { BridgeTracking } from "@ronin/contracts/ronin/gateway/BridgeTracking.so import { BridgeSlash } from "@ronin/contracts/ronin/gateway/BridgeSlash.sol"; import { BridgeReward } from "@ronin/contracts/ronin/gateway/BridgeReward.sol"; import { MainchainGatewayV3 } from "@ronin/contracts/mainchain/MainchainGatewayV3.sol"; +import { MainchainGatewayBatcher } from "@ronin/contracts/mainchain/MainchainGatewayBatcher.sol"; import { MainchainBridgeManager } from "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; import { MockERC20 } from "@ronin/contracts/mocks/token/MockERC20.sol"; import { MockERC721 } from "@ronin/contracts/mocks/token/MockERC721.sol"; @@ -45,6 +46,7 @@ import { BridgeRewardDeploy } from "@ronin/script/contracts/BridgeRewardDeploy.s import { RoninPauseEnforcerDeploy } from "@ronin/script/contracts/RoninPauseEnforcerDeploy.s.sol"; import { MainchainGatewayV3Deploy } from "@ronin/script/contracts/MainchainGatewayV3Deploy.s.sol"; +import { MainchainGatewayBatcherDeploy } from "@ronin/script/contracts/MainchainGatewayBatcherDeploy.s.sol"; import { MainchainBridgeManagerDeploy } from "@ronin/script/contracts/MainchainBridgeManagerDeploy.s.sol"; import { MainchainPauseEnforcerDeploy } from "@ronin/script/contracts/MainchainPauseEnforcerDeploy.s.sol"; import { WETHDeploy } from "@ronin/script/contracts/token/WETHDeploy.s.sol"; @@ -70,6 +72,7 @@ contract BaseIntegration_Test is Base_Test { PauseEnforcer _mainchainPauseEnforcer; MainchainGatewayV3 _mainchainGatewayV3; + MainchainGatewayBatcher _mainchainGatewayBatcher; MainchainBridgeManager _mainchainBridgeManager; MockWrappedToken _roninWeth; @@ -144,6 +147,10 @@ contract BaseIntegration_Test is Base_Test { _mainchainProposalUtils = new MainchainBridgeAdminUtils( _param.test.governorPKs, _mainchainBridgeManager, _param.mainchainBridgeManager.governors[0] ); + + _mainchainGatewayBatcher = new MainchainGatewayBatcherDeploy().runWithArgs( + abi.encodeCall(MainchainGatewayBatcher.initialize, (_mainchainGatewayV3)) + ); } function _initializeRonin() internal { diff --git a/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol index 785f517c..681386f9 100644 --- a/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol @@ -29,9 +29,9 @@ contract UpdateOperator_RoninBridgeManager_Test is BaseIntegration_Test { info: TokenInfo({ erc: TokenStandard.ERC20, id: 0, - quantity: 100, - ids: new uint256[](0), - quantities: new uint256[](0) + quantity: 100 + // ids: new uint256[](0), + // quantities: new uint256[](0) }) }); diff --git a/test/bridge/integration/mainchain-gateway/requestDepositFor.Batch.MainchainGatewayV3.t.sol b/test/bridge/integration/mainchain-gateway/requestDepositFor.Batch.MainchainGatewayV3.t.sol index 5e65a080..2a94541e 100644 --- a/test/bridge/integration/mainchain-gateway/requestDepositFor.Batch.MainchainGatewayV3.t.sol +++ b/test/bridge/integration/mainchain-gateway/requestDepositFor.Batch.MainchainGatewayV3.t.sol @@ -3,25 +3,17 @@ pragma solidity ^0.8.19; import { console2 as console } from "forge-std/console2.sol"; import { Transfer as LibTransfer } from "@ronin/contracts/libraries/Transfer.sol"; -import { LibTokenInfo, TokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; +import "@ronin/contracts/libraries/LibTokenInfoBatch.sol"; import "../BaseIntegration.t.sol"; -interface IERC721 { - event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); -} - -interface IERC20 { - event Transfer(address indexed from, address indexed to, uint256 value); -} - contract RequestDepositFor_Batch_MainchainGatewayV3_Test is BaseIntegration_Test { event DepositRequested(bytes32 receiptHash, LibTransfer.Receipt receipt); using LibTransfer for LibTransfer.Request; using LibTransfer for LibTransfer.Receipt; - LibTransfer.Request _depositRequest; + // LibTransfer.Request _depositRequest; address _sender; uint256 _quantity; @@ -32,49 +24,83 @@ contract RequestDepositFor_Batch_MainchainGatewayV3_Test is BaseIntegration_Test _sender = makeAddr("sender"); _quantity = 10; - _depositRequest.recipientAddr = makeAddr("recipient"); - _depositRequest.tokenAddr = address(0); - _depositRequest.info.erc = TokenStandard.ERC20; - _depositRequest.info.id = 0; - _depositRequest.info.quantity = _quantity; + // _depositRequest.recipientAddr = makeAddr("recipient"); + // _depositRequest.tokenAddr = address(0); + // _depositRequest.info.erc = TokenStandard.ERC20; + // _depositRequest.info.id = 0; + // _depositRequest.info.quantity = _quantity; vm.deal(_sender, 10 ether); } // deposit erc721 in batch (2 ids), both success + // function test_depositERC721Batch_Success() public { + // uint256 tokenId1 = 22; + // uint256 tokenId2 = 23; + // _mainchainMockERC721.mint(_sender, tokenId1); + // _mainchainMockERC721.mint(_sender, tokenId2); + // vm.startPrank(_sender); + // _mainchainMockERC721.approve(address(_mainchainGatewayV3), tokenId1); + // _mainchainMockERC721.approve(address(_mainchainGatewayV3), tokenId2); + // vm.stopPrank(); + + // _depositRequest.tokenAddr = address(_mainchainMockERC721); + // _depositRequest.info.erc = TokenStandard.ERC721; + // _depositRequest.info.id = 0; + // _depositRequest.info.quantity = 0; + // _depositRequest.info.ids = new uint256[](2); + // _depositRequest.info.ids[0] = tokenId1; + // _depositRequest.info.ids[1] = tokenId2; + // _depositRequest.info.quantities = new uint256[](2); + + // LibTransfer.Receipt memory receipt = _depositRequest.into_deposit_receipt( + // _sender, _mainchainGatewayV3.depositCount(), address(_roninMockERC721), block.chainid + // ); + // vm.expectEmit(address(_mainchainGatewayV3)); + // emit DepositRequested(receipt.hash(), receipt); + + // assertEq(_mainchainMockERC721.ownerOf(tokenId1), _sender); + // assertEq(_mainchainMockERC721.ownerOf(tokenId2), _sender); + + // vm.prank(_sender); + // _mainchainGatewayV3.requestDepositFor(_depositRequest); + + // assertEq(_mainchainMockERC721.ownerOf(tokenId1), address(_mainchainGatewayV3)); + // assertEq(_mainchainMockERC721.ownerOf(tokenId2), address(_mainchainGatewayV3)); + // assertEq(_mainchainGatewayV3.depositCount(), 1); + // } + function test_depositERC721Batch_Success() public { uint256 tokenId1 = 22; uint256 tokenId2 = 23; _mainchainMockERC721.mint(_sender, tokenId1); _mainchainMockERC721.mint(_sender, tokenId2); + vm.startPrank(_sender); - _mainchainMockERC721.approve(address(_mainchainGatewayV3), tokenId1); - _mainchainMockERC721.approve(address(_mainchainGatewayV3), tokenId2); - vm.stopPrank(); - - _depositRequest.tokenAddr = address(_mainchainMockERC721); - _depositRequest.info.erc = TokenStandard.ERC721Batch; - _depositRequest.info.id = 0; - _depositRequest.info.quantity = 0; - _depositRequest.info.ids = new uint256[](2); - _depositRequest.info.ids[0] = tokenId1; - _depositRequest.info.ids[1] = tokenId2; - _depositRequest.info.quantities = new uint256[](2); - - LibTransfer.Receipt memory receipt = _depositRequest.into_deposit_receipt( - _sender, _mainchainGatewayV3.depositCount(), address(_roninMockERC721), block.chainid - ); - vm.expectEmit(address(_mainchainGatewayV3)); - emit DepositRequested(receipt.hash(), receipt); + _mainchainMockERC721.approve(address(_mainchainGatewayBatcher), tokenId1); + _mainchainMockERC721.approve(address(_mainchainGatewayBatcher), tokenId2); + + MainchainGatewayBatcher.RequestBatch memory req; + req.recipient = makeAddr("recipient"); + req.tokenAddr = address(_mainchainMockERC721); + req.info.erc = TokenStandard.ERC721; + req.info.ids = new uint256[](2); + req.info.ids[0] = tokenId1; + req.info.ids[1] = tokenId2; assertEq(_mainchainMockERC721.ownerOf(tokenId1), _sender); assertEq(_mainchainMockERC721.ownerOf(tokenId2), _sender); - vm.prank(_sender); - _mainchainGatewayV3.requestDepositFor(_depositRequest); + _mainchainGatewayBatcher.requestDepositForBatch(req); + + // LibTransfer.Receipt memory receipt = _depositRequest.into_deposit_receipt( + // _sender, _mainchainGatewayV3.depositCount(), address(_roninMockERC721), block.chainid + // ); + // vm.expectEmit(address(_mainchainGatewayV3)); + // emit DepositRequested(receipt.hash(), receipt); assertEq(_mainchainMockERC721.ownerOf(tokenId1), address(_mainchainGatewayV3)); assertEq(_mainchainMockERC721.ownerOf(tokenId2), address(_mainchainGatewayV3)); - assertEq(_mainchainGatewayV3.depositCount(), 1); + assertEq(_mainchainGatewayV3.depositCount(), 2); } } diff --git a/test/bridge/integration/pause-enforcer/emergencyAction.PauseEnforcer.t.sol b/test/bridge/integration/pause-enforcer/emergencyAction.PauseEnforcer.t.sol index 84d8da3c..4c795f50 100644 --- a/test/bridge/integration/pause-enforcer/emergencyAction.PauseEnforcer.t.sol +++ b/test/bridge/integration/pause-enforcer/emergencyAction.PauseEnforcer.t.sol @@ -33,9 +33,9 @@ contract EmergencyAction_PauseEnforcer_Test is BaseIntegration_Test { info: TokenInfo({ erc: TokenStandard.ERC20, id: 0, - quantity: 100, - ids: new uint256[](0), - quantities: new uint256[](0) + quantity: 100 + // ids: new uint256[](0), + // quantities: new uint256[](0) }) }); @@ -76,9 +76,9 @@ contract EmergencyAction_PauseEnforcer_Test is BaseIntegration_Test { info: TokenInfo({ erc: TokenStandard.ERC20, id: 0, - quantity: 100, - ids: new uint256[](0), - quantities: new uint256[](0) + quantity: 100 + // ids: new uint256[](0), + // quantities: new uint256[](0) }) }); diff --git a/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol b/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol index 14af2f15..67166440 100644 --- a/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol +++ b/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol @@ -30,9 +30,9 @@ contract DepositVote_RoninGatewayV3_Test is BaseIntegration_Test { info: TokenInfo({ erc: TokenStandard.ERC20, id: 0, - quantity: 100, - ids: new uint256[](0), - quantities: new uint256[](0) + quantity: 100 + // ids: new uint256[](0), + // quantities: new uint256[](0) }) }); From 7d7c5d59abaa85566829b8db9001fe572b3b4468 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 18 Mar 2024 14:26:25 +0700 Subject: [PATCH 074/180] feat(GatewayBatcher): separate to two `-Batch` lib --- src/libraries/LibRequestBatch.sol | 47 ++++++++++++ src/libraries/LibTokenInfoBatch.sol | 19 +++-- src/mainchain/MainchainGatewayBatcher.sol | 74 ++----------------- ...tDepositFor.Batch.MainchainGatewayV3.t.sol | 3 +- 4 files changed, 67 insertions(+), 76 deletions(-) create mode 100644 src/libraries/LibRequestBatch.sol diff --git a/src/libraries/LibRequestBatch.sol b/src/libraries/LibRequestBatch.sol new file mode 100644 index 00000000..5d309bdb --- /dev/null +++ b/src/libraries/LibRequestBatch.sol @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "../interfaces/IMainchainGatewayV3.sol"; +import { TokenInfoBatch, ErrUnsupportedStandard } from "./LibTokenInfoBatch.sol"; + +struct RequestBatch { + address recipient; + address tokenAddr; + TokenInfoBatch info; +} + +library LibRequestBatch { + function forwardRequestToGateway(RequestBatch memory req, IMainchainGatewayV3 mainchainGateway) internal { + if (req.info.erc == TokenStandard.ERC721) { + _forwardRequestToGatewayERC721(req, mainchainGateway); + } else if (req.info.erc == TokenStandard.ERC1155) { + _forwardRequestToGatewayERC1155(req, mainchainGateway); + } else { + revert ErrUnsupportedStandard(); + } + } + + function _forwardRequestToGatewayERC721(RequestBatch memory req, IMainchainGatewayV3 mainchainGateway) internal { + for (uint256 i; i < req.info.ids.length; i++) { + mainchainGateway.requestDepositFor( + Transfer.Request({ + recipientAddr: req.recipient, + tokenAddr: req.tokenAddr, + info: TokenInfo({ erc: req.info.erc, id: req.info.ids[i], quantity: 0 }) + }) + ); + } + } + + function _forwardRequestToGatewayERC1155(RequestBatch memory req, IMainchainGatewayV3 mainchainGateway) internal { + for (uint256 i; i < req.info.ids.length; i++) { + mainchainGateway.requestDepositFor( + Transfer.Request({ + recipientAddr: req.recipient, + tokenAddr: req.tokenAddr, + info: TokenInfo({ erc: req.info.erc, id: req.info.ids[i], quantity: req.info.quantities[i] }) + }) + ); + } + } +} diff --git a/src/libraries/LibTokenInfoBatch.sol b/src/libraries/LibTokenInfoBatch.sol index 7370e817..0570bc86 100644 --- a/src/libraries/LibTokenInfoBatch.sol +++ b/src/libraries/LibTokenInfoBatch.sol @@ -48,24 +48,27 @@ library LibTokenInfoBatch { function _validateERC721Batch(TokenInfoBatch memory self) private pure returns (bool res) { uint256 length = self.ids.length; - res = self.erc == TokenStandard.ERC721; - - for (uint256 i; i < length; ++i) { - if (self.quantities[i] != 0) { - return false; - } - } + return self.erc == TokenStandard.ERC721 // Check ERC721 + && self.ids.length != 0 // Info must contain valid array of ids + && self.quantities.length == 0; // Quantity of each ERC721 alway is 1, no input to save gas } function _validateERC1155Batch(TokenInfoBatch memory self) private pure returns (bool res) { uint256 length = self.ids.length; - res = self.erc == TokenStandard.ERC1155; + // Info must have same length for each token id + if (self.erc == TokenStandard.ERC1155 || length != self.quantities.length) { + return false; + } + + // Each token id must have quantity for (uint256 i; i < length; ++i) { if (self.quantities[i] == 0) { return false; } } + + return true; } /** diff --git a/src/mainchain/MainchainGatewayBatcher.sol b/src/mainchain/MainchainGatewayBatcher.sol index 784f5079..dab743ec 100644 --- a/src/mainchain/MainchainGatewayBatcher.sol +++ b/src/mainchain/MainchainGatewayBatcher.sol @@ -3,22 +3,20 @@ pragma solidity ^0.8.0; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; +import "../libraries/LibRequestBatch.sol"; import "../libraries/LibTokenInfoBatch.sol"; import "./MainchainGatewayV3.sol"; contract MainchainGatewayBatcher is Initializable { + using LibRequestBatch for RequestBatch; + using LibTokenInfoBatch for TokenInfoBatch; + MainchainGatewayV3 internal _mainchainGateway; constructor() { _disableInitializers(); } - struct RequestBatch { - address recipient; - address tokenAddr; - TokenInfoBatch info; - } - function initialize(MainchainGatewayV3 gateway) external initializer { _mainchainGateway = gateway; } @@ -40,68 +38,10 @@ contract MainchainGatewayBatcher is Initializable { * - Emit an event that include information of the {RequestBatch} */ function requestDepositForBatch(RequestBatch calldata request) external { - _validateRequestBatchERC721(request); - _handleAssetInBatchERC721(request); + request.info.validate(); + request.info.handleAssetIn(msg.sender, request.tokenAddr); IERC721(request.tokenAddr).setApprovalForAll(address(_mainchainGateway), true); - _forwardRequestToGatewayERC721(request); - } - - function _validateRequestBatchERC721(RequestBatch memory request) internal pure { - if (request.info.erc != TokenStandard.ERC721) { - revert ErrUnsupportedToken(); - } - - if ( - request.info.ids.length == 0 // Request must contain valid array of ids - || request.info.quantities.length != 0 // Quantity of each ERC721 alway is 1, no input to save gas - ) { - revert ErrInvalidRequest(); - } - } - - function _handleAssetInBatchERC721(RequestBatch memory request) internal returns (bool success) { - success = _tryTransferFromERC721Loop(request.tokenAddr, msg.sender, address(this), request.info.ids); - if (!success) { - revert("Transfer Failed"); - } - } - - /** - * @dev Transfers ERC721 token in a loop and returns the result. - * - * If there is fail when transfer one `id`, the loop will break early to save gas. - * Consumer of this method should revert the transaction if receive `false` success status. - */ - function _tryTransferFromERC721Loop(address token, address from, address to, uint256[] memory ids) - private - returns (bool success) - { - for (uint256 i; i < ids.length; ++i) { - if (!_tryTransferFromERC721(token, from, to, ids[i])) { - return false; // Break early if send fails - } - } - - return true; - } - - /** - * @dev Transfers ERC721 token and returns the result. - */ - function _tryTransferFromERC721(address token, address from, address to, uint256 id) private returns (bool success) { - (success,) = token.call(abi.encodeWithSelector(IERC721.transferFrom.selector, from, to, id)); - } - - function _forwardRequestToGatewayERC721(RequestBatch memory req) internal { - for (uint256 i; i < req.info.ids.length; i++) { - _mainchainGateway.requestDepositFor( - Transfer.Request({ - recipientAddr: req.recipient, - tokenAddr: req.tokenAddr, - info: TokenInfo({ erc: req.info.erc, id: req.info.ids[i], quantity: 0 }) - }) - ); - } + request.forwardRequestToGateway(_mainchainGateway); } } diff --git a/test/bridge/integration/mainchain-gateway/requestDepositFor.Batch.MainchainGatewayV3.t.sol b/test/bridge/integration/mainchain-gateway/requestDepositFor.Batch.MainchainGatewayV3.t.sol index 2a94541e..35d0611a 100644 --- a/test/bridge/integration/mainchain-gateway/requestDepositFor.Batch.MainchainGatewayV3.t.sol +++ b/test/bridge/integration/mainchain-gateway/requestDepositFor.Batch.MainchainGatewayV3.t.sol @@ -3,6 +3,7 @@ pragma solidity ^0.8.19; import { console2 as console } from "forge-std/console2.sol"; import { Transfer as LibTransfer } from "@ronin/contracts/libraries/Transfer.sol"; +import "@ronin/contracts/libraries/LibRequestBatch.sol"; import "@ronin/contracts/libraries/LibTokenInfoBatch.sol"; import "../BaseIntegration.t.sol"; @@ -80,7 +81,7 @@ contract RequestDepositFor_Batch_MainchainGatewayV3_Test is BaseIntegration_Test _mainchainMockERC721.approve(address(_mainchainGatewayBatcher), tokenId1); _mainchainMockERC721.approve(address(_mainchainGatewayBatcher), tokenId2); - MainchainGatewayBatcher.RequestBatch memory req; + RequestBatch memory req; req.recipient = makeAddr("recipient"); req.tokenAddr = address(_mainchainMockERC721); req.info.erc = TokenStandard.ERC721; From 65bbf4c1cc85cfca9797501f46f76cc2681a8b14 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 18 Mar 2024 15:47:41 +0700 Subject: [PATCH 075/180] feat(GatewayBatcher): refactor by dispatcher --- src/libraries/LibRequestBatch.sol | 14 +------ src/libraries/LibTokenInfo.sol | 6 +-- src/libraries/LibTokenInfoBatch.sol | 44 ++++++++++--------- src/mainchain/MainchainGatewayBatcher.sol | 51 +++++++++++++++++++++-- 4 files changed, 78 insertions(+), 37 deletions(-) diff --git a/src/libraries/LibRequestBatch.sol b/src/libraries/LibRequestBatch.sol index 5d309bdb..dc04e2a2 100644 --- a/src/libraries/LibRequestBatch.sol +++ b/src/libraries/LibRequestBatch.sol @@ -11,17 +11,7 @@ struct RequestBatch { } library LibRequestBatch { - function forwardRequestToGateway(RequestBatch memory req, IMainchainGatewayV3 mainchainGateway) internal { - if (req.info.erc == TokenStandard.ERC721) { - _forwardRequestToGatewayERC721(req, mainchainGateway); - } else if (req.info.erc == TokenStandard.ERC1155) { - _forwardRequestToGatewayERC1155(req, mainchainGateway); - } else { - revert ErrUnsupportedStandard(); - } - } - - function _forwardRequestToGatewayERC721(RequestBatch memory req, IMainchainGatewayV3 mainchainGateway) internal { + function forwardRequestToGatewayERC721(RequestBatch memory req, IMainchainGatewayV3 mainchainGateway) internal { for (uint256 i; i < req.info.ids.length; i++) { mainchainGateway.requestDepositFor( Transfer.Request({ @@ -33,7 +23,7 @@ library LibRequestBatch { } } - function _forwardRequestToGatewayERC1155(RequestBatch memory req, IMainchainGatewayV3 mainchainGateway) internal { + function forwardRequestToGatewayERC1155(RequestBatch memory req, IMainchainGatewayV3 mainchainGateway) internal { for (uint256 i; i < req.info.ids.length; i++) { mainchainGateway.requestDepositFor( Transfer.Request({ diff --git a/src/libraries/LibTokenInfo.sol b/src/libraries/LibTokenInfo.sol index 3aeda7e3..469f4ca9 100644 --- a/src/libraries/LibTokenInfo.sol +++ b/src/libraries/LibTokenInfo.sol @@ -132,7 +132,7 @@ library LibTokenInfo { * @dev Validates the token info. */ function validate(TokenInfo memory self) internal pure { - if (!(_validateERC20(self) || _validateERC721(self) || _validateERC721Batch(self) || _validateERC1155Batch(self))) { + if (!(_validateERC20(self) || _validateERC721(self) || _checkERC721Batch(self) || _checkERC1155Batch(self))) { revert ErrInvalidInfo(); } } @@ -145,7 +145,7 @@ library LibTokenInfo { return (self.erc == TokenStandard.ERC721 && self.quantity == 0); } - function _validateERC721Batch(TokenInfo memory self) private pure returns (bool res) { + function _checkERC721Batch(TokenInfo memory self) private pure returns (bool res) { // uint256 length = self.ids.length; // res = self.erc == TokenStandard.ERC721Batch && _validateBatch(self); @@ -157,7 +157,7 @@ library LibTokenInfo { // } } - function _validateERC1155Batch(TokenInfo memory self) private pure returns (bool res) { + function _checkERC1155Batch(TokenInfo memory self) private pure returns (bool res) { // uint256 length = self.ids.length; // res = self.erc == TokenStandard.ERC1155Batch && _validateBatch(self); diff --git a/src/libraries/LibTokenInfoBatch.sol b/src/libraries/LibTokenInfoBatch.sol index 0570bc86..fa68add9 100644 --- a/src/libraries/LibTokenInfoBatch.sol +++ b/src/libraries/LibTokenInfoBatch.sol @@ -39,25 +39,28 @@ library LibTokenInfoBatch { /** * @dev Validates the token info. */ - function validate(TokenInfoBatch memory self) internal pure { - if (!(_validateERC721Batch(self) || _validateERC1155Batch(self))) { + function validate(TokenInfoBatch memory self, function (TokenInfoBatch memory) pure returns (bool) fCheck) + internal + pure + { + if (!fCheck(self)) { revert ErrInvalidInfo(); } } - function _validateERC721Batch(TokenInfoBatch memory self) private pure returns (bool res) { - uint256 length = self.ids.length; - + function checkERC721Batch(TokenInfoBatch memory self) internal pure returns (bool res) { return self.erc == TokenStandard.ERC721 // Check ERC721 && self.ids.length != 0 // Info must contain valid array of ids && self.quantities.length == 0; // Quantity of each ERC721 alway is 1, no input to save gas } - function _validateERC1155Batch(TokenInfoBatch memory self) private pure returns (bool res) { + function checkERC1155Batch(TokenInfoBatch memory self) internal pure returns (bool res) { uint256 length = self.ids.length; - // Info must have same length for each token id - if (self.erc == TokenStandard.ERC1155 || length != self.quantities.length) { + if ( + self.erc == TokenStandard.ERC1155 // Check ERC1155 + || length != self.quantities.length // Info must have same length for each token id + ) { return false; } @@ -84,18 +87,21 @@ library LibTokenInfoBatch { * - The `_from` address must approve for the contract using this library. * */ - function handleAssetIn(TokenInfoBatch memory self, address from, address token) internal { - bool success; - bytes memory data; - if (self.erc == TokenStandard.ERC721) { - success = _tryTransferFromERC721Loop(token, from, address(this), self.ids); - } else if (self.erc == TokenStandard.ERC1155) { - success = _tryTransferERC1155Batch(token, from, address(this), self.ids, self.quantities); - } else { - revert ErrUnsupportedStandard(); - } + function handleAssetIn( + TokenInfoBatch memory self, + address from, + address token, + function (TokenInfoBatch memory, address, address) returns (bool) fHandleAssetIn + ) internal { + if (!fHandleAssetIn(self, from, token)) revert ErrTokenBatchCouldNotTransferFrom(self, from, address(this), token); + } + + function tryHandleAssetInERC721(TokenInfoBatch memory self, address from, address token) internal returns (bool) { + return _tryTransferFromERC721Loop(token, from, address(this), self.ids); + } - if (!success) revert ErrTokenBatchCouldNotTransferFrom(self, from, address(this), token); + function tryHandleAssetInERC1155(TokenInfoBatch memory self, address from, address token) internal returns (bool) { + return _tryTransferERC1155Batch(token, from, address(this), self.ids, self.quantities); } /** diff --git a/src/mainchain/MainchainGatewayBatcher.sol b/src/mainchain/MainchainGatewayBatcher.sol index dab743ec..add22028 100644 --- a/src/mainchain/MainchainGatewayBatcher.sol +++ b/src/mainchain/MainchainGatewayBatcher.sol @@ -21,6 +21,8 @@ contract MainchainGatewayBatcher is Initializable { _mainchainGateway = gateway; } + event BatchDepositRequested(address indexed requested); + /** * @notice Batch transfer token from user to this Batcher, then sequentially request deposit for to gateway on behalf of user. * @@ -38,10 +40,53 @@ contract MainchainGatewayBatcher is Initializable { * - Emit an event that include information of the {RequestBatch} */ function requestDepositForBatch(RequestBatch calldata request) external { - request.info.validate(); - request.info.handleAssetIn(msg.sender, request.tokenAddr); + // Dispatch the corresponding internal methods for each type of ERC + ( + function (TokenInfoBatch memory) pure returns (bool) fCheck, + function (TokenInfoBatch memory, address, address) returns (bool) fHandleAssetIn, + function (RequestBatch memory, IMainchainGatewayV3) fForwardRequestToGateway + ) = _dispatcher(request.info.erc); + + // Revert if validate fails + request.info.validate(fCheck); + + // Revert if cannot transfer all tokens to this Batcher + request.info.handleAssetIn(msg.sender, request.tokenAddr, fHandleAssetIn); + // Approve all tokens from this Batcher to the actual Gateway IERC721(request.tokenAddr).setApprovalForAll(address(_mainchainGateway), true); - request.forwardRequestToGateway(_mainchainGateway); + + // Loop over all token ids and make a deposit request for each + fForwardRequestToGateway(request, _mainchainGateway); + + emit BatchDepositRequested(msg.sender); + } + + function _dispatcher(TokenStandard erc) + private + pure + returns ( + function (TokenInfoBatch memory) pure returns (bool) fValidate, + function (TokenInfoBatch memory, address, address) returns (bool) fHandleAsset, + function (RequestBatch memory, IMainchainGatewayV3) fForwardRequestToGateway + ) + { + if (erc == TokenStandard.ERC721) { + return ( + LibTokenInfoBatch.checkERC721Batch, + LibTokenInfoBatch.tryHandleAssetInERC721, + LibRequestBatch.forwardRequestToGatewayERC721 + ); + } + + if (erc == TokenStandard.ERC1155) { + return ( + LibTokenInfoBatch.checkERC1155Batch, + LibTokenInfoBatch.tryHandleAssetInERC1155, + LibRequestBatch.forwardRequestToGatewayERC1155 + ); + } + + revert ErrUnsupportedStandard(); } } From a0e0e367c5bbfa7b8b0aacf10782f75701ad3096 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 18 Mar 2024 16:32:51 +0700 Subject: [PATCH 076/180] feat(TokenInfo): remove batch action in legacy TokenInfo --- src/libraries/LibTokenInfo.sol | 215 +++++++-------------------------- 1 file changed, 41 insertions(+), 174 deletions(-) diff --git a/src/libraries/LibTokenInfo.sol b/src/libraries/LibTokenInfo.sol index 469f4ca9..6fd30422 100644 --- a/src/libraries/LibTokenInfo.sol +++ b/src/libraries/LibTokenInfo.sol @@ -50,26 +50,13 @@ error ErrERC721MintingFailed(); /// @dev Error indicating that the transfer of ERC1155 tokens has failed. error ErrERC1155TransferFailed(); -/// @dev Error indicating that the mint of ERC1155 tokens in batch has failed. -error ErrERC1155MintBatchFailed(); +/// @dev Error indicating that the mint of ERC1155 tokens has failed. +error ErrERC1155MintingFailed(); /// @dev Error indicating that an unsupported standard is encountered. error ErrUnsupportedStandard(); library LibTokenInfo { - /** - * - * ROUTER - * - */ - function _isStandardSingle(TokenStandard standard) private pure returns (bool) { - return standard == TokenStandard.ERC20 || standard == TokenStandard.ERC721; - } - - function _isStandardBatch(TokenStandard standard) private pure returns (bool) { - // return standard == TokenStandard.ERC721Batch || standard == TokenStandard.ERC1155Batch; - } - /** * * HASH @@ -79,19 +66,10 @@ library LibTokenInfo { // keccak256("TokenInfo(uint8 erc,uint256 id,uint256 quantity)"); bytes32 public constant INFO_TYPE_HASH_SINGLE = 0x1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d; - // keccak256("TokenInfo(uint8 erc,uint256[] ids,uint256[] quantities)"); - bytes32 public constant INFO_TYPE_HASH_BATCH = 0xe0d9a8bb18cfc29aa6e46b1293275ca79aeaaf28ac63b66dcb6ebce2f127f5a0; - /** * @dev Returns token info struct hash. */ function hash(TokenInfo memory self) internal pure returns (bytes32 digest) { - if (_isStandardSingle(self.erc)) return _hashSingle(self); - if (_isStandardBatch(self.erc)) return _hashBatch(self); - revert ErrUnsupportedStandard(); - } - - function _hashSingle(TokenInfo memory self) internal pure returns (bytes32 digest) { // keccak256(abi.encode(INFO_TYPE_HASH_SINGLE, info.erc, info.id, info.quantity)) assembly { let ptr := mload(0x40) @@ -103,25 +81,6 @@ library LibTokenInfo { } } - function _hashBatch(TokenInfo memory self) internal pure returns (bytes32 digest) { - // keccak256(abi.encode(INFO_TYPE_HASH_BATCH, info.erc, info.ids, info.quantities)) - assembly { - let ptr := mload(0x40) - mstore(ptr, INFO_TYPE_HASH_SINGLE) - mstore(add(ptr, 0x20), mload(self)) // info.erc - - let ids := mload(add(self, 0x20)) // info.ids - let idsHash := keccak256(add(ids, 32), mul(mload(ids), 32)) // keccak256(info.ids) - mstore(add(ptr, 0x40), idsHash) - - let qtys := mload(add(self, 0x40)) // info.quantities - let qtysHash := keccak256(add(qtys, 32), mul(mload(qtys), 32)) // keccak256(info.quantities) - mstore(add(ptr, 0x60), qtysHash) - - digest := keccak256(ptr, 0x80) - } - } - /** * * VALIDATE @@ -132,45 +91,22 @@ library LibTokenInfo { * @dev Validates the token info. */ function validate(TokenInfo memory self) internal pure { - if (!(_validateERC20(self) || _validateERC721(self) || _checkERC721Batch(self) || _checkERC1155Batch(self))) { + if (!(_checkERC20(self) || _checkERC721(self) || _checkERC1155(self))) { revert ErrInvalidInfo(); } } - function _validateERC20(TokenInfo memory self) private pure returns (bool) { + function _checkERC20(TokenInfo memory self) private pure returns (bool) { return (self.erc == TokenStandard.ERC20 && self.quantity > 0 && self.id == 0); } - function _validateERC721(TokenInfo memory self) private pure returns (bool) { + function _checkERC721(TokenInfo memory self) private pure returns (bool) { return (self.erc == TokenStandard.ERC721 && self.quantity == 0); } - function _checkERC721Batch(TokenInfo memory self) private pure returns (bool res) { - // uint256 length = self.ids.length; - - // res = self.erc == TokenStandard.ERC721Batch && _validateBatch(self); - - // for (uint256 i; i < length; ++i) { - // if (self.quantities[i] != 0) { - // return false; - // } - // } - } - - function _checkERC1155Batch(TokenInfo memory self) private pure returns (bool res) { - // uint256 length = self.ids.length; - // res = self.erc == TokenStandard.ERC1155Batch && _validateBatch(self); - - // for (uint256 i; i < length; ++i) { - // if (self.quantities[i] == 0) { - // return false; - // } - // } - } - - function _validateBatch(TokenInfo memory self) private pure returns (bool res) { - // return self.quantity == 0 && self.id == 0 && self.ids.length > 0 && self.quantities.length > 0 - // && self.ids.length == self.quantities.length; + function _checkERC1155(TokenInfo memory self) private pure returns (bool res) { + // Only validate the quantity, because id of ERC-1155 can be 0. + return (self.erc == TokenStandard.ERC1155 && self.quantity > 0); } /** @@ -195,10 +131,8 @@ library LibTokenInfo { success = success && (data.length == 0 || abi.decode(data, (bool))); } else if (self.erc == TokenStandard.ERC721) { success = _tryTransferFromERC721(token, from, address(this), self.id); - // } else if (self.erc == TokenStandard.ERC721Batch) { - // success = _tryTransferFromERC721Loop(token, from, address(this), self.ids); - // } else if (self.erc == TokenStandard.ERC1155Batch) { - // success = _tryTransferERC1155Batch(token, from, address(this), self.ids, self.quantities); + } else if (self.erc == TokenStandard.ERC1155) { + success = _tryTransferFromERC1155(token, from, address(this), self.id, self.quantity); } else { revert ErrUnsupportedStandard(); } @@ -230,7 +164,6 @@ library LibTokenInfo { } _transferTokenOut(self, to, token); - return; } @@ -238,33 +171,15 @@ library LibTokenInfo { if (!_tryTransferOutOrMintERC721(token, to, self.id)) { revert ErrERC721MintingFailed(); } - return; } - // if (self.erc == TokenStandard.ERC721Batch) { - // for (uint256 i; i < self.ids.length; ++i) { - // uint256 id = self.ids[i]; - // if (!_tryTransferOutOrMintERC721(token, to, id)) revert ErrERC721MintingFailed(); - // } - - // return; - // } - - // if (self.erc == TokenStandard.ERC1155Batch) { - // (uint256[] memory toMintIds, uint256[] memory toMintAmounts) = - // _calcLackBalancesERC1155(address(this), token, self.ids, self.quantities); - - // if (toMintIds.length > 0) { - // if (!_tryMintERC1155Batch(token, address(this), toMintIds, toMintAmounts)) revert ErrERC1155MintBatchFailed(); - // } - - // if (!_tryTransferERC1155Batch(token, address(this), to, self.ids, self.quantities)) { - // revert ErrERC1155TransferFailed(); - // } - - // return; - // } + if (self.erc == TokenStandard.ERC1155) { + if (!_tryTransferOutOrMintERC1155(token, to, self.id, self.quantity)) { + revert ErrERC1155MintingFailed(); + } + return; + } revert ErrUnsupportedStandard(); } @@ -291,6 +206,10 @@ library LibTokenInfo { if (!success) revert ErrTokenCouldNotTransfer(self, to, token); } + /** + * TRANSFER ERC-20 + */ + /** * @dev Transfers ERC20 token and returns the result. */ @@ -308,6 +227,10 @@ library LibTokenInfo { (success,) = token.call(abi.encodeWithSelector(0x40c10f19, to, quantity)); } + /** + * TRANSFER ERC-721 + */ + /** * @dev Transfers the ERC721 token out. If the transfer failed, mints the ERC721. * @return success Returns `false` if both transfer and mint are failed. @@ -326,25 +249,6 @@ library LibTokenInfo { (success,) = token.call(abi.encodeWithSelector(IERC721.transferFrom.selector, from, to, id)); } - /** - * @dev Transfers ERC721 token in a loop and returns the result. - * - * If there is fail when transfer one `id`, the loop will break early to save gas. - * Consumer of this method should revert the transaction if receive `false` success status. - */ - function _tryTransferFromERC721Loop(address token, address from, address to, uint256[] memory ids) - private - returns (bool success) - { - for (uint256 i; i < ids.length; ++i) { - if (!_tryTransferFromERC721(token, from, to, ids[i])) { - return false; // Break early if send fails - } - } - - return true; - } - /** * @dev Mints ERC721 token and returns the result. */ @@ -354,74 +258,37 @@ library LibTokenInfo { } /** - * @dev Transfers ERC1155 token in and returns the result. + * TRANSFER ERC-1155 */ - function _tryTransferERC1155(address token, address to, uint256 id, uint256 amount) private returns (bool success) { - (success,) = token.call(abi.encodeCall(IERC1155.safeTransferFrom, (address(this), to, id, amount, new bytes(0)))); - } /** - * @dev Transfers ERC1155 token in and returns the result. + * @dev Transfers the ERC1155 token out. If the transfer failed, mints the ERC11555. + * @return success Returns `false` if both transfer and mint are failed. */ - function _tryTransferERC1155Batch( - address token, - address from, - address to, - uint256[] memory ids, - uint256[] memory amounts - ) private returns (bool success) { - (success,) = token.call(abi.encodeCall(IERC1155.safeBatchTransferFrom, (from, to, ids, amounts, new bytes(0)))); + function _tryTransferOutOrMintERC1155(address token, address to, uint256 id, uint256 amount) + private + returns (bool success) + { + success = _tryTransferFromERC1155(token, address(this), to, id, amount); + if (!success) { + return _tryMintERC1155(token, to, id, amount); + } } /** - * @dev Mints ERC1155 token in batch and returns the result. + * @dev Transfers ERC1155 token and returns the result. */ - function _tryMintERC1155Batch(address token, address to, uint256[] memory ids, uint256[] memory amounts) + function _tryTransferFromERC1155(address token, address from, address to, uint256 id, uint256 amount) private returns (bool success) { - (success,) = token.call(abi.encodeCall(ERC1155PresetMinterPauser.mintBatch, (to, ids, amounts, new bytes(0)))); + (success,) = token.call(abi.encodeCall(IERC1155.safeTransferFrom, (from, to, id, amount, new bytes(0)))); } /** - * - * OTHER HELPERS - * - */ - - /** - * @dev Gets ERC1155 balance of token `ids` for user `who`, then compare with the `requiredAmounts`. Returns list of `ids_` that have `lackAmounts_` at least 1. + * @dev Mints ERC1155 token and returns the result. */ - function _calcLackBalancesERC1155(address who, address token, uint256[] memory ids, uint256[] memory requiredAmounts) - private - view - returns (uint256[] memory ids_, uint256[] memory lackAmounts_) - { - uint256 length = ids.length; - address[] memory whos = new address[](length); - ids_ = new uint256[](length); - lackAmounts_ = new uint256[](length); - - for (uint256 i; i < length; i++) { - whos[i] = address(who); - } - - // Get balance of all ids belongs to `who` - uint256[] memory balances = IERC1155(token).balanceOfBatch(whos, ids); - - uint256 count = 0; - - // Find the ids that lack of balance - for (uint256 i; i < length; i++) { - if (requiredAmounts[i] > balances[i]) { - lackAmounts_[count] = requiredAmounts[i] - balances[i]; - ids_[count++] = ids[i]; - } - } - - assembly { - mstore(ids_, count) - mstore(lackAmounts_, count) - } + function _tryMintERC1155(address token, address to, uint256 id, uint256 amount) private returns (bool success) { + (success,) = token.call(abi.encodeCall(ERC1155PresetMinterPauser.mint, (to, id, amount, new bytes(0)))); } } From 7a8e1ef4ed04ed24c79482c2798972e3e70941af Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 18 Mar 2024 17:44:53 +0700 Subject: [PATCH 077/180] feat(GatewayBatcher): fix validation erc1155 --- src/libraries/LibRequestBatch.sol | 2 +- src/libraries/LibTokenInfoBatch.sol | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libraries/LibRequestBatch.sol b/src/libraries/LibRequestBatch.sol index dc04e2a2..976ea148 100644 --- a/src/libraries/LibRequestBatch.sol +++ b/src/libraries/LibRequestBatch.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.0; import "../interfaces/IMainchainGatewayV3.sol"; -import { TokenInfoBatch, ErrUnsupportedStandard } from "./LibTokenInfoBatch.sol"; +import { TokenInfoBatch } from "./LibTokenInfoBatch.sol"; struct RequestBatch { address recipient; diff --git a/src/libraries/LibTokenInfoBatch.sol b/src/libraries/LibTokenInfoBatch.sol index fa68add9..14d72cb4 100644 --- a/src/libraries/LibTokenInfoBatch.sol +++ b/src/libraries/LibTokenInfoBatch.sol @@ -29,6 +29,8 @@ error ErrTokenBatchCouldNotTransfer(TokenInfoBatch tokenInfo, address to, addres */ error ErrTokenBatchCouldNotTransferFrom(TokenInfoBatch tokenInfo, address from, address to, address token); +error ErrInvalidInfoWithStandard(TokenStandard); + library LibTokenInfoBatch { /** * @@ -44,7 +46,7 @@ library LibTokenInfoBatch { pure { if (!fCheck(self)) { - revert ErrInvalidInfo(); + revert ErrInvalidInfoWithStandard(self.erc); } } @@ -58,7 +60,7 @@ library LibTokenInfoBatch { uint256 length = self.ids.length; if ( - self.erc == TokenStandard.ERC1155 // Check ERC1155 + self.erc != TokenStandard.ERC1155 // Check ERC1155 || length != self.quantities.length // Info must have same length for each token id ) { return false; From d5aca7089f19ed5db9ff7d89df4daf1e21675f7c Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 18 Mar 2024 17:45:52 +0700 Subject: [PATCH 078/180] test(GatewayBatcher): init first 1155 batch test --- script/GeneralConfig.sol | 1 + script/Migration.s.sol | 2 + .../contracts/token/MockERC1155Deploy.s.sol | 19 ++++++++ script/interfaces/ISharedArgument.sol | 5 +++ script/utils/Contract.sol | 2 + src/mocks/token/MockERC1155.sol | 12 +++++ test/bridge/integration/BaseIntegration.t.sol | 4 ++ ...tDepositFor.Batch.MainchainGatewayV3.t.sol | 44 ++++++++++++++++++- 8 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 script/contracts/token/MockERC1155Deploy.s.sol create mode 100644 src/mocks/token/MockERC1155.sol diff --git a/script/GeneralConfig.sol b/script/GeneralConfig.sol index e74e2520..28dd0071 100644 --- a/script/GeneralConfig.sol +++ b/script/GeneralConfig.sol @@ -49,6 +49,7 @@ contract GeneralConfig is BaseGeneralConfig, Utils { _mapContractName(Contract.MainchainGatewayBatcher); _mapContractName(Contract.MainchainBridgeManager); _mapContractName(Contract.MockERC721); + _mapContractName(Contract.MockERC1155); _contractNameMap[Contract.WETH.key()] = "MockWrappedToken"; _contractNameMap[Contract.WRON.key()] = "MockWrappedToken"; diff --git a/script/Migration.s.sol b/script/Migration.s.sol index fdd1b1ad..02c0ee3e 100644 --- a/script/Migration.s.sol +++ b/script/Migration.s.sol @@ -46,6 +46,8 @@ contract Migration is BaseMigrationV2, Utils { param.mockErc721.name = "Mock ERC721"; param.mockErc721.symbol = "M_ERC721"; + param.mockErc1155.uri = "mock://erc1155/"; + uint256 num = 6; address[] memory operatorAddrs = new address[](num); address[] memory governorAddrs = new address[](num); diff --git a/script/contracts/token/MockERC1155Deploy.s.sol b/script/contracts/token/MockERC1155Deploy.s.sol new file mode 100644 index 00000000..ec82026f --- /dev/null +++ b/script/contracts/token/MockERC1155Deploy.s.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { MockERC1155 } from "@ronin/contracts/mocks/token/MockERC1155.sol"; +import { Contract } from "../../utils/Contract.sol"; +import { ISharedArgument } from "../../interfaces/ISharedArgument.sol"; +import { Migration } from "../../Migration.s.sol"; + +contract MockERC1155Deploy is Migration { + function _defaultArguments() internal virtual override returns (bytes memory args) { + ISharedArgument.MockERC1155Param memory param = config.sharedArguments().mockErc1155; + + args = abi.encode(param.uri); + } + + function run() public virtual returns (MockERC1155) { + return MockERC1155(_deployImmutable(Contract.MockERC1155.key())); + } +} diff --git a/script/interfaces/ISharedArgument.sol b/script/interfaces/ISharedArgument.sol index f8f9f806..d75ed517 100644 --- a/script/interfaces/ISharedArgument.sol +++ b/script/interfaces/ISharedArgument.sol @@ -98,6 +98,10 @@ interface ISharedArgument is IGeneralConfig { string symbol; } + struct MockERC1155Param { + string uri; + } + struct UnitTestParam { address proxyAdmin; uint256 numberOfBlocksInEpoch; @@ -125,6 +129,7 @@ interface ISharedArgument is IGeneralConfig { MockERC20Param slp; MockERC20Param usdc; MockERC721Param mockErc721; + MockERC1155Param mockErc1155; UnitTestParam test; } diff --git a/script/utils/Contract.sol b/script/utils/Contract.sol index d9ccc2ca..8257f539 100644 --- a/script/utils/Contract.sol +++ b/script/utils/Contract.sol @@ -10,6 +10,7 @@ enum Contract { SLP, USDC, MockERC721, + MockERC1155, BridgeTracking, BridgeSlash, BridgeReward, @@ -35,6 +36,7 @@ function name(Contract contractEnum) pure returns (string memory) { if (contractEnum == Contract.SLP) return "SLP"; if (contractEnum == Contract.USDC) return "USDC"; if (contractEnum == Contract.MockERC721) return "MockERC721"; + if (contractEnum == Contract.MockERC1155) return "MockERC1155"; if (contractEnum == Contract.BridgeTracking) return "BridgeTracking"; if (contractEnum == Contract.BridgeSlash) return "BridgeSlash"; diff --git a/src/mocks/token/MockERC1155.sol b/src/mocks/token/MockERC1155.sol new file mode 100644 index 00000000..1a5e7292 --- /dev/null +++ b/src/mocks/token/MockERC1155.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import { ERC1155 } from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; + +contract MockERC1155 is ERC1155 { + constructor(string memory uri_) ERC1155(uri_) { } + + function mint(address to, uint256 id, uint256 amount) external { + _mint(to, id, amount, ""); + } +} diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index 2eebf35b..368e533a 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -19,6 +19,7 @@ import { MainchainGatewayBatcher } from "@ronin/contracts/mainchain/MainchainGat import { MainchainBridgeManager } from "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; import { MockERC20 } from "@ronin/contracts/mocks/token/MockERC20.sol"; import { MockERC721 } from "@ronin/contracts/mocks/token/MockERC721.sol"; +import { MockERC1155 } from "@ronin/contracts/mocks/token/MockERC1155.sol"; import { MockWrappedToken } from "@ronin/contracts/mocks/token/MockWrappedToken.sol"; import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; @@ -55,6 +56,7 @@ import { AXSDeploy } from "@ronin/script/contracts/token/AXSDeploy.s.sol"; import { SLPDeploy } from "@ronin/script/contracts/token/SLPDeploy.s.sol"; import { USDCDeploy } from "@ronin/script/contracts/token/USDCDeploy.s.sol"; import { MockERC721Deploy } from "@ronin/script/contracts/token/MockERC721Deploy.s.sol"; +import { MockERC1155Deploy } from "@ronin/script/contracts/token/MockERC1155Deploy.s.sol"; import { RoninBridgeAdminUtils } from "test/helpers/RoninBridgeAdminUtils.t.sol"; import { MainchainBridgeAdminUtils } from "test/helpers/MainchainBridgeAdminUtils.t.sol"; @@ -87,6 +89,7 @@ contract BaseIntegration_Test is Base_Test { MockERC20 _mainchainSlp; MockERC20 _mainchainUsdc; MockERC721 _mainchainMockERC721; + MockERC1155 _mainchainMockERC1155; MockValidatorContract_OnlyTiming_ForHardhatTest _validatorSet; @@ -142,6 +145,7 @@ contract BaseIntegration_Test is Base_Test { _mainchainSlp = new SLPDeploy().run(); _mainchainUsdc = new USDCDeploy().run(); _mainchainMockERC721 = new MockERC721Deploy().run(); + _mainchainMockERC1155 = new MockERC1155Deploy().run(); _param = ISharedArgument(LibSharedAddress.CONFIG).sharedArguments(); _mainchainProposalUtils = new MainchainBridgeAdminUtils( diff --git a/test/bridge/integration/mainchain-gateway/requestDepositFor.Batch.MainchainGatewayV3.t.sol b/test/bridge/integration/mainchain-gateway/requestDepositFor.Batch.MainchainGatewayV3.t.sol index 35d0611a..cde5da43 100644 --- a/test/bridge/integration/mainchain-gateway/requestDepositFor.Batch.MainchainGatewayV3.t.sol +++ b/test/bridge/integration/mainchain-gateway/requestDepositFor.Batch.MainchainGatewayV3.t.sol @@ -72,8 +72,8 @@ contract RequestDepositFor_Batch_MainchainGatewayV3_Test is BaseIntegration_Test // } function test_depositERC721Batch_Success() public { - uint256 tokenId1 = 22; - uint256 tokenId2 = 23; + uint256 tokenId1 = 721_22; + uint256 tokenId2 = 721_23; _mainchainMockERC721.mint(_sender, tokenId1); _mainchainMockERC721.mint(_sender, tokenId2); @@ -104,4 +104,44 @@ contract RequestDepositFor_Batch_MainchainGatewayV3_Test is BaseIntegration_Test assertEq(_mainchainMockERC721.ownerOf(tokenId2), address(_mainchainGatewayV3)); assertEq(_mainchainGatewayV3.depositCount(), 2); } + + function test_depositERC1155Batch_Success() public { + uint256 tokenId1 = 1155_33; + uint256 tokenId2 = 1155_34; + uint256 tokenId1Amount = 50; + uint256 tokenId2Amount = 100; + + _mainchainMockERC1155.mint(_sender, tokenId1, tokenId1Amount); + _mainchainMockERC1155.mint(_sender, tokenId2, tokenId2Amount); + + vm.startPrank(_sender); + _mainchainMockERC1155.setApprovalForAll(address(_mainchainGatewayBatcher), true); + + RequestBatch memory req; + req.recipient = makeAddr("recipient"); + req.tokenAddr = address(_mainchainMockERC1155); + req.info.erc = TokenStandard.ERC1155; + req.info.ids = new uint256[](2); + req.info.ids[0] = tokenId1; + req.info.ids[1] = tokenId2; + req.info.quantities = new uint256[](2); + req.info.quantities[0] = tokenId1Amount; + req.info.quantities[1] = tokenId2Amount; + + assertEq(_mainchainMockERC1155.balanceOf(_sender, tokenId1), tokenId1Amount); + assertEq(_mainchainMockERC1155.balanceOf(_sender, tokenId2), tokenId2Amount); + + _mainchainGatewayBatcher.requestDepositForBatch(req); + + // LibTransfer.Receipt memory receipt = _depositRequest.into_deposit_receipt( + // _sender, _mainchainGatewayV3.depositCount(), address(_roninMockERC721), block.chainid + // ); + // vm.expectEmit(address(_mainchainGatewayV3)); + // emit DepositRequested(receipt.hash(), receipt); + + assertEq(_mainchainMockERC1155.balanceOf(address(_mainchainGatewayV3), tokenId1), tokenId1Amount); + assertEq(_mainchainMockERC1155.balanceOf(address(_mainchainGatewayV3), tokenId2), tokenId2Amount); + + assertEq(_mainchainGatewayV3.depositCount(), 2); + } } From a8ca9eee2b8ca8c2c0a1b301ab5be0edab69c4dc Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 18 Mar 2024 18:07:56 +0700 Subject: [PATCH 079/180] feat(*Gateway): inherit ERC1155Holder --- src/extensions/GatewayV3.sol | 16 +++++++--------- src/mainchain/MainchainGatewayBatcher.sol | 3 ++- src/mainchain/MainchainGatewayV3.sol | 10 ++++++++++ src/ronin/gateway/RoninGatewayV3.sol | 10 ++++++++++ 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/src/extensions/GatewayV3.sol b/src/extensions/GatewayV3.sol index 6b10b19e..b76c96c2 100644 --- a/src/extensions/GatewayV3.sol +++ b/src/extensions/GatewayV3.sol @@ -5,7 +5,7 @@ import "@openzeppelin/contracts/security/Pausable.sol"; import "../interfaces/IQuorum.sol"; import "./collections/HasProxyAdmin.sol"; -abstract contract GatewayV3 is HasProxyAdmin, Pausable, IQuorum { +abstract contract GatewayV3 is HasProxyAdmin, Pausable, IQuorum { uint256 internal _num; uint256 internal _denom; @@ -44,10 +44,7 @@ abstract contract GatewayV3 is HasProxyAdmin, Pausable, IQuorum { /** * @inheritdoc IQuorum */ - function setThreshold( - uint256 _numerator, - uint256 _denominator - ) external virtual onlyAdmin returns (uint256, uint256) { + function setThreshold(uint256 _numerator, uint256 _denominator) external virtual onlyAdmin returns (uint256, uint256) { return _setThreshold(_numerator, _denominator); } @@ -80,10 +77,11 @@ abstract contract GatewayV3 is HasProxyAdmin, Pausable, IQuorum { * Emits the `ThresholdUpdated` event. * */ - function _setThreshold( - uint256 _numerator, - uint256 _denominator - ) internal virtual returns (uint256 _previousNum, uint256 _previousDenom) { + function _setThreshold(uint256 _numerator, uint256 _denominator) + internal + virtual + returns (uint256 _previousNum, uint256 _previousDenom) + { if (_numerator > _denominator) revert ErrInvalidThreshold(msg.sig); _previousNum = _num; _previousDenom = _denom; diff --git a/src/mainchain/MainchainGatewayBatcher.sol b/src/mainchain/MainchainGatewayBatcher.sol index add22028..2d02a006 100644 --- a/src/mainchain/MainchainGatewayBatcher.sol +++ b/src/mainchain/MainchainGatewayBatcher.sol @@ -2,12 +2,13 @@ pragma solidity ^0.8.0; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; +import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol"; import "../libraries/LibRequestBatch.sol"; import "../libraries/LibTokenInfoBatch.sol"; import "./MainchainGatewayV3.sol"; -contract MainchainGatewayBatcher is Initializable { +contract MainchainGatewayBatcher is Initializable, ERC1155Holder { using LibRequestBatch for RequestBatch; using LibTokenInfoBatch for TokenInfoBatch; diff --git a/src/mainchain/MainchainGatewayV3.sol b/src/mainchain/MainchainGatewayV3.sol index 4e48cd3c..b13a11f0 100644 --- a/src/mainchain/MainchainGatewayV3.sol +++ b/src/mainchain/MainchainGatewayV3.sol @@ -3,6 +3,7 @@ pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; +import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol"; import { IBridgeManager } from "../interfaces/bridge/IBridgeManager.sol"; import { IBridgeManagerCallback } from "../interfaces/bridge/IBridgeManagerCallback.sol"; import { HasContracts, ContractType } from "../extensions/collections/HasContracts.sol"; @@ -14,6 +15,7 @@ contract MainchainGatewayV3 is WithdrawalLimitation, Initializable, AccessControlEnumerable, + ERC1155Holder, IMainchainGatewayV3, HasContracts { @@ -456,4 +458,12 @@ contract MainchainGatewayV3 is function _getWeight(address _addr) internal view returns (uint256) { return IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)).getBridgeOperatorWeight(_addr); } + + function supportsInterface(bytes4 interfaceId) + public + view + override(AccessControlEnumerable, ERC1155Receiver) returns (bool) + { + return AccessControlEnumerable.supportsInterface(interfaceId) || ERC1155Receiver.supportsInterface(interfaceId); + } } diff --git a/src/ronin/gateway/RoninGatewayV3.sol b/src/ronin/gateway/RoninGatewayV3.sol index b0812b46..f39bec8b 100644 --- a/src/ronin/gateway/RoninGatewayV3.sol +++ b/src/ronin/gateway/RoninGatewayV3.sol @@ -3,6 +3,7 @@ pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; +import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol"; import "../../extensions/GatewayV3.sol"; import "../../extensions/collections/HasContracts.sol"; import "../../extensions/MinimumWithdrawal.sol"; @@ -20,6 +21,7 @@ contract RoninGatewayV3 is Initializable, MinimumWithdrawal, AccessControlEnumerable, + ERC1155Holder, VoteStatusConsumer, IRoninGatewayV3, HasContracts @@ -528,4 +530,12 @@ contract RoninGatewayV3 is function _minimumTrustedVoteWeight(uint256 _totalTrustedWeight) internal view virtual returns (uint256) { return (_trustedNum * _totalTrustedWeight + _trustedDenom - 1) / _trustedDenom; } + + function supportsInterface(bytes4 interfaceId) + public + view + override(AccessControlEnumerable, ERC1155Receiver) returns (bool) + { + return AccessControlEnumerable.supportsInterface(interfaceId) || ERC1155Receiver.supportsInterface(interfaceId); + } } From 9b8fc4a63e1cb7fe3ba7b43109b7f4fc565fc132 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 18 Mar 2024 18:17:26 +0700 Subject: [PATCH 080/180] test(ERC1155): fix the first test --- test/bridge/integration/BaseIntegration.t.sol | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index 368e533a..27b6e5fb 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -83,6 +83,7 @@ contract BaseIntegration_Test is Base_Test { MockERC20 _roninSlp; MockERC20 _roninUsdc; MockERC721 _roninMockERC721; + MockERC1155 _roninMockERC1155; MockWrappedToken _mainchainWeth; MockERC20 _mainchainAxs; @@ -128,6 +129,7 @@ contract BaseIntegration_Test is Base_Test { _roninSlp = new SLPDeploy().run(); _roninUsdc = new USDCDeploy().run(); _roninMockERC721 = new MockERC721Deploy().run(); + _roninMockERC1155 = new MockERC1155Deploy().run(); _param = ISharedArgument(LibSharedAddress.CONFIG).sharedArguments(); _roninProposalUtils = @@ -239,17 +241,14 @@ contract BaseIntegration_Test is Base_Test { } function _roninGatewayV3Initialize() internal { - (address[] memory mainchainTokens, address[] memory roninTokens) = _getMainchainAndRoninTokens(); + (address[] memory mainchainTokens, address[] memory roninTokens, TokenStandard[] memory standards) = _getMainchainAndRoninTokens(); uint256 tokenNum = mainchainTokens.length; // reserve slot for ERC721Tokens uint256[] memory minimumThreshold = new uint256[](tokenNum); uint256[] memory chainIds = new uint256[](tokenNum); - TokenStandard[] memory standards = new TokenStandard[](tokenNum); - for (uint256 i; i < tokenNum; i++) { - bool isERC721 = i == mainchainTokens.length - 1; // last item is ERC721 + for (uint256 i; i < tokenNum; i++) { minimumThreshold[i] = 20; chainIds[i] = block.chainid; - standards[i] = isERC721 ? TokenStandard.ERC721 : TokenStandard.ERC20; } // Ronin Gateway V3 @@ -437,28 +436,24 @@ contract BaseIntegration_Test is Base_Test { } function _mainchainGatewayV3Initialize() internal { - (address[] memory mainchainTokens, address[] memory roninTokens) = _getMainchainAndRoninTokens(); + (address[] memory mainchainTokens, address[] memory roninTokens, TokenStandard[] memory standards) = _getMainchainAndRoninTokens(); uint256 tokenNum = mainchainTokens.length; uint256[] memory highTierThreshold = new uint256[](tokenNum); uint256[] memory lockedThreshold = new uint256[](tokenNum); uint256[] memory unlockFeePercentages = new uint256[](tokenNum); uint256[] memory dailyWithdrawalLimits = new uint256[](tokenNum); - TokenStandard[] memory standards = new TokenStandard[](tokenNum); for (uint256 i; i < tokenNum; i++) { - bool isERC721 = i == mainchainTokens.length - 1; // last item is ERC721 - highTierThreshold[i] = 10; lockedThreshold[i] = 20; unlockFeePercentages[i] = 100_000; dailyWithdrawalLimits[i] = 12; - standards[i] = isERC721 ? TokenStandard.ERC721 : TokenStandard.ERC20; } // Mainchain Gateway V3 _param.mainchainGatewayV3.wrappedToken = address(_mainchainWeth); - _param.mainchainGatewayV3.addresses[0] = mainchainTokens; // (ERC20 + ERC721) - _param.mainchainGatewayV3.addresses[1] = roninTokens; // (ERC20 + ERC721) + _param.mainchainGatewayV3.addresses[0] = mainchainTokens; // (ERC20 + ERC721 + ERC1155) + _param.mainchainGatewayV3.addresses[1] = roninTokens; // (ERC20 + ERC721 + ERC1155) _param.mainchainGatewayV3.addresses[2] = getEmptyAddressArray(); _param.mainchainGatewayV3.thresholds[0] = highTierThreshold; _param.mainchainGatewayV3.thresholds[1] = lockedThreshold; @@ -494,23 +489,33 @@ contract BaseIntegration_Test is Base_Test { function _getMainchainAndRoninTokens() internal view - returns (address[] memory mainchainTokens, address[] memory roninTokens) + returns (address[] memory mainchainTokens, address[] memory roninTokens, TokenStandard[] memory standards) { - uint256 tokenNum = 5; + uint256 tokenNum = 6; mainchainTokens = new address[](tokenNum); roninTokens = new address[](tokenNum); + standards = new TokenStandard[](tokenNum); mainchainTokens[0] = address(_mainchainWeth); mainchainTokens[1] = address(_mainchainAxs); mainchainTokens[2] = address(_mainchainSlp); mainchainTokens[3] = address(_mainchainUsdc); mainchainTokens[4] = address(_mainchainMockERC721); + mainchainTokens[5] = address(_mainchainMockERC1155); roninTokens[0] = address(_roninWeth); roninTokens[1] = address(_roninAxs); roninTokens[2] = address(_roninSlp); roninTokens[3] = address(_roninUsdc); roninTokens[4] = address(_roninMockERC721); + roninTokens[5] = address(_roninMockERC1155); + + standards[0] = TokenStandard.ERC20; + standards[1] = TokenStandard.ERC20; + standards[2] = TokenStandard.ERC20; + standards[3] = TokenStandard.ERC20; + standards[4] = TokenStandard.ERC721; + standards[5] = TokenStandard.ERC1155; } function _changeAdminOnRonin() internal { From ceb797952aa060c07173b07400f19fc552a09341 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 20 Mar 2024 10:49:03 +0700 Subject: [PATCH 081/180] fix(RoninGateway): add initializer --- src/ronin/gateway/RoninBridgeManager.sol | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ronin/gateway/RoninBridgeManager.sol b/src/ronin/gateway/RoninBridgeManager.sol index 38d135da..5ca59ab1 100644 --- a/src/ronin/gateway/RoninBridgeManager.sol +++ b/src/ronin/gateway/RoninBridgeManager.sol @@ -12,7 +12,6 @@ import { VoteStatusConsumer } from "../../interfaces/consumers/VoteStatusConsume import { ErrQueryForEmptyVote } from "../../utils/CommonErrors.sol"; contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernanceProposal { - function initialize( uint256 num, uint256 denom, @@ -24,8 +23,8 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan address[] memory governors, uint96[] memory voteWeights, GlobalProposal.TargetOption[] memory targetOptions, - address[] memory targets) external - { + address[] memory targets + ) external initializer { __CoreGovernance_init(expiryDuration); __GlobalCoreGovernance_init(targetOptions, targets); __BridgeManager_init(num, denom, roninChainId, bridgeContract, callbackRegisters, bridgeOperators, governors, voteWeights); From 7eb813a58fa1225229c0d1fc866bd6f051babc3e Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 20 Mar 2024 10:53:35 +0700 Subject: [PATCH 082/180] fix(*BridgeManager): fix assertion in threshold --- .../bridge-operator-governance/BridgeManagerQuorum.sol | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol b/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol index 705656d9..51f50a8a 100644 --- a/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol +++ b/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol @@ -59,7 +59,10 @@ abstract contract BridgeManagerQuorum is IQuorum, IdentityGuard { * */ function _setThreshold(uint256 numerator, uint256 denominator) internal virtual returns (uint256 previousNum, uint256 previousDenom) { - if (numerator > denominator) revert ErrInvalidThreshold(msg.sig); + if ( + numerator > denominator // Assert valid fraction + || denominator < 2 // Avoid divide by zero, and avoid only require 1 manager + ) revert ErrInvalidThreshold(msg.sig); BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage(); From 7f00621a67623588da26baf693bd2d03db788f0e Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 20 Mar 2024 10:55:33 +0700 Subject: [PATCH 083/180] fix(MainchainGateway): assert chainId in withdrawal --- src/mainchain/MainchainGatewayV3.sol | 31 +++++++--------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/src/mainchain/MainchainGatewayV3.sol b/src/mainchain/MainchainGatewayV3.sol index dd1fab10..0fedfc7d 100644 --- a/src/mainchain/MainchainGatewayV3.sol +++ b/src/mainchain/MainchainGatewayV3.sol @@ -10,14 +10,7 @@ import "../extensions/WithdrawalLimitation.sol"; import "../libraries/Transfer.sol"; import "../interfaces/IMainchainGatewayV3.sol"; -contract MainchainGatewayV3 is - WithdrawalLimitation, - Initializable, - AccessControlEnumerable, - IMainchainGatewayV3, - HasContracts, - IBridgeManagerCallback -{ +contract MainchainGatewayV3 is WithdrawalLimitation, Initializable, AccessControlEnumerable, IMainchainGatewayV3, HasContracts, IBridgeManagerCallback { using Token for Token.Info; using Transfer for Transfer.Request; using Transfer for Transfer.Receipt; @@ -118,7 +111,7 @@ contract MainchainGatewayV3 is /** * @dev Receives ether without doing anything. Use this function to topup native token. */ - function receiveEther() external payable {} + function receiveEther() external payable { } /** * @inheritdoc IMainchainGatewayV3 @@ -144,10 +137,7 @@ contract MainchainGatewayV3 is /** * @inheritdoc IMainchainGatewayV3 */ - function submitWithdrawal( - Transfer.Receipt calldata _receipt, - Signature[] calldata _signatures - ) external virtual whenNotPaused returns (bool _locked) { + function submitWithdrawal(Transfer.Receipt calldata _receipt, Signature[] calldata _signatures) external virtual whenNotPaused returns (bool _locked) { return _submitWithdrawal(_receipt, _signatures); } @@ -184,11 +174,7 @@ contract MainchainGatewayV3 is /** * @inheritdoc IMainchainGatewayV3 */ - function mapTokens( - address[] calldata _mainchainTokens, - address[] calldata _roninTokens, - Token.Standard[] calldata _standards - ) external virtual onlyAdmin { + function mapTokens(address[] calldata _mainchainTokens, address[] calldata _roninTokens, Token.Standard[] calldata _standards) external virtual onlyAdmin { if (_mainchainTokens.length == 0) revert ErrEmptyArray(); _mapTokens(_mainchainTokens, _roninTokens, _standards); } @@ -270,7 +256,9 @@ contract MainchainGatewayV3 is MappedToken memory token = getRoninToken(receipt.mainchain.tokenAddr); - if (!(token.erc == receipt.info.erc && token.tokenAddr == receipt.ronin.tokenAddr)) revert ErrInvalidReceipt(); + if (!(token.erc == receipt.info.erc && token.tokenAddr == receipt.ronin.tokenAddr && receipt.ronin.chainId == roninChainId)) { + revert ErrInvalidReceipt(); + } if (withdrawalHash[id] != 0) revert ErrQueryForProcessedWithdrawal(); @@ -484,10 +472,7 @@ contract MainchainGatewayV3 is /** * @inheritdoc IBridgeManagerCallback */ - function onBridgeOperatorsRemoved( - address[] calldata operators, - bool[] calldata removeds - ) external onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) { + function onBridgeOperatorsRemoved(address[] calldata operators, bool[] calldata removeds) external onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) { uint length = operators.length; if (length != removeds.length) revert ErrLengthMismatch(msg.sig); if (length == 0) { From d10f739618a594535671ef843b08446e55ba3146 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 20 Mar 2024 10:57:21 +0700 Subject: [PATCH 084/180] feat(Gateway, Slash): remove onBridgeOperatorUpdated method --- lib/foundry-deployment-kit | 2 +- src/interfaces/bridge/IBridgeManagerCallback.sol | 11 ----------- src/mainchain/MainchainGatewayV3.sol | 10 ---------- src/ronin/gateway/BridgeSlash.sol | 15 --------------- 4 files changed, 1 insertion(+), 37 deletions(-) diff --git a/lib/foundry-deployment-kit b/lib/foundry-deployment-kit index 3aa1ca23..8c728424 160000 --- a/lib/foundry-deployment-kit +++ b/lib/foundry-deployment-kit @@ -1 +1 @@ -Subproject commit 3aa1ca23adaa55a2e04818b0dced14947e4e5c28 +Subproject commit 8c728424858f8c8358f2e0f9374a6ea581f46486 diff --git a/src/interfaces/bridge/IBridgeManagerCallback.sol b/src/interfaces/bridge/IBridgeManagerCallback.sol index 2c879a5c..9d63f0f8 100644 --- a/src/interfaces/bridge/IBridgeManagerCallback.sol +++ b/src/interfaces/bridge/IBridgeManagerCallback.sol @@ -30,15 +30,4 @@ interface IBridgeManagerCallback is IERC165 { address[] memory bridgeOperators, bool[] memory removeds ) external returns (bytes4 selector); - - /** - * @dev Handles the event when a bridge operator is updated. - * @param currentBridgeOperator The address of the current bridge operator. - * @param newbridgeOperator The new address of the bridge operator. - * @return selector The selector of the function being called. - */ - function onBridgeOperatorUpdated( - address currentBridgeOperator, - address newbridgeOperator - ) external returns (bytes4 selector); } diff --git a/src/mainchain/MainchainGatewayV3.sol b/src/mainchain/MainchainGatewayV3.sol index 0fedfc7d..6a0f367d 100644 --- a/src/mainchain/MainchainGatewayV3.sol +++ b/src/mainchain/MainchainGatewayV3.sol @@ -459,16 +459,6 @@ contract MainchainGatewayV3 is WithdrawalLimitation, Initializable, AccessContro return IBridgeManagerCallback.onBridgeOperatorsAdded.selector; } - /** - * @inheritdoc IBridgeManagerCallback - */ - function onBridgeOperatorUpdated(address currOperator, address newOperator) external onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) { - _operatorWeight[newOperator] = _operatorWeight[currOperator]; - delete _operatorWeight[currOperator]; - - return IBridgeManagerCallback.onBridgeOperatorUpdated.selector; - } - /** * @inheritdoc IBridgeManagerCallback */ diff --git a/src/ronin/gateway/BridgeSlash.sol b/src/ronin/gateway/BridgeSlash.sol index 5c43e32d..ae0a9739 100644 --- a/src/ronin/gateway/BridgeSlash.sol +++ b/src/ronin/gateway/BridgeSlash.sol @@ -118,21 +118,6 @@ contract BridgeSlash is return IBridgeManagerCallback.onBridgeOperatorsAdded.selector; } - /** - * @inheritdoc IBridgeManagerCallback - */ - function onBridgeOperatorUpdated( - address currentBridgeOperator, - address newBridgeOperator - ) external onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) { - mapping(address => BridgeSlashInfo) storage _bridgeSlashInfos = _getBridgeSlashInfos(); - - _bridgeSlashInfos[newBridgeOperator] = _bridgeSlashInfos[currentBridgeOperator]; - delete _bridgeSlashInfos[currentBridgeOperator]; - - return IBridgeManagerCallback.onBridgeOperatorUpdated.selector; - } - /** * @inheritdoc IBridgeSlash */ From 5fe83ca8fc18a88bedaea1caa8a36b71c762b527 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 20 Mar 2024 11:49:12 +0700 Subject: [PATCH 085/180] fix(Manager,MainchainGateway): revert on register fail --- .../BridgeManagerCallbackRegister.sol | 42 +++++++++++-------- .../bridge/IBridgeManagerCallbackRegister.sol | 2 + src/mainchain/MainchainGatewayV3.sol | 4 ++ ...al.MainchainGatewayV3.weth.benchmark.t.sol | 8 ++-- 4 files changed, 34 insertions(+), 22 deletions(-) diff --git a/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol b/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol index 32efcef6..87d975ab 100644 --- a/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol +++ b/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol @@ -33,9 +33,7 @@ abstract contract BridgeManagerCallbackRegister is IdentityGuard, IBridgeManager /** * @inheritdoc IBridgeManagerCallbackRegister */ - function unregisterCallbacks( - address[] calldata registers - ) external onlySelfCall returns (bool[] memory unregistereds) { + function unregisterCallbacks(address[] calldata registers) external onlySelfCall returns (bool[] memory unregistereds) { unregistereds = _unregisterCallbacks(registers); } @@ -51,9 +49,7 @@ abstract contract BridgeManagerCallbackRegister is IdentityGuard, IBridgeManager * @param registers The array of callback addresses to register. * @return registereds An array indicating the success status of each registration. */ - function _registerCallbacks( - address[] memory registers - ) internal nonDuplicate(registers) returns (bool[] memory registereds) { + function _registerCallbacks(address[] memory registers) internal nonDuplicate(registers) returns (bool[] memory registereds) { uint256 length = registers.length; registereds = new bool[](length); if (length == 0) return registereds; @@ -62,7 +58,7 @@ abstract contract BridgeManagerCallbackRegister is IdentityGuard, IBridgeManager address register; bytes4 callbackInterface = type(IBridgeManagerCallback).interfaceId; - for (uint256 i; i < length; ) { + for (uint256 i; i < length;) { register = registers[i]; _requireHasCode(register); @@ -81,14 +77,12 @@ abstract contract BridgeManagerCallbackRegister is IdentityGuard, IBridgeManager * @param registers The array of callback addresses to unregister. * @return unregistereds An array indicating the success status of each unregistration. */ - function _unregisterCallbacks( - address[] memory registers - ) internal nonDuplicate(registers) returns (bool[] memory unregistereds) { + function _unregisterCallbacks(address[] memory registers) internal nonDuplicate(registers) returns (bool[] memory unregistereds) { uint256 length = registers.length; unregistereds = new bool[](length); EnumerableSet.AddressSet storage _callbackRegisters = _getCallbackRegisters(); - for (uint256 i; i < length; ) { + for (uint256 i; i < length;) { unregistereds[i] = _callbackRegisters.remove(registers[i]); unchecked { @@ -97,29 +91,41 @@ abstract contract BridgeManagerCallbackRegister is IdentityGuard, IBridgeManager } } + /** + * @dev Same as {_notifyRegistersUnsafe} but revert when there at least one failed internal call. + */ + function _notifyRegisters(bytes4 callbackFnSig, bytes memory inputs) internal { + if (!_notifyRegistersUnsafe(callbackFnSig, inputs)) { + // revert ErrExistOneInternalCallFailed(msg.sender, callbackFnSig, inputs); + } + } + /** * @dev Internal function to notify all registered callbacks with the provided function signature and data. * @param callbackFnSig The function signature of the callback method. * @param inputs The data to pass to the callback method. + * @return allSuccess Return true if all internal calls are success */ - function _notifyRegisters(bytes4 callbackFnSig, bytes memory inputs) internal { + function _notifyRegistersUnsafe(bytes4 callbackFnSig, bytes memory inputs) internal returns (bool allSuccess) { + allSuccess = true; + address[] memory registers = _getCallbackRegisters().values(); uint256 length = registers.length; - if (length == 0) return; + if (length == 0) return allSuccess; bool[] memory successes = new bool[](length); bytes[] memory returnDatas = new bytes[](length); bytes memory callData = abi.encodePacked(callbackFnSig, inputs); bytes memory proxyCallData = abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (callData)); - for (uint256 i; i < length; ) { + for (uint256 i; i < length; i++) { + // First, attempt to call normally (successes[i], returnDatas[i]) = registers[i].call(callData); + + // If cannot call normally, attempt to call as the recipient is the proxy, and this caller is its admin. if (!successes[i]) { (successes[i], returnDatas[i]) = registers[i].call(proxyCallData); - } - - unchecked { - ++i; + allSuccess = allSuccess && successes[i]; } } diff --git a/src/interfaces/bridge/IBridgeManagerCallbackRegister.sol b/src/interfaces/bridge/IBridgeManagerCallbackRegister.sol index 2eea55ad..85177ad0 100644 --- a/src/interfaces/bridge/IBridgeManagerCallbackRegister.sol +++ b/src/interfaces/bridge/IBridgeManagerCallbackRegister.sol @@ -2,6 +2,8 @@ pragma solidity ^0.8.0; interface IBridgeManagerCallbackRegister { + error ErrExistOneInternalCallFailed(address sender, bytes4 msgSig, bytes callData); + /** * @dev Emitted when the contract notifies multiple registers with statuses and return data. */ diff --git a/src/mainchain/MainchainGatewayV3.sol b/src/mainchain/MainchainGatewayV3.sol index 6a0f367d..8281b8c7 100644 --- a/src/mainchain/MainchainGatewayV3.sol +++ b/src/mainchain/MainchainGatewayV3.sol @@ -433,6 +433,10 @@ contract MainchainGatewayV3 is WithdrawalLimitation, Initializable, AccessContro // CALLBACKS /////////////////////////////////////////////// + function supportsInterface(bytes4 interfaceId) public view override(AccessControlEnumerable, IERC165) returns (bool) { + return interfaceId == type(IMainchainGatewayV3).interfaceId || super.supportsInterface(interfaceId); + } + /** * @inheritdoc IBridgeManagerCallback */ diff --git a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.weth.benchmark.t.sol b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.weth.benchmark.t.sol index cf190f85..12360a3f 100644 --- a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.weth.benchmark.t.sol +++ b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.weth.benchmark.t.sol @@ -27,10 +27,10 @@ contract SubmitWithdrawal_MainchainGatewayV3_Weth_Benchmark_Test is BaseIntegrat _withdrawalReceipt.kind = Transfer.Kind.Withdrawal; _withdrawalReceipt.ronin.addr = makeAddr("requester"); _withdrawalReceipt.ronin.tokenAddr = address(_roninWeth); - _withdrawalReceipt.ronin.chainId =block.chainid; + _withdrawalReceipt.ronin.chainId = block.chainid; _withdrawalReceipt.mainchain.addr = address(notReceiveEtherRecipient); _withdrawalReceipt.mainchain.tokenAddr = address(_mainchainWeth); - _withdrawalReceipt.mainchain.chainId =block.chainid; + _withdrawalReceipt.mainchain.chainId = block.chainid; _withdrawalReceipt.info.erc = Token.Standard.ERC20; _withdrawalReceipt.info.id = 0; _withdrawalReceipt.info.quantity = 0; @@ -60,7 +60,7 @@ contract DiscardEther { _fallback(); } - function _fallback() internal { + function _fallback() internal pure { revert("Not receive ether"); } -} \ No newline at end of file +} From 7c4f5ec9b48a322da10dff3022976ec9d3550123 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 20 Mar 2024 13:50:06 +0700 Subject: [PATCH 086/180] Revert "fix(*BridgeManager): fix assertion in threshold" This reverts commit 7eb813a58fa1225229c0d1fc866bd6f051babc3e. --- .../bridge-operator-governance/BridgeManagerQuorum.sol | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol b/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol index 51f50a8a..705656d9 100644 --- a/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol +++ b/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol @@ -59,10 +59,7 @@ abstract contract BridgeManagerQuorum is IQuorum, IdentityGuard { * */ function _setThreshold(uint256 numerator, uint256 denominator) internal virtual returns (uint256 previousNum, uint256 previousDenom) { - if ( - numerator > denominator // Assert valid fraction - || denominator < 2 // Avoid divide by zero, and avoid only require 1 manager - ) revert ErrInvalidThreshold(msg.sig); + if (numerator > denominator) revert ErrInvalidThreshold(msg.sig); BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage(); From 82cba08d1b018183b77e0c64641b5a3a01f0bd4e Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 20 Mar 2024 14:04:57 +0700 Subject: [PATCH 087/180] fix(MainchainGateway): fix initV3 by call to bridge manager --- src/mainchain/MainchainGatewayV3.sol | 5 ++++- test/bridge/integration/BaseIntegration.t.sol | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mainchain/MainchainGatewayV3.sol b/src/mainchain/MainchainGatewayV3.sol index 8281b8c7..bf618c91 100644 --- a/src/mainchain/MainchainGatewayV3.sol +++ b/src/mainchain/MainchainGatewayV3.sol @@ -99,7 +99,10 @@ contract MainchainGatewayV3 is WithdrawalLimitation, Initializable, AccessContro _setContract(ContractType.BRIDGE_MANAGER, bridgeManagerContract); } - function initializeV3(address[] calldata operators, uint96[] calldata weights) external reinitializer(3) { + function initializeV3() external reinitializer(3) { + IBridgeManager mainchainBridgeManager = IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)); + (, address[] memory operators, uint96[] memory weights) = mainchainBridgeManager.getFullBridgeOperatorInfos(); + uint96 totalWeight; for (uint i; i < operators.length; i++) { _operatorWeight[operators[i]] = weights[i]; diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index 0be51cd2..8d983235 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -485,7 +485,7 @@ contract BaseIntegration_Test is Base_Test { ); _mainchainGatewayV3.initializeV2(address(_mainchainBridgeManager)); - _mainchainGatewayV3.initializeV3(_param.mainchainBridgeManager.bridgeOperators, _param.mainchainBridgeManager.voteWeights); + _mainchainGatewayV3.initializeV3(); } function _mainchainPauseEnforcerInitialize() internal { @@ -576,7 +576,7 @@ contract BaseIntegration_Test is Base_Test { LibTransfer.Receipt memory receipt, uint256[] memory signerPKs, bytes32 domainSeparator - ) internal pure returns (SignatureConsumer.Signature[] memory sigs) { + ) internal pure returns (SignatureConsumer.Signature[] memory sigs) { sigs = new SignatureConsumer.Signature[](signerPKs.length); for (uint256 i; i < signerPKs.length; i++) { From 71c0f1c3395f47919238406bf57a528b683df861 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 20 Mar 2024 14:17:58 +0700 Subject: [PATCH 088/180] fix(BridgeReward): chore: add comment --- src/ronin/gateway/BridgeReward.sol | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ronin/gateway/BridgeReward.sol b/src/ronin/gateway/BridgeReward.sol index 9798bcc0..cedd09c8 100644 --- a/src/ronin/gateway/BridgeReward.sol +++ b/src/ronin/gateway/BridgeReward.sol @@ -163,7 +163,8 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT function _assertPeriod(uint256 currPd, uint256 pdCount, uint256 lastRewardPd) internal pure { if (pdCount == 0) revert ErrPeriodCountIsZero(); - // Not settle the period that already rewarded. + // Not settle the period that already rewarded. This check may redundant as in the following assertion. + // However, not increase much in gas, this is kept for obvious in error handling. if (currPd <= lastRewardPd + 1) revert ErrPeriodAlreadyRewarded(currPd, lastRewardPd); // Not settle the periods that not happen yet. From d252469305a2115a6d584ce83c174dd7800aba33 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 20 Mar 2024 15:01:41 +0700 Subject: [PATCH 089/180] fix(BridgeReward): correct the claimed and total scattered --- src/interfaces/bridge/IBridgeReward.sol | 12 +++-- src/ronin/gateway/BridgeReward.sol | 30 ++++++++---- .../settleReward/settleReward.t.sol | 46 +++++++++++++++++++ 3 files changed, 73 insertions(+), 15 deletions(-) diff --git a/src/interfaces/bridge/IBridgeReward.sol b/src/interfaces/bridge/IBridgeReward.sol index f3668fc9..7287064a 100644 --- a/src/interfaces/bridge/IBridgeReward.sol +++ b/src/interfaces/bridge/IBridgeReward.sol @@ -26,14 +26,12 @@ interface IBridgeReward is IBridgeRewardEvents { function execSyncRewardAuto(uint256 currentPeriod) external; /** - * @dev Retrieve the total amount of rewards that have been topped up in the contract. - * @return totalRewardToppedUp The total rewards topped up value. + * @dev Returns the total amount of rewards that have been topped up in the contract. */ function getTotalRewardToppedUp() external view returns (uint256); /** - * @dev Retrieve the total amount of rewards that have been scattered to bridge operators in the contract. - * @return totalRewardScattered The total rewards scattered value. + * @dev Returns the total reward amount scattered to the operators, excluding the slashed reward and failed-to-transfer reward. */ function getTotalRewardScattered() external view returns (uint256); @@ -44,10 +42,14 @@ interface IBridgeReward is IBridgeRewardEvents { /** * @dev External function to retrieve the latest rewarded period in the contract. - * @return latestRewardedPeriod The latest rewarded period value. */ function getLatestRewardedPeriod() external view returns (uint256); + /** + * @dev Returns the claimed and slashed reward amount of the `operator`. + */ + function getRewardInfo(address operator) external view returns (BridgeRewardInfo memory rewardInfo); + /** * @dev Setter for all bridge operators per period. */ diff --git a/src/ronin/gateway/BridgeReward.sol b/src/ronin/gateway/BridgeReward.sol index cedd09c8..e1719d98 100644 --- a/src/ronin/gateway/BridgeReward.sol +++ b/src/ronin/gateway/BridgeReward.sol @@ -70,7 +70,7 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT } /** - @dev The following must be assured after initializing V2: + * @dev The following must be assured after initializing V2: * ``` * {BridgeTracking}._lastSyncPeriod * == {RoninValidatorSet}.currentPeriod() @@ -228,8 +228,8 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT slashUntilPeriod: slashedDurationList[i] }); - sumRewards += shouldSlash ? 0 : reward; - _updateRewardAndTransfer({ period: period, operator: operators[i], reward: reward, shouldSlash: shouldSlash }); + bool scattered = _updateRewardAndTransfer({ period: period, operator: operators[i], reward: reward, shouldSlash: shouldSlash }); + sumRewards += (shouldSlash || !scattered) ? 0 : reward; } $_TOTAL_REWARDS_SCATTERED.addAssign(sumRewards); @@ -307,19 +307,22 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT /** * @dev Transfer `reward` to a `operator` or only emit event based on the operator `slashed` status. */ - function _updateRewardAndTransfer(uint256 period, address operator, uint256 reward, bool shouldSlash) private { + function _updateRewardAndTransfer(uint256 period, address operator, uint256 reward, bool shouldSlash) private returns (bool scattered) { BridgeRewardInfo storage _iRewardInfo = _getRewardInfo()[operator]; if (shouldSlash) { _iRewardInfo.slashed += reward; emit BridgeRewardSlashed(period, operator, reward); - } else { + return false; + } + + if (_unsafeSendRONLimitGas({ recipient: payable(operator), amount: reward, gas: 0 })) { _iRewardInfo.claimed += reward; - if (_unsafeSendRONLimitGas({ recipient: payable(operator), amount: reward, gas: 0 })) { - emit BridgeRewardScattered(period, operator, reward); - } else { - emit BridgeRewardScatterFailed(period, operator, reward); - } + emit BridgeRewardScattered(period, operator, reward); + return true; + } else { + emit BridgeRewardScatterFailed(period, operator, reward); + return false; } } @@ -337,6 +340,13 @@ contract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONT return $_LATEST_REWARDED_PERIOD.load(); } + /** + * @inheritdoc IBridgeReward + */ + function getRewardInfo(address operator) external view returns (BridgeRewardInfo memory rewardInfo) { + return _getRewardInfo()[operator]; + } + /** * @inheritdoc IBridgeReward */ diff --git a/test/bridge/unit/concrete/bridge-reward/settleReward/settleReward.t.sol b/test/bridge/unit/concrete/bridge-reward/settleReward/settleReward.t.sol index cc5feddc..82f41c31 100644 --- a/test/bridge/unit/concrete/bridge-reward/settleReward/settleReward.t.sol +++ b/test/bridge/unit/concrete/bridge-reward/settleReward/settleReward.t.sol @@ -128,6 +128,52 @@ contract SettleReward_Unit_Concrete_Test is _bridgeReward.exposed_settleReward({ operators: operators, ballots: ballots, totalBallot: totalBallot, totalVote: totalVote, period: period }); assertEq(_bridgeReward.getLatestRewardedPeriod(), period); + + BridgeRewardInfo memory rewardInfo; + for (uint i; i < operators.length; i++) { + rewardInfo = _bridgeReward.getRewardInfo(operators[i]); + assertEq(rewardInfo.claimed, _rewardPerPeriod / operators.length); + } + assertEq(_bridgeReward.getTotalRewardScattered(), _rewardPerPeriod); + } + + function test_settleReward_ShareEqually_WhenNoVote_ButFundIsLackForOneOperator() external { + (address[] memory operators, uint256[] memory ballots, uint256 totalBallot, uint256 totalVote) = _generateInput_shareRewardProportionally(); + uint256 period = _validatorSetContract.currentPeriod(); + + uint nOperator = operators.length; + uint rewardShared = _rewardPerPeriod / nOperator; + + ballots[0] = 0; + ballots[1] = 0; + ballots[2] = 0; + ballots[3] = 0; + totalBallot = 0; + totalVote = 100; + + uint cheatBalance = rewardShared * (nOperator - 1); + vm.deal(address(_bridgeReward), cheatBalance); + + for (uint i; i < nOperator - 1; i++) { + vm.expectEmit({ emitter: address(_bridgeReward) }); + emit BridgeRewardScattered(period, operators[i], _rewardPerPeriod / nOperator); + } + + vm.expectEmit({ emitter: address(_bridgeReward) }); + emit BridgeRewardScatterFailed(period, operators[nOperator - 1], _rewardPerPeriod / nOperator); + + _bridgeReward.exposed_settleReward({ operators: operators, ballots: ballots, totalBallot: totalBallot, totalVote: totalVote, period: period }); + assertEq(_bridgeReward.getLatestRewardedPeriod(), period); + + BridgeRewardInfo memory rewardInfo; + for (uint i; i < nOperator - 1; i++) { + rewardInfo = _bridgeReward.getRewardInfo(operators[i]); + assertEq(rewardInfo.claimed, rewardShared); + } + + rewardInfo = _bridgeReward.getRewardInfo(operators[nOperator - 1]); + assertEq(rewardInfo.claimed, 0); + assertEq(_bridgeReward.getTotalRewardScattered(), cheatBalance); } function test_settleReward_SharePropotionally() public { From 59df650be9e8e092ed2d6cacbd080faebe67acc8 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Thu, 21 Mar 2024 10:59:10 +0700 Subject: [PATCH 090/180] fix(*BridgeManager): assert threshold --- .../bridge-operator-governance/BridgeManagerQuorum.sol | 2 +- src/mocks/ronin/MockBridgeManager.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol b/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol index 705656d9..26b7bbc6 100644 --- a/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol +++ b/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol @@ -59,7 +59,7 @@ abstract contract BridgeManagerQuorum is IQuorum, IdentityGuard { * */ function _setThreshold(uint256 numerator, uint256 denominator) internal virtual returns (uint256 previousNum, uint256 previousDenom) { - if (numerator > denominator) revert ErrInvalidThreshold(msg.sig); + if (numerator > denominator || denominator <= 1) revert ErrInvalidThreshold(msg.sig); BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage(); diff --git a/src/mocks/ronin/MockBridgeManager.sol b/src/mocks/ronin/MockBridgeManager.sol index a7dbe01a..a1e0eeb6 100644 --- a/src/mocks/ronin/MockBridgeManager.sol +++ b/src/mocks/ronin/MockBridgeManager.sol @@ -8,7 +8,7 @@ contract MockBridgeManager is BridgeManager { address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights - ) payable BridgeManager(0, 0, 0, address(0), _getEmptyAddressArray(), bridgeOperators, governors, voteWeights) {} + ) payable BridgeManager(0, 2, 0, address(0), _getEmptyAddressArray(), bridgeOperators, governors, voteWeights) {} function _getEmptyAddressArray() internal pure returns (address[] memory arr) {} } From 5e7ed806b8e679d4c2ceb038a0aca1f7bd8cd7c5 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Fri, 22 Mar 2024 10:50:51 +0700 Subject: [PATCH 091/180] fix(BridgeManagerCallback): uncomment temp disabled check --- .../BridgeManagerCallbackRegister.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol b/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol index 87d975ab..28879c63 100644 --- a/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol +++ b/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol @@ -96,7 +96,7 @@ abstract contract BridgeManagerCallbackRegister is IdentityGuard, IBridgeManager */ function _notifyRegisters(bytes4 callbackFnSig, bytes memory inputs) internal { if (!_notifyRegistersUnsafe(callbackFnSig, inputs)) { - // revert ErrExistOneInternalCallFailed(msg.sender, callbackFnSig, inputs); + revert ErrExistOneInternalCallFailed(msg.sender, callbackFnSig, inputs); } } From 584ad07fe3b4459b3ceeb216021349357b396ae8 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Fri, 22 Mar 2024 10:52:18 +0700 Subject: [PATCH 092/180] fix(BridgeManagerCallback): clean up unchecked `for` --- .../BridgeManagerCallbackRegister.sol | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol b/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol index 28879c63..ae0ec6f4 100644 --- a/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol +++ b/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol @@ -58,17 +58,13 @@ abstract contract BridgeManagerCallbackRegister is IdentityGuard, IBridgeManager address register; bytes4 callbackInterface = type(IBridgeManagerCallback).interfaceId; - for (uint256 i; i < length;) { + for (uint256 i; i < length; i++) { register = registers[i]; _requireHasCode(register); _requireSupportsInterface(register, callbackInterface); registereds[i] = _callbackRegisters.add(register); - - unchecked { - ++i; - } } } @@ -82,12 +78,8 @@ abstract contract BridgeManagerCallbackRegister is IdentityGuard, IBridgeManager unregistereds = new bool[](length); EnumerableSet.AddressSet storage _callbackRegisters = _getCallbackRegisters(); - for (uint256 i; i < length;) { + for (uint256 i; i < length; i++) { unregistereds[i] = _callbackRegisters.remove(registers[i]); - - unchecked { - ++i; - } } } From 515692c9648ddeb550f9aca44c59195c994b5a9e Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 25 Mar 2024 10:58:45 +0700 Subject: [PATCH 093/180] fix(MainchainGateway): not createDepositAllFallback with WETHWrapper --- src/mainchain/MainchainGatewayV3.sol | 4 ++-- ...requestDepositFor.MainchainGatewayV3.t.sol | 19 ++++++------------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/mainchain/MainchainGatewayV3.sol b/src/mainchain/MainchainGatewayV3.sol index c5eb4a23..20cfa732 100644 --- a/src/mainchain/MainchainGatewayV3.sol +++ b/src/mainchain/MainchainGatewayV3.sol @@ -416,10 +416,10 @@ contract MainchainGatewayV3 is WithdrawalLimitation, Initializable, AccessContro } /** - * @dev Receives ETH from WETH or creates deposit request if sender is not WETH. + * @dev Receives ETH from WETH or creates deposit request if sender is not WETH or WETHUnwrapper. */ function _fallback() internal virtual { - if (msg.sender == address(wrappedNativeToken)) { + if (msg.sender == address(wrappedNativeToken) || msg.sender == address(wethUnwrapper)) { return; } diff --git a/test/bridge/integration/mainchain-gateway/requestDepositFor.MainchainGatewayV3.t.sol b/test/bridge/integration/mainchain-gateway/requestDepositFor.MainchainGatewayV3.t.sol index 9de95d9c..ac941c5e 100644 --- a/test/bridge/integration/mainchain-gateway/requestDepositFor.MainchainGatewayV3.t.sol +++ b/test/bridge/integration/mainchain-gateway/requestDepositFor.MainchainGatewayV3.t.sol @@ -49,9 +49,7 @@ contract RequestDepositFor_MainchainGatewayV3_Test is BaseIntegration_Test { cachedRequest.tokenAddr = address(_mainchainWeth); vm.expectEmit(address(_mainchainGatewayV3)); - LibTransfer.Receipt memory receipt = cachedRequest.into_deposit_receipt( - _sender, _mainchainGatewayV3.depositCount(), address(_roninWeth), block.chainid - ); + LibTransfer.Receipt memory receipt = cachedRequest.into_deposit_receipt(_sender, _mainchainGatewayV3.depositCount(), address(_roninWeth), block.chainid); emit DepositRequested(receipt.hash(), receipt); vm.prank(_sender); @@ -70,9 +68,7 @@ contract RequestDepositFor_MainchainGatewayV3_Test is BaseIntegration_Test { _depositRequest.tokenAddr = address(_mainchainAxs); vm.expectEmit(address(_mainchainGatewayV3)); - LibTransfer.Receipt memory receipt = _depositRequest.into_deposit_receipt( - _sender, _mainchainGatewayV3.depositCount(), address(_roninAxs), block.chainid - ); + LibTransfer.Receipt memory receipt = _depositRequest.into_deposit_receipt(_sender, _mainchainGatewayV3.depositCount(), address(_roninAxs), block.chainid); emit DepositRequested(receipt.hash(), receipt); vm.prank(_sender); @@ -94,9 +90,8 @@ contract RequestDepositFor_MainchainGatewayV3_Test is BaseIntegration_Test { _depositRequest.info.id = tokenId; _depositRequest.info.quantity = 0; - LibTransfer.Receipt memory receipt = _depositRequest.into_deposit_receipt( - _sender, _mainchainGatewayV3.depositCount(), address(_roninMockERC721), block.chainid - ); + LibTransfer.Receipt memory receipt = + _depositRequest.into_deposit_receipt(_sender, _mainchainGatewayV3.depositCount(), address(_roninMockERC721), block.chainid); vm.expectEmit(address(_mainchainGatewayV3)); emit DepositRequested(receipt.hash(), receipt); @@ -118,15 +113,13 @@ contract RequestDepositFor_MainchainGatewayV3_Test is BaseIntegration_Test { _depositRequest.tokenAddr = address(_mainchainWeth); - LibTransfer.Receipt memory receipt = _depositRequest.into_deposit_receipt( - _sender, _mainchainGatewayV3.depositCount(), address(_roninWeth), block.chainid - ); + LibTransfer.Receipt memory receipt = _depositRequest.into_deposit_receipt(_sender, _mainchainGatewayV3.depositCount(), address(_roninWeth), block.chainid); vm.expectEmit(address(_mainchainGatewayV3)); emit DepositRequested(receipt.hash(), receipt); assertEq(address(_mainchainWeth).balance, _quantity); - vm.prank(_sender); + vm.startPrank(_sender); _mainchainGatewayV3.requestDepositFor(_depositRequest); assertEq(address(_mainchainGatewayV3).balance, _quantity); From 3b0dd2d98574da89d71d397b16b30ef94140c393 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 25 Mar 2024 16:09:55 +0700 Subject: [PATCH 094/180] fix(*Gateway): add `_disableInitializers` --- src/mainchain/MainchainGatewayV3.sol | 4 ++++ src/ronin/gateway/RoninGatewayV3.sol | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/mainchain/MainchainGatewayV3.sol b/src/mainchain/MainchainGatewayV3.sol index 68be6019..f2883d27 100644 --- a/src/mainchain/MainchainGatewayV3.sol +++ b/src/mainchain/MainchainGatewayV3.sol @@ -44,6 +44,10 @@ contract MainchainGatewayV3 is /// @custom:deprecated Previously `_bridgeOperators` (uint256[]) uint256 private ______deprecatedBridgeOperators; + constructor() { + _disableInitializers(); + } + fallback() external payable { _fallback(); } diff --git a/src/ronin/gateway/RoninGatewayV3.sol b/src/ronin/gateway/RoninGatewayV3.sol index 6a11782c..47442df9 100644 --- a/src/ronin/gateway/RoninGatewayV3.sol +++ b/src/ronin/gateway/RoninGatewayV3.sol @@ -58,6 +58,10 @@ contract RoninGatewayV3 is uint256 internal _trustedNum; uint256 internal _trustedDenom; + constructor () { + _disableInitializers(); + } + fallback() external payable { _fallback(); } From e8fb8fdac9d207f915ee67899e49444f7234926b Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 1 Apr 2024 10:39:53 +0700 Subject: [PATCH 095/180] feat(BridgeManager): change domain separator --- src/extensions/bridge-operator-governance/BridgeManager.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/extensions/bridge-operator-governance/BridgeManager.sol b/src/extensions/bridge-operator-governance/BridgeManager.sol index 2335b023..f3fa0c9c 100644 --- a/src/extensions/bridge-operator-governance/BridgeManager.sol +++ b/src/extensions/bridge-operator-governance/BridgeManager.sol @@ -77,9 +77,9 @@ abstract contract BridgeManager is IBridgeManager, Initializable, HasContracts, DOMAIN_SEPARATOR = keccak256( abi.encode( keccak256("EIP712Domain(string name,string version,bytes32 salt)"), - keccak256("BridgeAdmin"), // name hash - keccak256("2"), // version hash - keccak256(abi.encode("BRIDGE_ADMIN", roninChainId)) // salt + keccak256("BridgeManager"), // name hash + keccak256("3"), // version hash + keccak256(abi.encode("BRIDGE_MANAGER", roninChainId)) // salt ) ); From 5a93e6c525156c70d5ea351fd5b77a5bd6015a31 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 1 Apr 2024 10:52:37 +0700 Subject: [PATCH 096/180] feat(BridgeManager): add `executer` and `loose` to the proposal --- src/libraries/Proposal.sol | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/libraries/Proposal.sol b/src/libraries/Proposal.sol index 06e36db3..599fa0b0 100644 --- a/src/libraries/Proposal.sol +++ b/src/libraries/Proposal.sol @@ -21,14 +21,20 @@ library Proposal { // Other values: only specifc chain has to execute uint256 chainId; uint256 expiryTimestamp; + // The address that execute the proposal after the proposal passes. + // Leave this address as address(0) to auto-execute by the last valid vote. + address executer; + // A `loose` proposal will revert the whole proposal if encounter one internal failed. + // A non-`loose` proposal will ignore the failed internal calls. + bool loose; address[] targets; uint256[] values; bytes[] calldatas; uint256[] gasAmounts; } - // keccak256("ProposalDetail(uint256 nonce,uint256 chainId,uint256 expiryTimestamp,address[] targets,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)"); - bytes32 public constant TYPE_HASH = 0xd051578048e6ff0bbc9fca3b65a42088dbde10f36ca841de566711087ad9b08a; + // keccak256("ProposalDetail(uint256 nonce,uint256 chainId,uint256 expiryTimestamp,address executer,bool loose,address[] targets,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)"); + bytes32 public constant TYPE_HASH = 0x98e2bc443e89d620038081eb862bc4dd7a26e2eba7a2a87201642f9419340a57; /** * @dev Validates the proposal. From 7132d72eb28684a3464f34162f7bc5a8cef3bf7a Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 1 Apr 2024 10:53:43 +0700 Subject: [PATCH 097/180] fix(BridgeManager): rename for consistence --- src/libraries/Proposal.sol | 73 ++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 43 deletions(-) diff --git a/src/libraries/Proposal.sol b/src/libraries/Proposal.sol index 599fa0b0..55d4db9c 100644 --- a/src/libraries/Proposal.sol +++ b/src/libraries/Proposal.sol @@ -39,17 +39,17 @@ library Proposal { /** * @dev Validates the proposal. */ - function validate(ProposalDetail memory _proposal, uint256 _maxExpiryDuration) internal view { + function validate(ProposalDetail memory proposal, uint256 maxExpiryDuration) internal view { if ( - !(_proposal.targets.length > 0 && - _proposal.targets.length == _proposal.values.length && - _proposal.targets.length == _proposal.calldatas.length && - _proposal.targets.length == _proposal.gasAmounts.length) + !( + proposal.targets.length > 0 && proposal.targets.length == proposal.values.length && proposal.targets.length == proposal.calldatas.length + && proposal.targets.length == proposal.gasAmounts.length + ) ) { revert ErrLengthMismatch(msg.sig); } - if (_proposal.expiryTimestamp > block.timestamp + _maxExpiryDuration) { + if (proposal.expiryTimestamp > block.timestamp + maxExpiryDuration) { revert ErrInvalidExpiryTimestamp(); } } @@ -57,18 +57,14 @@ library Proposal { /** * @dev Returns struct hash of the proposal. */ - function hash(ProposalDetail memory _proposal) internal pure returns (bytes32 digest_) { - uint256[] memory _values = _proposal.values; - address[] memory _targets = _proposal.targets; - bytes32[] memory _calldataHashList = new bytes32[](_proposal.calldatas.length); - uint256[] memory _gasAmounts = _proposal.gasAmounts; - - for (uint256 _i; _i < _calldataHashList.length; ) { - _calldataHashList[_i] = keccak256(_proposal.calldatas[_i]); - - unchecked { - ++_i; - } + function hash(ProposalDetail memory proposal) internal pure returns (bytes32 digest_) { + uint256[] memory values = proposal.values; + address[] memory targets = proposal.targets; + bytes32[] memory calldataHashList = new bytes32[](proposal.calldatas.length); + uint256[] memory gasAmounts = proposal.gasAmounts; + + for (uint256 i; i < calldataHashList.length; ++i) { + calldataHashList[i] = keccak256(proposal.calldatas[i]); } // return @@ -87,18 +83,18 @@ library Proposal { assembly { let ptr := mload(0x40) mstore(ptr, TYPE_HASH) - mstore(add(ptr, 0x20), mload(_proposal)) // _proposal.nonce - mstore(add(ptr, 0x40), mload(add(_proposal, 0x20))) // _proposal.chainId - mstore(add(ptr, 0x60), mload(add(_proposal, 0x40))) // expiry timestamp + mstore(add(ptr, 0x20), mload(proposal)) // _proposal.nonce + mstore(add(ptr, 0x40), mload(add(proposal, 0x20))) // _proposal.chainId + mstore(add(ptr, 0x60), mload(add(proposal, 0x40))) // expiry timestamp let arrayHashed - arrayHashed := keccak256(add(_targets, 32), mul(mload(_targets), 32)) // targetsHash + arrayHashed := keccak256(add(targets, 32), mul(mload(targets), 32)) // targetsHash mstore(add(ptr, 0x80), arrayHashed) - arrayHashed := keccak256(add(_values, 32), mul(mload(_values), 32)) // _valuesHash + arrayHashed := keccak256(add(values, 32), mul(mload(values), 32)) // _valuesHash mstore(add(ptr, 0xa0), arrayHashed) - arrayHashed := keccak256(add(_calldataHashList, 32), mul(mload(_calldataHashList), 32)) // _calldatasHash + arrayHashed := keccak256(add(calldataHashList, 32), mul(mload(calldataHashList), 32)) // _calldatasHash mstore(add(ptr, 0xc0), arrayHashed) - arrayHashed := keccak256(add(_gasAmounts, 32), mul(mload(_gasAmounts), 32)) // _gasAmountsHash + arrayHashed := keccak256(add(gasAmounts, 32), mul(mload(gasAmounts), 32)) // _gasAmountsHash mstore(add(ptr, 0xe0), arrayHashed) digest_ := keccak256(ptr, 0x100) } @@ -110,31 +106,22 @@ library Proposal { * @notice Does not check whether the call result is successful or not. Please use `execute` instead. * */ - function executable(ProposalDetail memory _proposal) internal view returns (bool _result) { - return _proposal.chainId == 0 || _proposal.chainId == block.chainid; + function executable(ProposalDetail memory proposal) internal view returns (bool result) { + return proposal.chainId == 0 || proposal.chainId == block.chainid; } /** * @dev Executes the proposal. */ - function execute( - ProposalDetail memory _proposal - ) internal returns (bool[] memory _successCalls, bytes[] memory _returnDatas) { - if (!executable(_proposal)) revert ErrInvalidChainId(msg.sig, _proposal.chainId, block.chainid); - - _successCalls = new bool[](_proposal.targets.length); - _returnDatas = new bytes[](_proposal.targets.length); - for (uint256 _i = 0; _i < _proposal.targets.length; ) { - if (gasleft() <= _proposal.gasAmounts[_i]) revert ErrInsufficientGas(hash(_proposal)); + function execute(ProposalDetail memory proposal) internal returns (bool[] memory successCalls, bytes[] memory returnDatas) { + if (!executable(proposal)) revert ErrInvalidChainId(msg.sig, proposal.chainId, block.chainid); - (_successCalls[_i], _returnDatas[_i]) = _proposal.targets[_i].call{ - value: _proposal.values[_i], - gas: _proposal.gasAmounts[_i] - }(_proposal.calldatas[_i]); + successCalls = new bool[](proposal.targets.length); + returnDatas = new bytes[](proposal.targets.length); + for (uint256 i = 0; i < proposal.targets.length; ++i) { + if (gasleft() <= proposal.gasAmounts[i]) revert ErrInsufficientGas(hash(proposal)); - unchecked { - ++_i; - } + (successCalls[i], returnDatas[i]) = proposal.targets[i].call{ value: proposal.values[i], gas: proposal.gasAmounts[i] }(proposal.calldatas[i]); } } } From 21c4ee8d215a8087703546c92c74cae2591d65ae Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 1 Apr 2024 13:10:00 +0700 Subject: [PATCH 098/180] feat(BridgeManager): require executer and loose in the external methods --- .../sequential-governance/CoreGovernance.sol | 25 ++++++++- .../GlobalCoreGovernance.sol | 4 +- .../CommonGovernanceProposal.sol | 7 --- src/libraries/GlobalProposal.sol | 55 ++++++++++--------- src/libraries/Proposal.sol | 53 ++++++++++++------ src/ronin/gateway/RoninBridgeManager.sol | 35 +++++++++--- src/utils/CommonErrors.sol | 17 ++++++ 7 files changed, 136 insertions(+), 60 deletions(-) diff --git a/src/extensions/sequential-governance/CoreGovernance.sol b/src/extensions/sequential-governance/CoreGovernance.sol index 944905f7..c2a58fb2 100644 --- a/src/extensions/sequential-governance/CoreGovernance.sol +++ b/src/extensions/sequential-governance/CoreGovernance.sol @@ -109,6 +109,8 @@ abstract contract CoreGovernance is Initializable, SignatureConsumer, VoteStatus function _proposeProposal( uint256 chainId, uint256 expiryTimestamp, + address executer, + bool loose, address[] memory targets, uint256[] memory values, bytes[] memory calldatas, @@ -118,7 +120,7 @@ abstract contract CoreGovernance is Initializable, SignatureConsumer, VoteStatus if (chainId == 0) revert ErrInvalidChainId(msg.sig, 0, block.chainid); uint256 round_ = _createVotingRound(chainId); - proposal = Proposal.ProposalDetail(round_, chainId, expiryTimestamp, targets, values, calldatas, gasAmounts); + proposal = Proposal.ProposalDetail(round_, chainId, expiryTimestamp, executer, loose, targets, values, calldatas, gasAmounts); proposal.validate(_proposalExpiryDuration); bytes32 proposalHash = proposal.hash(); @@ -204,7 +206,9 @@ abstract contract CoreGovernance is Initializable, SignatureConsumer, VoteStatus done = true; _vote.status = VoteStatus.Approved; emit ProposalApproved(_vote.hash); - _tryExecute(_vote, proposal); + if (proposal.isAutoExecute()) { + _tryExecute(_vote, proposal); + } } else if (_againstVoteWeight >= minimumAgainstVoteWeight) { done = true; _vote.status = VoteStatus.Rejected; @@ -212,6 +216,23 @@ abstract contract CoreGovernance is Initializable, SignatureConsumer, VoteStatus } } + /** + * @dev The specified executer executes the proposal on an approved proposal. + */ + function _executeWithCaller(Proposal.ProposalDetail calldata proposal, address caller) internal { + bytes32 proposalHash = proposal.hash(); + ProposalVote storage _vote = vote[proposal.chainId][proposal.nonce]; + + if (_vote.hash != proposalHash) { + revert ErrInvalidProposal(proposalHash, _vote.hash); + } + + if (_vote.status != VoteStatus.Approved) revert ErrProposalNotApproved(); + if (caller != proposal.executer) revert ErrInvalidExecuter(); + + _tryExecute(_vote, proposal); + } + /** * @dev When the contract is on Ronin chain, checks whether the proposal is expired and delete it if is expired. * diff --git a/src/extensions/sequential-governance/GlobalCoreGovernance.sol b/src/extensions/sequential-governance/GlobalCoreGovernance.sol index b5ead07b..7c118ca0 100644 --- a/src/extensions/sequential-governance/GlobalCoreGovernance.sol +++ b/src/extensions/sequential-governance/GlobalCoreGovernance.sol @@ -42,6 +42,8 @@ abstract contract GlobalCoreGovernance is CoreGovernance { function _proposeGlobal( uint256 expiryTimestamp, GlobalProposal.TargetOption[] calldata targetOptions, + address executer, + bool loose, uint256[] memory values, bytes[] memory calldatas, uint256[] memory gasAmounts, @@ -49,7 +51,7 @@ abstract contract GlobalCoreGovernance is CoreGovernance { ) internal virtual { uint256 round_ = _createVotingRound(0); GlobalProposal.GlobalProposalDetail memory globalProposal = - GlobalProposal.GlobalProposalDetail(round_, expiryTimestamp, targetOptions, values, calldatas, gasAmounts); + GlobalProposal.GlobalProposalDetail(round_, expiryTimestamp, executer, loose, targetOptions, values, calldatas, gasAmounts); Proposal.ProposalDetail memory proposal = globalProposal.intoProposalDetail(_resolveTargets({ targetOptions: targetOptions, strict: true })); proposal.validate(_proposalExpiryDuration); diff --git a/src/extensions/sequential-governance/governance-proposal/CommonGovernanceProposal.sol b/src/extensions/sequential-governance/governance-proposal/CommonGovernanceProposal.sol index bfa07fd7..469391f1 100644 --- a/src/extensions/sequential-governance/governance-proposal/CommonGovernanceProposal.sol +++ b/src/extensions/sequential-governance/governance-proposal/CommonGovernanceProposal.sol @@ -6,13 +6,6 @@ import "../CoreGovernance.sol"; abstract contract CommonGovernanceProposal is CoreGovernance { using Proposal for Proposal.ProposalDetail; - /** - * @dev Error thrown when an invalid proposal is encountered. - * @param actual The actual value of the proposal. - * @param expected The expected value of the proposal. - */ - error ErrInvalidProposal(bytes32 actual, bytes32 expected); - /** * @dev Casts votes by signatures. * diff --git a/src/libraries/GlobalProposal.sol b/src/libraries/GlobalProposal.sol index 5fd9dd3e..ef67cbff 100644 --- a/src/libraries/GlobalProposal.sol +++ b/src/libraries/GlobalProposal.sol @@ -21,14 +21,16 @@ library GlobalProposal { // Nonce to make sure proposals are executed in order uint256 nonce; uint256 expiryTimestamp; + address executer; + bool loose; TargetOption[] targetOptions; uint256[] values; bytes[] calldatas; uint256[] gasAmounts; } - // keccak256("GlobalProposalDetail(uint256 nonce,uint256 expiryTimestamp,uint8[] targetOptions,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)"); - bytes32 public constant TYPE_HASH = 0x1463f426c05aff2c1a7a0957a71c9898bc8b47142540538e79ee25ee91141350; + // keccak256("GlobalProposalDetail(uint256 nonce,uint256 expiryTimestamp,address executer,bool loose,uint8[] targetOptions,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)"); + bytes32 public constant TYPE_HASH = 0x8fdb3bc7211cb44f39a2cae84127672c4570a00720dfbf2bb58285070faa28da; /** * @dev Returns struct hash of the proposal. @@ -39,7 +41,7 @@ library GlobalProposal { bytes32[] memory calldataHashList = new bytes32[](self.calldatas.length); uint256[] memory gasAmounts = self.gasAmounts; - for (uint256 i; i < calldataHashList.length; ) { + for (uint256 i; i < calldataHashList.length;) { calldataHashList[i] = keccak256(self.calldatas[i]); unchecked { @@ -52,54 +54,55 @@ library GlobalProposal { * keccak256( * abi.encode( * TYPE_HASH, - * _proposal.nonce, - * _proposal.expiryTimestamp, - * _targetsHash, - * _valuesHash, - * _calldatasHash, - * _gasAmountsHash + * proposal.nonce, + * proposal.expiryTimestamp, + * proposal.executer, + * proposal.loose, + * targetsHash, + * valuesHash, + * calldatasHash, + * gasAmountsHash * ) * ); */ assembly { let ptr := mload(0x40) mstore(ptr, TYPE_HASH) - mstore(add(ptr, 0x20), mload(self)) // _proposal.nonce - mstore(add(ptr, 0x40), mload(add(self, 0x20))) // _proposal.expiryTimestamp + mstore(add(ptr, 0x20), mload(self)) // proposal.nonce + mstore(add(ptr, 0x40), mload(add(self, 0x20))) // proposal.expiryTimestamp + mstore(add(ptr, 0x60), mload(add(self, 0x40))) // proposal.executer + mstore(add(ptr, 0x80), mload(add(self, 0x60))) // proposal.loose let arrayHashed arrayHashed := keccak256(add(targets, 32), mul(mload(targets), 32)) // targetsHash - mstore(add(ptr, 0x60), arrayHashed) - arrayHashed := keccak256(add(values, 32), mul(mload(values), 32)) // _valuesHash - mstore(add(ptr, 0x80), arrayHashed) - arrayHashed := keccak256(add(calldataHashList, 32), mul(mload(calldataHashList), 32)) // _calldatasHash mstore(add(ptr, 0xa0), arrayHashed) - arrayHashed := keccak256(add(gasAmounts, 32), mul(mload(gasAmounts), 32)) // _gasAmountsHash + arrayHashed := keccak256(add(values, 32), mul(mload(values), 32)) // valuesHash mstore(add(ptr, 0xc0), arrayHashed) - digest_ := keccak256(ptr, 0xe0) + arrayHashed := keccak256(add(calldataHashList, 32), mul(mload(calldataHashList), 32)) // calldatasHash + mstore(add(ptr, 0xe0), arrayHashed) + arrayHashed := keccak256(add(gasAmounts, 32), mul(mload(gasAmounts), 32)) // gasAmountsHash + mstore(add(ptr, 0x100), arrayHashed) + digest_ := keccak256(ptr, 0x120) } } /** * @dev Converts into the normal proposal. */ - function intoProposalDetail( - GlobalProposalDetail memory self, - address[] memory targets - ) internal pure returns (Proposal.ProposalDetail memory detail_) { + function intoProposalDetail(GlobalProposalDetail memory self, address[] memory targets) internal pure returns (Proposal.ProposalDetail memory detail_) { detail_.nonce = self.nonce; - detail_.expiryTimestamp = self.expiryTimestamp; detail_.chainId = 0; + detail_.expiryTimestamp = self.expiryTimestamp; + detail_.executer = self.executer; + detail_.loose = self.loose; + detail_.targets = new address[](self.targetOptions.length); detail_.values = self.values; detail_.calldatas = self.calldatas; detail_.gasAmounts = self.gasAmounts; - for (uint256 i; i < self.targetOptions.length; ) { + for (uint256 i; i < self.targetOptions.length; ++i) { detail_.targets[i] = targets[i]; - unchecked { - ++i; - } } } } diff --git a/src/libraries/Proposal.sol b/src/libraries/Proposal.sol index 55d4db9c..37586608 100644 --- a/src/libraries/Proposal.sol +++ b/src/libraries/Proposal.sol @@ -14,11 +14,16 @@ library Proposal { */ error ErrInvalidExpiryTimestamp(); + /** + * @dev Error thrown when the loose proposal reverts when execute the internal call no. `callIndex` with revert message is `revertMsg`. + */ + error ErrLooseProposalInternallyRevert(uint256 callIndex, bytes revertMsg); + struct ProposalDetail { // Nonce to make sure proposals are executed in order uint256 nonce; // Value 0: all chain should run this proposal - // Other values: only specifc chain has to execute + // Other values: only specific chain has to execute uint256 chainId; uint256 expiryTimestamp; // The address that execute the proposal after the proposal passes. @@ -71,35 +76,47 @@ library Proposal { // keccak256( // abi.encode( // TYPE_HASH, - // _proposal.nonce, - // _proposal.chainId, - // _targetsHash, - // _valuesHash, - // _calldatasHash, - // _gasAmountsHash + // proposal.nonce, + // proposal.chainId, + // proposal.expiryTimestamp + // proposal.executer + // proposal.loose + // targetsHash, + // valuesHash, + // calldatasHash, + // gasAmountsHash // ) // ); // / assembly { let ptr := mload(0x40) mstore(ptr, TYPE_HASH) - mstore(add(ptr, 0x20), mload(proposal)) // _proposal.nonce - mstore(add(ptr, 0x40), mload(add(proposal, 0x20))) // _proposal.chainId - mstore(add(ptr, 0x60), mload(add(proposal, 0x40))) // expiry timestamp + mstore(add(ptr, 0x20), mload(proposal)) // proposal.nonce + mstore(add(ptr, 0x40), mload(add(proposal, 0x20))) // proposal.chainId + mstore(add(ptr, 0x60), mload(add(proposal, 0x40))) // proposal.expiryTimestamp + mstore(add(ptr, 0x80), mload(add(proposal, 0x80))) // proposal.executer + mstore(add(ptr, 0xa0), mload(add(proposal, 0x80))) // proposal.loose let arrayHashed arrayHashed := keccak256(add(targets, 32), mul(mload(targets), 32)) // targetsHash - mstore(add(ptr, 0x80), arrayHashed) - arrayHashed := keccak256(add(values, 32), mul(mload(values), 32)) // _valuesHash - mstore(add(ptr, 0xa0), arrayHashed) - arrayHashed := keccak256(add(calldataHashList, 32), mul(mload(calldataHashList), 32)) // _calldatasHash mstore(add(ptr, 0xc0), arrayHashed) - arrayHashed := keccak256(add(gasAmounts, 32), mul(mload(gasAmounts), 32)) // _gasAmountsHash + arrayHashed := keccak256(add(values, 32), mul(mload(values), 32)) // valuesHash mstore(add(ptr, 0xe0), arrayHashed) - digest_ := keccak256(ptr, 0x100) + arrayHashed := keccak256(add(calldataHashList, 32), mul(mload(calldataHashList), 32)) // calldatasHash + mstore(add(ptr, 0x100), arrayHashed) + arrayHashed := keccak256(add(gasAmounts, 32), mul(mload(gasAmounts), 32)) // gasAmountsHash + mstore(add(ptr, 0x120), arrayHashed) + digest_ := keccak256(ptr, 0x140) } } + /** + * @dev Returns whether the proposal is auto-executed on the last valid vote. + */ + function isAutoExecute(ProposalDetail memory proposal) internal pure returns (bool) { + return proposal.executer == address(0); + } + /** * @dev Returns whether the proposal is executable for the current chain. * @@ -122,6 +139,10 @@ library Proposal { if (gasleft() <= proposal.gasAmounts[i]) revert ErrInsufficientGas(hash(proposal)); (successCalls[i], returnDatas[i]) = proposal.targets[i].call{ value: proposal.values[i], gas: proposal.gasAmounts[i] }(proposal.calldatas[i]); + + if (!successCalls[i]) { + revert ErrLooseProposalInternallyRevert(i, returnDatas[i]); + } } } } diff --git a/src/ronin/gateway/RoninBridgeManager.sol b/src/ronin/gateway/RoninBridgeManager.sol index 5ca59ab1..a95f7fae 100644 --- a/src/ronin/gateway/RoninBridgeManager.sol +++ b/src/ronin/gateway/RoninBridgeManager.sol @@ -9,9 +9,11 @@ import { GlobalGovernanceProposal } from "../../extensions/sequential-governance/governance-proposal/GlobalGovernanceProposal.sol"; import { VoteStatusConsumer } from "../../interfaces/consumers/VoteStatusConsumer.sol"; -import { ErrQueryForEmptyVote } from "../../utils/CommonErrors.sol"; +import "../../utils/CommonErrors.sol"; contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernanceProposal { + using Proposal for Proposal.ProposalDetail; + function initialize( uint256 num, uint256 denom, @@ -42,14 +44,16 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan * */ function propose( - uint256 _chainId, - uint256 _expiryTimestamp, - address[] calldata _targets, - uint256[] calldata _values, - bytes[] calldata _calldatas, - uint256[] calldata _gasAmounts + uint256 chainId, + uint256 expiryTimestamp, + address executer, + bool loose, + address[] calldata targets, + uint256[] calldata values, + bytes[] calldata calldatas, + uint256[] calldata gasAmounts ) external onlyGovernor { - _proposeProposal(_chainId, _expiryTimestamp, _targets, _values, _calldatas, _gasAmounts, msg.sender); + _proposeProposal(chainId, expiryTimestamp, executer, loose, targets, values, calldatas, gasAmounts, msg.sender); } /** @@ -78,6 +82,8 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan */ function proposeProposalForCurrentNetwork( uint256 expiryTimestamp, + address executer, + bool loose, address[] calldata targets, uint256[] calldata values, bytes[] calldata calldatas, @@ -88,6 +94,8 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan Proposal.ProposalDetail memory _proposal = _proposeProposal({ chainId: block.chainid, expiryTimestamp: expiryTimestamp, + executer: executer, + loose: loose, targets: targets, values: values, calldatas: calldatas, @@ -128,6 +136,8 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan */ function proposeGlobal( uint256 expiryTimestamp, + address executer, + bool loose, GlobalProposal.TargetOption[] calldata targetOptions, uint256[] calldata values, bytes[] calldata calldatas, @@ -135,6 +145,8 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan ) external onlyGovernor { _proposeGlobal({ expiryTimestamp: expiryTimestamp, + executer: executer, + loose: loose, targetOptions: targetOptions, values: values, calldatas: calldatas, @@ -179,6 +191,13 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan * COMMON METHODS */ + /** + * @dev See {CoreGovernance-_executeWithCaller}. + */ + function execute(Proposal.ProposalDetail calldata proposal) external { + _executeWithCaller(proposal, msg.sender); + } + /** * @dev Deletes the expired proposal by its chainId and nonce, without creating a new proposal. * diff --git a/src/utils/CommonErrors.sol b/src/utils/CommonErrors.sol index 0dd843f5..dc7a4050 100644 --- a/src/utils/CommonErrors.sol +++ b/src/utils/CommonErrors.sol @@ -226,3 +226,20 @@ error ErrOncePerBlock(); * @dev Error of method caller must be coinbase */ error ErrCallerMustBeCoinbase(); + +/** + * @dev Error thrown when an invalid proposal is encountered. + * @param actual The actual value of the proposal. + * @param expected The expected value of the proposal. + */ +error ErrInvalidProposal(bytes32 actual, bytes32 expected); + +/** + * @dev Error of proposal is not approved for executing. + */ +error ErrProposalNotApproved(); + +/** + * @dev Error of the caller is not the specified executer. + */ +error ErrInvalidExecuter(); From 84d546ad9dbf9e3881e26cb12988c887eed59c30 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 1 Apr 2024 13:10:12 +0700 Subject: [PATCH 099/180] test: adapt test --- .../20231218-maptoken-mainchain.s.sol | 2 +- .../20231218-maptoken-roninchain.s.sol | 2 +- .../20240115-maptoken-mainchain.s.sol | 2 + .../20240115-maptoken-roninchain.s.sol | 2 + .../20240131-maptoken-pixel-mainchain.s.sol | 2 + .../20240131-maptoken-pixel-roninchain.s.sol | 2 + .../20240206-maptoken-banana-mainchain.s.sol | 2 +- .../20240206-maptoken-banana-roninchain.s.sol | 4 +- test/bridge/integration/BaseIntegration.t.sol | 16 ++++++ ...oteBridgeOperator.RoninBridgeManager.t.sol | 4 ++ test/helpers/MainchainBridgeAdminUtils.t.sol | 8 +++ test/helpers/ProposalUtils.t.sol | 54 +++++++++---------- test/helpers/RoninBridgeAdminUtils.t.sol | 8 +++ 13 files changed, 75 insertions(+), 33 deletions(-) diff --git a/script/20231218-maptoken/20231218-maptoken-mainchain.s.sol b/script/20231218-maptoken/20231218-maptoken-mainchain.s.sol index e7a72225..abc8901e 100644 --- a/script/20231218-maptoken/20231218-maptoken-mainchain.s.sol +++ b/script/20231218-maptoken/20231218-maptoken-mainchain.s.sol @@ -83,6 +83,6 @@ contract Migration__20231215_MapTokenMainchain is BridgeMigration { uint256 chainId = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); vm.broadcast(sender()); - _roninBridgeManager.propose(chainId, expiredTime, targets, values, calldatas, gasAmounts); + _roninBridgeManager.propose(chainId, expiredTime, address(0), false, targets, values, calldatas, gasAmounts); } } diff --git a/script/20231218-maptoken/20231218-maptoken-roninchain.s.sol b/script/20231218-maptoken/20231218-maptoken-roninchain.s.sol index 5621946c..4e3b9150 100644 --- a/script/20231218-maptoken/20231218-maptoken-roninchain.s.sol +++ b/script/20231218-maptoken/20231218-maptoken-roninchain.s.sol @@ -58,6 +58,6 @@ contract Migration__20231215_MapTokenRoninchain is BridgeMigration { _verifyRoninProposalGasAmount(targets, values, calldatas, gasAmounts); vm.broadcast(sender()); - _roninBridgeManager.propose(block.chainid, expiredTime, targets, values, calldatas, gasAmounts); + _roninBridgeManager.propose(block.chainid, expiredTime, address(0), false, targets, values, calldatas, gasAmounts); } } diff --git a/script/20240115-mappixeltoken/20240115-maptoken-mainchain.s.sol b/script/20240115-mappixeltoken/20240115-maptoken-mainchain.s.sol index 649d8e6a..f433067c 100644 --- a/script/20240115-mappixeltoken/20240115-maptoken-mainchain.s.sol +++ b/script/20240115-mappixeltoken/20240115-maptoken-mainchain.s.sol @@ -175,6 +175,8 @@ contract Migration__MapTokenMainchain is BridgeMigration { _roninBridgeManager.propose( chainId, expiredTime, + address(0), + false, targets, values, calldatas, diff --git a/script/20240115-mappixeltoken/20240115-maptoken-roninchain.s.sol b/script/20240115-mappixeltoken/20240115-maptoken-roninchain.s.sol index 3b7d548b..ffd75cf7 100644 --- a/script/20240115-mappixeltoken/20240115-maptoken-roninchain.s.sol +++ b/script/20240115-mappixeltoken/20240115-maptoken-roninchain.s.sol @@ -131,6 +131,8 @@ contract Migration__MapTokenRoninchain is BridgeMigration { _roninBridgeManager.propose( block.chainid, expiredTime, + address(0), + false, targets, values, calldatas, diff --git a/script/20240131-maptoken-pixel/20240131-maptoken-pixel-mainchain.s.sol b/script/20240131-maptoken-pixel/20240131-maptoken-pixel-mainchain.s.sol index 1101126e..0603d4a2 100644 --- a/script/20240131-maptoken-pixel/20240131-maptoken-pixel-mainchain.s.sol +++ b/script/20240131-maptoken-pixel/20240131-maptoken-pixel-mainchain.s.sol @@ -133,6 +133,8 @@ contract Migration__20240131_MapTokenPixelMainchain is BridgeMigration, Migratio _roninBridgeManager.propose( chainId, expiredTime, + address(0), + false, targets, values, calldatas, diff --git a/script/20240131-maptoken-pixel/20240131-maptoken-pixel-roninchain.s.sol b/script/20240131-maptoken-pixel/20240131-maptoken-pixel-roninchain.s.sol index 607a728f..129f589b 100644 --- a/script/20240131-maptoken-pixel/20240131-maptoken-pixel-roninchain.s.sol +++ b/script/20240131-maptoken-pixel/20240131-maptoken-pixel-roninchain.s.sol @@ -131,6 +131,8 @@ contract Migration__20240131_MapTokenPixelRoninchain is BridgeMigration, Migrati _roninBridgeManager.propose( block.chainid, expiredTime, + address(0), + false, targets, values, calldatas, diff --git a/script/20240206-maptoken-banana/20240206-maptoken-banana-mainchain.s.sol b/script/20240206-maptoken-banana/20240206-maptoken-banana-mainchain.s.sol index 4a7da82a..9714c9bd 100644 --- a/script/20240206-maptoken-banana/20240206-maptoken-banana-mainchain.s.sol +++ b/script/20240206-maptoken-banana/20240206-maptoken-banana-mainchain.s.sol @@ -146,7 +146,7 @@ contract Migration__20240206_MapTokenBananaMainchain is console2.log("Nonce:", vm.getNonce(_governor)); vm.broadcast(_governor); - _roninBridgeManager.propose(chainId, expiredTime, targets, values, calldatas, gasAmounts); + _roninBridgeManager.propose(chainId, expiredTime, address(0), false, targets, values, calldatas, gasAmounts); } } diff --git a/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol b/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol index 375fc17b..2e6ab1dc 100644 --- a/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol +++ b/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol @@ -117,7 +117,7 @@ contract Migration__20240206_MapTokenBananaRoninChain is roninTokensToSetMinThreshold[1] = pixelRoninToken; minThresholds[1] = pixelMinThreshold; - + roninTokensToSetMinThreshold[2] = pixelMainchainToken; minThresholds[2] = 0; @@ -152,7 +152,7 @@ contract Migration__20240206_MapTokenBananaRoninChain is console2.log("Nonce:", vm.getNonce(_governor)); vm.broadcast(_governor); - _roninBridgeManager.propose(block.chainid, expiredTime, targets, values, calldatas, gasAmounts); + _roninBridgeManager.propose(block.chainid, expiredTime, address(0), false, targets, values, calldatas, gasAmounts); // ============= LOCAL SIMULATION ================== _cheatWeightOperator(_governor); diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index 79bb2828..41454d06 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -317,6 +317,8 @@ contract BaseIntegration_Test is Base_Test { // set targets GlobalProposal.GlobalProposalDetail memory globalProposal = _roninProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, + executer: address(0), + loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, calldata_: abi.encodeCall(GlobalCoreGovernance.updateManyTargetOption, (param.targetOptions, param.targets)), @@ -333,6 +335,8 @@ contract BaseIntegration_Test is Base_Test { // set bridge contract GlobalProposal.GlobalProposalDetail memory globalProposal = _roninProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, + executer: address(0), + loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, calldata_: abi.encodeCall(IHasContracts.setContract, (ContractType.BRIDGE, param.bridgeContract)), @@ -351,6 +355,8 @@ contract BaseIntegration_Test is Base_Test { bytes memory calldata_ = abi.encodeCall(IBridgeManagerCallbackRegister.registerCallbacks, (param.callbackRegisters)); GlobalProposal.GlobalProposalDetail memory globalProposal = _roninProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, + executer: address(0), + loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, calldata_: calldata_, @@ -368,6 +374,8 @@ contract BaseIntegration_Test is Base_Test { // set min governors GlobalProposal.GlobalProposalDetail memory globalProposal = _roninProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, + executer: address(0), + loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, calldata_: abi.encodeCall(IBridgeManager.setMinRequiredGovernor, (_param.roninBridgeManager.minRequiredGovernor)), @@ -406,6 +414,8 @@ contract BaseIntegration_Test is Base_Test { // set targets GlobalProposal.GlobalProposalDetail memory globalProposal = _mainchainProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, + executer: address(0), + loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, calldata_: abi.encodeCall(GlobalCoreGovernance.updateManyTargetOption, (param.targetOptions, param.targets)), @@ -422,6 +432,8 @@ contract BaseIntegration_Test is Base_Test { // set bridge contract GlobalProposal.GlobalProposalDetail memory globalProposal = _mainchainProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, + executer: address(0), + loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, calldata_: abi.encodeCall(IHasContracts.setContract, (ContractType.BRIDGE, param.bridgeContract)), @@ -440,6 +452,8 @@ contract BaseIntegration_Test is Base_Test { bytes memory calldata_ = abi.encodeCall(IBridgeManagerCallbackRegister.registerCallbacks, (param.callbackRegisters)); GlobalProposal.GlobalProposalDetail memory globalProposal = _mainchainProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, + executer: address(0), + loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, calldata_: calldata_, @@ -457,6 +471,8 @@ contract BaseIntegration_Test is Base_Test { // set min governors GlobalProposal.GlobalProposalDetail memory globalProposal = _roninProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, + executer: address(0), + loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, calldata_: abi.encodeCall(IBridgeManager.setMinRequiredGovernor, (_param.roninBridgeManager.minRequiredGovernor)), diff --git a/test/bridge/integration/bridge-manager/propose-and-cast-vote/voteBridgeOperator.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/propose-and-cast-vote/voteBridgeOperator.RoninBridgeManager.t.sol index 5d45e546..5589b253 100644 --- a/test/bridge/integration/bridge-manager/propose-and-cast-vote/voteBridgeOperator.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/propose-and-cast-vote/voteBridgeOperator.RoninBridgeManager.t.sol @@ -58,6 +58,8 @@ contract VoteBridgeOperator_RoninBridgeManager_Test is BaseIntegration_Test { function test_voteAddBridgeOperatorsProposal() public { _globalProposal = _roninProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + _proposalExpiryDuration, + executer: address(0), + loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, calldata_: abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators)), @@ -119,6 +121,8 @@ contract VoteBridgeOperator_RoninBridgeManager_Test is BaseIntegration_Test { _globalProposal = _roninProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + _proposalExpiryDuration, + executer: address(0), + loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, calldata_: abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators)), diff --git a/test/helpers/MainchainBridgeAdminUtils.t.sol b/test/helpers/MainchainBridgeAdminUtils.t.sol index 55c534d0..aad2f32f 100644 --- a/test/helpers/MainchainBridgeAdminUtils.t.sol +++ b/test/helpers/MainchainBridgeAdminUtils.t.sol @@ -20,6 +20,8 @@ contract MainchainBridgeAdminUtils is ProposalUtils { function functionDelegateCall(address to, bytes memory data) public { Proposal.ProposalDetail memory proposal = this.createProposal({ expiryTimestamp: this.defaultExpiryTimestamp(), + executer: address(0), + loose: false, target: to, value: 0, calldata_: abi.encodeWithSignature("functionDelegateCall(bytes)", data), @@ -40,6 +42,8 @@ contract MainchainBridgeAdminUtils is ProposalUtils { function functionDelegateCallGlobal(GlobalProposal.TargetOption target, bytes memory data) public { GlobalProposal.GlobalProposalDetail memory proposal = this.createGlobalProposal({ expiryTimestamp: this.defaultExpiryTimestamp(), + executer: address(0), + loose: false, targetOption: target, value: 0, calldata_: abi.encodeWithSignature("functionDelegateCall(bytes)", data), @@ -73,6 +77,8 @@ contract MainchainBridgeAdminUtils is ProposalUtils { GlobalProposal.GlobalProposalDetail memory proposal = GlobalProposal.GlobalProposalDetail({ nonce: _contract.round(0) + 1, expiryTimestamp: this.defaultExpiryTimestamp(), + executer: address(0), + loose: false, targetOptions: targetOptions, values: values, calldatas: calldatas, @@ -92,6 +98,8 @@ contract MainchainBridgeAdminUtils is ProposalUtils { function upgradeGlobal(GlobalProposal.TargetOption targetOption, uint256 nonce, bytes memory data) public { GlobalProposal.GlobalProposalDetail memory proposal = this.createGlobalProposal({ expiryTimestamp: this.defaultExpiryTimestamp(), + executer: address(0), + loose: false, targetOption: targetOption, value: 0, calldata_: abi.encodeWithSignature("upgradeTo(bytes)", data), diff --git a/test/helpers/ProposalUtils.t.sol b/test/helpers/ProposalUtils.t.sol index 4e06b0b5..04395331 100644 --- a/test/helpers/ProposalUtils.t.sol +++ b/test/helpers/ProposalUtils.t.sol @@ -28,6 +28,8 @@ contract ProposalUtils is Utils, Test { function createProposal( uint256 expiryTimestamp, + address executer, + bool loose, address target, uint256 value, bytes memory calldata_, @@ -37,6 +39,8 @@ contract ProposalUtils is Utils, Test { proposal = Proposal.ProposalDetail({ nonce: nonce, chainId: block.chainid, + executer: executer, + loose: loose, expiryTimestamp: expiryTimestamp, targets: wrapAddress(target), values: wrapUint(value), @@ -47,6 +51,8 @@ contract ProposalUtils is Utils, Test { function createGlobalProposal( uint256 expiryTimestamp, + address executer, + bool loose, GlobalProposal.TargetOption targetOption, uint256 value, bytes memory calldata_, @@ -59,6 +65,8 @@ contract ProposalUtils is Utils, Test { proposal = GlobalProposal.GlobalProposalDetail({ nonce: nonce, expiryTimestamp: expiryTimestamp, + executer: executer, + loose: loose, targetOptions: targetOptions, values: wrapUint(value), calldatas: wrapBytes(calldata_), @@ -75,19 +83,14 @@ contract ProposalUtils is Utils, Test { return generateSignaturesFor(proposalHash, signerPKs, support); } - function generateSignatures(Proposal.ProposalDetail memory proposal, uint256[] memory signerPKs) - public - view - returns (SignatureConsumer.Signature[] memory sigs) - { + function generateSignatures( + Proposal.ProposalDetail memory proposal, + uint256[] memory signerPKs + ) public view returns (SignatureConsumer.Signature[] memory sigs) { return generateSignatures(proposal, signerPKs, Ballot.VoteType.For); } - function generateSignatures(Proposal.ProposalDetail memory proposal) - public - view - returns (SignatureConsumer.Signature[] memory sigs) - { + function generateSignatures(Proposal.ProposalDetail memory proposal) public view returns (SignatureConsumer.Signature[] memory sigs) { return generateSignatures(proposal, _signerPKs, Ballot.VoteType.For); } @@ -100,19 +103,14 @@ contract ProposalUtils is Utils, Test { return generateSignaturesFor(proposalHash, signerPKs, support); } - function generateSignaturesGlobal(GlobalProposal.GlobalProposalDetail memory proposal, uint256[] memory signerPKs) - public - view - returns (SignatureConsumer.Signature[] memory sigs) - { + function generateSignaturesGlobal( + GlobalProposal.GlobalProposalDetail memory proposal, + uint256[] memory signerPKs + ) public view returns (SignatureConsumer.Signature[] memory sigs) { return generateSignaturesGlobal(proposal, signerPKs, Ballot.VoteType.For); } - function generateSignaturesGlobal(GlobalProposal.GlobalProposalDetail memory proposal) - public - view - returns (SignatureConsumer.Signature[] memory sigs) - { + function generateSignaturesGlobal(GlobalProposal.GlobalProposalDetail memory proposal) public view returns (SignatureConsumer.Signature[] memory sigs) { return generateSignaturesGlobal(proposal, _signerPKs, Ballot.VoteType.For); } @@ -120,18 +118,18 @@ contract ProposalUtils is Utils, Test { return keccak256( abi.encode( keccak256("EIP712Domain(string name,string version,bytes32 salt)"), - keccak256("BridgeAdmin"), // name hash - keccak256("2"), // version hash - keccak256(abi.encode("BRIDGE_ADMIN", block.chainid)) // salt + keccak256("BridgeManager"), // name hash + keccak256("3"), // version hash + keccak256(abi.encode("BRIDGE_MANAGER", block.chainid)) // salt ) ); } - function generateSignaturesFor(bytes32 proposalHash, uint256[] memory signerPKs, Ballot.VoteType support) - public - view - returns (SignatureConsumer.Signature[] memory sigs) - { + function generateSignaturesFor( + bytes32 proposalHash, + uint256[] memory signerPKs, + Ballot.VoteType support + ) public view returns (SignatureConsumer.Signature[] memory sigs) { sigs = new SignatureConsumer.Signature[](signerPKs.length); for (uint256 i; i < signerPKs.length; i++) { diff --git a/test/helpers/RoninBridgeAdminUtils.t.sol b/test/helpers/RoninBridgeAdminUtils.t.sol index 1b65257d..0292ea53 100644 --- a/test/helpers/RoninBridgeAdminUtils.t.sol +++ b/test/helpers/RoninBridgeAdminUtils.t.sol @@ -20,6 +20,8 @@ contract RoninBridgeAdminUtils is ProposalUtils { function functionDelegateCall(address to, bytes memory data) public { Proposal.ProposalDetail memory proposal = this.createProposal({ expiryTimestamp: this.defaultExpiryTimestamp(), + executer: address(0), + loose: false, target: to, value: 0, calldata_: abi.encodeWithSignature("functionDelegateCall(bytes)", data), @@ -40,6 +42,8 @@ contract RoninBridgeAdminUtils is ProposalUtils { function functionDelegateCallGlobal(GlobalProposal.TargetOption target, bytes memory data) public { GlobalProposal.GlobalProposalDetail memory proposal = this.createGlobalProposal({ expiryTimestamp: this.defaultExpiryTimestamp(), + executer: address(0), + loose: false, targetOption: target, value: 0, calldata_: abi.encodeWithSignature("functionDelegateCall(bytes)", data), @@ -73,6 +77,8 @@ contract RoninBridgeAdminUtils is ProposalUtils { GlobalProposal.GlobalProposalDetail memory proposal = GlobalProposal.GlobalProposalDetail({ nonce: _contract.round(0) + 1, expiryTimestamp: this.defaultExpiryTimestamp(), + executer: address(0), + loose: false, targetOptions: targetOptions, values: values, calldatas: calldatas, @@ -92,6 +98,8 @@ contract RoninBridgeAdminUtils is ProposalUtils { function upgradeGlobal(GlobalProposal.TargetOption targetOption, uint256 nonce, bytes memory data) public { GlobalProposal.GlobalProposalDetail memory proposal = this.createGlobalProposal({ expiryTimestamp: this.defaultExpiryTimestamp(), + executer: address(0), + loose: false, targetOption: targetOption, value: 0, calldata_: abi.encodeWithSignature("upgradeTo(bytes)", data), From 4dfe941ef7374a8e66937573e18f9f038bcdd281 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 1 Apr 2024 14:56:39 +0700 Subject: [PATCH 100/180] fix(BridgeManager): fix loose proposal check --- src/libraries/Proposal.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/Proposal.sol b/src/libraries/Proposal.sol index 37586608..b0ef091f 100644 --- a/src/libraries/Proposal.sol +++ b/src/libraries/Proposal.sol @@ -140,7 +140,7 @@ library Proposal { (successCalls[i], returnDatas[i]) = proposal.targets[i].call{ value: proposal.values[i], gas: proposal.gasAmounts[i] }(proposal.calldatas[i]); - if (!successCalls[i]) { + if (!proposal.loose && !successCalls[i]) { revert ErrLooseProposalInternallyRevert(i, returnDatas[i]); } } From 4d76453aa7f6e7af5907403940ad6b54865d826e Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 1 Apr 2024 16:20:45 +0700 Subject: [PATCH 101/180] test: add `loose` proposal test --- .../proposeCurrent.RoninBridgeManager.t.sol | 172 +++++++++++++++++ ...proposeGlobal.MainchainBridgeManager.t.sol | 177 ++++++++++++++++++ .../proposeGlobal.RoninBridgeManager.t.sol | 169 +++++++++++++++++ 3 files changed, 518 insertions(+) create mode 100644 test/bridge/integration/bridge-manager/proposal-loose/proposeCurrent.RoninBridgeManager.t.sol create mode 100644 test/bridge/integration/bridge-manager/proposal-loose/proposeGlobal.MainchainBridgeManager.t.sol create mode 100644 test/bridge/integration/bridge-manager/proposal-loose/proposeGlobal.RoninBridgeManager.t.sol diff --git a/test/bridge/integration/bridge-manager/proposal-loose/proposeCurrent.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-loose/proposeCurrent.RoninBridgeManager.t.sol new file mode 100644 index 00000000..662db5bc --- /dev/null +++ b/test/bridge/integration/bridge-manager/proposal-loose/proposeCurrent.RoninBridgeManager.t.sol @@ -0,0 +1,172 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { console2 as console } from "forge-std/console2.sol"; +import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; +import { Ballot } from "@ronin/contracts/libraries/Ballot.sol"; +import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; +import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; +import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; +import { LibSort } from "solady/utils/LibSort.sol"; + +import "../../BaseIntegration.t.sol"; + +contract LooseProposal_CurrentNetworkProposal_RoninBridgeManager_Test is BaseIntegration_Test { + event ProposalVoted(bytes32 indexed proposalHash, address indexed voter, Ballot.VoteType support, uint256 weight); + + error ErrInvalidProposalNonce(bytes4 sig); + error ErrLooseProposalInternallyRevert(uint, bytes); + + using LibSort for address[]; + + uint256 _proposalExpiryDuration; + uint256 _addingOperatorNum; + address[] _addingOperators; + address[] _addingGovernors; + uint96[] _voteWeights; + + address[] _beforeRelayedOperators; + address[] _beforeRelayedGovernors; + + address[] _afterRelayedOperators; + address[] _afterRelayedGovernors; + + Ballot.VoteType[] _supports; + + GlobalProposal.GlobalProposalDetail _globalProposal; + SignatureConsumer.Signature[] _signatures; + + Proposal.ProposalDetail _proposal; + + bytes32 _anyValue; + + function setUp() public virtual override { + super.setUp(); + + _proposalExpiryDuration = 60; + _addingOperatorNum = 3; + + _beforeRelayedOperators = _param.roninBridgeManager.bridgeOperators; + _beforeRelayedGovernors = _param.roninBridgeManager.governors; + + _supports = new Ballot.VoteType[](_beforeRelayedOperators.length); + for (uint256 i; i < _beforeRelayedGovernors.length; i++) { + _supports[i] = Ballot.VoteType.For; + } + + _generateAddingOperators(_addingOperatorNum); + + _proposal.nonce = _roninBridgeManager.round(block.chainid) + 1; + _proposal.chainId = block.chainid; + _proposal.executer = address(0); + _proposal.loose = false; + _proposal.expiryTimestamp = block.timestamp + _proposalExpiryDuration; + + _proposal.targets.push(address(_roninBridgeManager)); + _proposal.values.push(0); + _proposal.calldatas.push(abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators))); + _proposal.gasAmounts.push(1_000_000); + + // Duplicate the internal call + _proposal.targets.push(address(_roninBridgeManager)); + _proposal.values.push(0); + _proposal.calldatas.push(abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators))); + _proposal.gasAmounts.push(1_000_000); + } + + // Should the strict proposal failed when containing one failed internal call + function test_strictProposal_revertWhen_containingOneFailedInternalCall() external { + _proposal.loose = false; + _proposal.gasAmounts[1] = 1_000; // Set gas for the second call becomes failed + + vm.expectEmit(false, true, true, true); + emit ProposalVoted(_anyValue, _param.roninBridgeManager.governors[0], Ballot.VoteType.For, 100); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignatures(_proposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + vm.expectRevert(abi.encodeWithSelector(ErrLooseProposalInternallyRevert.selector, 1, "")); + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.proposeProposalStructAndCastVotes(_proposal, _supports, _signatures); + } + + // Should the strict proposal passes when all internal calls are valid + function test_strictProposal_WhenAllInternalCallsPass() external { + _proposal.loose = false; + _proposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success + + vm.expectEmit(false, true, true, true); + emit ProposalVoted(_anyValue, _param.roninBridgeManager.governors[0], Ballot.VoteType.For, 100); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignatures(_proposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.proposeProposalStructAndCastVotes(_proposal, _supports, _signatures); + + assertEq(_roninBridgeManager.proposalVoted(block.chainid, _proposal.nonce, _param.roninBridgeManager.governors[0]), true); + assertEq(_roninBridgeManager.getBridgeOperators(), _afterRelayedOperators); + } + + // Should the loose proposal passes when containing one failed internal call + function test_looseProposal_WhenContainsOneInternalCallFailed() external { + _proposal.loose = true; + _proposal.gasAmounts[1] = 1_000; // Set gas for the second call becomes failed + + vm.expectEmit(false, true, true, true); + emit ProposalVoted(_anyValue, _param.roninBridgeManager.governors[0], Ballot.VoteType.For, 100); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignatures(_proposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.proposeProposalStructAndCastVotes(_proposal, _supports, _signatures); + + assertEq(_roninBridgeManager.proposalVoted(block.chainid, _proposal.nonce, _param.roninBridgeManager.governors[0]), true); + assertEq(_roninBridgeManager.getBridgeOperators(), _afterRelayedOperators); + } + + // Should the loose proposal passes when all internal calls are valid + function test_looseProposal_WhenAllInternalCallsPass() external { + _proposal.loose = true; + _proposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success + + vm.expectEmit(false, true, true, true); + emit ProposalVoted(_anyValue, _param.roninBridgeManager.governors[0], Ballot.VoteType.For, 100); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignatures(_proposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.proposeProposalStructAndCastVotes(_proposal, _supports, _signatures); + + assertEq(_roninBridgeManager.proposalVoted(block.chainid, _proposal.nonce, _param.roninBridgeManager.governors[0]), true); + assertEq(_roninBridgeManager.getBridgeOperators(), _afterRelayedOperators); + } + + function _generateAddingOperators(uint256 num) internal { + delete _addingOperators; + delete _addingGovernors; + delete _voteWeights; + + _afterRelayedOperators = _beforeRelayedOperators; + _afterRelayedGovernors = _beforeRelayedGovernors; + + for (uint256 i; i < num; i++) { + _addingOperators.push(makeAddr(string.concat("adding-operator", vm.toString(i)))); + _addingGovernors.push(makeAddr(string.concat("adding-governor", vm.toString(i)))); + _voteWeights.push(uint96(uint256(100))); + + _afterRelayedOperators.push(_addingOperators[i]); + _afterRelayedGovernors.push(_addingGovernors[i]); + } + } +} diff --git a/test/bridge/integration/bridge-manager/proposal-loose/proposeGlobal.MainchainBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-loose/proposeGlobal.MainchainBridgeManager.t.sol new file mode 100644 index 00000000..084d5d65 --- /dev/null +++ b/test/bridge/integration/bridge-manager/proposal-loose/proposeGlobal.MainchainBridgeManager.t.sol @@ -0,0 +1,177 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { console2 as console } from "forge-std/console2.sol"; +import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; +import { Ballot } from "@ronin/contracts/libraries/Ballot.sol"; +import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; +import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; +import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; +import { LibSort } from "solady/utils/LibSort.sol"; + +import "../../BaseIntegration.t.sol"; + +contract LooseProposal_GlobalProposal_MainchainBridgeManager_Test is BaseIntegration_Test { + event ProposalVoted(bytes32 indexed proposalHash, address indexed voter, Ballot.VoteType support, uint256 weight); + event ProposalApproved(bytes32 indexed proposalHash); + event ProposalExecuted(bytes32 indexed proposalHash, bool[] successCalls, bytes[] returnDatas); + + error ErrInvalidProposalNonce(bytes4 sig); + error ErrLooseProposalInternallyRevert(uint, bytes); + + using LibSort for address[]; + + uint256 _proposalExpiryDuration; + uint256 _addingOperatorNum; + address[] _addingOperators; + address[] _addingGovernors; + uint96[] _voteWeights; + + address[] _beforeRelayedOperators; + address[] _beforeRelayedGovernors; + + address[] _afterRelayedOperators; + address[] _afterRelayedGovernors; + + Ballot.VoteType[] _supports; + + GlobalProposal.GlobalProposalDetail _globalProposal; + SignatureConsumer.Signature[] _signatures; + + bytes32 _anyValue; + + function setUp() public virtual override { + super.setUp(); + + _proposalExpiryDuration = 60; + _addingOperatorNum = 3; + + _beforeRelayedOperators = _param.roninBridgeManager.bridgeOperators; + _beforeRelayedGovernors = _param.roninBridgeManager.governors; + + _supports = new Ballot.VoteType[](_beforeRelayedOperators.length); + for (uint256 i; i < _beforeRelayedGovernors.length; i++) { + _supports[i] = Ballot.VoteType.For; + } + + _generateAddingOperators(_addingOperatorNum); + + _globalProposal.nonce = _mainchainBridgeManager.round(0) + 1; + _globalProposal.expiryTimestamp = block.timestamp + _proposalExpiryDuration; + _globalProposal.executer = address(0); + _globalProposal.loose = false; + + _globalProposal.targetOptions.push(GlobalProposal.TargetOption.BridgeManager); + _globalProposal.values.push(0); + _globalProposal.calldatas.push(abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators))); + _globalProposal.gasAmounts.push(1_000_000); + + // Duplicate the internal call + _globalProposal.targetOptions.push(GlobalProposal.TargetOption.BridgeManager); + _globalProposal.values.push(0); + _globalProposal.calldatas.push(abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators))); + _globalProposal.gasAmounts.push(1_000_000); + } + + // Should the strict proposal failed when containing one failed internal call + function test_strictProposal_globalProposal_MainchainSide_revertWhen_containingOneFailedInternalCall() external { + _globalProposal.loose = false; + _globalProposal.gasAmounts[1] = 1_000; // Set gas for the second call becomes failed + + vm.expectEmit(false, true, true, true); + emit ProposalApproved(_anyValue); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignaturesGlobal(_globalProposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + vm.expectRevert(abi.encodeWithSelector(ErrLooseProposalInternallyRevert.selector, 1, "")); + vm.prank(_param.roninBridgeManager.governors[0]); + _mainchainBridgeManager.relayGlobalProposal(_globalProposal, _supports, _signatures); + } + + // Should the strict proposal passes when all internal calls are valid + function test_strictProposal_globalProposal_MainchainSide_WhenAllInternalCallsPass() external { + _globalProposal.loose = false; + _globalProposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success + + vm.expectEmit(false, false, false, false); + emit ProposalApproved(_anyValue); + vm.expectEmit(false, false, false, false); + emit ProposalExecuted(_anyValue, new bool[](2), new bytes[](2)); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignaturesGlobal(_globalProposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + vm.prank(_param.roninBridgeManager.governors[0]); + _mainchainBridgeManager.relayGlobalProposal(_globalProposal, _supports, _signatures); + + assertEq(_mainchainBridgeManager.globalProposalRelayed(_globalProposal.nonce), true); + assertEq(_mainchainBridgeManager.getBridgeOperators(), _afterRelayedOperators); + } + + // Should the loose proposal passes when containing one failed internal call + function test_looseProposal_globalProposal_MainchainSide_WhenContainsOneInternalCallFailed() external { + _globalProposal.loose = true; + _globalProposal.gasAmounts[1] = 1_000; // Set gas for the second call becomes failed + + vm.expectEmit(false, false, false, false); + emit ProposalApproved(_anyValue); + vm.expectEmit(false, false, false, false); + emit ProposalExecuted(_anyValue, new bool[](2), new bytes[](2)); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignaturesGlobal(_globalProposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + vm.prank(_param.roninBridgeManager.governors[0]); + _mainchainBridgeManager.relayGlobalProposal(_globalProposal, _supports, _signatures); + + assertEq(_mainchainBridgeManager.globalProposalRelayed(_globalProposal.nonce), true); + assertEq(_mainchainBridgeManager.getBridgeOperators(), _afterRelayedOperators); + } + + // Should the loose proposal passes when all internal calls are valid + function test_looseProposal_globalProposal_MainchainSide_WhenAllInternalCallsPass() external { + _globalProposal.loose = true; + _globalProposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success + + vm.expectEmit(false, false, false, false); + emit ProposalApproved(_anyValue); + vm.expectEmit(false, false, false, false); + emit ProposalExecuted(_anyValue, new bool[](2), new bytes[](2)); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignaturesGlobal(_globalProposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + vm.prank(_param.roninBridgeManager.governors[0]); + _mainchainBridgeManager.relayGlobalProposal(_globalProposal, _supports, _signatures); + + assertEq(_mainchainBridgeManager.globalProposalRelayed(_globalProposal.nonce), true); + assertEq(_mainchainBridgeManager.getBridgeOperators(), _afterRelayedOperators); + } + + function _generateAddingOperators(uint256 num) internal { + delete _addingOperators; + delete _addingGovernors; + delete _voteWeights; + + _afterRelayedOperators = _beforeRelayedOperators; + _afterRelayedGovernors = _beforeRelayedGovernors; + + for (uint256 i; i < num; i++) { + _addingOperators.push(makeAddr(string.concat("adding-operator", vm.toString(i)))); + _addingGovernors.push(makeAddr(string.concat("adding-governor", vm.toString(i)))); + _voteWeights.push(uint96(uint256(100))); + + _afterRelayedOperators.push(_addingOperators[i]); + _afterRelayedGovernors.push(_addingGovernors[i]); + } + } +} diff --git a/test/bridge/integration/bridge-manager/proposal-loose/proposeGlobal.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-loose/proposeGlobal.RoninBridgeManager.t.sol new file mode 100644 index 00000000..95bffd82 --- /dev/null +++ b/test/bridge/integration/bridge-manager/proposal-loose/proposeGlobal.RoninBridgeManager.t.sol @@ -0,0 +1,169 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { console2 as console } from "forge-std/console2.sol"; +import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; +import { Ballot } from "@ronin/contracts/libraries/Ballot.sol"; +import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; +import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; +import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; +import { LibSort } from "solady/utils/LibSort.sol"; + +import "../../BaseIntegration.t.sol"; + +contract LooseProposal_GlobalProposal_RoninBridgeManager_Test is BaseIntegration_Test { + event ProposalVoted(bytes32 indexed proposalHash, address indexed voter, Ballot.VoteType support, uint256 weight); + + error ErrInvalidProposalNonce(bytes4 sig); + error ErrLooseProposalInternallyRevert(uint, bytes); + + using LibSort for address[]; + + uint256 _proposalExpiryDuration; + uint256 _addingOperatorNum; + address[] _addingOperators; + address[] _addingGovernors; + uint96[] _voteWeights; + + address[] _beforeRelayedOperators; + address[] _beforeRelayedGovernors; + + address[] _afterRelayedOperators; + address[] _afterRelayedGovernors; + + Ballot.VoteType[] _supports; + + GlobalProposal.GlobalProposalDetail _globalProposal; + SignatureConsumer.Signature[] _signatures; + + bytes32 _anyValue; + + function setUp() public virtual override { + super.setUp(); + + _proposalExpiryDuration = 60; + _addingOperatorNum = 3; + + _beforeRelayedOperators = _param.roninBridgeManager.bridgeOperators; + _beforeRelayedGovernors = _param.roninBridgeManager.governors; + + _supports = new Ballot.VoteType[](_beforeRelayedOperators.length); + for (uint256 i; i < _beforeRelayedGovernors.length; i++) { + _supports[i] = Ballot.VoteType.For; + } + + _generateAddingOperators(_addingOperatorNum); + + _globalProposal.nonce = _roninBridgeManager.round(0) + 1; + _globalProposal.expiryTimestamp = block.timestamp + _proposalExpiryDuration; + _globalProposal.executer = address(0); + _globalProposal.loose = false; + + _globalProposal.targetOptions.push(GlobalProposal.TargetOption.BridgeManager); + _globalProposal.values.push(0); + _globalProposal.calldatas.push(abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators))); + _globalProposal.gasAmounts.push(1_000_000); + + // Duplicate the internal call + _globalProposal.targetOptions.push(GlobalProposal.TargetOption.BridgeManager); + _globalProposal.values.push(0); + _globalProposal.calldatas.push(abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators))); + _globalProposal.gasAmounts.push(1_000_000); + } + + // Should the strict proposal failed when containing one failed internal call + function test_strictProposal_globalProposal_RoninSide_revertWhen_containingOneFailedInternalCall() external { + _globalProposal.loose = false; + _globalProposal.gasAmounts[1] = 1_000; // Set gas for the second call becomes failed + + vm.expectEmit(false, true, true, true); + emit ProposalVoted(_anyValue, _param.roninBridgeManager.governors[0], Ballot.VoteType.For, 100); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignaturesGlobal(_globalProposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + vm.expectRevert(abi.encodeWithSelector(ErrLooseProposalInternallyRevert.selector, 1, "")); + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.proposeGlobalProposalStructAndCastVotes(_globalProposal, _supports, _signatures); + } + + // Should the strict proposal passes when all internal calls are valid + function test_strictProposal_globalProposal_RoninSide_WhenAllInternalCallsPass() external { + _globalProposal.loose = false; + _globalProposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success + + vm.expectEmit(false, true, true, true); + emit ProposalVoted(_anyValue, _param.roninBridgeManager.governors[0], Ballot.VoteType.For, 100); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignaturesGlobal(_globalProposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.proposeGlobalProposalStructAndCastVotes(_globalProposal, _supports, _signatures); + + assertEq(_roninBridgeManager.globalProposalVoted(_globalProposal.nonce, _param.roninBridgeManager.governors[0]), true); + assertEq(_roninBridgeManager.getBridgeOperators(), _afterRelayedOperators); + } + + // Should the loose proposal passes when containing one failed internal call + function test_looseProposal_globalProposal_RoninSide_WhenContainsOneInternalCallFailed() external { + _globalProposal.loose = true; + _globalProposal.gasAmounts[1] = 1_000; // Set gas for the second call becomes failed + + vm.expectEmit(false, true, true, true); + emit ProposalVoted(_anyValue, _param.roninBridgeManager.governors[0], Ballot.VoteType.For, 100); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignaturesGlobal(_globalProposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.proposeGlobalProposalStructAndCastVotes(_globalProposal, _supports, _signatures); + + assertEq(_roninBridgeManager.globalProposalVoted(_globalProposal.nonce, _param.roninBridgeManager.governors[0]), true); + assertEq(_roninBridgeManager.getBridgeOperators(), _afterRelayedOperators); + } + + // Should the loose proposal passes when all internal calls are valid + function test_looseProposal_globalProposal_RoninSide_WhenAllInternalCallsPass() external { + _globalProposal.loose = true; + _globalProposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success + + vm.expectEmit(false, true, true, true); + emit ProposalVoted(_anyValue, _param.roninBridgeManager.governors[0], Ballot.VoteType.For, 100); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignaturesGlobal(_globalProposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.proposeGlobalProposalStructAndCastVotes(_globalProposal, _supports, _signatures); + + assertEq(_roninBridgeManager.globalProposalVoted(_globalProposal.nonce, _param.roninBridgeManager.governors[0]), true); + assertEq(_roninBridgeManager.getBridgeOperators(), _afterRelayedOperators); + } + + function _generateAddingOperators(uint256 num) internal { + delete _addingOperators; + delete _addingGovernors; + delete _voteWeights; + + _afterRelayedOperators = _beforeRelayedOperators; + _afterRelayedGovernors = _beforeRelayedGovernors; + + for (uint256 i; i < num; i++) { + _addingOperators.push(makeAddr(string.concat("adding-operator", vm.toString(i)))); + _addingGovernors.push(makeAddr(string.concat("adding-governor", vm.toString(i)))); + _voteWeights.push(uint96(uint256(100))); + + _afterRelayedOperators.push(_addingOperators[i]); + _afterRelayedGovernors.push(_addingGovernors[i]); + } + } +} From 8cf4b22f6e917457cb4e3e24f558131d442a4c19 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 1 Apr 2024 17:17:08 +0700 Subject: [PATCH 102/180] test: add `executer` for Ronin proposal test --- ...er.proposeCurrent.RoninBridgeManager.t.sol | 197 ++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 test/bridge/integration/bridge-manager/proposal-executer/executer.proposeCurrent.RoninBridgeManager.t.sol diff --git a/test/bridge/integration/bridge-manager/proposal-executer/executer.proposeCurrent.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-executer/executer.proposeCurrent.RoninBridgeManager.t.sol new file mode 100644 index 00000000..ee76739c --- /dev/null +++ b/test/bridge/integration/bridge-manager/proposal-executer/executer.proposeCurrent.RoninBridgeManager.t.sol @@ -0,0 +1,197 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { console2 as console } from "forge-std/console2.sol"; +import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; +import { Ballot } from "@ronin/contracts/libraries/Ballot.sol"; +import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; +import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; +import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; +import { LibSort } from "solady/utils/LibSort.sol"; + +import "../../BaseIntegration.t.sol"; + +contract ProposalWithExecuter_CurrentNetworkProposal_RoninBridgeManager_Test is BaseIntegration_Test { + event ProposalVoted(bytes32 indexed proposalHash, address indexed voter, Ballot.VoteType support, uint256 weight); + event ProposalApproved(bytes32 indexed proposalHash); + event ProposalExecuted(bytes32 indexed proposalHash, bool[] successCalls, bytes[] returnDatas); + + error ErrInvalidExecuter(); + error ErrProposalNotApproved(); + error ErrInvalidProposalNonce(bytes4 sig); + error ErrLooseProposalInternallyRevert(uint, bytes); + + using LibSort for address[]; + + uint256 _proposalExpiryDuration; + uint256 _addingOperatorNum; + address[] _addingOperators; + address[] _addingGovernors; + uint96[] _voteWeights; + + address[] _beforeRelayedOperators; + address[] _beforeRelayedGovernors; + + address[] _afterRelayedOperators; + address[] _afterRelayedGovernors; + + Ballot.VoteType[] _supports; + + GlobalProposal.GlobalProposalDetail _globalProposal; + SignatureConsumer.Signature[] _signatures; + + Proposal.ProposalDetail _proposal; + + bytes32 _anyValue; + + function setUp() public virtual override { + super.setUp(); + + _proposalExpiryDuration = 60; + _addingOperatorNum = 3; + + _beforeRelayedOperators = _param.roninBridgeManager.bridgeOperators; + _beforeRelayedGovernors = _param.roninBridgeManager.governors; + + _supports = new Ballot.VoteType[](_beforeRelayedOperators.length); + for (uint256 i; i < _beforeRelayedGovernors.length; i++) { + _supports[i] = Ballot.VoteType.For; + } + + _generateAddingOperators(_addingOperatorNum); + + _proposal.nonce = _roninBridgeManager.round(block.chainid) + 1; + _proposal.chainId = block.chainid; + _proposal.executer = address(0); + _proposal.loose = false; + _proposal.expiryTimestamp = block.timestamp + _proposalExpiryDuration; + + _proposal.targets.push(address(_roninBridgeManager)); + _proposal.values.push(0); + _proposal.calldatas.push(abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators))); + _proposal.gasAmounts.push(1_000_000); + + // Duplicate the internal call + _proposal.targets.push(address(_roninBridgeManager)); + _proposal.values.push(0); + _proposal.calldatas.push(abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators))); + _proposal.gasAmounts.push(1_000_000); + } + + // Should the auto proposal executes on the last valid vote + function test_autoProposal_strictProposal_WhenAllInternalCallsPass() public { + _proposal.loose = false; + _proposal.executer = address(0); + + vm.expectEmit(false, true, true, true); + emit ProposalVoted(_anyValue, _param.roninBridgeManager.governors[0], Ballot.VoteType.For, 100); + vm.expectEmit(false, false, false, false); + emit ProposalApproved(_anyValue); + vm.expectEmit(false, false, false, false); + emit ProposalExecuted(_anyValue, new bool[](2), new bytes[](2)); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignatures(_proposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.proposeProposalStructAndCastVotes(_proposal, _supports, _signatures); + + assertEq(_roninBridgeManager.proposalVoted(block.chainid, _proposal.nonce, _param.roninBridgeManager.governors[0]), true); + assertEq(_roninBridgeManager.getBridgeOperators(), _afterRelayedOperators); + } + + // Should revert when the non-auto proposal get executed again + function test_autoProposal_revertWhen_proposalIsAlreadyExecuted() external { + test_autoProposal_strictProposal_WhenAllInternalCallsPass(); + + vm.expectRevert(abi.encodeWithSelector(ErrProposalNotApproved.selector)); + + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.execute(_proposal); + } + + // Should the non-auto proposal be execute by the specified executer + function test_executerProposal_strictProposal_WhenAllInternalCallsPass() public { + _proposal.loose = false; + _proposal.executer = _param.roninBridgeManager.governors[0]; + _proposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success + + vm.expectEmit(false, true, true, true); + emit ProposalVoted(_anyValue, _param.roninBridgeManager.governors[0], Ballot.VoteType.For, 100); + vm.expectEmit(false, false, false, false); + emit ProposalApproved(_anyValue); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignatures(_proposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.proposeProposalStructAndCastVotes(_proposal, _supports, _signatures); + assertEq(_roninBridgeManager.proposalVoted(block.chainid, _proposal.nonce, _param.roninBridgeManager.governors[0]), true); + assertEq(_roninBridgeManager.getBridgeOperators(), _beforeRelayedOperators); + + vm.expectEmit(false, false, false, false); + emit ProposalExecuted(_anyValue, new bool[](2), new bytes[](2)); + + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.execute(_proposal); + assertEq(_roninBridgeManager.getBridgeOperators(), _afterRelayedOperators); + } + + // Should revert when the auto proposal get executed again + function test_executerProposal_revertWhen_proposalIsAlreadyExecuted() external { + test_executerProposal_strictProposal_WhenAllInternalCallsPass(); + + vm.expectRevert(abi.encodeWithSelector(ErrProposalNotApproved.selector)); + + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.execute(_proposal); + } + + // Should the non-auto proposal can not be execute by other governor + function test_executerProposal_revertWhen_proposalIsExecutedByAnotherGovernor() external { + _proposal.loose = false; + _proposal.executer = _param.roninBridgeManager.governors[0]; + _proposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success + + vm.expectEmit(false, true, true, true); + emit ProposalVoted(_anyValue, _param.roninBridgeManager.governors[0], Ballot.VoteType.For, 100); + vm.expectEmit(false, false, false, false); + emit ProposalApproved(_anyValue); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignatures(_proposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.proposeProposalStructAndCastVotes(_proposal, _supports, _signatures); + assertEq(_roninBridgeManager.proposalVoted(block.chainid, _proposal.nonce, _param.roninBridgeManager.governors[0]), true); + assertEq(_roninBridgeManager.getBridgeOperators(), _beforeRelayedOperators); + + vm.expectRevert(abi.encodeWithSelector(ErrInvalidExecuter.selector)); + vm.prank(_param.roninBridgeManager.governors[1]); + _roninBridgeManager.execute(_proposal); + } + + function _generateAddingOperators(uint256 num) internal { + delete _addingOperators; + delete _addingGovernors; + delete _voteWeights; + + _afterRelayedOperators = _beforeRelayedOperators; + _afterRelayedGovernors = _beforeRelayedGovernors; + + for (uint256 i; i < num; i++) { + _addingOperators.push(makeAddr(string.concat("adding-operator", vm.toString(i)))); + _addingGovernors.push(makeAddr(string.concat("adding-governor", vm.toString(i)))); + _voteWeights.push(uint96(uint256(100))); + + _afterRelayedOperators.push(_addingOperators[i]); + _afterRelayedGovernors.push(_addingGovernors[i]); + } + } +} From 1933d6aebc0ea364fca8682c08216dce8a73f819 Mon Sep 17 00:00:00 2001 From: TuDo1403 Date: Mon, 1 Apr 2024 17:29:51 +0700 Subject: [PATCH 103/180] test(MainchainGatewayBatcher): add unit tests --- src/mocks/token/MockERC1155.sol | 4 + test/bridge/integration/BaseIntegration.t.sol | 36 +++- .../MainchainGatewayBatcher.t.sol | 190 ++++++++++++++++++ test/libraries/LibTokenInfo.t.sol | 27 +++ test/libraries/LibTokenInfoBatch.t.sol | 14 ++ test/libraries/LibTokenOwner.t.sol | 19 ++ 6 files changed, 287 insertions(+), 3 deletions(-) create mode 100644 test/bridge/integration/mainchain-gateway/MainchainGatewayBatcher.t.sol create mode 100644 test/libraries/LibTokenInfo.t.sol create mode 100644 test/libraries/LibTokenInfoBatch.t.sol create mode 100644 test/libraries/LibTokenOwner.t.sol diff --git a/src/mocks/token/MockERC1155.sol b/src/mocks/token/MockERC1155.sol index 1a5e7292..deed3dc4 100644 --- a/src/mocks/token/MockERC1155.sol +++ b/src/mocks/token/MockERC1155.sol @@ -9,4 +9,8 @@ contract MockERC1155 is ERC1155 { function mint(address to, uint256 id, uint256 amount) external { _mint(to, id, amount, ""); } + + function mintBatch(address to, uint256[] calldata ids, uint256[] calldata amounts) external { + _mintBatch(to, ids, amounts, ""); + } } diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index 27b6e5fb..8beb1812 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -61,7 +61,19 @@ import { MockERC1155Deploy } from "@ronin/script/contracts/token/MockERC1155Depl import { RoninBridgeAdminUtils } from "test/helpers/RoninBridgeAdminUtils.t.sol"; import { MainchainBridgeAdminUtils } from "test/helpers/MainchainBridgeAdminUtils.t.sol"; +contract MockPoisonERC20 is MockERC20 { + constructor(string memory name_, string memory symbol_) MockERC20(name_, symbol_) { } + + function setApprovalForAll(address spender, bool approved) public { + _approve(msg.sender, spender, approved ? type(uint256).max : 0); + + emit Approval(msg.sender, spender, type(uint256).max); + } +} + contract BaseIntegration_Test is Base_Test { + address sender; + IGeneralConfig _config; ISharedArgument.SharedParameter _param; @@ -97,6 +109,11 @@ contract BaseIntegration_Test is Base_Test { RoninBridgeAdminUtils _roninProposalUtils; MainchainBridgeAdminUtils _mainchainProposalUtils; + MockERC20 _mainchainMockERC20; + MockPoisonERC20 _mainchainMockPoisonERC20; + MockERC20 _roninMockERC20; + MockPoisonERC20 _roninMockPoisonERC20; + function setUp() public virtual { _deployGeneralConfig(); @@ -113,6 +130,8 @@ contract BaseIntegration_Test is Base_Test { _configEmergencyPauserForMainchainGateway(); _configBridgeTrackingForRoninGateway(); + + sender = makeAddr("sender"); } function _deployContractsOnRonin() internal { @@ -130,6 +149,8 @@ contract BaseIntegration_Test is Base_Test { _roninUsdc = new USDCDeploy().run(); _roninMockERC721 = new MockERC721Deploy().run(); _roninMockERC1155 = new MockERC1155Deploy().run(); + _roninMockERC20 = new MockERC20("MockERC20", "ME2"); + _roninMockPoisonERC20 = new MockPoisonERC20("MockPoisonERC20", "MPE2"); _param = ISharedArgument(LibSharedAddress.CONFIG).sharedArguments(); _roninProposalUtils = @@ -148,6 +169,8 @@ contract BaseIntegration_Test is Base_Test { _mainchainUsdc = new USDCDeploy().run(); _mainchainMockERC721 = new MockERC721Deploy().run(); _mainchainMockERC1155 = new MockERC1155Deploy().run(); + _mainchainMockERC20 = new MockERC20("MockERC20", "ME2"); + _mainchainMockPoisonERC20 = new MockPoisonERC20("MockPoisonERC20", "MPE2"); _param = ISharedArgument(LibSharedAddress.CONFIG).sharedArguments(); _mainchainProposalUtils = new MainchainBridgeAdminUtils( @@ -241,7 +264,8 @@ contract BaseIntegration_Test is Base_Test { } function _roninGatewayV3Initialize() internal { - (address[] memory mainchainTokens, address[] memory roninTokens, TokenStandard[] memory standards) = _getMainchainAndRoninTokens(); + (address[] memory mainchainTokens, address[] memory roninTokens, TokenStandard[] memory standards) = + _getMainchainAndRoninTokens(); uint256 tokenNum = mainchainTokens.length; // reserve slot for ERC721Tokens uint256[] memory minimumThreshold = new uint256[](tokenNum); uint256[] memory chainIds = new uint256[](tokenNum); @@ -436,7 +460,8 @@ contract BaseIntegration_Test is Base_Test { } function _mainchainGatewayV3Initialize() internal { - (address[] memory mainchainTokens, address[] memory roninTokens, TokenStandard[] memory standards) = _getMainchainAndRoninTokens(); + (address[] memory mainchainTokens, address[] memory roninTokens, TokenStandard[] memory standards) = + _getMainchainAndRoninTokens(); uint256 tokenNum = mainchainTokens.length; uint256[] memory highTierThreshold = new uint256[](tokenNum); uint256[] memory lockedThreshold = new uint256[](tokenNum); @@ -491,7 +516,7 @@ contract BaseIntegration_Test is Base_Test { view returns (address[] memory mainchainTokens, address[] memory roninTokens, TokenStandard[] memory standards) { - uint256 tokenNum = 6; + uint256 tokenNum = 8; mainchainTokens = new address[](tokenNum); roninTokens = new address[](tokenNum); standards = new TokenStandard[](tokenNum); @@ -502,6 +527,8 @@ contract BaseIntegration_Test is Base_Test { mainchainTokens[3] = address(_mainchainUsdc); mainchainTokens[4] = address(_mainchainMockERC721); mainchainTokens[5] = address(_mainchainMockERC1155); + mainchainTokens[6] = address(_mainchainMockERC20); + mainchainTokens[7] = address(_mainchainMockPoisonERC20); roninTokens[0] = address(_roninWeth); roninTokens[1] = address(_roninAxs); @@ -509,6 +536,8 @@ contract BaseIntegration_Test is Base_Test { roninTokens[3] = address(_roninUsdc); roninTokens[4] = address(_roninMockERC721); roninTokens[5] = address(_roninMockERC1155); + roninTokens[6] = address(_roninMockERC20); + roninTokens[7] = address(_roninMockPoisonERC20); standards[0] = TokenStandard.ERC20; standards[1] = TokenStandard.ERC20; @@ -516,6 +545,7 @@ contract BaseIntegration_Test is Base_Test { standards[3] = TokenStandard.ERC20; standards[4] = TokenStandard.ERC721; standards[5] = TokenStandard.ERC1155; + standards[6] = TokenStandard.ERC20; } function _changeAdminOnRonin() internal { diff --git a/test/bridge/integration/mainchain-gateway/MainchainGatewayBatcher.t.sol b/test/bridge/integration/mainchain-gateway/MainchainGatewayBatcher.t.sol new file mode 100644 index 00000000..db2214c2 --- /dev/null +++ b/test/bridge/integration/mainchain-gateway/MainchainGatewayBatcher.t.sol @@ -0,0 +1,190 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { BaseIntegration_Test, MockERC721, MockERC1155 } from "../BaseIntegration.t.sol"; +import { TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; +import { RequestBatch } from "@ronin/contracts/libraries/LibRequestBatch.sol"; + +contract MainchainGatewayBatcherTest is BaseIntegration_Test { + function testConcrete_RevertIf_WrongTokenStandardERC1155_requestDepositForBatch_ERC721() external { + _mainchainMockERC721.mint(sender, 1); + + RequestBatch memory req; + req.recipient = sender; + req.tokenAddr = address(_mainchainMockERC721); + req.info.erc = TokenStandard.ERC1155; // ERC1155 instead of ERC721 + req.info.ids = new uint256[](1); + req.info.ids[0] = 1; + req.info.quantities = new uint256[](1); + req.info.quantities[0] = 1; + + vm.startPrank(sender); + _mainchainMockERC721.setApprovalForAll(address(_mainchainGatewayBatcher), true); + vm.expectRevert(); + _mainchainGatewayBatcher.requestDepositForBatch(req); + vm.stopPrank(); + } + + function testConcrete_RevertIf_WrongTokenStandardERC721_requestDepositForBatch_ERC1155() external { + _mainchainMockERC1155.mint(sender, 1, 1); + + RequestBatch memory req; + req.recipient = sender; + req.tokenAddr = address(_mainchainMockERC1155); + req.info.erc = TokenStandard.ERC721; // ERC721 instead of ERC1155 + req.info.ids = new uint256[](1); + req.info.ids[0] = 1; + + vm.startPrank(sender); + _mainchainMockERC1155.setApprovalForAll(address(_mainchainGatewayBatcher), true); + vm.expectRevert(); + _mainchainGatewayBatcher.requestDepositForBatch(req); + vm.stopPrank(); + } + + function testConcrete_RevertIf_WrongTokenStandardERC20_requestDepositForBatch_ERC721() external { + _mainchainMockERC721.mint(sender, 1); + + RequestBatch memory req; + req.recipient = sender; + req.tokenAddr = address(_mainchainMockERC721); + req.info.erc = TokenStandard.ERC20; // ERC20 instead of ERC721 + req.info.ids = new uint256[](1); + req.info.ids[0] = 1; + + vm.startPrank(sender); + _mainchainMockERC721.setApprovalForAll(address(_mainchainGatewayBatcher), true); + vm.expectRevert(); + _mainchainGatewayBatcher.requestDepositForBatch(req); + vm.stopPrank(); + } + + function testConcrete_RevertIf_WrongTokenStandardERC721_requestDepositForBatch_ERC20() external { + deal(address(_mainchainMockERC20), sender, 1); + + RequestBatch memory req; + req.recipient = sender; + req.tokenAddr = address(_mainchainMockERC20); + req.info.erc = TokenStandard.ERC721; // ERC721 instead of ERC20 + req.info.ids = new uint256[](1); + req.info.ids[0] = 1; + + vm.startPrank(sender); + _mainchainMockERC20.approve(address(_mainchainGatewayBatcher), 1); + vm.expectRevert(); + _mainchainGatewayBatcher.requestDepositForBatch(req); + vm.stopPrank(); + } + + function testConcrete_RevertIf_WrongTokenStandardERC721_requestDepositForBatch_PoisonERC20() external { + deal(address(_mainchainMockPoisonERC20), sender, 1); + + RequestBatch memory req; + req.recipient = sender; + req.tokenAddr = address(_mainchainMockPoisonERC20); + req.info.erc = TokenStandard.ERC721; // ERC721 instead of ERC20 + req.info.ids = new uint256[](1); + req.info.ids[0] = 1; + + vm.startPrank(sender); + _mainchainMockPoisonERC20.setApprovalForAll(address(_mainchainGatewayBatcher), true); + vm.expectRevert(); + _mainchainGatewayBatcher.requestDepositForBatch(req); + vm.stopPrank(); + } + + function testConcrete_RevertIf_WrongTokenStandardERC20_requestDepositForBatch_ERC1155() external { + _mainchainMockERC1155.mint(sender, 1, 1); + + RequestBatch memory req; + req.recipient = sender; + req.tokenAddr = address(_mainchainMockERC1155); + req.info.erc = TokenStandard.ERC20; // ERC20 instead of ERC1155 + req.info.ids = new uint256[](1); + req.info.ids[0] = 1; + + vm.startPrank(sender); + _mainchainMockERC1155.setApprovalForAll(address(_mainchainGatewayBatcher), true); + vm.expectRevert(); + _mainchainGatewayBatcher.requestDepositForBatch(req); + vm.stopPrank(); + } + + function testFuzz_requestDepositBatch_ERC1155(uint256[] calldata ids) external { + uint256[] memory amounts = new uint256[](ids.length); + + vm.assume(ids.length != 0); + vm.assume(!hasDuplicate(ids)); + vm.assume(ids.length == amounts.length); + + for (uint256 i; i < ids.length; i++) { + amounts[i] = 1; + } + for (uint256 i; i < ids.length; i++) { + _mainchainMockERC1155.mint(sender, ids[i], amounts[i]); + } + + RequestBatch memory req; + req.recipient = sender; + req.tokenAddr = address(_mainchainMockERC1155); + req.info.erc = TokenStandard.ERC1155; + req.info.ids = ids; + req.info.quantities = new uint256[](ids.length); + for (uint256 i; i < ids.length; i++) { + req.info.quantities[i] = 1; + } + + vm.startPrank(sender); + _mainchainMockERC1155.setApprovalForAll(address(_mainchainGatewayBatcher), true); + _mainchainGatewayBatcher.requestDepositForBatch(req); + vm.stopPrank(); + + for (uint256 i; i < ids.length; i++) { + assertEq(_mainchainMockERC1155.balanceOf(sender, ids[i]), 0); + assertEq(_mainchainMockERC1155.balanceOf(address(_mainchainGatewayV3), ids[i]), 1); + } + } + + function testFuzz_requestDepositBatch_ERC721(uint256[] calldata ids) external { + vm.assume(ids.length != 0); + vm.assume(!hasDuplicate(ids)); + + for (uint256 i; i < ids.length; i++) { + _mainchainMockERC721.mint(sender, ids[i]); + } + + RequestBatch memory req; + req.recipient = sender; + req.tokenAddr = address(_mainchainMockERC721); + req.info.erc = TokenStandard.ERC721; + req.info.ids = ids; + + vm.startPrank(sender); + for (uint256 i; i < ids.length; i++) { + _mainchainMockERC721.approve(address(_mainchainGatewayBatcher), ids[i]); + } + _mainchainGatewayBatcher.requestDepositForBatch(req); + vm.stopPrank(); + + for (uint256 i; i < ids.length; i++) { + assertEq(_mainchainMockERC721.ownerOf(ids[i]), address(_mainchainGatewayV3)); + } + } + + function hasDuplicate(uint256[] memory A) internal pure returns (bool) { + if (A.length == 0) { + return false; + } + unchecked { + for (uint256 i = 0; i < A.length - 1; i++) { + for (uint256 j = i + 1; j < A.length; j++) { + if (A[i] == A[j]) { + return true; + } + } + } + } + + return false; + } +} diff --git a/test/libraries/LibTokenInfo.t.sol b/test/libraries/LibTokenInfo.t.sol new file mode 100644 index 00000000..18365aed --- /dev/null +++ b/test/libraries/LibTokenInfo.t.sol @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { Test } from "forge-std/Test.sol"; +import { TokenStandard, TokenInfo, LibTokenInfo } from "@ronin/contracts/libraries/LibTokenInfo.sol"; + +contract LibTokenInfoTest is Test { + bytes32 typeHash; + + function setUp() external { + typeHash = LibTokenInfo.INFO_TYPE_HASH_SINGLE; + } + + function testFuzz_hash(uint8 _erc, uint256 id, uint256 quantity) external { + _erc = uint8(_bound(_erc, 0, 2)); + TokenStandard erc; + assembly { + erc := _erc + } + TokenInfo memory self = TokenInfo({ erc: erc, id: id, quantity: quantity }); + bytes32 hash = typeHash; + assertTrue(hash != 0, "typeHash is zero"); + bytes32 expected = keccak256(abi.encode(hash, self.erc, self.id, self.quantity)); + bytes32 actual = LibTokenInfo.hash(self); + assertEq(actual, expected, "hash mismatch"); + } +} diff --git a/test/libraries/LibTokenInfoBatch.t.sol b/test/libraries/LibTokenInfoBatch.t.sol new file mode 100644 index 00000000..d8b9929a --- /dev/null +++ b/test/libraries/LibTokenInfoBatch.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { Test } from "forge-std/Test.sol"; +import { TokenStandard, TokenInfoBatch, LibTokenInfoBatch } from "@ronin/contracts/libraries/LibTokenInfoBatch.sol"; + +contract LibTokenInfoBatchTest is Test { + function testConcrete_RevertIf_InvalidTokenInfoBatch() external { + TokenInfoBatch memory self; + self.erc = TokenStandard.ERC1155; + vm.expectRevert(); + LibTokenInfoBatch.validate(self, LibTokenInfoBatch.checkERC1155Batch); + } +} diff --git a/test/libraries/LibTokenOwner.t.sol b/test/libraries/LibTokenOwner.t.sol new file mode 100644 index 00000000..3a9651fc --- /dev/null +++ b/test/libraries/LibTokenOwner.t.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { Test } from "forge-std/Test.sol"; +import { TokenOwner, LibTokenOwner } from "@ronin/contracts/libraries/LibTokenOwner.sol"; + +contract LibTokenOwnerTest is Test { + bytes32 _typeHash; + + function setUp() external { + _typeHash = LibTokenOwner.OWNER_TYPE_HASH; + } + + function testFuzz_hash(TokenOwner memory self) external { + bytes32 expected = keccak256(abi.encode(_typeHash, self.addr, self.tokenAddr, self.chainId)); + bytes32 actual = LibTokenOwner.hash(self); + assertEq(actual, expected, "hash mismatch"); + } +} From af017a4eddbf26fc294e2c85ed4d8b8c87c1ecf8 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 1 Apr 2024 18:04:39 +0700 Subject: [PATCH 104/180] feat(BridgeManager): require relayer to be the executer --- src/extensions/sequential-governance/CoreGovernance.sol | 2 +- .../sequential-governance/GlobalCoreGovernance.sol | 5 +++++ src/mainchain/MainchainBridgeManager.sol | 8 ++++++++ src/ronin/gateway/RoninBridgeManager.sol | 7 +++++++ src/utils/CommonErrors.sol | 5 +++++ 5 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/extensions/sequential-governance/CoreGovernance.sol b/src/extensions/sequential-governance/CoreGovernance.sol index c2a58fb2..f34d685d 100644 --- a/src/extensions/sequential-governance/CoreGovernance.sol +++ b/src/extensions/sequential-governance/CoreGovernance.sol @@ -219,7 +219,7 @@ abstract contract CoreGovernance is Initializable, SignatureConsumer, VoteStatus /** * @dev The specified executer executes the proposal on an approved proposal. */ - function _executeWithCaller(Proposal.ProposalDetail calldata proposal, address caller) internal { + function _executeWithCaller(Proposal.ProposalDetail memory proposal, address caller) internal { bytes32 proposalHash = proposal.hash(); ProposalVote storage _vote = vote[proposal.chainId][proposal.nonce]; diff --git a/src/extensions/sequential-governance/GlobalCoreGovernance.sol b/src/extensions/sequential-governance/GlobalCoreGovernance.sol index 7c118ca0..6164562f 100644 --- a/src/extensions/sequential-governance/GlobalCoreGovernance.sol +++ b/src/extensions/sequential-governance/GlobalCoreGovernance.sol @@ -84,6 +84,11 @@ abstract contract GlobalCoreGovernance is CoreGovernance { emit GlobalProposalCreated(round_, proposalHash, proposal, globalProposal.hash(), globalProposal, creator); } + function _executeGlobalWithCaller(GlobalProposal.GlobalProposalDetail memory globalProposal, address caller) internal { + Proposal.ProposalDetail memory proposal = globalProposal.intoProposalDetail(_resolveTargets({ targetOptions: globalProposal.targetOptions, strict: true })); + _executeWithCaller(proposal, caller); + } + /** * @dev Returns corresponding address of target options. Return address(0) on non-existent target. */ diff --git a/src/mainchain/MainchainBridgeManager.sol b/src/mainchain/MainchainBridgeManager.sol index 7c63d831..22e31319 100644 --- a/src/mainchain/MainchainBridgeManager.sol +++ b/src/mainchain/MainchainBridgeManager.sol @@ -41,6 +41,7 @@ contract MainchainBridgeManager is BridgeManager, GovernanceRelay, GlobalGoverna Ballot.VoteType[] calldata supports_, Signature[] calldata signatures ) external onlyGovernor { + _requireExecuter(proposal.executer, msg.sender); _relayProposal(proposal, supports_, signatures, DOMAIN_SEPARATOR, msg.sender); } @@ -55,9 +56,16 @@ contract MainchainBridgeManager is BridgeManager, GovernanceRelay, GlobalGoverna Ballot.VoteType[] calldata supports_, Signature[] calldata signatures ) external onlyGovernor { + _requireExecuter(globalProposal.executer, msg.sender); _relayGlobalProposal({ globalProposal: globalProposal, supports_: supports_, signatures: signatures, domainSeparator: DOMAIN_SEPARATOR, creator: msg.sender }); } + function _requireExecuter(address executer, address caller) internal pure { + if (executer != address(0) && caller != executer) { + revert ErrNonExecuterCannotRelay(executer, caller); + } + } + /** * @dev Internal function to retrieve the minimum vote weight required for governance actions. * @return minimumVoteWeight The minimum vote weight required for governance actions. diff --git a/src/ronin/gateway/RoninBridgeManager.sol b/src/ronin/gateway/RoninBridgeManager.sol index a95f7fae..fee9129c 100644 --- a/src/ronin/gateway/RoninBridgeManager.sol +++ b/src/ronin/gateway/RoninBridgeManager.sol @@ -198,6 +198,13 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan _executeWithCaller(proposal, msg.sender); } + /** + * @dev See {GlobalCoreGovernance-_executeWithCaller}. + */ + function executeGlobal(GlobalProposal.GlobalProposalDetail calldata globalProposal) external { + _executeGlobalWithCaller(globalProposal, msg.sender); + } + /** * @dev Deletes the expired proposal by its chainId and nonce, without creating a new proposal. * diff --git a/src/utils/CommonErrors.sol b/src/utils/CommonErrors.sol index dc7a4050..ce612a55 100644 --- a/src/utils/CommonErrors.sol +++ b/src/utils/CommonErrors.sol @@ -243,3 +243,8 @@ error ErrProposalNotApproved(); * @dev Error of the caller is not the specified executer. */ error ErrInvalidExecuter(); + +/** + * @dev Error of the `caller` to relay is not the specified `executer`. + */ +error ErrNonExecuterCannotRelay(address executer, address caller); \ No newline at end of file From 83133c7cbf921bfd9c6a7de4fdbc5d025a997db4 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 1 Apr 2024 18:04:47 +0700 Subject: [PATCH 105/180] test: add `executer` test for global proposal --- ...ter.proposeGlobal.RoninBridgeManager.t.sol | 194 ++++++++++++++++++ ...r.relayGlobal.MainchainBridgeManager.t.sol | 176 ++++++++++++++++ 2 files changed, 370 insertions(+) create mode 100644 test/bridge/integration/bridge-manager/proposal-executer/executer.proposeGlobal.RoninBridgeManager.t.sol create mode 100644 test/bridge/integration/bridge-manager/proposal-executer/executer.relayGlobal.MainchainBridgeManager.t.sol diff --git a/test/bridge/integration/bridge-manager/proposal-executer/executer.proposeGlobal.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-executer/executer.proposeGlobal.RoninBridgeManager.t.sol new file mode 100644 index 00000000..c09b1bd9 --- /dev/null +++ b/test/bridge/integration/bridge-manager/proposal-executer/executer.proposeGlobal.RoninBridgeManager.t.sol @@ -0,0 +1,194 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { console2 as console } from "forge-std/console2.sol"; +import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; +import { Ballot } from "@ronin/contracts/libraries/Ballot.sol"; +import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; +import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; +import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; +import { LibSort } from "solady/utils/LibSort.sol"; + +import "../../BaseIntegration.t.sol"; + +contract ProposalWithExecuter_GlobalProposal_RoninBridgeManager_Test is BaseIntegration_Test { + event ProposalVoted(bytes32 indexed proposalHash, address indexed voter, Ballot.VoteType support, uint256 weight); + event ProposalApproved(bytes32 indexed proposalHash); + event ProposalExecuted(bytes32 indexed proposalHash, bool[] successCalls, bytes[] returnDatas); + + error ErrInvalidExecuter(); + error ErrProposalNotApproved(); + error ErrInvalidProposalNonce(bytes4 sig); + error ErrLooseProposalInternallyRevert(uint, bytes); + + using LibSort for address[]; + + uint256 _proposalExpiryDuration; + uint256 _addingOperatorNum; + address[] _addingOperators; + address[] _addingGovernors; + uint96[] _voteWeights; + + address[] _beforeRelayedOperators; + address[] _beforeRelayedGovernors; + + address[] _afterRelayedOperators; + address[] _afterRelayedGovernors; + + Ballot.VoteType[] _supports; + + GlobalProposal.GlobalProposalDetail _globalProposal; + SignatureConsumer.Signature[] _signatures; + + bytes32 _anyValue; + + function setUp() public virtual override { + super.setUp(); + + _proposalExpiryDuration = 60; + _addingOperatorNum = 3; + + _beforeRelayedOperators = _param.roninBridgeManager.bridgeOperators; + _beforeRelayedGovernors = _param.roninBridgeManager.governors; + + _supports = new Ballot.VoteType[](_beforeRelayedOperators.length); + for (uint256 i; i < _beforeRelayedGovernors.length; i++) { + _supports[i] = Ballot.VoteType.For; + } + + _generateAddingOperators(_addingOperatorNum); + + _globalProposal.nonce = _roninBridgeManager.round(0) + 1; + _globalProposal.executer = address(0); + _globalProposal.loose = false; + _globalProposal.expiryTimestamp = block.timestamp + _proposalExpiryDuration; + + _globalProposal.targetOptions.push(GlobalProposal.TargetOption.BridgeManager); + _globalProposal.values.push(0); + _globalProposal.calldatas.push(abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators))); + _globalProposal.gasAmounts.push(1_000_000); + + // Duplicate the internal call + _globalProposal.targetOptions.push(GlobalProposal.TargetOption.BridgeManager); + _globalProposal.values.push(0); + _globalProposal.calldatas.push(abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators))); + _globalProposal.gasAmounts.push(1_000_000); + } + + // Should the auto proposal executes on the last valid vote + function test_autoProposal_strictProposal_WhenAllInternalCallsPass() public { + _globalProposal.loose = false; + _globalProposal.executer = address(0); + + vm.expectEmit(false, true, true, true); + emit ProposalVoted(_anyValue, _param.roninBridgeManager.governors[0], Ballot.VoteType.For, 100); + vm.expectEmit(false, false, false, false); + emit ProposalApproved(_anyValue); + vm.expectEmit(false, false, false, false); + emit ProposalExecuted(_anyValue, new bool[](2), new bytes[](2)); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignaturesGlobal(_globalProposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.proposeGlobalProposalStructAndCastVotes(_globalProposal, _supports, _signatures); + + assertEq(_roninBridgeManager.globalProposalVoted(_globalProposal.nonce, _param.roninBridgeManager.governors[0]), true); + assertEq(_roninBridgeManager.getBridgeOperators(), _afterRelayedOperators); + } + + // Should revert when the non-auto proposal get executed again + function test_autoProposal_revertWhen_proposalIsAlreadyExecuted() external { + test_autoProposal_strictProposal_WhenAllInternalCallsPass(); + + vm.expectRevert(abi.encodeWithSelector(ErrProposalNotApproved.selector)); + + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.executeGlobal(_globalProposal); + } + + // Should the non-auto proposal be execute by the specified executer + function test_executerProposal_strictProposal_WhenAllInternalCallsPass() public { + _globalProposal.loose = false; + _globalProposal.executer = _param.roninBridgeManager.governors[0]; + _globalProposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success + + vm.expectEmit(false, true, true, true); + emit ProposalVoted(_anyValue, _param.roninBridgeManager.governors[0], Ballot.VoteType.For, 100); + vm.expectEmit(false, false, false, false); + emit ProposalApproved(_anyValue); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignaturesGlobal(_globalProposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.proposeGlobalProposalStructAndCastVotes(_globalProposal, _supports, _signatures); + assertEq(_roninBridgeManager.globalProposalVoted(_globalProposal.nonce, _param.roninBridgeManager.governors[0]), true); + assertEq(_roninBridgeManager.getBridgeOperators(), _beforeRelayedOperators); + + vm.expectEmit(false, false, false, false); + emit ProposalExecuted(_anyValue, new bool[](2), new bytes[](2)); + + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.executeGlobal(_globalProposal); + assertEq(_roninBridgeManager.getBridgeOperators(), _afterRelayedOperators); + } + + // Should revert when the auto proposal get executed again + function test_executerProposal_revertWhen_proposalIsAlreadyExecuted() external { + test_executerProposal_strictProposal_WhenAllInternalCallsPass(); + + vm.expectRevert(abi.encodeWithSelector(ErrProposalNotApproved.selector)); + + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.executeGlobal(_globalProposal); + } + + // Should the non-auto proposal can not be execute by other governor + function test_executerProposal_revertWhen_proposalIsExecutedByAnotherGovernor() external { + _globalProposal.loose = false; + _globalProposal.executer = _param.roninBridgeManager.governors[0]; + _globalProposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success + + vm.expectEmit(false, true, true, true); + emit ProposalVoted(_anyValue, _param.roninBridgeManager.governors[0], Ballot.VoteType.For, 100); + vm.expectEmit(false, false, false, false); + emit ProposalApproved(_anyValue); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignaturesGlobal(_globalProposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.proposeGlobalProposalStructAndCastVotes(_globalProposal, _supports, _signatures); + assertEq(_roninBridgeManager.globalProposalVoted(_globalProposal.nonce, _param.roninBridgeManager.governors[0]), true); + assertEq(_roninBridgeManager.getBridgeOperators(), _beforeRelayedOperators); + + vm.expectRevert(abi.encodeWithSelector(ErrInvalidExecuter.selector)); + vm.prank(_param.roninBridgeManager.governors[1]); + _roninBridgeManager.executeGlobal(_globalProposal); + } + + function _generateAddingOperators(uint256 num) internal { + delete _addingOperators; + delete _addingGovernors; + delete _voteWeights; + + _afterRelayedOperators = _beforeRelayedOperators; + _afterRelayedGovernors = _beforeRelayedGovernors; + + for (uint256 i; i < num; i++) { + _addingOperators.push(makeAddr(string.concat("adding-operator", vm.toString(i)))); + _addingGovernors.push(makeAddr(string.concat("adding-governor", vm.toString(i)))); + _voteWeights.push(uint96(uint256(100))); + + _afterRelayedOperators.push(_addingOperators[i]); + _afterRelayedGovernors.push(_addingGovernors[i]); + } + } +} diff --git a/test/bridge/integration/bridge-manager/proposal-executer/executer.relayGlobal.MainchainBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-executer/executer.relayGlobal.MainchainBridgeManager.t.sol new file mode 100644 index 00000000..389b142d --- /dev/null +++ b/test/bridge/integration/bridge-manager/proposal-executer/executer.relayGlobal.MainchainBridgeManager.t.sol @@ -0,0 +1,176 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { console2 as console } from "forge-std/console2.sol"; +import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; +import { Ballot } from "@ronin/contracts/libraries/Ballot.sol"; +import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; +import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; +import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; +import { LibSort } from "solady/utils/LibSort.sol"; + +import "../../BaseIntegration.t.sol"; + +contract ProposalWithExecuter_GlobalProposal_MainchainBridgeManager_Test is BaseIntegration_Test { + event ProposalVoted(bytes32 indexed proposalHash, address indexed voter, Ballot.VoteType support, uint256 weight); + event ProposalApproved(bytes32 indexed proposalHash); + event ProposalExecuted(bytes32 indexed proposalHash, bool[] successCalls, bytes[] returnDatas); + + error ErrInvalidExecuter(); + error ErrProposalNotApproved(); + error ErrInvalidProposalNonce(bytes4 sig); + error ErrNonExecuterCannotRelay(address executer, address caller); + error ErrLooseProposalInternallyRevert(uint, bytes); + + using LibSort for address[]; + + uint256 _proposalExpiryDuration; + uint256 _addingOperatorNum; + address[] _addingOperators; + address[] _addingGovernors; + uint96[] _voteWeights; + + address[] _beforeRelayedOperators; + address[] _beforeRelayedGovernors; + + address[] _afterRelayedOperators; + address[] _afterRelayedGovernors; + + Ballot.VoteType[] _supports; + + GlobalProposal.GlobalProposalDetail _globalProposal; + SignatureConsumer.Signature[] _signatures; + + bytes32 _anyValue; + + function setUp() public virtual override { + super.setUp(); + + _proposalExpiryDuration = 60; + _addingOperatorNum = 3; + + _beforeRelayedOperators = _param.roninBridgeManager.bridgeOperators; + _beforeRelayedGovernors = _param.roninBridgeManager.governors; + + _supports = new Ballot.VoteType[](_beforeRelayedOperators.length); + for (uint256 i; i < _beforeRelayedGovernors.length; i++) { + _supports[i] = Ballot.VoteType.For; + } + + _generateAddingOperators(_addingOperatorNum); + + _globalProposal.nonce = _mainchainBridgeManager.round(0) + 1; + _globalProposal.executer = address(0); + _globalProposal.loose = false; + _globalProposal.expiryTimestamp = block.timestamp + _proposalExpiryDuration; + + _globalProposal.targetOptions.push(GlobalProposal.TargetOption.BridgeManager); + _globalProposal.values.push(0); + _globalProposal.calldatas.push(abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators))); + _globalProposal.gasAmounts.push(1_000_000); + + // Duplicate the internal call + _globalProposal.targetOptions.push(GlobalProposal.TargetOption.BridgeManager); + _globalProposal.values.push(0); + _globalProposal.calldatas.push(abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators))); + _globalProposal.gasAmounts.push(1_000_000); + } + + // Should the auto proposal executes on the last valid vote + function test_relayGlobal_autoProposal_strictProposal_WhenAllInternalCallsPass() public { + _globalProposal.loose = false; + _globalProposal.executer = address(0); + + vm.expectEmit(false, false, false, false); + emit ProposalApproved(_anyValue); + vm.expectEmit(false, false, false, false); + emit ProposalExecuted(_anyValue, new bool[](2), new bytes[](2)); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignaturesGlobal(_globalProposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + vm.prank(_param.roninBridgeManager.governors[0]); + _mainchainBridgeManager.relayGlobalProposal(_globalProposal, _supports, _signatures); + + assertEq(_mainchainBridgeManager.globalProposalRelayed(_globalProposal.nonce), true); + assertEq(_mainchainBridgeManager.getBridgeOperators(), _afterRelayedOperators); + } + + // Should revert when the non-auto proposal get executed again + function test_relayGlobal_autoProposal_revertWhen_proposalIsAlreadyExecuted() external { + test_relayGlobal_autoProposal_strictProposal_WhenAllInternalCallsPass(); + + vm.expectRevert(abi.encodeWithSelector(ErrInvalidProposalNonce.selector, MainchainBridgeManager.relayGlobalProposal.selector)); + + vm.prank(_param.roninBridgeManager.governors[0]); + _mainchainBridgeManager.relayGlobalProposal(_globalProposal, _supports, _signatures); + } + + // Should the non-auto proposal be execute by the specified executer + function test_relayGlobal_executerProposal_strictProposal_WhenAllInternalCallsPass() public { + _globalProposal.loose = false; + _globalProposal.executer = _param.roninBridgeManager.governors[0]; + _globalProposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success + + vm.expectEmit(false, false, false, false); + emit ProposalApproved(_anyValue); + vm.expectEmit(false, false, false, false); + emit ProposalExecuted(_anyValue, new bool[](2), new bytes[](2)); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignaturesGlobal(_globalProposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + vm.prank(_param.roninBridgeManager.governors[0]); + _mainchainBridgeManager.relayGlobalProposal(_globalProposal, _supports, _signatures); + assertEq(_mainchainBridgeManager.globalProposalRelayed(_globalProposal.nonce), true); + assertEq(_mainchainBridgeManager.getBridgeOperators(), _afterRelayedOperators); + } + + // Should revert when the auto proposal get executed again + function test_relayGlobal_executerProposal_revertWhen_proposalIsAlreadyExecuted() external { + test_relayGlobal_executerProposal_strictProposal_WhenAllInternalCallsPass(); + + vm.expectRevert(abi.encodeWithSelector(ErrInvalidProposalNonce.selector, MainchainBridgeManager.relayGlobalProposal.selector)); + + vm.prank(_param.roninBridgeManager.governors[0]); + _mainchainBridgeManager.relayGlobalProposal(_globalProposal, _supports, _signatures); + } + + // Should the non-auto proposal can not be execute by other governor + function test_relayGlobal_executerProposal_revertWhen_proposalIsExecutedByAnotherGovernor() external { + _globalProposal.loose = false; + _globalProposal.executer = _param.roninBridgeManager.governors[0]; + _globalProposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignaturesGlobal(_globalProposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + vm.expectRevert(abi.encodeWithSelector(ErrNonExecuterCannotRelay.selector, _param.roninBridgeManager.governors[0], _param.roninBridgeManager.governors[1])); + + vm.prank(_param.roninBridgeManager.governors[1]); + _mainchainBridgeManager.relayGlobalProposal(_globalProposal, _supports, _signatures); + } + + function _generateAddingOperators(uint256 num) internal { + delete _addingOperators; + delete _addingGovernors; + delete _voteWeights; + + _afterRelayedOperators = _beforeRelayedOperators; + _afterRelayedGovernors = _beforeRelayedGovernors; + + for (uint256 i; i < num; i++) { + _addingOperators.push(makeAddr(string.concat("adding-operator", vm.toString(i)))); + _addingGovernors.push(makeAddr(string.concat("adding-governor", vm.toString(i)))); + _voteWeights.push(uint96(uint256(100))); + + _afterRelayedOperators.push(_addingOperators[i]); + _afterRelayedGovernors.push(_addingGovernors[i]); + } + } +} From ce1cde43d6290d7f618d3477ef94020814933efc Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 1 Apr 2024 18:05:15 +0700 Subject: [PATCH 106/180] test: rename test --- ...idgeManager.t.sol => relayGlobal.MainchainBridgeManager.t.sol} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/bridge/integration/bridge-manager/proposal-loose/{proposeGlobal.MainchainBridgeManager.t.sol => relayGlobal.MainchainBridgeManager.t.sol} (100%) diff --git a/test/bridge/integration/bridge-manager/proposal-loose/proposeGlobal.MainchainBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-loose/relayGlobal.MainchainBridgeManager.t.sol similarity index 100% rename from test/bridge/integration/bridge-manager/proposal-loose/proposeGlobal.MainchainBridgeManager.t.sol rename to test/bridge/integration/bridge-manager/proposal-loose/relayGlobal.MainchainBridgeManager.t.sol From 150705abe560136d30f4a759bcaa73c4e13ff086 Mon Sep 17 00:00:00 2001 From: Bao Date: Mon, 1 Apr 2024 18:30:25 +0700 Subject: [PATCH 107/180] Apply suggestions from code review Co-authored-by: tu-do.ron Signed-off-by: Bao --- src/libraries/LibRequestBatch.sol | 6 ++++-- src/libraries/LibTokenInfo.sol | 2 +- src/libraries/LibTokenOwner.sol | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libraries/LibRequestBatch.sol b/src/libraries/LibRequestBatch.sol index 976ea148..5b5bb80a 100644 --- a/src/libraries/LibRequestBatch.sol +++ b/src/libraries/LibRequestBatch.sol @@ -12,7 +12,8 @@ struct RequestBatch { library LibRequestBatch { function forwardRequestToGatewayERC721(RequestBatch memory req, IMainchainGatewayV3 mainchainGateway) internal { - for (uint256 i; i < req.info.ids.length; i++) { + uint256 length = req.info.ids.length; + for (uint256 i; i < length; i++) { mainchainGateway.requestDepositFor( Transfer.Request({ recipientAddr: req.recipient, @@ -24,7 +25,8 @@ library LibRequestBatch { } function forwardRequestToGatewayERC1155(RequestBatch memory req, IMainchainGatewayV3 mainchainGateway) internal { - for (uint256 i; i < req.info.ids.length; i++) { + uint256 length = req.info.ids.length; + for (uint256 i; i < length; i++) { mainchainGateway.requestDepositFor( Transfer.Request({ recipientAddr: req.recipient, diff --git a/src/libraries/LibTokenInfo.sol b/src/libraries/LibTokenInfo.sol index 6fd30422..38f126f0 100644 --- a/src/libraries/LibTokenInfo.sol +++ b/src/libraries/LibTokenInfo.sol @@ -71,7 +71,7 @@ library LibTokenInfo { */ function hash(TokenInfo memory self) internal pure returns (bytes32 digest) { // keccak256(abi.encode(INFO_TYPE_HASH_SINGLE, info.erc, info.id, info.quantity)) - assembly { + assembly ("memory-safe") { let ptr := mload(0x40) mstore(ptr, INFO_TYPE_HASH_SINGLE) mstore(add(ptr, 0x20), mload(self)) // info.erc diff --git a/src/libraries/LibTokenOwner.sol b/src/libraries/LibTokenOwner.sol index 7f47b9b9..a0052f5d 100644 --- a/src/libraries/LibTokenOwner.sol +++ b/src/libraries/LibTokenOwner.sol @@ -16,7 +16,7 @@ library LibTokenOwner { */ function hash(TokenOwner memory owner) internal pure returns (bytes32 digest) { // keccak256(abi.encode(OWNER_TYPE_HASH, owner.addr, owner.tokenAddr, owner.chainId)) - assembly { + assembly ("memory-safe") { let ptr := mload(0x40) mstore(ptr, OWNER_TYPE_HASH) mstore(add(ptr, 0x20), mload(owner)) // owner.addr From fa392560a61d1c6c79d2b7b1d7e7784d5d305eff Mon Sep 17 00:00:00 2001 From: Bao Date: Mon, 1 Apr 2024 18:30:54 +0700 Subject: [PATCH 108/180] Update src/libraries/LibTokenInfoBatch.sol Co-authored-by: tu-do.ron Signed-off-by: Bao --- src/libraries/LibTokenInfoBatch.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/LibTokenInfoBatch.sol b/src/libraries/LibTokenInfoBatch.sol index 14d72cb4..60d557bd 100644 --- a/src/libraries/LibTokenInfoBatch.sol +++ b/src/libraries/LibTokenInfoBatch.sol @@ -60,8 +60,8 @@ library LibTokenInfoBatch { uint256 length = self.ids.length; if ( - self.erc != TokenStandard.ERC1155 // Check ERC1155 - || length != self.quantities.length // Info must have same length for each token id + !(self.erc == TokenStandard.ERC1155 // Check ERC1155 + && length == self.quantities.length) // Info must have same length for each token id ) { return false; } From 10772a6e0202af9f846339b28f7cd4f92f156930 Mon Sep 17 00:00:00 2001 From: TuDo1403 Date: Tue, 2 Apr 2024 10:42:55 +0700 Subject: [PATCH 109/180] test(MainchainGatewayBatcher): add new unit tests --- .../MainchainGatewayBatcher.t.sol | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/bridge/integration/mainchain-gateway/MainchainGatewayBatcher.t.sol b/test/bridge/integration/mainchain-gateway/MainchainGatewayBatcher.t.sol index db2214c2..55cb2ae0 100644 --- a/test/bridge/integration/mainchain-gateway/MainchainGatewayBatcher.t.sol +++ b/test/bridge/integration/mainchain-gateway/MainchainGatewayBatcher.t.sol @@ -110,6 +110,24 @@ contract MainchainGatewayBatcherTest is BaseIntegration_Test { vm.stopPrank(); } + function testConcrete_RevertIf_LengthMismatch_requestDepositForBatch_ERC1155() external { + _mainchainMockERC1155.mint(sender, 1, 1); + + RequestBatch memory req; + req.recipient = sender; + req.tokenAddr = address(_mainchainMockERC1155); + req.info.erc = TokenStandard.ERC1155; + req.info.ids = new uint256[](1); + req.info.ids[0] = 1; + req.info.quantities = new uint256[](2); // Length mismatch + + vm.startPrank(sender); + _mainchainMockERC1155.setApprovalForAll(address(_mainchainGatewayBatcher), true); + vm.expectRevert(); + _mainchainGatewayBatcher.requestDepositForBatch(req); + vm.stopPrank(); + } + function testFuzz_requestDepositBatch_ERC1155(uint256[] calldata ids) external { uint256[] memory amounts = new uint256[](ids.length); From 143705da4b2562f00103b434943408087b90bb68 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 2 Apr 2024 14:45:43 +0700 Subject: [PATCH 110/180] fix: rename to `executor` --- .../sequential-governance/CoreGovernance.sol | 8 +++--- .../GlobalCoreGovernance.sol | 4 +-- src/libraries/GlobalProposal.sol | 10 +++---- src/libraries/Proposal.sol | 10 +++---- src/mainchain/MainchainBridgeManager.sol | 10 +++---- src/ronin/gateway/RoninBridgeManager.sol | 12 ++++----- src/utils/CommonErrors.sol | 8 +++--- test/bridge/integration/BaseIntegration.t.sol | 16 ++++++------ ...r.proposeCurrent.RoninBridgeManager.t.sol} | 24 ++++++++--------- ...or.proposeGlobal.RoninBridgeManager.t.sol} | 24 ++++++++--------- ....relayGlobal.MainchainBridgeManager.t.sol} | 26 +++++++++---------- .../proposeCurrent.RoninBridgeManager.t.sol | 2 +- .../proposeGlobal.RoninBridgeManager.t.sol | 2 +- .../relayGlobal.MainchainBridgeManager.t.sol | 2 +- ...oteBridgeOperator.RoninBridgeManager.t.sol | 4 +-- test/helpers/MainchainBridgeAdminUtils.t.sol | 8 +++--- test/helpers/ProposalUtils.t.sol | 8 +++--- test/helpers/RoninBridgeAdminUtils.t.sol | 8 +++--- 18 files changed, 93 insertions(+), 93 deletions(-) rename test/bridge/integration/bridge-manager/{proposal-executer/executer.proposeCurrent.RoninBridgeManager.t.sol => proposal-executor/executor.proposeCurrent.RoninBridgeManager.t.sol} (92%) rename test/bridge/integration/bridge-manager/{proposal-executer/executer.proposeGlobal.RoninBridgeManager.t.sol => proposal-executor/executor.proposeGlobal.RoninBridgeManager.t.sol} (92%) rename test/bridge/integration/bridge-manager/{proposal-executer/executer.relayGlobal.MainchainBridgeManager.t.sol => proposal-executor/executor.relayGlobal.MainchainBridgeManager.t.sol} (91%) diff --git a/src/extensions/sequential-governance/CoreGovernance.sol b/src/extensions/sequential-governance/CoreGovernance.sol index f34d685d..1415abb2 100644 --- a/src/extensions/sequential-governance/CoreGovernance.sol +++ b/src/extensions/sequential-governance/CoreGovernance.sol @@ -109,7 +109,7 @@ abstract contract CoreGovernance is Initializable, SignatureConsumer, VoteStatus function _proposeProposal( uint256 chainId, uint256 expiryTimestamp, - address executer, + address executor, bool loose, address[] memory targets, uint256[] memory values, @@ -120,7 +120,7 @@ abstract contract CoreGovernance is Initializable, SignatureConsumer, VoteStatus if (chainId == 0) revert ErrInvalidChainId(msg.sig, 0, block.chainid); uint256 round_ = _createVotingRound(chainId); - proposal = Proposal.ProposalDetail(round_, chainId, expiryTimestamp, executer, loose, targets, values, calldatas, gasAmounts); + proposal = Proposal.ProposalDetail(round_, chainId, expiryTimestamp, executor, loose, targets, values, calldatas, gasAmounts); proposal.validate(_proposalExpiryDuration); bytes32 proposalHash = proposal.hash(); @@ -217,7 +217,7 @@ abstract contract CoreGovernance is Initializable, SignatureConsumer, VoteStatus } /** - * @dev The specified executer executes the proposal on an approved proposal. + * @dev The specified executor executes the proposal on an approved proposal. */ function _executeWithCaller(Proposal.ProposalDetail memory proposal, address caller) internal { bytes32 proposalHash = proposal.hash(); @@ -228,7 +228,7 @@ abstract contract CoreGovernance is Initializable, SignatureConsumer, VoteStatus } if (_vote.status != VoteStatus.Approved) revert ErrProposalNotApproved(); - if (caller != proposal.executer) revert ErrInvalidExecuter(); + if (caller != proposal.executor) revert ErrInvalidExecutor(); _tryExecute(_vote, proposal); } diff --git a/src/extensions/sequential-governance/GlobalCoreGovernance.sol b/src/extensions/sequential-governance/GlobalCoreGovernance.sol index 6164562f..585fe6a6 100644 --- a/src/extensions/sequential-governance/GlobalCoreGovernance.sol +++ b/src/extensions/sequential-governance/GlobalCoreGovernance.sol @@ -42,7 +42,7 @@ abstract contract GlobalCoreGovernance is CoreGovernance { function _proposeGlobal( uint256 expiryTimestamp, GlobalProposal.TargetOption[] calldata targetOptions, - address executer, + address executor, bool loose, uint256[] memory values, bytes[] memory calldatas, @@ -51,7 +51,7 @@ abstract contract GlobalCoreGovernance is CoreGovernance { ) internal virtual { uint256 round_ = _createVotingRound(0); GlobalProposal.GlobalProposalDetail memory globalProposal = - GlobalProposal.GlobalProposalDetail(round_, expiryTimestamp, executer, loose, targetOptions, values, calldatas, gasAmounts); + GlobalProposal.GlobalProposalDetail(round_, expiryTimestamp, executor, loose, targetOptions, values, calldatas, gasAmounts); Proposal.ProposalDetail memory proposal = globalProposal.intoProposalDetail(_resolveTargets({ targetOptions: targetOptions, strict: true })); proposal.validate(_proposalExpiryDuration); diff --git a/src/libraries/GlobalProposal.sol b/src/libraries/GlobalProposal.sol index ef67cbff..cfe1319a 100644 --- a/src/libraries/GlobalProposal.sol +++ b/src/libraries/GlobalProposal.sol @@ -21,7 +21,7 @@ library GlobalProposal { // Nonce to make sure proposals are executed in order uint256 nonce; uint256 expiryTimestamp; - address executer; + address executor; bool loose; TargetOption[] targetOptions; uint256[] values; @@ -29,7 +29,7 @@ library GlobalProposal { uint256[] gasAmounts; } - // keccak256("GlobalProposalDetail(uint256 nonce,uint256 expiryTimestamp,address executer,bool loose,uint8[] targetOptions,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)"); + // keccak256("GlobalProposalDetail(uint256 nonce,uint256 expiryTimestamp,address executor,bool loose,uint8[] targetOptions,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)"); bytes32 public constant TYPE_HASH = 0x8fdb3bc7211cb44f39a2cae84127672c4570a00720dfbf2bb58285070faa28da; /** @@ -56,7 +56,7 @@ library GlobalProposal { * TYPE_HASH, * proposal.nonce, * proposal.expiryTimestamp, - * proposal.executer, + * proposal.executor, * proposal.loose, * targetsHash, * valuesHash, @@ -70,7 +70,7 @@ library GlobalProposal { mstore(ptr, TYPE_HASH) mstore(add(ptr, 0x20), mload(self)) // proposal.nonce mstore(add(ptr, 0x40), mload(add(self, 0x20))) // proposal.expiryTimestamp - mstore(add(ptr, 0x60), mload(add(self, 0x40))) // proposal.executer + mstore(add(ptr, 0x60), mload(add(self, 0x40))) // proposal.executor mstore(add(ptr, 0x80), mload(add(self, 0x60))) // proposal.loose let arrayHashed @@ -93,7 +93,7 @@ library GlobalProposal { detail_.nonce = self.nonce; detail_.chainId = 0; detail_.expiryTimestamp = self.expiryTimestamp; - detail_.executer = self.executer; + detail_.executor = self.executor; detail_.loose = self.loose; detail_.targets = new address[](self.targetOptions.length); diff --git a/src/libraries/Proposal.sol b/src/libraries/Proposal.sol index b0ef091f..5f19cf49 100644 --- a/src/libraries/Proposal.sol +++ b/src/libraries/Proposal.sol @@ -28,7 +28,7 @@ library Proposal { uint256 expiryTimestamp; // The address that execute the proposal after the proposal passes. // Leave this address as address(0) to auto-execute by the last valid vote. - address executer; + address executor; // A `loose` proposal will revert the whole proposal if encounter one internal failed. // A non-`loose` proposal will ignore the failed internal calls. bool loose; @@ -38,7 +38,7 @@ library Proposal { uint256[] gasAmounts; } - // keccak256("ProposalDetail(uint256 nonce,uint256 chainId,uint256 expiryTimestamp,address executer,bool loose,address[] targets,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)"); + // keccak256("ProposalDetail(uint256 nonce,uint256 chainId,uint256 expiryTimestamp,address executor,bool loose,address[] targets,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)"); bytes32 public constant TYPE_HASH = 0x98e2bc443e89d620038081eb862bc4dd7a26e2eba7a2a87201642f9419340a57; /** @@ -79,7 +79,7 @@ library Proposal { // proposal.nonce, // proposal.chainId, // proposal.expiryTimestamp - // proposal.executer + // proposal.executor // proposal.loose // targetsHash, // valuesHash, @@ -94,7 +94,7 @@ library Proposal { mstore(add(ptr, 0x20), mload(proposal)) // proposal.nonce mstore(add(ptr, 0x40), mload(add(proposal, 0x20))) // proposal.chainId mstore(add(ptr, 0x60), mload(add(proposal, 0x40))) // proposal.expiryTimestamp - mstore(add(ptr, 0x80), mload(add(proposal, 0x80))) // proposal.executer + mstore(add(ptr, 0x80), mload(add(proposal, 0x80))) // proposal.executor mstore(add(ptr, 0xa0), mload(add(proposal, 0x80))) // proposal.loose let arrayHashed @@ -114,7 +114,7 @@ library Proposal { * @dev Returns whether the proposal is auto-executed on the last valid vote. */ function isAutoExecute(ProposalDetail memory proposal) internal pure returns (bool) { - return proposal.executer == address(0); + return proposal.executor == address(0); } /** diff --git a/src/mainchain/MainchainBridgeManager.sol b/src/mainchain/MainchainBridgeManager.sol index 22e31319..60f4bb7e 100644 --- a/src/mainchain/MainchainBridgeManager.sol +++ b/src/mainchain/MainchainBridgeManager.sol @@ -41,7 +41,7 @@ contract MainchainBridgeManager is BridgeManager, GovernanceRelay, GlobalGoverna Ballot.VoteType[] calldata supports_, Signature[] calldata signatures ) external onlyGovernor { - _requireExecuter(proposal.executer, msg.sender); + _requireExecutor(proposal.executor, msg.sender); _relayProposal(proposal, supports_, signatures, DOMAIN_SEPARATOR, msg.sender); } @@ -56,13 +56,13 @@ contract MainchainBridgeManager is BridgeManager, GovernanceRelay, GlobalGoverna Ballot.VoteType[] calldata supports_, Signature[] calldata signatures ) external onlyGovernor { - _requireExecuter(globalProposal.executer, msg.sender); + _requireExecutor(globalProposal.executor, msg.sender); _relayGlobalProposal({ globalProposal: globalProposal, supports_: supports_, signatures: signatures, domainSeparator: DOMAIN_SEPARATOR, creator: msg.sender }); } - function _requireExecuter(address executer, address caller) internal pure { - if (executer != address(0) && caller != executer) { - revert ErrNonExecuterCannotRelay(executer, caller); + function _requireExecutor(address executor, address caller) internal pure { + if (executor != address(0) && caller != executor) { + revert ErrNonExecutorCannotRelay(executor, caller); } } diff --git a/src/ronin/gateway/RoninBridgeManager.sol b/src/ronin/gateway/RoninBridgeManager.sol index fee9129c..4a4dac4c 100644 --- a/src/ronin/gateway/RoninBridgeManager.sol +++ b/src/ronin/gateway/RoninBridgeManager.sol @@ -46,14 +46,14 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan function propose( uint256 chainId, uint256 expiryTimestamp, - address executer, + address executor, bool loose, address[] calldata targets, uint256[] calldata values, bytes[] calldata calldatas, uint256[] calldata gasAmounts ) external onlyGovernor { - _proposeProposal(chainId, expiryTimestamp, executer, loose, targets, values, calldatas, gasAmounts, msg.sender); + _proposeProposal(chainId, expiryTimestamp, executor, loose, targets, values, calldatas, gasAmounts, msg.sender); } /** @@ -82,7 +82,7 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan */ function proposeProposalForCurrentNetwork( uint256 expiryTimestamp, - address executer, + address executor, bool loose, address[] calldata targets, uint256[] calldata values, @@ -94,7 +94,7 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan Proposal.ProposalDetail memory _proposal = _proposeProposal({ chainId: block.chainid, expiryTimestamp: expiryTimestamp, - executer: executer, + executor: executor, loose: loose, targets: targets, values: values, @@ -136,7 +136,7 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan */ function proposeGlobal( uint256 expiryTimestamp, - address executer, + address executor, bool loose, GlobalProposal.TargetOption[] calldata targetOptions, uint256[] calldata values, @@ -145,7 +145,7 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan ) external onlyGovernor { _proposeGlobal({ expiryTimestamp: expiryTimestamp, - executer: executer, + executor: executor, loose: loose, targetOptions: targetOptions, values: values, diff --git a/src/utils/CommonErrors.sol b/src/utils/CommonErrors.sol index ce612a55..0aedf12e 100644 --- a/src/utils/CommonErrors.sol +++ b/src/utils/CommonErrors.sol @@ -240,11 +240,11 @@ error ErrInvalidProposal(bytes32 actual, bytes32 expected); error ErrProposalNotApproved(); /** - * @dev Error of the caller is not the specified executer. + * @dev Error of the caller is not the specified executor. */ -error ErrInvalidExecuter(); +error ErrInvalidExecutor(); /** - * @dev Error of the `caller` to relay is not the specified `executer`. + * @dev Error of the `caller` to relay is not the specified `executor`. */ -error ErrNonExecuterCannotRelay(address executer, address caller); \ No newline at end of file +error ErrNonExecutorCannotRelay(address executor, address caller); \ No newline at end of file diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index 41454d06..672a4a2c 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -317,7 +317,7 @@ contract BaseIntegration_Test is Base_Test { // set targets GlobalProposal.GlobalProposalDetail memory globalProposal = _roninProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, - executer: address(0), + executor: address(0), loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, @@ -335,7 +335,7 @@ contract BaseIntegration_Test is Base_Test { // set bridge contract GlobalProposal.GlobalProposalDetail memory globalProposal = _roninProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, - executer: address(0), + executor: address(0), loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, @@ -355,7 +355,7 @@ contract BaseIntegration_Test is Base_Test { bytes memory calldata_ = abi.encodeCall(IBridgeManagerCallbackRegister.registerCallbacks, (param.callbackRegisters)); GlobalProposal.GlobalProposalDetail memory globalProposal = _roninProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, - executer: address(0), + executor: address(0), loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, @@ -374,7 +374,7 @@ contract BaseIntegration_Test is Base_Test { // set min governors GlobalProposal.GlobalProposalDetail memory globalProposal = _roninProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, - executer: address(0), + executor: address(0), loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, @@ -414,7 +414,7 @@ contract BaseIntegration_Test is Base_Test { // set targets GlobalProposal.GlobalProposalDetail memory globalProposal = _mainchainProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, - executer: address(0), + executor: address(0), loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, @@ -432,7 +432,7 @@ contract BaseIntegration_Test is Base_Test { // set bridge contract GlobalProposal.GlobalProposalDetail memory globalProposal = _mainchainProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, - executer: address(0), + executor: address(0), loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, @@ -452,7 +452,7 @@ contract BaseIntegration_Test is Base_Test { bytes memory calldata_ = abi.encodeCall(IBridgeManagerCallbackRegister.registerCallbacks, (param.callbackRegisters)); GlobalProposal.GlobalProposalDetail memory globalProposal = _mainchainProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, - executer: address(0), + executor: address(0), loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, @@ -471,7 +471,7 @@ contract BaseIntegration_Test is Base_Test { // set min governors GlobalProposal.GlobalProposalDetail memory globalProposal = _roninProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, - executer: address(0), + executor: address(0), loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, diff --git a/test/bridge/integration/bridge-manager/proposal-executer/executer.proposeCurrent.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-executor/executor.proposeCurrent.RoninBridgeManager.t.sol similarity index 92% rename from test/bridge/integration/bridge-manager/proposal-executer/executer.proposeCurrent.RoninBridgeManager.t.sol rename to test/bridge/integration/bridge-manager/proposal-executor/executor.proposeCurrent.RoninBridgeManager.t.sol index ee76739c..6acebfa4 100644 --- a/test/bridge/integration/bridge-manager/proposal-executer/executer.proposeCurrent.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/proposal-executor/executor.proposeCurrent.RoninBridgeManager.t.sol @@ -11,12 +11,12 @@ import { LibSort } from "solady/utils/LibSort.sol"; import "../../BaseIntegration.t.sol"; -contract ProposalWithExecuter_CurrentNetworkProposal_RoninBridgeManager_Test is BaseIntegration_Test { +contract ProposalWithExecutor_CurrentNetworkProposal_RoninBridgeManager_Test is BaseIntegration_Test { event ProposalVoted(bytes32 indexed proposalHash, address indexed voter, Ballot.VoteType support, uint256 weight); event ProposalApproved(bytes32 indexed proposalHash); event ProposalExecuted(bytes32 indexed proposalHash, bool[] successCalls, bytes[] returnDatas); - error ErrInvalidExecuter(); + error ErrInvalidExecutor(); error ErrProposalNotApproved(); error ErrInvalidProposalNonce(bytes4 sig); error ErrLooseProposalInternallyRevert(uint, bytes); @@ -62,7 +62,7 @@ contract ProposalWithExecuter_CurrentNetworkProposal_RoninBridgeManager_Test is _proposal.nonce = _roninBridgeManager.round(block.chainid) + 1; _proposal.chainId = block.chainid; - _proposal.executer = address(0); + _proposal.executor = address(0); _proposal.loose = false; _proposal.expiryTimestamp = block.timestamp + _proposalExpiryDuration; @@ -81,7 +81,7 @@ contract ProposalWithExecuter_CurrentNetworkProposal_RoninBridgeManager_Test is // Should the auto proposal executes on the last valid vote function test_autoProposal_strictProposal_WhenAllInternalCallsPass() public { _proposal.loose = false; - _proposal.executer = address(0); + _proposal.executor = address(0); vm.expectEmit(false, true, true, true); emit ProposalVoted(_anyValue, _param.roninBridgeManager.governors[0], Ballot.VoteType.For, 100); @@ -112,10 +112,10 @@ contract ProposalWithExecuter_CurrentNetworkProposal_RoninBridgeManager_Test is _roninBridgeManager.execute(_proposal); } - // Should the non-auto proposal be execute by the specified executer - function test_executerProposal_strictProposal_WhenAllInternalCallsPass() public { + // Should the non-auto proposal be execute by the specified executor + function test_executorProposal_strictProposal_WhenAllInternalCallsPass() public { _proposal.loose = false; - _proposal.executer = _param.roninBridgeManager.governors[0]; + _proposal.executor = _param.roninBridgeManager.governors[0]; _proposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success vm.expectEmit(false, true, true, true); @@ -142,8 +142,8 @@ contract ProposalWithExecuter_CurrentNetworkProposal_RoninBridgeManager_Test is } // Should revert when the auto proposal get executed again - function test_executerProposal_revertWhen_proposalIsAlreadyExecuted() external { - test_executerProposal_strictProposal_WhenAllInternalCallsPass(); + function test_executorProposal_revertWhen_proposalIsAlreadyExecuted() external { + test_executorProposal_strictProposal_WhenAllInternalCallsPass(); vm.expectRevert(abi.encodeWithSelector(ErrProposalNotApproved.selector)); @@ -152,9 +152,9 @@ contract ProposalWithExecuter_CurrentNetworkProposal_RoninBridgeManager_Test is } // Should the non-auto proposal can not be execute by other governor - function test_executerProposal_revertWhen_proposalIsExecutedByAnotherGovernor() external { + function test_executorProposal_revertWhen_proposalIsExecutedByAnotherGovernor() external { _proposal.loose = false; - _proposal.executer = _param.roninBridgeManager.governors[0]; + _proposal.executor = _param.roninBridgeManager.governors[0]; _proposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success vm.expectEmit(false, true, true, true); @@ -172,7 +172,7 @@ contract ProposalWithExecuter_CurrentNetworkProposal_RoninBridgeManager_Test is assertEq(_roninBridgeManager.proposalVoted(block.chainid, _proposal.nonce, _param.roninBridgeManager.governors[0]), true); assertEq(_roninBridgeManager.getBridgeOperators(), _beforeRelayedOperators); - vm.expectRevert(abi.encodeWithSelector(ErrInvalidExecuter.selector)); + vm.expectRevert(abi.encodeWithSelector(ErrInvalidExecutor.selector)); vm.prank(_param.roninBridgeManager.governors[1]); _roninBridgeManager.execute(_proposal); } diff --git a/test/bridge/integration/bridge-manager/proposal-executer/executer.proposeGlobal.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-executor/executor.proposeGlobal.RoninBridgeManager.t.sol similarity index 92% rename from test/bridge/integration/bridge-manager/proposal-executer/executer.proposeGlobal.RoninBridgeManager.t.sol rename to test/bridge/integration/bridge-manager/proposal-executor/executor.proposeGlobal.RoninBridgeManager.t.sol index c09b1bd9..bf524b16 100644 --- a/test/bridge/integration/bridge-manager/proposal-executer/executer.proposeGlobal.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/proposal-executor/executor.proposeGlobal.RoninBridgeManager.t.sol @@ -11,12 +11,12 @@ import { LibSort } from "solady/utils/LibSort.sol"; import "../../BaseIntegration.t.sol"; -contract ProposalWithExecuter_GlobalProposal_RoninBridgeManager_Test is BaseIntegration_Test { +contract ProposalWithExecutor_GlobalProposal_RoninBridgeManager_Test is BaseIntegration_Test { event ProposalVoted(bytes32 indexed proposalHash, address indexed voter, Ballot.VoteType support, uint256 weight); event ProposalApproved(bytes32 indexed proposalHash); event ProposalExecuted(bytes32 indexed proposalHash, bool[] successCalls, bytes[] returnDatas); - error ErrInvalidExecuter(); + error ErrInvalidExecutor(); error ErrProposalNotApproved(); error ErrInvalidProposalNonce(bytes4 sig); error ErrLooseProposalInternallyRevert(uint, bytes); @@ -59,7 +59,7 @@ contract ProposalWithExecuter_GlobalProposal_RoninBridgeManager_Test is BaseInte _generateAddingOperators(_addingOperatorNum); _globalProposal.nonce = _roninBridgeManager.round(0) + 1; - _globalProposal.executer = address(0); + _globalProposal.executor = address(0); _globalProposal.loose = false; _globalProposal.expiryTimestamp = block.timestamp + _proposalExpiryDuration; @@ -78,7 +78,7 @@ contract ProposalWithExecuter_GlobalProposal_RoninBridgeManager_Test is BaseInte // Should the auto proposal executes on the last valid vote function test_autoProposal_strictProposal_WhenAllInternalCallsPass() public { _globalProposal.loose = false; - _globalProposal.executer = address(0); + _globalProposal.executor = address(0); vm.expectEmit(false, true, true, true); emit ProposalVoted(_anyValue, _param.roninBridgeManager.governors[0], Ballot.VoteType.For, 100); @@ -109,10 +109,10 @@ contract ProposalWithExecuter_GlobalProposal_RoninBridgeManager_Test is BaseInte _roninBridgeManager.executeGlobal(_globalProposal); } - // Should the non-auto proposal be execute by the specified executer - function test_executerProposal_strictProposal_WhenAllInternalCallsPass() public { + // Should the non-auto proposal be execute by the specified executor + function test_executorProposal_strictProposal_WhenAllInternalCallsPass() public { _globalProposal.loose = false; - _globalProposal.executer = _param.roninBridgeManager.governors[0]; + _globalProposal.executor = _param.roninBridgeManager.governors[0]; _globalProposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success vm.expectEmit(false, true, true, true); @@ -139,8 +139,8 @@ contract ProposalWithExecuter_GlobalProposal_RoninBridgeManager_Test is BaseInte } // Should revert when the auto proposal get executed again - function test_executerProposal_revertWhen_proposalIsAlreadyExecuted() external { - test_executerProposal_strictProposal_WhenAllInternalCallsPass(); + function test_executorProposal_revertWhen_proposalIsAlreadyExecuted() external { + test_executorProposal_strictProposal_WhenAllInternalCallsPass(); vm.expectRevert(abi.encodeWithSelector(ErrProposalNotApproved.selector)); @@ -149,9 +149,9 @@ contract ProposalWithExecuter_GlobalProposal_RoninBridgeManager_Test is BaseInte } // Should the non-auto proposal can not be execute by other governor - function test_executerProposal_revertWhen_proposalIsExecutedByAnotherGovernor() external { + function test_executorProposal_revertWhen_proposalIsExecutedByAnotherGovernor() external { _globalProposal.loose = false; - _globalProposal.executer = _param.roninBridgeManager.governors[0]; + _globalProposal.executor = _param.roninBridgeManager.governors[0]; _globalProposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success vm.expectEmit(false, true, true, true); @@ -169,7 +169,7 @@ contract ProposalWithExecuter_GlobalProposal_RoninBridgeManager_Test is BaseInte assertEq(_roninBridgeManager.globalProposalVoted(_globalProposal.nonce, _param.roninBridgeManager.governors[0]), true); assertEq(_roninBridgeManager.getBridgeOperators(), _beforeRelayedOperators); - vm.expectRevert(abi.encodeWithSelector(ErrInvalidExecuter.selector)); + vm.expectRevert(abi.encodeWithSelector(ErrInvalidExecutor.selector)); vm.prank(_param.roninBridgeManager.governors[1]); _roninBridgeManager.executeGlobal(_globalProposal); } diff --git a/test/bridge/integration/bridge-manager/proposal-executer/executer.relayGlobal.MainchainBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-executor/executor.relayGlobal.MainchainBridgeManager.t.sol similarity index 91% rename from test/bridge/integration/bridge-manager/proposal-executer/executer.relayGlobal.MainchainBridgeManager.t.sol rename to test/bridge/integration/bridge-manager/proposal-executor/executor.relayGlobal.MainchainBridgeManager.t.sol index 389b142d..fba61e10 100644 --- a/test/bridge/integration/bridge-manager/proposal-executer/executer.relayGlobal.MainchainBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/proposal-executor/executor.relayGlobal.MainchainBridgeManager.t.sol @@ -11,15 +11,15 @@ import { LibSort } from "solady/utils/LibSort.sol"; import "../../BaseIntegration.t.sol"; -contract ProposalWithExecuter_GlobalProposal_MainchainBridgeManager_Test is BaseIntegration_Test { +contract ProposalWithExecutor_GlobalProposal_MainchainBridgeManager_Test is BaseIntegration_Test { event ProposalVoted(bytes32 indexed proposalHash, address indexed voter, Ballot.VoteType support, uint256 weight); event ProposalApproved(bytes32 indexed proposalHash); event ProposalExecuted(bytes32 indexed proposalHash, bool[] successCalls, bytes[] returnDatas); - error ErrInvalidExecuter(); + error ErrInvalidExecutor(); error ErrProposalNotApproved(); error ErrInvalidProposalNonce(bytes4 sig); - error ErrNonExecuterCannotRelay(address executer, address caller); + error ErrNonExecutorCannotRelay(address executor, address caller); error ErrLooseProposalInternallyRevert(uint, bytes); using LibSort for address[]; @@ -60,7 +60,7 @@ contract ProposalWithExecuter_GlobalProposal_MainchainBridgeManager_Test is Base _generateAddingOperators(_addingOperatorNum); _globalProposal.nonce = _mainchainBridgeManager.round(0) + 1; - _globalProposal.executer = address(0); + _globalProposal.executor = address(0); _globalProposal.loose = false; _globalProposal.expiryTimestamp = block.timestamp + _proposalExpiryDuration; @@ -79,7 +79,7 @@ contract ProposalWithExecuter_GlobalProposal_MainchainBridgeManager_Test is Base // Should the auto proposal executes on the last valid vote function test_relayGlobal_autoProposal_strictProposal_WhenAllInternalCallsPass() public { _globalProposal.loose = false; - _globalProposal.executer = address(0); + _globalProposal.executor = address(0); vm.expectEmit(false, false, false, false); emit ProposalApproved(_anyValue); @@ -108,10 +108,10 @@ contract ProposalWithExecuter_GlobalProposal_MainchainBridgeManager_Test is Base _mainchainBridgeManager.relayGlobalProposal(_globalProposal, _supports, _signatures); } - // Should the non-auto proposal be execute by the specified executer - function test_relayGlobal_executerProposal_strictProposal_WhenAllInternalCallsPass() public { + // Should the non-auto proposal be execute by the specified executor + function test_relayGlobal_executorProposal_strictProposal_WhenAllInternalCallsPass() public { _globalProposal.loose = false; - _globalProposal.executer = _param.roninBridgeManager.governors[0]; + _globalProposal.executor = _param.roninBridgeManager.governors[0]; _globalProposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success vm.expectEmit(false, false, false, false); @@ -131,8 +131,8 @@ contract ProposalWithExecuter_GlobalProposal_MainchainBridgeManager_Test is Base } // Should revert when the auto proposal get executed again - function test_relayGlobal_executerProposal_revertWhen_proposalIsAlreadyExecuted() external { - test_relayGlobal_executerProposal_strictProposal_WhenAllInternalCallsPass(); + function test_relayGlobal_executorProposal_revertWhen_proposalIsAlreadyExecuted() external { + test_relayGlobal_executorProposal_strictProposal_WhenAllInternalCallsPass(); vm.expectRevert(abi.encodeWithSelector(ErrInvalidProposalNonce.selector, MainchainBridgeManager.relayGlobalProposal.selector)); @@ -141,16 +141,16 @@ contract ProposalWithExecuter_GlobalProposal_MainchainBridgeManager_Test is Base } // Should the non-auto proposal can not be execute by other governor - function test_relayGlobal_executerProposal_revertWhen_proposalIsExecutedByAnotherGovernor() external { + function test_relayGlobal_executorProposal_revertWhen_proposalIsExecutedByAnotherGovernor() external { _globalProposal.loose = false; - _globalProposal.executer = _param.roninBridgeManager.governors[0]; + _globalProposal.executor = _param.roninBridgeManager.governors[0]; _globalProposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignaturesGlobal(_globalProposal, _param.test.governorPKs); for (uint256 i; i < signatures.length; i++) { _signatures.push(signatures[i]); } - vm.expectRevert(abi.encodeWithSelector(ErrNonExecuterCannotRelay.selector, _param.roninBridgeManager.governors[0], _param.roninBridgeManager.governors[1])); + vm.expectRevert(abi.encodeWithSelector(ErrNonExecutorCannotRelay.selector, _param.roninBridgeManager.governors[0], _param.roninBridgeManager.governors[1])); vm.prank(_param.roninBridgeManager.governors[1]); _mainchainBridgeManager.relayGlobalProposal(_globalProposal, _supports, _signatures); diff --git a/test/bridge/integration/bridge-manager/proposal-loose/proposeCurrent.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-loose/proposeCurrent.RoninBridgeManager.t.sol index 662db5bc..17ee78e1 100644 --- a/test/bridge/integration/bridge-manager/proposal-loose/proposeCurrent.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/proposal-loose/proposeCurrent.RoninBridgeManager.t.sol @@ -58,7 +58,7 @@ contract LooseProposal_CurrentNetworkProposal_RoninBridgeManager_Test is BaseInt _proposal.nonce = _roninBridgeManager.round(block.chainid) + 1; _proposal.chainId = block.chainid; - _proposal.executer = address(0); + _proposal.executor = address(0); _proposal.loose = false; _proposal.expiryTimestamp = block.timestamp + _proposalExpiryDuration; diff --git a/test/bridge/integration/bridge-manager/proposal-loose/proposeGlobal.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-loose/proposeGlobal.RoninBridgeManager.t.sol index 95bffd82..d05a5156 100644 --- a/test/bridge/integration/bridge-manager/proposal-loose/proposeGlobal.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/proposal-loose/proposeGlobal.RoninBridgeManager.t.sol @@ -56,7 +56,7 @@ contract LooseProposal_GlobalProposal_RoninBridgeManager_Test is BaseIntegration _globalProposal.nonce = _roninBridgeManager.round(0) + 1; _globalProposal.expiryTimestamp = block.timestamp + _proposalExpiryDuration; - _globalProposal.executer = address(0); + _globalProposal.executor = address(0); _globalProposal.loose = false; _globalProposal.targetOptions.push(GlobalProposal.TargetOption.BridgeManager); diff --git a/test/bridge/integration/bridge-manager/proposal-loose/relayGlobal.MainchainBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-loose/relayGlobal.MainchainBridgeManager.t.sol index 084d5d65..b2375358 100644 --- a/test/bridge/integration/bridge-manager/proposal-loose/relayGlobal.MainchainBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/proposal-loose/relayGlobal.MainchainBridgeManager.t.sol @@ -58,7 +58,7 @@ contract LooseProposal_GlobalProposal_MainchainBridgeManager_Test is BaseIntegra _globalProposal.nonce = _mainchainBridgeManager.round(0) + 1; _globalProposal.expiryTimestamp = block.timestamp + _proposalExpiryDuration; - _globalProposal.executer = address(0); + _globalProposal.executor = address(0); _globalProposal.loose = false; _globalProposal.targetOptions.push(GlobalProposal.TargetOption.BridgeManager); diff --git a/test/bridge/integration/bridge-manager/propose-and-cast-vote/voteBridgeOperator.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/propose-and-cast-vote/voteBridgeOperator.RoninBridgeManager.t.sol index 5589b253..48e96924 100644 --- a/test/bridge/integration/bridge-manager/propose-and-cast-vote/voteBridgeOperator.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/propose-and-cast-vote/voteBridgeOperator.RoninBridgeManager.t.sol @@ -58,7 +58,7 @@ contract VoteBridgeOperator_RoninBridgeManager_Test is BaseIntegration_Test { function test_voteAddBridgeOperatorsProposal() public { _globalProposal = _roninProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + _proposalExpiryDuration, - executer: address(0), + executor: address(0), loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, @@ -121,7 +121,7 @@ contract VoteBridgeOperator_RoninBridgeManager_Test is BaseIntegration_Test { _globalProposal = _roninProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + _proposalExpiryDuration, - executer: address(0), + executor: address(0), loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, diff --git a/test/helpers/MainchainBridgeAdminUtils.t.sol b/test/helpers/MainchainBridgeAdminUtils.t.sol index aad2f32f..322771c2 100644 --- a/test/helpers/MainchainBridgeAdminUtils.t.sol +++ b/test/helpers/MainchainBridgeAdminUtils.t.sol @@ -20,7 +20,7 @@ contract MainchainBridgeAdminUtils is ProposalUtils { function functionDelegateCall(address to, bytes memory data) public { Proposal.ProposalDetail memory proposal = this.createProposal({ expiryTimestamp: this.defaultExpiryTimestamp(), - executer: address(0), + executor: address(0), loose: false, target: to, value: 0, @@ -42,7 +42,7 @@ contract MainchainBridgeAdminUtils is ProposalUtils { function functionDelegateCallGlobal(GlobalProposal.TargetOption target, bytes memory data) public { GlobalProposal.GlobalProposalDetail memory proposal = this.createGlobalProposal({ expiryTimestamp: this.defaultExpiryTimestamp(), - executer: address(0), + executor: address(0), loose: false, targetOption: target, value: 0, @@ -77,7 +77,7 @@ contract MainchainBridgeAdminUtils is ProposalUtils { GlobalProposal.GlobalProposalDetail memory proposal = GlobalProposal.GlobalProposalDetail({ nonce: _contract.round(0) + 1, expiryTimestamp: this.defaultExpiryTimestamp(), - executer: address(0), + executor: address(0), loose: false, targetOptions: targetOptions, values: values, @@ -98,7 +98,7 @@ contract MainchainBridgeAdminUtils is ProposalUtils { function upgradeGlobal(GlobalProposal.TargetOption targetOption, uint256 nonce, bytes memory data) public { GlobalProposal.GlobalProposalDetail memory proposal = this.createGlobalProposal({ expiryTimestamp: this.defaultExpiryTimestamp(), - executer: address(0), + executor: address(0), loose: false, targetOption: targetOption, value: 0, diff --git a/test/helpers/ProposalUtils.t.sol b/test/helpers/ProposalUtils.t.sol index 04395331..38a9bc65 100644 --- a/test/helpers/ProposalUtils.t.sol +++ b/test/helpers/ProposalUtils.t.sol @@ -28,7 +28,7 @@ contract ProposalUtils is Utils, Test { function createProposal( uint256 expiryTimestamp, - address executer, + address executor, bool loose, address target, uint256 value, @@ -39,7 +39,7 @@ contract ProposalUtils is Utils, Test { proposal = Proposal.ProposalDetail({ nonce: nonce, chainId: block.chainid, - executer: executer, + executor: executor, loose: loose, expiryTimestamp: expiryTimestamp, targets: wrapAddress(target), @@ -51,7 +51,7 @@ contract ProposalUtils is Utils, Test { function createGlobalProposal( uint256 expiryTimestamp, - address executer, + address executor, bool loose, GlobalProposal.TargetOption targetOption, uint256 value, @@ -65,7 +65,7 @@ contract ProposalUtils is Utils, Test { proposal = GlobalProposal.GlobalProposalDetail({ nonce: nonce, expiryTimestamp: expiryTimestamp, - executer: executer, + executor: executor, loose: loose, targetOptions: targetOptions, values: wrapUint(value), diff --git a/test/helpers/RoninBridgeAdminUtils.t.sol b/test/helpers/RoninBridgeAdminUtils.t.sol index 0292ea53..db703ab9 100644 --- a/test/helpers/RoninBridgeAdminUtils.t.sol +++ b/test/helpers/RoninBridgeAdminUtils.t.sol @@ -20,7 +20,7 @@ contract RoninBridgeAdminUtils is ProposalUtils { function functionDelegateCall(address to, bytes memory data) public { Proposal.ProposalDetail memory proposal = this.createProposal({ expiryTimestamp: this.defaultExpiryTimestamp(), - executer: address(0), + executor: address(0), loose: false, target: to, value: 0, @@ -42,7 +42,7 @@ contract RoninBridgeAdminUtils is ProposalUtils { function functionDelegateCallGlobal(GlobalProposal.TargetOption target, bytes memory data) public { GlobalProposal.GlobalProposalDetail memory proposal = this.createGlobalProposal({ expiryTimestamp: this.defaultExpiryTimestamp(), - executer: address(0), + executor: address(0), loose: false, targetOption: target, value: 0, @@ -77,7 +77,7 @@ contract RoninBridgeAdminUtils is ProposalUtils { GlobalProposal.GlobalProposalDetail memory proposal = GlobalProposal.GlobalProposalDetail({ nonce: _contract.round(0) + 1, expiryTimestamp: this.defaultExpiryTimestamp(), - executer: address(0), + executor: address(0), loose: false, targetOptions: targetOptions, values: values, @@ -98,7 +98,7 @@ contract RoninBridgeAdminUtils is ProposalUtils { function upgradeGlobal(GlobalProposal.TargetOption targetOption, uint256 nonce, bytes memory data) public { GlobalProposal.GlobalProposalDetail memory proposal = this.createGlobalProposal({ expiryTimestamp: this.defaultExpiryTimestamp(), - executer: address(0), + executor: address(0), loose: false, targetOption: targetOption, value: 0, From 9d5f226fc5c97938606ae9fbda01f7b34fe0a990 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 2 Apr 2024 17:02:58 +0700 Subject: [PATCH 111/180] test: add propose and relay mainchain proposal --- ....proposeMainchain.RoninBridgeManager.t.sol | 180 ++++++++++++++++++ ...elayMainchain.MainchainBridgeManager.t.sol | 158 +++++++++++++++ 2 files changed, 338 insertions(+) create mode 100644 test/bridge/integration/bridge-manager/proposal-executor/executor.proposeMainchain.RoninBridgeManager.t.sol create mode 100644 test/bridge/integration/bridge-manager/proposal-executor/executor.relayMainchain.MainchainBridgeManager.t.sol diff --git a/test/bridge/integration/bridge-manager/proposal-executor/executor.proposeMainchain.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-executor/executor.proposeMainchain.RoninBridgeManager.t.sol new file mode 100644 index 00000000..53467717 --- /dev/null +++ b/test/bridge/integration/bridge-manager/proposal-executor/executor.proposeMainchain.RoninBridgeManager.t.sol @@ -0,0 +1,180 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { console2 as console } from "forge-std/console2.sol"; +import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; +import { Ballot } from "@ronin/contracts/libraries/Ballot.sol"; +import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; +import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; +import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; +import { LibSort } from "solady/utils/LibSort.sol"; + +import "../../BaseIntegration.t.sol"; + +contract ProposalWithExecutor_MainchainProposal_RoninBridgeManager_Test is BaseIntegration_Test { + event ProposalVoted(bytes32 indexed proposalHash, address indexed voter, Ballot.VoteType support, uint256 weight); + event ProposalApproved(bytes32 indexed proposalHash); + event ProposalExecuted(bytes32 indexed proposalHash, bool[] successCalls, bytes[] returnDatas); + + error ErrInvalidExecutor(); + error ErrProposalNotApproved(); + error ErrInvalidProposalNonce(bytes4 sig); + error ErrLooseProposalInternallyRevert(uint, bytes); + + using LibSort for address[]; + + uint256 _proposalExpiryDuration; + uint256 _addingOperatorNum; + address[] _addingOperators; + address[] _addingGovernors; + uint96[] _voteWeights; + + address[] _beforeRelayedOperators; + address[] _beforeRelayedGovernors; + + address[] _afterRelayedOperators; + address[] _afterRelayedGovernors; + + Ballot.VoteType[] _supports; + + Proposal.ProposalDetail _proposal; + SignatureConsumer.Signature[] _signatures; + + bytes32 _anyValue; + + function setUp() public virtual override { + super.setUp(); + + _proposalExpiryDuration = 60; + _addingOperatorNum = 3; + + _beforeRelayedOperators = _param.roninBridgeManager.bridgeOperators; + _beforeRelayedGovernors = _param.roninBridgeManager.governors; + + _supports = new Ballot.VoteType[](_beforeRelayedOperators.length); + for (uint256 i; i < _beforeRelayedGovernors.length; i++) { + _supports[i] = Ballot.VoteType.For; + } + + _generateAddingOperators(_addingOperatorNum); + + _proposal.nonce = _roninBridgeManager.round(block.chainid) + 1; + _proposal.chainId = block.chainid; + _proposal.executor = address(0); + _proposal.loose = false; + _proposal.expiryTimestamp = block.timestamp + _proposalExpiryDuration; + + _proposal.targets.push(address(_mainchainBridgeManager)); // Test Relay + _proposal.values.push(0); + _proposal.calldatas.push(abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators))); + _proposal.gasAmounts.push(1_000_000); + + // Duplicate the internal call + _proposal.targets.push(address(_mainchainBridgeManager)); // Test Relay + _proposal.values.push(0); + _proposal.calldatas.push(abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators))); + _proposal.gasAmounts.push(1_000_000); + } + + // Should the proposal is approved but not executed on Ronin chain + function test_proposeMainchain_autoProposal_looseProposal() public { + _proposal.loose = true; + _proposal.executor = address(0); + + vm.expectEmit(false, true, true, true); + emit ProposalVoted(_anyValue, _param.roninBridgeManager.governors[0], Ballot.VoteType.For, 100); + vm.expectEmit(false, false, false, false); + emit ProposalApproved(_anyValue); + vm.expectEmit(false, false, false, false); + emit ProposalExecuted(_anyValue, new bool[](2), new bytes[](2)); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignatures(_proposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.proposeProposalStructAndCastVotes(_proposal, _supports, _signatures); + + assertEq(_roninBridgeManager.proposalVoted(block.chainid, _proposal.nonce, _param.roninBridgeManager.governors[0]), true); + + // Mainchain proposal does not take effect on Ronin chain + assertEq(_roninBridgeManager.getBridgeOperators(), _beforeRelayedOperators); + } + + // Should the non-auto proposal be execute by the specified executor + function test_proposeMainchain_executorProposal_looseProposal_WhenAllInternalCallsPass() public { + _proposal.loose = true; + _proposal.executor = _param.roninBridgeManager.governors[0]; + _proposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success + + vm.expectEmit(false, true, true, true); + emit ProposalVoted(_anyValue, _param.roninBridgeManager.governors[0], Ballot.VoteType.For, 100); + vm.expectEmit(false, false, false, false); + emit ProposalApproved(_anyValue); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignatures(_proposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.proposeProposalStructAndCastVotes(_proposal, _supports, _signatures); + assertEq(_roninBridgeManager.proposalVoted(block.chainid, _proposal.nonce, _param.roninBridgeManager.governors[0]), true); + assertEq(_roninBridgeManager.getBridgeOperators(), _beforeRelayedOperators); + + vm.expectEmit(false, false, false, false); + emit ProposalExecuted(_anyValue, new bool[](2), new bytes[](2)); + + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.execute(_proposal); + + // Mainchain proposal does not take effect on Ronin chain + assertEq(_roninBridgeManager.getBridgeOperators(), _beforeRelayedOperators); + } + + + // Should the non-auto proposal can not be execute by other governor + function test_proposeMainchain_executorProposal_revertWhen_proposalIsExecutedByAnotherGovernor() external { + _proposal.loose = false; + _proposal.executor = _param.roninBridgeManager.governors[0]; + _proposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success + + vm.expectEmit(false, true, true, true); + emit ProposalVoted(_anyValue, _param.roninBridgeManager.governors[0], Ballot.VoteType.For, 100); + vm.expectEmit(false, false, false, false); + emit ProposalApproved(_anyValue); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignatures(_proposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + vm.prank(_param.roninBridgeManager.governors[0]); + _roninBridgeManager.proposeProposalStructAndCastVotes(_proposal, _supports, _signatures); + assertEq(_roninBridgeManager.proposalVoted(block.chainid, _proposal.nonce, _param.roninBridgeManager.governors[0]), true); + assertEq(_roninBridgeManager.getBridgeOperators(), _beforeRelayedOperators); + + vm.expectRevert(abi.encodeWithSelector(ErrInvalidExecutor.selector)); + vm.prank(_param.roninBridgeManager.governors[1]); + _roninBridgeManager.execute(_proposal); + } + + function _generateAddingOperators(uint256 num) internal { + delete _addingOperators; + delete _addingGovernors; + delete _voteWeights; + + _afterRelayedOperators = _beforeRelayedOperators; + _afterRelayedGovernors = _beforeRelayedGovernors; + + for (uint256 i; i < num; i++) { + _addingOperators.push(makeAddr(string.concat("adding-operator", vm.toString(i)))); + _addingGovernors.push(makeAddr(string.concat("adding-governor", vm.toString(i)))); + _voteWeights.push(uint96(uint256(100))); + + _afterRelayedOperators.push(_addingOperators[i]); + _afterRelayedGovernors.push(_addingGovernors[i]); + } + } +} diff --git a/test/bridge/integration/bridge-manager/proposal-executor/executor.relayMainchain.MainchainBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-executor/executor.relayMainchain.MainchainBridgeManager.t.sol new file mode 100644 index 00000000..89818604 --- /dev/null +++ b/test/bridge/integration/bridge-manager/proposal-executor/executor.relayMainchain.MainchainBridgeManager.t.sol @@ -0,0 +1,158 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { console2 as console } from "forge-std/console2.sol"; +import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; +import { Ballot } from "@ronin/contracts/libraries/Ballot.sol"; +import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; +import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; +import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; +import { LibSort } from "solady/utils/LibSort.sol"; + +import "../../BaseIntegration.t.sol"; + +contract ProposalWithExecutor_MainchainProposal_MainchainBridgeManager_Test is BaseIntegration_Test { + event ProposalVoted(bytes32 indexed proposalHash, address indexed voter, Ballot.VoteType support, uint256 weight); + event ProposalApproved(bytes32 indexed proposalHash); + event ProposalExecuted(bytes32 indexed proposalHash, bool[] successCalls, bytes[] returnDatas); + + error ErrNonExecutorCannotRelay(address executor, address caller); + error ErrInvalidExecutor(); + error ErrProposalNotApproved(); + error ErrInvalidProposalNonce(bytes4 sig); + error ErrLooseProposalInternallyRevert(uint, bytes); + + using LibSort for address[]; + + uint256 _proposalExpiryDuration; + uint256 _addingOperatorNum; + address[] _addingOperators; + address[] _addingGovernors; + uint96[] _voteWeights; + + address[] _beforeRelayedOperators; + address[] _beforeRelayedGovernors; + + address[] _afterRelayedOperators; + address[] _afterRelayedGovernors; + + Ballot.VoteType[] _supports; + + Proposal.ProposalDetail _proposal; + SignatureConsumer.Signature[] _signatures; + + bytes32 _anyValue; + + function setUp() public virtual override { + super.setUp(); + + _proposalExpiryDuration = 60; + _addingOperatorNum = 3; + + _beforeRelayedOperators = _param.roninBridgeManager.bridgeOperators; + _beforeRelayedGovernors = _param.roninBridgeManager.governors; + + _supports = new Ballot.VoteType[](_beforeRelayedOperators.length); + for (uint256 i; i < _beforeRelayedGovernors.length; i++) { + _supports[i] = Ballot.VoteType.For; + } + + _generateAddingOperators(_addingOperatorNum); + + _proposal.nonce = _mainchainBridgeManager.round(block.chainid) + 1; + _proposal.chainId = block.chainid; + _proposal.executor = address(0); + _proposal.loose = false; + _proposal.expiryTimestamp = block.timestamp + _proposalExpiryDuration; + + _proposal.targets.push(address(_mainchainBridgeManager)); // Test Relay + _proposal.values.push(0); + _proposal.calldatas.push(abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators))); + _proposal.gasAmounts.push(1_000_000); + + // Duplicate the internal call + _proposal.targets.push(address(_mainchainBridgeManager)); // Test Relay + _proposal.values.push(0); + _proposal.calldatas.push(abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators))); + _proposal.gasAmounts.push(1_000_000); + } + + // Should the proposal is approved but not executed on Ronin chain + function test_relayMainchain_autoProposal_looseProposal() public { + _proposal.loose = true; + _proposal.executor = address(0); + + vm.expectEmit(false, false, false, false); + emit ProposalApproved(_anyValue); + vm.expectEmit(false, false, false, false); + emit ProposalExecuted(_anyValue, new bool[](2), new bytes[](2)); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignatures(_proposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + // Mainchain proposal take effect on Mainchain + assertEq(_mainchainBridgeManager.getBridgeOperators(), _beforeRelayedOperators); + vm.prank(_param.roninBridgeManager.governors[0]); + _mainchainBridgeManager.relayProposal(_proposal, _supports, _signatures); + assertEq(_mainchainBridgeManager.getBridgeOperators(), _afterRelayedOperators); + } + + // Should the non-auto proposal be relay by the specified executor + function test_relayMainchain_executorProposal_looseProposal_WhenAllInternalCallsPass() public { + _proposal.loose = true; + _proposal.executor = _param.roninBridgeManager.governors[0]; + _proposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success + + vm.expectEmit(false, false, false, false); + emit ProposalApproved(_anyValue); + vm.expectEmit(false, false, false, false); + emit ProposalExecuted(_anyValue, new bool[](2), new bytes[](2)); + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignatures(_proposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + // Mainchain proposal take effect on Mainchain + assertEq(_mainchainBridgeManager.getBridgeOperators(), _beforeRelayedOperators); + vm.prank(_param.roninBridgeManager.governors[0]); + _mainchainBridgeManager.relayProposal(_proposal, _supports, _signatures); + assertEq(_mainchainBridgeManager.getBridgeOperators(), _afterRelayedOperators); + } + + // Should the non-auto proposal can not be execute by other governor + function test_relayMainchain_executorProposal_revertWhen_proposalIsExecutedByAnotherGovernor() external { + _proposal.loose = false; + _proposal.executor = _param.roninBridgeManager.governors[0]; + _proposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success + + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignatures(_proposal, _param.test.governorPKs); + for (uint256 i; i < signatures.length; i++) { + _signatures.push(signatures[i]); + } + + vm.expectRevert(abi.encodeWithSelector(ErrNonExecutorCannotRelay.selector, _param.roninBridgeManager.governors[0], _param.roninBridgeManager.governors[1])); + vm.prank(_param.roninBridgeManager.governors[1]); + _mainchainBridgeManager.relayProposal(_proposal, _supports, _signatures); + } + + function _generateAddingOperators(uint256 num) internal { + delete _addingOperators; + delete _addingGovernors; + delete _voteWeights; + + _afterRelayedOperators = _beforeRelayedOperators; + _afterRelayedGovernors = _beforeRelayedGovernors; + + for (uint256 i; i < num; i++) { + _addingOperators.push(makeAddr(string.concat("adding-operator", vm.toString(i)))); + _addingGovernors.push(makeAddr(string.concat("adding-governor", vm.toString(i)))); + _voteWeights.push(uint96(uint256(100))); + + _afterRelayedOperators.push(_addingOperators[i]); + _afterRelayedGovernors.push(_addingGovernors[i]); + } + } +} From 1d4a682e67d8b86ab13db5c49d4676f26f298c9f Mon Sep 17 00:00:00 2001 From: Bao Date: Tue, 2 Apr 2024 17:27:10 +0700 Subject: [PATCH 112/180] Update src/libraries/Proposal.sol Co-authored-by: tu-do.ron Signed-off-by: Bao --- src/libraries/Proposal.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/Proposal.sol b/src/libraries/Proposal.sol index 5f19cf49..abb4dd42 100644 --- a/src/libraries/Proposal.sol +++ b/src/libraries/Proposal.sol @@ -94,7 +94,7 @@ library Proposal { mstore(add(ptr, 0x20), mload(proposal)) // proposal.nonce mstore(add(ptr, 0x40), mload(add(proposal, 0x20))) // proposal.chainId mstore(add(ptr, 0x60), mload(add(proposal, 0x40))) // proposal.expiryTimestamp - mstore(add(ptr, 0x80), mload(add(proposal, 0x80))) // proposal.executor + mstore(add(ptr, 0x80), mload(add(proposal, 0x60))) // proposal.executor mstore(add(ptr, 0xa0), mload(add(proposal, 0x80))) // proposal.loose let arrayHashed From a6986752225eb7a00fc4162762ad89a55cea74d7 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 2 Apr 2024 17:30:43 +0700 Subject: [PATCH 113/180] fix: set constant as internal --- src/libraries/GlobalProposal.sol | 2 +- src/libraries/Proposal.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/GlobalProposal.sol b/src/libraries/GlobalProposal.sol index cfe1319a..9d26debf 100644 --- a/src/libraries/GlobalProposal.sol +++ b/src/libraries/GlobalProposal.sol @@ -30,7 +30,7 @@ library GlobalProposal { } // keccak256("GlobalProposalDetail(uint256 nonce,uint256 expiryTimestamp,address executor,bool loose,uint8[] targetOptions,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)"); - bytes32 public constant TYPE_HASH = 0x8fdb3bc7211cb44f39a2cae84127672c4570a00720dfbf2bb58285070faa28da; + bytes32 internal constant TYPE_HASH = 0x8fdb3bc7211cb44f39a2cae84127672c4570a00720dfbf2bb58285070faa28da; /** * @dev Returns struct hash of the proposal. diff --git a/src/libraries/Proposal.sol b/src/libraries/Proposal.sol index abb4dd42..c5ede054 100644 --- a/src/libraries/Proposal.sol +++ b/src/libraries/Proposal.sol @@ -39,7 +39,7 @@ library Proposal { } // keccak256("ProposalDetail(uint256 nonce,uint256 chainId,uint256 expiryTimestamp,address executor,bool loose,address[] targets,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)"); - bytes32 public constant TYPE_HASH = 0x98e2bc443e89d620038081eb862bc4dd7a26e2eba7a2a87201642f9419340a57; + bytes32 internal constant TYPE_HASH = 0x98e2bc443e89d620038081eb862bc4dd7a26e2eba7a2a87201642f9419340a57; /** * @dev Validates the proposal. From 50ab2341de6ba35694b53f33b53a45d27c69b4fb Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 3 Apr 2024 21:09:16 +0700 Subject: [PATCH 114/180] fix(CoreGovernance): remove `_proposeProposal` --- .../sequential-governance/CoreGovernance.sol | 31 ------------------- src/ronin/gateway/RoninBridgeManager.sol | 25 +++++++++++---- 2 files changed, 19 insertions(+), 37 deletions(-) diff --git a/src/extensions/sequential-governance/CoreGovernance.sol b/src/extensions/sequential-governance/CoreGovernance.sol index 1415abb2..3abd7634 100644 --- a/src/extensions/sequential-governance/CoreGovernance.sol +++ b/src/extensions/sequential-governance/CoreGovernance.sol @@ -97,37 +97,6 @@ abstract contract CoreGovernance is Initializable, SignatureConsumer, VoteStatus _vote.expiryTimestamp = _expiryTimestamp; } - /** - * @dev Proposes for a new proposal. - * - * Requirements: - * - The chain id is not equal to 0. - * - * Emits the `ProposalCreated` event. - * - */ - function _proposeProposal( - uint256 chainId, - uint256 expiryTimestamp, - address executor, - bool loose, - address[] memory targets, - uint256[] memory values, - bytes[] memory calldatas, - uint256[] memory gasAmounts, - address creator - ) internal virtual returns (Proposal.ProposalDetail memory proposal) { - if (chainId == 0) revert ErrInvalidChainId(msg.sig, 0, block.chainid); - uint256 round_ = _createVotingRound(chainId); - - proposal = Proposal.ProposalDetail(round_, chainId, expiryTimestamp, executor, loose, targets, values, calldatas, gasAmounts); - proposal.validate(_proposalExpiryDuration); - - bytes32 proposalHash = proposal.hash(); - _saveVotingRound(vote[chainId][round_], proposalHash, expiryTimestamp); - emit ProposalCreated(chainId, round_, proposalHash, proposal, creator); - } - /** * @dev Proposes proposal struct. * diff --git a/src/ronin/gateway/RoninBridgeManager.sol b/src/ronin/gateway/RoninBridgeManager.sol index 4a4dac4c..f63bdeb4 100644 --- a/src/ronin/gateway/RoninBridgeManager.sol +++ b/src/ronin/gateway/RoninBridgeManager.sol @@ -53,7 +53,20 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan bytes[] calldata calldatas, uint256[] calldata gasAmounts ) external onlyGovernor { - _proposeProposal(chainId, expiryTimestamp, executor, loose, targets, values, calldatas, gasAmounts, msg.sender); + _proposeProposalStruct( + Proposal.ProposalDetail({ + nonce: _createVotingRound(block.chainid), + chainId: block.chainid, + expiryTimestamp: expiryTimestamp, + executor: executor, + loose: loose, + targets: targets, + values: values, + calldatas: calldatas, + gasAmounts: gasAmounts + }), + msg.sender + ); } /** @@ -90,8 +103,8 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan uint256[] calldata gasAmounts, Ballot.VoteType support ) external onlyGovernor { - address _voter = msg.sender; - Proposal.ProposalDetail memory _proposal = _proposeProposal({ + Proposal.ProposalDetail memory proposal = Proposal.ProposalDetail({ + nonce: _createVotingRound(block.chainid), chainId: block.chainid, expiryTimestamp: expiryTimestamp, executor: executor, @@ -99,10 +112,10 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan targets: targets, values: values, calldatas: calldatas, - gasAmounts: gasAmounts, - creator: _voter + gasAmounts: gasAmounts }); - _castProposalVoteForCurrentNetwork(_voter, _proposal, support); + _proposeProposalStruct(proposal, msg.sender); + _castProposalVoteForCurrentNetwork(msg.sender, proposal, support); } /** From c6c5cca5c0ba01a8d3d3211a5adfacbb03e08353 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 3 Apr 2024 21:16:59 +0700 Subject: [PATCH 115/180] fix: bring internal method into equiv external --- .../BridgeManagerCallbackRegister.sol | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol b/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol index 0197e688..81b818bc 100644 --- a/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol +++ b/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol @@ -34,8 +34,14 @@ abstract contract BridgeManagerCallbackRegister is Initializable, IdentityGuard, /** * @inheritdoc IBridgeManagerCallbackRegister */ - function unregisterCallbacks(address[] calldata registers) external onlySelfCall returns (bool[] memory unregistereds) { - unregistereds = _unregisterCallbacks(registers); + function unregisterCallbacks(address[] calldata registers) external onlySelfCall nonDuplicate(registers) returns (bool[] memory unregistereds) { + uint256 length = registers.length; + unregistereds = new bool[](length); + EnumerableSet.AddressSet storage _callbackRegisters = _getCallbackRegisters(); + + for (uint256 i; i < length; i++) { + unregistereds[i] = _callbackRegisters.remove(registers[i]); + } } /** @@ -69,21 +75,6 @@ abstract contract BridgeManagerCallbackRegister is Initializable, IdentityGuard, } } - /** - * @dev Internal function to unregister multiple callbacks from the bridge. - * @param registers The array of callback addresses to unregister. - * @return unregistereds An array indicating the success status of each unregistration. - */ - function _unregisterCallbacks(address[] memory registers) internal nonDuplicate(registers) returns (bool[] memory unregistereds) { - uint256 length = registers.length; - unregistereds = new bool[](length); - EnumerableSet.AddressSet storage _callbackRegisters = _getCallbackRegisters(); - - for (uint256 i; i < length; i++) { - unregistereds[i] = _callbackRegisters.remove(registers[i]); - } - } - /** * @dev Same as {_notifyRegistersUnsafe} but revert when there at least one failed internal call. */ From 9b0f2a44b68eb679f872b0d35703f989a57c991f Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 3 Apr 2024 21:26:51 +0700 Subject: [PATCH 116/180] fix: remove local vars --- .../BridgeManagerCallbackRegister.sol | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol b/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol index 81b818bc..163838bf 100644 --- a/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol +++ b/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol @@ -57,19 +57,17 @@ abstract contract BridgeManagerCallbackRegister is Initializable, IdentityGuard, * @return registereds An array indicating the success status of each registration. */ function _registerCallbacks(address[] memory registers) internal nonDuplicate(registers) returns (bool[] memory registereds) { - uint256 length = registers.length; - registereds = new bool[](length); - if (length == 0) return registereds; + registereds = new bool[](registers.length); + if (registers.length == 0) return registereds; EnumerableSet.AddressSet storage _callbackRegisters = _getCallbackRegisters(); address register; - bytes4 callbackInterface = type(IBridgeManagerCallback).interfaceId; - for (uint256 i; i < length; i++) { + for (uint256 i; i < registers.length; i++) { register = registers[i]; _requireHasCode(register); - _requireSupportsInterface(register, callbackInterface); + _requireSupportsInterface(register, type(IBridgeManagerCallback).interfaceId); registereds[i] = _callbackRegisters.add(register); } From d405fa660434428610d4098e0b542ef54381e180 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 3 Apr 2024 21:31:17 +0700 Subject: [PATCH 117/180] fix: remove deprecated methods, remove local vars --- .../BridgeManager.sol | 28 ++----------------- src/interfaces/bridge/IBridgeManager.sol | 28 ++----------------- 2 files changed, 5 insertions(+), 51 deletions(-) diff --git a/src/extensions/bridge-operator-governance/BridgeManager.sol b/src/extensions/bridge-operator-governance/BridgeManager.sol index f3fa0c9c..31687a00 100644 --- a/src/extensions/bridge-operator-governance/BridgeManager.sol +++ b/src/extensions/bridge-operator-governance/BridgeManager.sol @@ -152,10 +152,9 @@ abstract contract BridgeManager is IBridgeManager, Initializable, HasContracts, */ function _getGovernorWeights(address[] memory governors) internal view returns (uint96[] memory weights) { BridgeManagerStorage storage $ = _getBridgeManagerStorage(); - uint256 length = governors.length; - weights = new uint96[](length); + weights = new uint96[](governors.length); - for (uint256 i; i < length; i++) { + for (uint256 i; i < governors.length; i++) { weights[i] = $._governorWeight[governors[i]]; } } @@ -233,13 +232,6 @@ abstract contract BridgeManager is IBridgeManager, Initializable, HasContracts, removeds = _removeBridgeOperators(bridgeOperators); } - /** - * @inheritdoc IBridgeManager - */ - function updateBridgeOperator(address, /* currOperator */ address /* newOperator */ ) external view onlyGovernor { - revert("Not supported"); - } - /** * @dev Internal function to add bridge operators. * @@ -427,14 +419,6 @@ abstract contract BridgeManager is IBridgeManager, Initializable, HasContracts, return $._governors; } - /** - * @inheritdoc IBridgeManager - * @custom:deprecated Deprecated due to high gas consume in new design. - */ - function getBridgeOperatorOf(address[] memory /*governors*/ ) external pure returns (address[] memory /*bridgeOperators*/ ) { - revert("Deprecated method"); - } - /** * @inheritdoc IBridgeManager */ @@ -445,14 +429,6 @@ abstract contract BridgeManager is IBridgeManager, Initializable, HasContracts, return _getBridgeManagerStorage()._operators[idx]; } - /** - * @inheritdoc IBridgeManager - * @custom:deprecated Deprecated due to high gas consume in new design. - */ - function getGovernorsOf(address[] calldata /*bridgeOperators*/ ) external pure returns (address[] memory /*governors*/ ) { - revert("Deprecated method"); - } - /** * @inheritdoc IBridgeManager */ diff --git a/src/interfaces/bridge/IBridgeManager.sol b/src/interfaces/bridge/IBridgeManager.sol index aa057dac..a7ba8907 100644 --- a/src/interfaces/bridge/IBridgeManager.sol +++ b/src/interfaces/bridge/IBridgeManager.sol @@ -80,25 +80,14 @@ interface IBridgeManager is IBridgeManagerEvents { */ function getBridgeOperators() external view returns (address[] memory); - /** - * @dev Returns an array of bridge operators corresponding to governor addresses. - */ - function getBridgeOperatorOf(address[] calldata gorvernors) external view returns (address[] memory bridgeOperators_); - /** * @dev Returns the corresponding `operator` of a `governor`. */ function getOperatorOf(address governor) external view returns (address operator); - /** - * @dev Retrieves the governors corresponding to a given array of bridge operators. - */ - function getGovernorsOf(address[] calldata bridgeOperators) external view returns (address[] memory governors); - /** * @dev Returns the corresponding `governor` of a `operator`. */ - function getGovernorOf(address operator) external view returns (address governor); /** @@ -182,19 +171,8 @@ interface IBridgeManager is IBridgeManagerEvents { function removeBridgeOperators(address[] calldata bridgeOperators) external returns (bool[] memory removeds); /** - * @dev Governor updates their corresponding or operator address. - * - * Requirements: - * - The caller must be the governor of the operator that is requested changes. - * - * @param currOperator The address of the operator to update. - * @param newOperator The new address of the operator. + * @dev Self-call to update the minimum required governor. + * @param min The minimum number, this must not less than 3. */ - function updateBridgeOperator(address currOperator, address newOperator) external; - - /** - * @dev Self-call to update the minimum required governor. - * @param min The minimum number, this must not less than 3. - */ - function setMinRequiredGovernor(uint min) external; + function setMinRequiredGovernor(uint min) external; } From 3845d2fc6196aeeef36b97b32ed827743a1f1fec Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 3 Apr 2024 22:20:26 +0700 Subject: [PATCH 118/180] fix: reduce passed param among internal calls --- .../CommonGovernanceProposal.sol | 44 ++++++------ .../GlobalGovernanceProposal.sol | 33 +++------ .../GovernanceProposal.sol | 42 ++--------- .../CommonGovernanceRelay.sol | 69 +++++++++++-------- .../GlobalGovernanceRelay.sol | 4 +- .../governance-relay/GovernanceRelay.sol | 4 +- src/mainchain/MainchainBridgeManager.sol | 4 ++ src/ronin/gateway/RoninBridgeManager.sol | 12 +++- 8 files changed, 94 insertions(+), 118 deletions(-) diff --git a/src/extensions/sequential-governance/governance-proposal/CommonGovernanceProposal.sol b/src/extensions/sequential-governance/governance-proposal/CommonGovernanceProposal.sol index 469391f1..eb28ee72 100644 --- a/src/extensions/sequential-governance/governance-proposal/CommonGovernanceProposal.sol +++ b/src/extensions/sequential-governance/governance-proposal/CommonGovernanceProposal.sol @@ -16,46 +16,46 @@ abstract contract CommonGovernanceProposal is CoreGovernance { Proposal.ProposalDetail memory _proposal, Ballot.VoteType[] calldata _supports, Signature[] calldata _signatures, - bytes32 _forDigest, - bytes32 _againstDigest + bytes32 proposalHash ) internal { if (!(_supports.length != 0 && _supports.length == _signatures.length)) revert ErrLengthMismatch(msg.sig); + bytes32 _forDigest = ECDSA.toTypedDataHash(_proposalDomainSeparator(), Ballot.hash(proposalHash, Ballot.VoteType.For)); + bytes32 _againstDigest = ECDSA.toTypedDataHash(_proposalDomainSeparator(), Ballot.hash(proposalHash, Ballot.VoteType.Against)); + uint256 _minimumForVoteWeight = _getMinimumVoteWeight(); uint256 _minimumAgainstVoteWeight = _getTotalWeight() - _minimumForVoteWeight + 1; address _lastSigner; - address _signer; - Signature calldata _sig; - bool _hasValidVotes; - for (uint256 _i; _i < _signatures.length; ) { + + for (uint256 _i; _i < _signatures.length;) { + Signature calldata _sig; + address _signer; _sig = _signatures[_i]; if (_supports[_i] == Ballot.VoteType.For) { _signer = ECDSA.recover(_forDigest, _sig.v, _sig.r, _sig.s); } else if (_supports[_i] == Ballot.VoteType.Against) { _signer = ECDSA.recover(_againstDigest, _sig.v, _sig.r, _sig.s); - } else revert ErrUnsupportedVoteType(msg.sig); + } else { + revert ErrUnsupportedVoteType(msg.sig); + } if (_lastSigner >= _signer) revert ErrInvalidOrder(msg.sig); _lastSigner = _signer; uint256 _weight = _getWeight(_signer); - if (_weight > 0) { - _hasValidVotes = true; - if ( - _castVote(_proposal, _supports[_i], _minimumForVoteWeight, _minimumAgainstVoteWeight, _signer, _sig, _weight) - ) { - return; - } + + if (_weight == 0) revert ErrInvalidSignatures(msg.sig); + + if (_castVote(_proposal, _supports[_i], _minimumForVoteWeight, _minimumAgainstVoteWeight, _signer, _sig, _weight)) { + return; } unchecked { ++_i; } } - - if (!_hasValidVotes) revert ErrInvalidSignatures(msg.sig); } /** @@ -67,11 +67,7 @@ abstract contract CommonGovernanceProposal is CoreGovernance { function _getProposalSignatures( uint256 _chainId, uint256 _round - ) - internal - view - returns (address[] memory _voters, Ballot.VoteType[] memory _supports, Signature[] memory _signatures) - { + ) internal view returns (address[] memory _voters, Ballot.VoteType[] memory _supports, Signature[] memory _signatures) { ProposalVote storage _vote = vote[_chainId][_round]; uint256 _forLength = _vote.forVoteds.length; @@ -81,7 +77,7 @@ abstract contract CommonGovernanceProposal is CoreGovernance { _supports = new Ballot.VoteType[](_voterLength); _signatures = new Signature[](_voterLength); _voters = new address[](_voterLength); - for (uint256 _i; _i < _forLength; ) { + for (uint256 _i; _i < _forLength;) { _supports[_i] = Ballot.VoteType.For; _signatures[_i] = vote[_chainId][_round].sig[_vote.forVoteds[_i]]; _voters[_i] = _vote.forVoteds[_i]; @@ -90,7 +86,7 @@ abstract contract CommonGovernanceProposal is CoreGovernance { ++_i; } } - for (uint256 _i; _i < _againstLength; ) { + for (uint256 _i; _i < _againstLength;) { _supports[_i + _forLength] = Ballot.VoteType.Against; _signatures[_i + _forLength] = vote[_chainId][_round].sig[_vote.againstVoteds[_i]]; _voters[_i + _forLength] = _vote.againstVoteds[_i]; @@ -112,4 +108,6 @@ abstract contract CommonGovernanceProposal is CoreGovernance { * @dev Returns the weight of a governor. */ function _getWeight(address _governor) internal view virtual returns (uint256); + + function _proposalDomainSeparator() internal view virtual returns (bytes32); } diff --git a/src/extensions/sequential-governance/governance-proposal/GlobalGovernanceProposal.sol b/src/extensions/sequential-governance/governance-proposal/GlobalGovernanceProposal.sol index 7f3494cc..83c8bb39 100644 --- a/src/extensions/sequential-governance/governance-proposal/GlobalGovernanceProposal.sol +++ b/src/extensions/sequential-governance/governance-proposal/GlobalGovernanceProposal.sol @@ -20,14 +20,7 @@ abstract contract GlobalGovernanceProposal is GlobalCoreGovernance, CommonGovern address creator ) internal returns (Proposal.ProposalDetail memory proposal) { proposal = _proposeGlobalStruct(globalProposal, creator); - bytes32 _globalProposalHash = globalProposal.hash(); - _castVotesBySignatures( - proposal, - supports_, - signatures, - ECDSA.toTypedDataHash(domainSeparator, Ballot.hash(_globalProposalHash, Ballot.VoteType.For)), - ECDSA.toTypedDataHash(domainSeparator, Ballot.hash(_globalProposalHash, Ballot.VoteType.Against)) - ); + _castVotesBySignatures(proposal, supports_, signatures, globalProposal.hash()); } /** @@ -39,30 +32,24 @@ abstract contract GlobalGovernanceProposal is GlobalCoreGovernance, CommonGovern Signature[] calldata signatures, bytes32 domainSeparator ) internal { - Proposal.ProposalDetail memory _proposal = globalProposal.intoProposalDetail( - _resolveTargets({ targetOptions: globalProposal.targetOptions, strict: true }) - ); + Proposal.ProposalDetail memory _proposal = globalProposal.intoProposalDetail(_resolveTargets({ targetOptions: globalProposal.targetOptions, strict: true })); bytes32 proposalHash = _proposal.hash(); - if (vote[0][_proposal.nonce].hash != proposalHash) + if (vote[0][_proposal.nonce].hash != proposalHash) { revert ErrInvalidProposal(proposalHash, vote[0][_proposal.nonce].hash); + } - bytes32 globalProposalHash = globalProposal.hash(); - _castVotesBySignatures( - _proposal, - supports_, - signatures, - ECDSA.toTypedDataHash(domainSeparator, Ballot.hash(globalProposalHash, Ballot.VoteType.For)), - ECDSA.toTypedDataHash(domainSeparator, Ballot.hash(globalProposalHash, Ballot.VoteType.Against)) - ); + _castVotesBySignatures(_proposal, supports_, signatures, globalProposal.hash()); } /** * @dev See {CommonGovernanceProposal-_getProposalSignatures} */ - function getGlobalProposalSignatures( - uint256 round_ - ) external view returns (address[] memory voters, Ballot.VoteType[] memory supports_, Signature[] memory signatures) { + function getGlobalProposalSignatures(uint256 round_) + external + view + returns (address[] memory voters, Ballot.VoteType[] memory supports_, Signature[] memory signatures) + { return _getProposalSignatures(0, round_); } diff --git a/src/extensions/sequential-governance/governance-proposal/GovernanceProposal.sol b/src/extensions/sequential-governance/governance-proposal/GovernanceProposal.sol index 47064e95..7e9d75ec 100644 --- a/src/extensions/sequential-governance/governance-proposal/GovernanceProposal.sol +++ b/src/extensions/sequential-governance/governance-proposal/GovernanceProposal.sol @@ -18,14 +18,7 @@ abstract contract GovernanceProposal is CoreGovernance, CommonGovernanceProposal address _creator ) internal { _proposeProposalStruct(_proposal, _creator); - bytes32 _proposalHash = _proposal.hash(); - _castVotesBySignatures( - _proposal, - _supports, - _signatures, - ECDSA.toTypedDataHash(_domainSeparator, Ballot.hash(_proposalHash, Ballot.VoteType.For)), - ECDSA.toTypedDataHash(_domainSeparator, Ballot.hash(_proposalHash, Ballot.VoteType.Against)) - ); + _castVotesBySignatures(_proposal, _supports, _signatures, _proposal.hash()); } /** @@ -43,41 +36,24 @@ abstract contract GovernanceProposal is CoreGovernance, CommonGovernanceProposal revert ErrInvalidProposal(_proposalHash, vote[_proposal.chainId][_proposal.nonce].hash); } - _castVotesBySignatures( - _proposal, - _supports, - _signatures, - ECDSA.toTypedDataHash(_domainSeparator, Ballot.hash(_proposalHash, Ballot.VoteType.For)), - ECDSA.toTypedDataHash(_domainSeparator, Ballot.hash(_proposalHash, Ballot.VoteType.Against)) - ); + _castVotesBySignatures(_proposal, _supports, _signatures, _proposal.hash()); } /** * @dev See `castProposalVoteForCurrentNetwork`. */ - function _castProposalVoteForCurrentNetwork( - address _voter, - Proposal.ProposalDetail memory _proposal, - Ballot.VoteType _support - ) internal { + function _castProposalVoteForCurrentNetwork(address _voter, Proposal.ProposalDetail memory _proposal, Ballot.VoteType _support) internal { if (_proposal.chainId != block.chainid) revert ErrInvalidChainId(msg.sig, _proposal.chainId, block.chainid); bytes32 proposalHash = _proposal.hash(); - if (vote[_proposal.chainId][_proposal.nonce].hash != proposalHash) + if (vote[_proposal.chainId][_proposal.nonce].hash != proposalHash) { revert ErrInvalidProposal(proposalHash, vote[_proposal.chainId][_proposal.nonce].hash); + } uint256 _minimumForVoteWeight = _getMinimumVoteWeight(); uint256 _minimumAgainstVoteWeight = _getTotalWeight() - _minimumForVoteWeight + 1; Signature memory _emptySignature; - _castVote( - _proposal, - _support, - _minimumForVoteWeight, - _minimumAgainstVoteWeight, - _voter, - _emptySignature, - _getWeight(_voter) - ); + _castVote(_proposal, _support, _minimumForVoteWeight, _minimumAgainstVoteWeight, _voter, _emptySignature, _getWeight(_voter)); } /** @@ -86,11 +62,7 @@ abstract contract GovernanceProposal is CoreGovernance, CommonGovernanceProposal function getProposalSignatures( uint256 _chainId, uint256 _round - ) - external - view - returns (address[] memory _voters, Ballot.VoteType[] memory _supports, Signature[] memory _signatures) - { + ) external view returns (address[] memory _voters, Ballot.VoteType[] memory _supports, Signature[] memory _signatures) { return _getProposalSignatures(_chainId, _round); } diff --git a/src/extensions/sequential-governance/governance-relay/CommonGovernanceRelay.sol b/src/extensions/sequential-governance/governance-relay/CommonGovernanceRelay.sol index 35bc7c52..4ccd2838 100644 --- a/src/extensions/sequential-governance/governance-relay/CommonGovernanceRelay.sol +++ b/src/extensions/sequential-governance/governance-relay/CommonGovernanceRelay.sol @@ -17,46 +17,53 @@ abstract contract CommonGovernanceRelay is CoreGovernance { Proposal.ProposalDetail memory _proposal, Ballot.VoteType[] calldata _supports, Signature[] calldata _signatures, - bytes32 _forDigest, - bytes32 _againstDigest + bytes32 proposalHash ) internal { if (!(_supports.length > 0 && _supports.length == _signatures.length)) revert ErrLengthMismatch(msg.sig); - uint256 _forVoteCount; - uint256 _againstVoteCount; + bytes32 _forDigest = ECDSA.toTypedDataHash(_proposalDomainSeparator(), Ballot.hash(proposalHash, Ballot.VoteType.For)); + bytes32 _againstDigest = ECDSA.toTypedDataHash(_proposalDomainSeparator(), Ballot.hash(proposalHash, Ballot.VoteType.Against)); + address[] memory _forVoteSigners = new address[](_signatures.length); address[] memory _againstVoteSigners = new address[](_signatures.length); { - address _signer; - address _lastSigner; - Ballot.VoteType _support; - Signature calldata _sig; - - for (uint256 _i; _i < _signatures.length; ) { - _sig = _signatures[_i]; - _support = _supports[_i]; - - if (_support == Ballot.VoteType.For) { - _signer = ECDSA.recover(_forDigest, _sig.v, _sig.r, _sig.s); - _forVoteSigners[_forVoteCount++] = _signer; - } else if (_support == Ballot.VoteType.Against) { - _signer = ECDSA.recover(_againstDigest, _sig.v, _sig.r, _sig.s); - _againstVoteSigners[_againstVoteCount++] = _signer; - } else revert ErrUnsupportedVoteType(msg.sig); - - if (_lastSigner >= _signer) revert ErrInvalidOrder(msg.sig); - _lastSigner = _signer; - - unchecked { - ++_i; + uint256 _forVoteCount; + uint256 _againstVoteCount; + + { + address _signer; + address _lastSigner; + Ballot.VoteType _support; + Signature calldata _sig; + + for (uint256 _i; _i < _signatures.length;) { + _sig = _signatures[_i]; + _support = _supports[_i]; + + if (_support == Ballot.VoteType.For) { + _signer = ECDSA.recover(_forDigest, _sig.v, _sig.r, _sig.s); + _forVoteSigners[_forVoteCount++] = _signer; + } else if (_support == Ballot.VoteType.Against) { + _signer = ECDSA.recover(_againstDigest, _sig.v, _sig.r, _sig.s); + _againstVoteSigners[_againstVoteCount++] = _signer; + } else { + revert ErrUnsupportedVoteType(msg.sig); + } + + if (_lastSigner >= _signer) revert ErrInvalidOrder(msg.sig); + _lastSigner = _signer; + + unchecked { + ++_i; + } } } - } - assembly { - mstore(_forVoteSigners, _forVoteCount) - mstore(_againstVoteSigners, _againstVoteCount) + assembly { + mstore(_forVoteSigners, _forVoteCount) + mstore(_againstVoteSigners, _againstVoteCount) + } } ProposalVote storage _vote = vote[_proposal.chainId][_proposal.nonce]; @@ -86,4 +93,6 @@ abstract contract CommonGovernanceRelay is CoreGovernance { * @dev Returns the weight of the governor list. */ function _sumWeight(address[] memory _governors) internal view virtual returns (uint256); + + function _proposalDomainSeparator() internal view virtual returns (bytes32); } diff --git a/src/extensions/sequential-governance/governance-relay/GlobalGovernanceRelay.sol b/src/extensions/sequential-governance/governance-relay/GlobalGovernanceRelay.sol index ec0a4c8d..b6d283c3 100644 --- a/src/extensions/sequential-governance/governance-relay/GlobalGovernanceRelay.sol +++ b/src/extensions/sequential-governance/governance-relay/GlobalGovernanceRelay.sol @@ -29,13 +29,11 @@ abstract contract GlobalGovernanceRelay is CommonGovernanceRelay, GlobalCoreGove address creator ) internal { Proposal.ProposalDetail memory _proposal = _proposeGlobalStruct(globalProposal, creator); - bytes32 globalProposalHash = globalProposal.hash(); _relayVotesBySignatures( _proposal, supports_, signatures, - ECDSA.toTypedDataHash(domainSeparator, Ballot.hash(globalProposalHash, Ballot.VoteType.For)), - ECDSA.toTypedDataHash(domainSeparator, Ballot.hash(globalProposalHash, Ballot.VoteType.Against)) + globalProposal.hash() ); } } diff --git a/src/extensions/sequential-governance/governance-relay/GovernanceRelay.sol b/src/extensions/sequential-governance/governance-relay/GovernanceRelay.sol index 58b11f2c..9349d1ee 100644 --- a/src/extensions/sequential-governance/governance-relay/GovernanceRelay.sol +++ b/src/extensions/sequential-governance/governance-relay/GovernanceRelay.sol @@ -23,13 +23,11 @@ abstract contract GovernanceRelay is CoreGovernance, CommonGovernanceRelay { address _creator ) internal { _proposeProposalStruct(_proposal, _creator); - bytes32 _proposalHash = _proposal.hash(); _relayVotesBySignatures( _proposal, _supports, _signatures, - ECDSA.toTypedDataHash(_domainSeparator, Ballot.hash(_proposalHash, Ballot.VoteType.For)), - ECDSA.toTypedDataHash(_domainSeparator, Ballot.hash(_proposalHash, Ballot.VoteType.Against)) + _proposal.hash() ); } } diff --git a/src/mainchain/MainchainBridgeManager.sol b/src/mainchain/MainchainBridgeManager.sol index 60f4bb7e..16947c5b 100644 --- a/src/mainchain/MainchainBridgeManager.sol +++ b/src/mainchain/MainchainBridgeManager.sol @@ -105,4 +105,8 @@ contract MainchainBridgeManager is BridgeManager, GovernanceRelay, GlobalGoverna function _getChainType() internal pure override returns (ChainType) { return ChainType.Mainchain; } + + function _proposalDomainSeparator() internal view override returns (bytes32) { + return DOMAIN_SEPARATOR; + } } diff --git a/src/ronin/gateway/RoninBridgeManager.sol b/src/ronin/gateway/RoninBridgeManager.sol index f63bdeb4..c251acd0 100644 --- a/src/ronin/gateway/RoninBridgeManager.sol +++ b/src/ronin/gateway/RoninBridgeManager.sol @@ -2,7 +2,13 @@ pragma solidity ^0.8.0; import { ContractType, RoleAccess, ErrUnauthorized, BridgeManager } from "../../extensions/bridge-operator-governance/BridgeManager.sol"; -import { Ballot, GlobalProposal, Proposal, GovernanceProposal } from "../../extensions/sequential-governance/governance-proposal/GovernanceProposal.sol"; +import { + Ballot, + GlobalProposal, + Proposal, + CommonGovernanceProposal, + GovernanceProposal +} from "../../extensions/sequential-governance/governance-proposal/GovernanceProposal.sol"; import { CoreGovernance, GlobalCoreGovernance, @@ -271,4 +277,8 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan function _getWeight(address _governor) internal view virtual override returns (uint256) { return _getGovernorWeight(_governor); } + + function _proposalDomainSeparator() internal view override returns (bytes32) { + return DOMAIN_SEPARATOR; + } } From 3537623676878dcb2ee1175f731d4ff0dff4ef13 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Thu, 4 Apr 2024 10:24:00 +0700 Subject: [PATCH 119/180] fix: remove `loose`, proposal is always loose --- .../GlobalCoreGovernance.sol | 3 +-- .../GlobalGovernanceProposal.sol | 4 ++-- src/libraries/GlobalProposal.sol | 16 ++++++-------- src/libraries/Proposal.sol | 21 +++++++------------ src/ronin/gateway/RoninBridgeManager.sol | 6 ------ 5 files changed, 17 insertions(+), 33 deletions(-) diff --git a/src/extensions/sequential-governance/GlobalCoreGovernance.sol b/src/extensions/sequential-governance/GlobalCoreGovernance.sol index 585fe6a6..6ebd9940 100644 --- a/src/extensions/sequential-governance/GlobalCoreGovernance.sol +++ b/src/extensions/sequential-governance/GlobalCoreGovernance.sol @@ -43,7 +43,6 @@ abstract contract GlobalCoreGovernance is CoreGovernance { uint256 expiryTimestamp, GlobalProposal.TargetOption[] calldata targetOptions, address executor, - bool loose, uint256[] memory values, bytes[] memory calldatas, uint256[] memory gasAmounts, @@ -51,7 +50,7 @@ abstract contract GlobalCoreGovernance is CoreGovernance { ) internal virtual { uint256 round_ = _createVotingRound(0); GlobalProposal.GlobalProposalDetail memory globalProposal = - GlobalProposal.GlobalProposalDetail(round_, expiryTimestamp, executor, loose, targetOptions, values, calldatas, gasAmounts); + GlobalProposal.GlobalProposalDetail(round_, expiryTimestamp, executor, targetOptions, values, calldatas, gasAmounts); Proposal.ProposalDetail memory proposal = globalProposal.intoProposalDetail(_resolveTargets({ targetOptions: targetOptions, strict: true })); proposal.validate(_proposalExpiryDuration); diff --git a/src/extensions/sequential-governance/governance-proposal/GlobalGovernanceProposal.sol b/src/extensions/sequential-governance/governance-proposal/GlobalGovernanceProposal.sol index 83c8bb39..23c14008 100644 --- a/src/extensions/sequential-governance/governance-proposal/GlobalGovernanceProposal.sol +++ b/src/extensions/sequential-governance/governance-proposal/GlobalGovernanceProposal.sol @@ -10,7 +10,7 @@ abstract contract GlobalGovernanceProposal is GlobalCoreGovernance, CommonGovern using GlobalProposal for GlobalProposal.GlobalProposalDetail; /** - * @dev Proposes and votes by signature. + * @dev Proposes and casts votes for a global proposal by signatures. */ function _proposeGlobalProposalStructAndCastVotes( GlobalProposal.GlobalProposalDetail calldata globalProposal, @@ -24,7 +24,7 @@ abstract contract GlobalGovernanceProposal is GlobalCoreGovernance, CommonGovern } /** - * @dev Proposes a global proposal struct and casts votes by signature. + * @dev Casts votes for a global proposal by signatures. */ function _castGlobalProposalBySignatures( GlobalProposal.GlobalProposalDetail calldata globalProposal, diff --git a/src/libraries/GlobalProposal.sol b/src/libraries/GlobalProposal.sol index 9d26debf..823c8df7 100644 --- a/src/libraries/GlobalProposal.sol +++ b/src/libraries/GlobalProposal.sol @@ -22,14 +22,13 @@ library GlobalProposal { uint256 nonce; uint256 expiryTimestamp; address executor; - bool loose; TargetOption[] targetOptions; uint256[] values; bytes[] calldatas; uint256[] gasAmounts; } - // keccak256("GlobalProposalDetail(uint256 nonce,uint256 expiryTimestamp,address executor,bool loose,uint8[] targetOptions,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)"); + // keccak256("GlobalProposalDetail(uint256 nonce,uint256 expiryTimestamp,address executor,uint8[] targetOptions,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)"); bytes32 internal constant TYPE_HASH = 0x8fdb3bc7211cb44f39a2cae84127672c4570a00720dfbf2bb58285070faa28da; /** @@ -57,7 +56,6 @@ library GlobalProposal { * proposal.nonce, * proposal.expiryTimestamp, * proposal.executor, - * proposal.loose, * targetsHash, * valuesHash, * calldatasHash, @@ -71,18 +69,17 @@ library GlobalProposal { mstore(add(ptr, 0x20), mload(self)) // proposal.nonce mstore(add(ptr, 0x40), mload(add(self, 0x20))) // proposal.expiryTimestamp mstore(add(ptr, 0x60), mload(add(self, 0x40))) // proposal.executor - mstore(add(ptr, 0x80), mload(add(self, 0x60))) // proposal.loose let arrayHashed arrayHashed := keccak256(add(targets, 32), mul(mload(targets), 32)) // targetsHash - mstore(add(ptr, 0xa0), arrayHashed) + mstore(add(ptr, 0x80), arrayHashed) arrayHashed := keccak256(add(values, 32), mul(mload(values), 32)) // valuesHash - mstore(add(ptr, 0xc0), arrayHashed) + mstore(add(ptr, 0xa0), arrayHashed) arrayHashed := keccak256(add(calldataHashList, 32), mul(mload(calldataHashList), 32)) // calldatasHash - mstore(add(ptr, 0xe0), arrayHashed) + mstore(add(ptr, 0xc0), arrayHashed) arrayHashed := keccak256(add(gasAmounts, 32), mul(mload(gasAmounts), 32)) // gasAmountsHash - mstore(add(ptr, 0x100), arrayHashed) - digest_ := keccak256(ptr, 0x120) + mstore(add(ptr, 0xe0), arrayHashed) + digest_ := keccak256(ptr, 0x100) } } @@ -94,7 +91,6 @@ library GlobalProposal { detail_.chainId = 0; detail_.expiryTimestamp = self.expiryTimestamp; detail_.executor = self.executor; - detail_.loose = self.loose; detail_.targets = new address[](self.targetOptions.length); detail_.values = self.values; diff --git a/src/libraries/Proposal.sol b/src/libraries/Proposal.sol index c5ede054..b6aca9d8 100644 --- a/src/libraries/Proposal.sol +++ b/src/libraries/Proposal.sol @@ -15,7 +15,7 @@ library Proposal { error ErrInvalidExpiryTimestamp(); /** - * @dev Error thrown when the loose proposal reverts when execute the internal call no. `callIndex` with revert message is `revertMsg`. + * @dev Error thrown when the proposal reverts when execute the internal call no. `callIndex` with revert message is `revertMsg`. */ error ErrLooseProposalInternallyRevert(uint256 callIndex, bytes revertMsg); @@ -29,16 +29,13 @@ library Proposal { // The address that execute the proposal after the proposal passes. // Leave this address as address(0) to auto-execute by the last valid vote. address executor; - // A `loose` proposal will revert the whole proposal if encounter one internal failed. - // A non-`loose` proposal will ignore the failed internal calls. - bool loose; address[] targets; uint256[] values; bytes[] calldatas; uint256[] gasAmounts; } - // keccak256("ProposalDetail(uint256 nonce,uint256 chainId,uint256 expiryTimestamp,address executor,bool loose,address[] targets,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)"); + // keccak256("ProposalDetail(uint256 nonce,uint256 chainId,uint256 expiryTimestamp,address executor,address[] targets,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)"); bytes32 internal constant TYPE_HASH = 0x98e2bc443e89d620038081eb862bc4dd7a26e2eba7a2a87201642f9419340a57; /** @@ -80,7 +77,6 @@ library Proposal { // proposal.chainId, // proposal.expiryTimestamp // proposal.executor - // proposal.loose // targetsHash, // valuesHash, // calldatasHash, @@ -95,18 +91,17 @@ library Proposal { mstore(add(ptr, 0x40), mload(add(proposal, 0x20))) // proposal.chainId mstore(add(ptr, 0x60), mload(add(proposal, 0x40))) // proposal.expiryTimestamp mstore(add(ptr, 0x80), mload(add(proposal, 0x60))) // proposal.executor - mstore(add(ptr, 0xa0), mload(add(proposal, 0x80))) // proposal.loose let arrayHashed arrayHashed := keccak256(add(targets, 32), mul(mload(targets), 32)) // targetsHash - mstore(add(ptr, 0xc0), arrayHashed) + mstore(add(ptr, 0xa0), arrayHashed) arrayHashed := keccak256(add(values, 32), mul(mload(values), 32)) // valuesHash - mstore(add(ptr, 0xe0), arrayHashed) + mstore(add(ptr, 0xc0), arrayHashed) arrayHashed := keccak256(add(calldataHashList, 32), mul(mload(calldataHashList), 32)) // calldatasHash - mstore(add(ptr, 0x100), arrayHashed) + mstore(add(ptr, 0xe0), arrayHashed) arrayHashed := keccak256(add(gasAmounts, 32), mul(mload(gasAmounts), 32)) // gasAmountsHash - mstore(add(ptr, 0x120), arrayHashed) - digest_ := keccak256(ptr, 0x140) + mstore(add(ptr, 0x100), arrayHashed) + digest_ := keccak256(ptr, 0x120) } } @@ -140,7 +135,7 @@ library Proposal { (successCalls[i], returnDatas[i]) = proposal.targets[i].call{ value: proposal.values[i], gas: proposal.gasAmounts[i] }(proposal.calldatas[i]); - if (!proposal.loose && !successCalls[i]) { + if (!successCalls[i]) { revert ErrLooseProposalInternallyRevert(i, returnDatas[i]); } } diff --git a/src/ronin/gateway/RoninBridgeManager.sol b/src/ronin/gateway/RoninBridgeManager.sol index c251acd0..4b05bf01 100644 --- a/src/ronin/gateway/RoninBridgeManager.sol +++ b/src/ronin/gateway/RoninBridgeManager.sol @@ -53,7 +53,6 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan uint256 chainId, uint256 expiryTimestamp, address executor, - bool loose, address[] calldata targets, uint256[] calldata values, bytes[] calldata calldatas, @@ -65,7 +64,6 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan chainId: block.chainid, expiryTimestamp: expiryTimestamp, executor: executor, - loose: loose, targets: targets, values: values, calldatas: calldatas, @@ -102,7 +100,6 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan function proposeProposalForCurrentNetwork( uint256 expiryTimestamp, address executor, - bool loose, address[] calldata targets, uint256[] calldata values, bytes[] calldata calldatas, @@ -114,7 +111,6 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan chainId: block.chainid, expiryTimestamp: expiryTimestamp, executor: executor, - loose: loose, targets: targets, values: values, calldatas: calldatas, @@ -156,7 +152,6 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan function proposeGlobal( uint256 expiryTimestamp, address executor, - bool loose, GlobalProposal.TargetOption[] calldata targetOptions, uint256[] calldata values, bytes[] calldata calldatas, @@ -165,7 +160,6 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan _proposeGlobal({ expiryTimestamp: expiryTimestamp, executor: executor, - loose: loose, targetOptions: targetOptions, values: values, calldatas: calldatas, From 9c8114d2efb1a63a2dc2b6e13ff1630982921c83 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Thu, 4 Apr 2024 10:44:38 +0700 Subject: [PATCH 120/180] fix: impl one `_findInStorageArray` --- .../BridgeManager.sol | 35 +++++-------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/src/extensions/bridge-operator-governance/BridgeManager.sol b/src/extensions/bridge-operator-governance/BridgeManager.sol index 31687a00..65f3f1e4 100644 --- a/src/extensions/bridge-operator-governance/BridgeManager.sol +++ b/src/extensions/bridge-operator-governance/BridgeManager.sol @@ -2,7 +2,6 @@ pragma solidity ^0.8.23; import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol"; -import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import { IBridgeManagerCallback, BridgeManagerCallbackRegister } from "./BridgeManagerCallbackRegister.sol"; import { IHasContracts, HasContracts } from "../../extensions/collections/HasContracts.sol"; @@ -16,7 +15,6 @@ import "./BridgeManagerQuorum.sol"; abstract contract BridgeManager is IBridgeManager, Initializable, HasContracts, BridgeManagerQuorum, BridgeManagerCallbackRegister { using AddressArrayUtils for address[]; - using EnumerableSet for EnumerableSet.AddressSet; struct BridgeManagerStorage { /// @notice List of the governors. @@ -361,23 +359,9 @@ abstract contract BridgeManager is IBridgeManager, Initializable, HasContracts, emit BridgeOperatorsRemoved(removeds, removingOperators); } - function _findOperatorInArray(address addr) internal view returns (bool found, uint idx) { - BridgeManagerStorage storage $ = _getBridgeManagerStorage(); - - for (uint i; i < $._operators.length; i++) { - if (addr == $._operators[i]) { - return (true, i); - } - } - - return (false, type(uint256).max); - } - - function _findGovernorInArray(address addr) internal view returns (bool found, uint idx) { - BridgeManagerStorage storage $ = _getBridgeManagerStorage(); - - for (uint i; i < $._governors.length; i++) { - if (addr == $._governors[i]) { + function _findInArray(address[] storage $_array, address addr) internal view returns (bool found, uint idx) { + for (uint i; i < $_array.length; i++) { + if (addr == $_array[i]) { return (true, i); } } @@ -391,8 +375,7 @@ abstract contract BridgeManager is IBridgeManager, Initializable, HasContracts, * @inheritdoc IBridgeManager */ function totalBridgeOperator() external view returns (uint256) { - BridgeManagerStorage storage $ = _getBridgeManagerStorage(); - return $._operators.length; + return _getBridgeManagerStorage()._operators.length; } /** @@ -407,23 +390,21 @@ abstract contract BridgeManager is IBridgeManager, Initializable, HasContracts, * @inheritdoc IBridgeManager */ function getBridgeOperators() external view returns (address[] memory) { - BridgeManagerStorage storage $ = _getBridgeManagerStorage(); - return $._operators; + return _getBridgeManagerStorage()._operators; } /** * @inheritdoc IBridgeManager */ function getGovernors() external view returns (address[] memory) { - BridgeManagerStorage storage $ = _getBridgeManagerStorage(); - return $._governors; + return _getBridgeManagerStorage()._governors; } /** * @inheritdoc IBridgeManager */ function getOperatorOf(address governor) external view returns (address operator) { - (bool found, uint idx) = _findGovernorInArray(governor); + (bool found, uint idx) = _findInArray(_getBridgeManagerStorage()._governors, governor); if (!found) revert ErrGovernorNotFound(governor); return _getBridgeManagerStorage()._operators[idx]; @@ -437,7 +418,7 @@ abstract contract BridgeManager is IBridgeManager, Initializable, HasContracts, } function _getGovernorOf(address operator) internal view returns (address governor, uint idx) { - (bool found, uint foundId) = _findOperatorInArray(operator); + (bool found, uint foundId) = _findInArray(_getBridgeManagerStorage()._operators, operator); if (!found) revert ErrOperatorNotFound(operator); return (_getBridgeManagerStorage()._governors[foundId], foundId); From ea04a8ee9c2529818108fe2c6e4ea9f3b119bfae Mon Sep 17 00:00:00 2001 From: nxqbao Date: Thu, 4 Apr 2024 10:44:53 +0700 Subject: [PATCH 121/180] fix: split out initialize --- src/ronin/gateway/RoninBridgeManager.sol | 18 ----- .../gateway/RoninBridgeManagerConstructor.sol | 78 +++++++++++++++++++ 2 files changed, 78 insertions(+), 18 deletions(-) create mode 100644 src/ronin/gateway/RoninBridgeManagerConstructor.sol diff --git a/src/ronin/gateway/RoninBridgeManager.sol b/src/ronin/gateway/RoninBridgeManager.sol index 4b05bf01..4549a59c 100644 --- a/src/ronin/gateway/RoninBridgeManager.sol +++ b/src/ronin/gateway/RoninBridgeManager.sol @@ -20,24 +20,6 @@ import "../../utils/CommonErrors.sol"; contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernanceProposal { using Proposal for Proposal.ProposalDetail; - function initialize( - uint256 num, - uint256 denom, - uint256 roninChainId, - uint256 expiryDuration, - address bridgeContract, - address[] memory callbackRegisters, - address[] memory bridgeOperators, - address[] memory governors, - uint96[] memory voteWeights, - GlobalProposal.TargetOption[] memory targetOptions, - address[] memory targets - ) external initializer { - __CoreGovernance_init(expiryDuration); - __GlobalCoreGovernance_init(targetOptions, targets); - __BridgeManager_init(num, denom, roninChainId, bridgeContract, callbackRegisters, bridgeOperators, governors, voteWeights); - } - /** * CURRENT NETWORK */ diff --git a/src/ronin/gateway/RoninBridgeManagerConstructor.sol b/src/ronin/gateway/RoninBridgeManagerConstructor.sol new file mode 100644 index 00000000..0661de6e --- /dev/null +++ b/src/ronin/gateway/RoninBridgeManagerConstructor.sol @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import { ContractType, RoleAccess, ErrUnauthorized, BridgeManager } from "../../extensions/bridge-operator-governance/BridgeManager.sol"; +import { + Ballot, + GlobalProposal, + Proposal, + CommonGovernanceProposal, + GovernanceProposal +} from "../../extensions/sequential-governance/governance-proposal/GovernanceProposal.sol"; +import { + CoreGovernance, + GlobalCoreGovernance, + GlobalGovernanceProposal +} from "../../extensions/sequential-governance/governance-proposal/GlobalGovernanceProposal.sol"; +import { VoteStatusConsumer } from "../../interfaces/consumers/VoteStatusConsumer.sol"; +import "../../utils/CommonErrors.sol"; + +contract RoninBridgeManagerConstructor is BridgeManager, GovernanceProposal, GlobalGovernanceProposal { + using Proposal for Proposal.ProposalDetail; + + function initialize( + uint256 num, + uint256 denom, + uint256 roninChainId, + uint256 expiryDuration, + address bridgeContract, + address[] memory callbackRegisters, + address[] memory bridgeOperators, + address[] memory governors, + uint96[] memory voteWeights, + GlobalProposal.TargetOption[] memory targetOptions, + address[] memory targets + ) external initializer { + __CoreGovernance_init(expiryDuration); + __GlobalCoreGovernance_init(targetOptions, targets); + __BridgeManager_init(num, denom, roninChainId, bridgeContract, callbackRegisters, bridgeOperators, governors, voteWeights); + } + + + /** + * @dev Internal function to get the chain type of the contract. + * @return The chain type, indicating the type of the chain the contract operates on (e.g., RoninChain). + */ + function _getChainType() internal pure override returns (ChainType) { + return ChainType.RoninChain; + } + + /** + * @dev Internal function to get the total weights of all governors. + * @return The total weights of all governors combined. + */ + function _getTotalWeight() internal view virtual override returns (uint256) { + return getTotalWeight(); + } + + /** + * @dev Internal function to get the minimum vote weight required for governance actions. + * @return The minimum vote weight required for governance actions. + */ + function _getMinimumVoteWeight() internal view virtual override returns (uint256) { + return minimumVoteWeight(); + } + + /** + * @dev Internal function to get the vote weight of a specific governor. + * @param _governor The address of the governor to get the vote weight for. + * @return The vote weight of the specified governor. + */ + function _getWeight(address _governor) internal view virtual override returns (uint256) { + return _getGovernorWeight(_governor); + } + + function _proposalDomainSeparator() internal view override returns (bytes32) { + return DOMAIN_SEPARATOR; + } +} From 8409167490fab75e24324bf07f5fc4d290625097 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Thu, 4 Apr 2024 10:55:24 +0700 Subject: [PATCH 122/180] fix: remove internal method `_executeGlobalWithCaller` --- .../GlobalCoreGovernance.sol | 15 ++------------- src/ronin/gateway/RoninBridgeManager.sol | 6 +++++- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/extensions/sequential-governance/GlobalCoreGovernance.sol b/src/extensions/sequential-governance/GlobalCoreGovernance.sol index 6ebd9940..7fcd4f21 100644 --- a/src/extensions/sequential-governance/GlobalCoreGovernance.sol +++ b/src/extensions/sequential-governance/GlobalCoreGovernance.sol @@ -83,11 +83,6 @@ abstract contract GlobalCoreGovernance is CoreGovernance { emit GlobalProposalCreated(round_, proposalHash, proposal, globalProposal.hash(), globalProposal, creator); } - function _executeGlobalWithCaller(GlobalProposal.GlobalProposalDetail memory globalProposal, address caller) internal { - Proposal.ProposalDetail memory proposal = globalProposal.intoProposalDetail(_resolveTargets({ targetOptions: globalProposal.targetOptions, strict: true })); - _executeWithCaller(proposal, caller); - } - /** * @dev Returns corresponding address of target options. Return address(0) on non-existent target. */ @@ -103,12 +98,9 @@ abstract contract GlobalCoreGovernance is CoreGovernance { function _resolveTargets(GlobalProposal.TargetOption[] memory targetOptions, bool strict) internal view returns (address[] memory targets) { targets = new address[](targetOptions.length); - for (uint256 i; i < targetOptions.length;) { + for (uint256 i; i < targetOptions.length; ++i) { targets[i] = _targetOptionsMap[targetOptions[i]]; if (strict && targets[i] == address(0)) revert ErrInvalidArguments(msg.sig); - unchecked { - ++i; - } } } @@ -129,12 +121,9 @@ abstract contract GlobalCoreGovernance is CoreGovernance { * @dev Updates list of `targetOptions` to `targets`. */ function _updateManyTargetOption(GlobalProposal.TargetOption[] memory targetOptions, address[] memory targets) internal { - for (uint256 i; i < targetOptions.length;) { + for (uint256 i; i < targetOptions.length; ++i) { if (targets[i] == address(this)) revert ErrInvalidArguments(msg.sig); _updateTargetOption(targetOptions[i], targets[i]); - unchecked { - ++i; - } } } diff --git a/src/ronin/gateway/RoninBridgeManager.sol b/src/ronin/gateway/RoninBridgeManager.sol index 4549a59c..8b8ce4f5 100644 --- a/src/ronin/gateway/RoninBridgeManager.sol +++ b/src/ronin/gateway/RoninBridgeManager.sol @@ -19,6 +19,7 @@ import "../../utils/CommonErrors.sol"; contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernanceProposal { using Proposal for Proposal.ProposalDetail; + using GlobalProposal for GlobalProposal.GlobalProposalDetail; /** * CURRENT NETWORK @@ -197,7 +198,10 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan * @dev See {GlobalCoreGovernance-_executeWithCaller}. */ function executeGlobal(GlobalProposal.GlobalProposalDetail calldata globalProposal) external { - _executeGlobalWithCaller(globalProposal, msg.sender); + _executeWithCaller({ + proposal: globalProposal.intoProposalDetail(_resolveTargets({ targetOptions: globalProposal.targetOptions, strict: true })), + caller: msg.sender + }); } /** From bedbef46100272520f29f7632bc6847beaaff655 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Thu, 4 Apr 2024 10:58:34 +0700 Subject: [PATCH 123/180] fix: remove internal `_getProposalExpiryDuration` --- src/extensions/sequential-governance/CoreGovernance.sol | 7 ------- src/mainchain/MainchainBridgeManager.sol | 2 +- src/ronin/gateway/RoninBridgeManager.sol | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/extensions/sequential-governance/CoreGovernance.sol b/src/extensions/sequential-governance/CoreGovernance.sol index 3abd7634..e0022668 100644 --- a/src/extensions/sequential-governance/CoreGovernance.sol +++ b/src/extensions/sequential-governance/CoreGovernance.sol @@ -261,13 +261,6 @@ abstract contract CoreGovernance is Initializable, SignatureConsumer, VoteStatus emit ProposalExpiryDurationChanged(expiryDuration); } - /** - * @dev Returns the expiry duration for a new proposal. - */ - function _getProposalExpiryDuration() internal view returns (uint256) { - return _proposalExpiryDuration; - } - /** * @dev Returns whether the voter casted for the proposal. */ diff --git a/src/mainchain/MainchainBridgeManager.sol b/src/mainchain/MainchainBridgeManager.sol index 16947c5b..821ee8aa 100644 --- a/src/mainchain/MainchainBridgeManager.sol +++ b/src/mainchain/MainchainBridgeManager.sol @@ -78,7 +78,7 @@ contract MainchainBridgeManager is BridgeManager, GovernanceRelay, GlobalGoverna * @dev Returns the expiry duration for a new proposal. */ function getProposalExpiryDuration() external view returns (uint256) { - return _getProposalExpiryDuration(); + return _proposalExpiryDuration; } /** diff --git a/src/ronin/gateway/RoninBridgeManager.sol b/src/ronin/gateway/RoninBridgeManager.sol index 8b8ce4f5..f4d86701 100644 --- a/src/ronin/gateway/RoninBridgeManager.sol +++ b/src/ronin/gateway/RoninBridgeManager.sol @@ -222,7 +222,7 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan * @dev Returns the expiry duration for a new proposal. */ function getProposalExpiryDuration() external view returns (uint256) { - return _getProposalExpiryDuration(); + return _proposalExpiryDuration; } /** From f30fad5ce2e09415a229ac567a9697694dbdea06 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Thu, 4 Apr 2024 10:59:47 +0700 Subject: [PATCH 124/180] config: add foundry profile runs 1 for RoninBridgeManager --- foundry.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/foundry.toml b/foundry.toml index 06eee488..ce1b284d 100644 --- a/foundry.toml +++ b/foundry.toml @@ -24,6 +24,10 @@ evm_version = 'istanbul' [profile.ethereum] evm_version = 'shanghai' +[profile.ronin.ronin_bridge_manager] +evm_version = 'istanbul' +optimizer_runs = 1 + [fmt] line_length = 160 tab_width = 2 From e37b01b30a5372c8e7aadf0cef0cb82209c18af8 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Thu, 4 Apr 2024 11:07:32 +0700 Subject: [PATCH 125/180] test: remove `loose` in test setup --- .../20231218-maptoken-mainchain.s.sol | 9 +++------ test/bridge/integration/BaseIntegration.t.sol | 8 -------- ...or.proposeCurrent.RoninBridgeManager.t.sol | 4 ---- ...tor.proposeGlobal.RoninBridgeManager.t.sol | 4 ---- ....proposeMainchain.RoninBridgeManager.t.sol | 5 ----- ...r.relayGlobal.MainchainBridgeManager.t.sol | 4 ---- ...elayMainchain.MainchainBridgeManager.t.sol | 4 ---- .../proposeCurrent.RoninBridgeManager.t.sol | 5 ----- .../proposeGlobal.RoninBridgeManager.t.sol | 5 ----- .../relayGlobal.MainchainBridgeManager.t.sol | 5 ----- ...oteBridgeOperator.RoninBridgeManager.t.sol | 20 +++++-------------- test/helpers/MainchainBridgeAdminUtils.t.sol | 4 ---- test/helpers/ProposalUtils.t.sol | 4 ---- test/helpers/RoninBridgeAdminUtils.t.sol | 4 ---- 14 files changed, 8 insertions(+), 77 deletions(-) diff --git a/script/20231218-maptoken/20231218-maptoken-mainchain.s.sol b/script/20231218-maptoken/20231218-maptoken-mainchain.s.sol index abc8901e..ac16b2e6 100644 --- a/script/20231218-maptoken/20231218-maptoken-mainchain.s.sol +++ b/script/20231218-maptoken/20231218-maptoken-mainchain.s.sol @@ -31,9 +31,7 @@ contract Migration__20231215_MapTokenMainchain is BridgeMigration { super.setUp(); _roninBridgeManager = RoninBridgeManager(_config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); - _mainchainGatewayV3 = _config.getAddress( - _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).key(), Contract.MainchainGatewayV3.key() - ); + _mainchainGatewayV3 = _config.getAddress(_config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).key(), Contract.MainchainGatewayV3.key()); } function run() public { @@ -64,8 +62,7 @@ contract Migration__20231215_MapTokenMainchain is BridgeMigration { // uint256[][4] calldata _thresholds // ) - bytes memory innerData = - abi.encodeCall(IMainchainGatewayV3.mapTokensAndThresholds, (mainchainTokens, roninTokens, standards, thresholds)); + bytes memory innerData = abi.encodeCall(IMainchainGatewayV3.mapTokensAndThresholds, (mainchainTokens, roninTokens, standards, thresholds)); bytes memory proxyData = abi.encodeWithSignature("functionDelegateCall(bytes)", innerData); uint256 expiredTime = block.timestamp + 10 days; @@ -83,6 +80,6 @@ contract Migration__20231215_MapTokenMainchain is BridgeMigration { uint256 chainId = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); vm.broadcast(sender()); - _roninBridgeManager.propose(chainId, expiredTime, address(0), false, targets, values, calldatas, gasAmounts); + _roninBridgeManager.propose(chainId, expiredTime, address(0), targets, values, calldatas, gasAmounts); } } diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index 672a4a2c..d2c84f31 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -318,7 +318,6 @@ contract BaseIntegration_Test is Base_Test { GlobalProposal.GlobalProposalDetail memory globalProposal = _roninProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, executor: address(0), - loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, calldata_: abi.encodeCall(GlobalCoreGovernance.updateManyTargetOption, (param.targetOptions, param.targets)), @@ -336,7 +335,6 @@ contract BaseIntegration_Test is Base_Test { GlobalProposal.GlobalProposalDetail memory globalProposal = _roninProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, executor: address(0), - loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, calldata_: abi.encodeCall(IHasContracts.setContract, (ContractType.BRIDGE, param.bridgeContract)), @@ -356,7 +354,6 @@ contract BaseIntegration_Test is Base_Test { GlobalProposal.GlobalProposalDetail memory globalProposal = _roninProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, executor: address(0), - loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, calldata_: calldata_, @@ -375,7 +372,6 @@ contract BaseIntegration_Test is Base_Test { GlobalProposal.GlobalProposalDetail memory globalProposal = _roninProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, executor: address(0), - loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, calldata_: abi.encodeCall(IBridgeManager.setMinRequiredGovernor, (_param.roninBridgeManager.minRequiredGovernor)), @@ -415,7 +411,6 @@ contract BaseIntegration_Test is Base_Test { GlobalProposal.GlobalProposalDetail memory globalProposal = _mainchainProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, executor: address(0), - loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, calldata_: abi.encodeCall(GlobalCoreGovernance.updateManyTargetOption, (param.targetOptions, param.targets)), @@ -433,7 +428,6 @@ contract BaseIntegration_Test is Base_Test { GlobalProposal.GlobalProposalDetail memory globalProposal = _mainchainProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, executor: address(0), - loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, calldata_: abi.encodeCall(IHasContracts.setContract, (ContractType.BRIDGE, param.bridgeContract)), @@ -453,7 +447,6 @@ contract BaseIntegration_Test is Base_Test { GlobalProposal.GlobalProposalDetail memory globalProposal = _mainchainProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, executor: address(0), - loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, calldata_: calldata_, @@ -472,7 +465,6 @@ contract BaseIntegration_Test is Base_Test { GlobalProposal.GlobalProposalDetail memory globalProposal = _roninProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + 10, executor: address(0), - loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, calldata_: abi.encodeCall(IBridgeManager.setMinRequiredGovernor, (_param.roninBridgeManager.minRequiredGovernor)), diff --git a/test/bridge/integration/bridge-manager/proposal-executor/executor.proposeCurrent.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-executor/executor.proposeCurrent.RoninBridgeManager.t.sol index 6acebfa4..2b23582e 100644 --- a/test/bridge/integration/bridge-manager/proposal-executor/executor.proposeCurrent.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/proposal-executor/executor.proposeCurrent.RoninBridgeManager.t.sol @@ -63,7 +63,6 @@ contract ProposalWithExecutor_CurrentNetworkProposal_RoninBridgeManager_Test is _proposal.nonce = _roninBridgeManager.round(block.chainid) + 1; _proposal.chainId = block.chainid; _proposal.executor = address(0); - _proposal.loose = false; _proposal.expiryTimestamp = block.timestamp + _proposalExpiryDuration; _proposal.targets.push(address(_roninBridgeManager)); @@ -80,7 +79,6 @@ contract ProposalWithExecutor_CurrentNetworkProposal_RoninBridgeManager_Test is // Should the auto proposal executes on the last valid vote function test_autoProposal_strictProposal_WhenAllInternalCallsPass() public { - _proposal.loose = false; _proposal.executor = address(0); vm.expectEmit(false, true, true, true); @@ -114,7 +112,6 @@ contract ProposalWithExecutor_CurrentNetworkProposal_RoninBridgeManager_Test is // Should the non-auto proposal be execute by the specified executor function test_executorProposal_strictProposal_WhenAllInternalCallsPass() public { - _proposal.loose = false; _proposal.executor = _param.roninBridgeManager.governors[0]; _proposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success @@ -153,7 +150,6 @@ contract ProposalWithExecutor_CurrentNetworkProposal_RoninBridgeManager_Test is // Should the non-auto proposal can not be execute by other governor function test_executorProposal_revertWhen_proposalIsExecutedByAnotherGovernor() external { - _proposal.loose = false; _proposal.executor = _param.roninBridgeManager.governors[0]; _proposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success diff --git a/test/bridge/integration/bridge-manager/proposal-executor/executor.proposeGlobal.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-executor/executor.proposeGlobal.RoninBridgeManager.t.sol index bf524b16..98aac58d 100644 --- a/test/bridge/integration/bridge-manager/proposal-executor/executor.proposeGlobal.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/proposal-executor/executor.proposeGlobal.RoninBridgeManager.t.sol @@ -60,7 +60,6 @@ contract ProposalWithExecutor_GlobalProposal_RoninBridgeManager_Test is BaseInte _globalProposal.nonce = _roninBridgeManager.round(0) + 1; _globalProposal.executor = address(0); - _globalProposal.loose = false; _globalProposal.expiryTimestamp = block.timestamp + _proposalExpiryDuration; _globalProposal.targetOptions.push(GlobalProposal.TargetOption.BridgeManager); @@ -77,7 +76,6 @@ contract ProposalWithExecutor_GlobalProposal_RoninBridgeManager_Test is BaseInte // Should the auto proposal executes on the last valid vote function test_autoProposal_strictProposal_WhenAllInternalCallsPass() public { - _globalProposal.loose = false; _globalProposal.executor = address(0); vm.expectEmit(false, true, true, true); @@ -111,7 +109,6 @@ contract ProposalWithExecutor_GlobalProposal_RoninBridgeManager_Test is BaseInte // Should the non-auto proposal be execute by the specified executor function test_executorProposal_strictProposal_WhenAllInternalCallsPass() public { - _globalProposal.loose = false; _globalProposal.executor = _param.roninBridgeManager.governors[0]; _globalProposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success @@ -150,7 +147,6 @@ contract ProposalWithExecutor_GlobalProposal_RoninBridgeManager_Test is BaseInte // Should the non-auto proposal can not be execute by other governor function test_executorProposal_revertWhen_proposalIsExecutedByAnotherGovernor() external { - _globalProposal.loose = false; _globalProposal.executor = _param.roninBridgeManager.governors[0]; _globalProposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success diff --git a/test/bridge/integration/bridge-manager/proposal-executor/executor.proposeMainchain.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-executor/executor.proposeMainchain.RoninBridgeManager.t.sol index 53467717..37b115e6 100644 --- a/test/bridge/integration/bridge-manager/proposal-executor/executor.proposeMainchain.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/proposal-executor/executor.proposeMainchain.RoninBridgeManager.t.sol @@ -61,7 +61,6 @@ contract ProposalWithExecutor_MainchainProposal_RoninBridgeManager_Test is BaseI _proposal.nonce = _roninBridgeManager.round(block.chainid) + 1; _proposal.chainId = block.chainid; _proposal.executor = address(0); - _proposal.loose = false; _proposal.expiryTimestamp = block.timestamp + _proposalExpiryDuration; _proposal.targets.push(address(_mainchainBridgeManager)); // Test Relay @@ -78,7 +77,6 @@ contract ProposalWithExecutor_MainchainProposal_RoninBridgeManager_Test is BaseI // Should the proposal is approved but not executed on Ronin chain function test_proposeMainchain_autoProposal_looseProposal() public { - _proposal.loose = true; _proposal.executor = address(0); vm.expectEmit(false, true, true, true); @@ -104,7 +102,6 @@ contract ProposalWithExecutor_MainchainProposal_RoninBridgeManager_Test is BaseI // Should the non-auto proposal be execute by the specified executor function test_proposeMainchain_executorProposal_looseProposal_WhenAllInternalCallsPass() public { - _proposal.loose = true; _proposal.executor = _param.roninBridgeManager.governors[0]; _proposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success @@ -133,10 +130,8 @@ contract ProposalWithExecutor_MainchainProposal_RoninBridgeManager_Test is BaseI assertEq(_roninBridgeManager.getBridgeOperators(), _beforeRelayedOperators); } - // Should the non-auto proposal can not be execute by other governor function test_proposeMainchain_executorProposal_revertWhen_proposalIsExecutedByAnotherGovernor() external { - _proposal.loose = false; _proposal.executor = _param.roninBridgeManager.governors[0]; _proposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success diff --git a/test/bridge/integration/bridge-manager/proposal-executor/executor.relayGlobal.MainchainBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-executor/executor.relayGlobal.MainchainBridgeManager.t.sol index fba61e10..c0a97047 100644 --- a/test/bridge/integration/bridge-manager/proposal-executor/executor.relayGlobal.MainchainBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/proposal-executor/executor.relayGlobal.MainchainBridgeManager.t.sol @@ -61,7 +61,6 @@ contract ProposalWithExecutor_GlobalProposal_MainchainBridgeManager_Test is Base _globalProposal.nonce = _mainchainBridgeManager.round(0) + 1; _globalProposal.executor = address(0); - _globalProposal.loose = false; _globalProposal.expiryTimestamp = block.timestamp + _proposalExpiryDuration; _globalProposal.targetOptions.push(GlobalProposal.TargetOption.BridgeManager); @@ -78,7 +77,6 @@ contract ProposalWithExecutor_GlobalProposal_MainchainBridgeManager_Test is Base // Should the auto proposal executes on the last valid vote function test_relayGlobal_autoProposal_strictProposal_WhenAllInternalCallsPass() public { - _globalProposal.loose = false; _globalProposal.executor = address(0); vm.expectEmit(false, false, false, false); @@ -110,7 +108,6 @@ contract ProposalWithExecutor_GlobalProposal_MainchainBridgeManager_Test is Base // Should the non-auto proposal be execute by the specified executor function test_relayGlobal_executorProposal_strictProposal_WhenAllInternalCallsPass() public { - _globalProposal.loose = false; _globalProposal.executor = _param.roninBridgeManager.governors[0]; _globalProposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success @@ -142,7 +139,6 @@ contract ProposalWithExecutor_GlobalProposal_MainchainBridgeManager_Test is Base // Should the non-auto proposal can not be execute by other governor function test_relayGlobal_executorProposal_revertWhen_proposalIsExecutedByAnotherGovernor() external { - _globalProposal.loose = false; _globalProposal.executor = _param.roninBridgeManager.governors[0]; _globalProposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success diff --git a/test/bridge/integration/bridge-manager/proposal-executor/executor.relayMainchain.MainchainBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-executor/executor.relayMainchain.MainchainBridgeManager.t.sol index 89818604..c06d6792 100644 --- a/test/bridge/integration/bridge-manager/proposal-executor/executor.relayMainchain.MainchainBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/proposal-executor/executor.relayMainchain.MainchainBridgeManager.t.sol @@ -62,7 +62,6 @@ contract ProposalWithExecutor_MainchainProposal_MainchainBridgeManager_Test is B _proposal.nonce = _mainchainBridgeManager.round(block.chainid) + 1; _proposal.chainId = block.chainid; _proposal.executor = address(0); - _proposal.loose = false; _proposal.expiryTimestamp = block.timestamp + _proposalExpiryDuration; _proposal.targets.push(address(_mainchainBridgeManager)); // Test Relay @@ -79,7 +78,6 @@ contract ProposalWithExecutor_MainchainProposal_MainchainBridgeManager_Test is B // Should the proposal is approved but not executed on Ronin chain function test_relayMainchain_autoProposal_looseProposal() public { - _proposal.loose = true; _proposal.executor = address(0); vm.expectEmit(false, false, false, false); @@ -101,7 +99,6 @@ contract ProposalWithExecutor_MainchainProposal_MainchainBridgeManager_Test is B // Should the non-auto proposal be relay by the specified executor function test_relayMainchain_executorProposal_looseProposal_WhenAllInternalCallsPass() public { - _proposal.loose = true; _proposal.executor = _param.roninBridgeManager.governors[0]; _proposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success @@ -124,7 +121,6 @@ contract ProposalWithExecutor_MainchainProposal_MainchainBridgeManager_Test is B // Should the non-auto proposal can not be execute by other governor function test_relayMainchain_executorProposal_revertWhen_proposalIsExecutedByAnotherGovernor() external { - _proposal.loose = false; _proposal.executor = _param.roninBridgeManager.governors[0]; _proposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success diff --git a/test/bridge/integration/bridge-manager/proposal-loose/proposeCurrent.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-loose/proposeCurrent.RoninBridgeManager.t.sol index 17ee78e1..daa8f3d8 100644 --- a/test/bridge/integration/bridge-manager/proposal-loose/proposeCurrent.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/proposal-loose/proposeCurrent.RoninBridgeManager.t.sol @@ -59,7 +59,6 @@ contract LooseProposal_CurrentNetworkProposal_RoninBridgeManager_Test is BaseInt _proposal.nonce = _roninBridgeManager.round(block.chainid) + 1; _proposal.chainId = block.chainid; _proposal.executor = address(0); - _proposal.loose = false; _proposal.expiryTimestamp = block.timestamp + _proposalExpiryDuration; _proposal.targets.push(address(_roninBridgeManager)); @@ -76,7 +75,6 @@ contract LooseProposal_CurrentNetworkProposal_RoninBridgeManager_Test is BaseInt // Should the strict proposal failed when containing one failed internal call function test_strictProposal_revertWhen_containingOneFailedInternalCall() external { - _proposal.loose = false; _proposal.gasAmounts[1] = 1_000; // Set gas for the second call becomes failed vm.expectEmit(false, true, true, true); @@ -94,7 +92,6 @@ contract LooseProposal_CurrentNetworkProposal_RoninBridgeManager_Test is BaseInt // Should the strict proposal passes when all internal calls are valid function test_strictProposal_WhenAllInternalCallsPass() external { - _proposal.loose = false; _proposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success vm.expectEmit(false, true, true, true); @@ -114,7 +111,6 @@ contract LooseProposal_CurrentNetworkProposal_RoninBridgeManager_Test is BaseInt // Should the loose proposal passes when containing one failed internal call function test_looseProposal_WhenContainsOneInternalCallFailed() external { - _proposal.loose = true; _proposal.gasAmounts[1] = 1_000; // Set gas for the second call becomes failed vm.expectEmit(false, true, true, true); @@ -134,7 +130,6 @@ contract LooseProposal_CurrentNetworkProposal_RoninBridgeManager_Test is BaseInt // Should the loose proposal passes when all internal calls are valid function test_looseProposal_WhenAllInternalCallsPass() external { - _proposal.loose = true; _proposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success vm.expectEmit(false, true, true, true); diff --git a/test/bridge/integration/bridge-manager/proposal-loose/proposeGlobal.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-loose/proposeGlobal.RoninBridgeManager.t.sol index d05a5156..1ab43f14 100644 --- a/test/bridge/integration/bridge-manager/proposal-loose/proposeGlobal.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/proposal-loose/proposeGlobal.RoninBridgeManager.t.sol @@ -57,7 +57,6 @@ contract LooseProposal_GlobalProposal_RoninBridgeManager_Test is BaseIntegration _globalProposal.nonce = _roninBridgeManager.round(0) + 1; _globalProposal.expiryTimestamp = block.timestamp + _proposalExpiryDuration; _globalProposal.executor = address(0); - _globalProposal.loose = false; _globalProposal.targetOptions.push(GlobalProposal.TargetOption.BridgeManager); _globalProposal.values.push(0); @@ -73,7 +72,6 @@ contract LooseProposal_GlobalProposal_RoninBridgeManager_Test is BaseIntegration // Should the strict proposal failed when containing one failed internal call function test_strictProposal_globalProposal_RoninSide_revertWhen_containingOneFailedInternalCall() external { - _globalProposal.loose = false; _globalProposal.gasAmounts[1] = 1_000; // Set gas for the second call becomes failed vm.expectEmit(false, true, true, true); @@ -91,7 +89,6 @@ contract LooseProposal_GlobalProposal_RoninBridgeManager_Test is BaseIntegration // Should the strict proposal passes when all internal calls are valid function test_strictProposal_globalProposal_RoninSide_WhenAllInternalCallsPass() external { - _globalProposal.loose = false; _globalProposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success vm.expectEmit(false, true, true, true); @@ -111,7 +108,6 @@ contract LooseProposal_GlobalProposal_RoninBridgeManager_Test is BaseIntegration // Should the loose proposal passes when containing one failed internal call function test_looseProposal_globalProposal_RoninSide_WhenContainsOneInternalCallFailed() external { - _globalProposal.loose = true; _globalProposal.gasAmounts[1] = 1_000; // Set gas for the second call becomes failed vm.expectEmit(false, true, true, true); @@ -131,7 +127,6 @@ contract LooseProposal_GlobalProposal_RoninBridgeManager_Test is BaseIntegration // Should the loose proposal passes when all internal calls are valid function test_looseProposal_globalProposal_RoninSide_WhenAllInternalCallsPass() external { - _globalProposal.loose = true; _globalProposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success vm.expectEmit(false, true, true, true); diff --git a/test/bridge/integration/bridge-manager/proposal-loose/relayGlobal.MainchainBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-loose/relayGlobal.MainchainBridgeManager.t.sol index b2375358..f842451f 100644 --- a/test/bridge/integration/bridge-manager/proposal-loose/relayGlobal.MainchainBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/proposal-loose/relayGlobal.MainchainBridgeManager.t.sol @@ -59,7 +59,6 @@ contract LooseProposal_GlobalProposal_MainchainBridgeManager_Test is BaseIntegra _globalProposal.nonce = _mainchainBridgeManager.round(0) + 1; _globalProposal.expiryTimestamp = block.timestamp + _proposalExpiryDuration; _globalProposal.executor = address(0); - _globalProposal.loose = false; _globalProposal.targetOptions.push(GlobalProposal.TargetOption.BridgeManager); _globalProposal.values.push(0); @@ -75,7 +74,6 @@ contract LooseProposal_GlobalProposal_MainchainBridgeManager_Test is BaseIntegra // Should the strict proposal failed when containing one failed internal call function test_strictProposal_globalProposal_MainchainSide_revertWhen_containingOneFailedInternalCall() external { - _globalProposal.loose = false; _globalProposal.gasAmounts[1] = 1_000; // Set gas for the second call becomes failed vm.expectEmit(false, true, true, true); @@ -93,7 +91,6 @@ contract LooseProposal_GlobalProposal_MainchainBridgeManager_Test is BaseIntegra // Should the strict proposal passes when all internal calls are valid function test_strictProposal_globalProposal_MainchainSide_WhenAllInternalCallsPass() external { - _globalProposal.loose = false; _globalProposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success vm.expectEmit(false, false, false, false); @@ -115,7 +112,6 @@ contract LooseProposal_GlobalProposal_MainchainBridgeManager_Test is BaseIntegra // Should the loose proposal passes when containing one failed internal call function test_looseProposal_globalProposal_MainchainSide_WhenContainsOneInternalCallFailed() external { - _globalProposal.loose = true; _globalProposal.gasAmounts[1] = 1_000; // Set gas for the second call becomes failed vm.expectEmit(false, false, false, false); @@ -137,7 +133,6 @@ contract LooseProposal_GlobalProposal_MainchainBridgeManager_Test is BaseIntegra // Should the loose proposal passes when all internal calls are valid function test_looseProposal_globalProposal_MainchainSide_WhenAllInternalCallsPass() external { - _globalProposal.loose = true; _globalProposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success vm.expectEmit(false, false, false, false); diff --git a/test/bridge/integration/bridge-manager/propose-and-cast-vote/voteBridgeOperator.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/propose-and-cast-vote/voteBridgeOperator.RoninBridgeManager.t.sol index 48e96924..110d1070 100644 --- a/test/bridge/integration/bridge-manager/propose-and-cast-vote/voteBridgeOperator.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/propose-and-cast-vote/voteBridgeOperator.RoninBridgeManager.t.sol @@ -59,7 +59,6 @@ contract VoteBridgeOperator_RoninBridgeManager_Test is BaseIntegration_Test { _globalProposal = _roninProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + _proposalExpiryDuration, executor: address(0), - loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, calldata_: abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators)), @@ -67,8 +66,7 @@ contract VoteBridgeOperator_RoninBridgeManager_Test is BaseIntegration_Test { nonce: _roninBridgeManager.round(0) + 1 }); - SignatureConsumer.Signature[] memory signatures = - _roninProposalUtils.generateSignaturesGlobal(_globalProposal, _param.test.governorPKs); + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignaturesGlobal(_globalProposal, _param.test.governorPKs); for (uint256 i; i < signatures.length; i++) { _signatures.push(signatures[i]); @@ -80,9 +78,7 @@ contract VoteBridgeOperator_RoninBridgeManager_Test is BaseIntegration_Test { vm.prank(_param.roninBridgeManager.governors[0]); _roninBridgeManager.proposeGlobalProposalStructAndCastVotes(_globalProposal, _supports, _signatures); - assertEq( - _roninBridgeManager.globalProposalVoted(_globalProposal.nonce, _param.roninBridgeManager.governors[0]), true - ); + assertEq(_roninBridgeManager.globalProposalVoted(_globalProposal.nonce, _param.roninBridgeManager.governors[0]), true); assertEq(_roninBridgeManager.getBridgeOperators(), _afterRelayedOperators); } @@ -106,9 +102,7 @@ contract VoteBridgeOperator_RoninBridgeManager_Test is BaseIntegration_Test { function test_RevertWhen_RelayAgain() public { test_relayAddBridgeOperator(); - vm.expectRevert( - abi.encodeWithSelector(ErrInvalidProposalNonce.selector, MainchainBridgeManager.relayGlobalProposal.selector) - ); + vm.expectRevert(abi.encodeWithSelector(ErrInvalidProposalNonce.selector, MainchainBridgeManager.relayGlobalProposal.selector)); vm.prank(_param.mainchainBridgeManager.governors[0]); _mainchainBridgeManager.relayGlobalProposal(_globalProposal, _supports, _signatures); @@ -122,7 +116,6 @@ contract VoteBridgeOperator_RoninBridgeManager_Test is BaseIntegration_Test { _globalProposal = _roninProposalUtils.createGlobalProposal({ expiryTimestamp: block.timestamp + _proposalExpiryDuration, executor: address(0), - loose: false, targetOption: GlobalProposal.TargetOption.BridgeManager, value: 0, calldata_: abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators)), @@ -130,8 +123,7 @@ contract VoteBridgeOperator_RoninBridgeManager_Test is BaseIntegration_Test { nonce: _roninBridgeManager.round(0) + 1 }); - SignatureConsumer.Signature[] memory signatures = - _roninProposalUtils.generateSignaturesGlobal(_globalProposal, _param.test.governorPKs); + SignatureConsumer.Signature[] memory signatures = _roninProposalUtils.generateSignaturesGlobal(_globalProposal, _param.test.governorPKs); for (uint256 i; i < signatures.length; i++) { _signatures.push(signatures[i]); @@ -143,9 +135,7 @@ contract VoteBridgeOperator_RoninBridgeManager_Test is BaseIntegration_Test { vm.prank(_param.roninBridgeManager.governors[0]); _roninBridgeManager.proposeGlobalProposalStructAndCastVotes(_globalProposal, _supports, _signatures); - assertEq( - _roninBridgeManager.globalProposalVoted(_globalProposal.nonce, _param.roninBridgeManager.governors[0]), true - ); + assertEq(_roninBridgeManager.globalProposalVoted(_globalProposal.nonce, _param.roninBridgeManager.governors[0]), true); assertEq(_roninBridgeManager.getBridgeOperators(), _afterRelayedOperators); } diff --git a/test/helpers/MainchainBridgeAdminUtils.t.sol b/test/helpers/MainchainBridgeAdminUtils.t.sol index 322771c2..197ab666 100644 --- a/test/helpers/MainchainBridgeAdminUtils.t.sol +++ b/test/helpers/MainchainBridgeAdminUtils.t.sol @@ -21,7 +21,6 @@ contract MainchainBridgeAdminUtils is ProposalUtils { Proposal.ProposalDetail memory proposal = this.createProposal({ expiryTimestamp: this.defaultExpiryTimestamp(), executor: address(0), - loose: false, target: to, value: 0, calldata_: abi.encodeWithSignature("functionDelegateCall(bytes)", data), @@ -43,7 +42,6 @@ contract MainchainBridgeAdminUtils is ProposalUtils { GlobalProposal.GlobalProposalDetail memory proposal = this.createGlobalProposal({ expiryTimestamp: this.defaultExpiryTimestamp(), executor: address(0), - loose: false, targetOption: target, value: 0, calldata_: abi.encodeWithSignature("functionDelegateCall(bytes)", data), @@ -78,7 +76,6 @@ contract MainchainBridgeAdminUtils is ProposalUtils { nonce: _contract.round(0) + 1, expiryTimestamp: this.defaultExpiryTimestamp(), executor: address(0), - loose: false, targetOptions: targetOptions, values: values, calldatas: calldatas, @@ -99,7 +96,6 @@ contract MainchainBridgeAdminUtils is ProposalUtils { GlobalProposal.GlobalProposalDetail memory proposal = this.createGlobalProposal({ expiryTimestamp: this.defaultExpiryTimestamp(), executor: address(0), - loose: false, targetOption: targetOption, value: 0, calldata_: abi.encodeWithSignature("upgradeTo(bytes)", data), diff --git a/test/helpers/ProposalUtils.t.sol b/test/helpers/ProposalUtils.t.sol index 38a9bc65..8affd389 100644 --- a/test/helpers/ProposalUtils.t.sol +++ b/test/helpers/ProposalUtils.t.sol @@ -29,7 +29,6 @@ contract ProposalUtils is Utils, Test { function createProposal( uint256 expiryTimestamp, address executor, - bool loose, address target, uint256 value, bytes memory calldata_, @@ -40,7 +39,6 @@ contract ProposalUtils is Utils, Test { nonce: nonce, chainId: block.chainid, executor: executor, - loose: loose, expiryTimestamp: expiryTimestamp, targets: wrapAddress(target), values: wrapUint(value), @@ -52,7 +50,6 @@ contract ProposalUtils is Utils, Test { function createGlobalProposal( uint256 expiryTimestamp, address executor, - bool loose, GlobalProposal.TargetOption targetOption, uint256 value, bytes memory calldata_, @@ -66,7 +63,6 @@ contract ProposalUtils is Utils, Test { nonce: nonce, expiryTimestamp: expiryTimestamp, executor: executor, - loose: loose, targetOptions: targetOptions, values: wrapUint(value), calldatas: wrapBytes(calldata_), diff --git a/test/helpers/RoninBridgeAdminUtils.t.sol b/test/helpers/RoninBridgeAdminUtils.t.sol index db703ab9..6489a7f3 100644 --- a/test/helpers/RoninBridgeAdminUtils.t.sol +++ b/test/helpers/RoninBridgeAdminUtils.t.sol @@ -21,7 +21,6 @@ contract RoninBridgeAdminUtils is ProposalUtils { Proposal.ProposalDetail memory proposal = this.createProposal({ expiryTimestamp: this.defaultExpiryTimestamp(), executor: address(0), - loose: false, target: to, value: 0, calldata_: abi.encodeWithSignature("functionDelegateCall(bytes)", data), @@ -43,7 +42,6 @@ contract RoninBridgeAdminUtils is ProposalUtils { GlobalProposal.GlobalProposalDetail memory proposal = this.createGlobalProposal({ expiryTimestamp: this.defaultExpiryTimestamp(), executor: address(0), - loose: false, targetOption: target, value: 0, calldata_: abi.encodeWithSignature("functionDelegateCall(bytes)", data), @@ -78,7 +76,6 @@ contract RoninBridgeAdminUtils is ProposalUtils { nonce: _contract.round(0) + 1, expiryTimestamp: this.defaultExpiryTimestamp(), executor: address(0), - loose: false, targetOptions: targetOptions, values: values, calldatas: calldatas, @@ -99,7 +96,6 @@ contract RoninBridgeAdminUtils is ProposalUtils { GlobalProposal.GlobalProposalDetail memory proposal = this.createGlobalProposal({ expiryTimestamp: this.defaultExpiryTimestamp(), executor: address(0), - loose: false, targetOption: targetOption, value: 0, calldata_: abi.encodeWithSignature("upgradeTo(bytes)", data), From 6238f2323a8f3778409cb226e25138b7f9e2e485 Mon Sep 17 00:00:00 2001 From: TuDo1403 Date: Thu, 4 Apr 2024 16:00:32 +0700 Subject: [PATCH 126/180] script: fix test, RoninBridgeManagerDeploy script --- .../20231218-maptoken-roninchain.s.sol | 5 +- .../20240115-maptoken-mainchain.s.sol | 49 ++------- .../20240115-maptoken-roninchain.s.sol | 32 ++---- .../20240131-maptoken-pixel-mainchain.s.sol | 35 ++---- .../20240131-maptoken-pixel-roninchain.s.sol | 23 +--- .../20240206-maptoken-banana-mainchain.s.sol | 28 ++--- .../20240206-maptoken-banana-roninchain.s.sol | 2 +- script/GeneralConfig.sol | 1 + .../contracts/RoninBridgeManagerDeploy.s.sol | 14 ++- script/utils/Contract.sol | 2 + ....proposeMainchain.RoninBridgeManager.t.sol | 2 + .../proposeCurrent.RoninBridgeManager.t.sol | 1 + .../proposeGlobal.RoninBridgeManager.t.sol | 1 + .../relayGlobal.MainchainBridgeManager.t.sol | 1 + .../updateOperator.RoninBridgeManager.t.sol | 69 ++++++------ .../bridge-manager/update/update.t.sol | 101 +++++++++--------- .../bridge-manager/BridgeManagerCRUD.t.sol | 97 ++++++++--------- 17 files changed, 195 insertions(+), 268 deletions(-) diff --git a/script/20231218-maptoken/20231218-maptoken-roninchain.s.sol b/script/20231218-maptoken/20231218-maptoken-roninchain.s.sol index 4e3b9150..9a7d2a2c 100644 --- a/script/20231218-maptoken/20231218-maptoken-roninchain.s.sol +++ b/script/20231218-maptoken/20231218-maptoken-roninchain.s.sol @@ -41,8 +41,7 @@ contract Migration__20231215_MapTokenRoninchain is BridgeMigration { // uint256[] calldata chainIds, // Token.Standard[] calldata _standards // ) - bytes memory innerData = - abi.encodeCall(IRoninGatewayV3.mapTokens, (roninTokens, mainchainTokens, chainIds, standards)); + bytes memory innerData = abi.encodeCall(IRoninGatewayV3.mapTokens, (roninTokens, mainchainTokens, chainIds, standards)); bytes memory proxyData = abi.encodeWithSignature("functionDelegateCall(bytes)", innerData); uint256 expiredTime = block.timestamp + 10 days; @@ -58,6 +57,6 @@ contract Migration__20231215_MapTokenRoninchain is BridgeMigration { _verifyRoninProposalGasAmount(targets, values, calldatas, gasAmounts); vm.broadcast(sender()); - _roninBridgeManager.propose(block.chainid, expiredTime, address(0), false, targets, values, calldatas, gasAmounts); + _roninBridgeManager.propose(block.chainid, expiredTime, address(0), targets, values, calldatas, gasAmounts); } } diff --git a/script/20240115-mappixeltoken/20240115-maptoken-mainchain.s.sol b/script/20240115-mappixeltoken/20240115-maptoken-mainchain.s.sol index f433067c..18cde061 100644 --- a/script/20240115-mappixeltoken/20240115-maptoken-mainchain.s.sol +++ b/script/20240115-mappixeltoken/20240115-maptoken-mainchain.s.sol @@ -43,14 +43,9 @@ contract Migration__MapTokenMainchain is BridgeMigration { super.setUp(); _roninBridgeManager = RoninBridgeManager(_config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); - _mainchainGatewayV3 = _config.getAddress( - _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).key(), - Contract.MainchainGatewayV3.key() - ); - _mainchainBridgeManager = _config.getAddress( - _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).key(), - Contract.MainchainBridgeManager.key() - ); + _mainchainGatewayV3 = _config.getAddress(_config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).key(), Contract.MainchainGatewayV3.key()); + _mainchainBridgeManager = + _config.getAddress(_config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).key(), Contract.MainchainBridgeManager.key()); } function _mapFarmlandToken() internal pure returns (bytes memory) { @@ -68,11 +63,7 @@ contract Migration__MapTokenMainchain is BridgeMigration { // Token.Standard[] calldata _standards // ) - bytes memory innerData = abi.encodeCall(IMainchainGatewayV3.mapTokens, ( - mainchainTokens, - roninTokens, - standards - )); + bytes memory innerData = abi.encodeCall(IMainchainGatewayV3.mapTokens, (mainchainTokens, roninTokens, standards)); return abi.encodeWithSignature("functionDelegateCall(bytes)", innerData); } @@ -106,25 +97,18 @@ contract Migration__MapTokenMainchain is BridgeMigration { // uint256[][4] calldata _thresholds // ) - bytes memory innerData = abi.encodeCall(IMainchainGatewayV3.mapTokensAndThresholds, ( - mainchainTokens, - roninTokens, - standards, - thresholds - )); + bytes memory innerData = abi.encodeCall(IMainchainGatewayV3.mapTokensAndThresholds, (mainchainTokens, roninTokens, standards, thresholds)); return abi.encodeWithSignature("functionDelegateCall(bytes)", innerData); } - function _removeAxieChatGovernorAddress() pure internal returns (bytes memory) { + function _removeAxieChatGovernorAddress() internal pure returns (bytes memory) { address[] memory bridgeOperator = new address[](1); bridgeOperator[0] = _axieChatBridgeOperator; - return abi.encodeCall(IBridgeManager.removeBridgeOperators, ( - bridgeOperator - )); + return abi.encodeCall(IBridgeManager.removeBridgeOperators, (bridgeOperator)); } - function _addAxieChatGovernorAddress() pure internal returns (bytes memory) { + function _addAxieChatGovernorAddress() internal pure returns (bytes memory) { uint96[] memory voteWeight = new uint96[](1); address[] memory governor = new address[](1); address[] memory bridgeOperator = new address[](1); @@ -133,11 +117,7 @@ contract Migration__MapTokenMainchain is BridgeMigration { governor[0] = _axieChatGovernor; bridgeOperator[0] = _axieChatBridgeOperator; - return abi.encodeCall(IBridgeManager.addBridgeOperators, ( - voteWeight, - governor, - bridgeOperator - )); + return abi.encodeCall(IBridgeManager.addBridgeOperators, (voteWeight, governor, bridgeOperator)); } function run() public { @@ -172,15 +152,6 @@ contract Migration__MapTokenMainchain is BridgeMigration { uint256 chainId = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); vm.broadcast(sender()); - _roninBridgeManager.propose( - chainId, - expiredTime, - address(0), - false, - targets, - values, - calldatas, - gasAmounts - ); + _roninBridgeManager.propose(chainId, expiredTime, address(0), targets, values, calldatas, gasAmounts); } } diff --git a/script/20240115-mappixeltoken/20240115-maptoken-roninchain.s.sol b/script/20240115-mappixeltoken/20240115-maptoken-roninchain.s.sol index ffd75cf7..07e09cce 100644 --- a/script/20240115-mappixeltoken/20240115-maptoken-roninchain.s.sol +++ b/script/20240115-mappixeltoken/20240115-maptoken-roninchain.s.sol @@ -59,16 +59,11 @@ contract Migration__MapTokenRoninchain is BridgeMigration { // Token.Standard[] calldata _standards // ) - bytes memory innerData = abi.encodeCall(IRoninGatewayV3.mapTokens, ( - roninTokens, - mainchainTokens, - chainIds, - standards - )); + bytes memory innerData = abi.encodeCall(IRoninGatewayV3.mapTokens, (roninTokens, mainchainTokens, chainIds, standards)); return abi.encodeWithSignature("functionDelegateCall(bytes)", innerData); } - function _removeAxieChatGovernorAddress() pure internal returns (bytes memory) { + function _removeAxieChatGovernorAddress() internal pure returns (bytes memory) { address[] memory bridgeOperator = new address[](1); bridgeOperator[0] = _axieChatBridgeOperator; @@ -76,12 +71,10 @@ contract Migration__MapTokenRoninchain is BridgeMigration { // address[] calldata bridgeOperators // ) - return abi.encodeCall(IBridgeManager.removeBridgeOperators, ( - bridgeOperator - )); + return abi.encodeCall(IBridgeManager.removeBridgeOperators, (bridgeOperator)); } - function _addAxieChatGovernorAddress() pure internal returns (bytes memory) { + function _addAxieChatGovernorAddress() internal pure returns (bytes memory) { uint96[] memory voteWeight = new uint96[](1); address[] memory governor = new address[](1); address[] memory bridgeOperator = new address[](1); @@ -96,11 +89,7 @@ contract Migration__MapTokenRoninchain is BridgeMigration { // address[] calldata bridgeOperators // ) - return abi.encodeCall(IBridgeManager.addBridgeOperators, ( - voteWeight, - governor, - bridgeOperator - )); + return abi.encodeCall(IBridgeManager.addBridgeOperators, (voteWeight, governor, bridgeOperator)); } function run() public { @@ -128,15 +117,6 @@ contract Migration__MapTokenRoninchain is BridgeMigration { _verifyRoninProposalGasAmount(targets, values, calldatas, gasAmounts); vm.broadcast(sender()); - _roninBridgeManager.propose( - block.chainid, - expiredTime, - address(0), - false, - targets, - values, - calldatas, - gasAmounts - ); + _roninBridgeManager.propose(block.chainid, expiredTime, address(0), targets, values, calldatas, gasAmounts); } } diff --git a/script/20240131-maptoken-pixel/20240131-maptoken-pixel-mainchain.s.sol b/script/20240131-maptoken-pixel/20240131-maptoken-pixel-mainchain.s.sol index 0603d4a2..3c81b866 100644 --- a/script/20240131-maptoken-pixel/20240131-maptoken-pixel-mainchain.s.sol +++ b/script/20240131-maptoken-pixel/20240131-maptoken-pixel-mainchain.s.sol @@ -26,14 +26,9 @@ contract Migration__20240131_MapTokenPixelMainchain is BridgeMigration, Migratio super.setUp(); _roninBridgeManager = RoninBridgeManager(_config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); - _mainchainGatewayV3 = _config.getAddress( - _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).key(), - Contract.MainchainGatewayV3.key() - ); - _mainchainBridgeManager = _config.getAddress( - _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).key(), - Contract.MainchainBridgeManager.key() - ); + _mainchainGatewayV3 = _config.getAddress(_config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).key(), Contract.MainchainGatewayV3.key()); + _mainchainBridgeManager = + _config.getAddress(_config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).key(), Contract.MainchainBridgeManager.key()); } function run() public { @@ -73,12 +68,7 @@ contract Migration__20240131_MapTokenPixelMainchain is BridgeMigration, Migratio // uint256[][4] calldata _thresholds // ) - bytes memory innerData = abi.encodeCall(IMainchainGatewayV3.mapTokensAndThresholds, ( - mainchainTokens, - roninTokens, - standards, - thresholds - )); + bytes memory innerData = abi.encodeCall(IMainchainGatewayV3.mapTokensAndThresholds, (mainchainTokens, roninTokens, standards, thresholds)); bytes memory proxyData = abi.encodeWithSignature("functionDelegateCall(bytes)", innerData); @@ -99,11 +89,7 @@ contract Migration__20240131_MapTokenPixelMainchain is BridgeMigration, Migratio // Token.Standard[] calldata _standards // ) external; - innerData = abi.encodeCall(IMainchainGatewayV3.mapTokens, ( - mainchainTokens, - roninTokens, - standards - )); + innerData = abi.encodeCall(IMainchainGatewayV3.mapTokens, (mainchainTokens, roninTokens, standards)); proxyData = abi.encodeWithSignature("functionDelegateCall(bytes)", innerData); @@ -130,15 +116,6 @@ contract Migration__20240131_MapTokenPixelMainchain is BridgeMigration, Migratio uint256 chainId = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); vm.broadcast(_governor); - _roninBridgeManager.propose( - chainId, - expiredTime, - address(0), - false, - targets, - values, - calldatas, - gasAmounts - ); + _roninBridgeManager.propose(chainId, expiredTime, address(0), targets, values, calldatas, gasAmounts); } } diff --git a/script/20240131-maptoken-pixel/20240131-maptoken-pixel-roninchain.s.sol b/script/20240131-maptoken-pixel/20240131-maptoken-pixel-roninchain.s.sol index 129f589b..96c309bb 100644 --- a/script/20240131-maptoken-pixel/20240131-maptoken-pixel-roninchain.s.sol +++ b/script/20240131-maptoken-pixel/20240131-maptoken-pixel-roninchain.s.sol @@ -74,12 +74,7 @@ contract Migration__20240131_MapTokenPixelRoninchain is BridgeMigration, Migrati // uint256[] calldata chainIds, // Token.Standard[] calldata _standards // ) - bytes memory innerData = abi.encodeCall(IRoninGatewayV3.mapTokens, ( - roninTokens, - mainchainTokens, - chainIds, - standards - )); + bytes memory innerData = abi.encodeCall(IRoninGatewayV3.mapTokens, (roninTokens, mainchainTokens, chainIds, standards)); bytes memory proxyData = abi.encodeWithSignature("functionDelegateCall(bytes)", innerData); targets[0] = _roninGatewayV3; @@ -101,10 +96,7 @@ contract Migration__20240131_MapTokenPixelRoninchain is BridgeMigration, Migrati mainchainTokensToSetMinThreshold[1] = _aggMainchainToken; minThresholds[1] = _aggMinThreshold; - innerData = abi.encodeCall(MinimumWithdrawal.setMinimumThresholds, ( - mainchainTokensToSetMinThreshold, - minThresholds - )); + innerData = abi.encodeCall(MinimumWithdrawal.setMinimumThresholds, (mainchainTokensToSetMinThreshold, minThresholds)); proxyData = abi.encodeWithSignature("functionDelegateCall(bytes)", innerData); targets[1] = _roninGatewayV3; @@ -128,15 +120,6 @@ contract Migration__20240131_MapTokenPixelRoninchain is BridgeMigration, Migrati _verifyRoninProposalGasAmount(targets, values, calldatas, gasAmounts); vm.broadcast(_governor); - _roninBridgeManager.propose( - block.chainid, - expiredTime, - address(0), - false, - targets, - values, - calldatas, - gasAmounts - ); + _roninBridgeManager.propose(block.chainid, expiredTime, address(0), targets, values, calldatas, gasAmounts); } } diff --git a/script/20240206-maptoken-banana/20240206-maptoken-banana-mainchain.s.sol b/script/20240206-maptoken-banana/20240206-maptoken-banana-mainchain.s.sol index 9714c9bd..d5b28654 100644 --- a/script/20240206-maptoken-banana/20240206-maptoken-banana-mainchain.s.sol +++ b/script/20240206-maptoken-banana/20240206-maptoken-banana-mainchain.s.sol @@ -1,19 +1,19 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import {console2} from "forge-std/console2.sol"; -import {StdStyle} from "forge-std/StdStyle.sol"; -import {BaseMigration} from "foundry-deployment-kit/BaseMigration.s.sol"; -import {RoninBridgeManager} from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; -import {IMainchainGatewayV3} from "@ronin/contracts/interfaces/IMainchainGatewayV3.sol"; -import {GlobalProposal} from "@ronin/contracts/libraries/GlobalProposal.sol"; -import {Token} from "@ronin/contracts/libraries/Token.sol"; -import {Contract} from "../utils/Contract.sol"; -import {BridgeMigration} from "../BridgeMigration.sol"; -import {Network} from "../utils/Network.sol"; -import {DefaultNetwork} from "foundry-deployment-kit/utils/DefaultNetwork.sol"; -import {Contract} from "../utils/Contract.sol"; -import {IGeneralConfigExtended} from "../IGeneralConfigExtended.sol"; +import { console2 } from "forge-std/console2.sol"; +import { StdStyle } from "forge-std/StdStyle.sol"; +import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; +import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; +import { IMainchainGatewayV3 } from "@ronin/contracts/interfaces/IMainchainGatewayV3.sol"; +import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; +import { Token } from "@ronin/contracts/libraries/Token.sol"; +import { Contract } from "../utils/Contract.sol"; +import { BridgeMigration } from "../BridgeMigration.sol"; +import { Network } from "../utils/Network.sol"; +import { DefaultNetwork } from "foundry-deployment-kit/utils/DefaultNetwork.sol"; +import { Contract } from "../utils/Contract.sol"; +import { IGeneralConfigExtended } from "../IGeneralConfigExtended.sol"; import "./maptoken-banana-configs.s.sol"; import "./maptoken-genkai-configs.s.sol"; @@ -146,7 +146,7 @@ contract Migration__20240206_MapTokenBananaMainchain is console2.log("Nonce:", vm.getNonce(_governor)); vm.broadcast(_governor); - _roninBridgeManager.propose(chainId, expiredTime, address(0), false, targets, values, calldatas, gasAmounts); + _roninBridgeManager.propose(chainId, expiredTime, address(0), targets, values, calldatas, gasAmounts); } } diff --git a/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol b/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol index 2e6ab1dc..f0a2bdb8 100644 --- a/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol +++ b/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol @@ -152,7 +152,7 @@ contract Migration__20240206_MapTokenBananaRoninChain is console2.log("Nonce:", vm.getNonce(_governor)); vm.broadcast(_governor); - _roninBridgeManager.propose(block.chainid, expiredTime, address(0), false, targets, values, calldatas, gasAmounts); + _roninBridgeManager.propose(block.chainid, expiredTime, address(0), targets, values, calldatas, gasAmounts); // ============= LOCAL SIMULATION ================== _cheatWeightOperator(_governor); diff --git a/script/GeneralConfig.sol b/script/GeneralConfig.sol index 3d5de15f..7e2dbfdc 100644 --- a/script/GeneralConfig.sol +++ b/script/GeneralConfig.sol @@ -48,6 +48,7 @@ contract GeneralConfig is BaseGeneralConfig, Utils { _mapContractName(Contract.MainchainGatewayV3); _mapContractName(Contract.MainchainBridgeManager); _mapContractName(Contract.MockERC721); + _mapContractName(Contract.RoninBridgeManagerConstructor); _contractNameMap[Contract.WETH.key()] = "MockWrappedToken"; _contractNameMap[Contract.WRON.key()] = "MockWrappedToken"; diff --git a/script/contracts/RoninBridgeManagerDeploy.s.sol b/script/contracts/RoninBridgeManagerDeploy.s.sol index 6666dc38..951f0745 100644 --- a/script/contracts/RoninBridgeManagerDeploy.s.sol +++ b/script/contracts/RoninBridgeManagerDeploy.s.sol @@ -1,20 +1,22 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; +import { RoninBridgeManagerConstructor } from "@ronin/contracts/ronin/gateway/RoninBridgeManagerConstructor.sol"; import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; import { Contract } from "../utils/Contract.sol"; import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; import { Migration } from "../Migration.s.sol"; - +import { LibProxy } from "foundry-deployment-kit/libraries/LibProxy.sol"; import { RoninGatewayV3Deploy } from "./RoninGatewayV3Deploy.s.sol"; import { BridgeSlashDeploy } from "./BridgeSlashDeploy.s.sol"; contract RoninBridgeManagerDeploy is Migration { + using LibProxy for *; + function _defaultArguments() internal virtual override returns (bytes memory args) { ISharedArgument.BridgeManagerParam memory param = config.sharedArguments().roninBridgeManager; - args = abi.encodeCall( - RoninBridgeManager.initialize, + RoninBridgeManagerConstructor.initialize, ( param.num, param.denom, @@ -32,6 +34,10 @@ contract RoninBridgeManagerDeploy is Migration { } function run() public virtual returns (RoninBridgeManager) { - return RoninBridgeManager(_deployProxy(Contract.RoninBridgeManager.key())); + address payable instance = _deployProxy(Contract.RoninBridgeManagerConstructor.key()); + address logic = _deployLogic(Contract.RoninBridgeManager.key()); + address proxyAdmin = instance.getProxyAdmin(); + _upgradeRaw(proxyAdmin, instance, logic, EMPTY_ARGS); + return RoninBridgeManager(instance); } } diff --git a/script/utils/Contract.sol b/script/utils/Contract.sol index 3442649f..bdaa906e 100644 --- a/script/utils/Contract.sol +++ b/script/utils/Contract.sol @@ -16,6 +16,7 @@ enum Contract { RoninPauseEnforcer, RoninGatewayV3, RoninBridgeManager, + RoninBridgeManagerConstructor, MainchainPauseEnforcer, MainchainGatewayV3, MainchainBridgeManager, @@ -42,6 +43,7 @@ function name(Contract contractEnum) pure returns (string memory) { if (contractEnum == Contract.RoninPauseEnforcer) return "PauseEnforcer"; if (contractEnum == Contract.RoninGatewayV3) return "RoninGatewayV3"; if (contractEnum == Contract.RoninBridgeManager) return "RoninBridgeManager"; + if (contractEnum == Contract.RoninBridgeManagerConstructor) return "RoninBridgeManagerConstructor"; if (contractEnum == Contract.MainchainPauseEnforcer) return "PauseEnforcer"; if (contractEnum == Contract.MainchainGatewayV3) return "MainchainGatewayV3"; diff --git a/test/bridge/integration/bridge-manager/proposal-executor/executor.proposeMainchain.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-executor/executor.proposeMainchain.RoninBridgeManager.t.sol index 37b115e6..dd811cf3 100644 --- a/test/bridge/integration/bridge-manager/proposal-executor/executor.proposeMainchain.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/proposal-executor/executor.proposeMainchain.RoninBridgeManager.t.sol @@ -77,6 +77,7 @@ contract ProposalWithExecutor_MainchainProposal_RoninBridgeManager_Test is BaseI // Should the proposal is approved but not executed on Ronin chain function test_proposeMainchain_autoProposal_looseProposal() public { + vm.skip(true); _proposal.executor = address(0); vm.expectEmit(false, true, true, true); @@ -102,6 +103,7 @@ contract ProposalWithExecutor_MainchainProposal_RoninBridgeManager_Test is BaseI // Should the non-auto proposal be execute by the specified executor function test_proposeMainchain_executorProposal_looseProposal_WhenAllInternalCallsPass() public { + vm.skip(true); _proposal.executor = _param.roninBridgeManager.governors[0]; _proposal.gasAmounts[1] = 1_000_000; // Set gas for the second call becomes success diff --git a/test/bridge/integration/bridge-manager/proposal-loose/proposeCurrent.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-loose/proposeCurrent.RoninBridgeManager.t.sol index daa8f3d8..c994d91e 100644 --- a/test/bridge/integration/bridge-manager/proposal-loose/proposeCurrent.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/proposal-loose/proposeCurrent.RoninBridgeManager.t.sol @@ -111,6 +111,7 @@ contract LooseProposal_CurrentNetworkProposal_RoninBridgeManager_Test is BaseInt // Should the loose proposal passes when containing one failed internal call function test_looseProposal_WhenContainsOneInternalCallFailed() external { + vm.skip(true); _proposal.gasAmounts[1] = 1_000; // Set gas for the second call becomes failed vm.expectEmit(false, true, true, true); diff --git a/test/bridge/integration/bridge-manager/proposal-loose/proposeGlobal.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-loose/proposeGlobal.RoninBridgeManager.t.sol index 1ab43f14..c067afb1 100644 --- a/test/bridge/integration/bridge-manager/proposal-loose/proposeGlobal.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/proposal-loose/proposeGlobal.RoninBridgeManager.t.sol @@ -108,6 +108,7 @@ contract LooseProposal_GlobalProposal_RoninBridgeManager_Test is BaseIntegration // Should the loose proposal passes when containing one failed internal call function test_looseProposal_globalProposal_RoninSide_WhenContainsOneInternalCallFailed() external { + vm.skip(true); _globalProposal.gasAmounts[1] = 1_000; // Set gas for the second call becomes failed vm.expectEmit(false, true, true, true); diff --git a/test/bridge/integration/bridge-manager/proposal-loose/relayGlobal.MainchainBridgeManager.t.sol b/test/bridge/integration/bridge-manager/proposal-loose/relayGlobal.MainchainBridgeManager.t.sol index f842451f..cf1c01c6 100644 --- a/test/bridge/integration/bridge-manager/proposal-loose/relayGlobal.MainchainBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/proposal-loose/relayGlobal.MainchainBridgeManager.t.sol @@ -112,6 +112,7 @@ contract LooseProposal_GlobalProposal_MainchainBridgeManager_Test is BaseIntegra // Should the loose proposal passes when containing one failed internal call function test_looseProposal_globalProposal_MainchainSide_WhenContainsOneInternalCallFailed() external { + vm.skip(true); _globalProposal.gasAmounts[1] = 1_000; // Set gas for the second call becomes failed vm.expectEmit(false, false, false, false); diff --git a/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol index 8398e397..07b5fe50 100644 --- a/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol @@ -41,52 +41,53 @@ contract UpdateOperator_RoninBridgeManager_Test is BaseIntegration_Test { } function test_updateOperator_and_wrapUpEpoch() public { - // Disable test due to not supporting update operator vm.skip(true); - console.log("=============== Test Update Operator ==========="); + // // Disable test due to not supporting update operator + // vm.skip(true); + // console.log("=============== Test Update Operator ==========="); - _depositFor(); - _moveToEndPeriodAndWrapUpEpoch(); + // _depositFor(); + // _moveToEndPeriodAndWrapUpEpoch(); - console.log("=============== First 50 Receipts ==========="); - // _bulkDepositFor(first50Receipts); + // console.log("=============== First 50 Receipts ==========="); + // // _bulkDepositFor(first50Receipts); - for (uint i; i < 50; i++) { - _depositFor(); - } + // for (uint i; i < 50; i++) { + // _depositFor(); + // } - console.log("=============== Update bridge operator ==========="); - _updateBridgeOperator(); + // console.log("=============== Update bridge operator ==========="); + // _updateBridgeOperator(); - console.log("=============== Second 50 Receipts ==========="); - // _bulkDepositFor(second50Receipts); - for (uint i; i < 50; i++) { - _depositFor(); - } + // console.log("=============== Second 50 Receipts ==========="); + // // _bulkDepositFor(second50Receipts); + // for (uint i; i < 50; i++) { + // _depositFor(); + // } - _wrapUpEpoch(); - _wrapUpEpoch(); + // _wrapUpEpoch(); + // _wrapUpEpoch(); - _moveToEndPeriodAndWrapUpEpoch(); + // _moveToEndPeriodAndWrapUpEpoch(); - console.log("=============== Check slash and reward behavior ==========="); - _depositFor(); + // console.log("=============== Check slash and reward behavior ==========="); + // _depositFor(); - logBridgeTracking(); - logBridgeSlash(); + // logBridgeTracking(); + // logBridgeSlash(); } - function _updateBridgeOperator() internal { - vm.prank(_param.roninBridgeManager.governors[0]); - address previousOperator = _param.roninBridgeManager.bridgeOperators[0]; - _roninBridgeManager.updateBridgeOperator(previousOperator, _newBridgeOperator); - _param.roninBridgeManager.bridgeOperators[0] = _newBridgeOperator; - - console.log( - "Update operator: ", - string(abi.encodePacked(vm.toString(previousOperator), " => ", vm.toString(_newBridgeOperator))) - ); - } + // function _updateBridgeOperator() internal { + // vm.prank(_param.roninBridgeManager.governors[0]); + // address previousOperator = _param.roninBridgeManager.bridgeOperators[0]; + // _roninBridgeManager.updateBridgeOperator(previousOperator, _newBridgeOperator); + // _param.roninBridgeManager.bridgeOperators[0] = _newBridgeOperator; + + // console.log( + // "Update operator: ", + // string(abi.encodePacked(vm.toString(previousOperator), " => ", vm.toString(_newBridgeOperator))) + // ); + // } function _depositFor() internal { console.log(">> depositFor ...."); diff --git a/test/bridge/unit/concrete/bridge-manager/update/update.t.sol b/test/bridge/unit/concrete/bridge-manager/update/update.t.sol index e5c62c6c..bff731f3 100644 --- a/test/bridge/unit/concrete/bridge-manager/update/update.t.sol +++ b/test/bridge/unit/concrete/bridge-manager/update/update.t.sol @@ -22,89 +22,90 @@ contract Update_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { } function test_RevertWhen_NotGovernorOfTheChangingBridgeOperator() external { - address newOperator = _generateBridgeOperatorAddressToUpdate(); + vm.skip(true); + // address newOperator = _generateBridgeOperatorAddressToUpdate(); - // Make the caller not the governor. - changePrank({ msgSender: _bridgeOperators[0] }); + // // Make the caller not the governor. + // changePrank({ msgSender: _bridgeOperators[0] }); - // Run the test. - vm.expectRevert(abi.encodeWithSelector(ErrUnauthorized.selector, IBridgeManager.updateBridgeOperator.selector, RoleAccess.GOVERNOR)); - _bridgeManager.updateBridgeOperator(_bridgeOperators[0], newOperator); + // // Run the test. + // vm.expectRevert(abi.encodeWithSelector(ErrUnauthorized.selector, IBridgeManager.updateBridgeOperator.selector, RoleAccess.GOVERNOR)); + // _bridgeManager.updateBridgeOperator(_bridgeOperators[0], newOperator); } function test_RevertWhen_NewOperatorAddressIsZero() external { vm.skip(true); - address newOperator = address(0); + // address newOperator = address(0); - // Run the test. - vm.expectRevert(abi.encodeWithSelector(ErrZeroAddress.selector, IBridgeManager.updateBridgeOperator.selector)); - _bridgeManager.updateBridgeOperator(_bridgeOperators[0], newOperator); + // // Run the test. + // vm.expectRevert(abi.encodeWithSelector(ErrZeroAddress.selector, IBridgeManager.updateBridgeOperator.selector)); + // _bridgeManager.updateBridgeOperator(_bridgeOperators[0], newOperator); } function test_RevertWhen_NewOperatorIsExistedInCurrentOperatorList() external { vm.skip(true); - address newOperator = _bridgeOperators[2]; + // address newOperator = _bridgeOperators[2]; - // Run the test. - vm.expectRevert(abi.encodeWithSelector(ErrBridgeOperatorAlreadyExisted.selector, newOperator)); - _bridgeManager.updateBridgeOperator(_bridgeOperators[0], newOperator); + // // Run the test. + // vm.expectRevert(abi.encodeWithSelector(ErrBridgeOperatorAlreadyExisted.selector, newOperator)); + // _bridgeManager.updateBridgeOperator(_bridgeOperators[0], newOperator); } function test_RevertWhen_NewOperatorIsExistedInCurrentGovernorList() external { vm.skip(true); - address newOperator = _governors[2]; + // address newOperator = _governors[2]; - // Run the test. - vm.expectRevert(abi.encodeWithSelector(ErrZeroAddress.selector, IBridgeManager.updateBridgeOperator.selector)); // TODO: fix error sig here - _bridgeManager.updateBridgeOperator(_bridgeOperators[0], newOperator); + // // Run the test. + // vm.expectRevert(abi.encodeWithSelector(ErrZeroAddress.selector, IBridgeManager.updateBridgeOperator.selector)); // TODO: fix error sig here + // _bridgeManager.updateBridgeOperator(_bridgeOperators[0], newOperator); } function test_RevertWhen_NewOperatorIsTheSameWithPreviousOperator() external { vm.skip(true); - address prevOperator = _bridgeManager.getOperatorOf(_caller); - address newOperator = prevOperator; + // address prevOperator = _bridgeManager.getOperatorOf(_caller); + // address newOperator = prevOperator; - // Run the test. - vm.expectRevert(abi.encodeWithSelector(ErrBridgeOperatorAlreadyExisted.selector, prevOperator)); - _bridgeManager.updateBridgeOperator(_bridgeOperators[0], newOperator); + // // Run the test. + // vm.expectRevert(abi.encodeWithSelector(ErrBridgeOperatorAlreadyExisted.selector, prevOperator)); + // _bridgeManager.updateBridgeOperator(_bridgeOperators[0], newOperator); } function test_UpdateOperators_NewOperatorIsValid() external { vm.skip(true); - // Get before test state. - (address[] memory beforeBridgeOperators, address[] memory beforeGovernors, uint96[] memory beforeVoteWeights) = _getBridgeMembers(); + // // Get before test state. + // (address[] memory beforeBridgeOperators, address[] memory beforeGovernors, uint96[] memory beforeVoteWeights) = _getBridgeMembers(); - // Prepare data. - address prevOperator = _bridgeManager.getOperatorOf(_caller); - address newOperator = _generateBridgeOperatorAddressToUpdate(); + // // Prepare data. + // address prevOperator = _bridgeManager.getOperatorOf(_caller); + // address newOperator = _generateBridgeOperatorAddressToUpdate(); - // Run the test + // // Run the test - // Should emit the event - vm.expectEmit({ emitter: address(_bridgeManager) }); - emit BridgeOperatorUpdated(_caller, prevOperator, newOperator); + // // Should emit the event + // vm.expectEmit({ emitter: address(_bridgeManager) }); + // emit BridgeOperatorUpdated(_caller, prevOperator, newOperator); - _bridgeManager.updateBridgeOperator(_bridgeOperators[0], newOperator); + // _bridgeManager.updateBridgeOperator(_bridgeOperators[0], newOperator); - // Get after test state - (address[] memory afterBridgeOperators, address[] memory afterGovernors, uint96[] memory afterVoteWeights) = _getBridgeMembers(); + // // Get after test state + // (address[] memory afterBridgeOperators, address[] memory afterGovernors, uint96[] memory afterVoteWeights) = _getBridgeMembers(); - // it should modify the current operators list - beforeBridgeOperators[0] = newOperator; - _assertBridgeMembers({ - comparingOperators: beforeBridgeOperators, - comparingGovernors: beforeGovernors, - comparingWeights: beforeVoteWeights, - expectingOperators: afterBridgeOperators, - expectingGovernors: afterGovernors, - expectingWeights: afterVoteWeights - }); + // // it should modify the current operators list + // beforeBridgeOperators[0] = newOperator; + // _assertBridgeMembers({ + // comparingOperators: beforeBridgeOperators, + // comparingGovernors: beforeGovernors, + // comparingWeights: beforeVoteWeights, + // expectingOperators: afterBridgeOperators, + // expectingGovernors: afterGovernors, + // expectingWeights: afterVoteWeights + // }); - // it should remove the old operator - assertEq(_bridgeManager.getOperatorOf(_caller), newOperator); - assertEq(_bridgeManager.getGovernorOf(newOperator), _caller); + // // it should remove the old operator + // assertEq(_bridgeManager.getOperatorOf(_caller), newOperator); + // assertEq(_bridgeManager.getGovernorOf(newOperator), _caller); - vm.expectRevert(abi.encodeWithSelector(IBridgeManager.ErrOperatorNotFound.selector, prevOperator)); - _bridgeManager.getGovernorOf(prevOperator); + // vm.expectRevert(abi.encodeWithSelector(IBridgeManager.ErrOperatorNotFound.selector, prevOperator)); + // _bridgeManager.getGovernorOf(prevOperator); } } diff --git a/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol b/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol index ea79881f..20ecd00c 100644 --- a/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol +++ b/test/bridge/unit/fuzz/bridge-manager/BridgeManagerCRUD.t.sol @@ -39,19 +39,20 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { uint96[] private _initWeights; function testFail_MaliciousUpdateBridgeOperator() external { - (address[] memory bridgeOperators, address[] memory governors, ) = - getValidInputs(DEFAULT_R1, DEFAULT_R2, DEFAULT_R3, DEFAULT_NUM_BRIDGE_OPERATORS); + vm.skip(true); + // (address[] memory bridgeOperators, address[] memory governors, ) = + // getValidInputs(DEFAULT_R1, DEFAULT_R2, DEFAULT_R3, DEFAULT_NUM_BRIDGE_OPERATORS); - vm.startPrank(governors[0]); - address lastOperator; + // vm.startPrank(governors[0]); + // address lastOperator; - for (uint256 i = 1; i < bridgeOperators.length; ++i) { - lastOperator = bridgeOperators[i]; - MockBridgeManager(_bridgeManager).updateBridgeOperator(bridgeOperators[0], lastOperator); - vm.expectRevert(abi.encodeWithSelector(ErrBridgeOperatorUpdateFailed.selector, lastOperator)); - } + // for (uint256 i = 1; i < bridgeOperators.length; ++i) { + // lastOperator = bridgeOperators[i]; + // MockBridgeManager(_bridgeManager).updateBridgeOperator(bridgeOperators[0], lastOperator); + // vm.expectRevert(abi.encodeWithSelector(ErrBridgeOperatorUpdateFailed.selector, lastOperator)); + // } - vm.stopPrank(); + // vm.stopPrank(); } /** @@ -173,28 +174,28 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { */ function testFuzz_UpdateBridgeOperator_CallerIsGovernor(uint256 r1, uint256 r2, uint256 r3, uint16 numBridgeOperators) external virtual { vm.skip(true); - (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = - getValidAndNonExistingInputs(_bridgeManager, r1, r2, r3, numBridgeOperators); - IBridgeManager bridgeManager = _addBridgeOperators(_bridgeManager, _bridgeManager, voteWeights, governors, bridgeOperators); + // (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = + // getValidAndNonExistingInputs(_bridgeManager, r1, r2, r3, numBridgeOperators); + // IBridgeManager bridgeManager = _addBridgeOperators(_bridgeManager, _bridgeManager, voteWeights, governors, bridgeOperators); + + // uint256 randomSeed = _randomize(_triShuffle(r1, r2, r3), 0, voteWeights.length - 1); + // address randomGovernor = governors[randomSeed]; + // address correspondingOperator = bridgeOperators[randomSeed]; + // address newBridgeOperator = makeAddr("NEW_BRIDGE_OPERATOR"); + // vm.deal(newBridgeOperator, 1 ether); + + // vm.prank(randomGovernor); + // vm.expectEmit(_bridgeManager); + // bool[] memory statuses = new bool[](1); + // statuses[0] = true; + // emit BridgeOperatorUpdated(randomGovernor, bridgeOperators[randomSeed], newBridgeOperator); + // bridgeManager.updateBridgeOperator(correspondingOperator, newBridgeOperator); + + // // swap and pop + // bridgeOperators[randomSeed] = bridgeOperators[bridgeOperators.length - 1]; + // bridgeOperators[bridgeOperators.length - 1] = newBridgeOperator; - uint256 randomSeed = _randomize(_triShuffle(r1, r2, r3), 0, voteWeights.length - 1); - address randomGovernor = governors[randomSeed]; - address correspondingOperator = bridgeOperators[randomSeed]; - address newBridgeOperator = makeAddr("NEW_BRIDGE_OPERATOR"); - vm.deal(newBridgeOperator, 1 ether); - - vm.prank(randomGovernor); - vm.expectEmit(_bridgeManager); - bool[] memory statuses = new bool[](1); - statuses[0] = true; - emit BridgeOperatorUpdated(randomGovernor, bridgeOperators[randomSeed], newBridgeOperator); - bridgeManager.updateBridgeOperator(correspondingOperator, newBridgeOperator); - - // swap and pop - bridgeOperators[randomSeed] = bridgeOperators[bridgeOperators.length - 1]; - bridgeOperators[bridgeOperators.length - 1] = newBridgeOperator; - - _invariantTest(bridgeManager, voteWeights, governors, bridgeOperators); + // _invariantTest(bridgeManager, voteWeights, governors, bridgeOperators); } /** @@ -202,23 +203,23 @@ contract BridgeManagerCRUDTest is BridgeManagerUtils { */ function test_UpdateBridgeOperator_CallerIsNotGovernor(uint256 r1, uint256 r2, uint256 r3, uint16 numBridgeOperators) external virtual { vm.skip(true); - (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = - getValidAndNonExistingInputs(_bridgeManager, r1, r2, r3, numBridgeOperators); - IBridgeManager bridgeManager = _addBridgeOperators(_bridgeManager, _bridgeManager, voteWeights, governors, bridgeOperators); - - address unauthorizedCaller = makeAddr("UNAUTHORIZED_CALLER"); - for (uint256 i; i < governors.length;) { - vm.assume(unauthorizedCaller != governors[i]); - unchecked { - ++i; - } - } - address newBridgeOperator = makeAddr("NEW_BRIDGE_OPERATOR"); - - vm.prank(unauthorizedCaller); - bridgeManager.updateBridgeOperator(bridgeOperators[0], newBridgeOperator); - - vm.expectRevert(abi.encodeWithSelector(ErrUnauthorized.selector, IBridgeManager.updateBridgeOperator.selector, RoleAccess.GOVERNOR)); + // (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = + // getValidAndNonExistingInputs(_bridgeManager, r1, r2, r3, numBridgeOperators); + // IBridgeManager bridgeManager = _addBridgeOperators(_bridgeManager, _bridgeManager, voteWeights, governors, bridgeOperators); + + // address unauthorizedCaller = makeAddr("UNAUTHORIZED_CALLER"); + // for (uint256 i; i < governors.length;) { + // vm.assume(unauthorizedCaller != governors[i]); + // unchecked { + // ++i; + // } + // } + // address newBridgeOperator = makeAddr("NEW_BRIDGE_OPERATOR"); + + // vm.prank(unauthorizedCaller); + // bridgeManager.updateBridgeOperator(bridgeOperators[0], newBridgeOperator); + + // vm.expectRevert(abi.encodeWithSelector(ErrUnauthorized.selector, IBridgeManager.updateBridgeOperator.selector, RoleAccess.GOVERNOR)); } function _setUp() internal virtual { From a0e66069f4d2505d9a5547a4cac81127b7c272f8 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 8 Apr 2024 13:39:43 +0700 Subject: [PATCH 127/180] fix: typehash --- src/libraries/GlobalProposal.sol | 2 +- src/libraries/Proposal.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/GlobalProposal.sol b/src/libraries/GlobalProposal.sol index 823c8df7..fafab22d 100644 --- a/src/libraries/GlobalProposal.sol +++ b/src/libraries/GlobalProposal.sol @@ -29,7 +29,7 @@ library GlobalProposal { } // keccak256("GlobalProposalDetail(uint256 nonce,uint256 expiryTimestamp,address executor,uint8[] targetOptions,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)"); - bytes32 internal constant TYPE_HASH = 0x8fdb3bc7211cb44f39a2cae84127672c4570a00720dfbf2bb58285070faa28da; + bytes32 internal constant TYPE_HASH = 0xde480f0c53a3651c08fbab1dffbc45fe574f31188827fe52cb9035da9fe57e4a; /** * @dev Returns struct hash of the proposal. diff --git a/src/libraries/Proposal.sol b/src/libraries/Proposal.sol index b6aca9d8..e4a58469 100644 --- a/src/libraries/Proposal.sol +++ b/src/libraries/Proposal.sol @@ -36,7 +36,7 @@ library Proposal { } // keccak256("ProposalDetail(uint256 nonce,uint256 chainId,uint256 expiryTimestamp,address executor,address[] targets,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)"); - bytes32 internal constant TYPE_HASH = 0x98e2bc443e89d620038081eb862bc4dd7a26e2eba7a2a87201642f9419340a57; + bytes32 internal constant TYPE_HASH = 0x1b59eeec7c321899dc1e7a5b3d876c9a445dffc6d2f96ba842d7489908fdee12; /** * @dev Validates the proposal. From 04ea5251f49aa4c29fa5ecce8c2fab4b2ec1159d Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 8 Apr 2024 13:39:53 +0700 Subject: [PATCH 128/180] chore: add chmod --- upload-sig.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 upload-sig.sh diff --git a/upload-sig.sh b/upload-sig.sh old mode 100644 new mode 100755 From 631700551beeda49ef2392bc9002d475dceaffe3 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 8 Apr 2024 14:01:20 +0700 Subject: [PATCH 129/180] chore: enable literal content --- foundry.toml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/foundry.toml b/foundry.toml index ce1b284d..4c96ae7a 100644 --- a/foundry.toml +++ b/foundry.toml @@ -5,10 +5,7 @@ optimizer = true optimizer_runs = 200 ffi = true -libs = [ - 'lib', - 'node_modules/hardhat', -] +libs = ['lib', 'node_modules/hardhat'] # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options @@ -17,6 +14,7 @@ extra_output = ["devdoc", "userdoc", "storagelayout"] fs_permissions = [{ access = "read-write", path = "./" }] evm_version = 'istanbul' verbosity = 4 +use_literal_content = true [profile.ronin] evm_version = 'istanbul' From d76980948f4aeb1ec9b94418b692c3a2eb765968 Mon Sep 17 00:00:00 2001 From: TuDo1403 Date: Wed, 3 Apr 2024 11:25:58 +0700 Subject: [PATCH 130/180] forge install: foundry-deployment-kit v0.2.0 --- lib/foundry-deployment-kit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/foundry-deployment-kit b/lib/foundry-deployment-kit index 8c728424..2f48f7db 160000 --- a/lib/foundry-deployment-kit +++ b/lib/foundry-deployment-kit @@ -1 +1 @@ -Subproject commit 8c728424858f8c8358f2e0f9374a6ea581f46486 +Subproject commit 2f48f7dbed4b99688ecd2b42109e3400d296b3a3 From 935acb3684ae1dbedd59492a4bf5801c180a30f0 Mon Sep 17 00:00:00 2001 From: TuDo1403 Date: Thu, 4 Apr 2024 10:10:23 +0700 Subject: [PATCH 131/180] script: add post check --- foundry.toml | 2 + lib/forge-std | 2 +- remappings.txt | 2 +- .../20231218-maptoken-mainchain.s.sol | 42 +-- .../20231218-maptoken-roninchain.s.sol | 19 +- .../20240115-maptoken-mainchain.s.sol | 29 +- .../20240115-maptoken-roninchain.s.sol | 35 ++- .../20240131-maptoken-pixel-mainchain.s.sol | 32 +- .../20240131-maptoken-pixel-roninchain.s.sol | 24 +- .../maptoken-pixel-configs.s.sol | 2 +- .../update-axiechat-config.s.sol | 16 +- .../20240206-maptoken-banana-mainchain.s.sol | 33 +- .../20240206-maptoken-banana-roninchain.s.sol | 67 ++-- .../changeGV-stablenode-config.s.sol | 2 +- script/BaseMigrationV2.sol | 47 --- script/BridgeMigration.sol | 142 --------- script/GeneralConfig.sol | 40 ++- script/GeneralConfigExtended.sol | 53 ---- script/Migration.s.sol | 169 ++++++++-- script/PostChecker.sol | 37 +++ .../MainchainBridgeManagerDeploy.s.sol | 20 -- .../MainchainWethUnwrapperDeploy.s.sol | 7 +- .../deploy-v0.3.1/01_Deploy_RoninBridge.s.sol | 104 +++++++ .../02_Deploy_MainchainBridge.s.sol | 76 +++++ script/deploy-v0.3.1/Deploy.v0.3.1.s.sol | 46 +++ .../IGeneralConfigExtended.sol | 7 +- script/interfaces/ISharedArgument.sol | 4 +- script/libraries/LibArray.sol | 23 +- script/post-check/BasePostCheck.s.sol | 35 +++ .../BridgeManager.post_check.tree | 66 ++++ .../PostCheck_BridgeManager.s.sol | 18 ++ ...ridgeManager_CRUD_addBridgeOperators.s.sol | 119 +++++++ ...geManager_CRUD_removeBridgeOperators.s.sol | 81 +++++ .../PostCheck_BridgeManager_Proposal.s.sol | 97 ++++++ script/shared/libraries/LibArray.sol | 293 ++++++++++++++++++ .../shared/libraries/LibCompanionNetwork.sol | 36 +++ script/shared/libraries/LibProposal.sol | 269 ++++++++++++++++ script/shared/libraries/LibRandom.sol | 49 +++ script/shared/libraries/LibTimeWarper.sol | 41 +++ script/utils/Contract.sol | 2 +- script/utils/Network.sol | 11 +- src/extensions/GatewayV3.sol | 10 +- src/extensions/MinimumWithdrawal.sol | 2 +- src/extensions/RONTransferHelper.sol | 10 +- .../TransparentUpgradeableProxyV2.sol | 14 +- src/extensions/WithdrawalLimitation.sol | 34 +- .../BridgeTrackingHelper.sol | 6 +- src/interfaces/IBridgeAdminProposal.sol | 5 +- src/interfaces/IMainchainGatewayV3.sol | 11 +- src/interfaces/IQuorum.sol | 13 +- src/interfaces/IRoninGatewayV3.sol | 11 +- .../bridge/IBridgeManagerCallback.sol | 11 +- src/interfaces/bridge/IBridgeSlash.sol | 8 +- src/interfaces/bridge/IBridgeTracking.sol | 5 +- .../validator/ICandidateManager.sol | 7 +- .../validator/ICoinbaseExecution.sol | 40 +-- src/interfaces/validator/IEmergencyExit.sol | 13 +- .../validator/IRoninValidatorSet.sol | 8 +- .../validator/info-fragments/IJailingInfo.sol | 9 +- src/libraries/BridgeOperatorsBallot.sol | 5 +- src/libraries/GlobalProposal.sol | 15 +- src/libraries/Token.sol | 34 +- src/mocks/ronin/MockBridgeReward.sol | 23 +- src/mocks/ronin/MockBridgeSlash.sol | 6 +- .../ronin/MockRoninGatewayV3Extended.sol | 16 +- src/mocks/types/MockTUint256Slot.sol | 3 +- src/ronin/gateway/BridgeSlash.sol | 40 +-- src/ronin/gateway/BridgeTracking.sol | 5 +- src/ronin/gateway/PauseEnforcer.sol | 2 +- src/ronin/gateway/RoninGatewayV3.sol | 53 +--- src/utils/ContractType.sol | 48 ++- src/utils/IdentityGuard.sol | 4 +- src/utils/RoleAccess.sol | 33 +- test/bridge/integration/BaseIntegration.t.sol | 4 +- ...IsApprovedInLastEpoch.BridgeTracking.t.sol | 6 +- ...otApprovedInLastEpoch.BridgeTracking.t.sol | 15 +- ...l.MainchainGatewayV3.erc20.benchmark.t.sol | 2 +- .../emergencyAction.PauseEnforcer.t.sol | 3 +- .../set-config/setConfig.PauseEnforcer.t.sol | 3 +- .../depositVote.RoninGatewayV3.t.sol | 1 - .../concrete/bridge-manager/constructor.t.sol | 15 +- .../fuzz/bridge-manager/BridgeReward.t.sol | 50 +-- .../fuzz/bridge-manager/BridgeSlash.t.sol | 96 ++---- test/helpers/LibArrayUtils.t.sol | 8 +- test/helpers/Randomizer.t.sol | 11 +- test/mocks/MockBridgeSlash.sol | 22 +- test/mocks/MockBridgeTracking.sol | 18 +- 87 files changed, 1970 insertions(+), 987 deletions(-) delete mode 100644 script/BaseMigrationV2.sol delete mode 100644 script/BridgeMigration.sol delete mode 100644 script/GeneralConfigExtended.sol create mode 100644 script/PostChecker.sol create mode 100644 script/deploy-v0.3.1/01_Deploy_RoninBridge.s.sol create mode 100644 script/deploy-v0.3.1/02_Deploy_MainchainBridge.s.sol create mode 100644 script/deploy-v0.3.1/Deploy.v0.3.1.s.sol rename script/{ => interfaces}/IGeneralConfigExtended.sol (62%) create mode 100644 script/post-check/BasePostCheck.s.sol create mode 100644 script/post-check/bridge-manager/BridgeManager.post_check.tree create mode 100644 script/post-check/bridge-manager/PostCheck_BridgeManager.s.sol create mode 100644 script/post-check/bridge-manager/crud/PostCheck_BridgeManager_CRUD_addBridgeOperators.s.sol create mode 100644 script/post-check/bridge-manager/crud/PostCheck_BridgeManager_CRUD_removeBridgeOperators.s.sol create mode 100644 script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol create mode 100644 script/shared/libraries/LibArray.sol create mode 100644 script/shared/libraries/LibCompanionNetwork.sol create mode 100644 script/shared/libraries/LibProposal.sol create mode 100644 script/shared/libraries/LibRandom.sol create mode 100644 script/shared/libraries/LibTimeWarper.sol diff --git a/foundry.toml b/foundry.toml index 4c96ae7a..b8e519be 100644 --- a/foundry.toml +++ b/foundry.toml @@ -55,7 +55,9 @@ runs = 1_000 runs = 1_000 [rpc_endpoints] +localhost = "http://localhost:8545" ethereum = "https://eth.llamarpc.com" +sepolia = "https://sepolia.infura.io/v3/${INFURA_API_KEY}" goerli = "https://ethereum-goerli.publicnode.com" ronin-mainnet = "https://api-partner.roninchain.com/rpc" ronin-testnet = "https://saigon-archive.roninchain.com/rpc" diff --git a/lib/forge-std b/lib/forge-std index 4d9985c9..e4aef94c 160000 --- a/lib/forge-std +++ b/lib/forge-std @@ -1 +1 @@ -Subproject commit 4d9985c9fb046e5c8572bb173662109aae09d7de +Subproject commit e4aef94c1768803a16fe19f7ce8b65defd027cfd diff --git a/remappings.txt b/remappings.txt index 9b4fbfd9..7caef984 100644 --- a/remappings.txt +++ b/remappings.txt @@ -8,4 +8,4 @@ hardhat/=node_modules/hardhat/ @prb/test/=lib/prb-test/src/ @prb/math/=lib/prb-math/ solady/=lib/solady/src/ -foundry-deployment-kit/=lib/foundry-deployment-kit/script/ +@fdk/=lib/foundry-deployment-kit/script/ diff --git a/script/20231218-maptoken/20231218-maptoken-mainchain.s.sol b/script/20231218-maptoken/20231218-maptoken-mainchain.s.sol index ac16b2e6..c6d92467 100644 --- a/script/20231218-maptoken/20231218-maptoken-mainchain.s.sol +++ b/script/20231218-maptoken/20231218-maptoken-mainchain.s.sol @@ -3,18 +3,23 @@ pragma solidity ^0.8.19; import { console2 } from "forge-std/console2.sol"; import { StdStyle } from "forge-std/StdStyle.sol"; -import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; import { IMainchainGatewayV3 } from "@ronin/contracts/interfaces/IMainchainGatewayV3.sol"; import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; import { Token } from "@ronin/contracts/libraries/Token.sol"; import { Contract } from "../utils/Contract.sol"; -import { BridgeMigration } from "../BridgeMigration.sol"; -import { Network } from "../utils/Network.sol"; +import { Migration } from "../Migration.s.sol"; +import { TNetwork, Network } from "../utils/Network.sol"; import { Contract } from "../utils/Contract.sol"; -import { IGeneralConfigExtended } from "../IGeneralConfigExtended.sol"; +import { LibArray } from "script/shared/libraries/LibArray.sol"; +import { LibProposal } from "script/shared/libraries/LibProposal.sol"; +import { LibCompanionNetwork } from "script/shared/libraries/LibCompanionNetwork.sol"; + +contract Migration__20231215_MapTokenMainchain is Migration { + using LibArray for *; + using LibProposal for *; + using LibCompanionNetwork for *; -contract Migration__20231215_MapTokenMainchain is BridgeMigration { RoninBridgeManager internal _roninBridgeManager; address constant _aggRoninToken = address(0x294311a8C37F0744F99EB152c419D4D3D6FEC1C7); address constant _aggMainchainToken = address(0xFB0489e9753B045DdB35e39c6B0Cc02EC6b99AC5); @@ -30,8 +35,8 @@ contract Migration__20231215_MapTokenMainchain is BridgeMigration { function setUp() public override { super.setUp(); - _roninBridgeManager = RoninBridgeManager(_config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); - _mainchainGatewayV3 = _config.getAddress(_config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).key(), Contract.MainchainGatewayV3.key()); + _roninBridgeManager = RoninBridgeManager(loadContract(Contract.RoninBridgeManager.key())); + _mainchainGatewayV3 = config.getAddress(network().companionNetwork(), Contract.MainchainGatewayV3.key()); } function run() public { @@ -66,20 +71,21 @@ contract Migration__20231215_MapTokenMainchain is BridgeMigration { bytes memory proxyData = abi.encodeWithSignature("functionDelegateCall(bytes)", innerData); uint256 expiredTime = block.timestamp + 10 days; - address[] memory targets = new address[](1); - targets[0] = _mainchainGatewayV3; + address[] memory targets = _mainchainGatewayV3.toSingletonArray(); uint256[] memory values = new uint256[](1); - values[0] = 0; - bytes[] memory calldatas = new bytes[](1); - calldatas[0] = proxyData; - uint256[] memory gasAmounts = new uint256[](1); - gasAmounts[0] = 1_000_000; - - _verifyMainchainProposalGasAmount(targets, values, calldatas, gasAmounts); + bytes[] memory calldatas = proxyData.toSingletonArray(); + uint256[] memory gasAmounts = uint256(1_000_000).toSingletonArray(); - uint256 chainId = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); + TNetwork currentNetwork = network(); + TNetwork companionNetwork = config.getCompanionNetwork(currentNetwork); + address companionManager = config.getAddress(companionNetwork, Contract.MainchainBridgeManager.key()); + config.createFork(companionNetwork); + config.switchTo(companionNetwork); + uint256 companionChainId = block.chainid; + LibProposal.verifyProposalGasAmount(companionManager, targets, values, calldatas, gasAmounts); + config.switchTo(currentNetwork); vm.broadcast(sender()); - _roninBridgeManager.propose(chainId, expiredTime, address(0), targets, values, calldatas, gasAmounts); + _roninBridgeManager.propose(companionChainId, expiredTime, targets, values, calldatas, gasAmounts); } } diff --git a/script/20231218-maptoken/20231218-maptoken-roninchain.s.sol b/script/20231218-maptoken/20231218-maptoken-roninchain.s.sol index 9a7d2a2c..7ce9d7b3 100644 --- a/script/20231218-maptoken/20231218-maptoken-roninchain.s.sol +++ b/script/20231218-maptoken/20231218-maptoken-roninchain.s.sol @@ -3,17 +3,20 @@ pragma solidity ^0.8.19; import { console2 } from "forge-std/console2.sol"; import { StdStyle } from "forge-std/StdStyle.sol"; -import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; +import { BaseMigration } from "@fdk/BaseMigration.s.sol"; import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; import { IRoninGatewayV3 } from "@ronin/contracts/interfaces/IRoninGatewayV3.sol"; import { Token } from "@ronin/contracts/libraries/Token.sol"; import { Contract } from "../utils/Contract.sol"; -import { BridgeMigration } from "../BridgeMigration.sol"; +import { TNetwork, Network } from "../utils/Network.sol"; +import { LibProposal } from "script/shared/libraries/LibProposal.sol"; +import { Migration } from "../Migration.s.sol"; import { Network } from "../utils/Network.sol"; import { Contract } from "../utils/Contract.sol"; -import { IGeneralConfigExtended } from "../IGeneralConfigExtended.sol"; -contract Migration__20231215_MapTokenRoninchain is BridgeMigration { +contract Migration__20231215_MapTokenRoninchain is Migration { + using LibProposal for *; + RoninBridgeManager internal _roninBridgeManager; address constant _aggRoninToken = address(0x294311a8C37F0744F99EB152c419D4D3D6FEC1C7); address constant _aggMainchainToken = address(0xFB0489e9753B045DdB35e39c6B0Cc02EC6b99AC5); @@ -21,8 +24,8 @@ contract Migration__20231215_MapTokenRoninchain is BridgeMigration { function setUp() public override { super.setUp(); - _roninBridgeManager = RoninBridgeManager(_config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); - _roninGatewayV3 = _config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); + _roninBridgeManager = RoninBridgeManager(loadContract(Contract.RoninBridgeManager.key())); + _roninGatewayV3 = loadContract(Contract.RoninGatewayV3.key()); } function run() public { @@ -31,7 +34,7 @@ contract Migration__20231215_MapTokenRoninchain is BridgeMigration { address[] memory mainchainTokens = new address[](1); mainchainTokens[0] = _aggMainchainToken; uint256[] memory chainIds = new uint256[](1); - chainIds[0] = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); + chainIds[0] = config.getNetworkData(config.getCompanionNetwork(network())).chainId; Token.Standard[] memory standards = new Token.Standard[](1); standards[0] = Token.Standard.ERC20; @@ -54,7 +57,7 @@ contract Migration__20231215_MapTokenRoninchain is BridgeMigration { uint256[] memory gasAmounts = new uint256[](1); gasAmounts[0] = 1_000_000; - _verifyRoninProposalGasAmount(targets, values, calldatas, gasAmounts); + LibProposal.verifyProposalGasAmount(address(_roninBridgeManager), targets, values, calldatas, gasAmounts); vm.broadcast(sender()); _roninBridgeManager.propose(block.chainid, expiredTime, address(0), targets, values, calldatas, gasAmounts); diff --git a/script/20240115-mappixeltoken/20240115-maptoken-mainchain.s.sol b/script/20240115-mappixeltoken/20240115-maptoken-mainchain.s.sol index 18cde061..fa9dc042 100644 --- a/script/20240115-mappixeltoken/20240115-maptoken-mainchain.s.sol +++ b/script/20240115-mappixeltoken/20240115-maptoken-mainchain.s.sol @@ -3,19 +3,18 @@ pragma solidity ^0.8.19; import { console2 } from "forge-std/console2.sol"; import { StdStyle } from "forge-std/StdStyle.sol"; -import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; import { IMainchainGatewayV3 } from "@ronin/contracts/interfaces/IMainchainGatewayV3.sol"; import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; import { Token } from "@ronin/contracts/libraries/Token.sol"; import { Contract } from "../utils/Contract.sol"; -import { BridgeMigration } from "../BridgeMigration.sol"; -import { Network } from "../utils/Network.sol"; +import { Migration } from "../Migration.s.sol"; +import { LibProposal } from "script/shared/libraries/LibProposal.sol"; +import { TNetwork, Network } from "../utils/Network.sol"; import { Contract } from "../utils/Contract.sol"; -import { IGeneralConfigExtended } from "../IGeneralConfigExtended.sol"; -contract Migration__MapTokenMainchain is BridgeMigration { +contract Migration__MapTokenMainchain is Migration { RoninBridgeManager internal _roninBridgeManager; address constant _pixelRoninToken = address(0x8b50c162494567B3c8B7F00F6031341861c8dEeD); @@ -42,10 +41,9 @@ contract Migration__MapTokenMainchain is BridgeMigration { function setUp() public override { super.setUp(); - _roninBridgeManager = RoninBridgeManager(_config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); - _mainchainGatewayV3 = _config.getAddress(_config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).key(), Contract.MainchainGatewayV3.key()); - _mainchainBridgeManager = - _config.getAddress(_config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).key(), Contract.MainchainBridgeManager.key()); + _roninBridgeManager = RoninBridgeManager(config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); + _mainchainGatewayV3 = config.getAddress(config.getCompanionNetwork(network()), Contract.MainchainGatewayV3.key()); + _mainchainBridgeManager = config.getAddress(config.getCompanionNetwork(network()), Contract.MainchainBridgeManager.key()); } function _mapFarmlandToken() internal pure returns (bytes memory) { @@ -147,11 +145,16 @@ contract Migration__MapTokenMainchain is BridgeMigration { calldatas[3] = _addAxieChatGovernorAddress(); gasAmounts[3] = 1_000_000; - _verifyMainchainProposalGasAmount(targets, values, calldatas, gasAmounts); - - uint256 chainId = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); + TNetwork currentNetwork = network(); + TNetwork companionNetwork = config.getCompanionNetwork(currentNetwork); + address companionManager = config.getAddress(companionNetwork, Contract.MainchainBridgeManager.key()); + config.createFork(companionNetwork); + config.switchTo(companionNetwork); + uint256 companionChainId = block.chainid; + LibProposal.verifyProposalGasAmount(companionManager, targets, values, calldatas, gasAmounts); + config.switchTo(currentNetwork); vm.broadcast(sender()); - _roninBridgeManager.propose(chainId, expiredTime, address(0), targets, values, calldatas, gasAmounts); + _roninBridgeManager.propose(companionChainId, expiredTime, targets, values, calldatas, gasAmounts); } } diff --git a/script/20240115-mappixeltoken/20240115-maptoken-roninchain.s.sol b/script/20240115-mappixeltoken/20240115-maptoken-roninchain.s.sol index 07e09cce..91f1e3ae 100644 --- a/script/20240115-mappixeltoken/20240115-maptoken-roninchain.s.sol +++ b/script/20240115-mappixeltoken/20240115-maptoken-roninchain.s.sol @@ -3,18 +3,21 @@ pragma solidity ^0.8.19; import { console2 } from "forge-std/console2.sol"; import { StdStyle } from "forge-std/StdStyle.sol"; -import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; import { IRoninGatewayV3 } from "@ronin/contracts/interfaces/IRoninGatewayV3.sol"; import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; import { Token } from "@ronin/contracts/libraries/Token.sol"; import { Contract } from "../utils/Contract.sol"; -import { BridgeMigration } from "../BridgeMigration.sol"; -import { Network } from "../utils/Network.sol"; +import { Migration } from "../Migration.s.sol"; +import { TNetwork, Network } from "../utils/Network.sol"; +import { LibProposal } from "script/shared/libraries/LibProposal.sol"; +import { LibCompanionNetwork } from "script/shared/libraries/LibCompanionNetwork.sol"; import { Contract } from "../utils/Contract.sol"; -import { IGeneralConfigExtended } from "../IGeneralConfigExtended.sol"; -contract Migration__MapTokenRoninchain is BridgeMigration { +contract Migration__MapTokenRoninchain is Migration { + using LibProposal for *; + using LibCompanionNetwork for *; + RoninBridgeManager internal _roninBridgeManager; address constant _pixelRoninToken = address(0x8b50c162494567B3c8B7F00F6031341861c8dEeD); @@ -32,24 +35,25 @@ contract Migration__MapTokenRoninchain is BridgeMigration { function setUp() public override { super.setUp(); - _roninBridgeManager = RoninBridgeManager(_config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); - _roninGatewayV3 = _config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); + _roninBridgeManager = RoninBridgeManager(config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); + _roninGatewayV3 = config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); } - function _mapTokens() internal view returns (bytes memory) { + function _mapTokens() internal returns (bytes memory) { address[] memory mainchainTokens = new address[](2); address[] memory roninTokens = new address[](2); uint256[] memory chainIds = new uint256[](2); Token.Standard[] memory standards = new Token.Standard[](2); + uint256 companionChainId = network().companionChainId(); mainchainTokens[0] = _farmlandMainchainToken; roninTokens[0] = _farmlandRoninToken; - chainIds[0] = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); + chainIds[0] = companionChainId; standards[0] = Token.Standard.ERC721; mainchainTokens[1] = _pixelMainchainToken; roninTokens[1] = _pixelRoninToken; - chainIds[1] = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); + chainIds[1] = companionChainId; standards[1] = Token.Standard.ERC20; // function mapTokens( @@ -114,9 +118,16 @@ contract Migration__MapTokenRoninchain is BridgeMigration { calldatas[2] = _addAxieChatGovernorAddress(); gasAmounts[2] = 1_000_000; - _verifyRoninProposalGasAmount(targets, values, calldatas, gasAmounts); + TNetwork currentNetwork = network(); + TNetwork companionNetwork = config.getCompanionNetwork(currentNetwork); + address companionManager = config.getAddress(companionNetwork, Contract.MainchainBridgeManager.key()); + config.createFork(companionNetwork); + config.switchTo(companionNetwork); + uint256 companionChainId = block.chainid; + LibProposal.verifyProposalGasAmount(companionManager, targets, values, calldatas, gasAmounts); + config.switchTo(currentNetwork); vm.broadcast(sender()); - _roninBridgeManager.propose(block.chainid, expiredTime, address(0), targets, values, calldatas, gasAmounts); + _roninBridgeManager.propose(block.chainid, expiredTime, targets, values, calldatas, gasAmounts); } } diff --git a/script/20240131-maptoken-pixel/20240131-maptoken-pixel-mainchain.s.sol b/script/20240131-maptoken-pixel/20240131-maptoken-pixel-mainchain.s.sol index 3c81b866..4bea0602 100644 --- a/script/20240131-maptoken-pixel/20240131-maptoken-pixel-mainchain.s.sol +++ b/script/20240131-maptoken-pixel/20240131-maptoken-pixel-mainchain.s.sol @@ -3,21 +3,23 @@ pragma solidity ^0.8.19; import { console2 } from "forge-std/console2.sol"; import { StdStyle } from "forge-std/StdStyle.sol"; -import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; +import { BaseMigration } from "@fdk/BaseMigration.s.sol"; import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; import { IMainchainGatewayV3 } from "@ronin/contracts/interfaces/IMainchainGatewayV3.sol"; import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; import { Token } from "@ronin/contracts/libraries/Token.sol"; import { Contract } from "../utils/Contract.sol"; -import { BridgeMigration } from "../BridgeMigration.sol"; -import { Network } from "../utils/Network.sol"; +import { Migration } from "../Migration.s.sol"; +import { TNetwork, Network } from "../utils/Network.sol"; +import { LibProposal } from "script/shared/libraries/LibProposal.sol"; import { Contract } from "../utils/Contract.sol"; -import { IGeneralConfigExtended } from "../IGeneralConfigExtended.sol"; import "./maptoken-pixel-configs.s.sol"; import "./update-axiechat-config.s.sol"; -contract Migration__20240131_MapTokenPixelMainchain is BridgeMigration, Migration__MapToken_Pixel_Config, Migration__Update_AxieChat_Config { +contract Migration__20240131_MapTokenPixelMainchain is Migration, Migration__MapToken_Pixel_Config, Migration__Update_AxieChat_Config { + using LibProposal for *; + RoninBridgeManager internal _roninBridgeManager; address internal _mainchainGatewayV3; address internal _mainchainBridgeManager; @@ -25,10 +27,9 @@ contract Migration__20240131_MapTokenPixelMainchain is BridgeMigration, Migratio function setUp() public override { super.setUp(); - _roninBridgeManager = RoninBridgeManager(_config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); - _mainchainGatewayV3 = _config.getAddress(_config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).key(), Contract.MainchainGatewayV3.key()); - _mainchainBridgeManager = - _config.getAddress(_config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).key(), Contract.MainchainBridgeManager.key()); + _roninBridgeManager = RoninBridgeManager(loadContract(Contract.RoninBridgeManager.key())); + _mainchainGatewayV3 = config.getAddress(config.getCompanionNetwork(network()), Contract.MainchainGatewayV3.key()); + _mainchainBridgeManager = config.getAddress(config.getCompanionNetwork(network()), Contract.MainchainBridgeManager.key()); } function run() public { @@ -111,11 +112,16 @@ contract Migration__20240131_MapTokenPixelMainchain is BridgeMigration, Migratio // ================ VERIFY AND EXECUTE PROPOSAL =============== - _verifyMainchainProposalGasAmount(targets, values, calldatas, gasAmounts); - - uint256 chainId = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); + TNetwork currentNetwork = network(); + TNetwork companionNetwork = config.getCompanionNetwork(currentNetwork); + address companionManager = config.getAddress(companionNetwork, Contract.MainchainBridgeManager.key()); + config.createFork(companionNetwork); + config.switchTo(companionNetwork); + uint256 companionChainId = block.chainid; + LibProposal.verifyProposalGasAmount(companionManager, targets, values, calldatas, gasAmounts); + config.switchTo(currentNetwork); vm.broadcast(_governor); - _roninBridgeManager.propose(chainId, expiredTime, address(0), targets, values, calldatas, gasAmounts); + _roninBridgeManager.propose(companionChainId, expiredTime, targets, values, calldatas, gasAmounts); } } diff --git a/script/20240131-maptoken-pixel/20240131-maptoken-pixel-roninchain.s.sol b/script/20240131-maptoken-pixel/20240131-maptoken-pixel-roninchain.s.sol index 96c309bb..65e24b72 100644 --- a/script/20240131-maptoken-pixel/20240131-maptoken-pixel-roninchain.s.sol +++ b/script/20240131-maptoken-pixel/20240131-maptoken-pixel-roninchain.s.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; import { console2 } from "forge-std/console2.sol"; import { StdStyle } from "forge-std/StdStyle.sol"; -import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; +import { BaseMigration } from "@fdk/BaseMigration.s.sol"; import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; import { IRoninGatewayV3 } from "@ronin/contracts/interfaces/IRoninGatewayV3.sol"; @@ -13,24 +13,25 @@ import { Ballot } from "@ronin/contracts/libraries/Ballot.sol"; import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; import { Contract } from "../utils/Contract.sol"; -import { BridgeMigration } from "../BridgeMigration.sol"; +import { Migration } from "../Migration.s.sol"; import { Network } from "../utils/Network.sol"; import { Contract } from "../utils/Contract.sol"; -import { IGeneralConfigExtended } from "../IGeneralConfigExtended.sol"; - +import { LibProposal } from "script/shared/libraries/LibProposal.sol"; import "forge-std/console2.sol"; import "./maptoken-pixel-configs.s.sol"; import "./update-axiechat-config.s.sol"; -contract Migration__20240131_MapTokenPixelRoninchain is BridgeMigration, Migration__MapToken_Pixel_Config, Migration__Update_AxieChat_Config { +contract Migration__20240131_MapTokenPixelRoninchain is Migration, Migration__MapToken_Pixel_Config, Migration__Update_AxieChat_Config { + using LibProposal for *; + RoninBridgeManager internal _roninBridgeManager; address internal _roninGatewayV3; function setUp() public override { super.setUp(); - _roninBridgeManager = RoninBridgeManager(_config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); - _roninGatewayV3 = _config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); + _roninBridgeManager = RoninBridgeManager(loadContract(Contract.RoninBridgeManager.key())); + _roninGatewayV3 = loadContract(Contract.RoninGatewayV3.key()); _cheatWeightOperator(_governor); } @@ -60,12 +61,12 @@ contract Migration__20240131_MapTokenPixelRoninchain is BridgeMigration, Migrati roninTokens[0] = _pixelRoninToken; mainchainTokens[0] = _pixelMainchainToken; - chainIds[0] = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); + chainIds[0] = config.getNetworkData(config.getCompanionNetwork(network())).chainId; standards[0] = Token.Standard.ERC20; roninTokens[1] = _farmlandRoninToken; mainchainTokens[1] = _farmlandMainchainToken; - chainIds[1] = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); + chainIds[1] = config.getNetworkData(config.getCompanionNetwork(network())).chainId; standards[1] = Token.Standard.ERC721; // function mapTokens( @@ -116,10 +117,9 @@ contract Migration__20240131_MapTokenPixelRoninchain is BridgeMigration, Migrati gasAmounts[3] = 1_000_000; // ================ VERIFY AND EXECUTE PROPOSAL =============== - - _verifyRoninProposalGasAmount(targets, values, calldatas, gasAmounts); + LibProposal.verifyProposalGasAmount(address(_roninBridgeManager), targets, values, calldatas, gasAmounts); vm.broadcast(_governor); - _roninBridgeManager.propose(block.chainid, expiredTime, address(0), targets, values, calldatas, gasAmounts); + _roninBridgeManager.propose(block.chainid, expiredTime, targets, values, calldatas, gasAmounts); } } diff --git a/script/20240131-maptoken-pixel/maptoken-pixel-configs.s.sol b/script/20240131-maptoken-pixel/maptoken-pixel-configs.s.sol index 7ba0fbfd..0ef79aa9 100644 --- a/script/20240131-maptoken-pixel/maptoken-pixel-configs.s.sol +++ b/script/20240131-maptoken-pixel/maptoken-pixel-configs.s.sol @@ -21,4 +21,4 @@ contract Migration__MapToken_Pixel_Config { uint256 constant _aggMinThreshold = 1000 ether; address internal _governor = 0xe880802580a1fbdeF67ACe39D1B21c5b2C74f059; // TODO: replace by address of the SV governor -} \ No newline at end of file +} diff --git a/script/20240131-maptoken-pixel/update-axiechat-config.s.sol b/script/20240131-maptoken-pixel/update-axiechat-config.s.sol index 85afd74d..485ac114 100644 --- a/script/20240131-maptoken-pixel/update-axiechat-config.s.sol +++ b/script/20240131-maptoken-pixel/update-axiechat-config.s.sol @@ -7,7 +7,7 @@ contract Migration__Update_AxieChat_Config { address constant _axieChatBridgeOperator = address(0x772112C7e5dD4ed663e844e79d77c1569a2E88ce); address constant _axieChatGovernor = address(0x5832C3219c1dA998e828E1a2406B73dbFC02a70C); - function _removeAxieChatGovernorAddress() pure internal returns (bytes memory) { + function _removeAxieChatGovernorAddress() internal pure returns (bytes memory) { address[] memory bridgeOperator = new address[](1); bridgeOperator[0] = _axieChatBridgeOperator; @@ -15,12 +15,10 @@ contract Migration__Update_AxieChat_Config { // address[] calldata bridgeOperators // ) - return abi.encodeCall(IBridgeManager.removeBridgeOperators, ( - bridgeOperator - )); + return abi.encodeCall(IBridgeManager.removeBridgeOperators, (bridgeOperator)); } - function _addAxieChatGovernorAddress() pure internal returns (bytes memory) { + function _addAxieChatGovernorAddress() internal pure returns (bytes memory) { uint96[] memory voteWeight = new uint96[](1); address[] memory governor = new address[](1); address[] memory bridgeOperator = new address[](1); @@ -35,10 +33,6 @@ contract Migration__Update_AxieChat_Config { // address[] calldata bridgeOperators // ) - return abi.encodeCall(IBridgeManager.addBridgeOperators, ( - voteWeight, - governor, - bridgeOperator - )); + return abi.encodeCall(IBridgeManager.addBridgeOperators, (voteWeight, governor, bridgeOperator)); } -} \ No newline at end of file +} diff --git a/script/20240206-maptoken-banana/20240206-maptoken-banana-mainchain.s.sol b/script/20240206-maptoken-banana/20240206-maptoken-banana-mainchain.s.sol index d5b28654..23d7526a 100644 --- a/script/20240206-maptoken-banana/20240206-maptoken-banana-mainchain.s.sol +++ b/script/20240206-maptoken-banana/20240206-maptoken-banana-mainchain.s.sol @@ -3,17 +3,16 @@ pragma solidity ^0.8.19; import { console2 } from "forge-std/console2.sol"; import { StdStyle } from "forge-std/StdStyle.sol"; -import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; import { IMainchainGatewayV3 } from "@ronin/contracts/interfaces/IMainchainGatewayV3.sol"; import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; import { Token } from "@ronin/contracts/libraries/Token.sol"; import { Contract } from "../utils/Contract.sol"; -import { BridgeMigration } from "../BridgeMigration.sol"; -import { Network } from "../utils/Network.sol"; -import { DefaultNetwork } from "foundry-deployment-kit/utils/DefaultNetwork.sol"; +import { Migration } from "../Migration.s.sol"; +import { TNetwork, Network } from "../utils/Network.sol"; +import { LibProposal } from "script/shared/libraries/LibProposal.sol"; +import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol"; import { Contract } from "../utils/Contract.sol"; -import { IGeneralConfigExtended } from "../IGeneralConfigExtended.sol"; import "./maptoken-banana-configs.s.sol"; import "./maptoken-genkai-configs.s.sol"; @@ -21,7 +20,7 @@ import "./maptoken-vx-configs.s.sol"; import "./changeGV-stablenode-config.s.sol"; contract Migration__20240206_MapTokenBananaMainchain is - BridgeMigration, + Migration, Migration__MapToken_Banana_Config, Migration__MapToken_Vx_Config, Migration__MapToken_Genkai_Config, @@ -31,13 +30,12 @@ contract Migration__20240206_MapTokenBananaMainchain is address internal _mainchainGatewayV3; address internal _mainchainBridgeManager; - function setUp() public override { + function setUp() public virtual override { super.setUp(); - _roninBridgeManager = RoninBridgeManager(_config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); - _mainchainGatewayV3 = _config.getAddress(_config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).key(), Contract.MainchainGatewayV3.key()); - _mainchainBridgeManager = - _config.getAddress(_config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).key(), Contract.MainchainBridgeManager.key()); + _roninBridgeManager = RoninBridgeManager(config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); + _mainchainGatewayV3 = config.getAddress(config.getCompanionNetwork(network()), Contract.MainchainGatewayV3.key()); + _mainchainBridgeManager = config.getAddress(config.getCompanionNetwork(network()), Contract.MainchainBridgeManager.key()); } function run() public onlyOn(DefaultNetwork.RoninMainnet.key()) { @@ -140,13 +138,18 @@ contract Migration__20240206_MapTokenBananaMainchain is // ================ VERIFY AND EXECUTE PROPOSAL =============== - _verifyMainchainProposalGasAmount(targets, values, calldatas, gasAmounts); - - uint256 chainId = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); + TNetwork currentNetwork = network(); + TNetwork companionNetwork = config.getCompanionNetwork(currentNetwork); + address companionManager = config.getAddress(companionNetwork, Contract.MainchainBridgeManager.key()); + config.createFork(companionNetwork); + config.switchTo(companionNetwork); + uint256 companionChainId = block.chainid; + LibProposal.verifyProposalGasAmount(companionManager, targets, values, calldatas, gasAmounts); + config.switchTo(currentNetwork); console2.log("Nonce:", vm.getNonce(_governor)); vm.broadcast(_governor); - _roninBridgeManager.propose(chainId, expiredTime, address(0), targets, values, calldatas, gasAmounts); + _roninBridgeManager.propose(companionChainId, expiredTime, targets, values, calldatas, gasAmounts); } } diff --git a/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol b/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol index f0a2bdb8..a332d93d 100644 --- a/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol +++ b/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol @@ -1,26 +1,24 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import {console2} from "forge-std/console2.sol"; -import {StdStyle} from "forge-std/StdStyle.sol"; -import {BaseMigration} from "foundry-deployment-kit/BaseMigration.s.sol"; -import {DefaultNetwork} from "foundry-deployment-kit/utils/DefaultNetwork.sol"; - -import {RoninBridgeManager} from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; -import {IRoninGatewayV3} from "@ronin/contracts/interfaces/IRoninGatewayV3.sol"; -import {MinimumWithdrawal} from "@ronin/contracts/extensions/MinimumWithdrawal.sol"; -import {Token} from "@ronin/contracts/libraries/Token.sol"; -import {Ballot} from "@ronin/contracts/libraries/Ballot.sol"; -import {GlobalProposal} from "@ronin/contracts/libraries/GlobalProposal.sol"; -import {Proposal} from "@ronin/contracts/libraries/Proposal.sol"; - -import {Contract} from "../utils/Contract.sol"; -import {BridgeMigration} from "../BridgeMigration.sol"; -import {Network} from "../utils/Network.sol"; -import {Contract} from "../utils/Contract.sol"; -import {IGeneralConfigExtended} from "../IGeneralConfigExtended.sol"; - -import "forge-std/console2.sol"; +import { console2 } from "forge-std/console2.sol"; +import { StdStyle } from "forge-std/StdStyle.sol"; +import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol"; + +import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; +import { IRoninGatewayV3 } from "@ronin/contracts/interfaces/IRoninGatewayV3.sol"; +import { MinimumWithdrawal } from "@ronin/contracts/extensions/MinimumWithdrawal.sol"; +import { Token } from "@ronin/contracts/libraries/Token.sol"; +import { Ballot } from "@ronin/contracts/libraries/Ballot.sol"; +import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; +import { Proposal } from "@ronin/contracts/libraries/Proposal.sol"; + +import { Contract } from "../utils/Contract.sol"; +import { Migration } from "../Migration.s.sol"; +import { TNetwork, Network } from "../utils/Network.sol"; +import { LibProposal } from "script/shared/libraries/LibProposal.sol"; +import { LibCompanionNetwork } from "script/shared/libraries/LibCompanionNetwork.sol"; +import { Contract } from "../utils/Contract.sol"; import "./maptoken-banana-configs.s.sol"; import "./maptoken-genkai-configs.s.sol"; @@ -28,12 +26,15 @@ import "./maptoken-vx-configs.s.sol"; import "./changeGV-stablenode-config.s.sol"; contract Migration__20240206_MapTokenBananaRoninChain is - BridgeMigration, + Migration, Migration__MapToken_Banana_Config, Migration__MapToken_Vx_Config, Migration__MapToken_Genkai_Config, Migration__ChangeGV_StableNode_Config { + using LibProposal for *; + using LibCompanionNetwork for *; + RoninBridgeManager internal _roninBridgeManager; address internal _roninGatewayV3; @@ -45,10 +46,10 @@ contract Migration__20240206_MapTokenBananaRoninChain is address aggMainchainToken = 0xFB0489e9753B045DdB35e39c6B0Cc02EC6b99AC5; uint256 aggMinThreshold = 1000 ether; - function setUp() public override { + function setUp() public virtual override { super.setUp(); - _roninBridgeManager = RoninBridgeManager(_config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); - _roninGatewayV3 = _config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); + _roninBridgeManager = RoninBridgeManager(config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); + _roninGatewayV3 = config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); } function _cheatWeightOperator(address gov) internal { @@ -74,19 +75,20 @@ contract Migration__20240206_MapTokenBananaRoninChain is // ============= MAP NEW BANANA, VX, GENKAI TOKEN =========== + uint256 companionChainId = network().companionChainId(); roninTokens[0] = _bananaRoninToken; mainchainTokens[0] = _bananaMainchainToken; - chainIds[0] = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); + chainIds[0] = companionChainId; standards[0] = Token.Standard.ERC20; roninTokens[1] = _VxRoninToken; mainchainTokens[1] = _VxMainchainToken; - chainIds[1] = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); + chainIds[1] = companionChainId; standards[1] = Token.Standard.ERC721; roninTokens[2] = _genkaiRoninToken; mainchainTokens[2] = _genkaiMainchainToken; - chainIds[2] = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); + chainIds[2] = companionChainId; standards[2] = Token.Standard.ERC721; // function mapTokens( @@ -95,8 +97,7 @@ contract Migration__20240206_MapTokenBananaRoninChain is // uint256[] calldata chainIds, // Token.Standard[] calldata _standards // ) - bytes memory innerData = - abi.encodeCall(IRoninGatewayV3.mapTokens, (roninTokens, mainchainTokens, chainIds, standards)); + bytes memory innerData = abi.encodeCall(IRoninGatewayV3.mapTokens, (roninTokens, mainchainTokens, chainIds, standards)); bytes memory proxyData = abi.encodeWithSignature("functionDelegateCall(bytes)", innerData); targets[0] = _roninGatewayV3; @@ -148,7 +149,13 @@ contract Migration__20240206_MapTokenBananaRoninChain is // ================ VERIFY AND EXECUTE PROPOSAL =============== - _verifyRoninProposalGasAmount(targets, values, calldatas, gasAmounts); + TNetwork currentNetwork = network(); + TNetwork companionNetwork = config.getCompanionNetwork(currentNetwork); + address companionManager = config.getAddress(companionNetwork, Contract.MainchainBridgeManager.key()); + config.createFork(companionNetwork); + config.switchTo(companionNetwork); + LibProposal.verifyProposalGasAmount(companionManager, targets, values, calldatas, gasAmounts); + config.switchTo(currentNetwork); console2.log("Nonce:", vm.getNonce(_governor)); vm.broadcast(_governor); diff --git a/script/20240206-maptoken-banana/changeGV-stablenode-config.s.sol b/script/20240206-maptoken-banana/changeGV-stablenode-config.s.sol index ce9ce487..d727a47b 100644 --- a/script/20240206-maptoken-banana/changeGV-stablenode-config.s.sol +++ b/script/20240206-maptoken-banana/changeGV-stablenode-config.s.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import {IBridgeManager} from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; +import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; contract Migration__ChangeGV_StableNode_Config { address constant _stableNodeBridgeOperator = address(0x564DcB855Eb360826f27D1Eb9c57cbbe6C76F50F); diff --git a/script/BaseMigrationV2.sol b/script/BaseMigrationV2.sol deleted file mode 100644 index df622324..00000000 --- a/script/BaseMigrationV2.sol +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.23; - -import "foundry-deployment-kit/BaseMigration.s.sol"; - -abstract contract BaseMigrationV2 is BaseMigration { - using StdStyle for *; - using LibString for bytes32; - using LibProxy for address payable; - - function _deployProxy(TContract contractType, bytes memory args) - internal - virtual - override - logFn(string.concat("_deployProxy ", TContract.unwrap(contractType).unpackOne())) - returns (address payable deployed) - { - string memory contractName = CONFIG.getContractName(contractType); - - address logic = _deployLogic(contractType); - string memory proxyAbsolutePath = "TransparentUpgradeableProxyV2.sol:TransparentUpgradeableProxyV2"; - uint256 proxyNonce; - address proxyAdmin = _getProxyAdmin(); - assertTrue(proxyAdmin != address(0x0), "BaseMigration: Null ProxyAdmin"); - - (deployed, proxyNonce) = _deployRaw(proxyAbsolutePath, abi.encode(logic, proxyAdmin, args)); - - // validate proxy admin - address actualProxyAdmin = deployed.getProxyAdmin(); - assertEq( - actualProxyAdmin, - proxyAdmin, - string.concat( - "BaseMigration: Invalid proxy admin\n", - "Actual: ", - vm.toString(actualProxyAdmin), - "\nExpected: ", - vm.toString(proxyAdmin) - ) - ); - - CONFIG.setAddress(network(), contractType, deployed); - ARTIFACT_FACTORY.generateArtifact( - sender(), deployed, proxyAbsolutePath, string.concat(contractName, "Proxy"), args, proxyNonce - ); - } -} diff --git a/script/BridgeMigration.sol b/script/BridgeMigration.sol deleted file mode 100644 index 4cde39f8..00000000 --- a/script/BridgeMigration.sol +++ /dev/null @@ -1,142 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; - -import { console2 } from "forge-std/console2.sol"; -import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; -import { TNetwork } from "foundry-deployment-kit/types/Types.sol"; - - -import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; -import { ErrorHandler } from "@ronin/contracts/libraries/ErrorHandler.sol"; -import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; - -import { GeneralConfigExtended } from "./GeneralConfigExtended.sol"; -import { IGeneralConfigExtended } from "./IGeneralConfigExtended.sol"; -import { Network } from "./utils/Network.sol"; -import { Contract } from "./utils/Contract.sol"; -import { DefaultNetwork } from "foundry-deployment-kit/utils/DefaultNetwork.sol"; - -contract BridgeMigration is BaseMigration { - using ErrorHandler for bool; - - error ErrProposalOutOfGas(bytes4 sig, uint256 expectedGas); - - IGeneralConfigExtended internal constant _config = IGeneralConfigExtended(address(CONFIG)); - - function _configByteCode() internal virtual override returns (bytes memory) { - return abi.encodePacked(type(GeneralConfigExtended).creationCode); - } - - function _sharedArguments() internal virtual override returns (bytes memory rawArgs) { - return ""; - } - - function _verifyGlobalProposalGasAmount( - GlobalProposal.TargetOption[] memory targetOptions, - uint256[] memory values, - bytes[] memory calldatas, - uint256[] memory gasAmounts - ) internal { - address[] memory roninTargets = new address[](targetOptions.length); - address[] memory mainchainTargets = new address[](targetOptions.length); - for (uint i; i < roninTargets.length; i++) { - roninTargets[i] = _resolveRoninTarget(targetOptions[i]); - mainchainTargets[i] = _resolveMainchainTarget(targetOptions[i]); - } - _verifyRoninProposalGasAmount(roninTargets, values, calldatas, gasAmounts); - _verifyMainchainProposalGasAmount(mainchainTargets, values, calldatas, gasAmounts); - } - - function _resolveRoninTarget(GlobalProposal.TargetOption targetOption) internal returns (address) { - _config.switchTo(DefaultNetwork.RoninMainnet.key()); - if (targetOption == GlobalProposal.TargetOption.BridgeManager) - return _config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key()); - - if (targetOption == GlobalProposal.TargetOption.GatewayContract) - return _config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key()); - - if (targetOption == GlobalProposal.TargetOption.BridgeReward) - return _config.getAddressFromCurrentNetwork(Contract.BridgeReward.key()); - - if (targetOption == GlobalProposal.TargetOption.BridgeSlash) - return _config.getAddressFromCurrentNetwork(Contract.BridgeSlash.key()); - - if (targetOption == GlobalProposal.TargetOption.BridgeTracking) - return _config.getAddressFromCurrentNetwork(Contract.BridgeTracking.key()); - - return address(0); - } - - function _resolveMainchainTarget(GlobalProposal.TargetOption targetOption) internal returns (address) { - _config.createFork(Network.EthMainnet.key()); - _config.switchTo(Network.EthMainnet.key()); - if (targetOption == GlobalProposal.TargetOption.BridgeManager) - return _config.getAddressFromCurrentNetwork(Contract.MainchainBridgeManager.key()); - - if (targetOption == GlobalProposal.TargetOption.GatewayContract) - return _config.getAddressFromCurrentNetwork(Contract.MainchainBridgeManager.key()); - - return address(0); - } - - function _verifyRoninProposalGasAmount( - address[] memory targets, - uint256[] memory values, - bytes[] memory calldatas, - uint256[] memory gasAmounts - ) internal { - _config.switchTo(DefaultNetwork.RoninMainnet.key()); - - address roninBridgeManager = _config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key()); - uint256 snapshotId = vm.snapshot(); - vm.startPrank(address(roninBridgeManager)); - _verifyProposalGasAmount(roninBridgeManager, targets, values, calldatas, gasAmounts); - vm.stopPrank(); - vm.revertTo(snapshotId); - } - - function _verifyMainchainProposalGasAmount( - address[] memory targets, - uint256[] memory values, - bytes[] memory calldatas, - uint256[] memory gasAmounts - ) internal { - _config.createFork(Network.EthMainnet.key()); - _config.switchTo(Network.EthMainnet.key()); - - address mainchainBridgeManager = _config.getAddressFromCurrentNetwork(Contract.MainchainBridgeManager.key()); - uint256 snapshotId = vm.snapshot(); - - vm.startPrank(address(mainchainBridgeManager)); - _verifyProposalGasAmount(mainchainBridgeManager, targets, values, calldatas, gasAmounts); - vm.stopPrank(); - vm.revertTo(snapshotId); - - _config.switchTo(DefaultNetwork.RoninMainnet.key()); - } - - function _verifyProposalGasAmount( - address bridgeManager, - address[] memory targets, - uint256[] memory values, - bytes[] memory calldatas, - uint256[] memory gasAmounts - ) private { - for (uint256 i; i < targets.length; i++) { - vm.deal(address(bridgeManager), values[i]); - uint256 gasUsed = gasleft(); - (bool success, bytes memory returnOrRevertData) = targets[i].call{ value: values[i] }(calldatas[i]); - gasUsed = gasUsed - gasleft(); - if (success) { - console2.log("Call", i, ": gasUsed", gasUsed); - } else { - console2.log("Call", i, unicode": reverted. ❗ GasUsed", gasUsed); - } - success.handleRevert(bytes4(calldatas[i]), returnOrRevertData); - - if (gasUsed > gasAmounts[i]) { - revert ErrProposalOutOfGas(bytes4(calldatas[i]), gasUsed); - } - } - } -} \ No newline at end of file diff --git a/script/GeneralConfig.sol b/script/GeneralConfig.sol index 7e2dbfdc..e5e29e1d 100644 --- a/script/GeneralConfig.sol +++ b/script/GeneralConfig.sol @@ -2,10 +2,10 @@ pragma solidity ^0.8.23; import { console2 as console } from "forge-std/console2.sol"; -import { BaseGeneralConfig } from "foundry-deployment-kit/BaseGeneralConfig.sol"; -import { DefaultNetwork } from "foundry-deployment-kit/utils/DefaultNetwork.sol"; +import { BaseGeneralConfig } from "@fdk/BaseGeneralConfig.sol"; +import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol"; import { Contract } from "./utils/Contract.sol"; -import { Network } from "./utils/Network.sol"; +import { TNetwork, Network } from "./utils/Network.sol"; import { Utils } from "./utils/Utils.sol"; contract GeneralConfig is BaseGeneralConfig, Utils { @@ -38,11 +38,28 @@ contract GeneralConfig is BaseGeneralConfig, Utils { ); } + function getCompanionNetwork(TNetwork network) public view virtual returns (TNetwork companionNetwork) { + if (network == DefaultNetwork.RoninMainnet.key()) { + return Network.EthMainnet.key(); + } else if (network == Network.EthMainnet.key()) { + return DefaultNetwork.RoninMainnet.key(); + } else if (network == DefaultNetwork.RoninTestnet.key()) { + return Network.Goerli.key(); + } else if (network == Network.Goerli.key()) { + return DefaultNetwork.RoninTestnet.key(); + } else if (network == DefaultNetwork.Local.key()) { + return DefaultNetwork.Local.key(); + } + + return network; + } + function _setUpContracts() internal virtual override { // map contract name - _mapContractName(Contract.BridgeTracking); _mapContractName(Contract.BridgeSlash); + _mapContractName(Contract.MockERC721); _mapContractName(Contract.BridgeReward); + _mapContractName(Contract.BridgeTracking); _mapContractName(Contract.RoninGatewayV3); _mapContractName(Contract.RoninBridgeManager); _mapContractName(Contract.MainchainGatewayV3); @@ -50,16 +67,25 @@ contract GeneralConfig is BaseGeneralConfig, Utils { _mapContractName(Contract.MockERC721); _mapContractName(Contract.RoninBridgeManagerConstructor); - _contractNameMap[Contract.WETH.key()] = "MockWrappedToken"; - _contractNameMap[Contract.WRON.key()] = "MockWrappedToken"; _contractNameMap[Contract.AXS.key()] = "MockERC20"; _contractNameMap[Contract.SLP.key()] = "MockERC20"; _contractNameMap[Contract.USDC.key()] = "MockERC20"; + _contractNameMap[Contract.WRON.key()] = "MockWrappedToken"; + _contractNameMap[Contract.WETH.key()] = "MockWrappedToken"; + _contractNameMap[Contract.MainchainWethUnwrapper.key()] = "WethUnwrapper"; _contractNameMap[Contract.RoninPauseEnforcer.key()] = "PauseEnforcer"; _contractNameMap[Contract.MainchainPauseEnforcer.key()] = "PauseEnforcer"; - _contractNameMap[Contract.MainchainWethUnwrapper.key()] = "WethUnwrapper"; + _contractAddrMap[Network.Goerli.chainId()][Contract.WETH.name()] = 0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6; + _contractAddrMap[Network.Sepolia.chainId()][Contract.WETH.name()] = 0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9; + _contractAddrMap[Network.EthMainnet.chainId()][Contract.WETH.name()] = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; + + _contractAddrMap[DefaultNetwork.RoninMainnet.chainId()][Contract.WETH.name()] = 0xc99a6A985eD2Cac1ef41640596C5A5f9F4E19Ef5; + _contractAddrMap[DefaultNetwork.RoninMainnet.chainId()][Contract.WRON.name()] = 0xe514d9DEB7966c8BE0ca922de8a064264eA6bcd4; + + _contractAddrMap[DefaultNetwork.RoninTestnet.chainId()][Contract.WETH.name()] = 0x29C6F8349A028E1bdfC68BFa08BDee7bC5D47E16; + _contractAddrMap[DefaultNetwork.RoninTestnet.chainId()][Contract.WRON.name()] = 0xA959726154953bAe111746E265E6d754F48570E6; } function _mapContractName(Contract contractEnum) internal { diff --git a/script/GeneralConfigExtended.sol b/script/GeneralConfigExtended.sol deleted file mode 100644 index 1d2f5ccb..00000000 --- a/script/GeneralConfigExtended.sol +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; - -import { console2 as console } from "forge-std/console2.sol"; -import { TContract } from "foundry-deployment-kit/types/Types.sol"; -import { BaseGeneralConfig } from "foundry-deployment-kit/BaseGeneralConfig.sol"; -import { TNetwork } from "foundry-deployment-kit/types/Types.sol"; -import { DefaultNetwork } from "foundry-deployment-kit/utils/DefaultNetwork.sol"; -import { Network } from "./utils/Network.sol"; -import { Contract } from "./utils/Contract.sol"; - -contract GeneralConfigExtended is BaseGeneralConfig { - constructor() BaseGeneralConfig("", "deployments/") { } - - function _setUpNetworks() internal virtual override { - setNetworkInfo( - Network.Goerli.chainId(), - Network.Goerli.key(), - Network.Goerli.chainAlias(), - Network.Goerli.deploymentDir(), - Network.Goerli.envLabel(), - Network.Goerli.explorer() - ); - setNetworkInfo( - Network.EthMainnet.chainId(), - Network.EthMainnet.key(), - Network.EthMainnet.chainAlias(), - Network.EthMainnet.deploymentDir(), - Network.EthMainnet.envLabel(), - Network.EthMainnet.explorer() - ); - } - - function _setUpContracts() internal virtual override { - _mapContractname(Contract.BridgeReward); - _mapContractname(Contract.BridgeSlash); - _mapContractname(Contract.BridgeTracking); - _mapContractname(Contract.RoninBridgeManager); - _mapContractname(Contract.RoninGatewayV3); - _mapContractname(Contract.MainchainBridgeManager); - _mapContractname(Contract.MainchainGatewayV3); - } - - function _mapContractname(Contract contractEnum) internal { - _contractNameMap[contractEnum.key()] = contractEnum.name(); - } - - function getCompanionNetwork(TNetwork network) external pure returns (Network) { - if (network == DefaultNetwork.RoninTestnet.key()) return Network.Goerli; - if (network == DefaultNetwork.RoninMainnet.key()) return Network.EthMainnet; - revert("Network: Unknown companion network"); - } -} diff --git a/script/Migration.s.sol b/script/Migration.s.sol index 0ca03767..300cb7f1 100644 --- a/script/Migration.s.sol +++ b/script/Migration.s.sol @@ -1,19 +1,38 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.23; -import { BaseMigrationV2 } from "./BaseMigrationV2.sol"; -import { DefaultNetwork } from "foundry-deployment-kit/utils/DefaultNetwork.sol"; +import { ProxyAdmin } from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; +import { LibString } from "solady/utils/LibString.sol"; +import { StdStyle } from "forge-std/StdStyle.sol"; +import { console2 as console } from "forge-std/console2.sol"; +import { BaseMigration } from "@fdk/BaseMigration.s.sol"; +import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol"; +import { LibProxy } from "@fdk/libraries/LibProxy.sol"; import { GeneralConfig } from "./GeneralConfig.sol"; import { ISharedArgument } from "./interfaces/ISharedArgument.sol"; -import { Network } from "./utils/Network.sol"; +import { TNetwork, Network } from "./utils/Network.sol"; import { Utils } from "./utils/Utils.sol"; -import { Contract } from "./utils/Contract.sol"; -import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; +import { Contract, TContract } from "./utils/Contract.sol"; +import { GlobalProposal, Proposal, LibProposal } from "script/shared/libraries/LibProposal.sol"; +import { TransparentUpgradeableProxy, TransparentUpgradeableProxyV2 } from "@ronin/contracts/extensions/TransparentUpgradeableProxyV2.sol"; import { Token } from "@ronin/contracts/libraries/Token.sol"; -import { LibArray } from "./libraries/LibArray.sol"; +import { LibArray } from "script/shared/libraries/LibArray.sol"; +import { PostChecker } from "./PostChecker.sol"; +import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; -contract Migration is BaseMigrationV2, Utils { - ISharedArgument public constant config = ISharedArgument(address(CONFIG)); +contract Migration is PostChecker, Utils { + using LibProxy for *; + using LibArray for *; + using StdStyle for *; + using LibString for *; + using LibProposal for *; + + uint256 internal constant DEFAULT_PROPOSAL_GAS = 1_000_000; + ISharedArgument internal constant config = ISharedArgument(address(CONFIG)); + + function setUp() public virtual override { + super.setUp(); + } function _configByteCode() internal virtual override returns (bytes memory) { return abi.encodePacked(type(GeneralConfig).creationCode); @@ -46,7 +65,7 @@ contract Migration is BaseMigrationV2, Utils { param.mockErc721.name = "Mock ERC721"; param.mockErc721.symbol = "M_ERC721"; - uint256 num = 22; + uint256 num = 6; address[] memory operatorAddrs = new address[](num); address[] memory governorAddrs = new address[](num); uint256[] memory operatorPKs = new uint256[](num); @@ -66,8 +85,8 @@ contract Migration is BaseMigrationV2, Utils { voteWeights[i] = 100; } - LibArray.inlineSortByValue(operatorPKs, LibArray.toUint256s(operatorAddrs)); - LibArray.inlineSortByValue(governorPKs, LibArray.toUint256s(governorAddrs)); + operatorPKs.inplaceSortByValue(operatorAddrs.toUint256s()); + governorPKs.inplaceSortByValue(governorAddrs.toUint256s()); param.test.operatorPKs = operatorPKs; param.test.governorPKs = governorPKs; @@ -86,31 +105,37 @@ contract Migration is BaseMigrationV2, Utils { param.roninPauseEnforcer.sentries = wrapAddress(makeAddr("pause-enforcer-sentry")); // Ronin Gateway V3 - param.roninGatewayV3.numerator = 7; - param.roninGatewayV3.denominator = 10; - param.roninGatewayV3.trustedNumerator = 9; - param.roninGatewayV3.trustedDenominator = 10; + param.roninGatewayV3.numerator = 3; + param.roninGatewayV3.denominator = 6; + param.roninGatewayV3.trustedNumerator = 2; + param.roninGatewayV3.trustedDenominator = 3; // Ronin Bridge Manager - param.roninBridgeManager.num = 7; - param.roninBridgeManager.denom = 10; + param.roninBridgeManager.num = 2; + param.roninBridgeManager.denom = 4; + param.roninBridgeManager.roninChainId = 0; param.roninBridgeManager.roninChainId = block.chainid; - param.roninBridgeManager.expiryDuration = 60 * 60 * 24 * 14; // 14 days + param.roninBridgeManager.expiryDuration = 14 days; param.roninBridgeManager.bridgeOperators = operatorAddrs; param.roninBridgeManager.governors = governorAddrs; param.roninBridgeManager.voteWeights = voteWeights; param.roninBridgeManager.targetOptions = options; param.roninBridgeManager.targets = targets; + // Mainchain Gateway Pause Enforcer + param.mainchainPauseEnforcer.admin = makeAddr("pause-enforcer-admin"); + param.mainchainPauseEnforcer.sentries = wrapAddress(makeAddr("pause-enforcer-sentry")); + // Mainchain Gateway V3 param.mainchainGatewayV3.roninChainId = block.chainid; - param.mainchainGatewayV3.numerator = 7; - param.mainchainGatewayV3.highTierVWNumerator = 9; + param.mainchainGatewayV3.numerator = 1; + param.mainchainGatewayV3.highTierVWNumerator = 10; param.mainchainGatewayV3.denominator = 10; // Mainchain Bridge Manager - param.mainchainBridgeManager.num = 7; - param.mainchainBridgeManager.denom = 10; + param.mainchainBridgeManager.num = 2; + param.mainchainBridgeManager.denom = 4; + param.mainchainBridgeManager.roninChainId = 0; param.mainchainBridgeManager.roninChainId = block.chainid; param.mainchainBridgeManager.bridgeOperators = operatorAddrs; param.mainchainBridgeManager.governors = governorAddrs; @@ -128,4 +153,104 @@ contract Migration is BaseMigrationV2, Utils { bool isLocalNetwork = network() == DefaultNetwork.Local.key(); return isLocalNetwork ? payable(config.sharedArguments().test.proxyAdmin) : super._getProxyAdmin(); } + + function _getProxyAdminFromCurrentNetwork() internal view virtual returns (address proxyAdmin) { + TNetwork currentNetwork = network(); + if (currentNetwork == DefaultNetwork.RoninTestnet.key() || currentNetwork == DefaultNetwork.RoninMainnet.key()) { + proxyAdmin = config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key()); + } else if (currentNetwork == Network.Goerli.key() || currentNetwork == Network.EthMainnet.key()) { + proxyAdmin = config.getAddressFromCurrentNetwork(Contract.MainchainBridgeManager.key()); + } else { + revert("BridgeMigration(_getProxyAdminFromCurrentNetwork): Unhandled case"); + } + } + + function _upgradeRaw(address proxyAdmin, address payable proxy, address logic, bytes memory args) internal virtual override { + if (logic.codehash == payable(proxy).getProxyImplementation({ nullCheck: true }).codehash) { + console.log("BaseMigration: Logic is already upgraded!".yellow()); + return; + } + + assertTrue(proxyAdmin != address(0x0), "BridgeMigration: Invalid {proxyAdmin} or {proxy} is not a Proxy contract"); + address admin = _getProxyAdminFromCurrentNetwork(); + TNetwork currentNetwork = network(); + + if (proxyAdmin == admin) { + // in case proxyAdmin is GovernanceAdmin + if ( + currentNetwork == DefaultNetwork.RoninTestnet.key() || currentNetwork == DefaultNetwork.RoninMainnet.key() + || currentNetwork == Network.RoninDevnet.key() + ) { + // handle for ronin network + console.log(StdStyle.yellow("Voting on RoninBridgeManager for upgrading...")); + + RoninBridgeManager manager = RoninBridgeManager(admin); + bytes[] memory callDatas = new bytes[](1); + uint256[] memory values = new uint256[](1); + address[] memory targets = new address[](1); + + targets[0] = proxy; + callDatas[0] = args.length == 0 + ? abi.encodeCall(TransparentUpgradeableProxy.upgradeTo, (logic)) + : abi.encodeCall(TransparentUpgradeableProxy.upgradeToAndCall, (logic, args)); + + Proposal.ProposalDetail memory proposal = LibProposal.createProposal({ + nonce: manager.round(block.chainid) + 1, + expiryTimestamp: block.timestamp + 10 minutes, + targets: targets, + values: values, + calldatas: callDatas, + gasAmounts: uint256(DEFAULT_PROPOSAL_GAS).toSingletonArray() + }); + + manager.executeProposal(proposal); + assertEq(proxy.getProxyImplementation(), logic, "BridgeMigration: Upgrade failed"); + } else if (currentNetwork == Network.Goerli.key() || currentNetwork == Network.EthMainnet.key()) { + // handle for ethereum + revert("BridgeMigration: Unhandled case for ETH"); + } else { + revert("BridgeMigration: Unhandled case"); + } + } else if (proxyAdmin.code.length == 0) { + // in case proxyAdmin is an eoa + console.log(StdStyle.yellow("Upgrading with EOA wallet...")); + _prankOrBroadcast(address(proxyAdmin)); + if (args.length == 0) TransparentUpgradeableProxyV2(proxy).upgradeTo(logic); + else TransparentUpgradeableProxyV2(proxy).upgradeToAndCall(logic, args); + } else { + console.log(StdStyle.yellow("Upgrading with owner of ProxyAdmin contract...")); + // in case proxyAdmin is a ProxyAdmin contract + ProxyAdmin proxyAdminContract = ProxyAdmin(proxyAdmin); + address authorizedWallet = proxyAdminContract.owner(); + _prankOrBroadcast(authorizedWallet); + if (args.length == 0) proxyAdminContract.upgrade(TransparentUpgradeableProxy(proxy), logic); + else proxyAdminContract.upgradeAndCall(TransparentUpgradeableProxy(proxy), logic, args); + } + } + + function _deployProxy( + TContract contractType, + bytes memory args + ) internal virtual override logFn(string.concat("_deployProxy ", TContract.unwrap(contractType).unpackOne())) returns (address payable deployed) { + string memory contractName = config.getContractName(contractType); + + address logic = _deployLogic(contractType); + string memory proxyAbsolutePath = "TransparentUpgradeableProxyV2.sol:TransparentUpgradeableProxyV2"; + uint256 proxyNonce; + address proxyAdmin = _getProxyAdmin(); + assertTrue(proxyAdmin != address(0x0), "BaseMigration: Null ProxyAdmin"); + + (deployed, proxyNonce) = _deployRaw(proxyAbsolutePath, abi.encode(logic, proxyAdmin, args)); + + // validate proxy admin + address actualProxyAdmin = deployed.getProxyAdmin(); + assertEq( + actualProxyAdmin, + proxyAdmin, + string.concat("BaseMigration: Invalid proxy admin\n", "Actual: ", vm.toString(actualProxyAdmin), "\nExpected: ", vm.toString(proxyAdmin)) + ); + + config.setAddress(network(), contractType, deployed); + ARTIFACT_FACTORY.generateArtifact(sender(), deployed, proxyAbsolutePath, string.concat(contractName, "Proxy"), args, proxyNonce); + } } diff --git a/script/PostChecker.sol b/script/PostChecker.sol new file mode 100644 index 00000000..4a1ae8c4 --- /dev/null +++ b/script/PostChecker.sol @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { BaseMigration } from "@fdk/BaseMigration.s.sol"; +import { Contract } from "script/utils/Contract.sol"; +import { Network } from "script/utils/Network.sol"; +import { TNetwork, DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol"; +import { LibCompanionNetwork } from "script/shared/libraries/LibCompanionNetwork.sol"; +import { PostCheck_BridgeManager } from "./post-check/bridge-manager/PostCheck_BridgeManager.s.sol"; + +abstract contract PostChecker is BaseMigration, PostCheck_BridgeManager { + using LibCompanionNetwork for *; + + function _postCheck() internal override { + _loadSysContract(); + _validate_BridgeManager(); + } + + function _loadSysContract() private { + TNetwork currentNetwork = network(); + if ( + currentNetwork == DefaultNetwork.RoninMainnet.key() || currentNetwork == DefaultNetwork.RoninTestnet.key() || currentNetwork == Network.RoninDevnet.key() + || currentNetwork == DefaultNetwork.Local.key() + ) { + __bridgeSlash = loadContract(Contract.BridgeSlash.key()); + __bridgeReward = loadContract(Contract.BridgeReward.key()); + _gateway[block.chainid] = loadContract(Contract.RoninGatewayV3.key()); + _manager[block.chainid] = loadContract(Contract.RoninBridgeManager.key()); + + (uint256 companionChainId, TNetwork companionNetwork) = currentNetwork.companionNetworkData(); + _gateway[companionChainId] = CONFIG.getAddress(companionNetwork, Contract.MainchainGatewayV3.key()); + _manager[companionChainId] = CONFIG.getAddress(companionNetwork, Contract.MainchainBridgeManager.key()); + } else { + revert(string.concat("Unsupported network: ", currentNetwork.networkName())); + } + } +} diff --git a/script/contracts/MainchainBridgeManagerDeploy.s.sol b/script/contracts/MainchainBridgeManagerDeploy.s.sol index c91bb2e9..a0b36941 100644 --- a/script/contracts/MainchainBridgeManagerDeploy.s.sol +++ b/script/contracts/MainchainBridgeManagerDeploy.s.sol @@ -9,26 +9,6 @@ import { Migration } from "../Migration.s.sol"; import { MainchainGatewayV3Deploy } from "./MainchainGatewayV3Deploy.s.sol"; contract MainchainBridgeManagerDeploy is Migration { - function _defaultArguments() internal virtual override returns (bytes memory args) { - ISharedArgument.BridgeManagerParam memory param = config.sharedArguments().mainchainBridgeManager; - - args = abi.encodeCall( - MainchainBridgeManager.initialize, - ( - param.num, - param.denom, - param.roninChainId, - param.bridgeContract, - param.callbackRegisters, - param.bridgeOperators, - param.governors, - param.voteWeights, - param.targetOptions, - param.targets - ) - ); - } - function run() public virtual returns (MainchainBridgeManager) { return MainchainBridgeManager(_deployProxy(Contract.MainchainBridgeManager.key())); } diff --git a/script/contracts/MainchainWethUnwrapperDeploy.s.sol b/script/contracts/MainchainWethUnwrapperDeploy.s.sol index bdce4293..b550c7f8 100644 --- a/script/contracts/MainchainWethUnwrapperDeploy.s.sol +++ b/script/contracts/MainchainWethUnwrapperDeploy.s.sol @@ -3,14 +3,19 @@ pragma solidity ^0.8.19; import { WethUnwrapper } from "@ronin/contracts/extensions/WethUnwrapper.sol"; import { Contract } from "../utils/Contract.sol"; +import { WETHDeploy } from "./token/WETHDeploy.s.sol"; import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; import { Migration } from "../Migration.s.sol"; contract MainchainWethUnwrapperDeploy is Migration { + function _injectDependencies() internal virtual override { + _setDependencyDeployScript(Contract.WETH.key(), new WETHDeploy()); + } + function _defaultArguments() internal virtual override returns (bytes memory args) { ISharedArgument.WethUnwrapperParam memory param = config.sharedArguments().mainchainWethUnwrapper; - args = abi.encode(param.weth); + args = abi.encode(param.weth == address(0x0) ? loadContractOrDeploy(Contract.WETH.key()) : param.weth); } function run() public virtual returns (WethUnwrapper) { diff --git a/script/deploy-v0.3.1/01_Deploy_RoninBridge.s.sol b/script/deploy-v0.3.1/01_Deploy_RoninBridge.s.sol new file mode 100644 index 00000000..a515b6e3 --- /dev/null +++ b/script/deploy-v0.3.1/01_Deploy_RoninBridge.s.sol @@ -0,0 +1,104 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.23; + +import { Migration } from "../Migration.s.sol"; +import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; +import { BridgeSlash, BridgeSlashDeploy } from "../contracts/BridgeSlashDeploy.s.sol"; +import { BridgeReward, BridgeRewardDeploy } from "../contracts/BridgeRewardDeploy.s.sol"; +import { BridgeTracking, BridgeTrackingDeploy } from "../contracts/BridgeTrackingDeploy.s.sol"; +import { RoninGatewayV3, RoninGatewayV3Deploy } from "../contracts/RoninGatewayV3Deploy.s.sol"; +import { RoninBridgeManager, RoninBridgeManagerDeploy } from "../contracts/RoninBridgeManagerDeploy.s.sol"; + +contract Migration_01_Deploy_RoninBridge is Migration { + BridgeSlash private _bridgeSlash; + BridgeReward private _bridgeReward; + RoninGatewayV3 private _roninGatewayV3; + BridgeTracking private _bridgeTracking; + RoninBridgeManager private _roninBridgeManager; + address private _validatorSet; + + function run() external { + _roninGatewayV3 = new RoninGatewayV3Deploy().run(); + _bridgeSlash = new BridgeSlashDeploy().run(); + _bridgeReward = new BridgeRewardDeploy().run(); + _bridgeTracking = new BridgeTrackingDeploy().run(); + _roninBridgeManager = new RoninBridgeManagerDeploy().run(); + + _initBridgeReward(); + _initBridgeSlash(); + _initRoninGatewayV3(); + _initBridgeTracking(); + _initRoninBridgeManager(); + } + + function _initRoninBridgeManager() internal logFn("Init RoninBridgeManager") { + ISharedArgument.BridgeManagerParam memory param = config.sharedArguments().roninBridgeManager; + // address[] memory callbackRegisters = new address[](1); + // callbackRegisters[0] = address(_bridgeSlash); + // callbackRegisters[1] = address(_roninGatewayV3); + + _roninBridgeManager.initialize({ + num: param.num, + denom: param.denom, + roninChainId: block.chainid, + expiryDuration: param.expiryDuration, + bridgeContract: address(_roninGatewayV3), + callbackRegisters: param.callbackRegisters, + bridgeOperators: param.bridgeOperators, + governors: param.governors, + voteWeights: param.voteWeights, + targetOptions: param.targetOptions, + targets: param.targets + }); + } + + function _initBridgeTracking() internal logFn("Init BridgeTracking") { + _bridgeTracking.initialize({ bridgeContract: address(_roninGatewayV3), validatorContract: _validatorSet, startedAtBlock_: 0 }); + _bridgeTracking.initializeV3({ + bridgeManager: address(_roninBridgeManager), + bridgeSlash: address(_bridgeSlash), + bridgeReward: address(_bridgeReward), + dposGA: address(0x0) + }); + } + + function _initBridgeReward() internal logFn("Init BridgeReward") { + ISharedArgument.BridgeRewardParam memory param = config.sharedArguments().bridgeReward; + _bridgeReward.initialize({ + bridgeManagerContract: address(_roninBridgeManager), + bridgeTrackingContract: address(_bridgeTracking), + bridgeSlashContract: address(_bridgeSlash), + validatorSetContract: _validatorSet, + dposGA: address(0x0), + rewardPerPeriod: param.rewardPerPeriod + }); + // _bridgeReward.initializeREP2(); + _bridgeReward.initializeV2(); + } + + function _initBridgeSlash() internal logFn("Init BridgeSlash") { + _bridgeSlash.initialize({ + validatorContract: _validatorSet, + bridgeManagerContract: address(_roninBridgeManager), + bridgeTrackingContract: address(_bridgeTracking), + dposGA: address(0x0) + }); + } + + function _initRoninGatewayV3() internal logFn("Init RoninGatewayV3") { + ISharedArgument.RoninGatewayV3Param memory param = config.sharedArguments().roninGatewayV3; + + _roninGatewayV3.initialize( + param.roleSetter, + param.numerator, + param.denominator, + param.trustedNumerator, + param.trustedDenominator, + param.withdrawalMigrators, + param.packedAddresses, + param.packedNumbers, + param.standards + ); + _roninGatewayV3.initializeV3(address(_roninBridgeManager)); + } +} diff --git a/script/deploy-v0.3.1/02_Deploy_MainchainBridge.s.sol b/script/deploy-v0.3.1/02_Deploy_MainchainBridge.s.sol new file mode 100644 index 00000000..f744a059 --- /dev/null +++ b/script/deploy-v0.3.1/02_Deploy_MainchainBridge.s.sol @@ -0,0 +1,76 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.23; + +import { Migration } from "../Migration.s.sol"; +import { Contract } from "../utils/Contract.sol"; +import { IWETH } from "@ronin/contracts/interfaces/IWETH.sol"; +import { WETHDeploy } from "../contracts/token/WETHDeploy.s.sol"; +import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; +import { LibCompanionNetwork } from "script/shared/libraries/LibCompanionNetwork.sol"; +import { MainchainGatewayV3, MainchainGatewayV3Deploy } from "../contracts/MainchainGatewayV3Deploy.s.sol"; +import { WethUnwrapper, MainchainWethUnwrapperDeploy } from "../contracts/MainchainWethUnwrapperDeploy.s.sol"; +import { MainchainBridgeManager, MainchainBridgeManagerDeploy } from "../contracts/MainchainBridgeManagerDeploy.s.sol"; + +contract Migration_02_Deploy_MainchainBridge is Migration { + using LibCompanionNetwork for *; + + address private _weth; + WethUnwrapper private _mainchainWethUnwrapper; + MainchainGatewayV3 private _mainchainGatewayV3; + MainchainBridgeManager private _mainchainBridgeManager; + + function _injectDependencies() internal virtual override { + _setDependencyDeployScript(Contract.WETH.key(), new WETHDeploy()); + } + + function run() external { + _weth = loadContractOrDeploy(Contract.WETH.key()); + _mainchainGatewayV3 = new MainchainGatewayV3Deploy().run(); + _mainchainBridgeManager = new MainchainBridgeManagerDeploy().run(); + _mainchainWethUnwrapper = new MainchainWethUnwrapperDeploy().run(); + + _initMainchainGatewayV3(); + _initMainchainBridgeManager(); + } + + function _initMainchainBridgeManager() internal logFn("Init RoninBridgeManager") { + ISharedArgument.BridgeManagerParam memory param = config.sharedArguments().mainchainBridgeManager; + // address[] memory callbackRegisters = new address[](1); + // callbackRegisters[0] = address(_bridgeSlash); + // callbackRegisters[1] = address(_roninGatewayV3); + + uint256 companionChainId = network().companionChainId(); + _mainchainBridgeManager.initialize({ + num: param.num, + denom: param.denom, + roninChainId: companionChainId, + bridgeContract: address(_mainchainGatewayV3), + callbackRegisters: param.callbackRegisters, + bridgeOperators: param.bridgeOperators, + governors: param.governors, + voteWeights: param.voteWeights, + targetOptions: param.targetOptions, + targets: param.targets + }); + } + + function _initMainchainGatewayV3() internal logFn("Init MainchainGatewayV3") { + ISharedArgument.MainchainGatewayV3Param memory param = config.sharedArguments().mainchainGatewayV3; + + uint256 companionChainId = network().companionChainId(); + _mainchainGatewayV3.initialize( + param.roleSetter, + IWETH(_weth), + companionChainId, + param.numerator, + param.highTierVWNumerator, + param.denominator, + param.addresses, + param.thresholds, + param.standards + ); + _mainchainGatewayV3.initializeV2(address(_mainchainBridgeManager)); + _mainchainGatewayV3.initializeV3(); + _mainchainGatewayV3.initializeV4(payable(address(_mainchainWethUnwrapper))); + } +} diff --git a/script/deploy-v0.3.1/Deploy.v0.3.1.s.sol b/script/deploy-v0.3.1/Deploy.v0.3.1.s.sol new file mode 100644 index 00000000..ad534228 --- /dev/null +++ b/script/deploy-v0.3.1/Deploy.v0.3.1.s.sol @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.23; + +import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol"; +import { Migration } from "../Migration.s.sol"; +import { Contract } from "../utils/Contract.sol"; +import { TNetwork, Network } from "../utils/Network.sol"; +import { Migration_01_Deploy_RoninBridge } from "./01_Deploy_RoninBridge.s.sol"; +import { LibCompanionNetwork } from "../shared/libraries/LibCompanionNetwork.sol"; +import { Migration_02_Deploy_MainchainBridge } from "./02_Deploy_MainchainBridge.s.sol"; + +contract Deploy_v0_3_1 is Migration { + using LibCompanionNetwork for *; + + function run() external { + TNetwork currentNetwork = network(); + TNetwork companionNetwork = currentNetwork.companionNetwork(); + + if ( + currentNetwork == DefaultNetwork.RoninMainnet.key() || currentNetwork == DefaultNetwork.RoninTestnet.key() || currentNetwork == Network.RoninDevnet.key() + ) { + new Migration_01_Deploy_RoninBridge().run(); + + config.createFork(companionNetwork); + config.switchTo(companionNetwork); + + new Migration_02_Deploy_MainchainBridge().run(); + + config.switchTo(currentNetwork); + } else if (currentNetwork == Network.EthMainnet.key() || currentNetwork == Network.Goerli.key() || currentNetwork == Network.Sepolia.key()) { + config.createFork(companionNetwork); + config.switchTo(companionNetwork); + + new Migration_01_Deploy_RoninBridge().run(); + + config.switchTo(currentNetwork); + + new Migration_02_Deploy_MainchainBridge().run(); + } else if (currentNetwork == DefaultNetwork.Local.key()) { + new Migration_01_Deploy_RoninBridge().run(); + new Migration_02_Deploy_MainchainBridge().run(); + } else { + revert("Unsupported network"); + } + } +} diff --git a/script/IGeneralConfigExtended.sol b/script/interfaces/IGeneralConfigExtended.sol similarity index 62% rename from script/IGeneralConfigExtended.sol rename to script/interfaces/IGeneralConfigExtended.sol index 78a02582..257b80aa 100644 --- a/script/IGeneralConfigExtended.sol +++ b/script/interfaces/IGeneralConfigExtended.sol @@ -1,9 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import { IGeneralConfig } from "foundry-deployment-kit/interfaces/IGeneralConfig.sol"; -import { TNetwork } from "foundry-deployment-kit/types/Types.sol"; -import { Network } from "./utils/Network.sol"; +import { IGeneralConfig } from "@fdk/interfaces/IGeneralConfig.sol"; +import { TNetwork } from "@fdk/types/Types.sol"; interface IGeneralConfigExtended is IGeneralConfig { /** @@ -13,5 +12,5 @@ interface IGeneralConfigExtended is IGeneralConfig { * Output: companion mainchain network of roninchain * */ - function getCompanionNetwork(TNetwork network) external pure returns (Network); + function getCompanionNetwork(TNetwork network) external pure returns (TNetwork); } diff --git a/script/interfaces/ISharedArgument.sol b/script/interfaces/ISharedArgument.sol index 6b7f87b8..deab1709 100644 --- a/script/interfaces/ISharedArgument.sol +++ b/script/interfaces/ISharedArgument.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.23; -import { IGeneralConfig } from "foundry-deployment-kit/interfaces/IGeneralConfig.sol"; +import { IGeneralConfigExtended } from "./IGeneralConfigExtended.sol"; import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; import { Token } from "@ronin/contracts/libraries/Token.sol"; -interface ISharedArgument is IGeneralConfig { +interface ISharedArgument is IGeneralConfigExtended { struct BridgeManagerParam { uint256 num; uint256 denom; diff --git a/script/libraries/LibArray.sol b/script/libraries/LibArray.sol index d9630afa..afd37758 100644 --- a/script/libraries/LibArray.sol +++ b/script/libraries/LibArray.sol @@ -59,9 +59,9 @@ library LibArray { let dataElementLocation := add(data, 0x20) // Iterate until the bound is not met. - for { let end := add(dataElementLocation, mul(len, 0x20)) } lt(dataElementLocation, end) { - dataElementLocation := add(dataElementLocation, 0x20) - } { result := add(result, mload(dataElementLocation)) } + for { let end := add(dataElementLocation, mul(len, 0x20)) } lt(dataElementLocation, end) { dataElementLocation := add(dataElementLocation, 0x20) } { + result := add(result, mload(dataElementLocation)) + } } } @@ -105,11 +105,7 @@ library LibArray { * @notice This function modify `self` and `values` * @return sorted The sorted array. */ - function inlineSortByValue(uint256[] memory self, uint256[] memory values) - internal - pure - returns (uint256[] memory sorted) - { + function inlineSortByValue(uint256[] memory self, uint256[] memory values) internal pure returns (uint256[] memory sorted) { return inlineQuickSortByValue(self, values); } @@ -120,11 +116,7 @@ library LibArray { * @notice This function modify `self` and `values` * @return sorted The sorted array. */ - function inlineQuickSortByValue(uint256[] memory self, uint256[] memory values) - internal - pure - returns (uint256[] memory sorted) - { + function inlineQuickSortByValue(uint256[] memory self, uint256[] memory values) internal pure returns (uint256[] memory sorted) { uint256 length = self.length; if (length != values.length) revert LengthMismatch(); unchecked { @@ -144,10 +136,7 @@ library LibArray { * @param right The right index of the subarray to be sorted. * @notice This function modify `arr` and `values` */ - function inlineQuickSortByValue(uint256[] memory arr, uint256[] memory values, int256 left, int256 right) - private - pure - { + function inlineQuickSortByValue(uint256[] memory arr, uint256[] memory values, int256 left, int256 right) private pure { unchecked { if (left == right) return; int256 i = left; diff --git a/script/post-check/BasePostCheck.s.sol b/script/post-check/BasePostCheck.s.sol new file mode 100644 index 00000000..7b9219f8 --- /dev/null +++ b/script/post-check/BasePostCheck.s.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { Vm } from "forge-std/Vm.sol"; +import { StdStyle } from "forge-std/StdStyle.sol"; +import { console2 as console } from "forge-std/console2.sol"; +import { BaseMigration } from "@fdk/BaseMigration.s.sol"; +import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; + +abstract contract BasePostCheck is BaseMigration { + using StdStyle for *; + + uint256 internal seed = vm.unixTime(); + address internal __bridgeSlash; + address internal __bridgeReward; + address internal __bridgeTracking; + mapping(uint256 chainId => address manager) internal _manager; + mapping(uint256 chainId => address gateway) internal _gateway; + + modifier onPostCheck(string memory postCheckLabel) { + uint256 snapshotId = _beforePostCheck(postCheckLabel); + _; + _afterPostCheck(postCheckLabel, snapshotId); + } + + function _beforePostCheck(string memory postCheckLabel) private returns (uint256 snapshotId) { + snapshotId = vm.snapshot(); + console.log("\n> ".cyan(), postCheckLabel.blue().italic(), "..."); + } + + function _afterPostCheck(string memory postCheckLabel, uint256 snapshotId) private { + console.log(string.concat("Postcheck ", postCheckLabel.italic(), " successful!\n").green()); + vm.revertTo(snapshotId); + } +} diff --git a/script/post-check/bridge-manager/BridgeManager.post_check.tree b/script/post-check/bridge-manager/BridgeManager.post_check.tree new file mode 100644 index 00000000..a42faa0a --- /dev/null +++ b/script/post-check/bridge-manager/BridgeManager.post_check.tree @@ -0,0 +1,66 @@ +BridgeManager + CRUD + add + when not self-called + it should revert + when self-called + when the list has duplicate + it should revert + when the list has null value + it should revert + when three input array mismatch + it should revert + when vote weight is zero + it should revert + when the valid input + governor should be in governor list + it should increase the total weight + governor should have expected weight + operator should have expected weight + it should map governor => bridge operator + it should map bridge operator => governor + bridge operator should be in operator list + it should notify proxy contract with valid data + it should notify immutable contract with valid data + remove + when not self-called + it should revert + when self-called + when the list has duplicate + it should revert + when the list has null value + it should revert + when operator is not in the operator list + it should not remove + when operator is in the list + governor should have 0 weight + it should decrease the total weight + bridge operator should have 0 weight + orders of other governors must unchanged + orders of other bridge operators must unchanged + it should notify proxy contract with valid data + it should notify immutable contract with valid data + it should remove the operator from the operator list + it should remove corresponding governor from the list + it should remove the mapping governor => bridge operator + it should remove the mapping bridge operator => governor + + Proposal + GlobalProposal + when the nonce is invalid + it should revert + when the caller is not the governor + it should verify signature with correct governor + when the target is BridgeManager + it should self call + ProposalForCurrentNetwork + when the nonce is invalid + it should revert + when the caller is not the governor + when the calldata includes signature + it should verify correct signature + when the calldata not includes signature + it should revert + when the target is BridgeManager + it should self call + \ No newline at end of file diff --git a/script/post-check/bridge-manager/PostCheck_BridgeManager.s.sol b/script/post-check/bridge-manager/PostCheck_BridgeManager.s.sol new file mode 100644 index 00000000..24e113d4 --- /dev/null +++ b/script/post-check/bridge-manager/PostCheck_BridgeManager.s.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { PostCheck_BridgeManager_CRUD_AddBridgeOperators } from "./crud/PostCheck_BridgeManager_CRUD_AddBridgeOperators.s.sol"; +import { PostCheck_BridgeManager_CRUD_RemoveBridgeOperators } from "./crud/PostCheck_BridgeManager_CRUD_RemoveBridgeOperators.s.sol"; +import { PostCheck_BridgeManager_Proposal } from "./proposal/PostCheck_BridgeManager_Proposal.s.sol"; + +abstract contract PostCheck_BridgeManager is + PostCheck_BridgeManager_Proposal, + PostCheck_BridgeManager_CRUD_AddBridgeOperators, + PostCheck_BridgeManager_CRUD_RemoveBridgeOperators +{ + function _validate_BridgeManager() internal onPostCheck("validate_BridgeManager") { + _validate_BridgeManager_CRUD_addBridgeOperators(); + _validate_BridgeManager_CRUD_removeBridgeOperators(); + _validate_BridgeManager_Proposal(); + } +} diff --git a/script/post-check/bridge-manager/crud/PostCheck_BridgeManager_CRUD_addBridgeOperators.s.sol b/script/post-check/bridge-manager/crud/PostCheck_BridgeManager_CRUD_addBridgeOperators.s.sol new file mode 100644 index 00000000..b8102be0 --- /dev/null +++ b/script/post-check/bridge-manager/crud/PostCheck_BridgeManager_CRUD_addBridgeOperators.s.sol @@ -0,0 +1,119 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; +import { BasePostCheck } from "script/post-check/BasePostCheck.s.sol"; +import { LibArray } from "script/shared/libraries/LibArray.sol"; + +/** + * @title PostCheck_BridgeManager_CRUD_AddBridgeOperators + * @dev This contract contains post-check functions for adding bridge operators in the BridgeManager contract. + */ +abstract contract PostCheck_BridgeManager_CRUD_AddBridgeOperators is BasePostCheck { + using LibArray for *; + + uint256 private voteWeight = 100; + string private seedStr = vm.toString(seed); + address private any = makeAddr(string.concat("any", seedStr)); + address private operator = makeAddr(string.concat("operator-", seedStr)); + address private governor = makeAddr(string.concat("governor-", seedStr)); + + function _validate_BridgeManager_CRUD_addBridgeOperators() internal { + validate_RevertWhen_NotSelfCalled_addBridgeOperators(); + validate_RevertWhen_SelfCalled_TheListHasDuplicate_addBridgeOperators(); + validate_RevertWhen_SelfCalled_InputArrayLengthMismatch_addBridgeOperators(); + validate_RevertWhen_SelfCalled_ContainsNullVoteWeight_addBridgeOperators(); + validate_addBridgeOperators(); + } + + /** + * @dev Validates that the function `addBridgeOperators` reverts when it is not self-called. + */ + function validate_RevertWhen_NotSelfCalled_addBridgeOperators() private onPostCheck("validate_RevertWhen_NotSelfCalled_addBridgeOperators") { + vm.expectRevert(); + vm.prank(any); + bool[] memory addeds = IBridgeManager(_manager[block.chainid]).addBridgeOperators( + voteWeight.toSingletonArray().toUint96sUnsafe(), operator.toSingletonArray(), governor.toSingletonArray() + ); + } + + /** + * @dev Validates that the function `addBridgeOperators` reverts when the list of operators contains duplicates. + */ + function validate_RevertWhen_SelfCalled_TheListHasDuplicate_addBridgeOperators() + private + onPostCheck("validate_RevertWhen_SelfCalled_TheListHasDuplicate_addBridgeOperators") + { + vm.expectRevert(); + vm.prank(_manager[block.chainid]); + bool[] memory addeds = IBridgeManager(_manager[block.chainid]).addBridgeOperators( + voteWeight.toSingletonArray().toUint96sUnsafe(), operator.toSingletonArray(), operator.toSingletonArray() + ); + + vm.expectRevert(); + vm.prank(_manager[block.chainid]); + addeds = IBridgeManager(_manager[block.chainid]).addBridgeOperators( + voteWeight.toSingletonArray().toUint96sUnsafe(), governor.toSingletonArray(), governor.toSingletonArray() + ); + + vm.expectRevert(); + vm.prank(_manager[block.chainid]); + addeds = IBridgeManager(_manager[block.chainid]).addBridgeOperators( + voteWeight.toSingletonArray().toUint96sUnsafe(), + governor.toSingletonArray().extend(operator.toSingletonArray()), + operator.toSingletonArray().extend(governor.toSingletonArray()) + ); + } + + /** + * @dev Validates that the function `addBridgeOperators` reverts when the input array lengths mismatch. + */ + function validate_RevertWhen_SelfCalled_InputArrayLengthMismatch_addBridgeOperators() + private + onPostCheck("validate_RevertWhen_SelfCalled_InputArrayLengthMismatch_addBridgeOperators") + { + vm.prank(_manager[block.chainid]); + vm.expectRevert(); + IBridgeManager(_manager[block.chainid]).addBridgeOperators( + voteWeight.toSingletonArray().toUint96sUnsafe(), governor.toSingletonArray(), operator.toSingletonArray().extend(governor.toSingletonArray()) + ); + } + + /** + * @dev Validates that the function `addBridgeOperators` reverts when the input array contains a null vote weight. + */ + function validate_RevertWhen_SelfCalled_ContainsNullVoteWeight_addBridgeOperators() + private + onPostCheck("validate_RevertWhen_SelfCalled_ContainsNullVoteWeight_addBridgeOperators") + { + vm.prank(_manager[block.chainid]); + vm.expectRevert(); + IBridgeManager(_manager[block.chainid]).addBridgeOperators( + uint256(0).toSingletonArray().toUint96sUnsafe(), governor.toSingletonArray(), operator.toSingletonArray().extend(governor.toSingletonArray()) + ); + } + + /** + * @dev Validates that the function `addBridgeOperators`. + */ + function validate_addBridgeOperators() private onPostCheck("validate_addBridgeOperators") { + address manager = _manager[block.chainid]; + uint256 totalWeightBefore = IBridgeManager(manager).getTotalWeight(); + uint256 totalBridgeOperatorsBefore = IBridgeManager(manager).getBridgeOperators().length; + + vm.prank(manager); + bool[] memory addeds = + IBridgeManager(manager).addBridgeOperators(voteWeight.toSingletonArray().toUint96sUnsafe(), governor.toSingletonArray(), operator.toSingletonArray()); + + assertTrue(addeds[0], "addeds[0] == false"); + assertTrue(IBridgeManager(manager).isBridgeOperator(operator), "isBridgeOperator(operator) == false"); + assertEq(IBridgeManager(manager).getTotalWeight(), totalWeightBefore + voteWeight, "getTotalWeight() != totalWeightBefore + voteWeight"); + assertEq( + IBridgeManager(manager).getBridgeOperators().length, totalBridgeOperatorsBefore + 1, "getBridgeOperators().length != totalBridgeOperatorsBefore + 1" + ); + // Deprecated + // assertEq(IBridgeManager(manager).getGovernorsOf(operator.toSingletonArray())[0], governor, "getGovernorsOf(operator)[0] != governor"); + // Deprecated + // assertEq(IBridgeManager(manager).getBridgeOperatorOf(governor.toSingletonArray())[0], operator, "getBridgeOperatorOf(governor)[0] != operator"); + } +} diff --git a/script/post-check/bridge-manager/crud/PostCheck_BridgeManager_CRUD_removeBridgeOperators.s.sol b/script/post-check/bridge-manager/crud/PostCheck_BridgeManager_CRUD_removeBridgeOperators.s.sol new file mode 100644 index 00000000..1abcd2fc --- /dev/null +++ b/script/post-check/bridge-manager/crud/PostCheck_BridgeManager_CRUD_removeBridgeOperators.s.sol @@ -0,0 +1,81 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; +import { BasePostCheck } from "script/post-check/BasePostCheck.s.sol"; +import { LibArray } from "script/shared/libraries/LibArray.sol"; + +abstract contract PostCheck_BridgeManager_CRUD_RemoveBridgeOperators is BasePostCheck { + using LibArray for *; + + string private seedStr = vm.toString(seed); + address private operatorToRemove; + uint256 private voteWeightToRemove; + address private any = makeAddr(string.concat("any", seedStr)); + + function _validate_BridgeManager_CRUD_removeBridgeOperators() internal { + address manager = _manager[block.chainid]; + address[] memory operators = IBridgeManager(manager).getBridgeOperators(); + uint256 idx = _bound(seed, 0, operators.length - 1); + + operatorToRemove = operators[idx]; + voteWeightToRemove = IBridgeManager(manager).getBridgeOperatorWeight(operatorToRemove); + + validate_RevertWhen_NotSelfCalled_removeBridgeOperators(); + validate_RevertWhen_SelfCalled_TheListHasDuplicate_removeBridgeOperators(); + validate_RevertWhen_SelfCalled_TheListHasNull_removeBridgeOperators(); + validate_RevertWhen_SelfCalled_RemovedOperatorIsNotInTheList_removeBridgeOperators(); + validate_removeBridgeOperators(); + } + + function validate_RevertWhen_NotSelfCalled_removeBridgeOperators() private onPostCheck("validate_RevertWhen_NotSelfCalled_removeBridgeOperators") { + vm.prank(any); + vm.expectRevert(); + IBridgeManager(_manager[block.chainid]).removeBridgeOperators(operatorToRemove.toSingletonArray()); + } + + function validate_RevertWhen_SelfCalled_TheListHasDuplicate_removeBridgeOperators() + private + onPostCheck("validate_RevertWhen_SelfCalled_TheListHasDuplicate_removeBridgeOperators") + { + vm.prank(_manager[block.chainid]); + vm.expectRevert(); + IBridgeManager(_manager[block.chainid]).removeBridgeOperators(operatorToRemove.toSingletonArray().extend(operatorToRemove.toSingletonArray())); + } + + function validate_RevertWhen_SelfCalled_TheListHasNull_removeBridgeOperators() + private + onPostCheck("validate_RevertWhen_SelfCalled_TheListHasNull_removeBridgeOperators") + { + vm.prank(_manager[block.chainid]); + vm.expectRevert(); + IBridgeManager(_manager[block.chainid]).removeBridgeOperators(address(0).toSingletonArray()); + } + + function validate_RevertWhen_SelfCalled_RemovedOperatorIsNotInTheList_removeBridgeOperators() + private + onPostCheck("validate_RevertWhen_SelfCalled_RemovedOperatorIsNotInTheList_removeBridgeOperators") + { + vm.expectRevert(); + vm.prank(_manager[block.chainid]); + IBridgeManager(_manager[block.chainid]).removeBridgeOperators(any.toSingletonArray()); + } + + function validate_removeBridgeOperators() private onPostCheck("validate_removeBridgeOperators") { + address manager = _manager[block.chainid]; + uint256 total = IBridgeManager(manager).totalBridgeOperator(); + uint256 totalWeightBefore = IBridgeManager(manager).getTotalWeight(); + uint256 expected = total - 1; + + vm.prank(manager); + IBridgeManager(manager).removeBridgeOperators(operatorToRemove.toSingletonArray()); + uint256 actual = IBridgeManager(manager).totalBridgeOperator(); + + assertEq(actual, expected, "Bridge operator is not removed"); + assertEq(IBridgeManager(manager).getTotalWeight(), totalWeightBefore - voteWeightToRemove, "Bridge operator is not removed"); + assertFalse(IBridgeManager(manager).isBridgeOperator(operatorToRemove), "Bridge operator is not removed"); + assertEq(IBridgeManager(manager).getBridgeOperatorWeight(operatorToRemove), 0, "Bridge operator is not removed"); + // Deprecated + // assertEq(IBridgeManager(manager).getGovernorsOf(operatorToRemove.toSingletonArray()), address(0).toSingletonArray(), "Bridge operator is not removed"); + } +} diff --git a/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol b/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol new file mode 100644 index 00000000..ac0a47a4 --- /dev/null +++ b/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol @@ -0,0 +1,97 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import { BasePostCheck } from "../../BasePostCheck.s.sol"; +import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; +import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; +import { TContract, Contract } from "script/utils/Contract.sol"; +import "script/shared/libraries/LibProposal.sol"; +import { LibProxy } from "@fdk/libraries/LibProxy.sol"; +import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol"; + +abstract contract PostCheck_BridgeManager_Proposal is BasePostCheck { + using LibArray for *; + using LibProxy for *; + using LibProposal for *; + + uint96[] private _voteWeights = [100, 100]; + address[] private _addingGovernors = [makeAddr("governor-1"), makeAddr("governor-2")]; + address[] private _addingOperators = [makeAddr("operator-1"), makeAddr("operator-2")]; + address[] private _proxyTargets; + + modifier onlyOnRoninNetwork() { + require( + block.chainid == DefaultNetwork.RoninMainnet.chainId() || block.chainid == DefaultNetwork.RoninTestnet.chainId() + || block.chainid == Network.RoninDevnet.chainId() || block.chainid == DefaultNetwork.Local.chainId(), + "chainid != RoninMainnet or RoninTestnet" + ); + _; + } + + function _validate_BridgeManager_Proposal() internal { + validate_ProposeGlobalProposalAndRelay_addBridgeOperator(); + validate_canExecuteUpgradeSingleProposal(); + } + + function validate_ProposeGlobalProposalAndRelay_addBridgeOperator() private onPostCheck("validate_ProposeGlobalProposalAndRelay_addBridgeOperator") { + RoninBridgeManager manager = RoninBridgeManager(loadContract(Contract.RoninBridgeManager.key())); + uint256 totalVoteWeight = manager.getTotalWeight(); + + uint256 cheatVoteWeight = totalVoteWeight * 2; + address cheatOperator = makeAddr(string.concat("operator-", vm.toString(seed))); + (address cheatGovernor, uint256 cheatGovernorPk) = makeAddrAndKey(string.concat("governor-", vm.toString(seed))); + + vm.prank(address(manager)); + bool[] memory addeds = + manager.addBridgeOperators(cheatVoteWeight.toSingletonArray().toUint96sUnsafe(), cheatGovernor.toSingletonArray(), cheatOperator.toSingletonArray()); + assertTrue(addeds[0], "addeds[0] == false"); + + GlobalProposal.TargetOption[] memory targetOptions = new GlobalProposal.TargetOption[](1); + targetOptions[0] = GlobalProposal.TargetOption.BridgeManager; + + GlobalProposal.GlobalProposalDetail memory globalProposal = LibProposal.createGlobalProposal({ + expiryTimestamp: block.timestamp + 20 minutes, + targetOptions: targetOptions, + values: uint256(0).toSingletonArray(), + calldatas: abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators)).toSingletonArray(), + gasAmounts: uint256(1_000_000).toSingletonArray(), + nonce: manager.round(block.chainid) + 1 + }); + + SignatureConsumer.Signature[] memory signatures = globalProposal.generateSignaturesGlobal(cheatGovernorPk.toSingletonArray(), Ballot.VoteType.For); + Ballot.VoteType[] memory _supports = new Ballot.VoteType[](signatures.length); + + vm.prank(cheatGovernor); + manager.proposeGlobalProposalStructAndCastVotes(globalProposal, _supports, signatures); + + // Check if the proposal is voted + assertEq(manager.globalProposalVoted(globalProposal.nonce, cheatGovernor), true); + // Check if the operator is added + assertTrue(manager.isBridgeOperator(cheatOperator), "operator not added"); + // Check if the governor is added + assertTrue(manager.isBridgeGovernor(cheatGovernor), "governor not added"); + + } + + function validate_canExecuteUpgradeSingleProposal() private onlyOnRoninNetwork onPostCheck("validate_canExecuteUpgradeProposal") { + address manager = loadContract(Contract.RoninBridgeManager.key()); + // Get all contracts deployed from the current network + address payable[] memory addrs = CONFIG.getAllAddresses(network()); + + // Identify proxy targets to upgrade with proposal + for (uint256 i; i < addrs.length; ++i) { + address payable proxy = addrs[i].getProxyAdmin({ nullCheck: false }); + if (proxy == manager) { + console.log("Target Proxy to test upgrade with proposal", vm.getLabel(addrs[i])); + _proxyTargets.push(addrs[i]); + } + } + + address[] memory targets = _proxyTargets; + for (uint256 i; i < targets.length; ++i) { + TContract contractType = CONFIG.getContractTypeFromCurrentNetwok(targets[i]); + console.log("Upgrading contract:", vm.getLabel(targets[i])); + _upgradeProxy(contractType); + } + } +} diff --git a/script/shared/libraries/LibArray.sol b/script/shared/libraries/LibArray.sol new file mode 100644 index 00000000..4152024e --- /dev/null +++ b/script/shared/libraries/LibArray.sol @@ -0,0 +1,293 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +/** + * @title LibArray + * @dev A library for array-related utility functions in Solidity. + */ +library LibArray { + /** + * @dev Error indicating a length mismatch between two arrays. + */ + error LengthMismatch(); + + function repeat(uint256 value, uint256 length) internal pure returns (uint256[] memory arr) { + arr = new uint256[](length); + for (uint256 i; i < length; ++i) { + arr[i] = value; + } + } + + function toSingletonArray(address self) internal pure returns (address[] memory arr) { + arr = new address[](1); + arr[0] = self; + } + + function toSingletonArray(bytes memory self) internal pure returns (bytes[] memory arr) { + arr = new bytes[](1); + arr[0] = self; + } + + function toSingletonArray(bytes32 self) internal pure returns (bytes32[] memory arr) { + arr = new bytes32[](1); + arr[0] = self; + } + + function toSingletonArray(uint256 self) internal pure returns (uint256[] memory arr) { + arr = new uint256[](1); + arr[0] = self; + } + + /** + * @dev Returns whether or not there's a duplicate. Runs in O(n^2). + * @param arr Array to search + * @return Returns true if duplicate, false otherwise + */ + function hasDuplicate(uint256[] memory arr) internal pure returns (bool) { + if (arr.length == 0) return false; + + unchecked { + for (uint256 i; i < arr.length - 1; ++i) { + for (uint256 j = i + 1; j < arr.length; ++j) { + if (arr[i] == arr[j]) return true; + } + } + } + + return false; + } + + /** + * @dev Returns whether two arrays of addresses are equal or not. + */ + function isEqual(uint256[] memory self, uint256[] memory other) internal pure returns (bool yes) { + yes = hash(self) == hash(other); + } + + /** + * @dev Return the concatenated array from a and b. + */ + function extend(address[] memory a, address[] memory b) internal pure returns (address[] memory c) { + unchecked { + uint256 lengthA = a.length; + uint256 lengthB = b.length; + c = new address[](lengthA + lengthB); + + uint256 i; + for (; i < lengthA;) { + c[i] = a[i]; + ++i; + } + for (uint256 j; j < lengthB;) { + c[i] = b[j]; + ++i; + ++j; + } + } + } + + /** + * @dev Converts an array of uint8 to an array of uint256. + * @param self The array of uint8. + * @return uint256s The resulting array of uint256s. + */ + function toUint256s(uint8[] memory self) internal pure returns (uint256[] memory uint256s) { + assembly ("memory-safe") { + uint256s := self + } + } + + /** + * @dev Converts an array of uint96 to an array of uint256. + * @param self The array of uint96. + * @return uint256s The resulting array of uint256s. + */ + function toUint256s(uint96[] memory self) internal pure returns (uint256[] memory uint256s) { + assembly ("memory-safe") { + uint256s := self + } + } + + /** + * @dev Down cast an array of uint256 to an array of uint8. + * @param self The array of uint256. + * @return uint8s The resulting array of uint256s. + * This function will result in invalid data if value in array is greater than 255. + * Use it as caution. + */ + function toUint8sUnsafe(uint256[] memory self) internal pure returns (uint8[] memory uint8s) { + assembly ("memory-safe") { + uint8s := self + } + } + + function toUint96sUnsafe(uint256[] memory self) internal pure returns (uint96[] memory uint96s) { + assembly ("memory-safe") { + uint96s := self + } + } + + function toAddressesUnsafe(uint256[] memory self) internal pure returns (address[] memory addrs) { + assembly ("memory-safe") { + addrs := self + } + } + + /** + * @dev Create an array of indices with provided range. + * @param length The array size + * @return data an array of indices + */ + function arange(uint256 length) internal pure returns (uint256[] memory data) { + data = new uint256[](length); + for (uint256 i; i < length; ++i) { + data[i] = i; + } + } + + /** + * @dev Converts an array of uint256 to an array of bytes32. + * @param self The array of uint256. + * @return bytes32s The resulting array of bytes32. + */ + function toBytes32s(uint256[] memory self) internal pure returns (bytes32[] memory bytes32s) { + assembly ("memory-safe") { + bytes32s := self + } + } + + /** + * @dev Hash dynamic size array + * @param self The array of uint256 + * @return digest The hash result of the array + */ + function hash(uint256[] memory self) internal pure returns (bytes32 digest) { + assembly ("memory-safe") { + digest := keccak256(add(self, 0x20), mul(mload(self), 0x20)) + } + } + + /** + * @dev Calculates the sum of an array of uint256 values. + * @param data The array of uint256 values for which the sum is calculated. + * @return result The sum of the provided array. + */ + function sum(uint256[] memory data) internal pure returns (uint256 result) { + assembly ("memory-safe") { + // Load the length (first 32 bytes) + let len := mload(data) + let dataElementLocation := add(data, 0x20) + + // Iterate until the bound is not met. + for { let end := add(dataElementLocation, mul(len, 0x20)) } lt(dataElementLocation, end) { dataElementLocation := add(dataElementLocation, 0x20) } { + result := add(result, mload(dataElementLocation)) + } + } + } + + /** + * @dev Converts an array of bytes32 to an array of uint256. + * @param self The array of bytes32. + * @return uint256s The resulting array of uint256. + */ + function toUint256s(bytes32[] memory self) internal pure returns (uint256[] memory uint256s) { + assembly ("memory-safe") { + uint256s := self + } + } + + /** + * @dev Converts an array of bool to an array of uint256. + * @param self The array of bool. + * @return uint256s The resulting array of uint256. + */ + function toUint256s(bool[] memory self) internal pure returns (uint256[] memory uint256s) { + assembly ("memory-safe") { + uint256s := self + } + } + + /** + * @dev Converts an array of uint64 to an array of uint256. + * @param self The array of uint64. + * @return uint256s The resulting array of uint256. + */ + function toUint256s(uint64[] memory self) internal pure returns (uint256[] memory uint256s) { + assembly ("memory-safe") { + uint256s := self + } + } + + /** + * @dev Converts an array of address to an array of uint256. + * @param self The array of address. + * @return uint256s The resulting array of uint256. + */ + function toUint256s(address[] memory self) internal pure returns (uint256[] memory uint256s) { + assembly ("memory-safe") { + uint256s := self + } + } + + /** + * @dev Sorts an array of uint256 values based on a corresponding array of values using the specified sorting mode. + * @param self The array to be sorted. + * @param values The corresponding array of values used for sorting. + * @notice This function modify `self` and `values` + * @return sorted The sorted array. + */ + function inplaceSortByValue(uint256[] memory self, uint256[] memory values) internal pure returns (uint256[] memory sorted) { + return inplaceQuickSortByValue(self, values); + } + + /** + * @dev Sorts an array of uint256 based on a corresponding array of values. + * @param self The array to be sorted. + * @param values The corresponding array of values used for sorting. + * @notice This function modify `self` and `values` + * @return sorted The sorted array. + */ + function inplaceQuickSortByValue(uint256[] memory self, uint256[] memory values) internal pure returns (uint256[] memory sorted) { + uint256 length = self.length; + if (length != values.length) revert LengthMismatch(); + unchecked { + if (length > 1) inplaceQuickSortByValue(self, values, 0, int256(length - 1)); + } + + assembly ("memory-safe") { + sorted := self + } + } + + /** + * @dev Internal function to perform quicksort on an array of uint256 values based on a corresponding array of values. + * @param arr The array to be sorted. + * @param values The corresponding array of values used for sorting. + * @param left The left index of the subarray to be sorted. + * @param right The right index of the subarray to be sorted. + * @notice This function modify `arr` and `values` + */ + function inplaceQuickSortByValue(uint256[] memory arr, uint256[] memory values, int256 left, int256 right) private pure { + unchecked { + if (left == right) return; + int256 i = left; + int256 j = right; + uint256 pivot = values[uint256(left + right) >> 1]; + + while (i <= j) { + while (pivot > values[uint256(i)]) ++i; + while (pivot < values[uint256(j)]) --j; + + if (i <= j) { + (arr[uint256(i)], arr[uint256(j)]) = (arr[uint256(j)], arr[uint256(i)]); + (values[uint256(i)], values[uint256(j)]) = (values[uint256(j)], values[uint256(i)]); + ++i; + --j; + } + } + + if (left < j) inplaceQuickSortByValue(arr, values, left, j); + if (i < right) inplaceQuickSortByValue(arr, values, i, right); + } + } +} diff --git a/script/shared/libraries/LibCompanionNetwork.sol b/script/shared/libraries/LibCompanionNetwork.sol new file mode 100644 index 00000000..60de2cb9 --- /dev/null +++ b/script/shared/libraries/LibCompanionNetwork.sol @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import { LibSharedAddress } from "@fdk/libraries/LibSharedAddress.sol"; +import { IGeneralConfigExtended } from "script/interfaces/IGeneralConfigExtended.sol"; +import { TNetwork } from "@fdk/types/Types.sol"; + +library LibCompanionNetwork { + IGeneralConfigExtended private constant config = IGeneralConfigExtended(LibSharedAddress.CONFIG); + + function companionChainId() internal returns (uint256 chainId) { + (chainId,) = companionNetworkData(); + } + + function companionChainId(TNetwork network) internal returns (uint256 chainId) { + (chainId,) = companionNetworkData(network); + } + + function companionNetwork() internal returns (TNetwork network) { + (, network) = companionNetworkData(); + } + + function companionNetwork(TNetwork network) internal returns (TNetwork companionTNetwork) { + (, companionTNetwork) = companionNetworkData(network); + } + + function companionNetworkData() internal returns (uint256, TNetwork) { + return companionNetworkData(config.getCurrentNetwork()); + } + + function companionNetworkData(TNetwork network) internal returns (uint256 chainId, TNetwork companionTNetwork) { + companionTNetwork = config.getCompanionNetwork(network); + config.switchTo(companionTNetwork); + chainId = block.chainid; + } +} diff --git a/script/shared/libraries/LibProposal.sol b/script/shared/libraries/LibProposal.sol new file mode 100644 index 00000000..55a621be --- /dev/null +++ b/script/shared/libraries/LibProposal.sol @@ -0,0 +1,269 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; +import { Vm } from "forge-std/Vm.sol"; +import { console2 as console } from "forge-std/console2.sol"; +import { IGeneralConfigExtended } from "script/interfaces/IGeneralConfigExtended.sol"; +import { TNetwork, Network } from "script/utils/Network.sol"; +import { Contract } from "script/utils/Contract.sol"; +import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol"; +import { LibSharedAddress } from "@fdk/libraries/LibSharedAddress.sol"; +import { Proposal } from "@ronin/contracts/libraries/Proposal.sol"; +import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; +import { Ballot } from "@ronin/contracts/libraries/Ballot.sol"; +import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; +import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; +import { CoreGovernance } from "@ronin/contracts/extensions/sequential-governance/CoreGovernance.sol"; +import { LibArray } from "./LibArray.sol"; +import { LibErrorHandler } from "lib/foundry-deployment-kit/lib/contract-libs/src/LibErrorHandler.sol"; +import { VoteStatusConsumer } from "@ronin/contracts/interfaces/consumers/VoteStatusConsumer.sol"; + +library LibProposal { + using LibArray for *; + using ECDSA for bytes32; + using LibErrorHandler for bool; + using Proposal for Proposal.ProposalDetail; + using GlobalProposal for GlobalProposal.GlobalProposalDetail; + + error ErrProposalOutOfGas(uint256 chainId, bytes4 msgSig, uint256 gasUsed); + + uint256 internal constant DEFAULT_PROPOSAL_GAS = 1_000_000; + Vm private constant vm = Vm(LibSharedAddress.VM); + IGeneralConfigExtended private constant config = IGeneralConfigExtended(LibSharedAddress.CONFIG); + + modifier preserveState() { + uint256 snapshotId = vm.snapshot(); + _; + vm.revertTo(snapshotId); + } + + function getBridgeManagerDomain() internal view returns (bytes32) { + return keccak256( + abi.encode( + keccak256("EIP712Domain(string name,string version,bytes32 salt)"), + keccak256("BridgeAdmin"), // name hash + keccak256("2"), // version hash + keccak256(abi.encode("BRIDGE_ADMIN", block.chainid)) // salt + ) + ); + } + + function createProposal( + uint256 nonce, + uint256 expiryTimestamp, + address[] memory targets, + uint256[] memory values, + bytes[] memory calldatas, + uint256[] memory gasAmounts + ) internal returns (Proposal.ProposalDetail memory proposal) { + address manager = config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key()); + verifyProposalGasAmount(manager, targets, values, calldatas, gasAmounts); + + proposal = Proposal.ProposalDetail({ + nonce: nonce, + chainId: block.chainid, + expiryTimestamp: expiryTimestamp, + targets: targets, + values: values, + calldatas: calldatas, + gasAmounts: gasAmounts + }); + } + + function createGlobalProposal( + uint256 nonce, + uint256 expiryTimestamp, + uint256[] memory values, + bytes[] memory calldatas, + uint256[] memory gasAmounts, + GlobalProposal.TargetOption[] memory targetOptions + ) internal returns (GlobalProposal.GlobalProposalDetail memory proposal) { + verifyGlobalProposalGasAmount(values, calldatas, gasAmounts, targetOptions); + proposal = GlobalProposal.GlobalProposalDetail({ + nonce: nonce, + expiryTimestamp: expiryTimestamp, + targetOptions: targetOptions, + values: values, + calldatas: calldatas, + gasAmounts: gasAmounts + }); + } + + function executeProposal(RoninBridgeManager manager, Proposal.ProposalDetail memory proposal) internal { + Ballot.VoteType support = Ballot.VoteType.For; + address[] memory governors = manager.getGovernors(); + + bool shouldPrankOnly = config.isPostChecking(); + address governor0 = governors[0]; + + if (shouldPrankOnly) { + vm.prank(governor0); + } else { + vm.broadcast(governor0); + } + manager.proposeProposalForCurrentNetwork(proposal.expiryTimestamp, proposal.targets, proposal.values, proposal.calldatas, proposal.gasAmounts, support); + + uint256 totalGas = proposal.gasAmounts.sum(); + // 20% more gas for each governor + totalGas += totalGas * 20_00 / 100_00; + // if totalGas is less than DEFAULT_PROPOSAL_GAS, set it to 120% of DEFAULT_PROPOSAL_GAS + if (totalGas < DEFAULT_PROPOSAL_GAS) totalGas = DEFAULT_PROPOSAL_GAS * 120_00 / 100_00; + + for (uint256 i = 1; i < governors.length; ++i) { + (VoteStatusConsumer.VoteStatus status,,,,) = manager.vote(block.chainid, proposal.nonce); + if (status != VoteStatusConsumer.VoteStatus.Pending) break; + + address governor = governors[i]; + if (shouldPrankOnly) { + vm.prank(governor); + } else { + vm.broadcast(governor); + } + + manager.castProposalVoteForCurrentNetwork{ gas: totalGas }(proposal, support); + } + } + + function verifyGlobalProposalGasAmount( + uint256[] memory values, + bytes[] memory calldatas, + uint256[] memory gasAmounts, + GlobalProposal.TargetOption[] memory targetOptions + ) internal { + address manager; + address companionManager; + TNetwork currentNetwork = config.getCurrentNetwork(); + TNetwork companionNetwork = config.getCompanionNetwork(currentNetwork); + address[] memory roninTargets = new address[](targetOptions.length); + address[] memory mainchainTargets = new address[](targetOptions.length); + + if (currentNetwork == Network.EthMainnet.key() || currentNetwork == Network.Goerli.key()) { + manager = config.getAddress(currentNetwork, Contract.MainchainBridgeManager.key()); + companionManager = config.getAddress(companionNetwork, Contract.RoninBridgeManager.key()); + } else { + manager = config.getAddress(currentNetwork, Contract.RoninBridgeManager.key()); + companionManager = config.getAddress(companionNetwork, Contract.MainchainBridgeManager.key()); + } + + for (uint256 i; i < roninTargets.length; i++) { + roninTargets[i] = resolveRoninTarget(targetOptions[i]); + mainchainTargets[i] = resolveMainchainTarget(targetOptions[i]); + } + + // Verify gas amount for ronin targets + verifyProposalGasAmount(manager, roninTargets, values, calldatas, gasAmounts); + + // Verify gas amount for mainchain targets + config.createFork(companionNetwork); + config.switchTo(companionNetwork); + + // Verify gas amount for mainchain targets + verifyProposalGasAmount(companionManager, mainchainTargets, values, calldatas, gasAmounts); + + config.switchTo(currentNetwork); + } + + function verifyProposalGasAmount( + address governance, + address[] memory targets, + uint256[] memory values, + bytes[] memory calldatas, + uint256[] memory gasAmounts + ) internal preserveState { + for (uint256 i; i < targets.length; i++) { + vm.deal(governance, values[i]); + vm.prank(governance); + + uint256 gasUsed = gasleft(); + (bool success, bytes memory returnOrRevertData) = targets[i].call{ value: values[i], gas: gasAmounts[i] }(calldatas[i]); + gasUsed = gasUsed - gasleft(); + + if (success) { + console.log("Call", i, ": gasUsed", gasUsed); + } else { + console.log("Call", i, unicode": reverted. ❗ GasUsed", gasUsed); + } + success.handleRevert(bytes4(calldatas[i]), returnOrRevertData); + + if (gasUsed > gasAmounts[i]) revert ErrProposalOutOfGas(block.chainid, bytes4(calldatas[i]), gasUsed); + } + } + + function generateSignatures( + Proposal.ProposalDetail memory proposal, + uint256[] memory signerPKs, + Ballot.VoteType support + ) internal view returns (SignatureConsumer.Signature[] memory sigs) { + return generateSignaturesFor(proposal.hash(), signerPKs, support); + } + + function generateSignaturesGlobal( + GlobalProposal.GlobalProposalDetail memory proposal, + uint256[] memory signerPKs, + Ballot.VoteType support + ) internal view returns (SignatureConsumer.Signature[] memory sigs) { + return generateSignaturesFor(proposal.hash(), signerPKs, support); + } + + function generateSignaturesFor( + bytes32 proposalHash, + uint256[] memory signerPKs, + Ballot.VoteType support + ) internal view returns (SignatureConsumer.Signature[] memory sigs) { + sigs = new SignatureConsumer.Signature[](signerPKs.length); + bytes32 domain = getBridgeManagerDomain(); + for (uint256 i; i < signerPKs.length; i++) { + bytes32 digest = domain.toTypedDataHash(Ballot.hash(proposalHash, support)); + sigs[i] = sign(signerPKs[i], digest); + } + } + + function resolveRoninTarget(GlobalProposal.TargetOption targetOption) internal view returns (address) { + TNetwork network = config.getCurrentNetwork(); + if (!(network == DefaultNetwork.RoninMainnet.key() || network == DefaultNetwork.RoninTestnet.key())) { + network = config.getCompanionNetwork(network); + } + + if (targetOption == GlobalProposal.TargetOption.BridgeManager) { + return config.getAddress(network, Contract.RoninBridgeManager.key()); + } + if (targetOption == GlobalProposal.TargetOption.GatewayContract) { + return config.getAddress(network, Contract.RoninGatewayV3.key()); + } + if (targetOption == GlobalProposal.TargetOption.BridgeReward) { + return config.getAddress(network, Contract.BridgeReward.key()); + } + if (targetOption == GlobalProposal.TargetOption.BridgeSlash) { + return config.getAddress(network, Contract.BridgeSlash.key()); + } + if (targetOption == GlobalProposal.TargetOption.BridgeTracking) { + return config.getAddress(network, Contract.BridgeTracking.key()); + } + + return address(0); + } + + function resolveMainchainTarget(GlobalProposal.TargetOption targetOption) internal view returns (address) { + TNetwork network = config.getCurrentNetwork(); + if (!(network == Network.EthMainnet.key() || network == Network.Goerli.key())) { + network = config.getCompanionNetwork(network); + } + + if (targetOption == GlobalProposal.TargetOption.BridgeManager) { + return config.getAddress(network, Contract.MainchainBridgeManager.key()); + } + if (targetOption == GlobalProposal.TargetOption.GatewayContract) { + return config.getAddress(network, Contract.MainchainGatewayV3.key()); + } + + return address(0); + } + + function sign(uint256 pk, bytes32 digest) private pure returns (SignatureConsumer.Signature memory sig) { + (uint8 v, bytes32 r, bytes32 s) = vm.sign(pk, digest); + sig.v = v; + sig.r = r; + sig.s = s; + } +} diff --git a/script/shared/libraries/LibRandom.sol b/script/shared/libraries/LibRandom.sol new file mode 100644 index 00000000..1ae0d1f9 --- /dev/null +++ b/script/shared/libraries/LibRandom.sol @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import { Math } from "@openzeppelin/contracts/utils/math/Math.sol"; +import { Vm } from "forge-std/Vm.sol"; +import { LibSharedAddress } from "@fdk/libraries/LibSharedAddress.sol"; + +library LibRandom { + Vm private constant vm = Vm(LibSharedAddress.VM); + + function generateSeed() internal returns (uint256) { + return uint256(keccak256(abi.encode(vm.unixTime()))); + } + + function randomize(uint256 seed, uint256 min, uint256 max) internal pure returns (uint256 r) { + r = Math.max(r, min); + r = Math.min(seed, max); + } + + function createRandomAddresses(uint256 seed, uint256 amount) internal returns (address[] memory addrs) { + addrs = new address[](amount); + + for (uint256 i; i < amount;) { + seed = uint256(keccak256(abi.encode(seed))); + addrs[i] = vm.addr(seed); + vm.etch(addrs[i], abi.encode()); + vm.deal(addrs[i], 1 ether); + + unchecked { + ++i; + } + } + } + + function createRandomNumbers(uint256 seed, uint256 amount, uint256 min, uint256 max) internal pure returns (uint256[] memory nums) { + uint256 r; + nums = new uint256[](amount); + + for (uint256 i; i < amount;) { + r = randomize(seed, min, max); + nums[i] = r; + seed = r; + + unchecked { + ++i; + } + } + } +} diff --git a/script/shared/libraries/LibTimeWarper.sol b/script/shared/libraries/LibTimeWarper.sol new file mode 100644 index 00000000..c83166dd --- /dev/null +++ b/script/shared/libraries/LibTimeWarper.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import { Vm } from "forge-std/Vm.sol"; +import { IGeneralConfig } from "@fdk/interfaces/IGeneralConfig.sol"; +import { LibSharedAddress } from "@fdk/libraries/LibSharedAddress.sol"; + +library LibTimeWarper { + Vm private constant vm = Vm(LibSharedAddress.VM); + IGeneralConfig private constant config = IGeneralConfig(LibSharedAddress.CONFIG); + uint256 private constant PERIOD_DURATION = 1 days; + uint256 private constant TIMESTAMP_PER_BLOCK = 3; + uint256 private constant NUMBER_OF_BLOCKS_IN_EPOCH = 200; + + function warpNextPeriod() internal { + uint256 epochEndingBlockNumber = block.number + (NUMBER_OF_BLOCKS_IN_EPOCH - 1) - (block.number % NUMBER_OF_BLOCKS_IN_EPOCH); + uint256 nextDayTimestamp = block.timestamp + 1 days; + + // fast forward to next day + vm.warp(nextDayTimestamp); + vm.roll(epochEndingBlockNumber); + } + + function isPeriodEnding() internal view returns (bool) { + return block.number % NUMBER_OF_BLOCKS_IN_EPOCH == NUMBER_OF_BLOCKS_IN_EPOCH - 1; + } + + function epochOf(uint256 blockNumber) internal pure returns (uint256) { + return blockNumber / NUMBER_OF_BLOCKS_IN_EPOCH + 1; + } + + function computePeriod(uint256 timestamp) internal pure returns (uint256) { + return timestamp / PERIOD_DURATION; + } + + function warp(uint256 numPeriod) internal { + for (uint256 i; i < numPeriod; i++) { + warpNextPeriod(); + } + } +} diff --git a/script/utils/Contract.sol b/script/utils/Contract.sol index bdaa906e..c8b4b689 100644 --- a/script/utils/Contract.sol +++ b/script/utils/Contract.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.23; -import { LibString, TContract } from "foundry-deployment-kit/types/Types.sol"; +import { LibString, TContract } from "@fdk/types/Types.sol"; enum Contract { WETH, diff --git a/script/utils/Network.sol b/script/utils/Network.sol index 9eda031a..f9d9a722 100644 --- a/script/utils/Network.sol +++ b/script/utils/Network.sol @@ -1,10 +1,11 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import { LibString, TNetwork } from "foundry-deployment-kit/types/Types.sol"; +import { LibString, TNetwork } from "@fdk/types/Types.sol"; enum Network { Goerli, + Sepolia, EthMainnet, RoninDevnet } @@ -14,6 +15,7 @@ using { key, name, chainId, chainAlias, envLabel, deploymentDir, explorer } for function chainId(Network network) pure returns (uint256) { if (network == Network.Goerli) return 5; if (network == Network.EthMainnet) return 1; + if (network == Network.Sepolia) return 11155111; if (network == Network.RoninDevnet) return 2022; revert("Network: Unknown chain id"); @@ -24,12 +26,14 @@ function key(Network network) pure returns (TNetwork) { } function explorer(Network network) pure returns (string memory link) { - if (network == Network.Goerli) return "https://goerli.etherscan.io/"; if (network == Network.EthMainnet) return "https://etherscan.io/"; + if (network == Network.Goerli) return "https://goerli.etherscan.io/"; + if (network == Network.Sepolia) return "hhttps://sepolia.etherscan.io/"; } function name(Network network) pure returns (string memory) { if (network == Network.Goerli) return "Goerli"; + if (network == Network.Sepolia) return "Sepolia"; if (network == Network.RoninDevnet) return "RoninDevnet"; if (network == Network.EthMainnet) return "EthMainnet"; @@ -38,6 +42,7 @@ function name(Network network) pure returns (string memory) { function deploymentDir(Network network) pure returns (string memory) { if (network == Network.Goerli) return "goerli/"; + if (network == Network.Sepolia) return "sepolia/"; if (network == Network.EthMainnet) return "ethereum/"; if (network == Network.RoninDevnet) return "ronin-devnet/"; @@ -46,6 +51,7 @@ function deploymentDir(Network network) pure returns (string memory) { function envLabel(Network network) pure returns (string memory) { if (network == Network.Goerli) return "TESTNET_PK"; + if (network == Network.Sepolia) return "TESTNET_PK"; if (network == Network.RoninDevnet) return "DEVNET_PK"; if (network == Network.EthMainnet) return "MAINNET_PK"; @@ -53,6 +59,7 @@ function envLabel(Network network) pure returns (string memory) { } function chainAlias(Network network) pure returns (string memory) { + if (network == Network.Sepolia) return "sepolia"; if (network == Network.Goerli) return "goerli"; if (network == Network.EthMainnet) return "ethereum"; if (network == Network.RoninDevnet) return "ronin-devnet"; diff --git a/src/extensions/GatewayV3.sol b/src/extensions/GatewayV3.sol index 6b10b19e..43c55b9e 100644 --- a/src/extensions/GatewayV3.sol +++ b/src/extensions/GatewayV3.sol @@ -44,10 +44,7 @@ abstract contract GatewayV3 is HasProxyAdmin, Pausable, IQuorum { /** * @inheritdoc IQuorum */ - function setThreshold( - uint256 _numerator, - uint256 _denominator - ) external virtual onlyAdmin returns (uint256, uint256) { + function setThreshold(uint256 _numerator, uint256 _denominator) external virtual onlyAdmin returns (uint256, uint256) { return _setThreshold(_numerator, _denominator); } @@ -80,10 +77,7 @@ abstract contract GatewayV3 is HasProxyAdmin, Pausable, IQuorum { * Emits the `ThresholdUpdated` event. * */ - function _setThreshold( - uint256 _numerator, - uint256 _denominator - ) internal virtual returns (uint256 _previousNum, uint256 _previousDenom) { + function _setThreshold(uint256 _numerator, uint256 _denominator) internal virtual returns (uint256 _previousNum, uint256 _previousDenom) { if (_numerator > _denominator) revert ErrInvalidThreshold(msg.sig); _previousNum = _num; _previousDenom = _denom; diff --git a/src/extensions/MinimumWithdrawal.sol b/src/extensions/MinimumWithdrawal.sol index fa717926..6ac1f530 100644 --- a/src/extensions/MinimumWithdrawal.sol +++ b/src/extensions/MinimumWithdrawal.sol @@ -47,7 +47,7 @@ abstract contract MinimumWithdrawal is HasProxyAdmin { function _setMinimumThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) internal virtual { if (_tokens.length != _thresholds.length) revert ErrLengthMismatch(msg.sig); - for (uint256 _i; _i < _tokens.length; ) { + for (uint256 _i; _i < _tokens.length;) { minimumThreshold[_tokens[_i]] = _thresholds[_i]; unchecked { diff --git a/src/extensions/RONTransferHelper.sol b/src/extensions/RONTransferHelper.sol index 5fc77b24..95fe234a 100644 --- a/src/extensions/RONTransferHelper.sol +++ b/src/extensions/RONTransferHelper.sol @@ -40,17 +40,13 @@ abstract contract RONTransferHelper { * */ function _unsafeSendRON(address payable recipient, uint256 amount) internal returns (bool success) { - (success, ) = recipient.call{ value: amount }(""); + (success,) = recipient.call{ value: amount }(""); } /** * @dev Same purpose with {_unsafeSendRONLimitGas(address,uin256)} but containing gas limit stipend forwarded in the call. */ - function _unsafeSendRONLimitGas( - address payable recipient, - uint256 amount, - uint256 gas - ) internal returns (bool success) { - (success, ) = recipient.call{ value: amount, gas: gas }(""); + function _unsafeSendRONLimitGas(address payable recipient, uint256 amount, uint256 gas) internal returns (bool success) { + (success,) = recipient.call{ value: amount, gas: gas }(""); } } diff --git a/src/extensions/TransparentUpgradeableProxyV2.sol b/src/extensions/TransparentUpgradeableProxyV2.sol index 96963683..af851ca3 100644 --- a/src/extensions/TransparentUpgradeableProxyV2.sol +++ b/src/extensions/TransparentUpgradeableProxyV2.sol @@ -4,11 +4,7 @@ pragma solidity ^0.8.0; import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; contract TransparentUpgradeableProxyV2 is TransparentUpgradeableProxy { - constructor( - address _logic, - address admin_, - bytes memory _data - ) payable TransparentUpgradeableProxy(_logic, admin_, _data) {} + constructor(address _logic, address admin_, bytes memory _data) payable TransparentUpgradeableProxy(_logic, admin_, _data) { } /** * @dev Calls a function from the current implementation as specified by `_data`, which should be an encoded function call. @@ -27,12 +23,8 @@ contract TransparentUpgradeableProxyV2 is TransparentUpgradeableProxy { let _result := delegatecall(gas(), _addr, add(_data, 32), mload(_data), 0, 0) returndatacopy(0, 0, returndatasize()) switch _result - case 0 { - revert(0, returndatasize()) - } - default { - return(0, returndatasize()) - } + case 0 { revert(0, returndatasize()) } + default { return(0, returndatasize()) } } } } diff --git a/src/extensions/WithdrawalLimitation.sol b/src/extensions/WithdrawalLimitation.sol index dc95c86f..586af812 100644 --- a/src/extensions/WithdrawalLimitation.sol +++ b/src/extensions/WithdrawalLimitation.sol @@ -9,11 +9,7 @@ abstract contract WithdrawalLimitation is GatewayV3 { /// @dev Emitted when the high-tier vote weight threshold is updated event HighTierVoteWeightThresholdUpdated( - uint256 indexed nonce, - uint256 indexed numerator, - uint256 indexed denominator, - uint256 previousNumerator, - uint256 previousDenominator + uint256 indexed nonce, uint256 indexed numerator, uint256 indexed denominator, uint256 previousNumerator, uint256 previousDenominator ); /// @dev Emitted when the thresholds for high-tier withdrawals that requires high-tier vote weights are updated event HighTierThresholdsUpdated(address[] tokens, uint256[] thresholds); @@ -56,10 +52,7 @@ abstract contract WithdrawalLimitation is GatewayV3 { * - The high-tier vote weight threshold must equal to or larger than the normal threshold. * */ - function setThreshold( - uint256 _numerator, - uint256 _denominator - ) external virtual override onlyAdmin returns (uint256 _previousNum, uint256 _previousDenom) { + function setThreshold(uint256 _numerator, uint256 _denominator) external virtual override onlyAdmin returns (uint256 _previousNum, uint256 _previousDenom) { (_previousNum, _previousDenom) = _setThreshold(_numerator, _denominator); _verifyThresholds(); } @@ -106,10 +99,7 @@ abstract contract WithdrawalLimitation is GatewayV3 { * Emits the `HighTierThresholdsUpdated` event. * */ - function setHighTierThresholds( - address[] calldata _tokens, - uint256[] calldata _thresholds - ) external virtual onlyAdmin { + function setHighTierThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) external virtual onlyAdmin { if (_tokens.length == 0) revert ErrEmptyArray(); _setHighTierThresholds(_tokens, _thresholds); } @@ -139,10 +129,7 @@ abstract contract WithdrawalLimitation is GatewayV3 { * Emits the `UnlockFeePercentagesUpdated` event. * */ - function setUnlockFeePercentages( - address[] calldata _tokens, - uint256[] calldata _percentages - ) external virtual onlyAdmin { + function setUnlockFeePercentages(address[] calldata _tokens, uint256[] calldata _percentages) external virtual onlyAdmin { if (_tokens.length == 0) revert ErrEmptyArray(); _setUnlockFeePercentages(_tokens, _percentages); } @@ -175,10 +162,7 @@ abstract contract WithdrawalLimitation is GatewayV3 { * Emits the `HighTierVoteWeightThresholdUpdated` event. * */ - function _setHighTierVoteWeightThreshold( - uint256 _numerator, - uint256 _denominator - ) internal returns (uint256 _previousNum, uint256 _previousDenom) { + function _setHighTierVoteWeightThreshold(uint256 _numerator, uint256 _denominator) internal returns (uint256 _previousNum, uint256 _previousDenom) { if (_numerator > _denominator) revert ErrInvalidThreshold(msg.sig); _previousNum = _highTierVWNum; @@ -203,7 +187,7 @@ abstract contract WithdrawalLimitation is GatewayV3 { function _setHighTierThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) internal virtual { if (_tokens.length != _thresholds.length) revert ErrLengthMismatch(msg.sig); - for (uint256 _i; _i < _tokens.length; ) { + for (uint256 _i; _i < _tokens.length;) { highTierThreshold[_tokens[_i]] = _thresholds[_i]; unchecked { @@ -225,7 +209,7 @@ abstract contract WithdrawalLimitation is GatewayV3 { function _setLockedThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) internal virtual { if (_tokens.length != _thresholds.length) revert ErrLengthMismatch(msg.sig); - for (uint256 _i; _i < _tokens.length; ) { + for (uint256 _i; _i < _tokens.length;) { lockedThreshold[_tokens[_i]] = _thresholds[_i]; unchecked { @@ -248,7 +232,7 @@ abstract contract WithdrawalLimitation is GatewayV3 { function _setUnlockFeePercentages(address[] calldata _tokens, uint256[] calldata _percentages) internal virtual { if (_tokens.length != _percentages.length) revert ErrLengthMismatch(msg.sig); - for (uint256 _i; _i < _tokens.length; ) { + for (uint256 _i; _i < _tokens.length;) { if (_percentages[_i] > _MAX_PERCENTAGE) revert ErrInvalidPercentage(); unlockFeePercentages[_tokens[_i]] = _percentages[_i]; @@ -272,7 +256,7 @@ abstract contract WithdrawalLimitation is GatewayV3 { function _setDailyWithdrawalLimits(address[] calldata _tokens, uint256[] calldata _limits) internal virtual { if (_tokens.length != _limits.length) revert ErrLengthMismatch(msg.sig); - for (uint256 _i; _i < _tokens.length; ) { + for (uint256 _i; _i < _tokens.length;) { dailyWithdrawalLimit[_tokens[_i]] = _limits[_i]; unchecked { diff --git a/src/extensions/bridge-operator-governance/BridgeTrackingHelper.sol b/src/extensions/bridge-operator-governance/BridgeTrackingHelper.sol index 4512c58f..f729f5ff 100644 --- a/src/extensions/bridge-operator-governance/BridgeTrackingHelper.sol +++ b/src/extensions/bridge-operator-governance/BridgeTrackingHelper.sol @@ -14,11 +14,7 @@ abstract contract BridgeTrackingHelper { * @notice The function checks if each individual ballot count is not greater than the total votes recorded. * @notice It also verifies that the sum of all individual ballot counts does not exceed the total available ballots. */ - function _isValidBridgeTrackingResponse( - uint256 totalBallot, - uint256 totalVote, - uint256[] memory ballots - ) internal pure returns (bool valid) { + function _isValidBridgeTrackingResponse(uint256 totalBallot, uint256 totalVote, uint256[] memory ballots) internal pure returns (bool valid) { valid = true; uint256 sumBallot; uint256 length = ballots.length; diff --git a/src/interfaces/IBridgeAdminProposal.sol b/src/interfaces/IBridgeAdminProposal.sol index b6c22fb6..cf0b0149 100644 --- a/src/interfaces/IBridgeAdminProposal.sol +++ b/src/interfaces/IBridgeAdminProposal.sol @@ -15,8 +15,5 @@ interface IBridgeAdminProposal { /** * @dev Returns the synced bridge operator set info. */ - function lastSyncedBridgeOperatorSetInfo() - external - view - returns (BridgeOperatorsBallot.BridgeOperatorSet memory bridgeOperatorSetInfo); + function lastSyncedBridgeOperatorSetInfo() external view returns (BridgeOperatorsBallot.BridgeOperatorSet memory bridgeOperatorSetInfo); } diff --git a/src/interfaces/IMainchainGatewayV3.sol b/src/interfaces/IMainchainGatewayV3.sol index 5613d096..d609494d 100644 --- a/src/interfaces/IMainchainGatewayV3.sol +++ b/src/interfaces/IMainchainGatewayV3.sol @@ -83,10 +83,7 @@ interface IMainchainGatewayV3 is SignatureConsumer, MappedTokenConsumer { * Emits the `Withdrew` once the assets are released. * */ - function submitWithdrawal( - Transfer.Receipt memory _receipt, - Signature[] memory _signatures - ) external returns (bool _locked); + function submitWithdrawal(Transfer.Receipt memory _receipt, Signature[] memory _signatures) external returns (bool _locked); /** * @dev Approves a specific withdrawal. @@ -109,11 +106,7 @@ interface IMainchainGatewayV3 is SignatureConsumer, MappedTokenConsumer { * Emits the `TokenMapped` event. * */ - function mapTokens( - address[] calldata _mainchainTokens, - address[] calldata _roninTokens, - Token.Standard[] calldata _standards - ) external; + function mapTokens(address[] calldata _mainchainTokens, address[] calldata _roninTokens, Token.Standard[] calldata _standards) external; /** * @dev Maps mainchain tokens to Ronin network and sets thresholds. diff --git a/src/interfaces/IQuorum.sol b/src/interfaces/IQuorum.sol index 29c8f462..97619626 100644 --- a/src/interfaces/IQuorum.sol +++ b/src/interfaces/IQuorum.sol @@ -3,13 +3,7 @@ pragma solidity ^0.8.0; interface IQuorum { /// @dev Emitted when the threshold is updated - event ThresholdUpdated( - uint256 indexed nonce, - uint256 indexed numerator, - uint256 indexed denominator, - uint256 previousNumerator, - uint256 previousDenominator - ); + event ThresholdUpdated(uint256 indexed nonce, uint256 indexed numerator, uint256 indexed denominator, uint256 previousNumerator, uint256 previousDenominator); /** * @dev Returns the threshold. @@ -35,8 +29,5 @@ interface IQuorum { * Emits the `ThresholdUpdated` event. * */ - function setThreshold( - uint256 _numerator, - uint256 _denominator - ) external returns (uint256 _previousNum, uint256 _previousDenom); + function setThreshold(uint256 _numerator, uint256 _denominator) external returns (uint256 _previousNum, uint256 _previousDenom); } diff --git a/src/interfaces/IRoninGatewayV3.sol b/src/interfaces/IRoninGatewayV3.sol index 7e72bcfa..c3a9daa9 100644 --- a/src/interfaces/IRoninGatewayV3.sol +++ b/src/interfaces/IRoninGatewayV3.sol @@ -32,11 +32,7 @@ interface IRoninGatewayV3 is MappedTokenConsumer { event TokenMapped(address[] roninTokens, address[] mainchainTokens, uint256[] chainIds, Token.Standard[] standards); /// @dev Emitted when the threshold is updated event TrustedThresholdUpdated( - uint256 indexed nonce, - uint256 indexed numerator, - uint256 indexed denominator, - uint256 previousNumerator, - uint256 previousDenominator + uint256 indexed nonce, uint256 indexed numerator, uint256 indexed denominator, uint256 previousNumerator, uint256 previousDenominator ); /// @dev Emitted when a deposit is voted event DepositVoted(address indexed bridgeOperator, uint256 indexed id, uint256 indexed chainId, bytes32 receiptHash); @@ -49,10 +45,7 @@ interface IRoninGatewayV3 is MappedTokenConsumer { /** * @dev Returns withdrawal signatures. */ - function getWithdrawalSignatures( - uint256 _withdrawalId, - address[] calldata _validators - ) external view returns (bytes[] memory); + function getWithdrawalSignatures(uint256 _withdrawalId, address[] calldata _validators) external view returns (bytes[] memory); /** * @dev Deposits based on the receipt. diff --git a/src/interfaces/bridge/IBridgeManagerCallback.sol b/src/interfaces/bridge/IBridgeManagerCallback.sol index 9d63f0f8..22c0d730 100644 --- a/src/interfaces/bridge/IBridgeManagerCallback.sol +++ b/src/interfaces/bridge/IBridgeManagerCallback.sol @@ -14,11 +14,7 @@ interface IBridgeManagerCallback is IERC165 { * @param addeds The corresponding boolean values indicating whether the operators were added or not. * @return selector The selector of the function being called. */ - function onBridgeOperatorsAdded( - address[] memory bridgeOperators, - uint96[] calldata weights, - bool[] memory addeds - ) external returns (bytes4 selector); + function onBridgeOperatorsAdded(address[] memory bridgeOperators, uint96[] calldata weights, bool[] memory addeds) external returns (bytes4 selector); /** * @dev Handles the event when bridge operators are removed. @@ -26,8 +22,5 @@ interface IBridgeManagerCallback is IERC165 { * @param removeds The corresponding boolean values indicating whether the operators were removed or not. * @return selector The selector of the function being called. */ - function onBridgeOperatorsRemoved( - address[] memory bridgeOperators, - bool[] memory removeds - ) external returns (bytes4 selector); + function onBridgeOperatorsRemoved(address[] memory bridgeOperators, bool[] memory removeds) external returns (bytes4 selector); } diff --git a/src/interfaces/bridge/IBridgeSlash.sol b/src/interfaces/bridge/IBridgeSlash.sol index fd90f78a..d2d60b1b 100644 --- a/src/interfaces/bridge/IBridgeSlash.sol +++ b/src/interfaces/bridge/IBridgeSlash.sol @@ -12,13 +12,7 @@ interface IBridgeSlash is IBridgeSlashEvents { * @dev Slashes the unavailability of bridge operators during a specific period. * @param period The period to slash the bridge operators for. */ - function execSlashBridgeOperators( - address[] calldata operators, - uint256[] calldata ballots, - uint256 totalBallot, - uint256 totalVote, - uint256 period - ) external; + function execSlashBridgeOperators(address[] calldata operators, uint256[] calldata ballots, uint256 totalBallot, uint256 totalVote, uint256 period) external; /** * @dev Returns the penalize durations for the specified bridge operators. diff --git a/src/interfaces/bridge/IBridgeTracking.sol b/src/interfaces/bridge/IBridgeTracking.sol index 1b86b232..32ee5386 100644 --- a/src/interfaces/bridge/IBridgeTracking.sol +++ b/src/interfaces/bridge/IBridgeTracking.sol @@ -33,10 +33,7 @@ interface IBridgeTracking { /** * @dev Returns the total number of ballots of bridge operators at the specific period `_period`. */ - function getManyTotalBallots( - uint256 _period, - address[] calldata _bridgeOperators - ) external view returns (uint256[] memory); + function getManyTotalBallots(uint256 _period, address[] calldata _bridgeOperators) external view returns (uint256[] memory); /** * @dev Returns the total number of ballots of a bridge operator at the specific period `_period`. diff --git a/src/interfaces/validator/ICandidateManager.sol b/src/interfaces/validator/ICandidateManager.sol index 2ccb5bee..7d52576e 100644 --- a/src/interfaces/validator/ICandidateManager.sol +++ b/src/interfaces/validator/ICandidateManager.sol @@ -110,12 +110,7 @@ interface ICandidateManager { * Emits the event `CandidateGranted`. * */ - function execApplyValidatorCandidate( - address _admin, - address _consensusAddr, - address payable _treasuryAddr, - uint256 _commissionRate - ) external; + function execApplyValidatorCandidate(address _admin, address _consensusAddr, address payable _treasuryAddr, uint256 _commissionRate) external; /** * @dev Requests to revoke a validator candidate in next `_secsLeft` seconds. diff --git a/src/interfaces/validator/ICoinbaseExecution.sol b/src/interfaces/validator/ICoinbaseExecution.sol index c1946d16..15d92f06 100644 --- a/src/interfaces/validator/ICoinbaseExecution.sol +++ b/src/interfaces/validator/ICoinbaseExecution.sol @@ -19,59 +19,31 @@ interface ICoinbaseExecution is ISlashingExecution { event BridgeOperatorSetUpdated(uint256 indexed period, uint256 indexed epoch, address[] bridgeOperators); /// @dev Emitted when the reward of the block producer is deprecated. - event BlockRewardDeprecated( - address indexed coinbaseAddr, - uint256 rewardAmount, - BlockRewardDeprecatedType deprecatedType - ); + event BlockRewardDeprecated(address indexed coinbaseAddr, uint256 rewardAmount, BlockRewardDeprecatedType deprecatedType); /// @dev Emitted when the block reward is submitted. event BlockRewardSubmitted(address indexed coinbaseAddr, uint256 submittedAmount, uint256 bonusAmount); /// @dev Emitted when the block producer reward is distributed. event MiningRewardDistributed(address indexed consensusAddr, address indexed recipient, uint256 amount); /// @dev Emitted when the contract fails when distributing the block producer reward. - event MiningRewardDistributionFailed( - address indexed consensusAddr, - address indexed recipient, - uint256 amount, - uint256 contractBalance - ); + event MiningRewardDistributionFailed(address indexed consensusAddr, address indexed recipient, uint256 amount, uint256 contractBalance); /// @dev Emitted when the bridge operator reward is distributed. - event BridgeOperatorRewardDistributed( - address indexed consensusAddr, - address indexed bridgeOperator, - address indexed recipientAddr, - uint256 amount - ); + event BridgeOperatorRewardDistributed(address indexed consensusAddr, address indexed bridgeOperator, address indexed recipientAddr, uint256 amount); /// @dev Emitted when the contract fails when distributing the bridge operator reward. event BridgeOperatorRewardDistributionFailed( - address indexed consensusAddr, - address indexed bridgeOperator, - address indexed recipient, - uint256 amount, - uint256 contractBalance + address indexed consensusAddr, address indexed bridgeOperator, address indexed recipient, uint256 amount, uint256 contractBalance ); /// @dev Emitted when the fast finality reward is distributed. event FastFinalityRewardDistributed(address indexed consensusAddr, address indexed recipient, uint256 amount); /// @dev Emitted when the contract fails when distributing the fast finality reward. - event FastFinalityRewardDistributionFailed( - address indexed consensusAddr, - address indexed recipient, - uint256 amount, - uint256 contractBalance - ); + event FastFinalityRewardDistributionFailed(address indexed consensusAddr, address indexed recipient, uint256 amount, uint256 contractBalance); /// @dev Emitted when the amount of RON reward is distributed to staking contract. event StakingRewardDistributed(uint256 totalAmount, address[] consensusAddrs, uint256[] amounts); /// @dev Emitted when the contracts fails when distributing the amount of RON to the staking contract. - event StakingRewardDistributionFailed( - uint256 totalAmount, - address[] consensusAddrs, - uint256[] amounts, - uint256 contractBalance - ); + event StakingRewardDistributionFailed(uint256 totalAmount, address[] consensusAddrs, uint256[] amounts, uint256 contractBalance); /// @dev Emitted when the epoch is wrapped up. event WrappedUpEpoch(uint256 indexed periodNumber, uint256 indexed epochNumber, bool periodEnding); diff --git a/src/interfaces/validator/IEmergencyExit.sol b/src/interfaces/validator/IEmergencyExit.sol index d6a2cb5e..33c59060 100644 --- a/src/interfaces/validator/IEmergencyExit.sol +++ b/src/interfaces/validator/IEmergencyExit.sol @@ -6,18 +6,9 @@ interface IEmergencyExit { /// @dev Emitted when the fund is locked from an emergency exit request event EmergencyExitRequested(address indexed consensusAddr, uint256 lockedAmount); /// @dev Emitted when the fund that locked from an emergency exit request is transferred to the recipient. - event EmergencyExitLockedFundReleased( - address indexed consensusAddr, - address indexed recipient, - uint256 unlockedAmount - ); + event EmergencyExitLockedFundReleased(address indexed consensusAddr, address indexed recipient, uint256 unlockedAmount); /// @dev Emitted when the fund that locked from an emergency exit request is failed to transferred back. - event EmergencyExitLockedFundReleasingFailed( - address indexed consensusAddr, - address indexed recipient, - uint256 unlockedAmount, - uint256 contractBalance - ); + event EmergencyExitLockedFundReleasingFailed(address indexed consensusAddr, address indexed recipient, uint256 unlockedAmount, uint256 contractBalance); /// @dev Emitted when the emergency exit locked amount is updated. event EmergencyExitLockedAmountUpdated(uint256 amount); diff --git a/src/interfaces/validator/IRoninValidatorSet.sol b/src/interfaces/validator/IRoninValidatorSet.sol index 6628bf13..7e7f9f15 100644 --- a/src/interfaces/validator/IRoninValidatorSet.sol +++ b/src/interfaces/validator/IRoninValidatorSet.sol @@ -8,10 +8,4 @@ import "./ICoinbaseExecution.sol"; import "./ISlashingExecution.sol"; import "./IEmergencyExit.sol"; -interface IRoninValidatorSet is - ICandidateManager, - ICommonInfo, - ISlashingExecution, - ICoinbaseExecution, - IEmergencyExit -{} +interface IRoninValidatorSet is ICandidateManager, ICommonInfo, ISlashingExecution, ICoinbaseExecution, IEmergencyExit { } diff --git a/src/interfaces/validator/info-fragments/IJailingInfo.sol b/src/interfaces/validator/info-fragments/IJailingInfo.sol index e838df9c..b9735430 100644 --- a/src/interfaces/validator/info-fragments/IJailingInfo.sol +++ b/src/interfaces/validator/info-fragments/IJailingInfo.sol @@ -11,9 +11,7 @@ interface IJailingInfo { /** * @dev Returns whether the validator are put in jail and the number of block and epoch that he still is in the jail. */ - function getJailedTimeLeft( - address _addr - ) external view returns (bool isJailed_, uint256 blockLeft_, uint256 epochLeft_); + function getJailedTimeLeft(address _addr) external view returns (bool isJailed_, uint256 blockLeft_, uint256 epochLeft_); /** * @dev Returns whether the validator are put in jail (cannot join the set of validators) at a specific block. @@ -23,10 +21,7 @@ interface IJailingInfo { /** * @dev Returns whether the validator are put in jail at a specific block and the number of block and epoch that he still is in the jail. */ - function getJailedTimeLeftAtBlock( - address _addr, - uint256 _blockNum - ) external view returns (bool isJailed_, uint256 blockLeft_, uint256 epochLeft_); + function getJailedTimeLeftAtBlock(address _addr, uint256 _blockNum) external view returns (bool isJailed_, uint256 blockLeft_, uint256 epochLeft_); /** * @dev Returns whether the validators are put in jail (cannot join the set of validators) during the current period. diff --git a/src/libraries/BridgeOperatorsBallot.sol b/src/libraries/BridgeOperatorsBallot.sol index 347942ad..91499b9f 100644 --- a/src/libraries/BridgeOperatorsBallot.sol +++ b/src/libraries/BridgeOperatorsBallot.sol @@ -17,8 +17,7 @@ library BridgeOperatorsBallot { } // keccak256("BridgeOperatorsBallot(uint256 period,uint256 epoch,address[] operators)"); - bytes32 public constant BRIDGE_OPERATORS_BALLOT_TYPEHASH = - 0xd679a49e9e099fa9ed83a5446aaec83e746b03ec6723d6f5efb29d37d7f0b78a; + bytes32 public constant BRIDGE_OPERATORS_BALLOT_TYPEHASH = 0xd679a49e9e099fa9ed83a5446aaec83e746b03ec6723d6f5efb29d37d7f0b78a; /** * @dev Verifies whether the ballot is valid or not. @@ -32,7 +31,7 @@ library BridgeOperatorsBallot { if (_ballot.operators.length == 0) revert ErrEmptyArray(); address _addr = _ballot.operators[0]; - for (uint _i = 1; _i < _ballot.operators.length; ) { + for (uint _i = 1; _i < _ballot.operators.length;) { if (_addr >= _ballot.operators[_i]) revert ErrInvalidOrderOfBridgeOperator(); _addr = _ballot.operators[_i]; unchecked { diff --git a/src/libraries/GlobalProposal.sol b/src/libraries/GlobalProposal.sol index fafab22d..d31eb09b 100644 --- a/src/libraries/GlobalProposal.sol +++ b/src/libraries/GlobalProposal.sol @@ -10,11 +10,16 @@ library GlobalProposal { error ErrUnsupportedTarget(bytes32 proposalHash, uint256 targetNumber); enum TargetOption { - /* 0 */ BridgeManager, - /* 1 */ GatewayContract, - /* 2 */ BridgeReward, - /* 3 */ BridgeSlash, - /* 4 */ BridgeTracking + /* 0 */ + BridgeManager, + /* 1 */ + GatewayContract, + /* 2 */ + BridgeReward, + /* 3 */ + BridgeSlash, + /* 4 */ + BridgeTracking } struct GlobalProposalDetail { diff --git a/src/libraries/Token.sol b/src/libraries/Token.sol index 49e2fa77..c475cc98 100644 --- a/src/libraries/Token.sol +++ b/src/libraries/Token.sol @@ -70,10 +70,9 @@ library Token { * @dev Validates the token info. */ function validate(Info memory _info) internal pure { - if ( - !((_info.erc == Standard.ERC20 && _info.quantity > 0 && _info.id == 0) || - (_info.erc == Standard.ERC721 && _info.quantity == 0)) - ) revert ErrInvalidInfo(); + if (!((_info.erc == Standard.ERC20 && _info.quantity > 0 && _info.id == 0) || (_info.erc == Standard.ERC721 && _info.quantity == 0))) { + revert ErrInvalidInfo(); + } } /** @@ -91,8 +90,10 @@ library Token { _success = _success && (_data.length == 0 || abi.decode(_data, (bool))); } else if (_info.erc == Standard.ERC721) { // bytes4(keccak256("transferFrom(address,address,uint256)")) - (_success, ) = _token.call(abi.encodeWithSelector(0x23b872dd, _from, _to, _info.id)); - } else revert ErrUnsupportedStandard(); + (_success,) = _token.call(abi.encodeWithSelector(0x23b872dd, _from, _to, _info.id)); + } else { + revert ErrUnsupportedStandard(); + } if (!_success) revert ErrTokenCouldNotTransferFrom(_info, _from, _to, _token); } @@ -101,7 +102,7 @@ library Token { * @dev Transfers ERC721 token and returns the result. */ function tryTransferERC721(address _token, address _to, uint256 _id) internal returns (bool _success) { - (_success, ) = _token.call(abi.encodeWithSelector(IERC721.transferFrom.selector, address(this), _to, _id)); + (_success,) = _token.call(abi.encodeWithSelector(IERC721.transferFrom.selector, address(this), _to, _id)); } /** @@ -122,7 +123,9 @@ library Token { _success = tryTransferERC20(_token, _to, _info.quantity); } else if (_info.erc == Standard.ERC721) { _success = tryTransferERC721(_token, _to, _info.id); - } else revert ErrUnsupportedStandard(); + } else { + revert ErrUnsupportedStandard(); + } if (!_success) revert ErrTokenCouldNotTransfer(_info, _to, _token); } @@ -133,12 +136,7 @@ library Token { * @notice Prioritizes transfer native token if the token is wrapped. * */ - function handleAssetTransfer( - Info memory _info, - address payable _to, - address _token, - IWETH _wrappedNativeToken - ) internal { + function handleAssetTransfer(Info memory _info, address payable _to, address _token, IWETH _wrappedNativeToken) internal { bool _success; if (_token == address(_wrappedNativeToken)) { // Try sending the native token before transferring the wrapped token @@ -151,7 +149,7 @@ library Token { if (_balance < _info.quantity) { // bytes4(keccak256("mint(address,uint256)")) - (_success, ) = _token.call(abi.encodeWithSelector(0x40c10f19, address(this), _info.quantity - _balance)); + (_success,) = _token.call(abi.encodeWithSelector(0x40c10f19, address(this), _info.quantity - _balance)); if (!_success) revert ErrERC20MintingFailed(); } @@ -159,10 +157,12 @@ library Token { } else if (_info.erc == Token.Standard.ERC721) { if (!tryTransferERC721(_token, _to, _info.id)) { // bytes4(keccak256("mint(address,uint256)")) - (_success, ) = _token.call(abi.encodeWithSelector(0x40c10f19, _to, _info.id)); + (_success,) = _token.call(abi.encodeWithSelector(0x40c10f19, _to, _info.id)); if (!_success) revert ErrERC721MintingFailed(); } - } else revert ErrUnsupportedStandard(); + } else { + revert ErrUnsupportedStandard(); + } } struct Owner { diff --git a/src/mocks/ronin/MockBridgeReward.sol b/src/mocks/ronin/MockBridgeReward.sol index ef7fc602..87ca3c88 100644 --- a/src/mocks/ronin/MockBridgeReward.sol +++ b/src/mocks/ronin/MockBridgeReward.sol @@ -13,16 +13,7 @@ contract MockBridgeReward is BridgeReward { uint256 period, uint256 slashUntilPeriod ) external pure returns (uint256 reward, bool isSlashed) { - return - _calcRewardAndCheckSlashedStatus( - isValidTrackingResponse, - numBridgeOperators, - rewardPerPeriod, - ballot, - totalBallot, - period, - slashUntilPeriod - ); + return _calcRewardAndCheckSlashedStatus(isValidTrackingResponse, numBridgeOperators, rewardPerPeriod, ballot, totalBallot, period, slashUntilPeriod); } function calcReward( @@ -35,19 +26,11 @@ contract MockBridgeReward is BridgeReward { reward = _calcReward(isValidTrackingResponse, numBridgeOperators, rewardPerPeriod, ballot, totalBallot); } - function isValidBridgeTrackingResponse( - uint256 totalBallot, - uint256 totalVote, - uint256[] memory ballots - ) external pure returns (bool valid) { + function isValidBridgeTrackingResponse(uint256 totalBallot, uint256 totalVote, uint256[] memory ballots) external pure returns (bool valid) { return _isValidBridgeTrackingResponse(totalBallot, totalVote, ballots); } - function shouldShareEqually( - uint256 totalBallot, - uint256 totalVote, - uint256[] memory ballots - ) external returns (bool shareEqually) { + function shouldShareEqually(uint256 totalBallot, uint256 totalVote, uint256[] memory ballots) external returns (bool shareEqually) { return _shouldShareEqually(totalBallot, totalVote, ballots); } diff --git a/src/mocks/ronin/MockBridgeSlash.sol b/src/mocks/ronin/MockBridgeSlash.sol index 2210b20e..e4c0f0d9 100644 --- a/src/mocks/ronin/MockBridgeSlash.sol +++ b/src/mocks/ronin/MockBridgeSlash.sol @@ -4,11 +4,7 @@ pragma solidity ^0.8.0; import { IBridgeSlash, BridgeSlash } from "../../ronin/gateway/BridgeSlash.sol"; contract MockBridgeSlash is BridgeSlash { - function calcSlashUntilPeriod( - Tier tier, - uint256 period, - uint256 slashUntilPeriod - ) external pure returns (uint256 newSlashUntilPeriod) { + function calcSlashUntilPeriod(Tier tier, uint256 period, uint256 slashUntilPeriod) external pure returns (uint256 newSlashUntilPeriod) { newSlashUntilPeriod = _calcSlashUntilPeriod(tier, period, slashUntilPeriod, _getPenaltyDurations()); } diff --git a/src/mocks/ronin/MockRoninGatewayV3Extended.sol b/src/mocks/ronin/MockRoninGatewayV3Extended.sol index de7c9c9b..e988c854 100644 --- a/src/mocks/ronin/MockRoninGatewayV3Extended.sol +++ b/src/mocks/ronin/MockRoninGatewayV3Extended.sol @@ -7,31 +7,21 @@ contract MockRoninGatewayV3Extended is RoninGatewayV3 { /* * @dev Returns the vote weight for a deposit based on its corressponding hash. */ - function getDepositVoteWeight( - uint256 _chainId, - uint256 _depositId, - bytes32 _hash - ) external view returns (uint256 totalWeight) { + function getDepositVoteWeight(uint256 _chainId, uint256 _depositId, bytes32 _hash) external view returns (uint256 totalWeight) { totalWeight = _getVoteWeight(depositVote[_chainId][_depositId], _hash); } /** * @dev Returns the vote weight for a mainchain withdrew acknowledgement based on its corressponding hash. */ - function getMainchainWithdrewVoteWeight( - uint256 _withdrawalId, - bytes32 _hash - ) external view returns (uint256 totalWeight) { + function getMainchainWithdrewVoteWeight(uint256 _withdrawalId, bytes32 _hash) external view returns (uint256 totalWeight) { totalWeight = _getVoteWeight(mainchainWithdrewVote[_withdrawalId], _hash); } /** * @dev Returns the vote weight for a withdraw stats based on its corressponding hash. */ - function getWithdrawalStatVoteWeight( - uint256 _withdrawalId, - bytes32 _hash - ) external view returns (uint256 totalWeight) { + function getWithdrawalStatVoteWeight(uint256 _withdrawalId, bytes32 _hash) external view returns (uint256 totalWeight) { totalWeight = _getVoteWeight(withdrawalStatVote[_withdrawalId], _hash); } } diff --git a/src/mocks/types/MockTUint256Slot.sol b/src/mocks/types/MockTUint256Slot.sol index 343775db..1be35e20 100644 --- a/src/mocks/types/MockTUint256Slot.sol +++ b/src/mocks/types/MockTUint256Slot.sol @@ -4,8 +4,7 @@ pragma solidity ^0.8.0; import { TUint256Slot } from "../../types/Types.sol"; contract MockTUint256Slot { - TUint256Slot private constant CUSTOM_SLOT_UINT256 = - TUint256Slot.wrap(keccak256(abi.encode(type(MockTUint256Slot).name))); + TUint256Slot private constant CUSTOM_SLOT_UINT256 = TUint256Slot.wrap(keccak256(abi.encode(type(MockTUint256Slot).name))); uint256 private _primitiveUint256; diff --git a/src/ronin/gateway/BridgeSlash.sol b/src/ronin/gateway/BridgeSlash.sol index 62a834b3..74eb0ecf 100644 --- a/src/ronin/gateway/BridgeSlash.sol +++ b/src/ronin/gateway/BridgeSlash.sol @@ -17,14 +17,7 @@ import { ErrLengthMismatch } from "../../utils/CommonErrors.sol"; * @title BridgeSlash * @dev A contract that implements slashing functionality for bridge operators based on their availability. */ -contract BridgeSlash is - IBridgeSlash, - IBridgeManagerCallback, - BridgeTrackingHelper, - IdentityGuard, - Initializable, - HasContracts -{ +contract BridgeSlash is IBridgeSlash, IBridgeManagerCallback, BridgeTrackingHelper, IdentityGuard, Initializable, HasContracts { /// @inheritdoc IBridgeSlash uint256 public constant TIER_1_PENALTY_DURATION = 1; /// @inheritdoc IBridgeSlash @@ -66,12 +59,7 @@ contract BridgeSlash is _disableInitializers(); } - function initialize( - address validatorContract, - address bridgeManagerContract, - address bridgeTrackingContract, - address dposGA - ) external initializer { + function initialize(address validatorContract, address bridgeManagerContract, address bridgeTrackingContract, address dposGA) external initializer { _setContract(ContractType.VALIDATOR, validatorContract); _setContract(ContractType.BRIDGE_MANAGER, bridgeManagerContract); _setContract(ContractType.BRIDGE_TRACKING, bridgeTrackingContract); @@ -93,7 +81,7 @@ contract BridgeSlash is */ function onBridgeOperatorsAdded( address[] calldata bridgeOperators, - uint96[] calldata /* weights */, + uint96[] calldata, /* weights */ bool[] memory addeds ) external onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) { uint256 length = bridgeOperators.length; @@ -105,7 +93,7 @@ contract BridgeSlash is mapping(address => BridgeSlashInfo) storage _bridgeSlashInfos = _getBridgeSlashInfos(); uint256 currentPeriod = IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod(); - for (uint256 i; i < length; ) { + for (uint256 i; i < length;) { unchecked { if (addeds[i]) { _bridgeSlashInfos[bridgeOperators[i]].newlyAddedAtPeriod = uint128(currentPeriod); @@ -146,7 +134,7 @@ contract BridgeSlash is address bridgeOperator; Tier tier; - for (uint256 i; i < operators.length; ) { + for (uint256 i; i < operators.length;) { bridgeOperator = operators[i]; status = _bridgeSlashInfos[bridgeOperator]; @@ -185,10 +173,7 @@ contract BridgeSlash is /** * @inheritdoc IBridgeManagerCallback */ - function onBridgeOperatorsRemoved( - address[] calldata, - bool[] calldata - ) external view onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) { + function onBridgeOperatorsRemoved(address[] calldata, bool[] calldata) external view onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) { return IBridgeManagerCallback.onBridgeOperatorsRemoved.selector; } @@ -202,14 +187,12 @@ contract BridgeSlash is /** * @inheritdoc IBridgeSlash */ - function getSlashUntilPeriodOf( - address[] calldata bridgeOperators - ) external view returns (uint256[] memory untilPeriods) { + function getSlashUntilPeriodOf(address[] calldata bridgeOperators) external view returns (uint256[] memory untilPeriods) { uint256 length = bridgeOperators.length; untilPeriods = new uint256[](length); mapping(address => BridgeSlashInfo) storage _bridgeSlashInfos = _getBridgeSlashInfos(); - for (uint256 i; i < length; ) { + for (uint256 i; i < length;) { untilPeriods[i] = _bridgeSlashInfos[bridgeOperators[i]].slashUntilPeriod; unchecked { ++i; @@ -225,7 +208,7 @@ contract BridgeSlash is addedPeriods = new uint256[](length); mapping(address => BridgeSlashInfo) storage _bridgeSlashInfos = _getBridgeSlashInfos(); - for (uint256 i; i < length; ) { + for (uint256 i; i < length;) { addedPeriods[i] = _bridgeSlashInfos[bridgeOperators[i]].newlyAddedAtPeriod; unchecked { ++i; @@ -253,10 +236,7 @@ contract BridgeSlash is * @param period The current period. * @return met A boolean indicates that the threshold for removal is met. */ - function _isSlashDurationMetRemovalThreshold( - uint256 slashUntilPeriod, - uint256 period - ) internal pure returns (bool met) { + function _isSlashDurationMetRemovalThreshold(uint256 slashUntilPeriod, uint256 period) internal pure returns (bool met) { met = slashUntilPeriod - (period - 1) >= REMOVE_DURATION_THRESHOLD; } diff --git a/src/ronin/gateway/BridgeTracking.sol b/src/ronin/gateway/BridgeTracking.sol index 7dd21a1f..aeb9f7f9 100644 --- a/src/ronin/gateway/BridgeTracking.sol +++ b/src/ronin/gateway/BridgeTracking.sol @@ -220,9 +220,8 @@ contract BridgeTracking is HasBridgeDeprecated, HasValidatorDeprecated, HasContr uint256 totalBallot_ = totalBallot(lastSyncPeriod); address bridgeSlashContract = getContract(ContractType.BRIDGE_SLASH); - (bool success, bytes memory returnOrRevertData) = bridgeSlashContract.call( - abi.encodeCall(IBridgeSlash.execSlashBridgeOperators, (allOperators, ballots, totalBallot_, totalVote_, lastSyncPeriod)) - ); + (bool success, bytes memory returnOrRevertData) = + bridgeSlashContract.call(abi.encodeCall(IBridgeSlash.execSlashBridgeOperators, (allOperators, ballots, totalBallot_, totalVote_, lastSyncPeriod))); if (!success) { emit ExternalCallFailed(bridgeSlashContract, IBridgeSlash.execSlashBridgeOperators.selector, returnOrRevertData); } diff --git a/src/ronin/gateway/PauseEnforcer.sol b/src/ronin/gateway/PauseEnforcer.sol index 28480cdb..7e9b860f 100644 --- a/src/ronin/gateway/PauseEnforcer.sol +++ b/src/ronin/gateway/PauseEnforcer.sol @@ -63,7 +63,7 @@ contract PauseEnforcer is AccessControlEnumerable, Initializable { function initialize(IPauseTarget _target, address _admin, address[] memory _sentries) external initializer { _changeTarget(_target); _setupRole(DEFAULT_ADMIN_ROLE, _admin); - for (uint _i; _i < _sentries.length; ) { + for (uint _i; _i < _sentries.length;) { _grantRole(SENTRY_ROLE, _sentries[_i]); unchecked { diff --git a/src/ronin/gateway/RoninGatewayV3.sol b/src/ronin/gateway/RoninGatewayV3.sol index 565e1f27..d7a129e8 100644 --- a/src/ronin/gateway/RoninGatewayV3.sol +++ b/src/ronin/gateway/RoninGatewayV3.sol @@ -15,15 +15,7 @@ import "../../interfaces/validator/IRoninValidatorSet.sol"; import "../../libraries/IsolatedGovernance.sol"; import "../../interfaces/bridge/IBridgeManager.sol"; -contract RoninGatewayV3 is - GatewayV3, - Initializable, - MinimumWithdrawal, - AccessControlEnumerable, - VoteStatusConsumer, - IRoninGatewayV3, - HasContracts -{ +contract RoninGatewayV3 is GatewayV3, Initializable, MinimumWithdrawal, AccessControlEnumerable, VoteStatusConsumer, IRoninGatewayV3, HasContracts { using Token for Token.Info; using Transfer for Transfer.Request; using Transfer for Transfer.Receipt; @@ -123,10 +115,7 @@ contract RoninGatewayV3 is /** * @inheritdoc IRoninGatewayV3 */ - function getWithdrawalSignatures( - uint256 withdrawalId, - address[] calldata operators - ) external view returns (bytes[] memory _signatures) { + function getWithdrawalSignatures(uint256 withdrawalId, address[] calldata operators) external view returns (bytes[] memory _signatures) { _signatures = new bytes[](operators.length); for (uint256 _i = 0; _i < operators.length;) { _signatures[_i] = _withdrawalSig[withdrawalId][operators[_i]]; @@ -147,11 +136,7 @@ contract RoninGatewayV3 is /** * @inheritdoc IRoninGatewayV3 */ - function tryBulkAcknowledgeMainchainWithdrew(uint256[] calldata _withdrawalIds) - external - onlyBridgeOperator - returns (bool[] memory _executedReceipts) - { + function tryBulkAcknowledgeMainchainWithdrew(uint256[] calldata _withdrawalIds) external onlyBridgeOperator returns (bool[] memory _executedReceipts) { address governor = msg.sender; uint256 minVoteWeight = minimumVoteWeight(); @@ -183,12 +168,7 @@ contract RoninGatewayV3 is /** * @inheritdoc IRoninGatewayV3 */ - function tryBulkDepositFor(Transfer.Receipt[] calldata receipts) - external - whenNotPaused - onlyBridgeOperator - returns (bool[] memory _executedReceipts) - { + function tryBulkDepositFor(Transfer.Receipt[] calldata receipts) external whenNotPaused onlyBridgeOperator returns (bool[] memory _executedReceipts) { uint length = receipts.length; _executedReceipts = new bool[](length); uint256 minVoteWeight = minimumVoteWeight(); @@ -240,10 +220,7 @@ contract RoninGatewayV3 is /** * @inheritdoc IRoninGatewayV3 */ - function bulkSubmitWithdrawalSignatures( - uint256[] calldata withdrawals, - bytes[] calldata signatures - ) external whenNotPaused onlyBridgeOperator { + function bulkSubmitWithdrawalSignatures(uint256[] calldata withdrawals, bytes[] calldata signatures) external whenNotPaused onlyBridgeOperator { address operator = msg.sender; uint length = withdrawals.length; @@ -410,8 +387,7 @@ contract RoninGatewayV3 is address _mainchainTokenAddr ) internal returns (uint256 _withdrawalId) { _withdrawalId = withdrawalCount++; - Transfer.Receipt memory _receipt = - _request.into_withdrawal_receipt(_requester, _withdrawalId, _mainchainTokenAddr, _chainId); + Transfer.Receipt memory _receipt = _request.into_withdrawal_receipt(_requester, _withdrawalId, _mainchainTokenAddr, _chainId); withdrawal[_withdrawalId] = _receipt; emit WithdrawalRequested(_receipt.hash(), _receipt); } @@ -452,12 +428,8 @@ contract RoninGatewayV3 is /** * @dev Returns the vote weight for a specified hash. */ - function _getVoteWeight( - IsolatedGovernance.Vote storage _v, - bytes32 _hash - ) internal view returns (uint256 _totalWeight) { - (, address[] memory bridgeOperators, uint96[] memory weights) = - IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)).getFullBridgeOperatorInfos(); + function _getVoteWeight(IsolatedGovernance.Vote storage _v, bytes32 _hash) internal view returns (uint256 _totalWeight) { + (, address[] memory bridgeOperators, uint96[] memory weights) = IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)).getFullBridgeOperatorInfos(); uint256 length = bridgeOperators.length; unchecked { for (uint _i; _i < length; ++_i) { @@ -468,10 +440,7 @@ contract RoninGatewayV3 is } } - function setTrustedThreshold( - uint256 _trustedNumerator, - uint256 _trustedDenominator - ) external virtual onlyAdmin returns (uint256, uint256) { + function setTrustedThreshold(uint256 _trustedNumerator, uint256 _trustedDenominator) external virtual onlyAdmin returns (uint256, uint256) { return _setTrustedThreshold(_trustedNumerator, _trustedDenominator); } @@ -499,9 +468,7 @@ contract RoninGatewayV3 is _trustedNum = _trustedNumerator; _trustedDenom = _trustedDenominator; unchecked { - emit TrustedThresholdUpdated( - nonce++, _trustedNumerator, _trustedDenominator, _previousTrustedNum, _previousTrustedDenom - ); + emit TrustedThresholdUpdated(nonce++, _trustedNumerator, _trustedDenominator, _previousTrustedNum, _previousTrustedDenom); } } diff --git a/src/utils/ContractType.sol b/src/utils/ContractType.sol index 2fcb32f6..928c6354 100644 --- a/src/utils/ContractType.sol +++ b/src/utils/ContractType.sol @@ -2,20 +2,36 @@ pragma solidity ^0.8.0; enum ContractType { - /* 0 */ UNKNOWN, - /* 1 */ PAUSE_ENFORCER, - /* 2 */ BRIDGE, - /* 3 */ BRIDGE_TRACKING, - /* 4 */ GOVERNANCE_ADMIN, - /* 5 */ MAINTENANCE, - /* 6 */ SLASH_INDICATOR, - /* 7 */ STAKING_VESTING, - /* 8 */ VALIDATOR, - /* 9 */ STAKING, - /* 10 */ RONIN_TRUSTED_ORGANIZATION, - /* 11 */ BRIDGE_MANAGER, - /* 12 */ BRIDGE_SLASH, - /* 13 */ BRIDGE_REWARD, - /* 14 */ FAST_FINALITY_TRACKING, - /* 15 */ PROFILE + /* 0 */ + UNKNOWN, + /* 1 */ + PAUSE_ENFORCER, + /* 2 */ + BRIDGE, + /* 3 */ + BRIDGE_TRACKING, + /* 4 */ + GOVERNANCE_ADMIN, + /* 5 */ + MAINTENANCE, + /* 6 */ + SLASH_INDICATOR, + /* 7 */ + STAKING_VESTING, + /* 8 */ + VALIDATOR, + /* 9 */ + STAKING, + /* 10 */ + RONIN_TRUSTED_ORGANIZATION, + /* 11 */ + BRIDGE_MANAGER, + /* 12 */ + BRIDGE_SLASH, + /* 13 */ + BRIDGE_REWARD, + /* 14 */ + FAST_FINALITY_TRACKING, + /* 15 */ + PROFILE } diff --git a/src/utils/IdentityGuard.sol b/src/utils/IdentityGuard.sol index 4edbc32d..c84224b8 100644 --- a/src/utils/IdentityGuard.sol +++ b/src/utils/IdentityGuard.sol @@ -92,9 +92,7 @@ abstract contract IdentityGuard { bytes memory supportsInterfaceParams = abi.encodeCall(IERC165.supportsInterface, (interfaceId)); (bool success, bytes memory returnOrRevertData) = contractAddr.staticcall(supportsInterfaceParams); if (!success) { - (success, returnOrRevertData) = contractAddr.staticcall( - abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (supportsInterfaceParams)) - ); + (success, returnOrRevertData) = contractAddr.staticcall(abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (supportsInterfaceParams))); if (!success) revert ErrUnsupportedInterface(interfaceId, contractAddr); } if (!abi.decode(returnOrRevertData, (bool))) revert ErrUnsupportedInterface(interfaceId, contractAddr); diff --git a/src/utils/RoleAccess.sol b/src/utils/RoleAccess.sol index a96c8b0f..4ea496c3 100644 --- a/src/utils/RoleAccess.sol +++ b/src/utils/RoleAccess.sol @@ -2,15 +2,26 @@ pragma solidity ^0.8.0; enum RoleAccess { - /* 0 */ UNKNOWN, - /* 1 */ ADMIN, - /* 2 */ COINBASE, - /* 3 */ GOVERNOR, - /* 4 */ CANDIDATE_ADMIN, - /* 5 */ WITHDRAWAL_MIGRATOR, - /* 6 */ __DEPRECATED_BRIDGE_OPERATOR, - /* 7 */ BLOCK_PRODUCER, - /* 8 */ VALIDATOR_CANDIDATE, - /* 9 */ CONSENSUS, - /* 10 */ TREASURY + /* 0 */ + UNKNOWN, + /* 1 */ + ADMIN, + /* 2 */ + COINBASE, + /* 3 */ + GOVERNOR, + /* 4 */ + CANDIDATE_ADMIN, + /* 5 */ + WITHDRAWAL_MIGRATOR, + /* 6 */ + __DEPRECATED_BRIDGE_OPERATOR, + /* 7 */ + BLOCK_PRODUCER, + /* 8 */ + VALIDATOR_CANDIDATE, + /* 9 */ + CONSENSUS, + /* 10 */ + TREASURY } diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index d2c84f31..1bf04d90 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -3,9 +3,9 @@ pragma solidity ^0.8.19; import { console2 as console } from "forge-std/console2.sol"; import { Base_Test } from "../../Base.t.sol"; -import { LibSharedAddress } from "foundry-deployment-kit/libraries/LibSharedAddress.sol"; +import { LibSharedAddress } from "@fdk/libraries/LibSharedAddress.sol"; import { ISharedArgument } from "@ronin/script/interfaces/ISharedArgument.sol"; -import { IGeneralConfig } from "foundry-deployment-kit/interfaces/IGeneralConfig.sol"; +import { IGeneralConfig } from "@fdk/interfaces/IGeneralConfig.sol"; import { GeneralConfig } from "@ronin/script/GeneralConfig.sol"; import { Network } from "@ronin/script/utils/Network.sol"; diff --git a/test/bridge/integration/bridge-tracking/EpochE1_VoteIsApprovedInLastEpoch.BridgeTracking.t.sol b/test/bridge/integration/bridge-tracking/EpochE1_VoteIsApprovedInLastEpoch.BridgeTracking.t.sol index c4997634..2d227f36 100644 --- a/test/bridge/integration/bridge-tracking/EpochE1_VoteIsApprovedInLastEpoch.BridgeTracking.t.sol +++ b/test/bridge/integration/bridge-tracking/EpochE1_VoteIsApprovedInLastEpoch.BridgeTracking.t.sol @@ -5,8 +5,7 @@ import { IBridgeTracking } from "@ronin/contracts/interfaces/bridge/IBridgeTrack import { MockGatewayForTracking } from "@ronin/contracts/mocks/MockGatewayForTracking.sol"; import "../BaseIntegration.t.sol"; -import { EpochE2_VoteIsNotApprovedInLastEpoch_BridgeTracking_Test } from - "./EpochE2_VoteIsNotApprovedInLastEpoch.BridgeTracking.t.sol"; +import { EpochE2_VoteIsNotApprovedInLastEpoch_BridgeTracking_Test } from "./EpochE2_VoteIsNotApprovedInLastEpoch.BridgeTracking.t.sol"; // Epoch e-1 test: Vote is approved in the last epoch of period contract EpochE1_VoteIsApprovedInLastEpoch_BridgeTracking_Test is BaseIntegration_Test { @@ -30,8 +29,7 @@ contract EpochE1_VoteIsApprovedInLastEpoch_BridgeTracking_Test is BaseIntegratio // upgrade ronin gateway v3 _mockRoninGatewayV3 = new MockGatewayForTracking(address(_bridgeTracking)); - bytes memory calldata_ = - abi.encodeCall(IHasContracts.setContract, (ContractType.BRIDGE, address(_mockRoninGatewayV3))); + bytes memory calldata_ = abi.encodeCall(IHasContracts.setContract, (ContractType.BRIDGE, address(_mockRoninGatewayV3))); _roninProposalUtils.functionDelegateCall(address(_bridgeTracking), calldata_); vm.deal(address(_bridgeReward), 10 ether); diff --git a/test/bridge/integration/bridge-tracking/EpochE2_VoteIsNotApprovedInLastEpoch.BridgeTracking.t.sol b/test/bridge/integration/bridge-tracking/EpochE2_VoteIsNotApprovedInLastEpoch.BridgeTracking.t.sol index 5f487d0d..2b39e6d0 100644 --- a/test/bridge/integration/bridge-tracking/EpochE2_VoteIsNotApprovedInLastEpoch.BridgeTracking.t.sol +++ b/test/bridge/integration/bridge-tracking/EpochE2_VoteIsNotApprovedInLastEpoch.BridgeTracking.t.sol @@ -22,8 +22,7 @@ contract EpochE2_VoteIsNotApprovedInLastEpoch_BridgeTracking_Test is BaseIntegra // upgrade ronin gateway v3 _mockRoninGatewayV3 = new MockGatewayForTracking(address(_bridgeTracking)); - bytes memory calldata_ = - abi.encodeCall(IHasContracts.setContract, (ContractType.BRIDGE, address(_mockRoninGatewayV3))); + bytes memory calldata_ = abi.encodeCall(IHasContracts.setContract, (ContractType.BRIDGE, address(_mockRoninGatewayV3))); _roninProposalUtils.functionDelegateCall(address(_bridgeTracking), calldata_); vm.deal(address(_bridgeReward), 10 ether); @@ -102,15 +101,9 @@ contract EpochE2_VoteIsNotApprovedInLastEpoch_BridgeTracking_Test is BaseIntegra uint256 expectedTotalVotes = 1; assertEq(_bridgeTracking.totalVote(lastPeriod), expectedTotalVotes); assertEq(_bridgeTracking.totalBallot(lastPeriod), expectedTotalVotes * 3); - assertEq( - _bridgeTracking.totalBallotOf(lastPeriod, _param.roninBridgeManager.bridgeOperators[0]), expectedTotalVotes - ); - assertEq( - _bridgeTracking.totalBallotOf(lastPeriod, _param.roninBridgeManager.bridgeOperators[1]), expectedTotalVotes - ); - assertEq( - _bridgeTracking.totalBallotOf(lastPeriod, _param.roninBridgeManager.bridgeOperators[2]), expectedTotalVotes - ); + assertEq(_bridgeTracking.totalBallotOf(lastPeriod, _param.roninBridgeManager.bridgeOperators[0]), expectedTotalVotes); + assertEq(_bridgeTracking.totalBallotOf(lastPeriod, _param.roninBridgeManager.bridgeOperators[1]), expectedTotalVotes); + assertEq(_bridgeTracking.totalBallotOf(lastPeriod, _param.roninBridgeManager.bridgeOperators[2]), expectedTotalVotes); assertEq(_bridgeTracking.totalBallotOf(lastPeriod, _param.roninBridgeManager.bridgeOperators[3]), 0); _period = newPeriod; diff --git a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.erc20.benchmark.t.sol b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.erc20.benchmark.t.sol index 04b549c9..2341b708 100644 --- a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.erc20.benchmark.t.sol +++ b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.erc20.benchmark.t.sol @@ -8,7 +8,7 @@ import { Token } from "@ronin/contracts/libraries/Token.sol"; import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; import "../../BaseIntegration.t.sol"; -contract SubmitWithdrawal_MainchainGatewayV3_Native_Benchmark_Test is BaseIntegration_Test{ +contract SubmitWithdrawal_MainchainGatewayV3_Native_Benchmark_Test is BaseIntegration_Test { using Transfer for Transfer.Receipt; Transfer.Receipt _withdrawalReceipt; diff --git a/test/bridge/integration/pause-enforcer/emergencyAction.PauseEnforcer.t.sol b/test/bridge/integration/pause-enforcer/emergencyAction.PauseEnforcer.t.sol index fec87e77..59416233 100644 --- a/test/bridge/integration/pause-enforcer/emergencyAction.PauseEnforcer.t.sol +++ b/test/bridge/integration/pause-enforcer/emergencyAction.PauseEnforcer.t.sol @@ -69,8 +69,7 @@ contract EmergencyAction_PauseEnforcer_Test is BaseIntegration_Test { info: Token.Info({ erc: Token.Standard.ERC20, id: 0, quantity: 100 }) }); - uint256 numOperatorsForVoteExecuted = - _param.roninBridgeManager.bridgeOperators.length * _param.roninBridgeManager.num / _param.roninBridgeManager.denom; + uint256 numOperatorsForVoteExecuted = _param.roninBridgeManager.bridgeOperators.length * _param.roninBridgeManager.num / _param.roninBridgeManager.denom; for (uint256 i; i < numOperatorsForVoteExecuted; i++) { vm.prank(_param.roninBridgeManager.bridgeOperators[i]); _roninGatewayV3.depositFor(receipt); diff --git a/test/bridge/integration/pause-enforcer/set-config/setConfig.PauseEnforcer.t.sol b/test/bridge/integration/pause-enforcer/set-config/setConfig.PauseEnforcer.t.sol index 60e7dd9c..b3fe1f9e 100644 --- a/test/bridge/integration/pause-enforcer/set-config/setConfig.PauseEnforcer.t.sol +++ b/test/bridge/integration/pause-enforcer/set-config/setConfig.PauseEnforcer.t.sol @@ -22,8 +22,7 @@ contract SetConfig_PauseEnforcer_Test is BaseIntegration_Test { } function test_sentryEnforcerRole() public { - bool isSentryRole = - _roninPauseEnforcer.hasRole(_roninPauseEnforcer.SENTRY_ROLE(), _param.roninPauseEnforcer.sentries[0]); + bool isSentryRole = _roninPauseEnforcer.hasRole(_roninPauseEnforcer.SENTRY_ROLE(), _param.roninPauseEnforcer.sentries[0]); assertEq(isSentryRole, true); } diff --git a/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol b/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol index 8a8b18b7..9b0c3b52 100644 --- a/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol +++ b/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol @@ -33,7 +33,6 @@ contract DepositVote_RoninGatewayV3_Test is BaseIntegration_Test { receipt.id = 1; _depositReceipts.push(receipt); - _numOperatorsForVoteExecuted = (_roninBridgeManager.minimumVoteWeight() - 1) / 100 + 1; } diff --git a/test/bridge/unit/concrete/bridge-manager/constructor.t.sol b/test/bridge/unit/concrete/bridge-manager/constructor.t.sol index 16dd066f..ccb6d51b 100644 --- a/test/bridge/unit/concrete/bridge-manager/constructor.t.sol +++ b/test/bridge/unit/concrete/bridge-manager/constructor.t.sol @@ -38,17 +38,10 @@ contract Constructor_BridgeManager_Unit_Concrete_Test is BridgeManager_Unit_Conc } function test_GetFullBridgeOperatorInfos() external { - ( - address[] memory expectingBridgeOperators, - address[] memory expectingGovernors, - uint96[] memory expectingVoteWeights - ) = _getBridgeMembers(); - - ( - address[] memory returnedGovernors, - address[] memory returnedBridgeOperators, - uint96[] memory returnedVoteWeights - ) = _bridgeManager.getFullBridgeOperatorInfos(); + (address[] memory expectingBridgeOperators, address[] memory expectingGovernors, uint96[] memory expectingVoteWeights) = _getBridgeMembers(); + + (address[] memory returnedGovernors, address[] memory returnedBridgeOperators, uint96[] memory returnedVoteWeights) = + _bridgeManager.getFullBridgeOperatorInfos(); _assertBridgeMembers({ comparingOperators: returnedBridgeOperators, diff --git a/test/bridge/unit/fuzz/bridge-manager/BridgeReward.t.sol b/test/bridge/unit/fuzz/bridge-manager/BridgeReward.t.sol index 9514e0fb..76771ee5 100644 --- a/test/bridge/unit/fuzz/bridge-manager/BridgeReward.t.sol +++ b/test/bridge/unit/fuzz/bridge-manager/BridgeReward.t.sol @@ -52,7 +52,7 @@ contract BridgeRewardTest is Base_Test, IBridgeRewardEvents, BridgeManagerUtils period = _bound(period, 1, type(uint64).max); // Decode the default bridge manager inputs - (address[] memory bridgeOperators, , ) = abi.decode(_defaultBridgeManagerInputs, (address[], address[], uint256[])); + (address[] memory bridgeOperators,,) = abi.decode(_defaultBridgeManagerInputs, (address[], address[], uint256[])); // Generate random numbers for slashUntils and ballots uint256[] memory slashUntils = _createRandomNumbers(r1, bridgeOperators.length, 0, MAX_FUZZ_INPUTS); @@ -73,13 +73,7 @@ contract BridgeRewardTest is Base_Test, IBridgeRewardEvents, BridgeManagerUtils if (shouldShareEqually) { _assertCalculateRewardEqually(shouldShareEqually, rewardPerPeriod, totalBallot, bridgeRewardContract, ballots); } else { - _assertCalculateRewardProportionally( - shouldShareEqually, - rewardPerPeriod, - totalBallot, - bridgeRewardContract, - ballots - ); + _assertCalculateRewardProportionally(shouldShareEqually, rewardPerPeriod, totalBallot, bridgeRewardContract, ballots); } // Assert the slashing of bridge operators for the given period _assertSlashBridgeOperators(period, slashUntils, bridgeRewardContract); @@ -95,7 +89,7 @@ contract BridgeRewardTest is Base_Test, IBridgeRewardEvents, BridgeManagerUtils MockBridgeReward bridgeRewardContract = MockBridgeReward(payable(_bridgeRewardContract)); // Decode the default bridge manager inputs - (address[] memory bridgeOperators, , ) = abi.decode(_defaultBridgeManagerInputs, (address[], address[], uint256[])); + (address[] memory bridgeOperators,,) = abi.decode(_defaultBridgeManagerInputs, (address[], address[], uint256[])); // Create an empty array for ballots uint256[] memory ballots = new uint256[](bridgeOperators.length); // Calculate the total number of ballots @@ -132,7 +126,7 @@ contract BridgeRewardTest is Base_Test, IBridgeRewardEvents, BridgeManagerUtils uint256 actual; uint256 expected; - for (uint256 i; i < length; ) { + for (uint256 i; i < length;) { console.log("actual", actual); console.log("expected", expected); @@ -170,7 +164,7 @@ contract BridgeRewardTest is Base_Test, IBridgeRewardEvents, BridgeManagerUtils uint256 length = ballots.length; uint256 expected = rewardPerPeriod / length; - for (uint256 i; i < length; ) { + for (uint256 i; i < length;) { console.log("actual", actual); console.log("expected", expected); @@ -191,13 +185,9 @@ contract BridgeRewardTest is Base_Test, IBridgeRewardEvents, BridgeManagerUtils * @param slashUntils The array of slash until periods for bridge operators. * @param bridgeRewardContract The mock bridge reward contract. */ - function _assertSlashBridgeOperators( - uint256 period, - uint256[] memory slashUntils, - MockBridgeReward bridgeRewardContract - ) internal { + function _assertSlashBridgeOperators(uint256 period, uint256[] memory slashUntils, MockBridgeReward bridgeRewardContract) internal { uint256 length = slashUntils.length; - for (uint256 i; i < length; ) { + for (uint256 i; i < length;) { // Check if the bridge operator is slashed for the current period if (period <= slashUntils[i]) { // Assert that the bridge operator is slashed for the current period @@ -215,18 +205,14 @@ contract BridgeRewardTest is Base_Test, IBridgeRewardEvents, BridgeManagerUtils _validatorContract = address(new MockValidatorContract_OnlyTiming_ForHardhatTest(200)); - (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs( - DEFAULT_R1, - DEFAULT_R2, - DEFAULT_R3, - DEFAULT_NUM_BRIDGE_OPERATORS - ); + (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = + getValidInputs(DEFAULT_R1, DEFAULT_R2, DEFAULT_R3, DEFAULT_NUM_BRIDGE_OPERATORS); _defaultBridgeManagerInputs = abi.encode(bridgeOperators, governors, voteWeights); _bridgeManagerLogic = address(new MockBridgeManager()); _bridgeManagerContract = address( - new TransparentUpgradeableProxy(_bridgeManagerLogic, _admin, abi.encodeCall(MockBridgeManager.initialize, (bridgeOperators, governors, voteWeights))) + new TransparentUpgradeableProxy(_bridgeManagerLogic, _admin, abi.encodeCall(MockBridgeManager.initialize, (bridgeOperators, governors, voteWeights))) ); _bridgeTrackingLogic = address(new BridgeTracking()); @@ -235,12 +221,7 @@ contract BridgeRewardTest is Base_Test, IBridgeRewardEvents, BridgeManagerUtils _bridgeSlashLogic = address(new MockBridgeSlash()); _bridgeSlashContract = address( new TransparentUpgradeableProxy( - _bridgeSlashLogic, - _admin, - abi.encodeCall( - BridgeSlash.initialize, - (_validatorContract, _bridgeManagerContract, _bridgeTrackingContract, address(0)) - ) + _bridgeSlashLogic, _admin, abi.encodeCall(BridgeSlash.initialize, (_validatorContract, _bridgeManagerContract, _bridgeTrackingContract, address(0))) ) ); @@ -251,14 +232,7 @@ contract BridgeRewardTest is Base_Test, IBridgeRewardEvents, BridgeManagerUtils _admin, abi.encodeCall( BridgeReward.initialize, - ( - _bridgeManagerContract, - _bridgeTrackingContract, - _bridgeSlashContract, - _validatorContract, - address(0), - DEFAULT_REWARD_PER_PERIOD - ) + (_bridgeManagerContract, _bridgeTrackingContract, _bridgeSlashContract, _validatorContract, address(0), DEFAULT_REWARD_PER_PERIOD) ) ) ); diff --git a/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol b/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol index 995cb5b1..c3ee142a 100644 --- a/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol +++ b/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol @@ -61,11 +61,7 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { IBridgeSlash bridgeSlashContract = IBridgeSlash(_bridgeSlashContract); IBridgeSlash.Tier tier = bridgeSlashContract.getSlashTier(ballot, totalVote); // Calculate the new slash until period using the mock bridge slash contract - uint256 newSlashUntilPeriod = MockBridgeSlash(payable(_bridgeSlashContract)).calcSlashUntilPeriod( - tier, - period, - slashUntilPeriod - ); + uint256 newSlashUntilPeriod = MockBridgeSlash(payable(_bridgeSlashContract)).calcSlashUntilPeriod(tier, period, slashUntilPeriod); // Log the tier and slash period information console.log("tier", "period", "slashUntilPeriod", "newSlashUntilPeriod"); @@ -84,9 +80,7 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { assertTrue(newSlashUntilPeriod == uint256(slashUntilPeriod) + bridgeSlashContract.TIER_2_PENALTY_DURATION()); // Check if the slash duration meets the removal threshold - if ( - MockBridgeSlash(payable(_bridgeSlashContract)).isSlashDurationMetRemovalThreshold(newSlashUntilPeriod, period) - ) { + if (MockBridgeSlash(payable(_bridgeSlashContract)).isSlashDurationMetRemovalThreshold(newSlashUntilPeriod, period)) { assertTrue(newSlashUntilPeriod - period + 1 >= bridgeSlashContract.REMOVE_DURATION_THRESHOLD()); } } else { @@ -104,13 +98,7 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { * @param numBridgeOperators The number of bridge operators to add. * @param period The current period. */ - function test_bridgeSlash_recordEvents_onBridgeOperatorsAdded( - uint256 r1, - uint256 r2, - uint256 r3, - uint256 numBridgeOperators, - uint256 period - ) external { + function test_bridgeSlash_recordEvents_onBridgeOperatorsAdded(uint256 r1, uint256 r2, uint256 r3, uint256 numBridgeOperators, uint256 period) external { // Assume the input values are not equal to the default values vm.assume(r1 != DEFAULT_R1 && r2 != DEFAULT_R2 && r3 != DEFAULT_R3); // Bound the period between 1 and the maximum value of uint64 @@ -126,20 +114,15 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { MockBridgeManager(payable(_bridgeManagerContract)).registerCallbacks(registers); // Generate valid inputs for bridge operators - (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidAndNonExistingInputs( - _bridgeManagerContract, - r1, - r2, - r3, - numBridgeOperators - ); + (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = + getValidAndNonExistingInputs(_bridgeManagerContract, r1, r2, r3, numBridgeOperators); _addBridgeOperators(_bridgeManagerContract, _bridgeManagerContract, voteWeights, governors, bridgeOperators); // Retrieve the added periods for the bridge operators uint256[] memory addedPeriods = IBridgeSlash(_bridgeSlashContract).getAddedPeriodOf(bridgeOperators); // Check that the added periods match the current period - for (uint256 i; i < addedPeriods.length; ) { + for (uint256 i; i < addedPeriods.length;) { assertEq(addedPeriods[i], period); unchecked { ++i; @@ -154,12 +137,7 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { * @param duration The duration of the test. * @param newlyAddedSize The number of newly added operators. */ - function test_ExcludeNewlyAddedOperators_ExecSlashBridgeOperators( - uint256 r1, - uint256 period, - uint256 duration, - uint256 newlyAddedSize - ) external { + function test_ExcludeNewlyAddedOperators_ExecSlashBridgeOperators(uint256 r1, uint256 period, uint256 duration, uint256 newlyAddedSize) external { vm.assume(r1 != 0); vm.assume(r1 != DEFAULT_R1 && r1 != DEFAULT_R2 && r1 != DEFAULT_R3); // Bound the period, duration, and newlyAddedSize values @@ -174,9 +152,9 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { MockBridgeManager(payable(_bridgeManagerContract)).registerCallbacks(registers); // Decode the default bridge manager inputs to retrieve bridge operators - (address[] memory bridgeOperators, , ) = abi.decode(_defaultBridgeManagerInputs, (address[], address[], uint256[])); + (address[] memory bridgeOperators,,) = abi.decode(_defaultBridgeManagerInputs, (address[], address[], uint256[])); - for (uint256 i; i < duration; ) { + for (uint256 i; i < duration;) { // Set the current period in the mock validator contract MockValidatorSet_ForFoundryTest(payable(_validatorContract)).setCurrentPeriod(period); // Generate valid inputs for newly added operators @@ -185,20 +163,11 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { { address[] memory newlyAddedGovernors; uint96[] memory newlyAddedWeights; - (newlyAddedOperators, newlyAddedGovernors, newlyAddedWeights) = getValidInputs( - r1, - ~r1, - r1 << 1, - newlyAddedSize - ); + (newlyAddedOperators, newlyAddedGovernors, newlyAddedWeights) = getValidInputs(r1, ~r1, r1 << 1, newlyAddedSize); // Add the newly added operators using the bridge manager contract vm.prank(_bridgeManagerContract, _bridgeManagerContract); - bool[] memory addeds = IBridgeManager(_bridgeManagerContract).addBridgeOperators( - newlyAddedWeights, - newlyAddedGovernors, - newlyAddedOperators - ); + bool[] memory addeds = IBridgeManager(_bridgeManagerContract).addBridgeOperators(newlyAddedWeights, newlyAddedGovernors, newlyAddedOperators); vm.assume(addeds.sum() == addeds.length); // Retrieve the added periods for the newly added operators newlyAddedAtPeriods = IBridgeSlash(_bridgeSlashContract).getAddedPeriodOf(newlyAddedOperators); @@ -208,20 +177,12 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { uint256[] memory ballots = _createRandomNumbers(r1, bridgeOperators.length + newlyAddedSize, 0, MAX_FUZZ_INPUTS); // Execute slashBridgeOperators for all operators vm.prank(_bridgeTrackingContract, _bridgeTrackingContract); - IBridgeSlash(_bridgeSlashContract).execSlashBridgeOperators( - bridgeOperators.extend(newlyAddedOperators), - ballots, - ballots.sum(), - ballots.sum(), - period - ); + IBridgeSlash(_bridgeSlashContract).execSlashBridgeOperators(bridgeOperators.extend(newlyAddedOperators), ballots, ballots.sum(), ballots.sum(), period); // Check that the slashUntilPeriods and newlyAddedAtPeriods are correctly set uint256 length = newlyAddedAtPeriods.length; - uint256[] memory slashUntilPeriods = IBridgeSlash(_bridgeSlashContract).getSlashUntilPeriodOf( - newlyAddedOperators - ); - for (uint256 j; j < length; ) { + uint256[] memory slashUntilPeriods = IBridgeSlash(_bridgeSlashContract).getSlashUntilPeriodOf(newlyAddedOperators); + for (uint256 j; j < length;) { assertEq(slashUntilPeriods[j], 0); assertEq(newlyAddedAtPeriods[j], period); unchecked { @@ -251,14 +212,14 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { duration = _bound(duration, MIN_PERIOD_DURATION, MAX_PERIOD_DURATION); // Decode the default bridge manager inputs to retrieve bridge operators - (address[] memory bridgeOperators, , ) = abi.decode(_defaultBridgeManagerInputs, (address[], address[], uint256[])); + (address[] memory bridgeOperators,,) = abi.decode(_defaultBridgeManagerInputs, (address[], address[], uint256[])); vm.startPrank(_bridgeTrackingContract, _bridgeTrackingContract); uint256[] memory ballots; uint256 totalBallotForPeriod; IBridgeSlash bridgeSlashContract = IBridgeSlash(_bridgeSlashContract); MockValidatorSet_ForFoundryTest validatorContract = MockValidatorSet_ForFoundryTest(payable(_validatorContract)); - for (uint256 i; i < duration; ) { + for (uint256 i; i < duration;) { // Generate random ballots for bridge operators ballots = _createRandomNumbers(r1, bridgeOperators.length, 0, MAX_FUZZ_INPUTS); totalBallotForPeriod = ballots.sum(); @@ -267,13 +228,7 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { validatorContract.setCurrentPeriod(period); // Execute the `execSlashBridgeOperators` function - bridgeSlashContract.execSlashBridgeOperators( - bridgeOperators, - ballots, - totalBallotForPeriod, - totalBallotForPeriod, - period - ); + bridgeSlashContract.execSlashBridgeOperators(bridgeOperators, ballots, totalBallotForPeriod, totalBallotForPeriod, period); // Generate the next random number for r1 using the keccak256 hash function r1 = uint256(keccak256(abi.encode(r1))); @@ -289,12 +244,8 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { function _setUp() internal virtual { _admin = makeAddr("central-admin"); _validatorContract = address(new MockValidatorSet_ForFoundryTest()); - (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs( - DEFAULT_R1, - DEFAULT_R2, - DEFAULT_R3, - DEFAULT_NUM_BRIDGE_OPERATORS - ); + (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = + getValidInputs(DEFAULT_R1, DEFAULT_R2, DEFAULT_R3, DEFAULT_NUM_BRIDGE_OPERATORS); _defaultBridgeManagerInputs = abi.encode(bridgeOperators, governors, voteWeights); _bridgeManagerLogic = address(new MockBridgeManager()); @@ -306,19 +257,14 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { _gatewayContract = address(new TransparentUpgradeableProxyV2(_gatewayLogic, _admin, "")); _bridgeTrackingLogic = address(new BridgeTracking()); - _bridgeTrackingContract = address( - new TransparentUpgradeableProxyV2(_bridgeTrackingLogic, _bridgeManagerContract, "") - ); + _bridgeTrackingContract = address(new TransparentUpgradeableProxyV2(_bridgeTrackingLogic, _bridgeManagerContract, "")); _bridgeSlashLogic = address(new MockBridgeSlash()); _bridgeSlashContract = address( new TransparentUpgradeableProxyV2( _bridgeSlashLogic, _bridgeManagerContract, - abi.encodeCall( - BridgeSlash.initialize, - (_validatorContract, _bridgeManagerContract, _bridgeTrackingContract, address(0)) - ) + abi.encodeCall(BridgeSlash.initialize, (_validatorContract, _bridgeManagerContract, _bridgeTrackingContract, address(0))) ) ); } diff --git a/test/helpers/LibArrayUtils.t.sol b/test/helpers/LibArrayUtils.t.sol index 8ca5451a..e4442799 100644 --- a/test/helpers/LibArrayUtils.t.sol +++ b/test/helpers/LibArrayUtils.t.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; library LibArrayUtils { function sum(bool[] memory arr) internal pure returns (uint256 total) { uint256 length = arr.length; - for (uint256 i; i < length; ) { + for (uint256 i; i < length;) { if (arr[i]) total++; unchecked { ++i; @@ -14,7 +14,7 @@ library LibArrayUtils { function sum(uint256[] memory arr) internal pure returns (uint256 total) { uint256 length = arr.length; - for (uint256 i; i < length; ) { + for (uint256 i; i < length;) { total += arr[i]; unchecked { ++i; @@ -39,7 +39,7 @@ library LibArrayUtils { c[i] = a[i]; } - for (uint j; j < b.length; ) { + for (uint j; j < b.length;) { c[i] = b[j]; ++i; ++j; @@ -54,7 +54,7 @@ library LibArrayUtils { c[i] = a[i]; } - for (uint j; j < b.length; ) { + for (uint j; j < b.length;) { c[i] = b[j]; ++i; ++j; diff --git a/test/helpers/Randomizer.t.sol b/test/helpers/Randomizer.t.sol index af11ba36..9e317c47 100644 --- a/test/helpers/Randomizer.t.sol +++ b/test/helpers/Randomizer.t.sol @@ -11,7 +11,7 @@ abstract contract Randomizer is Base_Test { function _createRandomAddresses(uint256 seed, uint256 amount) internal returns (address[] memory addrs) { addrs = new address[](amount); - for (uint256 i; i < amount; ) { + for (uint256 i; i < amount;) { seed = uint256(keccak256(abi.encode(seed))); addrs[i] = vm.addr(seed); vm.etch(addrs[i], abi.encode()); @@ -23,16 +23,11 @@ abstract contract Randomizer is Base_Test { } } - function _createRandomNumbers( - uint256 seed, - uint256 amount, - uint256 min, - uint256 max - ) internal pure returns (uint256[] memory nums) { + function _createRandomNumbers(uint256 seed, uint256 amount, uint256 min, uint256 max) internal pure returns (uint256[] memory nums) { uint256 r; nums = new uint256[](amount); - for (uint256 i; i < amount; ) { + for (uint256 i; i < amount;) { r = _randomize(seed, min, max); nums[i] = r; seed = r; diff --git a/test/mocks/MockBridgeSlash.sol b/test/mocks/MockBridgeSlash.sol index 462aa12f..f605e621 100644 --- a/test/mocks/MockBridgeSlash.sol +++ b/test/mocks/MockBridgeSlash.sol @@ -6,27 +6,21 @@ import { IBridgeSlash } from "@ronin/contracts/interfaces/bridge/IBridgeSlash.so contract MockBridgeSlash is IBridgeSlash { mapping(address => uint256) internal _slashMap; - function MINIMUM_VOTE_THRESHOLD() external view returns (uint256) {} + function MINIMUM_VOTE_THRESHOLD() external view returns (uint256) { } - function REMOVE_DURATION_THRESHOLD() external view returns (uint256) {} + function REMOVE_DURATION_THRESHOLD() external view returns (uint256) { } - function TIER_1_PENALTY_DURATION() external view returns (uint256) {} + function TIER_1_PENALTY_DURATION() external view returns (uint256) { } - function TIER_2_PENALTY_DURATION() external view returns (uint256) {} + function TIER_2_PENALTY_DURATION() external view returns (uint256) { } - function execSlashBridgeOperators( - address[] calldata operators, - uint256[] calldata ballots, - uint256 totalBallot, - uint256 totalVote, - uint256 period - ) external {} + function execSlashBridgeOperators(address[] calldata operators, uint256[] calldata ballots, uint256 totalBallot, uint256 totalVote, uint256 period) external { } - function getAddedPeriodOf(address[] calldata bridgeOperators) external view returns (uint256[] memory addedPeriods) {} + function getAddedPeriodOf(address[] calldata bridgeOperators) external view returns (uint256[] memory addedPeriods) { } - function getPenaltyDurations() external pure returns (uint256[] memory penaltyDurations) {} + function getPenaltyDurations() external pure returns (uint256[] memory penaltyDurations) { } - function getSlashTier(uint256 ballot, uint256 totalVote) external pure returns (Tier tier) {} + function getSlashTier(uint256 ballot, uint256 totalVote) external pure returns (Tier tier) { } function getSlashUntilPeriodOf(address[] calldata operators) external view returns (uint256[] memory untilPeriods) { untilPeriods = new uint256[](operators.length); diff --git a/test/mocks/MockBridgeTracking.sol b/test/mocks/MockBridgeTracking.sol index e279d409..95a76cc7 100644 --- a/test/mocks/MockBridgeTracking.sol +++ b/test/mocks/MockBridgeTracking.sol @@ -13,12 +13,7 @@ contract MockBridgeTracking is IBridgeTracking { // Mapping from period number => period tracking mapping(uint256 => PeriodTracking) _tracks; - function cheat_setPeriodTracking( - uint256 period, - address[] memory operators, - uint256[] calldata ballots, - uint256 totalVote_ - ) external { + function cheat_setPeriodTracking(uint256 period, address[] memory operators, uint256[] calldata ballots, uint256 totalVote_) external { require(operators.length == ballots.length, "mismatch length"); PeriodTracking storage _sTrack = _tracks[period]; _sTrack.operators = operators; @@ -39,10 +34,7 @@ contract MockBridgeTracking is IBridgeTracking { } } - function getManyTotalBallots( - uint256 period, - address[] calldata operators - ) external view returns (uint256[] memory ballots_) { + function getManyTotalBallots(uint256 period, address[] calldata operators) external view returns (uint256[] memory ballots_) { ballots_ = new uint256[](operators.length); PeriodTracking storage _sTrack = _tracks[period]; for (uint i; i < operators.length; i++) { @@ -54,11 +46,11 @@ contract MockBridgeTracking is IBridgeTracking { return _ballotOf(_tracks[period], operator); } - function handleVoteApproved(VoteKind _kind, uint256 _requestId) external {} + function handleVoteApproved(VoteKind _kind, uint256 _requestId) external { } - function recordVote(VoteKind _kind, uint256 _requestId, address _operator) external {} + function recordVote(VoteKind _kind, uint256 _requestId, address _operator) external { } - function startedAtBlock() external view returns (uint256) {} + function startedAtBlock() external view returns (uint256) { } function _ballotOf(PeriodTracking storage _sTrack, address operator) private view returns (uint256) { return _sTrack.ballotMap[operator]; From 09f542c6ac37ff158fb3833d9b849a22db1b7003 Mon Sep 17 00:00:00 2001 From: TuDo1403 Date: Tue, 9 Apr 2024 16:49:41 +0700 Subject: [PATCH 132/180] script: resolve conflict --- script/contracts/RoninBridgeManagerDeploy.s.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/contracts/RoninBridgeManagerDeploy.s.sol b/script/contracts/RoninBridgeManagerDeploy.s.sol index 951f0745..764651c8 100644 --- a/script/contracts/RoninBridgeManagerDeploy.s.sol +++ b/script/contracts/RoninBridgeManagerDeploy.s.sol @@ -6,7 +6,7 @@ import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeMa import { Contract } from "../utils/Contract.sol"; import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; import { Migration } from "../Migration.s.sol"; -import { LibProxy } from "foundry-deployment-kit/libraries/LibProxy.sol"; +import { LibProxy } from "@fdk/libraries/LibProxy.sol"; import { RoninGatewayV3Deploy } from "./RoninGatewayV3Deploy.s.sol"; import { BridgeSlashDeploy } from "./BridgeSlashDeploy.s.sol"; From 88fbd2404aeee24fea138b7bf0587558131bc8e6 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 10 Apr 2024 15:10:20 +0700 Subject: [PATCH 133/180] resolve conflict --- .../20240405-maptoken-usdc-mainchain.s.sol | 1 + script/20240403-deploy-sepolia/deploy-sepolia.s.sol | 1 + script/factories/factory-maptoken-mainchain.s.sol | 2 +- script/factories/factory-maptoken-roninchain.s.sol | 2 +- test/helpers/ProposalUtils.t.sol | 6 +++--- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/script/20240403-deploy-sepolia/20240405-maptoken-usdc-mainchain.s.sol b/script/20240403-deploy-sepolia/20240405-maptoken-usdc-mainchain.s.sol index e407e202..3a77e5aa 100644 --- a/script/20240403-deploy-sepolia/20240405-maptoken-usdc-mainchain.s.sol +++ b/script/20240403-deploy-sepolia/20240405-maptoken-usdc-mainchain.s.sol @@ -133,6 +133,7 @@ contract Migration__20240405_MapTokenUsdcMainchain is BridgeMigration, Migration nonce: MainchainBridgeManager(_mainchainBridgeManager).round(11155111) + 1, chainId: block.chainid, expiryTimestamp: expiredTime, + executor: address(0), targets: targets, values: values, calldatas: calldatas, diff --git a/script/20240403-deploy-sepolia/deploy-sepolia.s.sol b/script/20240403-deploy-sepolia/deploy-sepolia.s.sol index 11c3590f..6bcfd1c8 100644 --- a/script/20240403-deploy-sepolia/deploy-sepolia.s.sol +++ b/script/20240403-deploy-sepolia/deploy-sepolia.s.sol @@ -161,6 +161,7 @@ contract DeploySepolia is BridgeMigration, DeploySepolia__ChangeGV_Config { nonce: _mainchainBridgeManager.round(0) + 1, chainId: block.chainid, expiryTimestamp: expiredTime, + executor: address(0), targets: targets, values: values, calldatas: calldatas, diff --git a/script/factories/factory-maptoken-mainchain.s.sol b/script/factories/factory-maptoken-mainchain.s.sol index c533e427..29ea6c17 100644 --- a/script/factories/factory-maptoken-mainchain.s.sol +++ b/script/factories/factory-maptoken-mainchain.s.sol @@ -94,6 +94,6 @@ abstract contract Factory__MapTokensMainchain is BridgeMigration { uint256 chainId = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); vm.broadcast(_governor); - _roninBridgeManager.propose(chainId, expiredTime, targets, values, calldatas, gasAmounts); + _roninBridgeManager.propose(chainId, expiredTime, address(0), targets, values, calldatas, gasAmounts); } } diff --git a/script/factories/factory-maptoken-roninchain.s.sol b/script/factories/factory-maptoken-roninchain.s.sol index 951a2c3d..5a14a2b8 100644 --- a/script/factories/factory-maptoken-roninchain.s.sol +++ b/script/factories/factory-maptoken-roninchain.s.sol @@ -111,6 +111,6 @@ abstract contract Factory__MapTokensRoninchain is BridgeMigration { _verifyRoninProposalGasAmount(targets, values, calldatas, gasAmounts); vm.broadcast(_governor); - _roninBridgeManager.propose(block.chainid, expiredTime, targets, values, calldatas, gasAmounts); + _roninBridgeManager.propose(block.chainid, expiredTime, address(0), targets, values, calldatas, gasAmounts); } } diff --git a/test/helpers/ProposalUtils.t.sol b/test/helpers/ProposalUtils.t.sol index 2ee8b177..1b7224e1 100644 --- a/test/helpers/ProposalUtils.t.sol +++ b/test/helpers/ProposalUtils.t.sol @@ -22,9 +22,9 @@ contract ProposalUtils is Utils, Test { _domain = keccak256( abi.encode( keccak256("EIP712Domain(string name,string version,bytes32 salt)"), - keccak256("BridgeAdmin"), // name hash - keccak256("2"), // version hash - keccak256(abi.encode("BRIDGE_ADMIN", roninChainId)) // salt + keccak256("BridgeManager"), // name hash + keccak256("3"), // version hash + keccak256(abi.encode("BRIDGE_MANAGER", roninChainId)) // salt ) ); From c5cc1d020571c144226ee4dfc451eff55a51fee0 Mon Sep 17 00:00:00 2001 From: TuDo1403 Date: Tue, 2 Apr 2024 16:40:40 +0700 Subject: [PATCH 134/180] test(RoninGatewayV3): add unit tests for bulkAcknowledgeMainchainWithdraw, bulkSubmitWithdrawalSignatures and submitWithdrawal --- ...AcknowledgeMainchainWithdrew.Gateway.t.sol | 75 +++++++++++++++++ .../bulkDepositAndRecord.Gateway.t.sol | 48 +++++++++-- ...lkSubmitWithdrawalSignatures.Gateway.t.sol | 83 +++++++++++++++++++ .../submitWithdrawal.MainchainGatewayV3.t.sol | 10 +++ 4 files changed, 208 insertions(+), 8 deletions(-) create mode 100644 test/bridge/integration/bridge-manager/deposit-and-record/bulkAcknowledgeMainchainWithdrew.Gateway.t.sol create mode 100644 test/bridge/integration/bridge-manager/deposit-and-record/bulkSubmitWithdrawalSignatures.Gateway.t.sol diff --git a/test/bridge/integration/bridge-manager/deposit-and-record/bulkAcknowledgeMainchainWithdrew.Gateway.t.sol b/test/bridge/integration/bridge-manager/deposit-and-record/bulkAcknowledgeMainchainWithdrew.Gateway.t.sol new file mode 100644 index 00000000..a85890eb --- /dev/null +++ b/test/bridge/integration/bridge-manager/deposit-and-record/bulkAcknowledgeMainchainWithdrew.Gateway.t.sol @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { console2 as console } from "forge-std/console2.sol"; +import { Transfer } from "@ronin/contracts/libraries/Transfer.sol"; +import { Token } from "@ronin/contracts/libraries/Token.sol"; +import "../../BaseIntegration.t.sol"; + +contract BulkAcknowledgeMainchainWithdrew_Gateway_Test is BaseIntegration_Test { + uint256 _numOperatorsForVoteExecuted; + uint256 _sampleReceipt; + uint256[] _bulkReceipts; + uint256 _id = 0; + + function setUp() public override { + super.setUp(); + + vm.deal(address(_bridgeReward), 10 ether); + + _numOperatorsForVoteExecuted = (_roninBridgeManager.minimumVoteWeight() - 1) / 100 + 1; + console.log("Num operators for vote executed:", _numOperatorsForVoteExecuted); + console.log("Total operators:", _param.roninBridgeManager.bridgeOperators.length); + } + + function test_minimum_bulkAcknowledgeMainchainWithdrew() external { + _bulkAcknowledgeMainchainWithdrew(_numOperatorsForVoteExecuted); + + _wrapUpEpoch(); + _wrapUpEpoch(); + + _moveToEndPeriodAndWrapUpEpoch(); + + uint256 lastSyncedPeriod = uint256(vm.load(address(_bridgeTracking), bytes32(uint256(11)))); + for (uint256 i; i < _numOperatorsForVoteExecuted; i++) { + address operator = _param.roninBridgeManager.bridgeOperators[i]; + assertEq(_bridgeTracking.totalBallotOf(lastSyncedPeriod, operator), _id, "Total ballot should be equal to the number of receipts"); + } + } + + function test_allVoters_AcknowledgeMainchainWithdrew() external { + uint256 numAllOperator = _param.roninBridgeManager.bridgeOperators.length; + _bulkAcknowledgeMainchainWithdrew(numAllOperator); + + _wrapUpEpoch(); + + uint256 lastSyncedPeriod = uint256(vm.load(address(_bridgeTracking), bytes32(uint256(11)))); + for (uint256 i; i < numAllOperator; i++) { + address operator = _param.roninBridgeManager.bridgeOperators[i]; + assertEq(_bridgeTracking.totalBallotOf(lastSyncedPeriod, operator), _id, "Total ballot should be equal to the number of receipts"); + } + } + + function _bulkAcknowledgeMainchainWithdrew(uint256 numVote) private { + console.log(">> tryBulkAcknowledgeMainchainWithdrew ...."); + _prepareBulkRequest(); + for (uint256 i; i < numVote; i++) { + console.log(" -> Operator vote:", _param.roninBridgeManager.bridgeOperators[i]); + vm.prank(_param.roninBridgeManager.bridgeOperators[i]); + bool[] memory _executedReceipts = _roninGatewayV3.tryBulkAcknowledgeMainchainWithdrew(_bulkReceipts); + + for (uint256 j; j < _executedReceipts.length; j++) { + assertTrue(_roninGatewayV3.mainchainWithdrewVoted(_bulkReceipts[j], _param.roninBridgeManager.bridgeOperators[i]), "Withdraw Receipt should be voted"); + } + } + } + + function _prepareBulkRequest() internal { + delete _bulkReceipts; + + for (uint256 i; i < 50; i++) { + _sampleReceipt = ++_id; + _bulkReceipts.push(_sampleReceipt); + } + } +} diff --git a/test/bridge/integration/bridge-manager/deposit-and-record/bulkDepositAndRecord.Gateway.t.sol b/test/bridge/integration/bridge-manager/deposit-and-record/bulkDepositAndRecord.Gateway.t.sol index c4a6f767..9159e51f 100644 --- a/test/bridge/integration/bridge-manager/deposit-and-record/bulkDepositAndRecord.Gateway.t.sol +++ b/test/bridge/integration/bridge-manager/deposit-and-record/bulkDepositAndRecord.Gateway.t.sol @@ -28,14 +28,16 @@ contract BulkDepositAndRecord_Gateway_Test is BaseIntegration_Test { }); _numOperatorsForVoteExecuted = (_roninBridgeManager.minimumVoteWeight() - 1) / 100 + 1; + console.log("Num operators for vote executed:", _numOperatorsForVoteExecuted); + console.log("Total operators:", _param.roninBridgeManager.bridgeOperators.length); } function test_bulkDepositFor_wrapUp_checkRewardAndSlash() public { - _depositFor(); + _depositFor(_numOperatorsForVoteExecuted); _moveToEndPeriodAndWrapUpEpoch(); console.log("=============== First 50 Receipts ==========="); - _bulkDepositFor(); + _bulkDepositFor(_numOperatorsForVoteExecuted); _wrapUpEpoch(); _wrapUpEpoch(); @@ -59,7 +61,7 @@ contract BulkDepositAndRecord_Gateway_Test is BaseIntegration_Test { } console.log("==== Check total ballot after new deposit ===="); - _depositFor(); + _depositFor(_numOperatorsForVoteExecuted); logBridgeTracking(); logBridgeSlash(); @@ -76,23 +78,53 @@ contract BulkDepositAndRecord_Gateway_Test is BaseIntegration_Test { } } - function _depositFor() internal { + function test_RecordAllVoters_bulkDepositFor() public { + uint256 numAllOperators = _param.roninBridgeManager.bridgeOperators.length; + + _depositFor(numAllOperators); + _moveToEndPeriodAndWrapUpEpoch(); + + // console.log("=============== First 50 Receipts ==========="); + _bulkDepositFor(numAllOperators); + + _wrapUpEpoch(); + _wrapUpEpoch(); + + _moveToEndPeriodAndWrapUpEpoch(); + + console.log("=============== Check slash and reward behavior ==========="); + console.log("==== Check total ballot before new deposit ===="); + + logBridgeTracking(); + + uint256 lastSyncedPeriod = uint256(vm.load(address(_bridgeTracking), bytes32(uint256(11)))); + for (uint256 i; i < numAllOperators; i++) { + address operator = _param.roninBridgeManager.bridgeOperators[i]; + assertEq(_bridgeTracking.totalBallotOf(lastSyncedPeriod, operator), _id, "Total ballot should be equal to the number of receipts"); + } + } + + function _depositFor(uint256 numVote) internal { console.log(">> depositFor ...."); _sampleReceipt.id = ++_id; - for (uint256 i; i < _numOperatorsForVoteExecuted; i++) { + for (uint256 i; i < numVote; i++) { console.log(" -> Operator vote:", _param.roninBridgeManager.bridgeOperators[i]); vm.prank(_param.roninBridgeManager.bridgeOperators[i]); _roninGatewayV3.depositFor(_sampleReceipt); } } - function _bulkDepositFor() internal { + function _bulkDepositFor(uint256 numVote) internal { console.log(">> bulkDepositFor ...."); _prepareBulkRequest(); - for (uint256 i; i < _numOperatorsForVoteExecuted; i++) { + for (uint256 i; i < numVote; i++) { console.log(" -> Operator vote:", _param.roninBridgeManager.bridgeOperators[i]); vm.prank(_param.roninBridgeManager.bridgeOperators[i]); - _roninGatewayV3.tryBulkDepositFor(_bulkReceipts); + bool[] memory _executedReceipts = _roninGatewayV3.tryBulkDepositFor(_bulkReceipts); + + for (uint256 j; j < _executedReceipts.length; j++) { + assertTrue(_roninGatewayV3.depositVoted(block.chainid, _bulkReceipts[j].id, _param.roninBridgeManager.bridgeOperators[i]), "Receipt should be voted"); + } } } diff --git a/test/bridge/integration/bridge-manager/deposit-and-record/bulkSubmitWithdrawalSignatures.Gateway.t.sol b/test/bridge/integration/bridge-manager/deposit-and-record/bulkSubmitWithdrawalSignatures.Gateway.t.sol new file mode 100644 index 00000000..f8800d1b --- /dev/null +++ b/test/bridge/integration/bridge-manager/deposit-and-record/bulkSubmitWithdrawalSignatures.Gateway.t.sol @@ -0,0 +1,83 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { console2 as console } from "forge-std/console2.sol"; +import { Transfer } from "@ronin/contracts/libraries/Transfer.sol"; +import { Token } from "@ronin/contracts/libraries/Token.sol"; +import "../../BaseIntegration.t.sol"; + +contract BulkSubmitWithdrawalSignatures_Gateway_Test is BaseIntegration_Test { + uint256 _numOperatorsForVoteExecuted; + uint256 _sampleReceipt; + uint256[] _withdrawals; + bytes[] _signatures; + uint256 _id = 0; + + function setUp() public override { + super.setUp(); + + vm.deal(address(_bridgeReward), 10 ether); + + _numOperatorsForVoteExecuted = (_roninBridgeManager.minimumVoteWeight() - 1) / 100 + 1; + console.log("Num operators for vote executed:", _numOperatorsForVoteExecuted); + console.log("Total operators:", _param.roninBridgeManager.bridgeOperators.length); + } + + function test_minimum_bulkSubmitWithdrawalSignatures() external { + _bulkSubmitWithdrawalSignatures(_numOperatorsForVoteExecuted); + + _wrapUpEpoch(); + _wrapUpEpoch(); + + _moveToEndPeriodAndWrapUpEpoch(); + + uint256 lastSyncedPeriod = uint256(vm.load(address(_bridgeTracking), bytes32(uint256(11)))); + for (uint256 i; i < _numOperatorsForVoteExecuted; i++) { + address operator = _param.roninBridgeManager.bridgeOperators[i]; + assertEq(_bridgeTracking.totalBallotOf(lastSyncedPeriod, operator), _id, "Total ballot should be equal to the number of receipts"); + } + } + + function test_allVoters_bulkSubmitWithdrawalSignatures() external { + uint256 numAllOperator = _param.roninBridgeManager.bridgeOperators.length; + _bulkSubmitWithdrawalSignatures(numAllOperator); + + _wrapUpEpoch(); + + uint256 lastSyncedPeriod = uint256(vm.load(address(_bridgeTracking), bytes32(uint256(11)))); + for (uint256 i; i < numAllOperator; i++) { + address operator = _param.roninBridgeManager.bridgeOperators[i]; + assertEq(_bridgeTracking.totalBallotOf(lastSyncedPeriod, operator), _id, "Total ballot should be equal to the number of receipts"); + } + } + + function _bulkSubmitWithdrawalSignatures(uint256 numVote) private { + console.log(">> _bulkSubmitWithdrawalSignatures ...."); + _prepareBulkRequest(); + + for (uint256 i; i < numVote; i++) { + console.log(" -> Operator vote:", _param.roninBridgeManager.bridgeOperators[i]); + vm.prank(_param.roninBridgeManager.bridgeOperators[i]); + _roninGatewayV3.bulkSubmitWithdrawalSignatures(_withdrawals, _signatures); + + for (uint256 j; j < _withdrawals.length; j++) { + address[] memory op = new address[](1); + op[0] = _param.roninBridgeManager.bridgeOperators[i]; + bytes[] memory sig = _roninGatewayV3.getWithdrawalSignatures(_withdrawals[j], op); + + assertTrue(sig[0].length > 0, "Withdraw Receipt should be voted"); + } + } + } + + function _prepareBulkRequest() internal { + delete _withdrawals; + delete _signatures; + + for (uint256 i; i < 50; i++) { + _sampleReceipt = ++_id; + _withdrawals.push(_sampleReceipt); + _signatures.push(abi.encodePacked("signature", i)); + } + } +} diff --git a/test/bridge/integration/mainchain-gateway/submitWithdrawal.MainchainGatewayV3.t.sol b/test/bridge/integration/mainchain-gateway/submitWithdrawal.MainchainGatewayV3.t.sol index d9b1d03a..1ecd8f4a 100644 --- a/test/bridge/integration/mainchain-gateway/submitWithdrawal.MainchainGatewayV3.t.sol +++ b/test/bridge/integration/mainchain-gateway/submitWithdrawal.MainchainGatewayV3.t.sol @@ -16,6 +16,13 @@ interface IERC20 { event Transfer(address indexed from, address indexed to, uint256 value); } +contract ReentrancyActor { + fallback() external payable { + // reentrancy + payable(msg.sender).transfer(msg.value); + } +} + contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test { event Withdrew(bytes32 receiptHash, LibTransfer.Receipt receipt); @@ -29,10 +36,13 @@ contract SubmitWithdrawal_MainchainGatewayV3_Test is BaseIntegration_Test { LibTransfer.Receipt _withdrawalReceipt; bytes32 _domainSeparator; + address actor; function setUp() public virtual override { super.setUp(); + actor = address(new ReentrancyActor()); + _domainSeparator = _mainchainGatewayV3.DOMAIN_SEPARATOR(); _withdrawalReceipt.id = 0; From d4cb23c909f952c3675e578566c40c05b5b1d00e Mon Sep 17 00:00:00 2001 From: TuDo1403 Date: Tue, 9 Apr 2024 14:36:42 +0700 Subject: [PATCH 135/180] test(Proposal, GlobalProposal): add test hash --- test/libraries/Proposal.t.sol | 114 ++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 test/libraries/Proposal.t.sol diff --git a/test/libraries/Proposal.t.sol b/test/libraries/Proposal.t.sol new file mode 100644 index 00000000..0eacb26b --- /dev/null +++ b/test/libraries/Proposal.t.sol @@ -0,0 +1,114 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.23; + +import { Test } from "forge-std/Test.sol"; +import { Proposal } from "@ronin/contracts/libraries/Proposal.sol"; +import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; + +contract ProposalTest is Test { + // keccak256("GlobalProposalDetail(uint256 nonce,uint256 expiryTimestamp,address executor,uint8[] targetOptions,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)"); + bytes32 internal constant GLOBAL_TYPE_HASH = 0xde480f0c53a3651c08fbab1dffbc45fe574f31188827fe52cb9035da9fe57e4a; + // keccak256("ProposalDetail(uint256 nonce,uint256 chainId,uint256 expiryTimestamp,address executor,address[] targets,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)"); + bytes32 internal constant TYPE_HASH = 0x1b59eeec7c321899dc1e7a5b3d876c9a445dffc6d2f96ba842d7489908fdee12; + + function testFuzz_hash_Proposal(uint256 nonce, uint256 chainId, uint256 expiryTimestamp, address executor, uint8 count) external returns (bytes32) { + vm.assume(count < 100 && count != 0); + + address[] memory targets = new address[](count); + uint256[] memory values = new uint256[](count); + bytes[] memory calldatas = new bytes[](count); + uint256[] memory gasAmounts = new uint256[](count); + + for (uint8 i = 0; i < count; i++) { + targets[i] = address(uint160(uint256(keccak256(abi.encodePacked("targets[i]", i))))); + values[i] = uint256(keccak256(abi.encodePacked("values[i]", i))); + calldatas[i] = abi.encodePacked("calldatas[i]", i); + gasAmounts[i] = uint256(keccak256(abi.encodePacked("gasAmounts[i]", i))); + } + + Proposal.ProposalDetail memory proposal = Proposal.ProposalDetail({ + nonce: nonce, + chainId: chainId, + expiryTimestamp: expiryTimestamp, + executor: executor, + targets: targets, + values: values, + calldatas: calldatas, + gasAmounts: gasAmounts + }); + bytes32 actual = Proposal.hash(proposal); + bytes32 expected = hash(proposal); + + assertEq(actual, expected, "hash mismatch"); + } + + function testFuzz_hash_GlobalProposal(uint256 nonce, uint256 expiryTimestamp, address executor, uint8 count) external returns (bytes32) { + vm.assume(count < 100 && count != 0); + + uint8[] memory _targetOptions = new uint8[](count); + uint256[] memory values = new uint256[](count); + bytes[] memory calldatas = new bytes[](count); + uint256[] memory gasAmounts = new uint256[](count); + + for (uint8 i = 0; i < count; i++) { + _targetOptions[i] = uint8(_bound(uint256(keccak256(abi.encodePacked("targetOptions[i]", i))), 0, 4)); + values[i] = uint256(keccak256(abi.encodePacked("values[i]", i))); + calldatas[i] = abi.encodePacked("calldatas[i]", i); + gasAmounts[i] = uint256(keccak256(abi.encodePacked("gasAmounts[i]", i))); + } + + GlobalProposal.TargetOption[] memory targetOptions; + assembly { + targetOptions := _targetOptions + } + + GlobalProposal.GlobalProposalDetail memory proposal = GlobalProposal.GlobalProposalDetail({ + nonce: nonce, + expiryTimestamp: expiryTimestamp, + executor: executor, + targetOptions: targetOptions, + values: values, + calldatas: calldatas, + gasAmounts: gasAmounts + }); + bytes32 actual = GlobalProposal.hash(proposal); + bytes32 expected = hash(proposal); + + assertEq(actual, expected, "hash mismatch"); + } + + function hash(Proposal.ProposalDetail memory proposal) private pure returns (bytes32) { + bytes32[] memory calldatasHashList = new bytes32[](proposal.calldatas.length); + for (uint256 i; i < calldatasHashList.length; ++i) { + calldatasHashList[i] = keccak256(proposal.calldatas[i]); + } + + bytes32 targetsHash = keccak256(abi.encodePacked(proposal.targets)); + bytes32 valuesHash = keccak256(abi.encodePacked(proposal.values)); + bytes32 calldatasHash = keccak256(abi.encodePacked(calldatasHashList)); + bytes32 gasAmountsHash = keccak256(abi.encodePacked(proposal.gasAmounts)); + + return keccak256( + abi.encode( + TYPE_HASH, proposal.nonce, proposal.chainId, proposal.expiryTimestamp, proposal.executor, targetsHash, valuesHash, calldatasHash, gasAmountsHash + ) + ); + } + + function hash(GlobalProposal.GlobalProposalDetail memory proposal) private pure returns (bytes32) { + bytes32[] memory calldatasHashList = new bytes32[](proposal.calldatas.length); + for (uint256 i; i < calldatasHashList.length; ++i) { + calldatasHashList[i] = keccak256(proposal.calldatas[i]); + } + + bytes32 targetsHash = keccak256(abi.encodePacked(proposal.targetOptions)); + bytes32 valuesHash = keccak256(abi.encodePacked(proposal.values)); + bytes32 calldatasHash = keccak256(abi.encodePacked(calldatasHashList)); + bytes32 gasAmountsHash = keccak256(abi.encodePacked(proposal.gasAmounts)); + + return keccak256( + abi.encode(GLOBAL_TYPE_HASH, proposal.nonce, proposal.expiryTimestamp, proposal.executor, targetsHash, valuesHash, calldatasHash, gasAmountsHash) + ); + } +} From bff9b835cbeda79762ab1679a767cacd31debe34 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 10 Apr 2024 17:15:17 +0700 Subject: [PATCH 136/180] fix(RoninGatewayV3): not early-exit in bulk vote --- src/ronin/gateway/RoninGatewayV3.sol | 30 ++++++++++++++++------------ 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/ronin/gateway/RoninGatewayV3.sol b/src/ronin/gateway/RoninGatewayV3.sol index 565e1f27..33fd0c92 100644 --- a/src/ronin/gateway/RoninGatewayV3.sol +++ b/src/ronin/gateway/RoninGatewayV3.sol @@ -161,21 +161,24 @@ contract RoninGatewayV3 is _executedReceipts = new bool[](length); IBridgeTracking bridgeTrackingContract = IBridgeTracking(getContract(ContractType.BRIDGE_TRACKING)); - for (uint256 i; i < length; i++) { + for (uint256 i; i < length; ++i) { withdrawalId = _withdrawalIds[i]; bridgeTrackingContract.recordVote(IBridgeTracking.VoteKind.MainchainWithdrawal, withdrawalId, governor); + + // Mark the withdrawal is executed if (mainchainWithdrew(withdrawalId)) { _executedReceipts[i] = true; - } else { - IsolatedGovernance.Vote storage _vote = mainchainWithdrewVote[withdrawalId]; - Transfer.Receipt memory _withdrawal = withdrawal[withdrawalId]; - bytes32 _hash = _withdrawal.hash(); - VoteStatus _status = _castIsolatedVote(_vote, governor, minVoteWeight, _hash); - if (_status == VoteStatus.Approved) { - _vote.status = VoteStatus.Executed; - bridgeTrackingContract.handleVoteApproved(IBridgeTracking.VoteKind.MainchainWithdrawal, withdrawalId); - emit MainchainWithdrew(_hash, _withdrawal); - } + } + + // Process all votes, not early-exit to track all votes in BridgeTracking + IsolatedGovernance.Vote storage _vote = mainchainWithdrewVote[withdrawalId]; + Transfer.Receipt memory _withdrawal = withdrawal[withdrawalId]; + bytes32 _hash = _withdrawal.hash(); + VoteStatus _status = _castIsolatedVote(_vote, governor, minVoteWeight, _hash); + if (_status == VoteStatus.Approved) { + _vote.status = VoteStatus.Executed; + bridgeTrackingContract.handleVoteApproved(IBridgeTracking.VoteKind.MainchainWithdrawal, withdrawalId); + emit MainchainWithdrew(_hash, _withdrawal); } } } @@ -198,9 +201,10 @@ contract RoninGatewayV3 is iReceipt = receipts[i]; if (depositVote[iReceipt.mainchain.chainId][iReceipt.id].status == VoteStatus.Executed) { _executedReceipts[i] = true; - } else { - _depositFor(iReceipt, msg.sender, minVoteWeight); } + + // Process all votes, not early-exit to track all votes in BridgeTracking + _depositFor(iReceipt, msg.sender, minVoteWeight); } } From 37da9e69db2b1b75ad8185c689ff162a6eda379e Mon Sep 17 00:00:00 2001 From: nxqbao Date: Thu, 11 Apr 2024 11:33:46 +0700 Subject: [PATCH 137/180] fix(LibTokenInfoBatch): assert array length gt 1 --- src/libraries/LibTokenInfoBatch.sol | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libraries/LibTokenInfoBatch.sol b/src/libraries/LibTokenInfoBatch.sol index 60d557bd..b52a175a 100644 --- a/src/libraries/LibTokenInfoBatch.sol +++ b/src/libraries/LibTokenInfoBatch.sol @@ -52,8 +52,8 @@ library LibTokenInfoBatch { function checkERC721Batch(TokenInfoBatch memory self) internal pure returns (bool res) { return self.erc == TokenStandard.ERC721 // Check ERC721 - && self.ids.length != 0 // Info must contain valid array of ids - && self.quantities.length == 0; // Quantity of each ERC721 alway is 1, no input to save gas + && self.ids.length != 0 // Info must contain at least one id in the array + && self.quantities.length == 0; // No requires quantity to save gas, because ERC-721 qty is always 1. } function checkERC1155Batch(TokenInfoBatch memory self) internal pure returns (bool res) { @@ -61,7 +61,8 @@ library LibTokenInfoBatch { if ( !(self.erc == TokenStandard.ERC1155 // Check ERC1155 - && length == self.quantities.length) // Info must have same length for each token id + && self.ids.length != 0 // Info must contain at least one id in the array + && length == self.quantities.length) // Info must have same length for each pair id and quantity ) { return false; } From abcc50e97ce7356abf833786fe28c3c2c26161e2 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Fri, 12 Apr 2024 10:11:41 +0700 Subject: [PATCH 138/180] fix(BridgeManager): remove unused param --- .../governance-proposal/GlobalGovernanceProposal.sol | 4 +--- .../governance-proposal/GovernanceProposal.sol | 4 +--- .../governance-relay/GlobalGovernanceRelay.sol | 1 - .../governance-relay/GovernanceRelay.sol | 1 - src/mainchain/MainchainBridgeManager.sol | 4 ++-- src/ronin/gateway/RoninBridgeManager.sol | 7 +++---- 6 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/extensions/sequential-governance/governance-proposal/GlobalGovernanceProposal.sol b/src/extensions/sequential-governance/governance-proposal/GlobalGovernanceProposal.sol index 23c14008..234ffe2a 100644 --- a/src/extensions/sequential-governance/governance-proposal/GlobalGovernanceProposal.sol +++ b/src/extensions/sequential-governance/governance-proposal/GlobalGovernanceProposal.sol @@ -16,7 +16,6 @@ abstract contract GlobalGovernanceProposal is GlobalCoreGovernance, CommonGovern GlobalProposal.GlobalProposalDetail calldata globalProposal, Ballot.VoteType[] calldata supports_, Signature[] calldata signatures, - bytes32 domainSeparator, address creator ) internal returns (Proposal.ProposalDetail memory proposal) { proposal = _proposeGlobalStruct(globalProposal, creator); @@ -29,8 +28,7 @@ abstract contract GlobalGovernanceProposal is GlobalCoreGovernance, CommonGovern function _castGlobalProposalBySignatures( GlobalProposal.GlobalProposalDetail calldata globalProposal, Ballot.VoteType[] calldata supports_, - Signature[] calldata signatures, - bytes32 domainSeparator + Signature[] calldata signatures ) internal { Proposal.ProposalDetail memory _proposal = globalProposal.intoProposalDetail(_resolveTargets({ targetOptions: globalProposal.targetOptions, strict: true })); diff --git a/src/extensions/sequential-governance/governance-proposal/GovernanceProposal.sol b/src/extensions/sequential-governance/governance-proposal/GovernanceProposal.sol index 7e9d75ec..cbc23fe0 100644 --- a/src/extensions/sequential-governance/governance-proposal/GovernanceProposal.sol +++ b/src/extensions/sequential-governance/governance-proposal/GovernanceProposal.sol @@ -14,7 +14,6 @@ abstract contract GovernanceProposal is CoreGovernance, CommonGovernanceProposal Proposal.ProposalDetail calldata _proposal, Ballot.VoteType[] calldata _supports, Signature[] calldata _signatures, - bytes32 _domainSeparator, address _creator ) internal { _proposeProposalStruct(_proposal, _creator); @@ -27,8 +26,7 @@ abstract contract GovernanceProposal is CoreGovernance, CommonGovernanceProposal function _castProposalBySignatures( Proposal.ProposalDetail calldata _proposal, Ballot.VoteType[] calldata _supports, - Signature[] calldata _signatures, - bytes32 _domainSeparator + Signature[] calldata _signatures ) internal { bytes32 _proposalHash = _proposal.hash(); diff --git a/src/extensions/sequential-governance/governance-relay/GlobalGovernanceRelay.sol b/src/extensions/sequential-governance/governance-relay/GlobalGovernanceRelay.sol index b6d283c3..76b347ca 100644 --- a/src/extensions/sequential-governance/governance-relay/GlobalGovernanceRelay.sol +++ b/src/extensions/sequential-governance/governance-relay/GlobalGovernanceRelay.sol @@ -25,7 +25,6 @@ abstract contract GlobalGovernanceRelay is CommonGovernanceRelay, GlobalCoreGove GlobalProposal.GlobalProposalDetail calldata globalProposal, Ballot.VoteType[] calldata supports_, Signature[] calldata signatures, - bytes32 domainSeparator, address creator ) internal { Proposal.ProposalDetail memory _proposal = _proposeGlobalStruct(globalProposal, creator); diff --git a/src/extensions/sequential-governance/governance-relay/GovernanceRelay.sol b/src/extensions/sequential-governance/governance-relay/GovernanceRelay.sol index 9349d1ee..e7bafea0 100644 --- a/src/extensions/sequential-governance/governance-relay/GovernanceRelay.sol +++ b/src/extensions/sequential-governance/governance-relay/GovernanceRelay.sol @@ -19,7 +19,6 @@ abstract contract GovernanceRelay is CoreGovernance, CommonGovernanceRelay { Proposal.ProposalDetail calldata _proposal, Ballot.VoteType[] calldata _supports, Signature[] calldata _signatures, - bytes32 _domainSeparator, address _creator ) internal { _proposeProposalStruct(_proposal, _creator); diff --git a/src/mainchain/MainchainBridgeManager.sol b/src/mainchain/MainchainBridgeManager.sol index 821ee8aa..7bc5f3cf 100644 --- a/src/mainchain/MainchainBridgeManager.sol +++ b/src/mainchain/MainchainBridgeManager.sol @@ -42,7 +42,7 @@ contract MainchainBridgeManager is BridgeManager, GovernanceRelay, GlobalGoverna Signature[] calldata signatures ) external onlyGovernor { _requireExecutor(proposal.executor, msg.sender); - _relayProposal(proposal, supports_, signatures, DOMAIN_SEPARATOR, msg.sender); + _relayProposal(proposal, supports_, signatures, msg.sender); } /** @@ -57,7 +57,7 @@ contract MainchainBridgeManager is BridgeManager, GovernanceRelay, GlobalGoverna Signature[] calldata signatures ) external onlyGovernor { _requireExecutor(globalProposal.executor, msg.sender); - _relayGlobalProposal({ globalProposal: globalProposal, supports_: supports_, signatures: signatures, domainSeparator: DOMAIN_SEPARATOR, creator: msg.sender }); + _relayGlobalProposal({ globalProposal: globalProposal, supports_: supports_, signatures: signatures, creator: msg.sender }); } function _requireExecutor(address executor, address caller) internal pure { diff --git a/src/ronin/gateway/RoninBridgeManager.sol b/src/ronin/gateway/RoninBridgeManager.sol index f4d86701..09ea6c03 100644 --- a/src/ronin/gateway/RoninBridgeManager.sol +++ b/src/ronin/gateway/RoninBridgeManager.sol @@ -69,7 +69,7 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan Ballot.VoteType[] calldata _supports, Signature[] calldata _signatures ) external onlyGovernor { - _proposeProposalStructAndCastVotes(_proposal, _supports, _signatures, DOMAIN_SEPARATOR, msg.sender); + _proposeProposalStructAndCastVotes(_proposal, _supports, _signatures, msg.sender); } /** @@ -118,7 +118,7 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan * @dev See `GovernanceProposal-_castProposalBySignatures`. */ function castProposalBySignatures(Proposal.ProposalDetail calldata proposal, Ballot.VoteType[] calldata supports_, Signature[] calldata signatures) external { - _castProposalBySignatures(proposal, supports_, signatures, DOMAIN_SEPARATOR); + _castProposalBySignatures(proposal, supports_, signatures); } /** @@ -167,7 +167,6 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan globalProposal: globalProposal, supports_: supports_, signatures: signatures, - domainSeparator: DOMAIN_SEPARATOR, creator: msg.sender }); } @@ -180,7 +179,7 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan Ballot.VoteType[] calldata supports_, Signature[] calldata signatures ) external { - _castGlobalProposalBySignatures({ globalProposal: globalProposal, supports_: supports_, signatures: signatures, domainSeparator: DOMAIN_SEPARATOR }); + _castGlobalProposalBySignatures({ globalProposal: globalProposal, supports_: supports_, signatures: signatures }); } /** From 9bd0664904c240cd7716868a15e2f2bccbc9b482 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Fri, 12 Apr 2024 10:12:04 +0700 Subject: [PATCH 139/180] fix(BridgeManager): fix chainId in propose --- src/ronin/gateway/RoninBridgeManager.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ronin/gateway/RoninBridgeManager.sol b/src/ronin/gateway/RoninBridgeManager.sol index 09ea6c03..b9e85058 100644 --- a/src/ronin/gateway/RoninBridgeManager.sol +++ b/src/ronin/gateway/RoninBridgeManager.sol @@ -43,8 +43,8 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan ) external onlyGovernor { _proposeProposalStruct( Proposal.ProposalDetail({ - nonce: _createVotingRound(block.chainid), - chainId: block.chainid, + nonce: _createVotingRound(chainId), + chainId: chainId, expiryTimestamp: expiryTimestamp, executor: executor, targets: targets, From 657fefb15e01b6268794d6871d87ffb8d5d4239d Mon Sep 17 00:00:00 2001 From: nxqbao Date: Fri, 12 Apr 2024 10:52:27 +0700 Subject: [PATCH 140/180] chore: forge fmt --- .../maptoken-pixel-configs.s.sol | 2 +- .../update-axiechat-config.s.sol | 16 +--- .../20240206-maptoken-banana-roninchain.s.sol | 39 ++++---- .../changeGV-stablenode-config.s.sol | 2 +- .../20240308-maptoken-aperios-mainchain.s.sol | 6 +- ...20240308-maptoken-aperios-roninchain.s.sol | 6 +- .../base-maptoken.s.sol | 8 +- .../maptoken-aperios-configs.s.sol | 2 +- .../maptoken-ygg-configs.s.sol | 2 +- .../20240405-maptoken-usdc-mainchain.s.sol | 28 ++---- .../20240409-maptoken-slp-mainchain.s.sol | 14 +-- .../deploy-sepolia.s.sol | 7 +- .../maptoken-slp-configs.s.sol | 2 +- .../maptoken-usdc-configs.s.sol | 2 +- .../20240411-operators-key.s.sol | 13 +++ script/BaseMigrationV2.sol | 23 ++--- script/BridgeMigration.sol | 38 ++++---- script/Migration.s.sol | 2 +- .../factory-maptoken-mainchain.s.sol | 13 +-- .../factory-maptoken-roninchain.s.sol | 6 +- script/libraries/LibArray.sol | 23 ++--- script/libraries/MapTokenInfo.sol | 2 - src/extensions/GatewayV3.sol | 8 +- src/extensions/MinimumWithdrawal.sol | 2 +- src/extensions/RONTransferHelper.sol | 10 +- .../TransparentUpgradeableProxyV2.sol | 14 +-- src/extensions/WithdrawalLimitation.sol | 34 ++----- .../BridgeTrackingHelper.sol | 6 +- .../GlobalGovernanceRelay.sol | 7 +- .../governance-relay/GovernanceRelay.sol | 7 +- src/interfaces/IBridgeAdminProposal.sol | 5 +- src/interfaces/IMainchainGatewayV3.sol | 11 +-- src/interfaces/IQuorum.sol | 13 +-- src/interfaces/IRoninGatewayV3.sol | 11 +-- .../bridge/IBridgeManagerCallback.sol | 11 +-- src/interfaces/bridge/IBridgeSlash.sol | 8 +- src/interfaces/bridge/IBridgeTracking.sol | 5 +- .../validator/ICandidateManager.sol | 7 +- .../validator/ICoinbaseExecution.sol | 40 ++------ src/interfaces/validator/IEmergencyExit.sol | 13 +-- .../validator/IRoninValidatorSet.sol | 8 +- .../validator/info-fragments/IJailingInfo.sol | 9 +- src/libraries/BridgeOperatorsBallot.sol | 5 +- src/libraries/GlobalProposal.sol | 11 ++- src/libraries/LibRequestBatch.sol | 6 +- src/libraries/LibTokenInfo.sol | 13 +-- src/libraries/LibTokenInfoBatch.sol | 24 ++--- src/mainchain/MainchainGatewayBatcher.sol | 12 +-- src/mainchain/MainchainGatewayV3.sol | 16 ++-- src/mocks/ronin/MockBridgeReward.sol | 23 +---- src/mocks/ronin/MockBridgeSlash.sol | 6 +- .../ronin/MockRoninGatewayV3Extended.sol | 16 +--- src/mocks/types/MockTUint256Slot.sol | 3 +- src/ronin/gateway/BridgeSlash.sol | 40 ++------ src/ronin/gateway/BridgeTracking.sol | 5 +- src/ronin/gateway/PauseEnforcer.sol | 2 +- src/ronin/gateway/RoninBridgeManager.sol | 7 +- .../gateway/RoninBridgeManagerConstructor.sol | 1 - src/ronin/gateway/RoninGatewayV3.sol | 51 +++------- src/utils/CommonErrors.sol | 2 +- src/utils/ContractType.sol | 33 +++---- src/utils/IdentityGuard.sol | 4 +- src/utils/RoleAccess.sol | 23 ++--- test/bridge/integration/BaseIntegration.t.sol | 20 ++-- .../updateOperator.RoninBridgeManager.t.sol | 10 +- ...IsApprovedInLastEpoch.BridgeTracking.t.sol | 6 +- ...otApprovedInLastEpoch.BridgeTracking.t.sol | 15 +-- ...l.MainchainGatewayV3.erc20.benchmark.t.sol | 2 +- .../emergencyAction.PauseEnforcer.t.sol | 23 ++--- .../set-config/setConfig.PauseEnforcer.t.sol | 3 +- .../depositVote.RoninGatewayV3.t.sol | 11 +-- .../concrete/bridge-manager/constructor.t.sol | 15 +-- .../fuzz/bridge-manager/BridgeReward.t.sol | 50 +++------- .../fuzz/bridge-manager/BridgeSlash.t.sol | 96 ++++--------------- test/helpers/LibArrayUtils.t.sol | 8 +- test/helpers/MainchainBridgeAdminUtils.t.sol | 4 +- test/helpers/Randomizer.t.sol | 11 +-- test/helpers/RoninBridgeAdminUtils.t.sol | 4 +- test/mocks/MockBridgeSlash.sol | 22 ++--- test/mocks/MockBridgeTracking.sol | 18 +--- 80 files changed, 318 insertions(+), 788 deletions(-) create mode 100644 script/20240411-upgrade-v3.2.0-testnet/20240411-operators-key.s.sol diff --git a/script/20240131-maptoken-pixel/maptoken-pixel-configs.s.sol b/script/20240131-maptoken-pixel/maptoken-pixel-configs.s.sol index 7ba0fbfd..0ef79aa9 100644 --- a/script/20240131-maptoken-pixel/maptoken-pixel-configs.s.sol +++ b/script/20240131-maptoken-pixel/maptoken-pixel-configs.s.sol @@ -21,4 +21,4 @@ contract Migration__MapToken_Pixel_Config { uint256 constant _aggMinThreshold = 1000 ether; address internal _governor = 0xe880802580a1fbdeF67ACe39D1B21c5b2C74f059; // TODO: replace by address of the SV governor -} \ No newline at end of file +} diff --git a/script/20240131-maptoken-pixel/update-axiechat-config.s.sol b/script/20240131-maptoken-pixel/update-axiechat-config.s.sol index 85afd74d..485ac114 100644 --- a/script/20240131-maptoken-pixel/update-axiechat-config.s.sol +++ b/script/20240131-maptoken-pixel/update-axiechat-config.s.sol @@ -7,7 +7,7 @@ contract Migration__Update_AxieChat_Config { address constant _axieChatBridgeOperator = address(0x772112C7e5dD4ed663e844e79d77c1569a2E88ce); address constant _axieChatGovernor = address(0x5832C3219c1dA998e828E1a2406B73dbFC02a70C); - function _removeAxieChatGovernorAddress() pure internal returns (bytes memory) { + function _removeAxieChatGovernorAddress() internal pure returns (bytes memory) { address[] memory bridgeOperator = new address[](1); bridgeOperator[0] = _axieChatBridgeOperator; @@ -15,12 +15,10 @@ contract Migration__Update_AxieChat_Config { // address[] calldata bridgeOperators // ) - return abi.encodeCall(IBridgeManager.removeBridgeOperators, ( - bridgeOperator - )); + return abi.encodeCall(IBridgeManager.removeBridgeOperators, (bridgeOperator)); } - function _addAxieChatGovernorAddress() pure internal returns (bytes memory) { + function _addAxieChatGovernorAddress() internal pure returns (bytes memory) { uint96[] memory voteWeight = new uint96[](1); address[] memory governor = new address[](1); address[] memory bridgeOperator = new address[](1); @@ -35,10 +33,6 @@ contract Migration__Update_AxieChat_Config { // address[] calldata bridgeOperators // ) - return abi.encodeCall(IBridgeManager.addBridgeOperators, ( - voteWeight, - governor, - bridgeOperator - )); + return abi.encodeCall(IBridgeManager.addBridgeOperators, (voteWeight, governor, bridgeOperator)); } -} \ No newline at end of file +} diff --git a/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol b/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol index 15ebb8ca..2f64cfbb 100644 --- a/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol +++ b/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol @@ -1,24 +1,24 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import {console2} from "forge-std/console2.sol"; -import {StdStyle} from "forge-std/StdStyle.sol"; -import {BaseMigration} from "foundry-deployment-kit/BaseMigration.s.sol"; -import {DefaultNetwork} from "foundry-deployment-kit/utils/DefaultNetwork.sol"; - -import {RoninBridgeManager} from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; -import {IRoninGatewayV3} from "@ronin/contracts/interfaces/IRoninGatewayV3.sol"; -import {MinimumWithdrawal} from "@ronin/contracts/extensions/MinimumWithdrawal.sol"; -import {LibTokenInfo, TokenStandard} from "@ronin/contracts/libraries/LibTokenInfo.sol"; -import {Ballot} from "@ronin/contracts/libraries/Ballot.sol"; -import {GlobalProposal} from "@ronin/contracts/libraries/GlobalProposal.sol"; -import {Proposal} from "@ronin/contracts/libraries/Proposal.sol"; - -import {Contract} from "../utils/Contract.sol"; -import {BridgeMigration} from "../BridgeMigration.sol"; -import {Network} from "../utils/Network.sol"; -import {Contract} from "../utils/Contract.sol"; -import {IGeneralConfigExtended} from "../IGeneralConfigExtended.sol"; +import { console2 } from "forge-std/console2.sol"; +import { StdStyle } from "forge-std/StdStyle.sol"; +import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; +import { DefaultNetwork } from "foundry-deployment-kit/utils/DefaultNetwork.sol"; + +import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; +import { IRoninGatewayV3 } from "@ronin/contracts/interfaces/IRoninGatewayV3.sol"; +import { MinimumWithdrawal } from "@ronin/contracts/extensions/MinimumWithdrawal.sol"; +import { LibTokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; +import { Ballot } from "@ronin/contracts/libraries/Ballot.sol"; +import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; +import { Proposal } from "@ronin/contracts/libraries/Proposal.sol"; + +import { Contract } from "../utils/Contract.sol"; +import { BridgeMigration } from "../BridgeMigration.sol"; +import { Network } from "../utils/Network.sol"; +import { Contract } from "../utils/Contract.sol"; +import { IGeneralConfigExtended } from "../IGeneralConfigExtended.sol"; import "forge-std/console2.sol"; @@ -95,8 +95,7 @@ contract Migration__20240206_MapTokenBananaRoninChain is // uint256[] calldata chainIds, // TokenStandard[] calldata _standards // ) - bytes memory innerData = - abi.encodeCall(IRoninGatewayV3.mapTokens, (roninTokens, mainchainTokens, chainIds, standards)); + bytes memory innerData = abi.encodeCall(IRoninGatewayV3.mapTokens, (roninTokens, mainchainTokens, chainIds, standards)); bytes memory proxyData = abi.encodeWithSignature("functionDelegateCall(bytes)", innerData); targets[0] = _roninGatewayV3; diff --git a/script/20240206-maptoken-banana/changeGV-stablenode-config.s.sol b/script/20240206-maptoken-banana/changeGV-stablenode-config.s.sol index ce9ce487..d727a47b 100644 --- a/script/20240206-maptoken-banana/changeGV-stablenode-config.s.sol +++ b/script/20240206-maptoken-banana/changeGV-stablenode-config.s.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; -import {IBridgeManager} from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; +import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; contract Migration__ChangeGV_StableNode_Config { address constant _stableNodeBridgeOperator = address(0x564DcB855Eb360826f27D1Eb9c57cbbe6C76F50F); diff --git a/script/20240308-maptoken-aperios/20240308-maptoken-aperios-mainchain.s.sol b/script/20240308-maptoken-aperios/20240308-maptoken-aperios-mainchain.s.sol index 81c096e9..57cf4462 100644 --- a/script/20240308-maptoken-aperios/20240308-maptoken-aperios-mainchain.s.sol +++ b/script/20240308-maptoken-aperios/20240308-maptoken-aperios-mainchain.s.sol @@ -9,11 +9,7 @@ contract Migration__20240308_MapTokenAperiosMainchain is Base__MapToken, Factory return Base__MapToken._initCaller(); } - function _initTokenList() - internal - override(Base__MapToken, Factory__MapTokensMainchain) - returns (uint256 totalToken, MapTokenInfo[] memory infos) - { + function _initTokenList() internal override(Base__MapToken, Factory__MapTokensMainchain) returns (uint256 totalToken, MapTokenInfo[] memory infos) { return Base__MapToken._initTokenList(); } diff --git a/script/20240308-maptoken-aperios/20240308-maptoken-aperios-roninchain.s.sol b/script/20240308-maptoken-aperios/20240308-maptoken-aperios-roninchain.s.sol index 472bcea4..ff54faad 100644 --- a/script/20240308-maptoken-aperios/20240308-maptoken-aperios-roninchain.s.sol +++ b/script/20240308-maptoken-aperios/20240308-maptoken-aperios-roninchain.s.sol @@ -10,11 +10,7 @@ contract Migration__20240308_MapTokenAperiosRoninchain is Base__MapToken, Factor return Base__MapToken._initCaller(); } - function _initTokenList() - internal - override(Base__MapToken, Factory__MapTokensRoninchain) - returns (uint256 totalToken, MapTokenInfo[] memory infos) - { + function _initTokenList() internal override(Base__MapToken, Factory__MapTokensRoninchain) returns (uint256 totalToken, MapTokenInfo[] memory infos) { return Base__MapToken._initTokenList(); } diff --git a/script/20240308-maptoken-aperios/base-maptoken.s.sol b/script/20240308-maptoken-aperios/base-maptoken.s.sol index 37a9b809..e4561c68 100644 --- a/script/20240308-maptoken-aperios/base-maptoken.s.sol +++ b/script/20240308-maptoken-aperios/base-maptoken.s.sol @@ -7,12 +7,8 @@ import "./caller-configs.s.sol"; import "./maptoken-aperios-configs.s.sol"; import "./maptoken-ygg-configs.s.sol"; -contract Base__MapToken is - Migration__Caller_Config, - Migration__MapToken_Aperios_Config, - Migration__MapToken_Ygg_Config -{ - function _initCaller() internal virtual returns(address) { +contract Base__MapToken is Migration__Caller_Config, Migration__MapToken_Aperios_Config, Migration__MapToken_Ygg_Config { + function _initCaller() internal virtual returns (address) { return SM_GOVERNOR; } diff --git a/script/20240308-maptoken-aperios/maptoken-aperios-configs.s.sol b/script/20240308-maptoken-aperios/maptoken-aperios-configs.s.sol index 185d0ff2..85bfe9f2 100644 --- a/script/20240308-maptoken-aperios/maptoken-aperios-configs.s.sol +++ b/script/20240308-maptoken-aperios/maptoken-aperios-configs.s.sol @@ -6,7 +6,7 @@ import { MapTokenInfo } from "../libraries/MapTokenInfo.sol"; contract Migration__MapToken_Aperios_Config { MapTokenInfo _aperiosInfo; - constructor () { + constructor() { _aperiosInfo.roninToken = address(0x7894b3088d069E70895EFfA4e8f7D2c243Fd04C1); _aperiosInfo.mainchainToken = address(0x95b4B8CaD3567B5d7EF7399C2aE1d7070692aB0D); _aperiosInfo.minThreshold = 10 ether; diff --git a/script/20240308-maptoken-aperios/maptoken-ygg-configs.s.sol b/script/20240308-maptoken-aperios/maptoken-ygg-configs.s.sol index aab89f50..380c7c5b 100644 --- a/script/20240308-maptoken-aperios/maptoken-ygg-configs.s.sol +++ b/script/20240308-maptoken-aperios/maptoken-ygg-configs.s.sol @@ -6,7 +6,7 @@ import { MapTokenInfo } from "../libraries/MapTokenInfo.sol"; contract Migration__MapToken_Ygg_Config { MapTokenInfo _yggInfo; - constructor () { + constructor() { _yggInfo.roninToken = address(0x1c306872bC82525d72Bf3562E8F0aA3f8F26e857); _yggInfo.mainchainToken = address(0x25f8087EAD173b73D6e8B84329989A8eEA16CF73); _yggInfo.minThreshold = 20 ether; diff --git a/script/20240403-deploy-sepolia/20240405-maptoken-usdc-mainchain.s.sol b/script/20240403-deploy-sepolia/20240405-maptoken-usdc-mainchain.s.sol index 1bb7eea1..d62362f9 100644 --- a/script/20240403-deploy-sepolia/20240405-maptoken-usdc-mainchain.s.sol +++ b/script/20240403-deploy-sepolia/20240405-maptoken-usdc-mainchain.s.sol @@ -75,28 +75,16 @@ contract Migration__20240405_MapTokenUsdcMainchain is BridgeMigration, Migration thresholds[2][1] = 0; thresholds[3][1] = 0; - bytes memory innerData = abi.encodeCall(IMainchainGatewayV3.mapTokensAndThresholds, ( - mainchainTokens, - roninTokens, - standards, - thresholds - )); + bytes memory innerData = abi.encodeCall(IMainchainGatewayV3.mapTokensAndThresholds, (mainchainTokens, roninTokens, standards, thresholds)); - bytes memory setEmergencyPauserInnerData = abi.encodeCall(GatewayV3.setEmergencyPauser, ( - _mainchainPauseEnforcer - )); + bytes memory setEmergencyPauserInnerData = abi.encodeCall(GatewayV3.setEmergencyPauser, (_mainchainPauseEnforcer)); vm.startBroadcast(0x968D0Cd7343f711216817E617d3f92a23dC91c07); - address(_mainchainGatewayV3).call(abi.encodeWithSignature("functionDelegateCall(bytes)",innerData)); - address(_mainchainGatewayV3).call(abi.encodeWithSignature("functionDelegateCall(bytes)",setEmergencyPauserInnerData)); + address(_mainchainGatewayV3).call(abi.encodeWithSignature("functionDelegateCall(bytes)", innerData)); + address(_mainchainGatewayV3).call(abi.encodeWithSignature("functionDelegateCall(bytes)", setEmergencyPauserInnerData)); return; - - - - - bytes memory proxyData = abi.encodeWithSignature("functionDelegateCall(bytes)", innerData); targets[0] = _mainchainGatewayV3; @@ -106,9 +94,7 @@ contract Migration__20240405_MapTokenUsdcMainchain is BridgeMigration, Migration targets[1] = _mainchainGatewayV3; values[1] = 0; - calldatas[1] = abi.encodeWithSignature("functionDelegateCall(bytes)", abi.encodeCall(GatewayV3.setEmergencyPauser, ( - _mainchainPauseEnforcer - ))); + calldatas[1] = abi.encodeWithSignature("functionDelegateCall(bytes)", abi.encodeCall(GatewayV3.setEmergencyPauser, (_mainchainPauseEnforcer))); gasAmounts[1] = 1_000_000; // ================ VERIFY AND EXECUTE PROPOSAL =============== @@ -125,9 +111,7 @@ contract Migration__20240405_MapTokenUsdcMainchain is BridgeMigration, Migration governors[0] = 0x087D08e3ba42e64E3948962dd1371F906D1278b9; governors[1] = 0x52ec2e6BBcE45AfFF8955Da6410bb13812F4289F; - _mainchainProposalUtils = new MainchainBridgeAdminUtils( - 2021, governorPKs, MainchainBridgeManager(_mainchainBridgeManager), governors[0] - ); + _mainchainProposalUtils = new MainchainBridgeAdminUtils(2021, governorPKs, MainchainBridgeManager(_mainchainBridgeManager), governors[0]); Proposal.ProposalDetail memory proposal = Proposal.ProposalDetail({ nonce: MainchainBridgeManager(_mainchainBridgeManager).round(11155111) + 1, diff --git a/script/20240403-deploy-sepolia/20240409-maptoken-slp-mainchain.s.sol b/script/20240403-deploy-sepolia/20240409-maptoken-slp-mainchain.s.sol index 8f05dfec..5a6eca65 100644 --- a/script/20240403-deploy-sepolia/20240409-maptoken-slp-mainchain.s.sol +++ b/script/20240403-deploy-sepolia/20240409-maptoken-slp-mainchain.s.sol @@ -70,26 +70,16 @@ contract Migration__20240409_MapTokenSlpMainchain is BridgeMigration, Migration_ thresholds[2][0] = _unlockFeePercentages; thresholds[3][0] = _dailyWithdrawalLimit; - bytes memory innerData = abi.encodeCall(IMainchainGatewayV3.mapTokensAndThresholds, ( - mainchainTokens, - roninTokens, - standards, - thresholds - )); + bytes memory innerData = abi.encodeCall(IMainchainGatewayV3.mapTokensAndThresholds, (mainchainTokens, roninTokens, standards, thresholds)); vm.startBroadcast(0x968D0Cd7343f711216817E617d3f92a23dC91c07); - address(_mainchainGatewayV3).call(abi.encodeWithSignature("functionDelegateCall(bytes)",innerData)); + address(_mainchainGatewayV3).call(abi.encodeWithSignature("functionDelegateCall(bytes)", innerData)); _mainchainSlp.mint(address(_mainchainGatewayV3), 50_000_000); _mainchainSlp.mint(address(0xC65C6BEA96666f150BEF9b936630f6355BfFCC06), 100_000); return; - - - - - // bytes memory proxyData = abi.encodeWithSignature("functionDelegateCall(bytes)", innerData); // targets[0] = _mainchainGatewayV3; diff --git a/script/20240403-deploy-sepolia/deploy-sepolia.s.sol b/script/20240403-deploy-sepolia/deploy-sepolia.s.sol index daeaa291..2faf4ac4 100644 --- a/script/20240403-deploy-sepolia/deploy-sepolia.s.sol +++ b/script/20240403-deploy-sepolia/deploy-sepolia.s.sol @@ -87,9 +87,7 @@ contract DeploySepolia is BridgeMigration, DeploySepolia__ChangeGV_Config { _mainchainMockERC721 = new MockERC721Deploy().run(); _param = ISharedArgument(LibSharedAddress.CONFIG).sharedArguments(); - _mainchainProposalUtils = new MainchainBridgeAdminUtils( - 2021, _param.test.governorPKs, _mainchainBridgeManager, _param.mainchainBridgeManager.governors[0] - ); + _mainchainProposalUtils = new MainchainBridgeAdminUtils(2021, _param.test.governorPKs, _mainchainBridgeManager, _param.mainchainBridgeManager.governors[0]); } function _mainchainGatewayV3Initialize() internal { @@ -171,8 +169,7 @@ contract DeploySepolia is BridgeMigration, DeploySepolia__ChangeGV_Config { Ballot.VoteType[] memory supports_ = new Ballot.VoteType[](1); supports_[0] = Ballot.VoteType.For; - SignatureConsumer.Signature[] memory signatures = - _mainchainProposalUtils.generateSignatures(proposal, _param.test.governorPKs); + SignatureConsumer.Signature[] memory signatures = _mainchainProposalUtils.generateSignatures(proposal, _param.test.governorPKs); vm.broadcast(_mainchainBridgeManager.getGovernors()[0]); _mainchainBridgeManager.relayProposal(proposal, supports_, signatures); diff --git a/script/20240403-deploy-sepolia/maptoken-slp-configs.s.sol b/script/20240403-deploy-sepolia/maptoken-slp-configs.s.sol index 6b4c9406..93eec901 100644 --- a/script/20240403-deploy-sepolia/maptoken-slp-configs.s.sol +++ b/script/20240403-deploy-sepolia/maptoken-slp-configs.s.sol @@ -14,4 +14,4 @@ contract Migration__MapToken_Slp_Config { // uint256 constant _slpMinThreshold = 1000; address internal _governor = 0xe880802580a1fbdeF67ACe39D1B21c5b2C74f059; // TODO: replace by address of the SV governor -} \ No newline at end of file +} diff --git a/script/20240403-deploy-sepolia/maptoken-usdc-configs.s.sol b/script/20240403-deploy-sepolia/maptoken-usdc-configs.s.sol index 79205270..4c4d6049 100644 --- a/script/20240403-deploy-sepolia/maptoken-usdc-configs.s.sol +++ b/script/20240403-deploy-sepolia/maptoken-usdc-configs.s.sol @@ -15,4 +15,4 @@ contract Migration__MapToken_Usdc_Config { // uint256 constant _usdcMinThreshold = 10 ether; address internal _governor = 0xe880802580a1fbdeF67ACe39D1B21c5b2C74f059; // TODO: replace by address of the SV governor -} \ No newline at end of file +} diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-operators-key.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-operators-key.s.sol new file mode 100644 index 00000000..78e02f75 --- /dev/null +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-operators-key.s.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +contract Migration__20240409_GovernorsKey { + function _loadGovernorPKs() internal pure returns (uint256[] memory res) { + res = new uint256[](4); + + res[3] = 0xe3c1c8220c4ee4a6532d633296c3301db5397cff8a89a920da28f8bec97fcfb6; + res[2] = 0xeb80bc77e3164b6bb3eebf7d5f96f2496eb292fab563377f247d2db5887395e0; + res[0] = 0xed79936f720ac50b7c06138c6fd2d70abc19935de0fb347b0d782bdb6630e5a4; + res[1] = 0x3b3eb1d442ea0d728bc069f9d6d47ba8dcc6c867800cdf42a12117cf231bba59; + } +} diff --git a/script/BaseMigrationV2.sol b/script/BaseMigrationV2.sol index df622324..2f11a188 100644 --- a/script/BaseMigrationV2.sol +++ b/script/BaseMigrationV2.sol @@ -8,13 +8,10 @@ abstract contract BaseMigrationV2 is BaseMigration { using LibString for bytes32; using LibProxy for address payable; - function _deployProxy(TContract contractType, bytes memory args) - internal - virtual - override - logFn(string.concat("_deployProxy ", TContract.unwrap(contractType).unpackOne())) - returns (address payable deployed) - { + function _deployProxy( + TContract contractType, + bytes memory args + ) internal virtual override logFn(string.concat("_deployProxy ", TContract.unwrap(contractType).unpackOne())) returns (address payable deployed) { string memory contractName = CONFIG.getContractName(contractType); address logic = _deployLogic(contractType); @@ -30,18 +27,10 @@ abstract contract BaseMigrationV2 is BaseMigration { assertEq( actualProxyAdmin, proxyAdmin, - string.concat( - "BaseMigration: Invalid proxy admin\n", - "Actual: ", - vm.toString(actualProxyAdmin), - "\nExpected: ", - vm.toString(proxyAdmin) - ) + string.concat("BaseMigration: Invalid proxy admin\n", "Actual: ", vm.toString(actualProxyAdmin), "\nExpected: ", vm.toString(proxyAdmin)) ); CONFIG.setAddress(network(), contractType, deployed); - ARTIFACT_FACTORY.generateArtifact( - sender(), deployed, proxyAbsolutePath, string.concat(contractName, "Proxy"), args, proxyNonce - ); + ARTIFACT_FACTORY.generateArtifact(sender(), deployed, proxyAbsolutePath, string.concat(contractName, "Proxy"), args, proxyNonce); } } diff --git a/script/BridgeMigration.sol b/script/BridgeMigration.sol index 7d332c66..5f7f846a 100644 --- a/script/BridgeMigration.sol +++ b/script/BridgeMigration.sol @@ -5,7 +5,6 @@ import { console2 } from "forge-std/console2.sol"; import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; import { TNetwork } from "foundry-deployment-kit/types/Types.sol"; - import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; import { ErrorHandler } from "@ronin/contracts/libraries/ErrorHandler.sol"; import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; @@ -49,20 +48,25 @@ contract BridgeMigration is BaseMigration { function _resolveRoninTarget(GlobalProposal.TargetOption targetOption) internal returns (address) { _config.switchTo(DefaultNetwork.RoninMainnet.key()); - if (targetOption == GlobalProposal.TargetOption.BridgeManager) + if (targetOption == GlobalProposal.TargetOption.BridgeManager) { return _config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key()); + } - if (targetOption == GlobalProposal.TargetOption.GatewayContract) + if (targetOption == GlobalProposal.TargetOption.GatewayContract) { return _config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key()); + } - if (targetOption == GlobalProposal.TargetOption.BridgeReward) + if (targetOption == GlobalProposal.TargetOption.BridgeReward) { return _config.getAddressFromCurrentNetwork(Contract.BridgeReward.key()); + } - if (targetOption == GlobalProposal.TargetOption.BridgeSlash) + if (targetOption == GlobalProposal.TargetOption.BridgeSlash) { return _config.getAddressFromCurrentNetwork(Contract.BridgeSlash.key()); + } - if (targetOption == GlobalProposal.TargetOption.BridgeTracking) + if (targetOption == GlobalProposal.TargetOption.BridgeTracking) { return _config.getAddressFromCurrentNetwork(Contract.BridgeTracking.key()); + } return address(0); } @@ -70,21 +74,18 @@ contract BridgeMigration is BaseMigration { function _resolveMainchainTarget(GlobalProposal.TargetOption targetOption) internal returns (address) { _config.createFork(Network.EthMainnet.key()); _config.switchTo(Network.EthMainnet.key()); - if (targetOption == GlobalProposal.TargetOption.BridgeManager) + if (targetOption == GlobalProposal.TargetOption.BridgeManager) { return _config.getAddressFromCurrentNetwork(Contract.MainchainBridgeManager.key()); + } - if (targetOption == GlobalProposal.TargetOption.GatewayContract) + if (targetOption == GlobalProposal.TargetOption.GatewayContract) { return _config.getAddressFromCurrentNetwork(Contract.MainchainBridgeManager.key()); + } return address(0); } - function _verifyRoninProposalGasAmount( - address[] memory targets, - uint256[] memory values, - bytes[] memory calldatas, - uint256[] memory gasAmounts - ) internal { + function _verifyRoninProposalGasAmount(address[] memory targets, uint256[] memory values, bytes[] memory calldatas, uint256[] memory gasAmounts) internal { _config.switchTo(DefaultNetwork.RoninMainnet.key()); address roninBridgeManager = _config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key()); @@ -95,12 +96,7 @@ contract BridgeMigration is BaseMigration { vm.revertTo(snapshotId); } - function _verifyMainchainProposalGasAmount( - address[] memory targets, - uint256[] memory values, - bytes[] memory calldatas, - uint256[] memory gasAmounts - ) internal { + function _verifyMainchainProposalGasAmount(address[] memory targets, uint256[] memory values, bytes[] memory calldatas, uint256[] memory gasAmounts) internal { _config.createFork(Network.EthMainnet.key()); _config.switchTo(Network.EthMainnet.key()); @@ -139,4 +135,4 @@ contract BridgeMigration is BaseMigration { } } } -} \ No newline at end of file +} diff --git a/script/Migration.s.sol b/script/Migration.s.sol index fb3784d6..bdbfa5aa 100644 --- a/script/Migration.s.sol +++ b/script/Migration.s.sol @@ -59,7 +59,7 @@ contract Migration is BaseMigrationV2, Utils { // Mainchain Gateway V3 param.mainchainGatewayV3.roleSetter = 0x968D0Cd7343f711216817E617d3f92a23dC91c07; param.mainchainGatewayV3.roninChainId = 2021; - param.mainchainGatewayV3.numerator = 4 ; + param.mainchainGatewayV3.numerator = 4; param.mainchainGatewayV3.highTierVWNumerator = 7; param.mainchainGatewayV3.denominator = 10; diff --git a/script/factories/factory-maptoken-mainchain.s.sol b/script/factories/factory-maptoken-mainchain.s.sol index 3527832d..5fec45ae 100644 --- a/script/factories/factory-maptoken-mainchain.s.sol +++ b/script/factories/factory-maptoken-mainchain.s.sol @@ -26,13 +26,9 @@ abstract contract Factory__MapTokensMainchain is BridgeMigration { super.setUp(); _roninBridgeManager = RoninBridgeManager(_config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); - _mainchainGatewayV3 = _config.getAddress( - _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).key(), Contract.MainchainGatewayV3.key() - ); - _mainchainBridgeManager = _config.getAddress( - _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).key(), - Contract.MainchainBridgeManager.key() - ); + _mainchainGatewayV3 = _config.getAddress(_config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).key(), Contract.MainchainGatewayV3.key()); + _mainchainBridgeManager = + _config.getAddress(_config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).key(), Contract.MainchainBridgeManager.key()); _governor = _initCaller(); } @@ -77,8 +73,7 @@ abstract contract Factory__MapTokensMainchain is BridgeMigration { // uint256[][4] calldata _thresholds // ) - bytes memory innerData = - abi.encodeCall(IMainchainGatewayV3.mapTokensAndThresholds, (mainchainTokens, roninTokens, standards, thresholds)); + bytes memory innerData = abi.encodeCall(IMainchainGatewayV3.mapTokensAndThresholds, (mainchainTokens, roninTokens, standards, thresholds)); bytes memory proxyData = abi.encodeWithSignature("functionDelegateCall(bytes)", innerData); diff --git a/script/factories/factory-maptoken-roninchain.s.sol b/script/factories/factory-maptoken-roninchain.s.sol index 121e73fe..346ab46a 100644 --- a/script/factories/factory-maptoken-roninchain.s.sol +++ b/script/factories/factory-maptoken-roninchain.s.sol @@ -75,8 +75,7 @@ abstract contract Factory__MapTokensRoninchain is BridgeMigration { // uint256[] calldata chainIds, // TokenStandard[] calldata _standards // ) - bytes memory innerData = - abi.encodeCall(IRoninGatewayV3.mapTokens, (roninTokens, mainchainTokens, chainIds, standards)); + bytes memory innerData = abi.encodeCall(IRoninGatewayV3.mapTokens, (roninTokens, mainchainTokens, chainIds, standards)); bytes memory proxyData = abi.encodeWithSignature("functionDelegateCall(bytes)", innerData); targets[0] = _roninGatewayV3; @@ -97,8 +96,7 @@ abstract contract Factory__MapTokensRoninchain is BridgeMigration { minThresholds[i] = tokenInfos[i].minThreshold; } - innerData = - abi.encodeCall(MinimumWithdrawal.setMinimumThresholds, (roninTokensToSetMinThreshold, minThresholds)); + innerData = abi.encodeCall(MinimumWithdrawal.setMinimumThresholds, (roninTokensToSetMinThreshold, minThresholds)); proxyData = abi.encodeWithSignature("functionDelegateCall(bytes)", innerData); targets[1] = _roninGatewayV3; diff --git a/script/libraries/LibArray.sol b/script/libraries/LibArray.sol index d9630afa..afd37758 100644 --- a/script/libraries/LibArray.sol +++ b/script/libraries/LibArray.sol @@ -59,9 +59,9 @@ library LibArray { let dataElementLocation := add(data, 0x20) // Iterate until the bound is not met. - for { let end := add(dataElementLocation, mul(len, 0x20)) } lt(dataElementLocation, end) { - dataElementLocation := add(dataElementLocation, 0x20) - } { result := add(result, mload(dataElementLocation)) } + for { let end := add(dataElementLocation, mul(len, 0x20)) } lt(dataElementLocation, end) { dataElementLocation := add(dataElementLocation, 0x20) } { + result := add(result, mload(dataElementLocation)) + } } } @@ -105,11 +105,7 @@ library LibArray { * @notice This function modify `self` and `values` * @return sorted The sorted array. */ - function inlineSortByValue(uint256[] memory self, uint256[] memory values) - internal - pure - returns (uint256[] memory sorted) - { + function inlineSortByValue(uint256[] memory self, uint256[] memory values) internal pure returns (uint256[] memory sorted) { return inlineQuickSortByValue(self, values); } @@ -120,11 +116,7 @@ library LibArray { * @notice This function modify `self` and `values` * @return sorted The sorted array. */ - function inlineQuickSortByValue(uint256[] memory self, uint256[] memory values) - internal - pure - returns (uint256[] memory sorted) - { + function inlineQuickSortByValue(uint256[] memory self, uint256[] memory values) internal pure returns (uint256[] memory sorted) { uint256 length = self.length; if (length != values.length) revert LengthMismatch(); unchecked { @@ -144,10 +136,7 @@ library LibArray { * @param right The right index of the subarray to be sorted. * @notice This function modify `arr` and `values` */ - function inlineQuickSortByValue(uint256[] memory arr, uint256[] memory values, int256 left, int256 right) - private - pure - { + function inlineQuickSortByValue(uint256[] memory arr, uint256[] memory values, int256 left, int256 right) private pure { unchecked { if (left == right) return; int256 i = left; diff --git a/script/libraries/MapTokenInfo.sol b/script/libraries/MapTokenInfo.sol index b1e0463c..fc7edbf6 100644 --- a/script/libraries/MapTokenInfo.sol +++ b/script/libraries/MapTokenInfo.sol @@ -4,10 +4,8 @@ pragma solidity ^0.8.19; struct MapTokenInfo { address roninToken; address mainchainToken; - // Config on mainchain uint256 minThreshold; - // Config on ronin chain uint256 highTierThreshold; uint256 lockedThreshold; diff --git a/src/extensions/GatewayV3.sol b/src/extensions/GatewayV3.sol index b76c96c2..43c55b9e 100644 --- a/src/extensions/GatewayV3.sol +++ b/src/extensions/GatewayV3.sol @@ -5,7 +5,7 @@ import "@openzeppelin/contracts/security/Pausable.sol"; import "../interfaces/IQuorum.sol"; import "./collections/HasProxyAdmin.sol"; -abstract contract GatewayV3 is HasProxyAdmin, Pausable, IQuorum { +abstract contract GatewayV3 is HasProxyAdmin, Pausable, IQuorum { uint256 internal _num; uint256 internal _denom; @@ -77,11 +77,7 @@ abstract contract GatewayV3 is HasProxyAdmin, Pausable, IQuorum { * Emits the `ThresholdUpdated` event. * */ - function _setThreshold(uint256 _numerator, uint256 _denominator) - internal - virtual - returns (uint256 _previousNum, uint256 _previousDenom) - { + function _setThreshold(uint256 _numerator, uint256 _denominator) internal virtual returns (uint256 _previousNum, uint256 _previousDenom) { if (_numerator > _denominator) revert ErrInvalidThreshold(msg.sig); _previousNum = _num; _previousDenom = _denom; diff --git a/src/extensions/MinimumWithdrawal.sol b/src/extensions/MinimumWithdrawal.sol index 9b0cc4dd..acf49592 100644 --- a/src/extensions/MinimumWithdrawal.sol +++ b/src/extensions/MinimumWithdrawal.sol @@ -47,7 +47,7 @@ abstract contract MinimumWithdrawal is HasProxyAdmin { function _setMinimumThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) internal virtual { if (_tokens.length != _thresholds.length) revert ErrLengthMismatch(msg.sig); - for (uint256 _i; _i < _tokens.length; ) { + for (uint256 _i; _i < _tokens.length;) { minimumThreshold[_tokens[_i]] = _thresholds[_i]; unchecked { diff --git a/src/extensions/RONTransferHelper.sol b/src/extensions/RONTransferHelper.sol index 5fc77b24..95fe234a 100644 --- a/src/extensions/RONTransferHelper.sol +++ b/src/extensions/RONTransferHelper.sol @@ -40,17 +40,13 @@ abstract contract RONTransferHelper { * */ function _unsafeSendRON(address payable recipient, uint256 amount) internal returns (bool success) { - (success, ) = recipient.call{ value: amount }(""); + (success,) = recipient.call{ value: amount }(""); } /** * @dev Same purpose with {_unsafeSendRONLimitGas(address,uin256)} but containing gas limit stipend forwarded in the call. */ - function _unsafeSendRONLimitGas( - address payable recipient, - uint256 amount, - uint256 gas - ) internal returns (bool success) { - (success, ) = recipient.call{ value: amount, gas: gas }(""); + function _unsafeSendRONLimitGas(address payable recipient, uint256 amount, uint256 gas) internal returns (bool success) { + (success,) = recipient.call{ value: amount, gas: gas }(""); } } diff --git a/src/extensions/TransparentUpgradeableProxyV2.sol b/src/extensions/TransparentUpgradeableProxyV2.sol index 96963683..af851ca3 100644 --- a/src/extensions/TransparentUpgradeableProxyV2.sol +++ b/src/extensions/TransparentUpgradeableProxyV2.sol @@ -4,11 +4,7 @@ pragma solidity ^0.8.0; import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; contract TransparentUpgradeableProxyV2 is TransparentUpgradeableProxy { - constructor( - address _logic, - address admin_, - bytes memory _data - ) payable TransparentUpgradeableProxy(_logic, admin_, _data) {} + constructor(address _logic, address admin_, bytes memory _data) payable TransparentUpgradeableProxy(_logic, admin_, _data) { } /** * @dev Calls a function from the current implementation as specified by `_data`, which should be an encoded function call. @@ -27,12 +23,8 @@ contract TransparentUpgradeableProxyV2 is TransparentUpgradeableProxy { let _result := delegatecall(gas(), _addr, add(_data, 32), mload(_data), 0, 0) returndatacopy(0, 0, returndatasize()) switch _result - case 0 { - revert(0, returndatasize()) - } - default { - return(0, returndatasize()) - } + case 0 { revert(0, returndatasize()) } + default { return(0, returndatasize()) } } } } diff --git a/src/extensions/WithdrawalLimitation.sol b/src/extensions/WithdrawalLimitation.sol index dc95c86f..586af812 100644 --- a/src/extensions/WithdrawalLimitation.sol +++ b/src/extensions/WithdrawalLimitation.sol @@ -9,11 +9,7 @@ abstract contract WithdrawalLimitation is GatewayV3 { /// @dev Emitted when the high-tier vote weight threshold is updated event HighTierVoteWeightThresholdUpdated( - uint256 indexed nonce, - uint256 indexed numerator, - uint256 indexed denominator, - uint256 previousNumerator, - uint256 previousDenominator + uint256 indexed nonce, uint256 indexed numerator, uint256 indexed denominator, uint256 previousNumerator, uint256 previousDenominator ); /// @dev Emitted when the thresholds for high-tier withdrawals that requires high-tier vote weights are updated event HighTierThresholdsUpdated(address[] tokens, uint256[] thresholds); @@ -56,10 +52,7 @@ abstract contract WithdrawalLimitation is GatewayV3 { * - The high-tier vote weight threshold must equal to or larger than the normal threshold. * */ - function setThreshold( - uint256 _numerator, - uint256 _denominator - ) external virtual override onlyAdmin returns (uint256 _previousNum, uint256 _previousDenom) { + function setThreshold(uint256 _numerator, uint256 _denominator) external virtual override onlyAdmin returns (uint256 _previousNum, uint256 _previousDenom) { (_previousNum, _previousDenom) = _setThreshold(_numerator, _denominator); _verifyThresholds(); } @@ -106,10 +99,7 @@ abstract contract WithdrawalLimitation is GatewayV3 { * Emits the `HighTierThresholdsUpdated` event. * */ - function setHighTierThresholds( - address[] calldata _tokens, - uint256[] calldata _thresholds - ) external virtual onlyAdmin { + function setHighTierThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) external virtual onlyAdmin { if (_tokens.length == 0) revert ErrEmptyArray(); _setHighTierThresholds(_tokens, _thresholds); } @@ -139,10 +129,7 @@ abstract contract WithdrawalLimitation is GatewayV3 { * Emits the `UnlockFeePercentagesUpdated` event. * */ - function setUnlockFeePercentages( - address[] calldata _tokens, - uint256[] calldata _percentages - ) external virtual onlyAdmin { + function setUnlockFeePercentages(address[] calldata _tokens, uint256[] calldata _percentages) external virtual onlyAdmin { if (_tokens.length == 0) revert ErrEmptyArray(); _setUnlockFeePercentages(_tokens, _percentages); } @@ -175,10 +162,7 @@ abstract contract WithdrawalLimitation is GatewayV3 { * Emits the `HighTierVoteWeightThresholdUpdated` event. * */ - function _setHighTierVoteWeightThreshold( - uint256 _numerator, - uint256 _denominator - ) internal returns (uint256 _previousNum, uint256 _previousDenom) { + function _setHighTierVoteWeightThreshold(uint256 _numerator, uint256 _denominator) internal returns (uint256 _previousNum, uint256 _previousDenom) { if (_numerator > _denominator) revert ErrInvalidThreshold(msg.sig); _previousNum = _highTierVWNum; @@ -203,7 +187,7 @@ abstract contract WithdrawalLimitation is GatewayV3 { function _setHighTierThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) internal virtual { if (_tokens.length != _thresholds.length) revert ErrLengthMismatch(msg.sig); - for (uint256 _i; _i < _tokens.length; ) { + for (uint256 _i; _i < _tokens.length;) { highTierThreshold[_tokens[_i]] = _thresholds[_i]; unchecked { @@ -225,7 +209,7 @@ abstract contract WithdrawalLimitation is GatewayV3 { function _setLockedThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) internal virtual { if (_tokens.length != _thresholds.length) revert ErrLengthMismatch(msg.sig); - for (uint256 _i; _i < _tokens.length; ) { + for (uint256 _i; _i < _tokens.length;) { lockedThreshold[_tokens[_i]] = _thresholds[_i]; unchecked { @@ -248,7 +232,7 @@ abstract contract WithdrawalLimitation is GatewayV3 { function _setUnlockFeePercentages(address[] calldata _tokens, uint256[] calldata _percentages) internal virtual { if (_tokens.length != _percentages.length) revert ErrLengthMismatch(msg.sig); - for (uint256 _i; _i < _tokens.length; ) { + for (uint256 _i; _i < _tokens.length;) { if (_percentages[_i] > _MAX_PERCENTAGE) revert ErrInvalidPercentage(); unlockFeePercentages[_tokens[_i]] = _percentages[_i]; @@ -272,7 +256,7 @@ abstract contract WithdrawalLimitation is GatewayV3 { function _setDailyWithdrawalLimits(address[] calldata _tokens, uint256[] calldata _limits) internal virtual { if (_tokens.length != _limits.length) revert ErrLengthMismatch(msg.sig); - for (uint256 _i; _i < _tokens.length; ) { + for (uint256 _i; _i < _tokens.length;) { dailyWithdrawalLimit[_tokens[_i]] = _limits[_i]; unchecked { diff --git a/src/extensions/bridge-operator-governance/BridgeTrackingHelper.sol b/src/extensions/bridge-operator-governance/BridgeTrackingHelper.sol index 4512c58f..f729f5ff 100644 --- a/src/extensions/bridge-operator-governance/BridgeTrackingHelper.sol +++ b/src/extensions/bridge-operator-governance/BridgeTrackingHelper.sol @@ -14,11 +14,7 @@ abstract contract BridgeTrackingHelper { * @notice The function checks if each individual ballot count is not greater than the total votes recorded. * @notice It also verifies that the sum of all individual ballot counts does not exceed the total available ballots. */ - function _isValidBridgeTrackingResponse( - uint256 totalBallot, - uint256 totalVote, - uint256[] memory ballots - ) internal pure returns (bool valid) { + function _isValidBridgeTrackingResponse(uint256 totalBallot, uint256 totalVote, uint256[] memory ballots) internal pure returns (bool valid) { valid = true; uint256 sumBallot; uint256 length = ballots.length; diff --git a/src/extensions/sequential-governance/governance-relay/GlobalGovernanceRelay.sol b/src/extensions/sequential-governance/governance-relay/GlobalGovernanceRelay.sol index 76b347ca..419dead7 100644 --- a/src/extensions/sequential-governance/governance-relay/GlobalGovernanceRelay.sol +++ b/src/extensions/sequential-governance/governance-relay/GlobalGovernanceRelay.sol @@ -28,11 +28,6 @@ abstract contract GlobalGovernanceRelay is CommonGovernanceRelay, GlobalCoreGove address creator ) internal { Proposal.ProposalDetail memory _proposal = _proposeGlobalStruct(globalProposal, creator); - _relayVotesBySignatures( - _proposal, - supports_, - signatures, - globalProposal.hash() - ); + _relayVotesBySignatures(_proposal, supports_, signatures, globalProposal.hash()); } } diff --git a/src/extensions/sequential-governance/governance-relay/GovernanceRelay.sol b/src/extensions/sequential-governance/governance-relay/GovernanceRelay.sol index e7bafea0..2b32fd3a 100644 --- a/src/extensions/sequential-governance/governance-relay/GovernanceRelay.sol +++ b/src/extensions/sequential-governance/governance-relay/GovernanceRelay.sol @@ -22,11 +22,6 @@ abstract contract GovernanceRelay is CoreGovernance, CommonGovernanceRelay { address _creator ) internal { _proposeProposalStruct(_proposal, _creator); - _relayVotesBySignatures( - _proposal, - _supports, - _signatures, - _proposal.hash() - ); + _relayVotesBySignatures(_proposal, _supports, _signatures, _proposal.hash()); } } diff --git a/src/interfaces/IBridgeAdminProposal.sol b/src/interfaces/IBridgeAdminProposal.sol index b6c22fb6..cf0b0149 100644 --- a/src/interfaces/IBridgeAdminProposal.sol +++ b/src/interfaces/IBridgeAdminProposal.sol @@ -15,8 +15,5 @@ interface IBridgeAdminProposal { /** * @dev Returns the synced bridge operator set info. */ - function lastSyncedBridgeOperatorSetInfo() - external - view - returns (BridgeOperatorsBallot.BridgeOperatorSet memory bridgeOperatorSetInfo); + function lastSyncedBridgeOperatorSetInfo() external view returns (BridgeOperatorsBallot.BridgeOperatorSet memory bridgeOperatorSetInfo); } diff --git a/src/interfaces/IMainchainGatewayV3.sol b/src/interfaces/IMainchainGatewayV3.sol index 41b0b87d..8ac6d6d1 100644 --- a/src/interfaces/IMainchainGatewayV3.sol +++ b/src/interfaces/IMainchainGatewayV3.sol @@ -83,10 +83,7 @@ interface IMainchainGatewayV3 is SignatureConsumer, MappedTokenConsumer { * Emits the `Withdrew` once the assets are released. * */ - function submitWithdrawal( - Transfer.Receipt memory _receipt, - Signature[] memory _signatures - ) external returns (bool _locked); + function submitWithdrawal(Transfer.Receipt memory _receipt, Signature[] memory _signatures) external returns (bool _locked); /** * @dev Approves a specific withdrawal. @@ -109,11 +106,7 @@ interface IMainchainGatewayV3 is SignatureConsumer, MappedTokenConsumer { * Emits the `TokenMapped` event. * */ - function mapTokens( - address[] calldata _mainchainTokens, - address[] calldata _roninTokens, - TokenStandard[] calldata _standards - ) external; + function mapTokens(address[] calldata _mainchainTokens, address[] calldata _roninTokens, TokenStandard[] calldata _standards) external; /** * @dev Maps mainchain tokens to Ronin network and sets thresholds. diff --git a/src/interfaces/IQuorum.sol b/src/interfaces/IQuorum.sol index 29c8f462..97619626 100644 --- a/src/interfaces/IQuorum.sol +++ b/src/interfaces/IQuorum.sol @@ -3,13 +3,7 @@ pragma solidity ^0.8.0; interface IQuorum { /// @dev Emitted when the threshold is updated - event ThresholdUpdated( - uint256 indexed nonce, - uint256 indexed numerator, - uint256 indexed denominator, - uint256 previousNumerator, - uint256 previousDenominator - ); + event ThresholdUpdated(uint256 indexed nonce, uint256 indexed numerator, uint256 indexed denominator, uint256 previousNumerator, uint256 previousDenominator); /** * @dev Returns the threshold. @@ -35,8 +29,5 @@ interface IQuorum { * Emits the `ThresholdUpdated` event. * */ - function setThreshold( - uint256 _numerator, - uint256 _denominator - ) external returns (uint256 _previousNum, uint256 _previousDenom); + function setThreshold(uint256 _numerator, uint256 _denominator) external returns (uint256 _previousNum, uint256 _previousDenom); } diff --git a/src/interfaces/IRoninGatewayV3.sol b/src/interfaces/IRoninGatewayV3.sol index 7e6d6fa9..c9d8d573 100644 --- a/src/interfaces/IRoninGatewayV3.sol +++ b/src/interfaces/IRoninGatewayV3.sol @@ -32,11 +32,7 @@ interface IRoninGatewayV3 is MappedTokenConsumer { event TokenMapped(address[] roninTokens, address[] mainchainTokens, uint256[] chainIds, TokenStandard[] standards); /// @dev Emitted when the threshold is updated event TrustedThresholdUpdated( - uint256 indexed nonce, - uint256 indexed numerator, - uint256 indexed denominator, - uint256 previousNumerator, - uint256 previousDenominator + uint256 indexed nonce, uint256 indexed numerator, uint256 indexed denominator, uint256 previousNumerator, uint256 previousDenominator ); /// @dev Emitted when a deposit is voted event DepositVoted(address indexed bridgeOperator, uint256 indexed id, uint256 indexed chainId, bytes32 receiptHash); @@ -49,10 +45,7 @@ interface IRoninGatewayV3 is MappedTokenConsumer { /** * @dev Returns withdrawal signatures. */ - function getWithdrawalSignatures( - uint256 _withdrawalId, - address[] calldata _validators - ) external view returns (bytes[] memory); + function getWithdrawalSignatures(uint256 _withdrawalId, address[] calldata _validators) external view returns (bytes[] memory); /** * @dev Deposits based on the receipt. diff --git a/src/interfaces/bridge/IBridgeManagerCallback.sol b/src/interfaces/bridge/IBridgeManagerCallback.sol index 9d63f0f8..22c0d730 100644 --- a/src/interfaces/bridge/IBridgeManagerCallback.sol +++ b/src/interfaces/bridge/IBridgeManagerCallback.sol @@ -14,11 +14,7 @@ interface IBridgeManagerCallback is IERC165 { * @param addeds The corresponding boolean values indicating whether the operators were added or not. * @return selector The selector of the function being called. */ - function onBridgeOperatorsAdded( - address[] memory bridgeOperators, - uint96[] calldata weights, - bool[] memory addeds - ) external returns (bytes4 selector); + function onBridgeOperatorsAdded(address[] memory bridgeOperators, uint96[] calldata weights, bool[] memory addeds) external returns (bytes4 selector); /** * @dev Handles the event when bridge operators are removed. @@ -26,8 +22,5 @@ interface IBridgeManagerCallback is IERC165 { * @param removeds The corresponding boolean values indicating whether the operators were removed or not. * @return selector The selector of the function being called. */ - function onBridgeOperatorsRemoved( - address[] memory bridgeOperators, - bool[] memory removeds - ) external returns (bytes4 selector); + function onBridgeOperatorsRemoved(address[] memory bridgeOperators, bool[] memory removeds) external returns (bytes4 selector); } diff --git a/src/interfaces/bridge/IBridgeSlash.sol b/src/interfaces/bridge/IBridgeSlash.sol index fd90f78a..d2d60b1b 100644 --- a/src/interfaces/bridge/IBridgeSlash.sol +++ b/src/interfaces/bridge/IBridgeSlash.sol @@ -12,13 +12,7 @@ interface IBridgeSlash is IBridgeSlashEvents { * @dev Slashes the unavailability of bridge operators during a specific period. * @param period The period to slash the bridge operators for. */ - function execSlashBridgeOperators( - address[] calldata operators, - uint256[] calldata ballots, - uint256 totalBallot, - uint256 totalVote, - uint256 period - ) external; + function execSlashBridgeOperators(address[] calldata operators, uint256[] calldata ballots, uint256 totalBallot, uint256 totalVote, uint256 period) external; /** * @dev Returns the penalize durations for the specified bridge operators. diff --git a/src/interfaces/bridge/IBridgeTracking.sol b/src/interfaces/bridge/IBridgeTracking.sol index 1b86b232..32ee5386 100644 --- a/src/interfaces/bridge/IBridgeTracking.sol +++ b/src/interfaces/bridge/IBridgeTracking.sol @@ -33,10 +33,7 @@ interface IBridgeTracking { /** * @dev Returns the total number of ballots of bridge operators at the specific period `_period`. */ - function getManyTotalBallots( - uint256 _period, - address[] calldata _bridgeOperators - ) external view returns (uint256[] memory); + function getManyTotalBallots(uint256 _period, address[] calldata _bridgeOperators) external view returns (uint256[] memory); /** * @dev Returns the total number of ballots of a bridge operator at the specific period `_period`. diff --git a/src/interfaces/validator/ICandidateManager.sol b/src/interfaces/validator/ICandidateManager.sol index 2ccb5bee..7d52576e 100644 --- a/src/interfaces/validator/ICandidateManager.sol +++ b/src/interfaces/validator/ICandidateManager.sol @@ -110,12 +110,7 @@ interface ICandidateManager { * Emits the event `CandidateGranted`. * */ - function execApplyValidatorCandidate( - address _admin, - address _consensusAddr, - address payable _treasuryAddr, - uint256 _commissionRate - ) external; + function execApplyValidatorCandidate(address _admin, address _consensusAddr, address payable _treasuryAddr, uint256 _commissionRate) external; /** * @dev Requests to revoke a validator candidate in next `_secsLeft` seconds. diff --git a/src/interfaces/validator/ICoinbaseExecution.sol b/src/interfaces/validator/ICoinbaseExecution.sol index c1946d16..15d92f06 100644 --- a/src/interfaces/validator/ICoinbaseExecution.sol +++ b/src/interfaces/validator/ICoinbaseExecution.sol @@ -19,59 +19,31 @@ interface ICoinbaseExecution is ISlashingExecution { event BridgeOperatorSetUpdated(uint256 indexed period, uint256 indexed epoch, address[] bridgeOperators); /// @dev Emitted when the reward of the block producer is deprecated. - event BlockRewardDeprecated( - address indexed coinbaseAddr, - uint256 rewardAmount, - BlockRewardDeprecatedType deprecatedType - ); + event BlockRewardDeprecated(address indexed coinbaseAddr, uint256 rewardAmount, BlockRewardDeprecatedType deprecatedType); /// @dev Emitted when the block reward is submitted. event BlockRewardSubmitted(address indexed coinbaseAddr, uint256 submittedAmount, uint256 bonusAmount); /// @dev Emitted when the block producer reward is distributed. event MiningRewardDistributed(address indexed consensusAddr, address indexed recipient, uint256 amount); /// @dev Emitted when the contract fails when distributing the block producer reward. - event MiningRewardDistributionFailed( - address indexed consensusAddr, - address indexed recipient, - uint256 amount, - uint256 contractBalance - ); + event MiningRewardDistributionFailed(address indexed consensusAddr, address indexed recipient, uint256 amount, uint256 contractBalance); /// @dev Emitted when the bridge operator reward is distributed. - event BridgeOperatorRewardDistributed( - address indexed consensusAddr, - address indexed bridgeOperator, - address indexed recipientAddr, - uint256 amount - ); + event BridgeOperatorRewardDistributed(address indexed consensusAddr, address indexed bridgeOperator, address indexed recipientAddr, uint256 amount); /// @dev Emitted when the contract fails when distributing the bridge operator reward. event BridgeOperatorRewardDistributionFailed( - address indexed consensusAddr, - address indexed bridgeOperator, - address indexed recipient, - uint256 amount, - uint256 contractBalance + address indexed consensusAddr, address indexed bridgeOperator, address indexed recipient, uint256 amount, uint256 contractBalance ); /// @dev Emitted when the fast finality reward is distributed. event FastFinalityRewardDistributed(address indexed consensusAddr, address indexed recipient, uint256 amount); /// @dev Emitted when the contract fails when distributing the fast finality reward. - event FastFinalityRewardDistributionFailed( - address indexed consensusAddr, - address indexed recipient, - uint256 amount, - uint256 contractBalance - ); + event FastFinalityRewardDistributionFailed(address indexed consensusAddr, address indexed recipient, uint256 amount, uint256 contractBalance); /// @dev Emitted when the amount of RON reward is distributed to staking contract. event StakingRewardDistributed(uint256 totalAmount, address[] consensusAddrs, uint256[] amounts); /// @dev Emitted when the contracts fails when distributing the amount of RON to the staking contract. - event StakingRewardDistributionFailed( - uint256 totalAmount, - address[] consensusAddrs, - uint256[] amounts, - uint256 contractBalance - ); + event StakingRewardDistributionFailed(uint256 totalAmount, address[] consensusAddrs, uint256[] amounts, uint256 contractBalance); /// @dev Emitted when the epoch is wrapped up. event WrappedUpEpoch(uint256 indexed periodNumber, uint256 indexed epochNumber, bool periodEnding); diff --git a/src/interfaces/validator/IEmergencyExit.sol b/src/interfaces/validator/IEmergencyExit.sol index d6a2cb5e..33c59060 100644 --- a/src/interfaces/validator/IEmergencyExit.sol +++ b/src/interfaces/validator/IEmergencyExit.sol @@ -6,18 +6,9 @@ interface IEmergencyExit { /// @dev Emitted when the fund is locked from an emergency exit request event EmergencyExitRequested(address indexed consensusAddr, uint256 lockedAmount); /// @dev Emitted when the fund that locked from an emergency exit request is transferred to the recipient. - event EmergencyExitLockedFundReleased( - address indexed consensusAddr, - address indexed recipient, - uint256 unlockedAmount - ); + event EmergencyExitLockedFundReleased(address indexed consensusAddr, address indexed recipient, uint256 unlockedAmount); /// @dev Emitted when the fund that locked from an emergency exit request is failed to transferred back. - event EmergencyExitLockedFundReleasingFailed( - address indexed consensusAddr, - address indexed recipient, - uint256 unlockedAmount, - uint256 contractBalance - ); + event EmergencyExitLockedFundReleasingFailed(address indexed consensusAddr, address indexed recipient, uint256 unlockedAmount, uint256 contractBalance); /// @dev Emitted when the emergency exit locked amount is updated. event EmergencyExitLockedAmountUpdated(uint256 amount); diff --git a/src/interfaces/validator/IRoninValidatorSet.sol b/src/interfaces/validator/IRoninValidatorSet.sol index 6628bf13..7e7f9f15 100644 --- a/src/interfaces/validator/IRoninValidatorSet.sol +++ b/src/interfaces/validator/IRoninValidatorSet.sol @@ -8,10 +8,4 @@ import "./ICoinbaseExecution.sol"; import "./ISlashingExecution.sol"; import "./IEmergencyExit.sol"; -interface IRoninValidatorSet is - ICandidateManager, - ICommonInfo, - ISlashingExecution, - ICoinbaseExecution, - IEmergencyExit -{} +interface IRoninValidatorSet is ICandidateManager, ICommonInfo, ISlashingExecution, ICoinbaseExecution, IEmergencyExit { } diff --git a/src/interfaces/validator/info-fragments/IJailingInfo.sol b/src/interfaces/validator/info-fragments/IJailingInfo.sol index e838df9c..b9735430 100644 --- a/src/interfaces/validator/info-fragments/IJailingInfo.sol +++ b/src/interfaces/validator/info-fragments/IJailingInfo.sol @@ -11,9 +11,7 @@ interface IJailingInfo { /** * @dev Returns whether the validator are put in jail and the number of block and epoch that he still is in the jail. */ - function getJailedTimeLeft( - address _addr - ) external view returns (bool isJailed_, uint256 blockLeft_, uint256 epochLeft_); + function getJailedTimeLeft(address _addr) external view returns (bool isJailed_, uint256 blockLeft_, uint256 epochLeft_); /** * @dev Returns whether the validator are put in jail (cannot join the set of validators) at a specific block. @@ -23,10 +21,7 @@ interface IJailingInfo { /** * @dev Returns whether the validator are put in jail at a specific block and the number of block and epoch that he still is in the jail. */ - function getJailedTimeLeftAtBlock( - address _addr, - uint256 _blockNum - ) external view returns (bool isJailed_, uint256 blockLeft_, uint256 epochLeft_); + function getJailedTimeLeftAtBlock(address _addr, uint256 _blockNum) external view returns (bool isJailed_, uint256 blockLeft_, uint256 epochLeft_); /** * @dev Returns whether the validators are put in jail (cannot join the set of validators) during the current period. diff --git a/src/libraries/BridgeOperatorsBallot.sol b/src/libraries/BridgeOperatorsBallot.sol index 347942ad..91499b9f 100644 --- a/src/libraries/BridgeOperatorsBallot.sol +++ b/src/libraries/BridgeOperatorsBallot.sol @@ -17,8 +17,7 @@ library BridgeOperatorsBallot { } // keccak256("BridgeOperatorsBallot(uint256 period,uint256 epoch,address[] operators)"); - bytes32 public constant BRIDGE_OPERATORS_BALLOT_TYPEHASH = - 0xd679a49e9e099fa9ed83a5446aaec83e746b03ec6723d6f5efb29d37d7f0b78a; + bytes32 public constant BRIDGE_OPERATORS_BALLOT_TYPEHASH = 0xd679a49e9e099fa9ed83a5446aaec83e746b03ec6723d6f5efb29d37d7f0b78a; /** * @dev Verifies whether the ballot is valid or not. @@ -32,7 +31,7 @@ library BridgeOperatorsBallot { if (_ballot.operators.length == 0) revert ErrEmptyArray(); address _addr = _ballot.operators[0]; - for (uint _i = 1; _i < _ballot.operators.length; ) { + for (uint _i = 1; _i < _ballot.operators.length;) { if (_addr >= _ballot.operators[_i]) revert ErrInvalidOrderOfBridgeOperator(); _addr = _ballot.operators[_i]; unchecked { diff --git a/src/libraries/GlobalProposal.sol b/src/libraries/GlobalProposal.sol index fafab22d..377f189e 100644 --- a/src/libraries/GlobalProposal.sol +++ b/src/libraries/GlobalProposal.sol @@ -10,11 +10,12 @@ library GlobalProposal { error ErrUnsupportedTarget(bytes32 proposalHash, uint256 targetNumber); enum TargetOption { - /* 0 */ BridgeManager, - /* 1 */ GatewayContract, - /* 2 */ BridgeReward, - /* 3 */ BridgeSlash, - /* 4 */ BridgeTracking + BridgeManager, // 0 + GatewayContract, // 1 + BridgeReward, // 2 + BridgeSlash, // 3 + BridgeTracking // 4 + } struct GlobalProposalDetail { diff --git a/src/libraries/LibRequestBatch.sol b/src/libraries/LibRequestBatch.sol index 5b5bb80a..3d1667f1 100644 --- a/src/libraries/LibRequestBatch.sol +++ b/src/libraries/LibRequestBatch.sol @@ -15,11 +15,7 @@ library LibRequestBatch { uint256 length = req.info.ids.length; for (uint256 i; i < length; i++) { mainchainGateway.requestDepositFor( - Transfer.Request({ - recipientAddr: req.recipient, - tokenAddr: req.tokenAddr, - info: TokenInfo({ erc: req.info.erc, id: req.info.ids[i], quantity: 0 }) - }) + Transfer.Request({ recipientAddr: req.recipient, tokenAddr: req.tokenAddr, info: TokenInfo({ erc: req.info.erc, id: req.info.ids[i], quantity: 0 }) }) ); } } diff --git a/src/libraries/LibTokenInfo.sol b/src/libraries/LibTokenInfo.sol index 38f126f0..fd0c96d0 100644 --- a/src/libraries/LibTokenInfo.sol +++ b/src/libraries/LibTokenInfo.sol @@ -126,8 +126,7 @@ library LibTokenInfo { bool success; bytes memory data; if (self.erc == TokenStandard.ERC20) { - (success, data) = - token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, address(this), self.quantity)); + (success, data) = token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, address(this), self.quantity)); success = success && (data.length == 0 || abi.decode(data, (bool))); } else if (self.erc == TokenStandard.ERC721) { success = _tryTransferFromERC721(token, from, address(this), self.id); @@ -265,10 +264,7 @@ library LibTokenInfo { * @dev Transfers the ERC1155 token out. If the transfer failed, mints the ERC11555. * @return success Returns `false` if both transfer and mint are failed. */ - function _tryTransferOutOrMintERC1155(address token, address to, uint256 id, uint256 amount) - private - returns (bool success) - { + function _tryTransferOutOrMintERC1155(address token, address to, uint256 id, uint256 amount) private returns (bool success) { success = _tryTransferFromERC1155(token, address(this), to, id, amount); if (!success) { return _tryMintERC1155(token, to, id, amount); @@ -278,10 +274,7 @@ library LibTokenInfo { /** * @dev Transfers ERC1155 token and returns the result. */ - function _tryTransferFromERC1155(address token, address from, address to, uint256 id, uint256 amount) - private - returns (bool success) - { + function _tryTransferFromERC1155(address token, address from, address to, uint256 id, uint256 amount) private returns (bool success) { (success,) = token.call(abi.encodeCall(IERC1155.safeTransferFrom, (from, to, id, amount, new bytes(0)))); } diff --git a/src/libraries/LibTokenInfoBatch.sol b/src/libraries/LibTokenInfoBatch.sol index b52a175a..b834c406 100644 --- a/src/libraries/LibTokenInfoBatch.sol +++ b/src/libraries/LibTokenInfoBatch.sol @@ -41,10 +41,7 @@ library LibTokenInfoBatch { /** * @dev Validates the token info. */ - function validate(TokenInfoBatch memory self, function (TokenInfoBatch memory) pure returns (bool) fCheck) - internal - pure - { + function validate(TokenInfoBatch memory self, function (TokenInfoBatch memory) pure returns (bool) fCheck) internal pure { if (!fCheck(self)) { revert ErrInvalidInfoWithStandard(self.erc); } @@ -60,9 +57,9 @@ library LibTokenInfoBatch { uint256 length = self.ids.length; if ( - !(self.erc == TokenStandard.ERC1155 // Check ERC1155 - && self.ids.length != 0 // Info must contain at least one id in the array - && length == self.quantities.length) // Info must have same length for each pair id and quantity + // Check ERC1155 + // Info must contain at least one id in the array + !(self.erc == TokenStandard.ERC1155 && self.ids.length != 0 && length == self.quantities.length) // Info must have same length for each pair id and quantity ) { return false; } @@ -126,10 +123,7 @@ library LibTokenInfoBatch { * If there is fail when transfer one `id`, the loop will break early to save gas. * Consumer of this method should revert the transaction if receive `false` success status. */ - function _tryTransferFromERC721Loop(address token, address from, address to, uint256[] memory ids) - private - returns (bool success) - { + function _tryTransferFromERC721Loop(address token, address from, address to, uint256[] memory ids) private returns (bool success) { for (uint256 i; i < ids.length; ++i) { if (!_tryTransferFromERC721(token, from, to, ids[i])) { return false; // Break early if send fails @@ -150,13 +144,7 @@ library LibTokenInfoBatch { /** * @dev Transfers ERC1155 token in and returns the result. */ - function _tryTransferERC1155Batch( - address token, - address from, - address to, - uint256[] memory ids, - uint256[] memory amounts - ) private returns (bool success) { + function _tryTransferERC1155Batch(address token, address from, address to, uint256[] memory ids, uint256[] memory amounts) private returns (bool success) { (success,) = token.call(abi.encodeCall(IERC1155.safeBatchTransferFrom, (from, to, ids, amounts, new bytes(0)))); } } diff --git a/src/mainchain/MainchainGatewayBatcher.sol b/src/mainchain/MainchainGatewayBatcher.sol index 2d02a006..4022d2f7 100644 --- a/src/mainchain/MainchainGatewayBatcher.sol +++ b/src/mainchain/MainchainGatewayBatcher.sol @@ -73,19 +73,11 @@ contract MainchainGatewayBatcher is Initializable, ERC1155Holder { ) { if (erc == TokenStandard.ERC721) { - return ( - LibTokenInfoBatch.checkERC721Batch, - LibTokenInfoBatch.tryHandleAssetInERC721, - LibRequestBatch.forwardRequestToGatewayERC721 - ); + return (LibTokenInfoBatch.checkERC721Batch, LibTokenInfoBatch.tryHandleAssetInERC721, LibRequestBatch.forwardRequestToGatewayERC721); } if (erc == TokenStandard.ERC1155) { - return ( - LibTokenInfoBatch.checkERC1155Batch, - LibTokenInfoBatch.tryHandleAssetInERC1155, - LibRequestBatch.forwardRequestToGatewayERC1155 - ); + return (LibTokenInfoBatch.checkERC1155Batch, LibTokenInfoBatch.tryHandleAssetInERC1155, LibRequestBatch.forwardRequestToGatewayERC1155); } revert ErrUnsupportedStandard(); diff --git a/src/mainchain/MainchainGatewayV3.sol b/src/mainchain/MainchainGatewayV3.sol index ac1912ce..5045273b 100644 --- a/src/mainchain/MainchainGatewayV3.sol +++ b/src/mainchain/MainchainGatewayV3.sol @@ -12,7 +12,15 @@ import "../extensions/WithdrawalLimitation.sol"; import "../libraries/Transfer.sol"; import "../interfaces/IMainchainGatewayV3.sol"; -contract MainchainGatewayV3 is WithdrawalLimitation, Initializable, AccessControlEnumerable, ERC1155Holder, IMainchainGatewayV3, HasContracts, IBridgeManagerCallback { +contract MainchainGatewayV3 is + WithdrawalLimitation, + Initializable, + AccessControlEnumerable, + ERC1155Holder, + IMainchainGatewayV3, + HasContracts, + IBridgeManagerCallback +{ using LibTokenInfo for TokenInfo; using Transfer for Transfer.Request; using Transfer for Transfer.Receipt; @@ -509,11 +517,7 @@ contract MainchainGatewayV3 is WithdrawalLimitation, Initializable, AccessContro return IBridgeManagerCallback.onBridgeOperatorsRemoved.selector; } - function supportsInterface(bytes4 interfaceId) - public - view - override(AccessControlEnumerable, IERC165, ERC1155Receiver) returns (bool) - { + function supportsInterface(bytes4 interfaceId) public view override(AccessControlEnumerable, IERC165, ERC1155Receiver) returns (bool) { return interfaceId == type(IMainchainGatewayV3).interfaceId || super.supportsInterface(interfaceId); } } diff --git a/src/mocks/ronin/MockBridgeReward.sol b/src/mocks/ronin/MockBridgeReward.sol index ef7fc602..87ca3c88 100644 --- a/src/mocks/ronin/MockBridgeReward.sol +++ b/src/mocks/ronin/MockBridgeReward.sol @@ -13,16 +13,7 @@ contract MockBridgeReward is BridgeReward { uint256 period, uint256 slashUntilPeriod ) external pure returns (uint256 reward, bool isSlashed) { - return - _calcRewardAndCheckSlashedStatus( - isValidTrackingResponse, - numBridgeOperators, - rewardPerPeriod, - ballot, - totalBallot, - period, - slashUntilPeriod - ); + return _calcRewardAndCheckSlashedStatus(isValidTrackingResponse, numBridgeOperators, rewardPerPeriod, ballot, totalBallot, period, slashUntilPeriod); } function calcReward( @@ -35,19 +26,11 @@ contract MockBridgeReward is BridgeReward { reward = _calcReward(isValidTrackingResponse, numBridgeOperators, rewardPerPeriod, ballot, totalBallot); } - function isValidBridgeTrackingResponse( - uint256 totalBallot, - uint256 totalVote, - uint256[] memory ballots - ) external pure returns (bool valid) { + function isValidBridgeTrackingResponse(uint256 totalBallot, uint256 totalVote, uint256[] memory ballots) external pure returns (bool valid) { return _isValidBridgeTrackingResponse(totalBallot, totalVote, ballots); } - function shouldShareEqually( - uint256 totalBallot, - uint256 totalVote, - uint256[] memory ballots - ) external returns (bool shareEqually) { + function shouldShareEqually(uint256 totalBallot, uint256 totalVote, uint256[] memory ballots) external returns (bool shareEqually) { return _shouldShareEqually(totalBallot, totalVote, ballots); } diff --git a/src/mocks/ronin/MockBridgeSlash.sol b/src/mocks/ronin/MockBridgeSlash.sol index 2210b20e..e4c0f0d9 100644 --- a/src/mocks/ronin/MockBridgeSlash.sol +++ b/src/mocks/ronin/MockBridgeSlash.sol @@ -4,11 +4,7 @@ pragma solidity ^0.8.0; import { IBridgeSlash, BridgeSlash } from "../../ronin/gateway/BridgeSlash.sol"; contract MockBridgeSlash is BridgeSlash { - function calcSlashUntilPeriod( - Tier tier, - uint256 period, - uint256 slashUntilPeriod - ) external pure returns (uint256 newSlashUntilPeriod) { + function calcSlashUntilPeriod(Tier tier, uint256 period, uint256 slashUntilPeriod) external pure returns (uint256 newSlashUntilPeriod) { newSlashUntilPeriod = _calcSlashUntilPeriod(tier, period, slashUntilPeriod, _getPenaltyDurations()); } diff --git a/src/mocks/ronin/MockRoninGatewayV3Extended.sol b/src/mocks/ronin/MockRoninGatewayV3Extended.sol index de7c9c9b..e988c854 100644 --- a/src/mocks/ronin/MockRoninGatewayV3Extended.sol +++ b/src/mocks/ronin/MockRoninGatewayV3Extended.sol @@ -7,31 +7,21 @@ contract MockRoninGatewayV3Extended is RoninGatewayV3 { /* * @dev Returns the vote weight for a deposit based on its corressponding hash. */ - function getDepositVoteWeight( - uint256 _chainId, - uint256 _depositId, - bytes32 _hash - ) external view returns (uint256 totalWeight) { + function getDepositVoteWeight(uint256 _chainId, uint256 _depositId, bytes32 _hash) external view returns (uint256 totalWeight) { totalWeight = _getVoteWeight(depositVote[_chainId][_depositId], _hash); } /** * @dev Returns the vote weight for a mainchain withdrew acknowledgement based on its corressponding hash. */ - function getMainchainWithdrewVoteWeight( - uint256 _withdrawalId, - bytes32 _hash - ) external view returns (uint256 totalWeight) { + function getMainchainWithdrewVoteWeight(uint256 _withdrawalId, bytes32 _hash) external view returns (uint256 totalWeight) { totalWeight = _getVoteWeight(mainchainWithdrewVote[_withdrawalId], _hash); } /** * @dev Returns the vote weight for a withdraw stats based on its corressponding hash. */ - function getWithdrawalStatVoteWeight( - uint256 _withdrawalId, - bytes32 _hash - ) external view returns (uint256 totalWeight) { + function getWithdrawalStatVoteWeight(uint256 _withdrawalId, bytes32 _hash) external view returns (uint256 totalWeight) { totalWeight = _getVoteWeight(withdrawalStatVote[_withdrawalId], _hash); } } diff --git a/src/mocks/types/MockTUint256Slot.sol b/src/mocks/types/MockTUint256Slot.sol index 343775db..1be35e20 100644 --- a/src/mocks/types/MockTUint256Slot.sol +++ b/src/mocks/types/MockTUint256Slot.sol @@ -4,8 +4,7 @@ pragma solidity ^0.8.0; import { TUint256Slot } from "../../types/Types.sol"; contract MockTUint256Slot { - TUint256Slot private constant CUSTOM_SLOT_UINT256 = - TUint256Slot.wrap(keccak256(abi.encode(type(MockTUint256Slot).name))); + TUint256Slot private constant CUSTOM_SLOT_UINT256 = TUint256Slot.wrap(keccak256(abi.encode(type(MockTUint256Slot).name))); uint256 private _primitiveUint256; diff --git a/src/ronin/gateway/BridgeSlash.sol b/src/ronin/gateway/BridgeSlash.sol index 62a834b3..74eb0ecf 100644 --- a/src/ronin/gateway/BridgeSlash.sol +++ b/src/ronin/gateway/BridgeSlash.sol @@ -17,14 +17,7 @@ import { ErrLengthMismatch } from "../../utils/CommonErrors.sol"; * @title BridgeSlash * @dev A contract that implements slashing functionality for bridge operators based on their availability. */ -contract BridgeSlash is - IBridgeSlash, - IBridgeManagerCallback, - BridgeTrackingHelper, - IdentityGuard, - Initializable, - HasContracts -{ +contract BridgeSlash is IBridgeSlash, IBridgeManagerCallback, BridgeTrackingHelper, IdentityGuard, Initializable, HasContracts { /// @inheritdoc IBridgeSlash uint256 public constant TIER_1_PENALTY_DURATION = 1; /// @inheritdoc IBridgeSlash @@ -66,12 +59,7 @@ contract BridgeSlash is _disableInitializers(); } - function initialize( - address validatorContract, - address bridgeManagerContract, - address bridgeTrackingContract, - address dposGA - ) external initializer { + function initialize(address validatorContract, address bridgeManagerContract, address bridgeTrackingContract, address dposGA) external initializer { _setContract(ContractType.VALIDATOR, validatorContract); _setContract(ContractType.BRIDGE_MANAGER, bridgeManagerContract); _setContract(ContractType.BRIDGE_TRACKING, bridgeTrackingContract); @@ -93,7 +81,7 @@ contract BridgeSlash is */ function onBridgeOperatorsAdded( address[] calldata bridgeOperators, - uint96[] calldata /* weights */, + uint96[] calldata, /* weights */ bool[] memory addeds ) external onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) { uint256 length = bridgeOperators.length; @@ -105,7 +93,7 @@ contract BridgeSlash is mapping(address => BridgeSlashInfo) storage _bridgeSlashInfos = _getBridgeSlashInfos(); uint256 currentPeriod = IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod(); - for (uint256 i; i < length; ) { + for (uint256 i; i < length;) { unchecked { if (addeds[i]) { _bridgeSlashInfos[bridgeOperators[i]].newlyAddedAtPeriod = uint128(currentPeriod); @@ -146,7 +134,7 @@ contract BridgeSlash is address bridgeOperator; Tier tier; - for (uint256 i; i < operators.length; ) { + for (uint256 i; i < operators.length;) { bridgeOperator = operators[i]; status = _bridgeSlashInfos[bridgeOperator]; @@ -185,10 +173,7 @@ contract BridgeSlash is /** * @inheritdoc IBridgeManagerCallback */ - function onBridgeOperatorsRemoved( - address[] calldata, - bool[] calldata - ) external view onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) { + function onBridgeOperatorsRemoved(address[] calldata, bool[] calldata) external view onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) { return IBridgeManagerCallback.onBridgeOperatorsRemoved.selector; } @@ -202,14 +187,12 @@ contract BridgeSlash is /** * @inheritdoc IBridgeSlash */ - function getSlashUntilPeriodOf( - address[] calldata bridgeOperators - ) external view returns (uint256[] memory untilPeriods) { + function getSlashUntilPeriodOf(address[] calldata bridgeOperators) external view returns (uint256[] memory untilPeriods) { uint256 length = bridgeOperators.length; untilPeriods = new uint256[](length); mapping(address => BridgeSlashInfo) storage _bridgeSlashInfos = _getBridgeSlashInfos(); - for (uint256 i; i < length; ) { + for (uint256 i; i < length;) { untilPeriods[i] = _bridgeSlashInfos[bridgeOperators[i]].slashUntilPeriod; unchecked { ++i; @@ -225,7 +208,7 @@ contract BridgeSlash is addedPeriods = new uint256[](length); mapping(address => BridgeSlashInfo) storage _bridgeSlashInfos = _getBridgeSlashInfos(); - for (uint256 i; i < length; ) { + for (uint256 i; i < length;) { addedPeriods[i] = _bridgeSlashInfos[bridgeOperators[i]].newlyAddedAtPeriod; unchecked { ++i; @@ -253,10 +236,7 @@ contract BridgeSlash is * @param period The current period. * @return met A boolean indicates that the threshold for removal is met. */ - function _isSlashDurationMetRemovalThreshold( - uint256 slashUntilPeriod, - uint256 period - ) internal pure returns (bool met) { + function _isSlashDurationMetRemovalThreshold(uint256 slashUntilPeriod, uint256 period) internal pure returns (bool met) { met = slashUntilPeriod - (period - 1) >= REMOVE_DURATION_THRESHOLD; } diff --git a/src/ronin/gateway/BridgeTracking.sol b/src/ronin/gateway/BridgeTracking.sol index 7dd21a1f..aeb9f7f9 100644 --- a/src/ronin/gateway/BridgeTracking.sol +++ b/src/ronin/gateway/BridgeTracking.sol @@ -220,9 +220,8 @@ contract BridgeTracking is HasBridgeDeprecated, HasValidatorDeprecated, HasContr uint256 totalBallot_ = totalBallot(lastSyncPeriod); address bridgeSlashContract = getContract(ContractType.BRIDGE_SLASH); - (bool success, bytes memory returnOrRevertData) = bridgeSlashContract.call( - abi.encodeCall(IBridgeSlash.execSlashBridgeOperators, (allOperators, ballots, totalBallot_, totalVote_, lastSyncPeriod)) - ); + (bool success, bytes memory returnOrRevertData) = + bridgeSlashContract.call(abi.encodeCall(IBridgeSlash.execSlashBridgeOperators, (allOperators, ballots, totalBallot_, totalVote_, lastSyncPeriod))); if (!success) { emit ExternalCallFailed(bridgeSlashContract, IBridgeSlash.execSlashBridgeOperators.selector, returnOrRevertData); } diff --git a/src/ronin/gateway/PauseEnforcer.sol b/src/ronin/gateway/PauseEnforcer.sol index 28480cdb..7e9b860f 100644 --- a/src/ronin/gateway/PauseEnforcer.sol +++ b/src/ronin/gateway/PauseEnforcer.sol @@ -63,7 +63,7 @@ contract PauseEnforcer is AccessControlEnumerable, Initializable { function initialize(IPauseTarget _target, address _admin, address[] memory _sentries) external initializer { _changeTarget(_target); _setupRole(DEFAULT_ADMIN_ROLE, _admin); - for (uint _i; _i < _sentries.length; ) { + for (uint _i; _i < _sentries.length;) { _grantRole(SENTRY_ROLE, _sentries[_i]); unchecked { diff --git a/src/ronin/gateway/RoninBridgeManager.sol b/src/ronin/gateway/RoninBridgeManager.sol index b9e85058..a55a992d 100644 --- a/src/ronin/gateway/RoninBridgeManager.sol +++ b/src/ronin/gateway/RoninBridgeManager.sol @@ -163,12 +163,7 @@ contract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernan Ballot.VoteType[] calldata supports_, Signature[] calldata signatures ) external onlyGovernor { - _proposeGlobalProposalStructAndCastVotes({ - globalProposal: globalProposal, - supports_: supports_, - signatures: signatures, - creator: msg.sender - }); + _proposeGlobalProposalStructAndCastVotes({ globalProposal: globalProposal, supports_: supports_, signatures: signatures, creator: msg.sender }); } /** diff --git a/src/ronin/gateway/RoninBridgeManagerConstructor.sol b/src/ronin/gateway/RoninBridgeManagerConstructor.sol index 0661de6e..12909e34 100644 --- a/src/ronin/gateway/RoninBridgeManagerConstructor.sol +++ b/src/ronin/gateway/RoninBridgeManagerConstructor.sol @@ -38,7 +38,6 @@ contract RoninBridgeManagerConstructor is BridgeManager, GovernanceProposal, Glo __BridgeManager_init(num, denom, roninChainId, bridgeContract, callbackRegisters, bridgeOperators, governors, voteWeights); } - /** * @dev Internal function to get the chain type of the contract. * @return The chain type, indicating the type of the chain the contract operates on (e.g., RoninChain). diff --git a/src/ronin/gateway/RoninGatewayV3.sol b/src/ronin/gateway/RoninGatewayV3.sol index 7585d5e7..a4aed59c 100644 --- a/src/ronin/gateway/RoninGatewayV3.sol +++ b/src/ronin/gateway/RoninGatewayV3.sol @@ -60,7 +60,7 @@ contract RoninGatewayV3 is uint256 internal _trustedNum; uint256 internal _trustedDenom; - constructor () { + constructor() { _disableInitializers(); } @@ -129,10 +129,7 @@ contract RoninGatewayV3 is /** * @inheritdoc IRoninGatewayV3 */ - function getWithdrawalSignatures( - uint256 withdrawalId, - address[] calldata operators - ) external view returns (bytes[] memory _signatures) { + function getWithdrawalSignatures(uint256 withdrawalId, address[] calldata operators) external view returns (bytes[] memory _signatures) { _signatures = new bytes[](operators.length); for (uint256 _i = 0; _i < operators.length;) { _signatures[_i] = _withdrawalSig[withdrawalId][operators[_i]]; @@ -153,11 +150,7 @@ contract RoninGatewayV3 is /** * @inheritdoc IRoninGatewayV3 */ - function tryBulkAcknowledgeMainchainWithdrew(uint256[] calldata _withdrawalIds) - external - onlyBridgeOperator - returns (bool[] memory _executedReceipts) - { + function tryBulkAcknowledgeMainchainWithdrew(uint256[] calldata _withdrawalIds) external onlyBridgeOperator returns (bool[] memory _executedReceipts) { address governor = msg.sender; uint256 minVoteWeight = minimumVoteWeight(); @@ -192,12 +185,7 @@ contract RoninGatewayV3 is /** * @inheritdoc IRoninGatewayV3 */ - function tryBulkDepositFor(Transfer.Receipt[] calldata receipts) - external - whenNotPaused - onlyBridgeOperator - returns (bool[] memory _executedReceipts) - { + function tryBulkDepositFor(Transfer.Receipt[] calldata receipts) external whenNotPaused onlyBridgeOperator returns (bool[] memory _executedReceipts) { uint length = receipts.length; _executedReceipts = new bool[](length); uint256 minVoteWeight = minimumVoteWeight(); @@ -250,10 +238,7 @@ contract RoninGatewayV3 is /** * @inheritdoc IRoninGatewayV3 */ - function bulkSubmitWithdrawalSignatures( - uint256[] calldata withdrawals, - bytes[] calldata signatures - ) external whenNotPaused onlyBridgeOperator { + function bulkSubmitWithdrawalSignatures(uint256[] calldata withdrawals, bytes[] calldata signatures) external whenNotPaused onlyBridgeOperator { address operator = msg.sender; uint length = withdrawals.length; @@ -420,8 +405,7 @@ contract RoninGatewayV3 is address _mainchainTokenAddr ) internal returns (uint256 _withdrawalId) { _withdrawalId = withdrawalCount++; - Transfer.Receipt memory _receipt = - _request.into_withdrawal_receipt(_requester, _withdrawalId, _mainchainTokenAddr, _chainId); + Transfer.Receipt memory _receipt = _request.into_withdrawal_receipt(_requester, _withdrawalId, _mainchainTokenAddr, _chainId); withdrawal[_withdrawalId] = _receipt; emit WithdrawalRequested(_receipt.hash(), _receipt); } @@ -462,12 +446,8 @@ contract RoninGatewayV3 is /** * @dev Returns the vote weight for a specified hash. */ - function _getVoteWeight( - IsolatedGovernance.Vote storage _v, - bytes32 _hash - ) internal view returns (uint256 _totalWeight) { - (, address[] memory bridgeOperators, uint96[] memory weights) = - IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)).getFullBridgeOperatorInfos(); + function _getVoteWeight(IsolatedGovernance.Vote storage _v, bytes32 _hash) internal view returns (uint256 _totalWeight) { + (, address[] memory bridgeOperators, uint96[] memory weights) = IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)).getFullBridgeOperatorInfos(); uint256 length = bridgeOperators.length; unchecked { for (uint _i; _i < length; ++_i) { @@ -478,10 +458,7 @@ contract RoninGatewayV3 is } } - function setTrustedThreshold( - uint256 _trustedNumerator, - uint256 _trustedDenominator - ) external virtual onlyAdmin returns (uint256, uint256) { + function setTrustedThreshold(uint256 _trustedNumerator, uint256 _trustedDenominator) external virtual onlyAdmin returns (uint256, uint256) { return _setTrustedThreshold(_trustedNumerator, _trustedDenominator); } @@ -509,9 +486,7 @@ contract RoninGatewayV3 is _trustedNum = _trustedNumerator; _trustedDenom = _trustedDenominator; unchecked { - emit TrustedThresholdUpdated( - nonce++, _trustedNumerator, _trustedDenominator, _previousTrustedNum, _previousTrustedDenom - ); + emit TrustedThresholdUpdated(nonce++, _trustedNumerator, _trustedDenominator, _previousTrustedNum, _previousTrustedDenom); } } @@ -522,11 +497,7 @@ contract RoninGatewayV3 is return (_trustedNum * _totalTrustedWeight + _trustedDenom - 1) / _trustedDenom; } - function supportsInterface(bytes4 interfaceId) - public - view - override(AccessControlEnumerable, ERC1155Receiver) returns (bool) - { + function supportsInterface(bytes4 interfaceId) public view override(AccessControlEnumerable, ERC1155Receiver) returns (bool) { return AccessControlEnumerable.supportsInterface(interfaceId) || ERC1155Receiver.supportsInterface(interfaceId); } } diff --git a/src/utils/CommonErrors.sol b/src/utils/CommonErrors.sol index 0aedf12e..ebcfdf8d 100644 --- a/src/utils/CommonErrors.sol +++ b/src/utils/CommonErrors.sol @@ -247,4 +247,4 @@ error ErrInvalidExecutor(); /** * @dev Error of the `caller` to relay is not the specified `executor`. */ -error ErrNonExecutorCannotRelay(address executor, address caller); \ No newline at end of file +error ErrNonExecutorCannotRelay(address executor, address caller); diff --git a/src/utils/ContractType.sol b/src/utils/ContractType.sol index 2fcb32f6..4c763ae3 100644 --- a/src/utils/ContractType.sol +++ b/src/utils/ContractType.sol @@ -2,20 +2,21 @@ pragma solidity ^0.8.0; enum ContractType { - /* 0 */ UNKNOWN, - /* 1 */ PAUSE_ENFORCER, - /* 2 */ BRIDGE, - /* 3 */ BRIDGE_TRACKING, - /* 4 */ GOVERNANCE_ADMIN, - /* 5 */ MAINTENANCE, - /* 6 */ SLASH_INDICATOR, - /* 7 */ STAKING_VESTING, - /* 8 */ VALIDATOR, - /* 9 */ STAKING, - /* 10 */ RONIN_TRUSTED_ORGANIZATION, - /* 11 */ BRIDGE_MANAGER, - /* 12 */ BRIDGE_SLASH, - /* 13 */ BRIDGE_REWARD, - /* 14 */ FAST_FINALITY_TRACKING, - /* 15 */ PROFILE + UNKNOWN, // 0 + PAUSE_ENFORCER, // 1 + BRIDGE, // 2 + BRIDGE_TRACKING, // 3 + GOVERNANCE_ADMIN, // 4 + MAINTENANCE, // 5 + SLASH_INDICATOR, // 6 + STAKING_VESTING, // 7 + VALIDATOR, // 8 + STAKING, // 9 + RONIN_TRUSTED_ORGANIZATION, // 10 + BRIDGE_MANAGER, // 11 + BRIDGE_SLASH, // 12 + BRIDGE_REWARD, // 13 + FAST_FINALITY_TRACKING, // 14 + PROFILE // 15 + } diff --git a/src/utils/IdentityGuard.sol b/src/utils/IdentityGuard.sol index 4edbc32d..c84224b8 100644 --- a/src/utils/IdentityGuard.sol +++ b/src/utils/IdentityGuard.sol @@ -92,9 +92,7 @@ abstract contract IdentityGuard { bytes memory supportsInterfaceParams = abi.encodeCall(IERC165.supportsInterface, (interfaceId)); (bool success, bytes memory returnOrRevertData) = contractAddr.staticcall(supportsInterfaceParams); if (!success) { - (success, returnOrRevertData) = contractAddr.staticcall( - abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (supportsInterfaceParams)) - ); + (success, returnOrRevertData) = contractAddr.staticcall(abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (supportsInterfaceParams))); if (!success) revert ErrUnsupportedInterface(interfaceId, contractAddr); } if (!abi.decode(returnOrRevertData, (bool))) revert ErrUnsupportedInterface(interfaceId, contractAddr); diff --git a/src/utils/RoleAccess.sol b/src/utils/RoleAccess.sol index a96c8b0f..b7c602ce 100644 --- a/src/utils/RoleAccess.sol +++ b/src/utils/RoleAccess.sol @@ -2,15 +2,16 @@ pragma solidity ^0.8.0; enum RoleAccess { - /* 0 */ UNKNOWN, - /* 1 */ ADMIN, - /* 2 */ COINBASE, - /* 3 */ GOVERNOR, - /* 4 */ CANDIDATE_ADMIN, - /* 5 */ WITHDRAWAL_MIGRATOR, - /* 6 */ __DEPRECATED_BRIDGE_OPERATOR, - /* 7 */ BLOCK_PRODUCER, - /* 8 */ VALIDATOR_CANDIDATE, - /* 9 */ CONSENSUS, - /* 10 */ TREASURY + UNKNOWN, // 0 + ADMIN, // 1 + COINBASE, // 2 + GOVERNOR, // 3 + CANDIDATE_ADMIN, // 4 + WITHDRAWAL_MIGRATOR, // 5 + __DEPRECATED_BRIDGE_OPERATOR, // 6 + BLOCK_PRODUCER, // 7 + VALIDATOR_CANDIDATE, // 8 + CONSENSUS, // 9 + TREASURY // 10 + } diff --git a/test/bridge/integration/BaseIntegration.t.sol b/test/bridge/integration/BaseIntegration.t.sol index edf9b595..c1c0d27a 100644 --- a/test/bridge/integration/BaseIntegration.t.sol +++ b/test/bridge/integration/BaseIntegration.t.sol @@ -79,6 +79,7 @@ contract MockPoisonERC20 is MockERC20 { contract BaseIntegration_Test is Base_Test { using LibTransfer for LibTransfer.Receipt; + address sender; IGeneralConfig _config; @@ -161,9 +162,7 @@ contract BaseIntegration_Test is Base_Test { _roninMockPoisonERC20 = new MockPoisonERC20("MockPoisonERC20", "MPE2"); _param = ISharedArgument(LibSharedAddress.CONFIG).sharedArguments(); - _roninProposalUtils = new RoninBridgeAdminUtils( - block.chainid, _param.test.governorPKs, _roninBridgeManager, _param.roninBridgeManager.governors[0] - ); + _roninProposalUtils = new RoninBridgeAdminUtils(block.chainid, _param.test.governorPKs, _roninBridgeManager, _param.roninBridgeManager.governors[0]); _validatorSet = new MockValidatorContract_OnlyTiming_ForHardhatTest(_param.test.numberOfBlocksInEpoch); } @@ -185,13 +184,10 @@ contract BaseIntegration_Test is Base_Test { _mainchainWethUnwrapper = new MainchainWethUnwrapperDeploy().runWithArgs(args); _param = ISharedArgument(LibSharedAddress.CONFIG).sharedArguments(); - _mainchainProposalUtils = new MainchainBridgeAdminUtils( - block.chainid, _param.test.governorPKs, _mainchainBridgeManager, _param.mainchainBridgeManager.governors[0] - ); + _mainchainProposalUtils = + new MainchainBridgeAdminUtils(block.chainid, _param.test.governorPKs, _mainchainBridgeManager, _param.mainchainBridgeManager.governors[0]); - _mainchainGatewayBatcher = new MainchainGatewayBatcherDeploy().runWithArgs( - abi.encodeCall(MainchainGatewayBatcher.initialize, (_mainchainGatewayV3)) - ); + _mainchainGatewayBatcher = new MainchainGatewayBatcherDeploy().runWithArgs(abi.encodeCall(MainchainGatewayBatcher.initialize, (_mainchainGatewayV3))); } function _initializeRonin() internal { @@ -269,8 +265,7 @@ contract BaseIntegration_Test is Base_Test { } function _roninGatewayV3Initialize() internal { - (address[] memory mainchainTokens, address[] memory roninTokens, TokenStandard[] memory standards) = - _getMainchainAndRoninTokens(); + (address[] memory mainchainTokens, address[] memory roninTokens, TokenStandard[] memory standards) = _getMainchainAndRoninTokens(); uint256 tokenNum = mainchainTokens.length; // reserve slot for ERC721Tokens uint256[] memory minimumThreshold = new uint256[](tokenNum); uint256[] memory chainIds = new uint256[](tokenNum); @@ -518,8 +513,7 @@ contract BaseIntegration_Test is Base_Test { } function _mainchainGatewayV3Initialize() internal { - (address[] memory mainchainTokens, address[] memory roninTokens, TokenStandard[] memory standards) = - _getMainchainAndRoninTokens(); + (address[] memory mainchainTokens, address[] memory roninTokens, TokenStandard[] memory standards) = _getMainchainAndRoninTokens(); uint256 tokenNum = mainchainTokens.length; uint256[] memory highTierThreshold = new uint256[](tokenNum); uint256[] memory lockedThreshold = new uint256[](tokenNum); diff --git a/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol b/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol index 8e5c2aa2..57abebd9 100644 --- a/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol +++ b/test/bridge/integration/bridge-manager/update-bridge-operator/updateOperator.RoninBridgeManager.t.sol @@ -26,14 +26,10 @@ contract UpdateOperator_RoninBridgeManager_Test is BaseIntegration_Test { kind: Transfer.Kind.Deposit, ronin: TokenOwner({ addr: makeAddr("recipient"), tokenAddr: address(_roninWeth), chainId: block.chainid }), mainchain: TokenOwner({ addr: makeAddr("requester"), tokenAddr: address(_mainchainWeth), chainId: block.chainid }), - info: TokenInfo({ - erc: TokenStandard.ERC20, - id: 0, - quantity: 100 - // ids: new uint256[](0), - // quantities: new uint256[](0) - }) + info: TokenInfo({ erc: TokenStandard.ERC20, id: 0, quantity: 100 }) }); + // ids: new uint256[](0), + // quantities: new uint256[](0) for (uint256 i; i < 50; i++) { first50Receipts.push(sampleReceipt); diff --git a/test/bridge/integration/bridge-tracking/EpochE1_VoteIsApprovedInLastEpoch.BridgeTracking.t.sol b/test/bridge/integration/bridge-tracking/EpochE1_VoteIsApprovedInLastEpoch.BridgeTracking.t.sol index c4997634..2d227f36 100644 --- a/test/bridge/integration/bridge-tracking/EpochE1_VoteIsApprovedInLastEpoch.BridgeTracking.t.sol +++ b/test/bridge/integration/bridge-tracking/EpochE1_VoteIsApprovedInLastEpoch.BridgeTracking.t.sol @@ -5,8 +5,7 @@ import { IBridgeTracking } from "@ronin/contracts/interfaces/bridge/IBridgeTrack import { MockGatewayForTracking } from "@ronin/contracts/mocks/MockGatewayForTracking.sol"; import "../BaseIntegration.t.sol"; -import { EpochE2_VoteIsNotApprovedInLastEpoch_BridgeTracking_Test } from - "./EpochE2_VoteIsNotApprovedInLastEpoch.BridgeTracking.t.sol"; +import { EpochE2_VoteIsNotApprovedInLastEpoch_BridgeTracking_Test } from "./EpochE2_VoteIsNotApprovedInLastEpoch.BridgeTracking.t.sol"; // Epoch e-1 test: Vote is approved in the last epoch of period contract EpochE1_VoteIsApprovedInLastEpoch_BridgeTracking_Test is BaseIntegration_Test { @@ -30,8 +29,7 @@ contract EpochE1_VoteIsApprovedInLastEpoch_BridgeTracking_Test is BaseIntegratio // upgrade ronin gateway v3 _mockRoninGatewayV3 = new MockGatewayForTracking(address(_bridgeTracking)); - bytes memory calldata_ = - abi.encodeCall(IHasContracts.setContract, (ContractType.BRIDGE, address(_mockRoninGatewayV3))); + bytes memory calldata_ = abi.encodeCall(IHasContracts.setContract, (ContractType.BRIDGE, address(_mockRoninGatewayV3))); _roninProposalUtils.functionDelegateCall(address(_bridgeTracking), calldata_); vm.deal(address(_bridgeReward), 10 ether); diff --git a/test/bridge/integration/bridge-tracking/EpochE2_VoteIsNotApprovedInLastEpoch.BridgeTracking.t.sol b/test/bridge/integration/bridge-tracking/EpochE2_VoteIsNotApprovedInLastEpoch.BridgeTracking.t.sol index 5f487d0d..2b39e6d0 100644 --- a/test/bridge/integration/bridge-tracking/EpochE2_VoteIsNotApprovedInLastEpoch.BridgeTracking.t.sol +++ b/test/bridge/integration/bridge-tracking/EpochE2_VoteIsNotApprovedInLastEpoch.BridgeTracking.t.sol @@ -22,8 +22,7 @@ contract EpochE2_VoteIsNotApprovedInLastEpoch_BridgeTracking_Test is BaseIntegra // upgrade ronin gateway v3 _mockRoninGatewayV3 = new MockGatewayForTracking(address(_bridgeTracking)); - bytes memory calldata_ = - abi.encodeCall(IHasContracts.setContract, (ContractType.BRIDGE, address(_mockRoninGatewayV3))); + bytes memory calldata_ = abi.encodeCall(IHasContracts.setContract, (ContractType.BRIDGE, address(_mockRoninGatewayV3))); _roninProposalUtils.functionDelegateCall(address(_bridgeTracking), calldata_); vm.deal(address(_bridgeReward), 10 ether); @@ -102,15 +101,9 @@ contract EpochE2_VoteIsNotApprovedInLastEpoch_BridgeTracking_Test is BaseIntegra uint256 expectedTotalVotes = 1; assertEq(_bridgeTracking.totalVote(lastPeriod), expectedTotalVotes); assertEq(_bridgeTracking.totalBallot(lastPeriod), expectedTotalVotes * 3); - assertEq( - _bridgeTracking.totalBallotOf(lastPeriod, _param.roninBridgeManager.bridgeOperators[0]), expectedTotalVotes - ); - assertEq( - _bridgeTracking.totalBallotOf(lastPeriod, _param.roninBridgeManager.bridgeOperators[1]), expectedTotalVotes - ); - assertEq( - _bridgeTracking.totalBallotOf(lastPeriod, _param.roninBridgeManager.bridgeOperators[2]), expectedTotalVotes - ); + assertEq(_bridgeTracking.totalBallotOf(lastPeriod, _param.roninBridgeManager.bridgeOperators[0]), expectedTotalVotes); + assertEq(_bridgeTracking.totalBallotOf(lastPeriod, _param.roninBridgeManager.bridgeOperators[1]), expectedTotalVotes); + assertEq(_bridgeTracking.totalBallotOf(lastPeriod, _param.roninBridgeManager.bridgeOperators[2]), expectedTotalVotes); assertEq(_bridgeTracking.totalBallotOf(lastPeriod, _param.roninBridgeManager.bridgeOperators[3]), 0); _period = newPeriod; diff --git a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.erc20.benchmark.t.sol b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.erc20.benchmark.t.sol index 7b6b1d36..7643cc7b 100644 --- a/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.erc20.benchmark.t.sol +++ b/test/bridge/integration/mainchain-gateway/submit-withdrawal/submitWithdrawal.MainchainGatewayV3.erc20.benchmark.t.sol @@ -8,7 +8,7 @@ import { LibTokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibToken import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; import "../../BaseIntegration.t.sol"; -contract SubmitWithdrawal_MainchainGatewayV3_Native_Benchmark_Test is BaseIntegration_Test{ +contract SubmitWithdrawal_MainchainGatewayV3_Native_Benchmark_Test is BaseIntegration_Test { using Transfer for Transfer.Receipt; Transfer.Receipt _withdrawalReceipt; diff --git a/test/bridge/integration/pause-enforcer/emergencyAction.PauseEnforcer.t.sol b/test/bridge/integration/pause-enforcer/emergencyAction.PauseEnforcer.t.sol index 4c795f50..8df9d14d 100644 --- a/test/bridge/integration/pause-enforcer/emergencyAction.PauseEnforcer.t.sol +++ b/test/bridge/integration/pause-enforcer/emergencyAction.PauseEnforcer.t.sol @@ -30,14 +30,10 @@ contract EmergencyAction_PauseEnforcer_Test is BaseIntegration_Test { kind: Transfer.Kind.Deposit, ronin: TokenOwner({ addr: makeAddr("recipient"), tokenAddr: address(_roninWeth), chainId: block.chainid }), mainchain: TokenOwner({ addr: makeAddr("requester"), tokenAddr: address(_mainchainWeth), chainId: block.chainid }), - info: TokenInfo({ - erc: TokenStandard.ERC20, - id: 0, - quantity: 100 - // ids: new uint256[](0), - // quantities: new uint256[](0) - }) + info: TokenInfo({ erc: TokenStandard.ERC20, id: 0, quantity: 100 }) }); + // ids: new uint256[](0), + // quantities: new uint256[](0) vm.expectRevert("Pausable: paused"); @@ -73,17 +69,12 @@ contract EmergencyAction_PauseEnforcer_Test is BaseIntegration_Test { kind: Transfer.Kind.Deposit, ronin: TokenOwner({ addr: makeAddr("recipient"), tokenAddr: address(_roninWeth), chainId: block.chainid }), mainchain: TokenOwner({ addr: makeAddr("requester"), tokenAddr: address(_mainchainWeth), chainId: block.chainid }), - info: TokenInfo({ - erc: TokenStandard.ERC20, - id: 0, - quantity: 100 - // ids: new uint256[](0), - // quantities: new uint256[](0) - }) + info: TokenInfo({ erc: TokenStandard.ERC20, id: 0, quantity: 100 }) }); + // ids: new uint256[](0), + // quantities: new uint256[](0) - uint256 numOperatorsForVoteExecuted = - _param.roninBridgeManager.bridgeOperators.length * _param.roninBridgeManager.num / _param.roninBridgeManager.denom; + uint256 numOperatorsForVoteExecuted = _param.roninBridgeManager.bridgeOperators.length * _param.roninBridgeManager.num / _param.roninBridgeManager.denom; for (uint256 i; i < numOperatorsForVoteExecuted; i++) { vm.prank(_param.roninBridgeManager.bridgeOperators[i]); _roninGatewayV3.depositFor(receipt); diff --git a/test/bridge/integration/pause-enforcer/set-config/setConfig.PauseEnforcer.t.sol b/test/bridge/integration/pause-enforcer/set-config/setConfig.PauseEnforcer.t.sol index 60e7dd9c..b3fe1f9e 100644 --- a/test/bridge/integration/pause-enforcer/set-config/setConfig.PauseEnforcer.t.sol +++ b/test/bridge/integration/pause-enforcer/set-config/setConfig.PauseEnforcer.t.sol @@ -22,8 +22,7 @@ contract SetConfig_PauseEnforcer_Test is BaseIntegration_Test { } function test_sentryEnforcerRole() public { - bool isSentryRole = - _roninPauseEnforcer.hasRole(_roninPauseEnforcer.SENTRY_ROLE(), _param.roninPauseEnforcer.sentries[0]); + bool isSentryRole = _roninPauseEnforcer.hasRole(_roninPauseEnforcer.SENTRY_ROLE(), _param.roninPauseEnforcer.sentries[0]); assertEq(isSentryRole, true); } diff --git a/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol b/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol index 1cd342d1..5dfc4c90 100644 --- a/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol +++ b/test/bridge/integration/ronin-gateway/depositVote.RoninGatewayV3.t.sol @@ -27,20 +27,15 @@ contract DepositVote_RoninGatewayV3_Test is BaseIntegration_Test { kind: Transfer.Kind.Deposit, ronin: TokenOwner({ addr: makeAddr("recipient"), tokenAddr: address(_roninWeth), chainId: block.chainid }), mainchain: TokenOwner({ addr: makeAddr("requester"), tokenAddr: address(_mainchainWeth), chainId: block.chainid }), - info: TokenInfo({ - erc: TokenStandard.ERC20, - id: 0, - quantity: 100 - // ids: new uint256[](0), - // quantities: new uint256[](0) - }) + info: TokenInfo({ erc: TokenStandard.ERC20, id: 0, quantity: 100 }) }); + // ids: new uint256[](0), + // quantities: new uint256[](0) _depositReceipts.push(receipt); receipt.id = 1; _depositReceipts.push(receipt); - _numOperatorsForVoteExecuted = (_roninBridgeManager.minimumVoteWeight() - 1) / 100 + 1; } diff --git a/test/bridge/unit/concrete/bridge-manager/constructor.t.sol b/test/bridge/unit/concrete/bridge-manager/constructor.t.sol index 16dd066f..ccb6d51b 100644 --- a/test/bridge/unit/concrete/bridge-manager/constructor.t.sol +++ b/test/bridge/unit/concrete/bridge-manager/constructor.t.sol @@ -38,17 +38,10 @@ contract Constructor_BridgeManager_Unit_Concrete_Test is BridgeManager_Unit_Conc } function test_GetFullBridgeOperatorInfos() external { - ( - address[] memory expectingBridgeOperators, - address[] memory expectingGovernors, - uint96[] memory expectingVoteWeights - ) = _getBridgeMembers(); - - ( - address[] memory returnedGovernors, - address[] memory returnedBridgeOperators, - uint96[] memory returnedVoteWeights - ) = _bridgeManager.getFullBridgeOperatorInfos(); + (address[] memory expectingBridgeOperators, address[] memory expectingGovernors, uint96[] memory expectingVoteWeights) = _getBridgeMembers(); + + (address[] memory returnedGovernors, address[] memory returnedBridgeOperators, uint96[] memory returnedVoteWeights) = + _bridgeManager.getFullBridgeOperatorInfos(); _assertBridgeMembers({ comparingOperators: returnedBridgeOperators, diff --git a/test/bridge/unit/fuzz/bridge-manager/BridgeReward.t.sol b/test/bridge/unit/fuzz/bridge-manager/BridgeReward.t.sol index 9514e0fb..76771ee5 100644 --- a/test/bridge/unit/fuzz/bridge-manager/BridgeReward.t.sol +++ b/test/bridge/unit/fuzz/bridge-manager/BridgeReward.t.sol @@ -52,7 +52,7 @@ contract BridgeRewardTest is Base_Test, IBridgeRewardEvents, BridgeManagerUtils period = _bound(period, 1, type(uint64).max); // Decode the default bridge manager inputs - (address[] memory bridgeOperators, , ) = abi.decode(_defaultBridgeManagerInputs, (address[], address[], uint256[])); + (address[] memory bridgeOperators,,) = abi.decode(_defaultBridgeManagerInputs, (address[], address[], uint256[])); // Generate random numbers for slashUntils and ballots uint256[] memory slashUntils = _createRandomNumbers(r1, bridgeOperators.length, 0, MAX_FUZZ_INPUTS); @@ -73,13 +73,7 @@ contract BridgeRewardTest is Base_Test, IBridgeRewardEvents, BridgeManagerUtils if (shouldShareEqually) { _assertCalculateRewardEqually(shouldShareEqually, rewardPerPeriod, totalBallot, bridgeRewardContract, ballots); } else { - _assertCalculateRewardProportionally( - shouldShareEqually, - rewardPerPeriod, - totalBallot, - bridgeRewardContract, - ballots - ); + _assertCalculateRewardProportionally(shouldShareEqually, rewardPerPeriod, totalBallot, bridgeRewardContract, ballots); } // Assert the slashing of bridge operators for the given period _assertSlashBridgeOperators(period, slashUntils, bridgeRewardContract); @@ -95,7 +89,7 @@ contract BridgeRewardTest is Base_Test, IBridgeRewardEvents, BridgeManagerUtils MockBridgeReward bridgeRewardContract = MockBridgeReward(payable(_bridgeRewardContract)); // Decode the default bridge manager inputs - (address[] memory bridgeOperators, , ) = abi.decode(_defaultBridgeManagerInputs, (address[], address[], uint256[])); + (address[] memory bridgeOperators,,) = abi.decode(_defaultBridgeManagerInputs, (address[], address[], uint256[])); // Create an empty array for ballots uint256[] memory ballots = new uint256[](bridgeOperators.length); // Calculate the total number of ballots @@ -132,7 +126,7 @@ contract BridgeRewardTest is Base_Test, IBridgeRewardEvents, BridgeManagerUtils uint256 actual; uint256 expected; - for (uint256 i; i < length; ) { + for (uint256 i; i < length;) { console.log("actual", actual); console.log("expected", expected); @@ -170,7 +164,7 @@ contract BridgeRewardTest is Base_Test, IBridgeRewardEvents, BridgeManagerUtils uint256 length = ballots.length; uint256 expected = rewardPerPeriod / length; - for (uint256 i; i < length; ) { + for (uint256 i; i < length;) { console.log("actual", actual); console.log("expected", expected); @@ -191,13 +185,9 @@ contract BridgeRewardTest is Base_Test, IBridgeRewardEvents, BridgeManagerUtils * @param slashUntils The array of slash until periods for bridge operators. * @param bridgeRewardContract The mock bridge reward contract. */ - function _assertSlashBridgeOperators( - uint256 period, - uint256[] memory slashUntils, - MockBridgeReward bridgeRewardContract - ) internal { + function _assertSlashBridgeOperators(uint256 period, uint256[] memory slashUntils, MockBridgeReward bridgeRewardContract) internal { uint256 length = slashUntils.length; - for (uint256 i; i < length; ) { + for (uint256 i; i < length;) { // Check if the bridge operator is slashed for the current period if (period <= slashUntils[i]) { // Assert that the bridge operator is slashed for the current period @@ -215,18 +205,14 @@ contract BridgeRewardTest is Base_Test, IBridgeRewardEvents, BridgeManagerUtils _validatorContract = address(new MockValidatorContract_OnlyTiming_ForHardhatTest(200)); - (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs( - DEFAULT_R1, - DEFAULT_R2, - DEFAULT_R3, - DEFAULT_NUM_BRIDGE_OPERATORS - ); + (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = + getValidInputs(DEFAULT_R1, DEFAULT_R2, DEFAULT_R3, DEFAULT_NUM_BRIDGE_OPERATORS); _defaultBridgeManagerInputs = abi.encode(bridgeOperators, governors, voteWeights); _bridgeManagerLogic = address(new MockBridgeManager()); _bridgeManagerContract = address( - new TransparentUpgradeableProxy(_bridgeManagerLogic, _admin, abi.encodeCall(MockBridgeManager.initialize, (bridgeOperators, governors, voteWeights))) + new TransparentUpgradeableProxy(_bridgeManagerLogic, _admin, abi.encodeCall(MockBridgeManager.initialize, (bridgeOperators, governors, voteWeights))) ); _bridgeTrackingLogic = address(new BridgeTracking()); @@ -235,12 +221,7 @@ contract BridgeRewardTest is Base_Test, IBridgeRewardEvents, BridgeManagerUtils _bridgeSlashLogic = address(new MockBridgeSlash()); _bridgeSlashContract = address( new TransparentUpgradeableProxy( - _bridgeSlashLogic, - _admin, - abi.encodeCall( - BridgeSlash.initialize, - (_validatorContract, _bridgeManagerContract, _bridgeTrackingContract, address(0)) - ) + _bridgeSlashLogic, _admin, abi.encodeCall(BridgeSlash.initialize, (_validatorContract, _bridgeManagerContract, _bridgeTrackingContract, address(0))) ) ); @@ -251,14 +232,7 @@ contract BridgeRewardTest is Base_Test, IBridgeRewardEvents, BridgeManagerUtils _admin, abi.encodeCall( BridgeReward.initialize, - ( - _bridgeManagerContract, - _bridgeTrackingContract, - _bridgeSlashContract, - _validatorContract, - address(0), - DEFAULT_REWARD_PER_PERIOD - ) + (_bridgeManagerContract, _bridgeTrackingContract, _bridgeSlashContract, _validatorContract, address(0), DEFAULT_REWARD_PER_PERIOD) ) ) ); diff --git a/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol b/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol index 995cb5b1..c3ee142a 100644 --- a/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol +++ b/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol @@ -61,11 +61,7 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { IBridgeSlash bridgeSlashContract = IBridgeSlash(_bridgeSlashContract); IBridgeSlash.Tier tier = bridgeSlashContract.getSlashTier(ballot, totalVote); // Calculate the new slash until period using the mock bridge slash contract - uint256 newSlashUntilPeriod = MockBridgeSlash(payable(_bridgeSlashContract)).calcSlashUntilPeriod( - tier, - period, - slashUntilPeriod - ); + uint256 newSlashUntilPeriod = MockBridgeSlash(payable(_bridgeSlashContract)).calcSlashUntilPeriod(tier, period, slashUntilPeriod); // Log the tier and slash period information console.log("tier", "period", "slashUntilPeriod", "newSlashUntilPeriod"); @@ -84,9 +80,7 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { assertTrue(newSlashUntilPeriod == uint256(slashUntilPeriod) + bridgeSlashContract.TIER_2_PENALTY_DURATION()); // Check if the slash duration meets the removal threshold - if ( - MockBridgeSlash(payable(_bridgeSlashContract)).isSlashDurationMetRemovalThreshold(newSlashUntilPeriod, period) - ) { + if (MockBridgeSlash(payable(_bridgeSlashContract)).isSlashDurationMetRemovalThreshold(newSlashUntilPeriod, period)) { assertTrue(newSlashUntilPeriod - period + 1 >= bridgeSlashContract.REMOVE_DURATION_THRESHOLD()); } } else { @@ -104,13 +98,7 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { * @param numBridgeOperators The number of bridge operators to add. * @param period The current period. */ - function test_bridgeSlash_recordEvents_onBridgeOperatorsAdded( - uint256 r1, - uint256 r2, - uint256 r3, - uint256 numBridgeOperators, - uint256 period - ) external { + function test_bridgeSlash_recordEvents_onBridgeOperatorsAdded(uint256 r1, uint256 r2, uint256 r3, uint256 numBridgeOperators, uint256 period) external { // Assume the input values are not equal to the default values vm.assume(r1 != DEFAULT_R1 && r2 != DEFAULT_R2 && r3 != DEFAULT_R3); // Bound the period between 1 and the maximum value of uint64 @@ -126,20 +114,15 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { MockBridgeManager(payable(_bridgeManagerContract)).registerCallbacks(registers); // Generate valid inputs for bridge operators - (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidAndNonExistingInputs( - _bridgeManagerContract, - r1, - r2, - r3, - numBridgeOperators - ); + (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = + getValidAndNonExistingInputs(_bridgeManagerContract, r1, r2, r3, numBridgeOperators); _addBridgeOperators(_bridgeManagerContract, _bridgeManagerContract, voteWeights, governors, bridgeOperators); // Retrieve the added periods for the bridge operators uint256[] memory addedPeriods = IBridgeSlash(_bridgeSlashContract).getAddedPeriodOf(bridgeOperators); // Check that the added periods match the current period - for (uint256 i; i < addedPeriods.length; ) { + for (uint256 i; i < addedPeriods.length;) { assertEq(addedPeriods[i], period); unchecked { ++i; @@ -154,12 +137,7 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { * @param duration The duration of the test. * @param newlyAddedSize The number of newly added operators. */ - function test_ExcludeNewlyAddedOperators_ExecSlashBridgeOperators( - uint256 r1, - uint256 period, - uint256 duration, - uint256 newlyAddedSize - ) external { + function test_ExcludeNewlyAddedOperators_ExecSlashBridgeOperators(uint256 r1, uint256 period, uint256 duration, uint256 newlyAddedSize) external { vm.assume(r1 != 0); vm.assume(r1 != DEFAULT_R1 && r1 != DEFAULT_R2 && r1 != DEFAULT_R3); // Bound the period, duration, and newlyAddedSize values @@ -174,9 +152,9 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { MockBridgeManager(payable(_bridgeManagerContract)).registerCallbacks(registers); // Decode the default bridge manager inputs to retrieve bridge operators - (address[] memory bridgeOperators, , ) = abi.decode(_defaultBridgeManagerInputs, (address[], address[], uint256[])); + (address[] memory bridgeOperators,,) = abi.decode(_defaultBridgeManagerInputs, (address[], address[], uint256[])); - for (uint256 i; i < duration; ) { + for (uint256 i; i < duration;) { // Set the current period in the mock validator contract MockValidatorSet_ForFoundryTest(payable(_validatorContract)).setCurrentPeriod(period); // Generate valid inputs for newly added operators @@ -185,20 +163,11 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { { address[] memory newlyAddedGovernors; uint96[] memory newlyAddedWeights; - (newlyAddedOperators, newlyAddedGovernors, newlyAddedWeights) = getValidInputs( - r1, - ~r1, - r1 << 1, - newlyAddedSize - ); + (newlyAddedOperators, newlyAddedGovernors, newlyAddedWeights) = getValidInputs(r1, ~r1, r1 << 1, newlyAddedSize); // Add the newly added operators using the bridge manager contract vm.prank(_bridgeManagerContract, _bridgeManagerContract); - bool[] memory addeds = IBridgeManager(_bridgeManagerContract).addBridgeOperators( - newlyAddedWeights, - newlyAddedGovernors, - newlyAddedOperators - ); + bool[] memory addeds = IBridgeManager(_bridgeManagerContract).addBridgeOperators(newlyAddedWeights, newlyAddedGovernors, newlyAddedOperators); vm.assume(addeds.sum() == addeds.length); // Retrieve the added periods for the newly added operators newlyAddedAtPeriods = IBridgeSlash(_bridgeSlashContract).getAddedPeriodOf(newlyAddedOperators); @@ -208,20 +177,12 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { uint256[] memory ballots = _createRandomNumbers(r1, bridgeOperators.length + newlyAddedSize, 0, MAX_FUZZ_INPUTS); // Execute slashBridgeOperators for all operators vm.prank(_bridgeTrackingContract, _bridgeTrackingContract); - IBridgeSlash(_bridgeSlashContract).execSlashBridgeOperators( - bridgeOperators.extend(newlyAddedOperators), - ballots, - ballots.sum(), - ballots.sum(), - period - ); + IBridgeSlash(_bridgeSlashContract).execSlashBridgeOperators(bridgeOperators.extend(newlyAddedOperators), ballots, ballots.sum(), ballots.sum(), period); // Check that the slashUntilPeriods and newlyAddedAtPeriods are correctly set uint256 length = newlyAddedAtPeriods.length; - uint256[] memory slashUntilPeriods = IBridgeSlash(_bridgeSlashContract).getSlashUntilPeriodOf( - newlyAddedOperators - ); - for (uint256 j; j < length; ) { + uint256[] memory slashUntilPeriods = IBridgeSlash(_bridgeSlashContract).getSlashUntilPeriodOf(newlyAddedOperators); + for (uint256 j; j < length;) { assertEq(slashUntilPeriods[j], 0); assertEq(newlyAddedAtPeriods[j], period); unchecked { @@ -251,14 +212,14 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { duration = _bound(duration, MIN_PERIOD_DURATION, MAX_PERIOD_DURATION); // Decode the default bridge manager inputs to retrieve bridge operators - (address[] memory bridgeOperators, , ) = abi.decode(_defaultBridgeManagerInputs, (address[], address[], uint256[])); + (address[] memory bridgeOperators,,) = abi.decode(_defaultBridgeManagerInputs, (address[], address[], uint256[])); vm.startPrank(_bridgeTrackingContract, _bridgeTrackingContract); uint256[] memory ballots; uint256 totalBallotForPeriod; IBridgeSlash bridgeSlashContract = IBridgeSlash(_bridgeSlashContract); MockValidatorSet_ForFoundryTest validatorContract = MockValidatorSet_ForFoundryTest(payable(_validatorContract)); - for (uint256 i; i < duration; ) { + for (uint256 i; i < duration;) { // Generate random ballots for bridge operators ballots = _createRandomNumbers(r1, bridgeOperators.length, 0, MAX_FUZZ_INPUTS); totalBallotForPeriod = ballots.sum(); @@ -267,13 +228,7 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { validatorContract.setCurrentPeriod(period); // Execute the `execSlashBridgeOperators` function - bridgeSlashContract.execSlashBridgeOperators( - bridgeOperators, - ballots, - totalBallotForPeriod, - totalBallotForPeriod, - period - ); + bridgeSlashContract.execSlashBridgeOperators(bridgeOperators, ballots, totalBallotForPeriod, totalBallotForPeriod, period); // Generate the next random number for r1 using the keccak256 hash function r1 = uint256(keccak256(abi.encode(r1))); @@ -289,12 +244,8 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { function _setUp() internal virtual { _admin = makeAddr("central-admin"); _validatorContract = address(new MockValidatorSet_ForFoundryTest()); - (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = getValidInputs( - DEFAULT_R1, - DEFAULT_R2, - DEFAULT_R3, - DEFAULT_NUM_BRIDGE_OPERATORS - ); + (address[] memory bridgeOperators, address[] memory governors, uint96[] memory voteWeights) = + getValidInputs(DEFAULT_R1, DEFAULT_R2, DEFAULT_R3, DEFAULT_NUM_BRIDGE_OPERATORS); _defaultBridgeManagerInputs = abi.encode(bridgeOperators, governors, voteWeights); _bridgeManagerLogic = address(new MockBridgeManager()); @@ -306,19 +257,14 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { _gatewayContract = address(new TransparentUpgradeableProxyV2(_gatewayLogic, _admin, "")); _bridgeTrackingLogic = address(new BridgeTracking()); - _bridgeTrackingContract = address( - new TransparentUpgradeableProxyV2(_bridgeTrackingLogic, _bridgeManagerContract, "") - ); + _bridgeTrackingContract = address(new TransparentUpgradeableProxyV2(_bridgeTrackingLogic, _bridgeManagerContract, "")); _bridgeSlashLogic = address(new MockBridgeSlash()); _bridgeSlashContract = address( new TransparentUpgradeableProxyV2( _bridgeSlashLogic, _bridgeManagerContract, - abi.encodeCall( - BridgeSlash.initialize, - (_validatorContract, _bridgeManagerContract, _bridgeTrackingContract, address(0)) - ) + abi.encodeCall(BridgeSlash.initialize, (_validatorContract, _bridgeManagerContract, _bridgeTrackingContract, address(0))) ) ); } diff --git a/test/helpers/LibArrayUtils.t.sol b/test/helpers/LibArrayUtils.t.sol index 8ca5451a..e4442799 100644 --- a/test/helpers/LibArrayUtils.t.sol +++ b/test/helpers/LibArrayUtils.t.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; library LibArrayUtils { function sum(bool[] memory arr) internal pure returns (uint256 total) { uint256 length = arr.length; - for (uint256 i; i < length; ) { + for (uint256 i; i < length;) { if (arr[i]) total++; unchecked { ++i; @@ -14,7 +14,7 @@ library LibArrayUtils { function sum(uint256[] memory arr) internal pure returns (uint256 total) { uint256 length = arr.length; - for (uint256 i; i < length; ) { + for (uint256 i; i < length;) { total += arr[i]; unchecked { ++i; @@ -39,7 +39,7 @@ library LibArrayUtils { c[i] = a[i]; } - for (uint j; j < b.length; ) { + for (uint j; j < b.length;) { c[i] = b[j]; ++i; ++j; @@ -54,7 +54,7 @@ library LibArrayUtils { c[i] = a[i]; } - for (uint j; j < b.length; ) { + for (uint j; j < b.length;) { c[i] = b[j]; ++i; ++j; diff --git a/test/helpers/MainchainBridgeAdminUtils.t.sol b/test/helpers/MainchainBridgeAdminUtils.t.sol index e4493fd0..e90fe7a9 100644 --- a/test/helpers/MainchainBridgeAdminUtils.t.sol +++ b/test/helpers/MainchainBridgeAdminUtils.t.sol @@ -8,9 +8,7 @@ contract MainchainBridgeAdminUtils is ProposalUtils { MainchainBridgeManager _contract; address _sender; - constructor(uint256 roninChainId, uint256[] memory signerPKs, MainchainBridgeManager contract_, address sender) - ProposalUtils(roninChainId, signerPKs) - { + constructor(uint256 roninChainId, uint256[] memory signerPKs, MainchainBridgeManager contract_, address sender) ProposalUtils(roninChainId, signerPKs) { _contract = contract_; _sender = sender; } diff --git a/test/helpers/Randomizer.t.sol b/test/helpers/Randomizer.t.sol index af11ba36..9e317c47 100644 --- a/test/helpers/Randomizer.t.sol +++ b/test/helpers/Randomizer.t.sol @@ -11,7 +11,7 @@ abstract contract Randomizer is Base_Test { function _createRandomAddresses(uint256 seed, uint256 amount) internal returns (address[] memory addrs) { addrs = new address[](amount); - for (uint256 i; i < amount; ) { + for (uint256 i; i < amount;) { seed = uint256(keccak256(abi.encode(seed))); addrs[i] = vm.addr(seed); vm.etch(addrs[i], abi.encode()); @@ -23,16 +23,11 @@ abstract contract Randomizer is Base_Test { } } - function _createRandomNumbers( - uint256 seed, - uint256 amount, - uint256 min, - uint256 max - ) internal pure returns (uint256[] memory nums) { + function _createRandomNumbers(uint256 seed, uint256 amount, uint256 min, uint256 max) internal pure returns (uint256[] memory nums) { uint256 r; nums = new uint256[](amount); - for (uint256 i; i < amount; ) { + for (uint256 i; i < amount;) { r = _randomize(seed, min, max); nums[i] = r; seed = r; diff --git a/test/helpers/RoninBridgeAdminUtils.t.sol b/test/helpers/RoninBridgeAdminUtils.t.sol index 98023e16..f8596a0e 100644 --- a/test/helpers/RoninBridgeAdminUtils.t.sol +++ b/test/helpers/RoninBridgeAdminUtils.t.sol @@ -8,9 +8,7 @@ contract RoninBridgeAdminUtils is ProposalUtils { RoninBridgeManager _contract; address _sender; - constructor(uint256 roninChainId, uint256[] memory signerPKs, RoninBridgeManager contract_, address sender) - ProposalUtils(roninChainId, signerPKs) - { + constructor(uint256 roninChainId, uint256[] memory signerPKs, RoninBridgeManager contract_, address sender) ProposalUtils(roninChainId, signerPKs) { _contract = contract_; _sender = sender; } diff --git a/test/mocks/MockBridgeSlash.sol b/test/mocks/MockBridgeSlash.sol index 462aa12f..f605e621 100644 --- a/test/mocks/MockBridgeSlash.sol +++ b/test/mocks/MockBridgeSlash.sol @@ -6,27 +6,21 @@ import { IBridgeSlash } from "@ronin/contracts/interfaces/bridge/IBridgeSlash.so contract MockBridgeSlash is IBridgeSlash { mapping(address => uint256) internal _slashMap; - function MINIMUM_VOTE_THRESHOLD() external view returns (uint256) {} + function MINIMUM_VOTE_THRESHOLD() external view returns (uint256) { } - function REMOVE_DURATION_THRESHOLD() external view returns (uint256) {} + function REMOVE_DURATION_THRESHOLD() external view returns (uint256) { } - function TIER_1_PENALTY_DURATION() external view returns (uint256) {} + function TIER_1_PENALTY_DURATION() external view returns (uint256) { } - function TIER_2_PENALTY_DURATION() external view returns (uint256) {} + function TIER_2_PENALTY_DURATION() external view returns (uint256) { } - function execSlashBridgeOperators( - address[] calldata operators, - uint256[] calldata ballots, - uint256 totalBallot, - uint256 totalVote, - uint256 period - ) external {} + function execSlashBridgeOperators(address[] calldata operators, uint256[] calldata ballots, uint256 totalBallot, uint256 totalVote, uint256 period) external { } - function getAddedPeriodOf(address[] calldata bridgeOperators) external view returns (uint256[] memory addedPeriods) {} + function getAddedPeriodOf(address[] calldata bridgeOperators) external view returns (uint256[] memory addedPeriods) { } - function getPenaltyDurations() external pure returns (uint256[] memory penaltyDurations) {} + function getPenaltyDurations() external pure returns (uint256[] memory penaltyDurations) { } - function getSlashTier(uint256 ballot, uint256 totalVote) external pure returns (Tier tier) {} + function getSlashTier(uint256 ballot, uint256 totalVote) external pure returns (Tier tier) { } function getSlashUntilPeriodOf(address[] calldata operators) external view returns (uint256[] memory untilPeriods) { untilPeriods = new uint256[](operators.length); diff --git a/test/mocks/MockBridgeTracking.sol b/test/mocks/MockBridgeTracking.sol index e279d409..95a76cc7 100644 --- a/test/mocks/MockBridgeTracking.sol +++ b/test/mocks/MockBridgeTracking.sol @@ -13,12 +13,7 @@ contract MockBridgeTracking is IBridgeTracking { // Mapping from period number => period tracking mapping(uint256 => PeriodTracking) _tracks; - function cheat_setPeriodTracking( - uint256 period, - address[] memory operators, - uint256[] calldata ballots, - uint256 totalVote_ - ) external { + function cheat_setPeriodTracking(uint256 period, address[] memory operators, uint256[] calldata ballots, uint256 totalVote_) external { require(operators.length == ballots.length, "mismatch length"); PeriodTracking storage _sTrack = _tracks[period]; _sTrack.operators = operators; @@ -39,10 +34,7 @@ contract MockBridgeTracking is IBridgeTracking { } } - function getManyTotalBallots( - uint256 period, - address[] calldata operators - ) external view returns (uint256[] memory ballots_) { + function getManyTotalBallots(uint256 period, address[] calldata operators) external view returns (uint256[] memory ballots_) { ballots_ = new uint256[](operators.length); PeriodTracking storage _sTrack = _tracks[period]; for (uint i; i < operators.length; i++) { @@ -54,11 +46,11 @@ contract MockBridgeTracking is IBridgeTracking { return _ballotOf(_tracks[period], operator); } - function handleVoteApproved(VoteKind _kind, uint256 _requestId) external {} + function handleVoteApproved(VoteKind _kind, uint256 _requestId) external { } - function recordVote(VoteKind _kind, uint256 _requestId, address _operator) external {} + function recordVote(VoteKind _kind, uint256 _requestId, address _operator) external { } - function startedAtBlock() external view returns (uint256) {} + function startedAtBlock() external view returns (uint256) { } function _ballotOf(PeriodTracking storage _sTrack, address operator) private view returns (uint256) { return _sTrack.ballotMap[operator]; From 10acfc9a5e59d4752da6e18d5c0aa2b63ace720a Mon Sep 17 00:00:00 2001 From: nxqbao Date: Thu, 11 Apr 2024 15:46:48 +0700 Subject: [PATCH 141/180] chore: clone ronin gateway artifact --- .../ronin-testnet/RoninGatewayV3Proxy.json | 332 ++++++++++++++++++ 1 file changed, 332 insertions(+) create mode 100644 deployments/ronin-testnet/RoninGatewayV3Proxy.json diff --git a/deployments/ronin-testnet/RoninGatewayV3Proxy.json b/deployments/ronin-testnet/RoninGatewayV3Proxy.json new file mode 100644 index 00000000..aac5e473 --- /dev/null +++ b/deployments/ronin-testnet/RoninGatewayV3Proxy.json @@ -0,0 +1,332 @@ +{ + "address": "0xcee681c9108c42c710c6a8a949307d5f13c9f3ca", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "functionDelegateCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xb6cb6f8b5f2414589d26802c66c2d84c91ae0927be205512dff75080385156a3", + "receipt": { + "to": null, + "from": "0x0F68eDBE14C8f68481771016d7E2871d6a35DE11", + "contractAddress": "0x0CF8fF40a508bdBc39fBe1Bb679dCBa64E65C7Df", + "transactionIndex": 8, + "gasUsed": "1187047", + "logsBloom": "0x40200004000000000000000000000000400000000000000000200000000400000000080000002000800000000000000000010000000000000000000000080400040000020000000000000000000002000000000000000000000400000000080000000000020000000000000000000800000040800000000000000000000000000000000000000000008000001000000000000000000000000008000000800000000000000000001000010000000000410200000000000000001000000000000041080020000000000000000000000000001000000400000108000800400020000000000000000000000001000080000000000004800000008000004000000000", + "blockHash": "0x918662e14b538e4abaae71051f02d7b22b7332f5cdc59f608331e4bebb52bffb", + "transactionHash": "0xb6cb6f8b5f2414589d26802c66c2d84c91ae0927be205512dff75080385156a3", + "logs": [ + { + "transactionIndex": 8, + "blockNumber": 14765762, + "transactionHash": "0xb6cb6f8b5f2414589d26802c66c2d84c91ae0927be205512dff75080385156a3", + "address": "0x0CF8fF40a508bdBc39fBe1Bb679dCBa64E65C7Df", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x00000000000000000000000075d23c8830bf28e5b88340638efc0f36e026b8a0" + ], + "data": "0x", + "logIndex": 15, + "blockHash": "0x918662e14b538e4abaae71051f02d7b22b7332f5cdc59f608331e4bebb52bffb" + }, + { + "transactionIndex": 8, + "blockNumber": 14765762, + "transactionHash": "0xb6cb6f8b5f2414589d26802c66c2d84c91ae0927be205512dff75080385156a3", + "address": "0x0CF8fF40a508bdBc39fBe1Bb679dCBa64E65C7Df", + "topics": [ + "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000ed4a9f48a62fb6fdcfb45bb00c9f61d1a436e58c", + "0x0000000000000000000000000f68edbe14c8f68481771016d7e2871d6a35de11" + ], + "data": "0x", + "logIndex": 16, + "blockHash": "0x918662e14b538e4abaae71051f02d7b22b7332f5cdc59f608331e4bebb52bffb" + }, + { + "transactionIndex": 8, + "blockNumber": 14765762, + "transactionHash": "0xb6cb6f8b5f2414589d26802c66c2d84c91ae0927be205512dff75080385156a3", + "address": "0x0CF8fF40a508bdBc39fBe1Bb679dCBa64E65C7Df", + "topics": [ + "0xef40dc07567635f84f5edbd2f8dbc16b40d9d282dd8e7e6f4ff58236b6836169" + ], + "data": "0x0000000000000000000000007f13232bdc3a010c3f749a1c25bf99f1c053ce70", + "logIndex": 17, + "blockHash": "0x918662e14b538e4abaae71051f02d7b22b7332f5cdc59f608331e4bebb52bffb" + }, + { + "transactionIndex": 8, + "blockNumber": 14765762, + "transactionHash": "0xb6cb6f8b5f2414589d26802c66c2d84c91ae0927be205512dff75080385156a3", + "address": "0x0CF8fF40a508bdBc39fBe1Bb679dCBa64E65C7Df", + "topics": [ + "0x976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000046", + "0x0000000000000000000000000000000000000000000000000000000000000064" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "logIndex": 18, + "blockHash": "0x918662e14b538e4abaae71051f02d7b22b7332f5cdc59f608331e4bebb52bffb" + }, + { + "transactionIndex": 8, + "blockNumber": 14765762, + "transactionHash": "0xb6cb6f8b5f2414589d26802c66c2d84c91ae0927be205512dff75080385156a3", + "address": "0x0CF8fF40a508bdBc39fBe1Bb679dCBa64E65C7Df", + "topics": [ + "0x2544bff60c6d5b84946e06804af9f84e150bbee85238dbdee79efca4e0adf401" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000004000000000000000000000000c99a6a985ed2cac1ef41640596c5a5f9f4e19ef5000000000000000000000000a8754b9fa15fc18bb59458815510e40a12cd201400000000000000000000000097a9107c1793bc407d6f527b77e7fff4d812bece0000000000000000000000000b7007c13325c48911f73a2dad5fa5dcbf808adc0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000cc8fa225d80b9c7d42f96e9570156c65d6caaa25000000000000000000000000bb0e17ef65f82ab018d8edd776e8dd940327b28b000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "logIndex": 19, + "blockHash": "0x918662e14b538e4abaae71051f02d7b22b7332f5cdc59f608331e4bebb52bffb" + }, + { + "transactionIndex": 8, + "blockNumber": 14765762, + "transactionHash": "0xb6cb6f8b5f2414589d26802c66c2d84c91ae0927be205512dff75080385156a3", + "address": "0x0CF8fF40a508bdBc39fBe1Bb679dCBa64E65C7Df", + "topics": [ + "0x6f52f53a938df83439fa4c6055c7df0a6906d621aa6dfa4708187037fdfc41da" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000004000000000000000000000000c99a6a985ed2cac1ef41640596c5a5f9f4e19ef5000000000000000000000000a8754b9fa15fc18bb59458815510e40a12cd201400000000000000000000000097a9107c1793bc407d6f527b77e7fff4d812bece0000000000000000000000000b7007c13325c48911f73a2dad5fa5dcbf808adc0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000000000000000000000000000000000000000000ab300000000000000000000000000000000000000000000000009da6d3cfe8700000000000000000000000000000000000000000000000000000000000000989680", + "logIndex": 20, + "blockHash": "0x918662e14b538e4abaae71051f02d7b22b7332f5cdc59f608331e4bebb52bffb" + }, + { + "transactionIndex": 8, + "blockNumber": 14765762, + "transactionHash": "0xb6cb6f8b5f2414589d26802c66c2d84c91ae0927be205512dff75080385156a3", + "address": "0x0CF8fF40a508bdBc39fBe1Bb679dCBa64E65C7Df", + "topics": [ + "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", + "0x384495a48d92b97cd9b9d199c73ed783dd1aa0076a6ebcf9156ca7fef7d2cc40", + "0x000000000000000000000000ae8db4d9d3067a33a8241e415e65f0c69cfbb8e1", + "0x0000000000000000000000000f68edbe14c8f68481771016d7e2871d6a35de11" + ], + "data": "0x", + "logIndex": 21, + "blockHash": "0x918662e14b538e4abaae71051f02d7b22b7332f5cdc59f608331e4bebb52bffb" + }, + { + "transactionIndex": 8, + "blockNumber": 14765762, + "transactionHash": "0xb6cb6f8b5f2414589d26802c66c2d84c91ae0927be205512dff75080385156a3", + "address": "0x0CF8fF40a508bdBc39fBe1Bb679dCBa64E65C7Df", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084390b8cf3e612e8c80d9ea2e92bcd029151404a", + "logIndex": 22, + "blockHash": "0x918662e14b538e4abaae71051f02d7b22b7332f5cdc59f608331e4bebb52bffb" + } + ], + "blockNumber": 14765762, + "cumulativeGasUsed": "2446859", + "status": 1, + "byzantium": true + }, + "args": [ + "0x75d23C8830BF28E5b88340638efC0f36e026B8a0", + "0x84390B8CF3E612e8c80D9EA2E92bcd029151404a", + "0xe22fe336000000000000000000000000ed4a9f48a62fb6fdcfb45bb00c9f61d1a436e58c0000000000000000000000007f13232bdc3a010c3f749a1c25bf99f1c053ce70000000000000000000000000000000000000000000000000000000000000004600000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000ae8db4d9d3067a33a8241e415e65f0c69cfbb8e1000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000004000000000000000000000000c99a6a985ed2cac1ef41640596c5a5f9f4e19ef5000000000000000000000000a8754b9fa15fc18bb59458815510e40a12cd201400000000000000000000000097a9107c1793bc407d6f527b77e7fff4d812bece0000000000000000000000000b7007c13325c48911f73a2dad5fa5dcbf808adc0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000cc8fa225d80b9c7d42f96e9570156c65d6caaa25000000000000000000000000bb0e17ef65f82ab018d8edd776e8dd940327b28b000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000000000000000000000000000000000000000000ab300000000000000000000000000000000000000000000000009da6d3cfe870000000000000000000000000000000000000000000000000000000000000098968000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + ], + "numDeployments": 2, + "solcInputHash": "267ddc12ed25de7b99c302796e5ae6c1", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"functionDelegateCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"functionDelegateCall(bytes)\":{\"details\":\"Calls a function from the current implementation as specified by `_data`, which should be an encoded function call. Requirements: - Only the admin can call this function.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"functionDelegateCall(bytes)\":{\"notice\":\"The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider reviewing the encoded data `_data` and the method which is called before using this.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/v0.8/extensions/TransparentUpgradeableProxyV2.sol\":\"TransparentUpgradeableProxyV2\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x140055a64cf579d622e04f5a198595832bf2cb193cd0005f4f2d4d61ca906253\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/v0.8/extensions/TransparentUpgradeableProxyV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\\\";\\n\\ncontract TransparentUpgradeableProxyV2 is TransparentUpgradeableProxy {\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable TransparentUpgradeableProxy(_logic, admin_, _data) {}\\n\\n /**\\n * @dev Calls a function from the current implementation as specified by `_data`, which should be an encoded function call.\\n *\\n * Requirements:\\n * - Only the admin can call this function.\\n *\\n * @notice The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid\\n * triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider\\n * reviewing the encoded data `_data` and the method which is called before using this.\\n *\\n */\\n function functionDelegateCall(bytes memory _data) public payable ifAdmin {\\n address _addr = _implementation();\\n assembly {\\n let _result := delegatecall(gas(), _addr, add(_data, 32), mload(_data), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n switch _result\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xdf52e28697a1af7d7e176d35df4cfa2eee79a19eb74df6eac7704953d3583449\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6080604052604051620011353803806200113583398101604081905262000026916200051f565b82828282816200005860017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005ff565b600080516020620010ee8339815191521462000078576200007862000625565b6200008682826000620000ed565b50620000b6905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005ff565b600080516020620010ce83398151915214620000d657620000d662000625565b620000e1826200012a565b5050505050506200068e565b620000f88362000185565b600082511180620001065750805b156200012557620001238383620001c760201b620002dd1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f62000155620001f6565b604080516001600160a01b03928316815291841660208301520160405180910390a162000182816200022f565b50565b6200019081620002e4565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001ef83836040518060600160405280602781526020016200110e6027913962000387565b9392505050565b600062000220600080516020620010ce83398151915260001b6200046d60201b620002851760201c565b546001600160a01b0316919050565b6001600160a01b0381166200029a5760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002c3600080516020620010ce83398151915260001b6200046d60201b620002851760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002fa816200047060201b620003091760201c565b6200035e5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840162000291565b80620002c3600080516020620010ee83398151915260001b6200046d60201b620002851760201c565b60606001600160a01b0384163b620003f15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840162000291565b600080856001600160a01b0316856040516200040e91906200063b565b600060405180830381855af49150503d80600081146200044b576040519150601f19603f3d011682016040523d82523d6000602084013e62000450565b606091505b509092509050620004638282866200047f565b9695505050505050565b90565b6001600160a01b03163b151590565b6060831562000490575081620001ef565b825115620004a15782518084602001fd5b8160405162461bcd60e51b815260040162000291919062000659565b80516001600160a01b0381168114620004d557600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200050d578181015183820152602001620004f3565b83811115620001235750506000910152565b6000806000606084860312156200053557600080fd5b6200054084620004bd565b92506200055060208501620004bd565b60408501519092506001600160401b03808211156200056e57600080fd5b818601915086601f8301126200058357600080fd5b815181811115620005985762000598620004da565b604051601f8201601f19908116603f01168101908382118183101715620005c357620005c3620004da565b81604052828152896020848701011115620005dd57600080fd5b620005f0836020830160208801620004f0565b80955050505050509250925092565b6000828210156200062057634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b600082516200064f818460208701620004f0565b9190910192915050565b60208152600082518060208401526200067a816040850160208701620004f0565b601f01601f19169190910160400192915050565b610a30806200069e6000396000f3fe6080604052600436106100695760003560e01c80635c60da1b116100435780635c60da1b146100c65780638f283970146100f7578063f851a4401461011757610078565b80633659cfe6146100805780634bb5274a146100a05780634f1ef286146100b357610078565b366100785761007661012c565b005b61007661012c565b34801561008c57600080fd5b5061007661009b3660046107da565b610146565b6100766100ae366004610824565b61018d565b6100766100c13660046108d5565b6101dc565b3480156100d257600080fd5b506100db61024d565b6040516001600160a01b03909116815260200160405180910390f35b34801561010357600080fd5b506100766101123660046107da565b610288565b34801561012357600080fd5b506100db6102b2565b610134610318565b61014461013f6103d2565b6103dc565b565b61014e6103fb565b6001600160a01b0316336001600160a01b03161415610185576101828160405180602001604052806000815250600061042e565b50565b61018261012c565b6101956103fb565b6001600160a01b0316336001600160a01b031614156101855760006101b86103d2565b9050600080835160208501845af43d6000803e8080156101d7573d6000f35b3d6000fd5b6101e46103fb565b6001600160a01b0316336001600160a01b03161415610245576102408383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061042e915050565b505050565b61024061012c565b60006102576103fb565b6001600160a01b0316336001600160a01b0316141561027d576102786103d2565b905090565b61028561012c565b90565b6102906103fb565b6001600160a01b0316336001600160a01b031614156101855761018281610459565b60006102bc6103fb565b6001600160a01b0316336001600160a01b0316141561027d576102786103fb565b606061030283836040518060600160405280602781526020016109d4602791396104ad565b9392505050565b6001600160a01b03163b151590565b6103206103fb565b6001600160a01b0316336001600160a01b031614156101445760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b60006102786105a1565b3660008037600080366000845af43d6000803e8080156101d7573d6000f35b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610437836105c9565b6000825111806104445750805b156102405761045383836102dd565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104826103fb565b604080516001600160a01b03928316815291841660208301520160405180910390a161018281610609565b60606001600160a01b0384163b61052c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084016103c9565b600080856001600160a01b0316856040516105479190610984565b600060405180830381855af49150503d8060008114610582576040519150601f19603f3d011682016040523d82523d6000602084013e610587565b606091505b50915091506105978282866106e1565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc61041f565b6105d28161071a565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166106855760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016103c9565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b039290921691909117905550565b606083156106f0575081610302565b8251156107005782518084602001fd5b8160405162461bcd60e51b81526004016103c991906109a0565b6001600160a01b0381163b6107975760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e74726163740000000000000000000000000000000000000060648201526084016103c9565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6106a8565b80356001600160a01b03811681146107d557600080fd5b919050565b6000602082840312156107ec57600080fd5b610302826107be565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561083657600080fd5b813567ffffffffffffffff8082111561084e57600080fd5b818401915084601f83011261086257600080fd5b813581811115610874576108746107f5565b604051601f8201601f19908116603f0116810190838211818310171561089c5761089c6107f5565b816040528281528760208487010111156108b557600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000806000604084860312156108ea57600080fd5b6108f3846107be565b9250602084013567ffffffffffffffff8082111561091057600080fd5b818601915086601f83011261092457600080fd5b81358181111561093357600080fd5b87602082850101111561094557600080fd5b6020830194508093505050509250925092565b60005b8381101561097357818101518382015260200161095b565b838111156104535750506000910152565b60008251610996818460208701610958565b9190910192915050565b60208152600082518060208401526109bf816040850160208701610958565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212203b097b88c1cee26a495ec73a23404fc321233caf781f72087a86ad15c85d8f1d64736f6c63430008090033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x6080604052600436106100695760003560e01c80635c60da1b116100435780635c60da1b146100c65780638f283970146100f7578063f851a4401461011757610078565b80633659cfe6146100805780634bb5274a146100a05780634f1ef286146100b357610078565b366100785761007661012c565b005b61007661012c565b34801561008c57600080fd5b5061007661009b3660046107da565b610146565b6100766100ae366004610824565b61018d565b6100766100c13660046108d5565b6101dc565b3480156100d257600080fd5b506100db61024d565b6040516001600160a01b03909116815260200160405180910390f35b34801561010357600080fd5b506100766101123660046107da565b610288565b34801561012357600080fd5b506100db6102b2565b610134610318565b61014461013f6103d2565b6103dc565b565b61014e6103fb565b6001600160a01b0316336001600160a01b03161415610185576101828160405180602001604052806000815250600061042e565b50565b61018261012c565b6101956103fb565b6001600160a01b0316336001600160a01b031614156101855760006101b86103d2565b9050600080835160208501845af43d6000803e8080156101d7573d6000f35b3d6000fd5b6101e46103fb565b6001600160a01b0316336001600160a01b03161415610245576102408383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061042e915050565b505050565b61024061012c565b60006102576103fb565b6001600160a01b0316336001600160a01b0316141561027d576102786103d2565b905090565b61028561012c565b90565b6102906103fb565b6001600160a01b0316336001600160a01b031614156101855761018281610459565b60006102bc6103fb565b6001600160a01b0316336001600160a01b0316141561027d576102786103fb565b606061030283836040518060600160405280602781526020016109d4602791396104ad565b9392505050565b6001600160a01b03163b151590565b6103206103fb565b6001600160a01b0316336001600160a01b031614156101445760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b60006102786105a1565b3660008037600080366000845af43d6000803e8080156101d7573d6000f35b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610437836105c9565b6000825111806104445750805b156102405761045383836102dd565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104826103fb565b604080516001600160a01b03928316815291841660208301520160405180910390a161018281610609565b60606001600160a01b0384163b61052c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084016103c9565b600080856001600160a01b0316856040516105479190610984565b600060405180830381855af49150503d8060008114610582576040519150601f19603f3d011682016040523d82523d6000602084013e610587565b606091505b50915091506105978282866106e1565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc61041f565b6105d28161071a565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166106855760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016103c9565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b039290921691909117905550565b606083156106f0575081610302565b8251156107005782518084602001fd5b8160405162461bcd60e51b81526004016103c991906109a0565b6001600160a01b0381163b6107975760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e74726163740000000000000000000000000000000000000060648201526084016103c9565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6106a8565b80356001600160a01b03811681146107d557600080fd5b919050565b6000602082840312156107ec57600080fd5b610302826107be565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561083657600080fd5b813567ffffffffffffffff8082111561084e57600080fd5b818401915084601f83011261086257600080fd5b813581811115610874576108746107f5565b604051601f8201601f19908116603f0116810190838211818310171561089c5761089c6107f5565b816040528281528760208487010111156108b557600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000806000604084860312156108ea57600080fd5b6108f3846107be565b9250602084013567ffffffffffffffff8082111561091057600080fd5b818601915086601f83011261092457600080fd5b81358181111561093357600080fd5b87602082850101111561094557600080fd5b6020830194508093505050509250925092565b60005b8381101561097357818101518382015260200161095b565b838111156104535750506000910152565b60008251610996818460208701610958565b9190910192915050565b60208152600082518060208401526109bf816040850160208701610958565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212203b097b88c1cee26a495ec73a23404fc321233caf781f72087a86ad15c85d8f1d64736f6c63430008090033", + "devdoc": { + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "functionDelegateCall(bytes)": { + "details": "Calls a function from the current implementation as specified by `_data`, which should be an encoded function call. Requirements: - Only the admin can call this function." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "functionDelegateCall(bytes)": { + "notice": "The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider reviewing the encoded data `_data` and the method which is called before using this." + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file From 916ec3f8c71bfe4d7b4f140d90c937cb09184bae Mon Sep 17 00:00:00 2001 From: nxqbao Date: Thu, 11 Apr 2024 15:47:09 +0700 Subject: [PATCH 142/180] script: deploy ronin bridge manager --- foundry.toml | 4 +- ...0240411-p1-deploy-ronin-bridge-manager.sol | 93 +++++++++++++++++++ 2 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.sol diff --git a/foundry.toml b/foundry.toml index 64942a1b..e15ef4ac 100644 --- a/foundry.toml +++ b/foundry.toml @@ -22,9 +22,11 @@ evm_version = 'istanbul' [profile.ethereum] evm_version = 'shanghai' -[profile.ronin.ronin_bridge_manager] +[profile.ronin_bridge_manager] evm_version = 'istanbul' +optimizer = true optimizer_runs = 1 +ffi = true [fmt] line_length = 160 diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.sol new file mode 100644 index 00000000..94dd4aa7 --- /dev/null +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.sol @@ -0,0 +1,93 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { console2 } from "forge-std/console2.sol"; +import { StdStyle } from "forge-std/StdStyle.sol"; +import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; +import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; +import { IMainchainGatewayV3 } from "@ronin/contracts/interfaces/IMainchainGatewayV3.sol"; +import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; +import { LibTokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; +import { Contract } from "../utils/Contract.sol"; +import { Network } from "../utils/Network.sol"; +import { Contract } from "../utils/Contract.sol"; +import { IGeneralConfigExtended } from "../IGeneralConfigExtended.sol"; +import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; +import "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; +import "@ronin/contracts/mainchain/MainchainGatewayV3.sol"; +import "@ronin/contracts/libraries/Proposal.sol"; +import "@ronin/contracts/libraries/Ballot.sol"; + +import { MockSLP } from "@ronin/contracts/mocks/token/MockSLP.sol"; +import { SLPDeploy } from "@ronin/script/contracts/token/SLPDeploy.s.sol"; +import { MainchainBridgeAdminUtils } from "test/helpers/MainchainBridgeAdminUtils.t.sol"; +import "@ronin/script/contracts/RoninBridgeManagerDeploy.s.sol"; + +import "../BridgeMigration.sol"; + +contract Migration__20240409_P1_DeployRoninBridgeManager is BridgeMigration { + ISharedArgument.SharedParameter _param; + RoninBridgeManager _roninBridgeManager; + + function setUp() public override { + super.setUp(); + } + + function run() public onlyOn(DefaultNetwork.RoninTestnet.key()) { + ISharedArgument.SharedParameter memory param; + + param.roninBridgeManager.num = 7; + param.roninBridgeManager.denom = 10; + param.roninBridgeManager.roninChainId = block.chainid; + param.roninBridgeManager.expiryDuration = 60 * 60 * 24 * 14; // 14 days + param.roninBridgeManager.bridgeContract = _config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); + param.roninBridgeManager.bridgeOperators = new address[](4); + param.roninBridgeManager.bridgeOperators[0] = 0x2e82D2b56f858f79DeeF11B160bFC4631873da2B; + param.roninBridgeManager.bridgeOperators[1] = 0xBcb61783dd2403FE8cC9B89B27B1A9Bb03d040Cb; + param.roninBridgeManager.bridgeOperators[2] = 0xB266Bf53Cf7EAc4E2065A404598DCB0E15E9462c; + param.roninBridgeManager.bridgeOperators[3] = 0xcc5Fc5B6c8595F56306Da736F6CD02eD9141C84A; + + param.roninBridgeManager.governors = new address[](4); + param.roninBridgeManager.governors[0] = 0xd24D87DDc1917165435b306aAC68D99e0F49A3Fa; + param.roninBridgeManager.governors[1] = 0xb033ba62EC622dC54D0ABFE0254e79692147CA26; + param.roninBridgeManager.governors[2] = 0x087D08e3ba42e64E3948962dd1371F906D1278b9; + param.roninBridgeManager.governors[3] = 0x52ec2e6BBcE45AfFF8955Da6410bb13812F4289F; + + param.roninBridgeManager.voteWeights = new uint96[](4); + param.roninBridgeManager.voteWeights[0] = 100; + param.roninBridgeManager.voteWeights[1] = 100; + param.roninBridgeManager.voteWeights[2] = 100; + param.roninBridgeManager.voteWeights[3] = 100; + + param.roninBridgeManager.targetOptions = new GlobalProposal.TargetOption[](4); + param.roninBridgeManager.targetOptions[0] = GlobalProposal.TargetOption.GatewayContract; + param.roninBridgeManager.targetOptions[1] = GlobalProposal.TargetOption.BridgeReward; + param.roninBridgeManager.targetOptions[2] = GlobalProposal.TargetOption.BridgeSlash; + param.roninBridgeManager.targetOptions[3] = GlobalProposal.TargetOption.BridgeTracking; + + param.roninBridgeManager.targets = new address[](4); + param.roninBridgeManager.targets[0] = _config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); + param.roninBridgeManager.targets[1] = _config.getAddressFromCurrentNetwork(Contract.BridgeReward.key()); + param.roninBridgeManager.targets[2] = _config.getAddressFromCurrentNetwork(Contract.BridgeSlash.key()); + param.roninBridgeManager.targets[3] = _config.getAddressFromCurrentNetwork(Contract.BridgeTracking.key()); + + _roninBridgeManager = RoninBridgeManager(new RoninBridgeManagerDeploy().overrideArgs( + abi.encodeCall( + RoninBridgeManagerConstructor.initialize, + ( + param.roninBridgeManager.num, + param.roninBridgeManager.denom, + param.roninBridgeManager.roninChainId, + param.roninBridgeManager.expiryDuration, + param.roninBridgeManager.bridgeContract, + param.roninBridgeManager.callbackRegisters, + param.roninBridgeManager.bridgeOperators, + param.roninBridgeManager.governors, + param.roninBridgeManager.voteWeights, + param.roninBridgeManager.targetOptions, + param.roninBridgeManager.targets + ) + ) + ).run()); + } +} From 59a4eb78b185152c33254429cece322941763984 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Thu, 11 Apr 2024 16:39:38 +0700 Subject: [PATCH 143/180] script: init script --- ...0240411-p1-deploy-ronin-bridge-manager.sol | 4 +- ...20240411-p2-upgrade-bridge-ronin-chain.sol | 98 +++++++++++++++++++ 2 files changed, 100 insertions(+), 2 deletions(-) create mode 100644 script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.sol diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.sol index 94dd4aa7..05b000a3 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.sol @@ -27,7 +27,7 @@ import "../BridgeMigration.sol"; contract Migration__20240409_P1_DeployRoninBridgeManager is BridgeMigration { ISharedArgument.SharedParameter _param; - RoninBridgeManager _roninBridgeManager; + RoninBridgeManager _newRoninBridgeManager; function setUp() public override { super.setUp(); @@ -71,7 +71,7 @@ contract Migration__20240409_P1_DeployRoninBridgeManager is BridgeMigration { param.roninBridgeManager.targets[2] = _config.getAddressFromCurrentNetwork(Contract.BridgeSlash.key()); param.roninBridgeManager.targets[3] = _config.getAddressFromCurrentNetwork(Contract.BridgeTracking.key()); - _roninBridgeManager = RoninBridgeManager(new RoninBridgeManagerDeploy().overrideArgs( + _newRoninBridgeManager = RoninBridgeManager(new RoninBridgeManagerDeploy().overrideArgs( abi.encodeCall( RoninBridgeManagerConstructor.initialize, ( diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.sol new file mode 100644 index 00000000..394a3193 --- /dev/null +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.sol @@ -0,0 +1,98 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { console2 } from "forge-std/console2.sol"; +import { StdStyle } from "forge-std/StdStyle.sol"; +import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; +import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; +import { IMainchainGatewayV3 } from "@ronin/contracts/interfaces/IMainchainGatewayV3.sol"; +import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; +import { LibTokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; +import { Contract } from "../utils/Contract.sol"; +import { Network } from "../utils/Network.sol"; +import { Contract } from "../utils/Contract.sol"; +import { IGeneralConfigExtended } from "../IGeneralConfigExtended.sol"; +import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; +import "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; +import "@ronin/contracts/mainchain/MainchainGatewayV3.sol"; +import "@ronin/contracts/libraries/Proposal.sol"; +import "@ronin/contracts/libraries/Ballot.sol"; + +import { MockSLP } from "@ronin/contracts/mocks/token/MockSLP.sol"; +import { SLPDeploy } from "@ronin/script/contracts/token/SLPDeploy.s.sol"; +import { MainchainBridgeAdminUtils } from "test/helpers/MainchainBridgeAdminUtils.t.sol"; +import "@ronin/script/contracts/RoninBridgeManagerDeploy.s.sol"; + +import "../BridgeMigration.sol"; + +contract Migration__20240409_P2_UpgradeBridgeRoninchain is BridgeMigration { + ISharedArgument.SharedParameter _param; + RoninBridgeManager _currRoninBridgeManager; + RoninBridgeManager _newRoninBridgeManager; + + address private _governor; + + + function setUp() public override { + super.setUp(); + } + + function run() public onlyOn(DefaultNetwork.RoninTestnet.key()) { + _governor = 0xd24D87DDc1917165435b306aAC68D99e0F49A3Fa; + _newRoninBridgeManager = RoninBridgeManager(address(0xdeadbeef)); // TODO: fulfill here + _currRoninBridgeManager = RoninBridgeManager(_config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); + + address bridgeRewardLogic = _deployLogic(Contract.BridgeReward.key()); + address bridgeSlashLogic = _deployLogic(Contract.BridgeSlash.key()); + address bridgeTrackingLogic = _deployLogic(Contract.BridgeTracking.key()); + address pauseEnforcerLogic = _deployLogic(Contract.RoninPauseEnforcer.key()); + address roninGatewayV3Logic = _deployLogic(Contract.RoninGatewayV3.key()); + + address bridgeRewardProxy = _config.getAddressFromCurrentNetwork(Contract.BridgeReward.key()); + address bridgeSlashProxy = _config.getAddressFromCurrentNetwork(Contract.BridgeSlash.key()); + address bridgeTrackingProxy = _config.getAddressFromCurrentNetwork(Contract.BridgeTracking.key()); + address pauseEnforcerProxy = _config.getAddressFromCurrentNetwork(Contract.RoninPauseEnforcer.key()); + address roninGatewayV3Proxy = _config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); + + uint256 expiredTime = block.timestamp + 14 days; + uint N = 10; + address[] memory targets = new address[](N); + uint256[] memory values = new uint256[](N); + bytes[] memory calldatas = new bytes[](N); + uint256[] memory gasAmounts = new uint256[](N); + + targets[0] = bridgeRewardProxy; + targets[1] = bridgeSlashProxy; + targets[2] = bridgeTrackingProxy; + targets[3] = pauseEnforcerProxy; + targets[4] = roninGatewayV3Proxy; + targets[5] = bridgeRewardProxy; + targets[6] = bridgeSlashProxy; + targets[7] = bridgeTrackingProxy; + targets[8] = pauseEnforcerProxy; + targets[9] = roninGatewayV3Proxy; + + calldatas[0] = abi.encodeWithSignature("upgradeTo(address)", bridgeRewardLogic); + calldatas[1] = abi.encodeWithSignature("upgradeTo(address)", bridgeSlashLogic); + calldatas[2] = abi.encodeWithSignature("upgradeTo(address)", bridgeTrackingLogic); + calldatas[3] = abi.encodeWithSignature("upgradeTo(address)", pauseEnforcerLogic); + calldatas[4] = abi.encodeWithSignature("upgradeTo(address)", roninGatewayV3Logic); + calldatas[5] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); + calldatas[6] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); + calldatas[7] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); + calldatas[8] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); + calldatas[9] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); + + for (uint i; i < N; ++i) { + gasAmounts[i] = 1_000_000; + } + + vm.broadcast(_governor); + address(_currRoninBridgeManager).call( + abi.encodeWithSignature( + "propose(uint256,uint256,address[],uint256[],bytes[],uint256[])", + block.chainid, expiredTime, targets, values, calldatas, gasAmounts + ) + ); + } +} From bdccbf3d76426576ba912c81e92390248fc82128 Mon Sep 17 00:00:00 2001 From: TuDo1403 Date: Thu, 11 Apr 2024 17:11:28 +0700 Subject: [PATCH 144/180] script: fix wrong artifact name --- script/utils/Contract.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/utils/Contract.sol b/script/utils/Contract.sol index da40fefa..717e9d1b 100644 --- a/script/utils/Contract.sol +++ b/script/utils/Contract.sol @@ -43,12 +43,12 @@ function name(Contract contractEnum) pure returns (string memory) { if (contractEnum == Contract.BridgeTracking) return "BridgeTracking"; if (contractEnum == Contract.BridgeSlash) return "BridgeSlash"; if (contractEnum == Contract.BridgeReward) return "BridgeReward"; - if (contractEnum == Contract.RoninPauseEnforcer) return "PauseEnforcer"; + if (contractEnum == Contract.RoninPauseEnforcer) return "RoninGatewayPauseEnforcer"; if (contractEnum == Contract.RoninGatewayV3) return "RoninGatewayV3"; if (contractEnum == Contract.RoninBridgeManager) return "RoninBridgeManager"; if (contractEnum == Contract.RoninBridgeManagerConstructor) return "RoninBridgeManagerConstructor"; - if (contractEnum == Contract.MainchainPauseEnforcer) return "PauseEnforcer"; + if (contractEnum == Contract.MainchainPauseEnforcer) return "MainchainGatewayPauseEnforcer"; if (contractEnum == Contract.MainchainGatewayV3) return "MainchainGatewayV3"; if (contractEnum == Contract.MainchainGatewayBatcher) return "MainchainGatewayBatcher"; if (contractEnum == Contract.MainchainBridgeManager) return "MainchainBridgeManager"; From 35227f206d56f92a7219d114d66dcc8b7ce9a4b1 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Thu, 11 Apr 2024 23:15:28 +0700 Subject: [PATCH 145/180] script: upgrade ronin chain script --- .../20240411-helper.s.sol | 51 +++++++++ ...20240411-p2-upgrade-bridge-ronin-chain.sol | 107 ++++++++++++++---- 2 files changed, 133 insertions(+), 25 deletions(-) create mode 100644 script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol new file mode 100644 index 00000000..bdd7bf17 --- /dev/null +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { Ballot } from "@ronin/contracts/libraries/Ballot.sol"; +import "../BridgeMigration.sol"; + +struct LegacyProposalDetail { + uint256 nonce; + uint256 chainId; + uint256 expiryTimestamp; + address[] targets; + uint256[] values; + bytes[] calldatas; + uint256[] gasAmounts; +} + +contract Migration__20240409_Helper is BridgeMigration { + address internal _governor; + address[] internal _voters; + + RoninBridgeManager internal _currRoninBridgeManager; + RoninBridgeManager internal _newRoninBridgeManager; + + function _helperProposeForCurrentNetwork(LegacyProposalDetail memory proposal) internal { + vm.broadcast(_governor); + address(_currRoninBridgeManager).call( + abi.encodeWithSignature( + "proposeProposalForCurrentNetwork(uint256,address[],uint256[],bytes[],uint256[],uint8)", + // proposal.chainId, + proposal.expiryTimestamp, + proposal.targets, + proposal.values, + proposal.calldatas, + proposal.gasAmounts, + Ballot.VoteType.For + ) + ); + } + + function _helperVoteForCurrentNetwork(LegacyProposalDetail memory proposal) internal { + for (uint i; i < _voters.length; ++i) { + vm.broadcast(_voters[i]); + address(_currRoninBridgeManager).call( + abi.encodeWithSignature( + "castProposalVoteForCurrentNetwork((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8)", + proposal, Ballot.VoteType.For + ) + ); + } + } +} \ No newline at end of file diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.sol index 394a3193..f6242d06 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.sol @@ -23,25 +23,78 @@ import { SLPDeploy } from "@ronin/script/contracts/token/SLPDeploy.s.sol"; import { MainchainBridgeAdminUtils } from "test/helpers/MainchainBridgeAdminUtils.t.sol"; import "@ronin/script/contracts/RoninBridgeManagerDeploy.s.sol"; -import "../BridgeMigration.sol"; +import "./20240411-helper.s.sol"; -contract Migration__20240409_P2_UpgradeBridgeRoninchain is BridgeMigration { +contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_Helper { ISharedArgument.SharedParameter _param; - RoninBridgeManager _currRoninBridgeManager; - RoninBridgeManager _newRoninBridgeManager; - - address private _governor; - function setUp() public override { super.setUp(); - } - function run() public onlyOn(DefaultNetwork.RoninTestnet.key()) { _governor = 0xd24D87DDc1917165435b306aAC68D99e0F49A3Fa; + _voters.push(0xb033ba62EC622dC54D0ABFE0254e79692147CA26); + _voters.push(0x087D08e3ba42e64E3948962dd1371F906D1278b9); + _voters.push(0x52ec2e6BBcE45AfFF8955Da6410bb13812F4289F); + _newRoninBridgeManager = RoninBridgeManager(address(0xdeadbeef)); // TODO: fulfill here _currRoninBridgeManager = RoninBridgeManager(_config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); + } + + function run() public onlyOn(DefaultNetwork.RoninTestnet.key()) { + _changeAdminOfEnforcer(); + _upgradeBridge(); + } + + function _changeAdminOfEnforcer() internal { + RoninBridgeManager roninGA = RoninBridgeManager(0x53Ea388CB72081A3a397114a43741e7987815896); + address pauseEnforcerProxy = _config.getAddressFromCurrentNetwork(Contract.RoninPauseEnforcer.key()); + + uint256 expiredTime = block.timestamp + 14 days; + uint N = 1; + address[] memory targets = new address[](N); + uint256[] memory values = new uint256[](N); + bytes[] memory calldatas = new bytes[](N); + uint256[] memory gasAmounts = new uint256[](N); + + targets[0] = pauseEnforcerProxy; + calldatas[0] = abi.encodeWithSignature("changeAdmin(address)", address(_currRoninBridgeManager)); + gasAmounts[0] = 1_000_000; + + LegacyProposalDetail memory proposal; + proposal.nonce = roninGA.round(block.chainid) + 1; + proposal.chainId = block.chainid; + proposal.expiryTimestamp = expiredTime; + proposal.targets = targets; + proposal.values = values; + proposal.calldatas = calldatas; + proposal.gasAmounts = gasAmounts; + + vm.broadcast(_governor); + address(roninGA).call( + abi.encodeWithSignature( + "proposeProposalForCurrentNetwork(uint256,address[],uint256[],bytes[],uint256[],uint8)", + // proposal.chainId, + proposal.expiryTimestamp, + proposal.targets, + proposal.values, + proposal.calldatas, + proposal.gasAmounts, + Ballot.VoteType.For + ) + ); + for (uint i; i < _voters.length; ++i) { + vm.broadcast(_voters[i]); + address(roninGA).call( + abi.encodeWithSignature( + "castProposalVoteForCurrentNetwork((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8)", + proposal, Ballot.VoteType.For + ) + ); + } + } + + function _upgradeBridge() internal { address bridgeRewardLogic = _deployLogic(Contract.BridgeReward.key()); address bridgeSlashLogic = _deployLogic(Contract.BridgeSlash.key()); address bridgeTrackingLogic = _deployLogic(Contract.BridgeTracking.key()); @@ -64,35 +117,39 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is BridgeMigration { targets[0] = bridgeRewardProxy; targets[1] = bridgeSlashProxy; targets[2] = bridgeTrackingProxy; - targets[3] = pauseEnforcerProxy; - targets[4] = roninGatewayV3Proxy; - targets[5] = bridgeRewardProxy; - targets[6] = bridgeSlashProxy; - targets[7] = bridgeTrackingProxy; + targets[3] = roninGatewayV3Proxy; + targets[4] = bridgeRewardProxy; + targets[5] = bridgeSlashProxy; + targets[6] = bridgeTrackingProxy; + targets[7] = roninGatewayV3Proxy; targets[8] = pauseEnforcerProxy; - targets[9] = roninGatewayV3Proxy; + targets[9] = pauseEnforcerProxy; calldatas[0] = abi.encodeWithSignature("upgradeTo(address)", bridgeRewardLogic); calldatas[1] = abi.encodeWithSignature("upgradeTo(address)", bridgeSlashLogic); calldatas[2] = abi.encodeWithSignature("upgradeTo(address)", bridgeTrackingLogic); - calldatas[3] = abi.encodeWithSignature("upgradeTo(address)", pauseEnforcerLogic); - calldatas[4] = abi.encodeWithSignature("upgradeTo(address)", roninGatewayV3Logic); + calldatas[3] = abi.encodeWithSignature("upgradeTo(address)", roninGatewayV3Logic); + calldatas[4] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); calldatas[5] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); calldatas[6] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); calldatas[7] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); - calldatas[8] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); + calldatas[8] = abi.encodeWithSignature("upgradeTo(address)", pauseEnforcerLogic); calldatas[9] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); for (uint i; i < N; ++i) { gasAmounts[i] = 1_000_000; } - vm.broadcast(_governor); - address(_currRoninBridgeManager).call( - abi.encodeWithSignature( - "propose(uint256,uint256,address[],uint256[],bytes[],uint256[])", - block.chainid, expiredTime, targets, values, calldatas, gasAmounts - ) - ); + LegacyProposalDetail memory proposal; + proposal.nonce = _currRoninBridgeManager.round(block.chainid) + 1; + proposal.chainId = block.chainid; + proposal.expiryTimestamp = expiredTime; + proposal.targets = targets; + proposal.values = values; + proposal.calldatas = calldatas; + proposal.gasAmounts = gasAmounts; + + _helperProposeForCurrentNetwork(proposal); + _helperVoteForCurrentNetwork(proposal); } } From cc993856f96f59494aae9883cd6fa4bdac100fd5 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Fri, 12 Apr 2024 01:13:06 +0700 Subject: [PATCH 146/180] fix(GlobalProposal): add enforcer to option --- src/libraries/GlobalProposal.sol | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libraries/GlobalProposal.sol b/src/libraries/GlobalProposal.sol index 377f189e..bb312eb0 100644 --- a/src/libraries/GlobalProposal.sol +++ b/src/libraries/GlobalProposal.sol @@ -14,7 +14,8 @@ library GlobalProposal { GatewayContract, // 1 BridgeReward, // 2 BridgeSlash, // 3 - BridgeTracking // 4 + BridgeTracking, // 4 + PauseEnforcer // 5 } From 12d9e0498cfb82ced027fd0dc4f7bb1c0d64785c Mon Sep 17 00:00:00 2001 From: nxqbao Date: Fri, 12 Apr 2024 01:13:18 +0700 Subject: [PATCH 147/180] script: add mainchain script --- .gitignore | 3 +- ...> MainchainGatewayPauseEnforcerLogic.json} | 0 ...> MainchainGatewayPauseEnforcerProxy.json} | 0 .../20240411-operators-key-template.s.sol | 10 + ...0240411-p1-deploy-ronin-bridge-manager.sol | 4 +- ...0240411-p3-upgrade-bridge-main-chain.s.sol | 266 ++++++++++++++++++ 6 files changed, 281 insertions(+), 2 deletions(-) rename deployments/sepolia/{PauseEnforcerLogic.json => MainchainGatewayPauseEnforcerLogic.json} (100%) rename deployments/sepolia/{PauseEnforcerProxy.json => MainchainGatewayPauseEnforcerProxy.json} (100%) create mode 100644 script/20240411-upgrade-v3.2.0-testnet/20240411-operators-key-template.s.sol create mode 100644 script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol diff --git a/.gitignore b/.gitignore index 8d1a2418..5d7d5663 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ remix-compiler.config.js out .DS_Store -dry-run/ \ No newline at end of file +dry-run/ +20240411-operators-key.s.sol \ No newline at end of file diff --git a/deployments/sepolia/PauseEnforcerLogic.json b/deployments/sepolia/MainchainGatewayPauseEnforcerLogic.json similarity index 100% rename from deployments/sepolia/PauseEnforcerLogic.json rename to deployments/sepolia/MainchainGatewayPauseEnforcerLogic.json diff --git a/deployments/sepolia/PauseEnforcerProxy.json b/deployments/sepolia/MainchainGatewayPauseEnforcerProxy.json similarity index 100% rename from deployments/sepolia/PauseEnforcerProxy.json rename to deployments/sepolia/MainchainGatewayPauseEnforcerProxy.json diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-operators-key-template.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-operators-key-template.s.sol new file mode 100644 index 00000000..c0e969dc --- /dev/null +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-operators-key-template.s.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +contract Migration__20240409_GovernorsKey { + function _loadGovernorPKs() pure internal returns (uint256[] memory res) { + res = new uint256[](1); + + res[0] = 0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef; + } +} \ No newline at end of file diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.sol index 05b000a3..bcbb98ea 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.sol @@ -59,17 +59,19 @@ contract Migration__20240409_P1_DeployRoninBridgeManager is BridgeMigration { param.roninBridgeManager.voteWeights[2] = 100; param.roninBridgeManager.voteWeights[3] = 100; - param.roninBridgeManager.targetOptions = new GlobalProposal.TargetOption[](4); + param.roninBridgeManager.targetOptions = new GlobalProposal.TargetOption[](5); param.roninBridgeManager.targetOptions[0] = GlobalProposal.TargetOption.GatewayContract; param.roninBridgeManager.targetOptions[1] = GlobalProposal.TargetOption.BridgeReward; param.roninBridgeManager.targetOptions[2] = GlobalProposal.TargetOption.BridgeSlash; param.roninBridgeManager.targetOptions[3] = GlobalProposal.TargetOption.BridgeTracking; + param.roninBridgeManager.targetOptions[4] = GlobalProposal.TargetOption.PauseEnforcer; param.roninBridgeManager.targets = new address[](4); param.roninBridgeManager.targets[0] = _config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); param.roninBridgeManager.targets[1] = _config.getAddressFromCurrentNetwork(Contract.BridgeReward.key()); param.roninBridgeManager.targets[2] = _config.getAddressFromCurrentNetwork(Contract.BridgeSlash.key()); param.roninBridgeManager.targets[3] = _config.getAddressFromCurrentNetwork(Contract.BridgeTracking.key()); + param.roninBridgeManager.targets[4] = _config.getAddressFromCurrentNetwork(Contract.RoninPauseEnforcer.key()); _newRoninBridgeManager = RoninBridgeManager(new RoninBridgeManagerDeploy().overrideArgs( abi.encodeCall( diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol new file mode 100644 index 00000000..e9a6c5d1 --- /dev/null +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol @@ -0,0 +1,266 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { console2 } from "forge-std/console2.sol"; +import { StdStyle } from "forge-std/StdStyle.sol"; +import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; +import { MainchainBridgeManager } from "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; +import { IMainchainGatewayV3 } from "@ronin/contracts/interfaces/IMainchainGatewayV3.sol"; +import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; +import { LibTokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; +import { Contract } from "../utils/Contract.sol"; +import { Network } from "../utils/Network.sol"; +import { Contract } from "../utils/Contract.sol"; +import { IGeneralConfigExtended } from "../IGeneralConfigExtended.sol"; +import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; +import "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; +import "@ronin/contracts/mainchain/MainchainGatewayV3.sol"; +import "@ronin/contracts/libraries/Proposal.sol"; +import "@ronin/contracts/libraries/Ballot.sol"; + +import { DefaultContract } from "foundry-deployment-kit/utils/DefaultContract.sol"; +import { MockSLP } from "@ronin/contracts/mocks/token/MockSLP.sol"; +import { SLPDeploy } from "@ronin/script/contracts/token/SLPDeploy.s.sol"; +import { MainchainBridgeAdminUtils } from "test/helpers/MainchainBridgeAdminUtils.t.sol"; +import "@ronin/script/contracts/MainchainBridgeManagerDeploy.s.sol"; +import "@ronin/script/contracts/MainchainWethUnwrapperDeploy.s.sol"; + +import "./20240411-operators-key.s.sol"; +import "../BridgeMigration.sol"; + +struct LegacyProposalDetail { + uint256 nonce; + uint256 chainId; + uint256 expiryTimestamp; + address[] targets; + uint256[] values; + bytes[] calldatas; + uint256[] gasAmounts; +} + +contract Migration__20240409_P3_UpgradeBridgeMainchain is BridgeMigration, Migration__20240409_GovernorsKey { + ISharedArgument.SharedParameter _param; + MainchainBridgeManager _currMainchainBridgeManager; + MainchainBridgeManager _newMainchainBridgeManager; + + address private _governor; + address[] private _voters; + + address PROXY_ADMIN = 0x968D0Cd7343f711216817E617d3f92a23dC91c07; + + + function setUp() public override { + super.setUp(); + CONFIG.setAddress(network(), DefaultContract.ProxyAdmin.key(), PROXY_ADMIN); + + _currMainchainBridgeManager = MainchainBridgeManager(_config.getAddressFromCurrentNetwork(Contract.MainchainBridgeManager.key())); + } + + function run() public onlyOn(Network.Sepolia.key()) { + _governor = 0xd24D87DDc1917165435b306aAC68D99e0F49A3Fa; + _voters.push(0xb033ba62EC622dC54D0ABFE0254e79692147CA26); + _voters.push(0x087D08e3ba42e64E3948962dd1371F906D1278b9); + _voters.push(0x52ec2e6BBcE45AfFF8955Da6410bb13812F4289F); + + _changeTempAdmin(); + _deployMainchainBridgeManager(); + _upgradeBridge(); + } + + function _changeTempAdmin() internal { + address pauseEnforcerProxy = _config.getAddressFromCurrentNetwork(Contract.MainchainPauseEnforcer.key()); + address mainchainGatewayV3Proxy = _config.getAddressFromCurrentNetwork(Contract.MainchainGatewayV3.key()); + + vm.startBroadcast(0x968D0Cd7343f711216817E617d3f92a23dC91c07); + address(pauseEnforcerProxy).call(abi.encodeWithSignature("changeAdmin(address)", _currMainchainBridgeManager)); + address(mainchainGatewayV3Proxy).call(abi.encodeWithSignature("changeAdmin(address)", _currMainchainBridgeManager)); + vm.stopBroadcast(); + } + + function _upgradeBridge() internal { + _newMainchainBridgeManager = new MainchainBridgeManagerDeploy().run(); + + address weth = _config.getAddressFromCurrentNetwork(Contract.WETH.key()); + address wethUnwrapper = new MainchainWethUnwrapperDeploy().overrideArgs(abi.encode(weth)).run(); + + address pauseEnforcerLogic = _deployLogic(Contract.MainchainPauseEnforcer.key()); + address mainchainGatewayV3Logic = _deployLogic(Contract.MainchainGatewayV3.key()); + + address pauseEnforcerProxy = _config.getAddressFromCurrentNetwork(Contract.MainchainPauseEnforcer.key()); + address mainchainGatewayV3Proxy = _config.getAddressFromCurrentNetwork(Contract.MainchainGatewayV3.key()); + + uint256 expiredTime = block.timestamp + 14 days; + uint N = 4; + address[] memory targets = new address[](N); + uint256[] memory values = new uint256[](N); + bytes[] memory calldatas = new bytes[](N); + uint256[] memory gasAmounts = new uint256[](N); + + targets[0] = mainchainGatewayV3Proxy; + targets[1] = mainchainGatewayV3Proxy; + targets[2] = pauseEnforcerProxy; + targets[3] = pauseEnforcerProxy; + + calldatas[0] = abi.encodeWithSignature( + "upgradeToAndCall(address,bytes)", + mainchainGatewayV3Logic, + abi.encodeWithSelector(MainchainGatewayV3.initializeV4.selector, wethUnwrapper) + ); + calldatas[1] = abi.encodeWithSignature("changeAdmin(address)", address(_newMainchainBridgeManager)); + calldatas[2] = abi.encodeWithSignature("upgradeTo(address)", pauseEnforcerLogic); + calldatas[3] = abi.encodeWithSignature("changeAdmin(address)", address(_newMainchainBridgeManager)); + + for (uint i; i < N; ++i) { + gasAmounts[i] = 1_000_000; + } + + LegacyProposalDetail memory proposal; + proposal.nonce = _currMainchainBridgeManager.round(block.chainid) + 1; + proposal.chainId = block.chainid; + proposal.expiryTimestamp = expiredTime; + proposal.targets = targets; + proposal.values = values; + proposal.calldatas = calldatas; + proposal.gasAmounts = gasAmounts; + + uint V = _voters.length + 1; + Ballot.VoteType[] memory supports_ = new Ballot.VoteType[](V); + for (uint i; i < V; ++i) { + supports_[i] = Ballot.VoteType.For; + } + + SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor( + getDomain(), + hashLegacyProposal(proposal), + _loadGovernorPKs(), + Ballot.VoteType.For + ); + + vm.broadcast(_governor); + address(_currMainchainBridgeManager).call( + abi.encodeWithSignature( + "relayProposal((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])", + proposal, + supports_, + signatures + ) + ); + } + + function getDomain() pure public returns (bytes32) { + return keccak256( + abi.encode( + keccak256("EIP712Domain(string name,string version,bytes32 salt)"), + keccak256("BridgeAdmin"), // name hash + keccak256("2"), // version hash + keccak256(abi.encode("BRIDGE_ADMIN", 2021)) // salt + ) + ); + } + + function _generateSignaturesFor( + bytes32 domain, + bytes32 proposalHash, + uint256[] memory signerPKs, + Ballot.VoteType support + ) public view returns (SignatureConsumer.Signature[] memory sigs) { + sigs = new SignatureConsumer.Signature[](signerPKs.length); + + for (uint256 i; i < signerPKs.length; i++) { + bytes32 digest = ECDSA.toTypedDataHash(domain, Ballot.hash(proposalHash, support)); + sigs[i] = _sign(signerPKs[i], digest); + } + } + + function _sign(uint256 pk, bytes32 digest) internal pure returns (SignatureConsumer.Signature memory sig) { + (uint8 v, bytes32 r, bytes32 s) = vm.sign(pk, digest); + sig.v = v; + sig.r = r; + sig.s = s; + } + + function hashLegacyProposal(LegacyProposalDetail memory proposal) pure public returns (bytes32 digest_) { + bytes32 TYPE_HASH = 0xd051578048e6ff0bbc9fca3b65a42088dbde10f36ca841de566711087ad9b08a; + + uint256[] memory values = proposal.values; + address[] memory targets = proposal.targets; + bytes32[] memory calldataHashList = new bytes32[](proposal.calldatas.length); + uint256[] memory gasAmounts = proposal.gasAmounts; + + for (uint256 i; i < calldataHashList.length; ++i) { + calldataHashList[i] = keccak256(proposal.calldatas[i]); + } + + assembly { + let ptr := mload(0x40) + mstore(ptr, TYPE_HASH) + mstore(add(ptr, 0x20), mload(proposal)) // _proposal.nonce + mstore(add(ptr, 0x40), mload(add(proposal, 0x20))) // _proposal.chainId + mstore(add(ptr, 0x60), mload(add(proposal, 0x40))) // expiry timestamp + + let arrayHashed + arrayHashed := keccak256(add(targets, 32), mul(mload(targets), 32)) // targetsHash + mstore(add(ptr, 0x80), arrayHashed) + arrayHashed := keccak256(add(values, 32), mul(mload(values), 32)) // _valuesHash + mstore(add(ptr, 0xa0), arrayHashed) + arrayHashed := keccak256(add(calldataHashList, 32), mul(mload(calldataHashList), 32)) // _calldatasHash + mstore(add(ptr, 0xc0), arrayHashed) + arrayHashed := keccak256(add(gasAmounts, 32), mul(mload(gasAmounts), 32)) // _gasAmountsHash + mstore(add(ptr, 0xe0), arrayHashed) + digest_ := keccak256(ptr, 0x100) + } + } + + function _deployMainchainBridgeManager() internal returns (address mainchainBM) { + ISharedArgument.SharedParameter memory param; + + param.mainchainBridgeManager.num = 7; + param.mainchainBridgeManager.denom = 10; + param.mainchainBridgeManager.roninChainId = 2021; + param.mainchainBridgeManager.expiryDuration = 60 * 60 * 24 * 14; // 14 days + param.mainchainBridgeManager.bridgeContract = _config.getAddressFromCurrentNetwork(Contract.MainchainGatewayV3.key()); + param.mainchainBridgeManager.bridgeOperators = new address[](4); + param.mainchainBridgeManager.bridgeOperators[0] = 0x2e82D2b56f858f79DeeF11B160bFC4631873da2B; + param.mainchainBridgeManager.bridgeOperators[1] = 0xBcb61783dd2403FE8cC9B89B27B1A9Bb03d040Cb; + param.mainchainBridgeManager.bridgeOperators[2] = 0xB266Bf53Cf7EAc4E2065A404598DCB0E15E9462c; + param.mainchainBridgeManager.bridgeOperators[3] = 0xcc5Fc5B6c8595F56306Da736F6CD02eD9141C84A; + + param.mainchainBridgeManager.governors = new address[](4); + param.mainchainBridgeManager.governors[0] = 0xd24D87DDc1917165435b306aAC68D99e0F49A3Fa; + param.mainchainBridgeManager.governors[1] = 0xb033ba62EC622dC54D0ABFE0254e79692147CA26; + param.mainchainBridgeManager.governors[2] = 0x087D08e3ba42e64E3948962dd1371F906D1278b9; + param.mainchainBridgeManager.governors[3] = 0x52ec2e6BBcE45AfFF8955Da6410bb13812F4289F; + + param.mainchainBridgeManager.voteWeights = new uint96[](4); + param.mainchainBridgeManager.voteWeights[0] = 100; + param.mainchainBridgeManager.voteWeights[1] = 100; + param.mainchainBridgeManager.voteWeights[2] = 100; + param.mainchainBridgeManager.voteWeights[3] = 100; + + param.mainchainBridgeManager.targetOptions = new GlobalProposal.TargetOption[](2); + param.mainchainBridgeManager.targetOptions[0] = GlobalProposal.TargetOption.GatewayContract; + param.mainchainBridgeManager.targetOptions[1] = GlobalProposal.TargetOption.PauseEnforcer; + + param.mainchainBridgeManager.targets = new address[](2); + param.mainchainBridgeManager.targets[0] = _config.getAddressFromCurrentNetwork(Contract.MainchainGatewayV3.key()); + param.mainchainBridgeManager.targets[1] = _config.getAddressFromCurrentNetwork(Contract.MainchainPauseEnforcer.key()); + + _newMainchainBridgeManager = MainchainBridgeManager(new MainchainBridgeManagerDeploy().overrideArgs( + abi.encodeCall( + _newMainchainBridgeManager.initialize, + ( + param.mainchainBridgeManager.num, + param.mainchainBridgeManager.denom, + param.mainchainBridgeManager.roninChainId, + param.mainchainBridgeManager.bridgeContract, + param.mainchainBridgeManager.callbackRegisters, + param.mainchainBridgeManager.bridgeOperators, + param.mainchainBridgeManager.governors, + param.mainchainBridgeManager.voteWeights, + param.mainchainBridgeManager.targetOptions, + param.mainchainBridgeManager.targets + ) + ) + ).run()); + } +} From 896da0d78d40d7ec02776e005208f06cddf0210f Mon Sep 17 00:00:00 2001 From: nxqbao Date: Fri, 12 Apr 2024 01:13:40 +0700 Subject: [PATCH 148/180] script: rename --- ...-manager.sol => 20240411-p1-deploy-ronin-bridge-manager.s.sol} | 0 ...nin-chain.sol => 20240411-p2-upgrade-bridge-ronin-chain.s.sol} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename script/20240411-upgrade-v3.2.0-testnet/{20240411-p1-deploy-ronin-bridge-manager.sol => 20240411-p1-deploy-ronin-bridge-manager.s.sol} (100%) rename script/20240411-upgrade-v3.2.0-testnet/{20240411-p2-upgrade-bridge-ronin-chain.sol => 20240411-p2-upgrade-bridge-ronin-chain.s.sol} (100%) diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.s.sol similarity index 100% rename from script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.sol rename to script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.s.sol diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol similarity index 100% rename from script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.sol rename to script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol From cae8efdf7ab5a584026853b1fafdc8b2c5c59577 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Fri, 12 Apr 2024 10:54:44 +0700 Subject: [PATCH 149/180] nit: forge fmt --- .../20240411-helper.s.sol | 19 +++--- .../20240411-operators-key-template.s.sol | 4 +- ...40411-p1-deploy-ronin-bridge-manager.s.sol | 38 ++++++------ ...240411-p2-upgrade-bridge-ronin-chain.s.sol | 21 ++++--- ...0240411-p3-upgrade-bridge-main-chain.s.sol | 59 ++++++++----------- 5 files changed, 66 insertions(+), 75 deletions(-) diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol index bdd7bf17..a1687040 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol @@ -26,13 +26,13 @@ contract Migration__20240409_Helper is BridgeMigration { address(_currRoninBridgeManager).call( abi.encodeWithSignature( "proposeProposalForCurrentNetwork(uint256,address[],uint256[],bytes[],uint256[],uint8)", - // proposal.chainId, - proposal.expiryTimestamp, - proposal.targets, - proposal.values, - proposal.calldatas, - proposal.gasAmounts, - Ballot.VoteType.For + // proposal.chainId, + proposal.expiryTimestamp, + proposal.targets, + proposal.values, + proposal.calldatas, + proposal.gasAmounts, + Ballot.VoteType.For ) ); } @@ -42,10 +42,9 @@ contract Migration__20240409_Helper is BridgeMigration { vm.broadcast(_voters[i]); address(_currRoninBridgeManager).call( abi.encodeWithSignature( - "castProposalVoteForCurrentNetwork((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8)", - proposal, Ballot.VoteType.For + "castProposalVoteForCurrentNetwork((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8)", proposal, Ballot.VoteType.For ) ); } } -} \ No newline at end of file +} diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-operators-key-template.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-operators-key-template.s.sol index c0e969dc..3381acfb 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-operators-key-template.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-operators-key-template.s.sol @@ -2,9 +2,9 @@ pragma solidity ^0.8.19; contract Migration__20240409_GovernorsKey { - function _loadGovernorPKs() pure internal returns (uint256[] memory res) { + function _loadGovernorPKs() internal pure returns (uint256[] memory res) { res = new uint256[](1); res[0] = 0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef; } -} \ No newline at end of file +} diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.s.sol index bcbb98ea..63bdc784 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.s.sol @@ -33,7 +33,7 @@ contract Migration__20240409_P1_DeployRoninBridgeManager is BridgeMigration { super.setUp(); } - function run() public onlyOn(DefaultNetwork.RoninTestnet.key()) { + function run() public onlyOn(DefaultNetwork.RoninTestnet.key()) { ISharedArgument.SharedParameter memory param; param.roninBridgeManager.num = 7; @@ -73,23 +73,25 @@ contract Migration__20240409_P1_DeployRoninBridgeManager is BridgeMigration { param.roninBridgeManager.targets[3] = _config.getAddressFromCurrentNetwork(Contract.BridgeTracking.key()); param.roninBridgeManager.targets[4] = _config.getAddressFromCurrentNetwork(Contract.RoninPauseEnforcer.key()); - _newRoninBridgeManager = RoninBridgeManager(new RoninBridgeManagerDeploy().overrideArgs( - abi.encodeCall( - RoninBridgeManagerConstructor.initialize, - ( - param.roninBridgeManager.num, - param.roninBridgeManager.denom, - param.roninBridgeManager.roninChainId, - param.roninBridgeManager.expiryDuration, - param.roninBridgeManager.bridgeContract, - param.roninBridgeManager.callbackRegisters, - param.roninBridgeManager.bridgeOperators, - param.roninBridgeManager.governors, - param.roninBridgeManager.voteWeights, - param.roninBridgeManager.targetOptions, - param.roninBridgeManager.targets + _newRoninBridgeManager = RoninBridgeManager( + new RoninBridgeManagerDeploy().overrideArgs( + abi.encodeCall( + RoninBridgeManagerConstructor.initialize, + ( + param.roninBridgeManager.num, + param.roninBridgeManager.denom, + param.roninBridgeManager.roninChainId, + param.roninBridgeManager.expiryDuration, + param.roninBridgeManager.bridgeContract, + param.roninBridgeManager.callbackRegisters, + param.roninBridgeManager.bridgeOperators, + param.roninBridgeManager.governors, + param.roninBridgeManager.voteWeights, + param.roninBridgeManager.targetOptions, + param.roninBridgeManager.targets + ) ) - ) - ).run()); + ).run() + ); } } diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol index f6242d06..7444852e 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol @@ -61,7 +61,7 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H gasAmounts[0] = 1_000_000; LegacyProposalDetail memory proposal; - proposal.nonce = roninGA.round(block.chainid) + 1; + proposal.nonce = roninGA.round(block.chainid) + 1; proposal.chainId = block.chainid; proposal.expiryTimestamp = expiredTime; proposal.targets = targets; @@ -73,13 +73,13 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H address(roninGA).call( abi.encodeWithSignature( "proposeProposalForCurrentNetwork(uint256,address[],uint256[],bytes[],uint256[],uint8)", - // proposal.chainId, - proposal.expiryTimestamp, - proposal.targets, - proposal.values, - proposal.calldatas, - proposal.gasAmounts, - Ballot.VoteType.For + // proposal.chainId, + proposal.expiryTimestamp, + proposal.targets, + proposal.values, + proposal.calldatas, + proposal.gasAmounts, + Ballot.VoteType.For ) ); @@ -87,8 +87,7 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H vm.broadcast(_voters[i]); address(roninGA).call( abi.encodeWithSignature( - "castProposalVoteForCurrentNetwork((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8)", - proposal, Ballot.VoteType.For + "castProposalVoteForCurrentNetwork((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8)", proposal, Ballot.VoteType.For ) ); } @@ -141,7 +140,7 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H } LegacyProposalDetail memory proposal; - proposal.nonce = _currRoninBridgeManager.round(block.chainid) + 1; + proposal.nonce = _currRoninBridgeManager.round(block.chainid) + 1; proposal.chainId = block.chainid; proposal.expiryTimestamp = expiredTime; proposal.targets = targets; diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol index e9a6c5d1..2bb4c081 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol @@ -48,7 +48,6 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is BridgeMigration, Migra address PROXY_ADMIN = 0x968D0Cd7343f711216817E617d3f92a23dC91c07; - function setUp() public override { super.setUp(); CONFIG.setAddress(network(), DefaultContract.ProxyAdmin.key(), PROXY_ADMIN); @@ -102,9 +101,7 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is BridgeMigration, Migra targets[3] = pauseEnforcerProxy; calldatas[0] = abi.encodeWithSignature( - "upgradeToAndCall(address,bytes)", - mainchainGatewayV3Logic, - abi.encodeWithSelector(MainchainGatewayV3.initializeV4.selector, wethUnwrapper) + "upgradeToAndCall(address,bytes)", mainchainGatewayV3Logic, abi.encodeWithSelector(MainchainGatewayV3.initializeV4.selector, wethUnwrapper) ); calldatas[1] = abi.encodeWithSignature("changeAdmin(address)", address(_newMainchainBridgeManager)); calldatas[2] = abi.encodeWithSignature("upgradeTo(address)", pauseEnforcerLogic); @@ -115,7 +112,7 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is BridgeMigration, Migra } LegacyProposalDetail memory proposal; - proposal.nonce = _currMainchainBridgeManager.round(block.chainid) + 1; + proposal.nonce = _currMainchainBridgeManager.round(block.chainid) + 1; proposal.chainId = block.chainid; proposal.expiryTimestamp = expiredTime; proposal.targets = targets; @@ -129,25 +126,17 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is BridgeMigration, Migra supports_[i] = Ballot.VoteType.For; } - SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor( - getDomain(), - hashLegacyProposal(proposal), - _loadGovernorPKs(), - Ballot.VoteType.For - ); + SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(getDomain(), hashLegacyProposal(proposal), _loadGovernorPKs(), Ballot.VoteType.For); vm.broadcast(_governor); address(_currMainchainBridgeManager).call( abi.encodeWithSignature( - "relayProposal((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])", - proposal, - supports_, - signatures + "relayProposal((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])", proposal, supports_, signatures ) ); - } + } - function getDomain() pure public returns (bytes32) { + function getDomain() public pure returns (bytes32) { return keccak256( abi.encode( keccak256("EIP712Domain(string name,string version,bytes32 salt)"), @@ -179,7 +168,7 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is BridgeMigration, Migra sig.s = s; } - function hashLegacyProposal(LegacyProposalDetail memory proposal) pure public returns (bytes32 digest_) { + function hashLegacyProposal(LegacyProposalDetail memory proposal) public pure returns (bytes32 digest_) { bytes32 TYPE_HASH = 0xd051578048e6ff0bbc9fca3b65a42088dbde10f36ca841de566711087ad9b08a; uint256[] memory values = proposal.values; @@ -245,22 +234,24 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is BridgeMigration, Migra param.mainchainBridgeManager.targets[0] = _config.getAddressFromCurrentNetwork(Contract.MainchainGatewayV3.key()); param.mainchainBridgeManager.targets[1] = _config.getAddressFromCurrentNetwork(Contract.MainchainPauseEnforcer.key()); - _newMainchainBridgeManager = MainchainBridgeManager(new MainchainBridgeManagerDeploy().overrideArgs( - abi.encodeCall( - _newMainchainBridgeManager.initialize, - ( - param.mainchainBridgeManager.num, - param.mainchainBridgeManager.denom, - param.mainchainBridgeManager.roninChainId, - param.mainchainBridgeManager.bridgeContract, - param.mainchainBridgeManager.callbackRegisters, - param.mainchainBridgeManager.bridgeOperators, - param.mainchainBridgeManager.governors, - param.mainchainBridgeManager.voteWeights, - param.mainchainBridgeManager.targetOptions, - param.mainchainBridgeManager.targets + _newMainchainBridgeManager = MainchainBridgeManager( + new MainchainBridgeManagerDeploy().overrideArgs( + abi.encodeCall( + _newMainchainBridgeManager.initialize, + ( + param.mainchainBridgeManager.num, + param.mainchainBridgeManager.denom, + param.mainchainBridgeManager.roninChainId, + param.mainchainBridgeManager.bridgeContract, + param.mainchainBridgeManager.callbackRegisters, + param.mainchainBridgeManager.bridgeOperators, + param.mainchainBridgeManager.governors, + param.mainchainBridgeManager.voteWeights, + param.mainchainBridgeManager.targetOptions, + param.mainchainBridgeManager.targets + ) ) - ) - ).run()); + ).run() + ); } } From 7b6c49dd3ca79566b3f6b39978ba967a6e9156b6 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Fri, 12 Apr 2024 13:46:48 +0700 Subject: [PATCH 150/180] resolve conflict --- foundry.toml | 1 - .../20231218-maptoken-mainchain.s.sol | 2 +- .../20240115-maptoken-mainchain.s.sol | 2 +- .../20240115-maptoken-roninchain.s.sol | 2 +- .../20240131-maptoken-pixel-mainchain.s.sol | 2 +- .../20240131-maptoken-pixel-roninchain.s.sol | 2 +- .../20240206-maptoken-banana-mainchain.s.sol | 2 +- .../20240206-maptoken-banana-roninchain.s.sol | 10 +- .../20240405-maptoken-usdc-mainchain.s.sol | 6 +- .../20240409-maptoken-slp-mainchain.s.sol | 7 +- .../deploy-sepolia.s.sol | 8 +- .../20240411-helper.s.sol | 4 +- ...40411-p1-deploy-ronin-bridge-manager.s.sol | 19 +- ...240411-p2-upgrade-bridge-ronin-chain.s.sol | 17 +- ...0240411-p3-upgrade-bridge-main-chain.s.sol | 27 ++- script/GeneralConfig.sol | 24 +-- .../deploy-v0.3.1/01_Deploy_RoninBridge.s.sol | 182 +++++++++--------- .../02_Deploy_MainchainBridge.s.sol | 128 ++++++------ script/deploy-v0.3.1/Deploy.v0.3.1.s.sol | 86 ++++----- .../factory-maptoken-mainchain.s.sol | 21 +- .../factory-maptoken-roninchain.s.sol | 18 +- .../PostCheck_BridgeManager_Proposal.s.sol | 4 +- script/shared/libraries/LibProposal.sol | 4 +- 23 files changed, 282 insertions(+), 296 deletions(-) diff --git a/foundry.toml b/foundry.toml index a5d442c0..12025047 100644 --- a/foundry.toml +++ b/foundry.toml @@ -64,6 +64,5 @@ localhost = "http://localhost:8545" ethereum = "https://eth.llamarpc.com" sepolia = "https://sepolia.infura.io/v3/${INFURA_API_KEY}" goerli = "https://ethereum-goerli.publicnode.com" -sepolia = "https://sepolia.infura.io/v3/${INFURA_API_KEY}" ronin-mainnet = "https://api-partner.roninchain.com/rpc" ronin-testnet = "https://saigon-archive.roninchain.com/rpc" diff --git a/script/20231218-maptoken/20231218-maptoken-mainchain.s.sol b/script/20231218-maptoken/20231218-maptoken-mainchain.s.sol index 78f3f99e..88995814 100644 --- a/script/20231218-maptoken/20231218-maptoken-mainchain.s.sol +++ b/script/20231218-maptoken/20231218-maptoken-mainchain.s.sol @@ -86,6 +86,6 @@ contract Migration__20231215_MapTokenMainchain is Migration { config.switchTo(currentNetwork); vm.broadcast(sender()); - _roninBridgeManager.propose(companionChainId, expiredTime, targets, values, calldatas, gasAmounts); + _roninBridgeManager.propose(companionChainId, expiredTime, address(0), targets, values, calldatas, gasAmounts); } } diff --git a/script/20240115-mappixeltoken/20240115-maptoken-mainchain.s.sol b/script/20240115-mappixeltoken/20240115-maptoken-mainchain.s.sol index b6c162e4..2b13ebeb 100644 --- a/script/20240115-mappixeltoken/20240115-maptoken-mainchain.s.sol +++ b/script/20240115-mappixeltoken/20240115-maptoken-mainchain.s.sol @@ -155,6 +155,6 @@ contract Migration__MapTokenMainchain is Migration { config.switchTo(currentNetwork); vm.broadcast(sender()); - _roninBridgeManager.propose(companionChainId, expiredTime, targets, values, calldatas, gasAmounts); + _roninBridgeManager.propose(companionChainId, expiredTime, address(0), targets, values, calldatas, gasAmounts); } } diff --git a/script/20240115-mappixeltoken/20240115-maptoken-roninchain.s.sol b/script/20240115-mappixeltoken/20240115-maptoken-roninchain.s.sol index 42985caa..e6e4f5f0 100644 --- a/script/20240115-mappixeltoken/20240115-maptoken-roninchain.s.sol +++ b/script/20240115-mappixeltoken/20240115-maptoken-roninchain.s.sol @@ -128,6 +128,6 @@ contract Migration__MapTokenRoninchain is Migration { config.switchTo(currentNetwork); vm.broadcast(sender()); - _roninBridgeManager.propose(block.chainid, expiredTime, targets, values, calldatas, gasAmounts); + _roninBridgeManager.propose(block.chainid, expiredTime, address(0), targets, values, calldatas, gasAmounts); } } diff --git a/script/20240131-maptoken-pixel/20240131-maptoken-pixel-mainchain.s.sol b/script/20240131-maptoken-pixel/20240131-maptoken-pixel-mainchain.s.sol index dbb2490e..ea78e79c 100644 --- a/script/20240131-maptoken-pixel/20240131-maptoken-pixel-mainchain.s.sol +++ b/script/20240131-maptoken-pixel/20240131-maptoken-pixel-mainchain.s.sol @@ -122,6 +122,6 @@ contract Migration__20240131_MapTokenPixelMainchain is Migration, Migration__Map config.switchTo(currentNetwork); vm.broadcast(_governor); - _roninBridgeManager.propose(companionChainId, expiredTime, targets, values, calldatas, gasAmounts); + _roninBridgeManager.propose(companionChainId, expiredTime, address(0), targets, values, calldatas, gasAmounts); } } diff --git a/script/20240131-maptoken-pixel/20240131-maptoken-pixel-roninchain.s.sol b/script/20240131-maptoken-pixel/20240131-maptoken-pixel-roninchain.s.sol index dc2eae63..cb54e108 100644 --- a/script/20240131-maptoken-pixel/20240131-maptoken-pixel-roninchain.s.sol +++ b/script/20240131-maptoken-pixel/20240131-maptoken-pixel-roninchain.s.sol @@ -120,6 +120,6 @@ contract Migration__20240131_MapTokenPixelRoninchain is Migration, Migration__Ma LibProposal.verifyProposalGasAmount(address(_roninBridgeManager), targets, values, calldatas, gasAmounts); vm.broadcast(_governor); - _roninBridgeManager.propose(block.chainid, expiredTime, targets, values, calldatas, gasAmounts); + _roninBridgeManager.propose(block.chainid, expiredTime, address(0), targets, values, calldatas, gasAmounts); } } diff --git a/script/20240206-maptoken-banana/20240206-maptoken-banana-mainchain.s.sol b/script/20240206-maptoken-banana/20240206-maptoken-banana-mainchain.s.sol index dcb18506..a65d8abd 100644 --- a/script/20240206-maptoken-banana/20240206-maptoken-banana-mainchain.s.sol +++ b/script/20240206-maptoken-banana/20240206-maptoken-banana-mainchain.s.sol @@ -149,7 +149,7 @@ contract Migration__20240206_MapTokenBananaMainchain is console2.log("Nonce:", vm.getNonce(_governor)); vm.broadcast(_governor); - _roninBridgeManager.propose(companionChainId, expiredTime, targets, values, calldatas, gasAmounts); + _roninBridgeManager.propose(companionChainId, expiredTime, address(0), targets, values, calldatas, gasAmounts); } } diff --git a/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol b/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol index b437d345..31540bf1 100644 --- a/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol +++ b/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol @@ -3,7 +3,6 @@ pragma solidity ^0.8.19; import { console2 } from "forge-std/console2.sol"; import { StdStyle } from "forge-std/StdStyle.sol"; -import { BaseMigration } from "@fdk/BaseMigration.s.sol"; import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol"; import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; @@ -14,12 +13,11 @@ import { Ballot } from "@ronin/contracts/libraries/Ballot.sol"; import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; import { Proposal } from "@ronin/contracts/libraries/Proposal.sol"; +import { Migration } from "../Migration.s.sol"; import { Contract } from "../utils/Contract.sol"; -import { BridgeMigration } from "../BridgeMigration.sol"; import { TNetwork, Network } from "../utils/Network.sol"; import { LibProposal } from "script/shared/libraries/LibProposal.sol"; import { LibCompanionNetwork } from "script/shared/libraries/LibCompanionNetwork.sol"; -import { Contract } from "../utils/Contract.sol"; import "./maptoken-banana-configs.s.sol"; import "./maptoken-genkai-configs.s.sol"; @@ -152,10 +150,12 @@ contract Migration__20240206_MapTokenBananaRoninChain is TNetwork currentNetwork = network(); TNetwork companionNetwork = config.getCompanionNetwork(currentNetwork); - address companionManager = config.getAddress(companionNetwork, Contract.MainchainBridgeManager.key()); config.createFork(companionNetwork); config.switchTo(companionNetwork); - LibProposal.verifyProposalGasAmount(companionManager, targets, values, calldatas, gasAmounts); + { + address companionManager = config.getAddress(companionNetwork, Contract.MainchainBridgeManager.key()); + LibProposal.verifyProposalGasAmount(companionManager, targets, values, calldatas, gasAmounts); + } config.switchTo(currentNetwork); console2.log("Nonce:", vm.getNonce(_governor)); diff --git a/script/20240403-deploy-sepolia/20240405-maptoken-usdc-mainchain.s.sol b/script/20240403-deploy-sepolia/20240405-maptoken-usdc-mainchain.s.sol index d62362f9..c7d8ae8d 100644 --- a/script/20240403-deploy-sepolia/20240405-maptoken-usdc-mainchain.s.sol +++ b/script/20240403-deploy-sepolia/20240405-maptoken-usdc-mainchain.s.sol @@ -3,7 +3,6 @@ pragma solidity ^0.8.19; import { console2 } from "forge-std/console2.sol"; import { StdStyle } from "forge-std/StdStyle.sol"; -import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; import { IMainchainGatewayV3 } from "@ronin/contracts/interfaces/IMainchainGatewayV3.sol"; import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; @@ -11,7 +10,6 @@ import { LibTokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibToken import { Contract } from "../utils/Contract.sol"; import { Network } from "../utils/Network.sol"; import { Contract } from "../utils/Contract.sol"; -import { IGeneralConfigExtended } from "../IGeneralConfigExtended.sol"; import "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; import "@ronin/contracts/mainchain/MainchainGatewayV3.sol"; import "@ronin/contracts/libraries/Proposal.sol"; @@ -22,9 +20,9 @@ import { USDCDeploy } from "@ronin/script/contracts/token/USDCDeploy.s.sol"; import { MainchainBridgeAdminUtils } from "test/helpers/MainchainBridgeAdminUtils.t.sol"; import "./maptoken-usdc-configs.s.sol"; -import "../BridgeMigration.sol"; +import "../Migration.s.sol"; -contract Migration__20240405_MapTokenUsdcMainchain is BridgeMigration, Migration__MapToken_Usdc_Config { +contract Migration__20240405_MapTokenUsdcMainchain is Migration, Migration__MapToken_Usdc_Config { address internal _mainchainPauseEnforcer; address internal _mainchainGatewayV3; address internal _mainchainBridgeManager; diff --git a/script/20240403-deploy-sepolia/20240409-maptoken-slp-mainchain.s.sol b/script/20240403-deploy-sepolia/20240409-maptoken-slp-mainchain.s.sol index 5a6eca65..c20a7f06 100644 --- a/script/20240403-deploy-sepolia/20240409-maptoken-slp-mainchain.s.sol +++ b/script/20240403-deploy-sepolia/20240409-maptoken-slp-mainchain.s.sol @@ -3,7 +3,6 @@ pragma solidity ^0.8.19; import { console2 } from "forge-std/console2.sol"; import { StdStyle } from "forge-std/StdStyle.sol"; -import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; import { IMainchainGatewayV3 } from "@ronin/contracts/interfaces/IMainchainGatewayV3.sol"; import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; @@ -11,7 +10,7 @@ import { LibTokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibToken import { Contract } from "../utils/Contract.sol"; import { Network } from "../utils/Network.sol"; import { Contract } from "../utils/Contract.sol"; -import { IGeneralConfigExtended } from "../IGeneralConfigExtended.sol"; +import { IGeneralConfigExtended } from "../interfaces/IGeneralConfigExtended.sol"; import "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; import "@ronin/contracts/mainchain/MainchainGatewayV3.sol"; import "@ronin/contracts/libraries/Proposal.sol"; @@ -22,9 +21,9 @@ import { SLPDeploy } from "@ronin/script/contracts/token/SLPDeploy.s.sol"; import { MainchainBridgeAdminUtils } from "test/helpers/MainchainBridgeAdminUtils.t.sol"; import "./maptoken-slp-configs.s.sol"; -import "../BridgeMigration.sol"; +import "../Migration.s.sol"; -contract Migration__20240409_MapTokenSlpMainchain is BridgeMigration, Migration__MapToken_Slp_Config { +contract Migration__20240409_MapTokenSlpMainchain is Migration, Migration__MapToken_Slp_Config { address internal _mainchainPauseEnforcer; address internal _mainchainGatewayV3; address internal _mainchainBridgeManager; diff --git a/script/20240403-deploy-sepolia/deploy-sepolia.s.sol b/script/20240403-deploy-sepolia/deploy-sepolia.s.sol index 2faf4ac4..1770c391 100644 --- a/script/20240403-deploy-sepolia/deploy-sepolia.s.sol +++ b/script/20240403-deploy-sepolia/deploy-sepolia.s.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.19; import { ISharedArgument } from "@ronin/script/interfaces/ISharedArgument.sol"; -import { LibSharedAddress } from "foundry-deployment-kit/libraries/LibSharedAddress.sol"; +import { LibSharedAddress } from "@fdk/libraries/LibSharedAddress.sol"; import "@ronin/contracts/mainchain/MainchainGatewayV3.sol"; import "@ronin/contracts/ronin/gateway/PauseEnforcer.sol"; @@ -27,13 +27,13 @@ import { MockERC721Deploy } from "@ronin/script/contracts/token/MockERC721Deploy import { GeneralConfig } from "../GeneralConfig.sol"; import { Network } from "../utils/Network.sol"; -import { BridgeMigration } from "../BridgeMigration.sol"; -import { DefaultContract } from "foundry-deployment-kit/utils/DefaultContract.sol"; +import { Migration } from "../Migration.s.sol"; +import { DefaultContract } from "@fdk/utils/DefaultContract.sol"; import "./changeGV-config.s.sol"; import "forge-std/console2.sol"; -contract DeploySepolia is BridgeMigration, DeploySepolia__ChangeGV_Config { +contract DeploySepolia is Migration, DeploySepolia__ChangeGV_Config { ISharedArgument.SharedParameter _param; PauseEnforcer _mainchainPauseEnforcer; diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol index a1687040..84749f17 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.19; import { Ballot } from "@ronin/contracts/libraries/Ballot.sol"; -import "../BridgeMigration.sol"; +import "../Migration.s.sol"; struct LegacyProposalDetail { uint256 nonce; @@ -14,7 +14,7 @@ struct LegacyProposalDetail { uint256[] gasAmounts; } -contract Migration__20240409_Helper is BridgeMigration { +contract Migration__20240409_Helper is Migration { address internal _governor; address[] internal _voters; diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.s.sol index 63bdc784..d7309b67 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.s.sol @@ -3,7 +3,6 @@ pragma solidity ^0.8.19; import { console2 } from "forge-std/console2.sol"; import { StdStyle } from "forge-std/StdStyle.sol"; -import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; import { IMainchainGatewayV3 } from "@ronin/contracts/interfaces/IMainchainGatewayV3.sol"; import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; @@ -11,7 +10,7 @@ import { LibTokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibToken import { Contract } from "../utils/Contract.sol"; import { Network } from "../utils/Network.sol"; import { Contract } from "../utils/Contract.sol"; -import { IGeneralConfigExtended } from "../IGeneralConfigExtended.sol"; +import { IGeneralConfigExtended } from "../interfaces/IGeneralConfigExtended.sol"; import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; import "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; import "@ronin/contracts/mainchain/MainchainGatewayV3.sol"; @@ -23,9 +22,9 @@ import { SLPDeploy } from "@ronin/script/contracts/token/SLPDeploy.s.sol"; import { MainchainBridgeAdminUtils } from "test/helpers/MainchainBridgeAdminUtils.t.sol"; import "@ronin/script/contracts/RoninBridgeManagerDeploy.s.sol"; -import "../BridgeMigration.sol"; +import "../Migration.s.sol"; -contract Migration__20240409_P1_DeployRoninBridgeManager is BridgeMigration { +contract Migration__20240409_P1_DeployRoninBridgeManager is Migration { ISharedArgument.SharedParameter _param; RoninBridgeManager _newRoninBridgeManager; @@ -40,7 +39,7 @@ contract Migration__20240409_P1_DeployRoninBridgeManager is BridgeMigration { param.roninBridgeManager.denom = 10; param.roninBridgeManager.roninChainId = block.chainid; param.roninBridgeManager.expiryDuration = 60 * 60 * 24 * 14; // 14 days - param.roninBridgeManager.bridgeContract = _config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); + param.roninBridgeManager.bridgeContract = config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); param.roninBridgeManager.bridgeOperators = new address[](4); param.roninBridgeManager.bridgeOperators[0] = 0x2e82D2b56f858f79DeeF11B160bFC4631873da2B; param.roninBridgeManager.bridgeOperators[1] = 0xBcb61783dd2403FE8cC9B89B27B1A9Bb03d040Cb; @@ -67,11 +66,11 @@ contract Migration__20240409_P1_DeployRoninBridgeManager is BridgeMigration { param.roninBridgeManager.targetOptions[4] = GlobalProposal.TargetOption.PauseEnforcer; param.roninBridgeManager.targets = new address[](4); - param.roninBridgeManager.targets[0] = _config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); - param.roninBridgeManager.targets[1] = _config.getAddressFromCurrentNetwork(Contract.BridgeReward.key()); - param.roninBridgeManager.targets[2] = _config.getAddressFromCurrentNetwork(Contract.BridgeSlash.key()); - param.roninBridgeManager.targets[3] = _config.getAddressFromCurrentNetwork(Contract.BridgeTracking.key()); - param.roninBridgeManager.targets[4] = _config.getAddressFromCurrentNetwork(Contract.RoninPauseEnforcer.key()); + param.roninBridgeManager.targets[0] = config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); + param.roninBridgeManager.targets[1] = config.getAddressFromCurrentNetwork(Contract.BridgeReward.key()); + param.roninBridgeManager.targets[2] = config.getAddressFromCurrentNetwork(Contract.BridgeSlash.key()); + param.roninBridgeManager.targets[3] = config.getAddressFromCurrentNetwork(Contract.BridgeTracking.key()); + param.roninBridgeManager.targets[4] = config.getAddressFromCurrentNetwork(Contract.RoninPauseEnforcer.key()); _newRoninBridgeManager = RoninBridgeManager( new RoninBridgeManagerDeploy().overrideArgs( diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol index 7444852e..12c9b9dc 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol @@ -3,7 +3,6 @@ pragma solidity ^0.8.19; import { console2 } from "forge-std/console2.sol"; import { StdStyle } from "forge-std/StdStyle.sol"; -import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; import { IMainchainGatewayV3 } from "@ronin/contracts/interfaces/IMainchainGatewayV3.sol"; import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; @@ -11,7 +10,7 @@ import { LibTokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibToken import { Contract } from "../utils/Contract.sol"; import { Network } from "../utils/Network.sol"; import { Contract } from "../utils/Contract.sol"; -import { IGeneralConfigExtended } from "../IGeneralConfigExtended.sol"; +import { IGeneralConfigExtended } from "../interfaces/IGeneralConfigExtended.sol"; import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; import "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; import "@ronin/contracts/mainchain/MainchainGatewayV3.sol"; @@ -37,7 +36,7 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H _voters.push(0x52ec2e6BBcE45AfFF8955Da6410bb13812F4289F); _newRoninBridgeManager = RoninBridgeManager(address(0xdeadbeef)); // TODO: fulfill here - _currRoninBridgeManager = RoninBridgeManager(_config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); + _currRoninBridgeManager = RoninBridgeManager(config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); } function run() public onlyOn(DefaultNetwork.RoninTestnet.key()) { @@ -47,7 +46,7 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H function _changeAdminOfEnforcer() internal { RoninBridgeManager roninGA = RoninBridgeManager(0x53Ea388CB72081A3a397114a43741e7987815896); - address pauseEnforcerProxy = _config.getAddressFromCurrentNetwork(Contract.RoninPauseEnforcer.key()); + address pauseEnforcerProxy = config.getAddressFromCurrentNetwork(Contract.RoninPauseEnforcer.key()); uint256 expiredTime = block.timestamp + 14 days; uint N = 1; @@ -100,11 +99,11 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H address pauseEnforcerLogic = _deployLogic(Contract.RoninPauseEnforcer.key()); address roninGatewayV3Logic = _deployLogic(Contract.RoninGatewayV3.key()); - address bridgeRewardProxy = _config.getAddressFromCurrentNetwork(Contract.BridgeReward.key()); - address bridgeSlashProxy = _config.getAddressFromCurrentNetwork(Contract.BridgeSlash.key()); - address bridgeTrackingProxy = _config.getAddressFromCurrentNetwork(Contract.BridgeTracking.key()); - address pauseEnforcerProxy = _config.getAddressFromCurrentNetwork(Contract.RoninPauseEnforcer.key()); - address roninGatewayV3Proxy = _config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); + address bridgeRewardProxy = config.getAddressFromCurrentNetwork(Contract.BridgeReward.key()); + address bridgeSlashProxy = config.getAddressFromCurrentNetwork(Contract.BridgeSlash.key()); + address bridgeTrackingProxy = config.getAddressFromCurrentNetwork(Contract.BridgeTracking.key()); + address pauseEnforcerProxy = config.getAddressFromCurrentNetwork(Contract.RoninPauseEnforcer.key()); + address roninGatewayV3Proxy = config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); uint256 expiredTime = block.timestamp + 14 days; uint N = 10; diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol index 2bb4c081..19ed6835 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol @@ -3,7 +3,6 @@ pragma solidity ^0.8.19; import { console2 } from "forge-std/console2.sol"; import { StdStyle } from "forge-std/StdStyle.sol"; -import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; import { MainchainBridgeManager } from "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; import { IMainchainGatewayV3 } from "@ronin/contracts/interfaces/IMainchainGatewayV3.sol"; import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; @@ -11,14 +10,14 @@ import { LibTokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibToken import { Contract } from "../utils/Contract.sol"; import { Network } from "../utils/Network.sol"; import { Contract } from "../utils/Contract.sol"; -import { IGeneralConfigExtended } from "../IGeneralConfigExtended.sol"; +import { IGeneralConfigExtended } from "../interfaces/IGeneralConfigExtended.sol"; import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; import "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; import "@ronin/contracts/mainchain/MainchainGatewayV3.sol"; import "@ronin/contracts/libraries/Proposal.sol"; import "@ronin/contracts/libraries/Ballot.sol"; -import { DefaultContract } from "foundry-deployment-kit/utils/DefaultContract.sol"; +import { DefaultContract } from "@fdk/utils/DefaultContract.sol"; import { MockSLP } from "@ronin/contracts/mocks/token/MockSLP.sol"; import { SLPDeploy } from "@ronin/script/contracts/token/SLPDeploy.s.sol"; import { MainchainBridgeAdminUtils } from "test/helpers/MainchainBridgeAdminUtils.t.sol"; @@ -26,7 +25,7 @@ import "@ronin/script/contracts/MainchainBridgeManagerDeploy.s.sol"; import "@ronin/script/contracts/MainchainWethUnwrapperDeploy.s.sol"; import "./20240411-operators-key.s.sol"; -import "../BridgeMigration.sol"; +import "../Migration.s.sol"; struct LegacyProposalDetail { uint256 nonce; @@ -38,7 +37,7 @@ struct LegacyProposalDetail { uint256[] gasAmounts; } -contract Migration__20240409_P3_UpgradeBridgeMainchain is BridgeMigration, Migration__20240409_GovernorsKey { +contract Migration__20240409_P3_UpgradeBridgeMainchain is Migration, Migration__20240409_GovernorsKey { ISharedArgument.SharedParameter _param; MainchainBridgeManager _currMainchainBridgeManager; MainchainBridgeManager _newMainchainBridgeManager; @@ -52,7 +51,7 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is BridgeMigration, Migra super.setUp(); CONFIG.setAddress(network(), DefaultContract.ProxyAdmin.key(), PROXY_ADMIN); - _currMainchainBridgeManager = MainchainBridgeManager(_config.getAddressFromCurrentNetwork(Contract.MainchainBridgeManager.key())); + _currMainchainBridgeManager = MainchainBridgeManager(config.getAddressFromCurrentNetwork(Contract.MainchainBridgeManager.key())); } function run() public onlyOn(Network.Sepolia.key()) { @@ -67,8 +66,8 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is BridgeMigration, Migra } function _changeTempAdmin() internal { - address pauseEnforcerProxy = _config.getAddressFromCurrentNetwork(Contract.MainchainPauseEnforcer.key()); - address mainchainGatewayV3Proxy = _config.getAddressFromCurrentNetwork(Contract.MainchainGatewayV3.key()); + address pauseEnforcerProxy = config.getAddressFromCurrentNetwork(Contract.MainchainPauseEnforcer.key()); + address mainchainGatewayV3Proxy = config.getAddressFromCurrentNetwork(Contract.MainchainGatewayV3.key()); vm.startBroadcast(0x968D0Cd7343f711216817E617d3f92a23dC91c07); address(pauseEnforcerProxy).call(abi.encodeWithSignature("changeAdmin(address)", _currMainchainBridgeManager)); @@ -79,14 +78,14 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is BridgeMigration, Migra function _upgradeBridge() internal { _newMainchainBridgeManager = new MainchainBridgeManagerDeploy().run(); - address weth = _config.getAddressFromCurrentNetwork(Contract.WETH.key()); + address weth = config.getAddressFromCurrentNetwork(Contract.WETH.key()); address wethUnwrapper = new MainchainWethUnwrapperDeploy().overrideArgs(abi.encode(weth)).run(); address pauseEnforcerLogic = _deployLogic(Contract.MainchainPauseEnforcer.key()); address mainchainGatewayV3Logic = _deployLogic(Contract.MainchainGatewayV3.key()); - address pauseEnforcerProxy = _config.getAddressFromCurrentNetwork(Contract.MainchainPauseEnforcer.key()); - address mainchainGatewayV3Proxy = _config.getAddressFromCurrentNetwork(Contract.MainchainGatewayV3.key()); + address pauseEnforcerProxy = config.getAddressFromCurrentNetwork(Contract.MainchainPauseEnforcer.key()); + address mainchainGatewayV3Proxy = config.getAddressFromCurrentNetwork(Contract.MainchainGatewayV3.key()); uint256 expiredTime = block.timestamp + 14 days; uint N = 4; @@ -207,7 +206,7 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is BridgeMigration, Migra param.mainchainBridgeManager.denom = 10; param.mainchainBridgeManager.roninChainId = 2021; param.mainchainBridgeManager.expiryDuration = 60 * 60 * 24 * 14; // 14 days - param.mainchainBridgeManager.bridgeContract = _config.getAddressFromCurrentNetwork(Contract.MainchainGatewayV3.key()); + param.mainchainBridgeManager.bridgeContract = config.getAddressFromCurrentNetwork(Contract.MainchainGatewayV3.key()); param.mainchainBridgeManager.bridgeOperators = new address[](4); param.mainchainBridgeManager.bridgeOperators[0] = 0x2e82D2b56f858f79DeeF11B160bFC4631873da2B; param.mainchainBridgeManager.bridgeOperators[1] = 0xBcb61783dd2403FE8cC9B89B27B1A9Bb03d040Cb; @@ -231,8 +230,8 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is BridgeMigration, Migra param.mainchainBridgeManager.targetOptions[1] = GlobalProposal.TargetOption.PauseEnforcer; param.mainchainBridgeManager.targets = new address[](2); - param.mainchainBridgeManager.targets[0] = _config.getAddressFromCurrentNetwork(Contract.MainchainGatewayV3.key()); - param.mainchainBridgeManager.targets[1] = _config.getAddressFromCurrentNetwork(Contract.MainchainPauseEnforcer.key()); + param.mainchainBridgeManager.targets[0] = config.getAddressFromCurrentNetwork(Contract.MainchainGatewayV3.key()); + param.mainchainBridgeManager.targets[1] = config.getAddressFromCurrentNetwork(Contract.MainchainPauseEnforcer.key()); _newMainchainBridgeManager = MainchainBridgeManager( new MainchainBridgeManagerDeploy().overrideArgs( diff --git a/script/GeneralConfig.sol b/script/GeneralConfig.sol index f3a454d3..5a04aa4c 100644 --- a/script/GeneralConfig.sol +++ b/script/GeneralConfig.sol @@ -40,19 +40,13 @@ contract GeneralConfig is BaseGeneralConfig, Utils { } function getCompanionNetwork(TNetwork network) public view virtual returns (TNetwork companionNetwork) { - if (network == DefaultNetwork.RoninMainnet.key()) { - return Network.EthMainnet.key(); - } else if (network == Network.EthMainnet.key()) { - return DefaultNetwork.RoninMainnet.key(); - } else if (network == DefaultNetwork.RoninTestnet.key()) { - return Network.Goerli.key(); - } else if (network == Network.Goerli.key()) { - return DefaultNetwork.RoninTestnet.key(); - } else if (network == DefaultNetwork.Local.key()) { - return DefaultNetwork.Local.key(); - } + if (network == DefaultNetwork.RoninMainnet.key()) return Network.EthMainnet.key(); + if (network == Network.EthMainnet.key()) return DefaultNetwork.RoninMainnet.key(); + if (network == DefaultNetwork.RoninTestnet.key()) return Network.Goerli.key(); + if (network == Network.Goerli.key()) return DefaultNetwork.RoninTestnet.key(); + if (network == DefaultNetwork.Local.key()) return DefaultNetwork.Local.key(); - return network; + revert("Network: Unknown companion network"); } function _setUpContracts() internal virtual override { @@ -102,10 +96,4 @@ contract GeneralConfig is BaseGeneralConfig, Utils { if (sender == address(0x0) && isLocalNetwork) sender = payable(DEFAULT_SENDER); require(sender != address(0x0), "GeneralConfig: Sender is address(0x0)"); } - - function getCompanionNetwork(TNetwork network) external pure returns (Network) { - if (network == DefaultNetwork.RoninTestnet.key()) return Network.Sepolia; - if (network == DefaultNetwork.RoninMainnet.key()) return Network.EthMainnet; - revert("Network: Unknown companion network"); - } } diff --git a/script/deploy-v0.3.1/01_Deploy_RoninBridge.s.sol b/script/deploy-v0.3.1/01_Deploy_RoninBridge.s.sol index a515b6e3..6dc3f7ee 100644 --- a/script/deploy-v0.3.1/01_Deploy_RoninBridge.s.sol +++ b/script/deploy-v0.3.1/01_Deploy_RoninBridge.s.sol @@ -1,104 +1,104 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.23; -import { Migration } from "../Migration.s.sol"; -import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; -import { BridgeSlash, BridgeSlashDeploy } from "../contracts/BridgeSlashDeploy.s.sol"; -import { BridgeReward, BridgeRewardDeploy } from "../contracts/BridgeRewardDeploy.s.sol"; -import { BridgeTracking, BridgeTrackingDeploy } from "../contracts/BridgeTrackingDeploy.s.sol"; -import { RoninGatewayV3, RoninGatewayV3Deploy } from "../contracts/RoninGatewayV3Deploy.s.sol"; -import { RoninBridgeManager, RoninBridgeManagerDeploy } from "../contracts/RoninBridgeManagerDeploy.s.sol"; +// import { Migration } from "../Migration.s.sol"; +// import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; +// import { BridgeSlash, BridgeSlashDeploy } from "../contracts/BridgeSlashDeploy.s.sol"; +// import { BridgeReward, BridgeRewardDeploy } from "../contracts/BridgeRewardDeploy.s.sol"; +// import { BridgeTracking, BridgeTrackingDeploy } from "../contracts/BridgeTrackingDeploy.s.sol"; +// import { RoninGatewayV3, RoninGatewayV3Deploy } from "../contracts/RoninGatewayV3Deploy.s.sol"; +// import { RoninBridgeManager, RoninBridgeManagerDeploy } from "../contracts/RoninBridgeManagerDeploy.s.sol"; -contract Migration_01_Deploy_RoninBridge is Migration { - BridgeSlash private _bridgeSlash; - BridgeReward private _bridgeReward; - RoninGatewayV3 private _roninGatewayV3; - BridgeTracking private _bridgeTracking; - RoninBridgeManager private _roninBridgeManager; - address private _validatorSet; +// contract Migration_01_Deploy_RoninBridge is Migration { +// BridgeSlash private _bridgeSlash; +// BridgeReward private _bridgeReward; +// RoninGatewayV3 private _roninGatewayV3; +// BridgeTracking private _bridgeTracking; +// RoninBridgeManager private _roninBridgeManager; +// address private _validatorSet; - function run() external { - _roninGatewayV3 = new RoninGatewayV3Deploy().run(); - _bridgeSlash = new BridgeSlashDeploy().run(); - _bridgeReward = new BridgeRewardDeploy().run(); - _bridgeTracking = new BridgeTrackingDeploy().run(); - _roninBridgeManager = new RoninBridgeManagerDeploy().run(); +// function run() external { +// _roninGatewayV3 = new RoninGatewayV3Deploy().run(); +// _bridgeSlash = new BridgeSlashDeploy().run(); +// _bridgeReward = new BridgeRewardDeploy().run(); +// _bridgeTracking = new BridgeTrackingDeploy().run(); +// _roninBridgeManager = new RoninBridgeManagerDeploy().run(); - _initBridgeReward(); - _initBridgeSlash(); - _initRoninGatewayV3(); - _initBridgeTracking(); - _initRoninBridgeManager(); - } +// _initBridgeReward(); +// _initBridgeSlash(); +// _initRoninGatewayV3(); +// _initBridgeTracking(); +// _initRoninBridgeManager(); +// } - function _initRoninBridgeManager() internal logFn("Init RoninBridgeManager") { - ISharedArgument.BridgeManagerParam memory param = config.sharedArguments().roninBridgeManager; - // address[] memory callbackRegisters = new address[](1); - // callbackRegisters[0] = address(_bridgeSlash); - // callbackRegisters[1] = address(_roninGatewayV3); +// function _initRoninBridgeManager() internal logFn("Init RoninBridgeManager") { +// ISharedArgument.BridgeManagerParam memory param = config.sharedArguments().roninBridgeManager; +// // address[] memory callbackRegisters = new address[](1); +// // callbackRegisters[0] = address(_bridgeSlash); +// // callbackRegisters[1] = address(_roninGatewayV3); - _roninBridgeManager.initialize({ - num: param.num, - denom: param.denom, - roninChainId: block.chainid, - expiryDuration: param.expiryDuration, - bridgeContract: address(_roninGatewayV3), - callbackRegisters: param.callbackRegisters, - bridgeOperators: param.bridgeOperators, - governors: param.governors, - voteWeights: param.voteWeights, - targetOptions: param.targetOptions, - targets: param.targets - }); - } +// _roninBridgeManager.initialize({ +// num: param.num, +// denom: param.denom, +// roninChainId: block.chainid, +// expiryDuration: param.expiryDuration, +// bridgeContract: address(_roninGatewayV3), +// callbackRegisters: param.callbackRegisters, +// bridgeOperators: param.bridgeOperators, +// governors: param.governors, +// voteWeights: param.voteWeights, +// targetOptions: param.targetOptions, +// targets: param.targets +// }); +// } - function _initBridgeTracking() internal logFn("Init BridgeTracking") { - _bridgeTracking.initialize({ bridgeContract: address(_roninGatewayV3), validatorContract: _validatorSet, startedAtBlock_: 0 }); - _bridgeTracking.initializeV3({ - bridgeManager: address(_roninBridgeManager), - bridgeSlash: address(_bridgeSlash), - bridgeReward: address(_bridgeReward), - dposGA: address(0x0) - }); - } +// function _initBridgeTracking() internal logFn("Init BridgeTracking") { +// _bridgeTracking.initialize({ bridgeContract: address(_roninGatewayV3), validatorContract: _validatorSet, startedAtBlock_: 0 }); +// _bridgeTracking.initializeV3({ +// bridgeManager: address(_roninBridgeManager), +// bridgeSlash: address(_bridgeSlash), +// bridgeReward: address(_bridgeReward), +// dposGA: address(0x0) +// }); +// } - function _initBridgeReward() internal logFn("Init BridgeReward") { - ISharedArgument.BridgeRewardParam memory param = config.sharedArguments().bridgeReward; - _bridgeReward.initialize({ - bridgeManagerContract: address(_roninBridgeManager), - bridgeTrackingContract: address(_bridgeTracking), - bridgeSlashContract: address(_bridgeSlash), - validatorSetContract: _validatorSet, - dposGA: address(0x0), - rewardPerPeriod: param.rewardPerPeriod - }); - // _bridgeReward.initializeREP2(); - _bridgeReward.initializeV2(); - } +// function _initBridgeReward() internal logFn("Init BridgeReward") { +// ISharedArgument.BridgeRewardParam memory param = config.sharedArguments().bridgeReward; +// _bridgeReward.initialize({ +// bridgeManagerContract: address(_roninBridgeManager), +// bridgeTrackingContract: address(_bridgeTracking), +// bridgeSlashContract: address(_bridgeSlash), +// validatorSetContract: _validatorSet, +// dposGA: address(0x0), +// rewardPerPeriod: param.rewardPerPeriod +// }); +// // _bridgeReward.initializeREP2(); +// _bridgeReward.initializeV2(); +// } - function _initBridgeSlash() internal logFn("Init BridgeSlash") { - _bridgeSlash.initialize({ - validatorContract: _validatorSet, - bridgeManagerContract: address(_roninBridgeManager), - bridgeTrackingContract: address(_bridgeTracking), - dposGA: address(0x0) - }); - } +// function _initBridgeSlash() internal logFn("Init BridgeSlash") { +// _bridgeSlash.initialize({ +// validatorContract: _validatorSet, +// bridgeManagerContract: address(_roninBridgeManager), +// bridgeTrackingContract: address(_bridgeTracking), +// dposGA: address(0x0) +// }); +// } - function _initRoninGatewayV3() internal logFn("Init RoninGatewayV3") { - ISharedArgument.RoninGatewayV3Param memory param = config.sharedArguments().roninGatewayV3; +// function _initRoninGatewayV3() internal logFn("Init RoninGatewayV3") { +// ISharedArgument.RoninGatewayV3Param memory param = config.sharedArguments().roninGatewayV3; - _roninGatewayV3.initialize( - param.roleSetter, - param.numerator, - param.denominator, - param.trustedNumerator, - param.trustedDenominator, - param.withdrawalMigrators, - param.packedAddresses, - param.packedNumbers, - param.standards - ); - _roninGatewayV3.initializeV3(address(_roninBridgeManager)); - } -} +// _roninGatewayV3.initialize( +// param.roleSetter, +// param.numerator, +// param.denominator, +// param.trustedNumerator, +// param.trustedDenominator, +// param.withdrawalMigrators, +// param.packedAddresses, +// param.packedNumbers, +// param.standards +// ); +// _roninGatewayV3.initializeV3(address(_roninBridgeManager)); +// } +// } diff --git a/script/deploy-v0.3.1/02_Deploy_MainchainBridge.s.sol b/script/deploy-v0.3.1/02_Deploy_MainchainBridge.s.sol index f744a059..a0a47cc1 100644 --- a/script/deploy-v0.3.1/02_Deploy_MainchainBridge.s.sol +++ b/script/deploy-v0.3.1/02_Deploy_MainchainBridge.s.sol @@ -1,76 +1,76 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.23; -import { Migration } from "../Migration.s.sol"; -import { Contract } from "../utils/Contract.sol"; -import { IWETH } from "@ronin/contracts/interfaces/IWETH.sol"; -import { WETHDeploy } from "../contracts/token/WETHDeploy.s.sol"; -import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; -import { LibCompanionNetwork } from "script/shared/libraries/LibCompanionNetwork.sol"; -import { MainchainGatewayV3, MainchainGatewayV3Deploy } from "../contracts/MainchainGatewayV3Deploy.s.sol"; -import { WethUnwrapper, MainchainWethUnwrapperDeploy } from "../contracts/MainchainWethUnwrapperDeploy.s.sol"; -import { MainchainBridgeManager, MainchainBridgeManagerDeploy } from "../contracts/MainchainBridgeManagerDeploy.s.sol"; +// import { Migration } from "../Migration.s.sol"; +// import { Contract } from "../utils/Contract.sol"; +// import { IWETH } from "@ronin/contracts/interfaces/IWETH.sol"; +// import { WETHDeploy } from "../contracts/token/WETHDeploy.s.sol"; +// import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; +// import { LibCompanionNetwork } from "script/shared/libraries/LibCompanionNetwork.sol"; +// import { MainchainGatewayV3, MainchainGatewayV3Deploy } from "../contracts/MainchainGatewayV3Deploy.s.sol"; +// import { WethUnwrapper, MainchainWethUnwrapperDeploy } from "../contracts/MainchainWethUnwrapperDeploy.s.sol"; +// import { MainchainBridgeManager, MainchainBridgeManagerDeploy } from "../contracts/MainchainBridgeManagerDeploy.s.sol"; -contract Migration_02_Deploy_MainchainBridge is Migration { - using LibCompanionNetwork for *; +// contract Migration_02_Deploy_MainchainBridge is Migration { +// using LibCompanionNetwork for *; - address private _weth; - WethUnwrapper private _mainchainWethUnwrapper; - MainchainGatewayV3 private _mainchainGatewayV3; - MainchainBridgeManager private _mainchainBridgeManager; +// address private _weth; +// WethUnwrapper private _mainchainWethUnwrapper; +// MainchainGatewayV3 private _mainchainGatewayV3; +// MainchainBridgeManager private _mainchainBridgeManager; - function _injectDependencies() internal virtual override { - _setDependencyDeployScript(Contract.WETH.key(), new WETHDeploy()); - } +// function _injectDependencies() internal virtual override { +// _setDependencyDeployScript(Contract.WETH.key(), new WETHDeploy()); +// } - function run() external { - _weth = loadContractOrDeploy(Contract.WETH.key()); - _mainchainGatewayV3 = new MainchainGatewayV3Deploy().run(); - _mainchainBridgeManager = new MainchainBridgeManagerDeploy().run(); - _mainchainWethUnwrapper = new MainchainWethUnwrapperDeploy().run(); +// function run() external { +// _weth = loadContractOrDeploy(Contract.WETH.key()); +// _mainchainGatewayV3 = new MainchainGatewayV3Deploy().run(); +// _mainchainBridgeManager = new MainchainBridgeManagerDeploy().run(); +// _mainchainWethUnwrapper = new MainchainWethUnwrapperDeploy().run(); - _initMainchainGatewayV3(); - _initMainchainBridgeManager(); - } +// _initMainchainGatewayV3(); +// _initMainchainBridgeManager(); +// } - function _initMainchainBridgeManager() internal logFn("Init RoninBridgeManager") { - ISharedArgument.BridgeManagerParam memory param = config.sharedArguments().mainchainBridgeManager; - // address[] memory callbackRegisters = new address[](1); - // callbackRegisters[0] = address(_bridgeSlash); - // callbackRegisters[1] = address(_roninGatewayV3); +// function _initMainchainBridgeManager() internal logFn("Init RoninBridgeManager") { +// ISharedArgument.BridgeManagerParam memory param = config.sharedArguments().mainchainBridgeManager; +// // address[] memory callbackRegisters = new address[](1); +// // callbackRegisters[0] = address(_bridgeSlash); +// // callbackRegisters[1] = address(_roninGatewayV3); - uint256 companionChainId = network().companionChainId(); - _mainchainBridgeManager.initialize({ - num: param.num, - denom: param.denom, - roninChainId: companionChainId, - bridgeContract: address(_mainchainGatewayV3), - callbackRegisters: param.callbackRegisters, - bridgeOperators: param.bridgeOperators, - governors: param.governors, - voteWeights: param.voteWeights, - targetOptions: param.targetOptions, - targets: param.targets - }); - } +// uint256 companionChainId = network().companionChainId(); +// _mainchainBridgeManager.initialize({ +// num: param.num, +// denom: param.denom, +// roninChainId: companionChainId, +// bridgeContract: address(_mainchainGatewayV3), +// callbackRegisters: param.callbackRegisters, +// bridgeOperators: param.bridgeOperators, +// governors: param.governors, +// voteWeights: param.voteWeights, +// targetOptions: param.targetOptions, +// targets: param.targets +// }); +// } - function _initMainchainGatewayV3() internal logFn("Init MainchainGatewayV3") { - ISharedArgument.MainchainGatewayV3Param memory param = config.sharedArguments().mainchainGatewayV3; +// function _initMainchainGatewayV3() internal logFn("Init MainchainGatewayV3") { +// ISharedArgument.MainchainGatewayV3Param memory param = config.sharedArguments().mainchainGatewayV3; - uint256 companionChainId = network().companionChainId(); - _mainchainGatewayV3.initialize( - param.roleSetter, - IWETH(_weth), - companionChainId, - param.numerator, - param.highTierVWNumerator, - param.denominator, - param.addresses, - param.thresholds, - param.standards - ); - _mainchainGatewayV3.initializeV2(address(_mainchainBridgeManager)); - _mainchainGatewayV3.initializeV3(); - _mainchainGatewayV3.initializeV4(payable(address(_mainchainWethUnwrapper))); - } -} +// uint256 companionChainId = network().companionChainId(); +// _mainchainGatewayV3.initialize( +// param.roleSetter, +// IWETH(_weth), +// companionChainId, +// param.numerator, +// param.highTierVWNumerator, +// param.denominator, +// param.addresses, +// param.thresholds, +// param.standards +// ); +// _mainchainGatewayV3.initializeV2(address(_mainchainBridgeManager)); +// _mainchainGatewayV3.initializeV3(); +// _mainchainGatewayV3.initializeV4(payable(address(_mainchainWethUnwrapper))); +// } +// } diff --git a/script/deploy-v0.3.1/Deploy.v0.3.1.s.sol b/script/deploy-v0.3.1/Deploy.v0.3.1.s.sol index ad534228..1bee4de5 100644 --- a/script/deploy-v0.3.1/Deploy.v0.3.1.s.sol +++ b/script/deploy-v0.3.1/Deploy.v0.3.1.s.sol @@ -1,46 +1,46 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.23; -import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol"; -import { Migration } from "../Migration.s.sol"; -import { Contract } from "../utils/Contract.sol"; -import { TNetwork, Network } from "../utils/Network.sol"; -import { Migration_01_Deploy_RoninBridge } from "./01_Deploy_RoninBridge.s.sol"; -import { LibCompanionNetwork } from "../shared/libraries/LibCompanionNetwork.sol"; -import { Migration_02_Deploy_MainchainBridge } from "./02_Deploy_MainchainBridge.s.sol"; - -contract Deploy_v0_3_1 is Migration { - using LibCompanionNetwork for *; - - function run() external { - TNetwork currentNetwork = network(); - TNetwork companionNetwork = currentNetwork.companionNetwork(); - - if ( - currentNetwork == DefaultNetwork.RoninMainnet.key() || currentNetwork == DefaultNetwork.RoninTestnet.key() || currentNetwork == Network.RoninDevnet.key() - ) { - new Migration_01_Deploy_RoninBridge().run(); - - config.createFork(companionNetwork); - config.switchTo(companionNetwork); - - new Migration_02_Deploy_MainchainBridge().run(); - - config.switchTo(currentNetwork); - } else if (currentNetwork == Network.EthMainnet.key() || currentNetwork == Network.Goerli.key() || currentNetwork == Network.Sepolia.key()) { - config.createFork(companionNetwork); - config.switchTo(companionNetwork); - - new Migration_01_Deploy_RoninBridge().run(); - - config.switchTo(currentNetwork); - - new Migration_02_Deploy_MainchainBridge().run(); - } else if (currentNetwork == DefaultNetwork.Local.key()) { - new Migration_01_Deploy_RoninBridge().run(); - new Migration_02_Deploy_MainchainBridge().run(); - } else { - revert("Unsupported network"); - } - } -} +// import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol"; +// import { Migration } from "../Migration.s.sol"; +// import { Contract } from "../utils/Contract.sol"; +// import { TNetwork, Network } from "../utils/Network.sol"; +// import { Migration_01_Deploy_RoninBridge } from "./01_Deploy_RoninBridge.s.sol"; +// import { LibCompanionNetwork } from "../shared/libraries/LibCompanionNetwork.sol"; +// import { Migration_02_Deploy_MainchainBridge } from "./02_Deploy_MainchainBridge.s.sol"; + +// contract Deploy_v0_3_1 is Migration { +// using LibCompanionNetwork for *; + +// function run() external { +// TNetwork currentNetwork = network(); +// TNetwork companionNetwork = currentNetwork.companionNetwork(); + +// if ( +// currentNetwork == DefaultNetwork.RoninMainnet.key() || currentNetwork == DefaultNetwork.RoninTestnet.key() || currentNetwork == Network.RoninDevnet.key() +// ) { +// new Migration_01_Deploy_RoninBridge().run(); + +// config.createFork(companionNetwork); +// config.switchTo(companionNetwork); + +// new Migration_02_Deploy_MainchainBridge().run(); + +// config.switchTo(currentNetwork); +// } else if (currentNetwork == Network.EthMainnet.key() || currentNetwork == Network.Goerli.key() || currentNetwork == Network.Sepolia.key()) { +// config.createFork(companionNetwork); +// config.switchTo(companionNetwork); + +// new Migration_01_Deploy_RoninBridge().run(); + +// config.switchTo(currentNetwork); + +// new Migration_02_Deploy_MainchainBridge().run(); +// } else if (currentNetwork == DefaultNetwork.Local.key()) { +// new Migration_01_Deploy_RoninBridge().run(); +// new Migration_02_Deploy_MainchainBridge().run(); +// } else { +// revert("Unsupported network"); +// } +// } +// } diff --git a/script/factories/factory-maptoken-mainchain.s.sol b/script/factories/factory-maptoken-mainchain.s.sol index 5fec45ae..fa0f4d7e 100644 --- a/script/factories/factory-maptoken-mainchain.s.sol +++ b/script/factories/factory-maptoken-mainchain.s.sol @@ -3,20 +3,22 @@ pragma solidity ^0.8.19; import { console2 } from "forge-std/console2.sol"; import { StdStyle } from "forge-std/StdStyle.sol"; -import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; import { IMainchainGatewayV3 } from "@ronin/contracts/interfaces/IMainchainGatewayV3.sol"; import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; import { LibTokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; import { Contract } from "../utils/Contract.sol"; -import { BridgeMigration } from "../BridgeMigration.sol"; +import { Migration } from "../Migration.s.sol"; import { Network } from "../utils/Network.sol"; import { Contract } from "../utils/Contract.sol"; -import { IGeneralConfigExtended } from "../IGeneralConfigExtended.sol"; +import { IGeneralConfigExtended } from "../interfaces/IGeneralConfigExtended.sol"; import { MapTokenInfo } from "../libraries/MapTokenInfo.sol"; +import { LibCompanionNetwork } from "script/shared/libraries/LibCompanionNetwork.sol"; + +abstract contract Factory__MapTokensMainchain is Migration { + using LibCompanionNetwork for *; -abstract contract Factory__MapTokensMainchain is BridgeMigration { RoninBridgeManager internal _roninBridgeManager; address internal _mainchainGatewayV3; address internal _mainchainBridgeManager; @@ -25,10 +27,9 @@ abstract contract Factory__MapTokensMainchain is BridgeMigration { function setUp() public override { super.setUp(); - _roninBridgeManager = RoninBridgeManager(_config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); - _mainchainGatewayV3 = _config.getAddress(_config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).key(), Contract.MainchainGatewayV3.key()); - _mainchainBridgeManager = - _config.getAddress(_config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).key(), Contract.MainchainBridgeManager.key()); + _roninBridgeManager = RoninBridgeManager(config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); + _mainchainGatewayV3 = config.getAddress(network().companionNetwork(), Contract.MainchainGatewayV3.key()); + _mainchainBridgeManager = config.getAddress(network().companionNetwork(), Contract.MainchainBridgeManager.key()); _governor = _initCaller(); } @@ -84,9 +85,9 @@ abstract contract Factory__MapTokensMainchain is BridgeMigration { // ================ VERIFY AND EXECUTE PROPOSAL =============== - _verifyMainchainProposalGasAmount(targets, values, calldatas, gasAmounts); + // _verifyMainchainProposalGasAmount(targets, values, calldatas, gasAmounts); - uint256 chainId = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); + uint256 chainId = network().companionChainId(); vm.broadcast(_governor); _roninBridgeManager.propose(chainId, expiredTime, address(0), targets, values, calldatas, gasAmounts); diff --git a/script/factories/factory-maptoken-roninchain.s.sol b/script/factories/factory-maptoken-roninchain.s.sol index 346ab46a..6fb30cd8 100644 --- a/script/factories/factory-maptoken-roninchain.s.sol +++ b/script/factories/factory-maptoken-roninchain.s.sol @@ -3,7 +3,6 @@ pragma solidity ^0.8.19; import { console2 } from "forge-std/console2.sol"; import { StdStyle } from "forge-std/StdStyle.sol"; -import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol"; import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; import { IRoninGatewayV3 } from "@ronin/contracts/interfaces/IRoninGatewayV3.sol"; @@ -13,22 +12,25 @@ import { Ballot } from "@ronin/contracts/libraries/Ballot.sol"; import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; import { Contract } from "../utils/Contract.sol"; -import { BridgeMigration } from "../BridgeMigration.sol"; +import { Migration } from "../Migration.s.sol"; import { Network } from "../utils/Network.sol"; import { Contract } from "../utils/Contract.sol"; -import { IGeneralConfigExtended } from "../IGeneralConfigExtended.sol"; +import { IGeneralConfigExtended } from "../interfaces/IGeneralConfigExtended.sol"; import { MapTokenInfo } from "../libraries/MapTokenInfo.sol"; +import { LibCompanionNetwork } from "script/shared/libraries/LibCompanionNetwork.sol"; + +abstract contract Factory__MapTokensRoninchain is Migration { + using LibCompanionNetwork for *; -abstract contract Factory__MapTokensRoninchain is BridgeMigration { RoninBridgeManager internal _roninBridgeManager; address internal _roninGatewayV3; address private _governor; function setUp() public override { super.setUp(); - _roninBridgeManager = RoninBridgeManager(_config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); - _roninGatewayV3 = _config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); + _roninBridgeManager = RoninBridgeManager(config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); + _roninGatewayV3 = config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); _governor = _initCaller(); _cheatWeightOperator(_governor); @@ -65,7 +67,7 @@ abstract contract Factory__MapTokensRoninchain is BridgeMigration { for (uint256 i; i < N; ++i) { roninTokens[i] = tokenInfos[i].roninToken; mainchainTokens[i] = tokenInfos[i].mainchainToken; - chainIds[i] = _config.getCompanionNetwork(_config.getNetworkByChainId(block.chainid)).chainId(); + chainIds[i] = network().companionChainId(); standards[i] = TokenStandard.ERC20; } @@ -106,7 +108,7 @@ abstract contract Factory__MapTokensRoninchain is BridgeMigration { // ================ VERIFY AND EXECUTE PROPOSAL =============== - _verifyRoninProposalGasAmount(targets, values, calldatas, gasAmounts); + // _verifyRoninProposalGasAmount(targets, values, calldatas, gasAmounts); vm.broadcast(_governor); _roninBridgeManager.propose(block.chainid, expiredTime, address(0), targets, values, calldatas, gasAmounts); diff --git a/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol b/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol index ac0a47a4..5809d277 100644 --- a/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol +++ b/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol @@ -68,8 +68,8 @@ abstract contract PostCheck_BridgeManager_Proposal is BasePostCheck { assertEq(manager.globalProposalVoted(globalProposal.nonce, cheatGovernor), true); // Check if the operator is added assertTrue(manager.isBridgeOperator(cheatOperator), "operator not added"); - // Check if the governor is added - assertTrue(manager.isBridgeGovernor(cheatGovernor), "governor not added"); + // // Check if the governor is added + // assertTrue(manager.isBridgeGovernor(cheatGovernor), "governor not added"); } diff --git a/script/shared/libraries/LibProposal.sol b/script/shared/libraries/LibProposal.sol index 55a621be..80cd9d81 100644 --- a/script/shared/libraries/LibProposal.sol +++ b/script/shared/libraries/LibProposal.sol @@ -64,6 +64,7 @@ library LibProposal { nonce: nonce, chainId: block.chainid, expiryTimestamp: expiryTimestamp, + executor: address(0), targets: targets, values: values, calldatas: calldatas, @@ -83,6 +84,7 @@ library LibProposal { proposal = GlobalProposal.GlobalProposalDetail({ nonce: nonce, expiryTimestamp: expiryTimestamp, + executor: address(0), targetOptions: targetOptions, values: values, calldatas: calldatas, @@ -102,7 +104,7 @@ library LibProposal { } else { vm.broadcast(governor0); } - manager.proposeProposalForCurrentNetwork(proposal.expiryTimestamp, proposal.targets, proposal.values, proposal.calldatas, proposal.gasAmounts, support); + manager.proposeProposalForCurrentNetwork(proposal.expiryTimestamp, proposal.executor, proposal.targets, proposal.values, proposal.calldatas, proposal.gasAmounts, support); uint256 totalGas = proposal.gasAmounts.sum(); // 20% more gas for each governor From 225f46555bb931f30abe46bf710fa6f0244b9a81 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Fri, 12 Apr 2024 13:47:39 +0700 Subject: [PATCH 151/180] script: fix double push in `setup` --- .../20240411-p2-upgrade-bridge-ronin-chain.s.sol | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol index 12c9b9dc..ba890963 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol @@ -30,16 +30,16 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H function setUp() public override { super.setUp(); - _governor = 0xd24D87DDc1917165435b306aAC68D99e0F49A3Fa; - _voters.push(0xb033ba62EC622dC54D0ABFE0254e79692147CA26); - _voters.push(0x087D08e3ba42e64E3948962dd1371F906D1278b9); - _voters.push(0x52ec2e6BBcE45AfFF8955Da6410bb13812F4289F); - _newRoninBridgeManager = RoninBridgeManager(address(0xdeadbeef)); // TODO: fulfill here _currRoninBridgeManager = RoninBridgeManager(config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); } function run() public onlyOn(DefaultNetwork.RoninTestnet.key()) { + _governor = 0xd24D87DDc1917165435b306aAC68D99e0F49A3Fa; + _voters.push(0xb033ba62EC622dC54D0ABFE0254e79692147CA26); + _voters.push(0x087D08e3ba42e64E3948962dd1371F906D1278b9); + _voters.push(0x52ec2e6BBcE45AfFF8955Da6410bb13812F4289F); + _changeAdminOfEnforcer(); _upgradeBridge(); } From d533dc3bfbd30e90a7bc4745c83c1ee913ce646d Mon Sep 17 00:00:00 2001 From: TuDo1403 Date: Fri, 12 Apr 2024 14:12:56 +0700 Subject: [PATCH 152/180] script: fix conflicted post check --- .../20231218-maptoken-mainchain.s.sol | 9 +- .../20240115-maptoken-mainchain.s.sol | 12 +- .../20240115-maptoken-roninchain.s.sol | 9 +- .../20240131-maptoken-pixel-mainchain.s.sol | 11 +- .../20240206-maptoken-banana-mainchain.s.sol | 12 +- .../20240206-maptoken-banana-roninchain.s.sol | 133 ++++++----- ...240411-p2-upgrade-bridge-ronin-chain.s.sol | 1 - ...0240411-p3-upgrade-bridge-main-chain.s.sol | 1 - script/GeneralConfig.sol | 5 +- script/Migration.s.sol | 56 +++-- .../deploy-v0.3.1/01_Deploy_RoninBridge.s.sol | 214 ++++++++++------- .../02_Deploy_MainchainBridge.s.sol | 137 ++++++----- script/deploy-v0.3.1/Deploy.v0.3.1.s.sol | 86 +++---- script/post-check/BasePostCheck.s.sol | 3 +- ...ridgeManager_CRUD_addBridgeOperators.s.sol | 2 +- .../PostCheck_BridgeManager_Proposal.s.sol | 222 +++++++++++++++--- .../shared/libraries/LibCompanionNetwork.sol | 2 + script/shared/libraries/LibProposal.sol | 74 +++++- 18 files changed, 621 insertions(+), 368 deletions(-) diff --git a/script/20231218-maptoken/20231218-maptoken-mainchain.s.sol b/script/20231218-maptoken/20231218-maptoken-mainchain.s.sol index 88995814..7cf53616 100644 --- a/script/20231218-maptoken/20231218-maptoken-mainchain.s.sol +++ b/script/20231218-maptoken/20231218-maptoken-mainchain.s.sol @@ -76,14 +76,9 @@ contract Migration__20231215_MapTokenMainchain is Migration { bytes[] memory calldatas = proxyData.toSingletonArray(); uint256[] memory gasAmounts = uint256(1_000_000).toSingletonArray(); - TNetwork currentNetwork = network(); - TNetwork companionNetwork = config.getCompanionNetwork(currentNetwork); + (uint256 companionChainId, TNetwork companionNetwork) = network().companionNetworkData(); address companionManager = config.getAddress(companionNetwork, Contract.MainchainBridgeManager.key()); - config.createFork(companionNetwork); - config.switchTo(companionNetwork); - uint256 companionChainId = block.chainid; - LibProposal.verifyProposalGasAmount(companionManager, targets, values, calldatas, gasAmounts); - config.switchTo(currentNetwork); + LibProposal.verifyMainchainProposalGasAmount(companionNetwork, companionManager, targets, values, calldatas, gasAmounts); vm.broadcast(sender()); _roninBridgeManager.propose(companionChainId, expiredTime, address(0), targets, values, calldatas, gasAmounts); diff --git a/script/20240115-mappixeltoken/20240115-maptoken-mainchain.s.sol b/script/20240115-mappixeltoken/20240115-maptoken-mainchain.s.sol index 2b13ebeb..6c30a645 100644 --- a/script/20240115-mappixeltoken/20240115-maptoken-mainchain.s.sol +++ b/script/20240115-mappixeltoken/20240115-maptoken-mainchain.s.sol @@ -11,10 +11,13 @@ import { LibTokenInfo, TokenInfo, TokenStandard } from "@ronin/contracts/librari import { Contract } from "../utils/Contract.sol"; import { Migration } from "../Migration.s.sol"; import { LibProposal } from "script/shared/libraries/LibProposal.sol"; +import { LibCompanionNetwork } from "script/shared/libraries/LibCompanionNetwork.sol"; import { TNetwork, Network } from "../utils/Network.sol"; import { Contract } from "../utils/Contract.sol"; contract Migration__MapTokenMainchain is Migration { + using LibCompanionNetwork for *; + RoninBridgeManager internal _roninBridgeManager; address constant _pixelRoninToken = address(0x8b50c162494567B3c8B7F00F6031341861c8dEeD); @@ -145,14 +148,9 @@ contract Migration__MapTokenMainchain is Migration { calldatas[3] = _addAxieChatGovernorAddress(); gasAmounts[3] = 1_000_000; - TNetwork currentNetwork = network(); - TNetwork companionNetwork = config.getCompanionNetwork(currentNetwork); + (uint256 companionChainId, TNetwork companionNetwork) = network().companionNetworkData(); address companionManager = config.getAddress(companionNetwork, Contract.MainchainBridgeManager.key()); - config.createFork(companionNetwork); - config.switchTo(companionNetwork); - uint256 companionChainId = block.chainid; - LibProposal.verifyProposalGasAmount(companionManager, targets, values, calldatas, gasAmounts); - config.switchTo(currentNetwork); + LibProposal.verifyMainchainProposalGasAmount(companionNetwork, companionManager, targets, values, calldatas, gasAmounts); vm.broadcast(sender()); _roninBridgeManager.propose(companionChainId, expiredTime, address(0), targets, values, calldatas, gasAmounts); diff --git a/script/20240115-mappixeltoken/20240115-maptoken-roninchain.s.sol b/script/20240115-mappixeltoken/20240115-maptoken-roninchain.s.sol index e6e4f5f0..aed10322 100644 --- a/script/20240115-mappixeltoken/20240115-maptoken-roninchain.s.sol +++ b/script/20240115-mappixeltoken/20240115-maptoken-roninchain.s.sol @@ -118,14 +118,9 @@ contract Migration__MapTokenRoninchain is Migration { calldatas[2] = _addAxieChatGovernorAddress(); gasAmounts[2] = 1_000_000; - TNetwork currentNetwork = network(); - TNetwork companionNetwork = config.getCompanionNetwork(currentNetwork); + (uint256 companionChainId, TNetwork companionNetwork) = network().companionNetworkData(); address companionManager = config.getAddress(companionNetwork, Contract.MainchainBridgeManager.key()); - config.createFork(companionNetwork); - config.switchTo(companionNetwork); - uint256 companionChainId = block.chainid; - LibProposal.verifyProposalGasAmount(companionManager, targets, values, calldatas, gasAmounts); - config.switchTo(currentNetwork); + LibProposal.verifyMainchainProposalGasAmount(companionNetwork, companionManager, targets, values, calldatas, gasAmounts); vm.broadcast(sender()); _roninBridgeManager.propose(block.chainid, expiredTime, address(0), targets, values, calldatas, gasAmounts); diff --git a/script/20240131-maptoken-pixel/20240131-maptoken-pixel-mainchain.s.sol b/script/20240131-maptoken-pixel/20240131-maptoken-pixel-mainchain.s.sol index ea78e79c..df2762eb 100644 --- a/script/20240131-maptoken-pixel/20240131-maptoken-pixel-mainchain.s.sol +++ b/script/20240131-maptoken-pixel/20240131-maptoken-pixel-mainchain.s.sol @@ -10,6 +10,7 @@ import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; import { LibTokenInfo, TokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; import { Contract } from "../utils/Contract.sol"; import { Migration } from "../Migration.s.sol"; +import { LibCompanionNetwork } from "script/shared/libraries/LibCompanionNetwork.sol"; import { TNetwork, Network } from "../utils/Network.sol"; import { LibProposal } from "script/shared/libraries/LibProposal.sol"; import { Contract } from "../utils/Contract.sol"; @@ -19,6 +20,7 @@ import "./update-axiechat-config.s.sol"; contract Migration__20240131_MapTokenPixelMainchain is Migration, Migration__MapToken_Pixel_Config, Migration__Update_AxieChat_Config { using LibProposal for *; + using LibCompanionNetwork for *; RoninBridgeManager internal _roninBridgeManager; address internal _mainchainGatewayV3; @@ -112,14 +114,9 @@ contract Migration__20240131_MapTokenPixelMainchain is Migration, Migration__Map // ================ VERIFY AND EXECUTE PROPOSAL =============== - TNetwork currentNetwork = network(); - TNetwork companionNetwork = config.getCompanionNetwork(currentNetwork); + (uint256 companionChainId, TNetwork companionNetwork) = network().companionNetworkData(); address companionManager = config.getAddress(companionNetwork, Contract.MainchainBridgeManager.key()); - config.createFork(companionNetwork); - config.switchTo(companionNetwork); - uint256 companionChainId = block.chainid; - LibProposal.verifyProposalGasAmount(companionManager, targets, values, calldatas, gasAmounts); - config.switchTo(currentNetwork); + LibProposal.verifyMainchainProposalGasAmount(companionNetwork, companionManager, targets, values, calldatas, gasAmounts); vm.broadcast(_governor); _roninBridgeManager.propose(companionChainId, expiredTime, address(0), targets, values, calldatas, gasAmounts); diff --git a/script/20240206-maptoken-banana/20240206-maptoken-banana-mainchain.s.sol b/script/20240206-maptoken-banana/20240206-maptoken-banana-mainchain.s.sol index a65d8abd..9f151d8a 100644 --- a/script/20240206-maptoken-banana/20240206-maptoken-banana-mainchain.s.sol +++ b/script/20240206-maptoken-banana/20240206-maptoken-banana-mainchain.s.sol @@ -11,6 +11,7 @@ import { Contract } from "../utils/Contract.sol"; import { Migration } from "../Migration.s.sol"; import { TNetwork, Network } from "../utils/Network.sol"; import { LibProposal } from "script/shared/libraries/LibProposal.sol"; +import { LibCompanionNetwork } from "script/shared/libraries/LibCompanionNetwork.sol"; import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol"; import { Contract } from "../utils/Contract.sol"; @@ -26,6 +27,8 @@ contract Migration__20240206_MapTokenBananaMainchain is Migration__MapToken_Genkai_Config, Migration__ChangeGV_StableNode_Config { + using LibCompanionNetwork for *; + RoninBridgeManager internal _roninBridgeManager; address internal _mainchainGatewayV3; address internal _mainchainBridgeManager; @@ -138,14 +141,9 @@ contract Migration__20240206_MapTokenBananaMainchain is // ================ VERIFY AND EXECUTE PROPOSAL =============== - TNetwork currentNetwork = network(); - TNetwork companionNetwork = config.getCompanionNetwork(currentNetwork); + (uint256 companionChainId, TNetwork companionNetwork) = network().companionNetworkData(); address companionManager = config.getAddress(companionNetwork, Contract.MainchainBridgeManager.key()); - config.createFork(companionNetwork); - config.switchTo(companionNetwork); - uint256 companionChainId = block.chainid; - LibProposal.verifyProposalGasAmount(companionManager, targets, values, calldatas, gasAmounts); - config.switchTo(currentNetwork); + LibProposal.verifyMainchainProposalGasAmount(companionNetwork, companionManager, targets, values, calldatas, gasAmounts); console2.log("Nonce:", vm.getNonce(_governor)); vm.broadcast(_governor); diff --git a/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol b/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol index 31540bf1..55cc2c6b 100644 --- a/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol +++ b/script/20240206-maptoken-banana/20240206-maptoken-banana-roninchain.s.sol @@ -74,21 +74,23 @@ contract Migration__20240206_MapTokenBananaRoninChain is // ============= MAP NEW BANANA, VX, GENKAI TOKEN =========== - uint256 companionChainId = network().companionChainId(); - roninTokens[0] = _bananaRoninToken; - mainchainTokens[0] = _bananaMainchainToken; - chainIds[0] = companionChainId; - standards[0] = TokenStandard.ERC20; - - roninTokens[1] = _VxRoninToken; - mainchainTokens[1] = _VxMainchainToken; - chainIds[1] = companionChainId; - standards[1] = TokenStandard.ERC721; - - roninTokens[2] = _genkaiRoninToken; - mainchainTokens[2] = _genkaiMainchainToken; - chainIds[2] = companionChainId; - standards[2] = TokenStandard.ERC721; + { + uint256 companionChainId = network().companionChainId(); + roninTokens[0] = _bananaRoninToken; + mainchainTokens[0] = _bananaMainchainToken; + chainIds[0] = companionChainId; + standards[0] = TokenStandard.ERC20; + + roninTokens[1] = _VxRoninToken; + mainchainTokens[1] = _VxMainchainToken; + chainIds[1] = companionChainId; + standards[1] = TokenStandard.ERC721; + + roninTokens[2] = _genkaiRoninToken; + mainchainTokens[2] = _genkaiMainchainToken; + chainIds[2] = companionChainId; + standards[2] = TokenStandard.ERC721; + } // function mapTokens( // address[] calldata _roninTokens, @@ -96,55 +98,58 @@ contract Migration__20240206_MapTokenBananaRoninChain is // uint256[] calldata chainIds, // TokenStandard[] calldata _standards // ) - bytes memory innerData = abi.encodeCall(IRoninGatewayV3.mapTokens, (roninTokens, mainchainTokens, chainIds, standards)); - bytes memory proxyData = abi.encodeWithSignature("functionDelegateCall(bytes)", innerData); - - targets[0] = _roninGatewayV3; - values[0] = 0; - calldatas[0] = proxyData; - gasAmounts[0] = 1_000_000; - - // ============= SET MIN THRESHOLD FOR BANANA, PIXEL, AGG ============ - // function setMinimumThresholds( - // address[] calldata _tokens, - // uint256[] calldata _thresholds - // ); - address[] memory roninTokensToSetMinThreshold = new address[](5); - uint256[] memory minThresholds = new uint256[](5); - - roninTokensToSetMinThreshold[0] = _bananaRoninToken; - minThresholds[0] = _bananaMinThreshold; - - roninTokensToSetMinThreshold[1] = pixelRoninToken; - minThresholds[1] = pixelMinThreshold; - - roninTokensToSetMinThreshold[2] = pixelMainchainToken; - minThresholds[2] = 0; - - roninTokensToSetMinThreshold[3] = aggRoninToken; - minThresholds[3] = aggMinThreshold; - - roninTokensToSetMinThreshold[4] = aggMainchainToken; - minThresholds[4] = 0; - - innerData = abi.encodeCall(MinimumWithdrawal.setMinimumThresholds, (roninTokensToSetMinThreshold, minThresholds)); - proxyData = abi.encodeWithSignature("functionDelegateCall(bytes)", innerData); - - targets[1] = _roninGatewayV3; - values[1] = 0; - calldatas[1] = proxyData; - gasAmounts[1] = 1_000_000; - - // =============== AXIE CHAT UPDATE =========== - targets[2] = address(_roninBridgeManager); - values[2] = 0; - calldatas[2] = _removeStableNodeGovernorAddress(); - gasAmounts[2] = 1_000_000; - - targets[3] = address(_roninBridgeManager); - values[3] = 0; - calldatas[3] = _addStableNodeGovernorAddress(); - gasAmounts[3] = 1_000_000; + { + bytes memory innerData = abi.encodeCall(IRoninGatewayV3.mapTokens, (roninTokens, mainchainTokens, chainIds, standards)); + bytes memory proxyData = abi.encodeWithSignature("functionDelegateCall(bytes)", innerData); + + targets[0] = _roninGatewayV3; + values[0] = 0; + calldatas[0] = proxyData; + gasAmounts[0] = 1_000_000; + + // ============= SET MIN THRESHOLD FOR BANANA, PIXEL, AGG ============ + // function setMinimumThresholds( + // address[] calldata _tokens, + // uint256[] calldata _thresholds + // ); + + address[] memory roninTokensToSetMinThreshold = new address[](5); + uint256[] memory minThresholds = new uint256[](5); + + roninTokensToSetMinThreshold[0] = _bananaRoninToken; + minThresholds[0] = _bananaMinThreshold; + + roninTokensToSetMinThreshold[1] = pixelRoninToken; + minThresholds[1] = pixelMinThreshold; + + roninTokensToSetMinThreshold[2] = pixelMainchainToken; + minThresholds[2] = 0; + + roninTokensToSetMinThreshold[3] = aggRoninToken; + minThresholds[3] = aggMinThreshold; + + roninTokensToSetMinThreshold[4] = aggMainchainToken; + minThresholds[4] = 0; + + innerData = abi.encodeCall(MinimumWithdrawal.setMinimumThresholds, (roninTokensToSetMinThreshold, minThresholds)); + proxyData = abi.encodeWithSignature("functionDelegateCall(bytes)", innerData); + + targets[1] = _roninGatewayV3; + values[1] = 0; + calldatas[1] = proxyData; + gasAmounts[1] = 1_000_000; + + // =============== AXIE CHAT UPDATE =========== + targets[2] = address(_roninBridgeManager); + values[2] = 0; + calldatas[2] = _removeStableNodeGovernorAddress(); + gasAmounts[2] = 1_000_000; + + targets[3] = address(_roninBridgeManager); + values[3] = 0; + calldatas[3] = _addStableNodeGovernorAddress(); + gasAmounts[3] = 1_000_000; + } // ================ VERIFY AND EXECUTE PROPOSAL =============== diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol index ba890963..d231c4d9 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol @@ -10,7 +10,6 @@ import { LibTokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibToken import { Contract } from "../utils/Contract.sol"; import { Network } from "../utils/Network.sol"; import { Contract } from "../utils/Contract.sol"; -import { IGeneralConfigExtended } from "../interfaces/IGeneralConfigExtended.sol"; import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; import "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; import "@ronin/contracts/mainchain/MainchainGatewayV3.sol"; diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol index 19ed6835..213649bb 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol @@ -10,7 +10,6 @@ import { LibTokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibToken import { Contract } from "../utils/Contract.sol"; import { Network } from "../utils/Network.sol"; import { Contract } from "../utils/Contract.sol"; -import { IGeneralConfigExtended } from "../interfaces/IGeneralConfigExtended.sol"; import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; import "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; import "@ronin/contracts/mainchain/MainchainGatewayV3.sol"; diff --git a/script/GeneralConfig.sol b/script/GeneralConfig.sol index 5a04aa4c..b7c39a1d 100644 --- a/script/GeneralConfig.sol +++ b/script/GeneralConfig.sol @@ -4,7 +4,6 @@ pragma solidity ^0.8.23; import { console2 as console } from "forge-std/console2.sol"; import { BaseGeneralConfig } from "@fdk/BaseGeneralConfig.sol"; import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol"; -import { TNetwork } from "@fdk/types/Types.sol"; import { Contract } from "./utils/Contract.sol"; import { TNetwork, Network } from "./utils/Network.sol"; import { Utils } from "./utils/Utils.sol"; @@ -42,8 +41,8 @@ contract GeneralConfig is BaseGeneralConfig, Utils { function getCompanionNetwork(TNetwork network) public view virtual returns (TNetwork companionNetwork) { if (network == DefaultNetwork.RoninMainnet.key()) return Network.EthMainnet.key(); if (network == Network.EthMainnet.key()) return DefaultNetwork.RoninMainnet.key(); - if (network == DefaultNetwork.RoninTestnet.key()) return Network.Goerli.key(); - if (network == Network.Goerli.key()) return DefaultNetwork.RoninTestnet.key(); + if (network == DefaultNetwork.RoninTestnet.key()) return Network.Sepolia.key(); + if (network == Network.Sepolia.key()) return DefaultNetwork.RoninTestnet.key(); if (network == DefaultNetwork.Local.key()) return DefaultNetwork.Local.key(); revert("Network: Unknown companion network"); diff --git a/script/Migration.s.sol b/script/Migration.s.sol index 195f8df3..146a3c5f 100644 --- a/script/Migration.s.sol +++ b/script/Migration.s.sol @@ -30,6 +30,8 @@ contract Migration is PostChecker, Utils { uint256 internal constant DEFAULT_PROPOSAL_GAS = 1_000_000; ISharedArgument internal constant config = ISharedArgument(address(CONFIG)); + bool internal _isLocalETH; + function setUp() public virtual override { super.setUp(); } @@ -93,6 +95,8 @@ contract Migration is PostChecker, Utils { param.mainchainBridgeManager.targets = targets; } else if (network() == DefaultNetwork.RoninTestnet.key()) { // Undefined + } else if (network() == DefaultNetwork.RoninMainnet.key()) { + // Undefined } else if (network() == DefaultNetwork.Local.key()) { // test param.test.numberOfBlocksInEpoch = 200; @@ -198,37 +202,43 @@ contract Migration is PostChecker, Utils { rawArgs = abi.encode(param); } - function _getProxyAdmin() internal virtual override returns (address payable) { - bool isLocalNetwork = network() == DefaultNetwork.Local.key(); - return isLocalNetwork ? payable(config.sharedArguments().test.proxyAdmin) : super._getProxyAdmin(); - } - - function _getProxyAdminFromCurrentNetwork() internal view virtual returns (address proxyAdmin) { + function _getProxyAdmin() internal virtual override returns (address payable proxyAdmin) { TNetwork currentNetwork = network(); - if (currentNetwork == DefaultNetwork.RoninTestnet.key() || currentNetwork == DefaultNetwork.RoninMainnet.key()) { - proxyAdmin = config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key()); - } else if (currentNetwork == Network.Goerli.key() || currentNetwork == Network.EthMainnet.key()) { - proxyAdmin = config.getAddressFromCurrentNetwork(Contract.MainchainBridgeManager.key()); + if ( + currentNetwork == DefaultNetwork.RoninTestnet.key() || currentNetwork == DefaultNetwork.RoninMainnet.key() || currentNetwork == Network.RoninDevnet.key() + ) { + proxyAdmin = loadContract(Contract.RoninBridgeManager.key()); + } else if (currentNetwork == Network.Sepolia.key() || currentNetwork == Network.Goerli.key() || currentNetwork == Network.EthMainnet.key()) { + proxyAdmin = loadContract(Contract.MainchainBridgeManager.key()); + } else if (currentNetwork == DefaultNetwork.Local.key()) { + TContract managerContractType = _isLocalETH ? Contract.MainchainBridgeManager.key() : Contract.RoninBridgeManager.key(); + try config.getAddressFromCurrentNetwork(managerContractType) returns (address payable addr) { + proxyAdmin = addr; + } catch { + proxyAdmin = payable(config.sharedArguments().test.proxyAdmin); + } } else { - revert("BridgeMigration(_getProxyAdminFromCurrentNetwork): Unhandled case"); + console.log("Network not supported".yellow(), currentNetwork.networkName()); + console.log("Chain Id".yellow(), block.chainid); + revert("BridgeMigration(_getProxyAdmin): Unhandled case"); } } function _upgradeRaw(address proxyAdmin, address payable proxy, address logic, bytes memory args) internal virtual override { - if (logic.codehash == payable(proxy).getProxyImplementation({ nullCheck: true }).codehash) { + if (!config.isPostChecking() && logic.codehash == payable(proxy).getProxyImplementation({ nullCheck: true }).codehash) { console.log("BaseMigration: Logic is already upgraded!".yellow()); return; } assertTrue(proxyAdmin != address(0x0), "BridgeMigration: Invalid {proxyAdmin} or {proxy} is not a Proxy contract"); - address admin = _getProxyAdminFromCurrentNetwork(); + address admin = _getProxyAdmin(); TNetwork currentNetwork = network(); if (proxyAdmin == admin) { // in case proxyAdmin is GovernanceAdmin if ( currentNetwork == DefaultNetwork.RoninTestnet.key() || currentNetwork == DefaultNetwork.RoninMainnet.key() - || currentNetwork == Network.RoninDevnet.key() + || currentNetwork == Network.RoninDevnet.key() || currentNetwork == DefaultNetwork.Local.key() ) { // handle for ronin network console.log(StdStyle.yellow("Voting on RoninBridgeManager for upgrading...")); @@ -244,6 +254,7 @@ contract Migration is PostChecker, Utils { : abi.encodeCall(TransparentUpgradeableProxy.upgradeToAndCall, (logic, args)); Proposal.ProposalDetail memory proposal = LibProposal.createProposal({ + manager: address(manager), nonce: manager.round(block.chainid) + 1, expiryTimestamp: block.timestamp + 10 minutes, targets: targets, @@ -254,7 +265,7 @@ contract Migration is PostChecker, Utils { manager.executeProposal(proposal); assertEq(proxy.getProxyImplementation(), logic, "BridgeMigration: Upgrade failed"); - } else if (currentNetwork == Network.Goerli.key() || currentNetwork == Network.EthMainnet.key()) { + } else if (currentNetwork == Network.Sepolia.key() || currentNetwork == Network.Goerli.key() || currentNetwork == Network.EthMainnet.key()) { // handle for ethereum revert("BridgeMigration: Unhandled case for ETH"); } else { @@ -277,6 +288,10 @@ contract Migration is PostChecker, Utils { } } + function _deployLogic(TContract contractType) internal virtual override returns (address payable logic) { + logic = _deployLogic(contractType, EMPTY_ARGS); + } + function _deployProxy( TContract contractType, bytes memory args @@ -302,4 +317,15 @@ contract Migration is PostChecker, Utils { config.setAddress(network(), contractType, deployed); ARTIFACT_FACTORY.generateArtifact(sender(), deployed, proxyAbsolutePath, string.concat(contractName, "Proxy"), args, proxyNonce); } + + function _getProxyAdminFromCurrentNetwork() internal view virtual returns (address proxyAdmin) { + TNetwork currentNetwork = network(); + if (currentNetwork == DefaultNetwork.RoninTestnet.key() || currentNetwork == DefaultNetwork.RoninMainnet.key()) { + proxyAdmin = config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key()); + } else if (currentNetwork == Network.Goerli.key() || currentNetwork == Network.EthMainnet.key()) { + proxyAdmin = config.getAddressFromCurrentNetwork(Contract.MainchainBridgeManager.key()); + } else { + revert("BridgeMigration(_getProxyAdminFromCurrentNetwork): Unhandled case"); + } + } } diff --git a/script/deploy-v0.3.1/01_Deploy_RoninBridge.s.sol b/script/deploy-v0.3.1/01_Deploy_RoninBridge.s.sol index 6dc3f7ee..3c296cf4 100644 --- a/script/deploy-v0.3.1/01_Deploy_RoninBridge.s.sol +++ b/script/deploy-v0.3.1/01_Deploy_RoninBridge.s.sol @@ -1,104 +1,136 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.23; -// import { Migration } from "../Migration.s.sol"; -// import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; -// import { BridgeSlash, BridgeSlashDeploy } from "../contracts/BridgeSlashDeploy.s.sol"; -// import { BridgeReward, BridgeRewardDeploy } from "../contracts/BridgeRewardDeploy.s.sol"; -// import { BridgeTracking, BridgeTrackingDeploy } from "../contracts/BridgeTrackingDeploy.s.sol"; -// import { RoninGatewayV3, RoninGatewayV3Deploy } from "../contracts/RoninGatewayV3Deploy.s.sol"; -// import { RoninBridgeManager, RoninBridgeManagerDeploy } from "../contracts/RoninBridgeManagerDeploy.s.sol"; +import { console } from "forge-std/console.sol"; +import { StdStyle } from "forge-std/StdStyle.sol"; +import { Migration } from "../Migration.s.sol"; +import { TNetwork, Network } from "../utils/Network.sol"; +import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol"; +import { TContract, Contract } from "../utils/Contract.sol"; +import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; +import { BridgeSlash, BridgeSlashDeploy } from "../contracts/BridgeSlashDeploy.s.sol"; +import { BridgeReward, BridgeRewardDeploy } from "../contracts/BridgeRewardDeploy.s.sol"; +import { BridgeTracking, BridgeTrackingDeploy } from "../contracts/BridgeTrackingDeploy.s.sol"; +import { RoninGatewayV3, RoninGatewayV3Deploy } from "../contracts/RoninGatewayV3Deploy.s.sol"; +import { RoninBridgeManagerConstructor, RoninBridgeManager, RoninBridgeManagerDeploy } from "../contracts/RoninBridgeManagerDeploy.s.sol"; -// contract Migration_01_Deploy_RoninBridge is Migration { -// BridgeSlash private _bridgeSlash; -// BridgeReward private _bridgeReward; -// RoninGatewayV3 private _roninGatewayV3; -// BridgeTracking private _bridgeTracking; -// RoninBridgeManager private _roninBridgeManager; -// address private _validatorSet; +contract Migration_01_Deploy_RoninBridge is Migration { + using StdStyle for *; -// function run() external { -// _roninGatewayV3 = new RoninGatewayV3Deploy().run(); -// _bridgeSlash = new BridgeSlashDeploy().run(); -// _bridgeReward = new BridgeRewardDeploy().run(); -// _bridgeTracking = new BridgeTrackingDeploy().run(); -// _roninBridgeManager = new RoninBridgeManagerDeploy().run(); + BridgeSlash private _bridgeSlash; + BridgeReward private _bridgeReward; + RoninGatewayV3 private _roninGatewayV3; + BridgeTracking private _bridgeTracking; + RoninBridgeManager private _roninBridgeManager; + address private _validatorSet; -// _initBridgeReward(); -// _initBridgeSlash(); -// _initRoninGatewayV3(); -// _initBridgeTracking(); -// _initRoninBridgeManager(); -// } + function run() external { + _roninGatewayV3 = new RoninGatewayV3Deploy().run(); + _bridgeSlash = new BridgeSlashDeploy().run(); + _bridgeReward = new BridgeRewardDeploy().run(); + _bridgeTracking = new BridgeTrackingDeploy().run(); -// function _initRoninBridgeManager() internal logFn("Init RoninBridgeManager") { -// ISharedArgument.BridgeManagerParam memory param = config.sharedArguments().roninBridgeManager; -// // address[] memory callbackRegisters = new address[](1); -// // callbackRegisters[0] = address(_bridgeSlash); -// // callbackRegisters[1] = address(_roninGatewayV3); + ISharedArgument.BridgeManagerParam memory param = config.sharedArguments().roninBridgeManager; + address[] memory callbackRegisters = new address[](1); + callbackRegisters[0] = address(_bridgeSlash); + callbackRegisters[1] = address(_roninGatewayV3); -// _roninBridgeManager.initialize({ -// num: param.num, -// denom: param.denom, -// roninChainId: block.chainid, -// expiryDuration: param.expiryDuration, -// bridgeContract: address(_roninGatewayV3), -// callbackRegisters: param.callbackRegisters, -// bridgeOperators: param.bridgeOperators, -// governors: param.governors, -// voteWeights: param.voteWeights, -// targetOptions: param.targetOptions, -// targets: param.targets -// }); -// } + _roninBridgeManager = RoninBridgeManager( + new RoninBridgeManagerDeploy().overrideArgs( + abi.encodeCall( + RoninBridgeManagerConstructor.initialize, + ( + param.num, + param.denom, + param.roninChainId, + param.expiryDuration, + param.bridgeContract, + param.callbackRegisters, + param.bridgeOperators, + param.governors, + param.voteWeights, + param.targetOptions, + param.targets + ) + ) + ).run() + ); -// function _initBridgeTracking() internal logFn("Init BridgeTracking") { -// _bridgeTracking.initialize({ bridgeContract: address(_roninGatewayV3), validatorContract: _validatorSet, startedAtBlock_: 0 }); -// _bridgeTracking.initializeV3({ -// bridgeManager: address(_roninBridgeManager), -// bridgeSlash: address(_bridgeSlash), -// bridgeReward: address(_bridgeReward), -// dposGA: address(0x0) -// }); -// } + _initBridgeReward(); + _initBridgeSlash(); + _initRoninGatewayV3(); + _initBridgeTracking(); + // _initRoninBridgeManager(); + } -// function _initBridgeReward() internal logFn("Init BridgeReward") { -// ISharedArgument.BridgeRewardParam memory param = config.sharedArguments().bridgeReward; -// _bridgeReward.initialize({ -// bridgeManagerContract: address(_roninBridgeManager), -// bridgeTrackingContract: address(_bridgeTracking), -// bridgeSlashContract: address(_bridgeSlash), -// validatorSetContract: _validatorSet, -// dposGA: address(0x0), -// rewardPerPeriod: param.rewardPerPeriod -// }); -// // _bridgeReward.initializeREP2(); -// _bridgeReward.initializeV2(); -// } + function _initRoninBridgeManager() internal logFn("Init RoninBridgeManager") { + ISharedArgument.BridgeManagerParam memory param = config.sharedArguments().roninBridgeManager; + // address[] memory callbackRegisters = new address[](1); + // callbackRegisters[0] = address(_bridgeSlash); + // callbackRegisters[1] = address(_roninGatewayV3); -// function _initBridgeSlash() internal logFn("Init BridgeSlash") { -// _bridgeSlash.initialize({ -// validatorContract: _validatorSet, -// bridgeManagerContract: address(_roninBridgeManager), -// bridgeTrackingContract: address(_bridgeTracking), -// dposGA: address(0x0) -// }); -// } + // _roninBridgeManager.initialize({ + // num: param.num, + // denom: param.denom, + // roninChainId: block.chainid, + // expiryDuration: param.expiryDuration, + // bridgeContract: address(_roninGatewayV3), + // callbackRegisters: param.callbackRegisters, + // bridgeOperators: param.bridgeOperators, + // governors: param.governors, + // voteWeights: param.voteWeights, + // targetOptions: param.targetOptions, + // targets: param.targets + // }); + } -// function _initRoninGatewayV3() internal logFn("Init RoninGatewayV3") { -// ISharedArgument.RoninGatewayV3Param memory param = config.sharedArguments().roninGatewayV3; + function _initBridgeTracking() internal logFn("Init BridgeTracking") { + _bridgeTracking.initialize({ bridgeContract: address(_roninGatewayV3), validatorContract: _validatorSet, startedAtBlock_: 0 }); + _bridgeTracking.initializeV3({ + bridgeManager: address(_roninBridgeManager), + bridgeSlash: address(_bridgeSlash), + bridgeReward: address(_bridgeReward), + dposGA: address(0x0) + }); + } -// _roninGatewayV3.initialize( -// param.roleSetter, -// param.numerator, -// param.denominator, -// param.trustedNumerator, -// param.trustedDenominator, -// param.withdrawalMigrators, -// param.packedAddresses, -// param.packedNumbers, -// param.standards -// ); -// _roninGatewayV3.initializeV3(address(_roninBridgeManager)); -// } -// } + function _initBridgeReward() internal logFn("Init BridgeReward") { + ISharedArgument.BridgeRewardParam memory param = config.sharedArguments().bridgeReward; + _bridgeReward.initialize({ + bridgeManagerContract: address(_roninBridgeManager), + bridgeTrackingContract: address(_bridgeTracking), + bridgeSlashContract: address(_bridgeSlash), + validatorSetContract: _validatorSet, + dposGA: address(0x0), + rewardPerPeriod: param.rewardPerPeriod + }); + // _bridgeReward.initializeREP2(); + _bridgeReward.initializeV2(); + } + + function _initBridgeSlash() internal logFn("Init BridgeSlash") { + _bridgeSlash.initialize({ + validatorContract: _validatorSet, + bridgeManagerContract: address(_roninBridgeManager), + bridgeTrackingContract: address(_bridgeTracking), + dposGA: address(0x0) + }); + } + + function _initRoninGatewayV3() internal logFn("Init RoninGatewayV3") { + ISharedArgument.RoninGatewayV3Param memory param = config.sharedArguments().roninGatewayV3; + + _roninGatewayV3.initialize( + param.roleSetter, + param.numerator, + param.denominator, + param.trustedNumerator, + param.trustedDenominator, + param.withdrawalMigrators, + param.packedAddresses, + param.packedNumbers, + param.standards + ); + _roninGatewayV3.initializeV3(address(_roninBridgeManager)); + } +} diff --git a/script/deploy-v0.3.1/02_Deploy_MainchainBridge.s.sol b/script/deploy-v0.3.1/02_Deploy_MainchainBridge.s.sol index a0a47cc1..fa1158e6 100644 --- a/script/deploy-v0.3.1/02_Deploy_MainchainBridge.s.sol +++ b/script/deploy-v0.3.1/02_Deploy_MainchainBridge.s.sol @@ -1,76 +1,85 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.23; -// import { Migration } from "../Migration.s.sol"; -// import { Contract } from "../utils/Contract.sol"; -// import { IWETH } from "@ronin/contracts/interfaces/IWETH.sol"; -// import { WETHDeploy } from "../contracts/token/WETHDeploy.s.sol"; -// import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; -// import { LibCompanionNetwork } from "script/shared/libraries/LibCompanionNetwork.sol"; -// import { MainchainGatewayV3, MainchainGatewayV3Deploy } from "../contracts/MainchainGatewayV3Deploy.s.sol"; -// import { WethUnwrapper, MainchainWethUnwrapperDeploy } from "../contracts/MainchainWethUnwrapperDeploy.s.sol"; -// import { MainchainBridgeManager, MainchainBridgeManagerDeploy } from "../contracts/MainchainBridgeManagerDeploy.s.sol"; +import { console } from "forge-std/console.sol"; +import { StdStyle } from "forge-std/StdStyle.sol"; +import { Migration } from "../Migration.s.sol"; +import { TContract, Contract } from "../utils/Contract.sol"; +import { TNetwork, Network } from "../utils/Network.sol"; +import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol"; +import { IWETH } from "@ronin/contracts/interfaces/IWETH.sol"; +import { WETHDeploy } from "../contracts/token/WETHDeploy.s.sol"; +import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; +import { LibCompanionNetwork } from "script/shared/libraries/LibCompanionNetwork.sol"; +import { MainchainGatewayV3, MainchainGatewayV3Deploy } from "../contracts/MainchainGatewayV3Deploy.s.sol"; +import { WethUnwrapper, MainchainWethUnwrapperDeploy } from "../contracts/MainchainWethUnwrapperDeploy.s.sol"; +import { MainchainBridgeManager, MainchainBridgeManagerDeploy } from "../contracts/MainchainBridgeManagerDeploy.s.sol"; -// contract Migration_02_Deploy_MainchainBridge is Migration { -// using LibCompanionNetwork for *; +contract Migration_02_Deploy_MainchainBridge is Migration { + using StdStyle for *; + using LibCompanionNetwork for *; -// address private _weth; -// WethUnwrapper private _mainchainWethUnwrapper; -// MainchainGatewayV3 private _mainchainGatewayV3; -// MainchainBridgeManager private _mainchainBridgeManager; + address private _weth; + WethUnwrapper private _mainchainWethUnwrapper; + MainchainGatewayV3 private _mainchainGatewayV3; + MainchainBridgeManager private _mainchainBridgeManager; -// function _injectDependencies() internal virtual override { -// _setDependencyDeployScript(Contract.WETH.key(), new WETHDeploy()); -// } + function _injectDependencies() internal virtual override { + _setDependencyDeployScript(Contract.WETH.key(), new WETHDeploy()); + } -// function run() external { -// _weth = loadContractOrDeploy(Contract.WETH.key()); -// _mainchainGatewayV3 = new MainchainGatewayV3Deploy().run(); -// _mainchainBridgeManager = new MainchainBridgeManagerDeploy().run(); -// _mainchainWethUnwrapper = new MainchainWethUnwrapperDeploy().run(); + function run() external { + _isLocalETH = true; -// _initMainchainGatewayV3(); -// _initMainchainBridgeManager(); -// } + _mainchainBridgeManager = new MainchainBridgeManagerDeploy().run(); + _weth = loadContractOrDeploy(Contract.WETH.key()); + _mainchainGatewayV3 = new MainchainGatewayV3Deploy().run(); + _mainchainWethUnwrapper = new MainchainWethUnwrapperDeploy().run(); -// function _initMainchainBridgeManager() internal logFn("Init RoninBridgeManager") { -// ISharedArgument.BridgeManagerParam memory param = config.sharedArguments().mainchainBridgeManager; -// // address[] memory callbackRegisters = new address[](1); -// // callbackRegisters[0] = address(_bridgeSlash); -// // callbackRegisters[1] = address(_roninGatewayV3); + _initMainchainGatewayV3(); + _initMainchainBridgeManager(); -// uint256 companionChainId = network().companionChainId(); -// _mainchainBridgeManager.initialize({ -// num: param.num, -// denom: param.denom, -// roninChainId: companionChainId, -// bridgeContract: address(_mainchainGatewayV3), -// callbackRegisters: param.callbackRegisters, -// bridgeOperators: param.bridgeOperators, -// governors: param.governors, -// voteWeights: param.voteWeights, -// targetOptions: param.targetOptions, -// targets: param.targets -// }); -// } + _isLocalETH = false; + } -// function _initMainchainGatewayV3() internal logFn("Init MainchainGatewayV3") { -// ISharedArgument.MainchainGatewayV3Param memory param = config.sharedArguments().mainchainGatewayV3; + function _initMainchainBridgeManager() internal logFn("Init RoninBridgeManager") { + ISharedArgument.BridgeManagerParam memory param = config.sharedArguments().mainchainBridgeManager; + // address[] memory callbackRegisters = new address[](1); + // callbackRegisters[0] = address(_bridgeSlash); + // callbackRegisters[1] = address(_roninGatewayV3); -// uint256 companionChainId = network().companionChainId(); -// _mainchainGatewayV3.initialize( -// param.roleSetter, -// IWETH(_weth), -// companionChainId, -// param.numerator, -// param.highTierVWNumerator, -// param.denominator, -// param.addresses, -// param.thresholds, -// param.standards -// ); -// _mainchainGatewayV3.initializeV2(address(_mainchainBridgeManager)); -// _mainchainGatewayV3.initializeV3(); -// _mainchainGatewayV3.initializeV4(payable(address(_mainchainWethUnwrapper))); -// } -// } + uint256 companionChainId = network().companionChainId(); + _mainchainBridgeManager.initialize({ + num: param.num, + denom: param.denom, + roninChainId: companionChainId, + bridgeContract: address(_mainchainGatewayV3), + callbackRegisters: param.callbackRegisters, + bridgeOperators: param.bridgeOperators, + governors: param.governors, + voteWeights: param.voteWeights, + targetOptions: param.targetOptions, + targets: param.targets + }); + } + + function _initMainchainGatewayV3() internal logFn("Init MainchainGatewayV3") { + ISharedArgument.MainchainGatewayV3Param memory param = config.sharedArguments().mainchainGatewayV3; + + uint256 companionChainId = network().companionChainId(); + _mainchainGatewayV3.initialize( + param.roleSetter, + IWETH(_weth), + companionChainId, + param.numerator, + param.highTierVWNumerator, + param.denominator, + param.addresses, + param.thresholds, + param.standards + ); + _mainchainGatewayV3.initializeV2(address(_mainchainBridgeManager)); + _mainchainGatewayV3.initializeV3(); + _mainchainGatewayV3.initializeV4(payable(address(_mainchainWethUnwrapper))); + } +} diff --git a/script/deploy-v0.3.1/Deploy.v0.3.1.s.sol b/script/deploy-v0.3.1/Deploy.v0.3.1.s.sol index 1bee4de5..ad534228 100644 --- a/script/deploy-v0.3.1/Deploy.v0.3.1.s.sol +++ b/script/deploy-v0.3.1/Deploy.v0.3.1.s.sol @@ -1,46 +1,46 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.23; -// import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol"; -// import { Migration } from "../Migration.s.sol"; -// import { Contract } from "../utils/Contract.sol"; -// import { TNetwork, Network } from "../utils/Network.sol"; -// import { Migration_01_Deploy_RoninBridge } from "./01_Deploy_RoninBridge.s.sol"; -// import { LibCompanionNetwork } from "../shared/libraries/LibCompanionNetwork.sol"; -// import { Migration_02_Deploy_MainchainBridge } from "./02_Deploy_MainchainBridge.s.sol"; - -// contract Deploy_v0_3_1 is Migration { -// using LibCompanionNetwork for *; - -// function run() external { -// TNetwork currentNetwork = network(); -// TNetwork companionNetwork = currentNetwork.companionNetwork(); - -// if ( -// currentNetwork == DefaultNetwork.RoninMainnet.key() || currentNetwork == DefaultNetwork.RoninTestnet.key() || currentNetwork == Network.RoninDevnet.key() -// ) { -// new Migration_01_Deploy_RoninBridge().run(); - -// config.createFork(companionNetwork); -// config.switchTo(companionNetwork); - -// new Migration_02_Deploy_MainchainBridge().run(); - -// config.switchTo(currentNetwork); -// } else if (currentNetwork == Network.EthMainnet.key() || currentNetwork == Network.Goerli.key() || currentNetwork == Network.Sepolia.key()) { -// config.createFork(companionNetwork); -// config.switchTo(companionNetwork); - -// new Migration_01_Deploy_RoninBridge().run(); - -// config.switchTo(currentNetwork); - -// new Migration_02_Deploy_MainchainBridge().run(); -// } else if (currentNetwork == DefaultNetwork.Local.key()) { -// new Migration_01_Deploy_RoninBridge().run(); -// new Migration_02_Deploy_MainchainBridge().run(); -// } else { -// revert("Unsupported network"); -// } -// } -// } +import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol"; +import { Migration } from "../Migration.s.sol"; +import { Contract } from "../utils/Contract.sol"; +import { TNetwork, Network } from "../utils/Network.sol"; +import { Migration_01_Deploy_RoninBridge } from "./01_Deploy_RoninBridge.s.sol"; +import { LibCompanionNetwork } from "../shared/libraries/LibCompanionNetwork.sol"; +import { Migration_02_Deploy_MainchainBridge } from "./02_Deploy_MainchainBridge.s.sol"; + +contract Deploy_v0_3_1 is Migration { + using LibCompanionNetwork for *; + + function run() external { + TNetwork currentNetwork = network(); + TNetwork companionNetwork = currentNetwork.companionNetwork(); + + if ( + currentNetwork == DefaultNetwork.RoninMainnet.key() || currentNetwork == DefaultNetwork.RoninTestnet.key() || currentNetwork == Network.RoninDevnet.key() + ) { + new Migration_01_Deploy_RoninBridge().run(); + + config.createFork(companionNetwork); + config.switchTo(companionNetwork); + + new Migration_02_Deploy_MainchainBridge().run(); + + config.switchTo(currentNetwork); + } else if (currentNetwork == Network.EthMainnet.key() || currentNetwork == Network.Goerli.key() || currentNetwork == Network.Sepolia.key()) { + config.createFork(companionNetwork); + config.switchTo(companionNetwork); + + new Migration_01_Deploy_RoninBridge().run(); + + config.switchTo(currentNetwork); + + new Migration_02_Deploy_MainchainBridge().run(); + } else if (currentNetwork == DefaultNetwork.Local.key()) { + new Migration_01_Deploy_RoninBridge().run(); + new Migration_02_Deploy_MainchainBridge().run(); + } else { + revert("Unsupported network"); + } + } +} diff --git a/script/post-check/BasePostCheck.s.sol b/script/post-check/BasePostCheck.s.sol index 7b9219f8..0033178b 100644 --- a/script/post-check/BasePostCheck.s.sol +++ b/script/post-check/BasePostCheck.s.sol @@ -30,6 +30,7 @@ abstract contract BasePostCheck is BaseMigration { function _afterPostCheck(string memory postCheckLabel, uint256 snapshotId) private { console.log(string.concat("Postcheck ", postCheckLabel.italic(), " successful!\n").green()); - vm.revertTo(snapshotId); + bool reverted = vm.revertTo(snapshotId); + assertTrue(reverted, string.concat("Cannot revert to snapshot id: ", vm.toString(snapshotId))); } } diff --git a/script/post-check/bridge-manager/crud/PostCheck_BridgeManager_CRUD_addBridgeOperators.s.sol b/script/post-check/bridge-manager/crud/PostCheck_BridgeManager_CRUD_addBridgeOperators.s.sol index b8102be0..be54b06a 100644 --- a/script/post-check/bridge-manager/crud/PostCheck_BridgeManager_CRUD_addBridgeOperators.s.sol +++ b/script/post-check/bridge-manager/crud/PostCheck_BridgeManager_CRUD_addBridgeOperators.s.sol @@ -32,7 +32,7 @@ abstract contract PostCheck_BridgeManager_CRUD_AddBridgeOperators is BasePostChe function validate_RevertWhen_NotSelfCalled_addBridgeOperators() private onPostCheck("validate_RevertWhen_NotSelfCalled_addBridgeOperators") { vm.expectRevert(); vm.prank(any); - bool[] memory addeds = IBridgeManager(_manager[block.chainid]).addBridgeOperators( + IBridgeManager(_manager[block.chainid]).addBridgeOperators( voteWeight.toSingletonArray().toUint96sUnsafe(), operator.toSingletonArray(), governor.toSingletonArray() ); } diff --git a/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol b/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol index 5809d277..9de9e916 100644 --- a/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol +++ b/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol @@ -1,11 +1,17 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; +import { console } from "forge-std/console.sol"; +import { TransparentUpgradeableProxy } from "@ronin/contracts/extensions/TransparentUpgradeableProxyV2.sol"; import { BasePostCheck } from "../../BasePostCheck.s.sol"; import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; +import { MainchainBridgeManager } from "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; import { TContract, Contract } from "script/utils/Contract.sol"; -import "script/shared/libraries/LibProposal.sol"; +import { TNetwork, Network } from "script/utils/Network.sol"; +import { LibArray } from "script/shared/libraries/LibArray.sol"; +import { LibCompanionNetwork } from "script/shared/libraries/LibCompanionNetwork.sol"; +import { Ballot, SignatureConsumer, Proposal, GlobalProposal, LibProposal } from "script/shared/libraries/LibProposal.sol"; import { LibProxy } from "@fdk/libraries/LibProxy.sol"; import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol"; @@ -13,13 +19,17 @@ abstract contract PostCheck_BridgeManager_Proposal is BasePostCheck { using LibArray for *; using LibProxy for *; using LibProposal for *; + using LibCompanionNetwork for *; + + address private _cheatGovernor; + address private _cheatOperator; + uint256 private _cheatGovernorPk; uint96[] private _voteWeights = [100, 100]; address[] private _addingGovernors = [makeAddr("governor-1"), makeAddr("governor-2")]; address[] private _addingOperators = [makeAddr("operator-1"), makeAddr("operator-2")]; - address[] private _proxyTargets; - modifier onlyOnRoninNetwork() { + modifier onlyOnRoninNetworkOrLocal() { require( block.chainid == DefaultNetwork.RoninMainnet.chainId() || block.chainid == DefaultNetwork.RoninTestnet.chainId() || block.chainid == Network.RoninDevnet.chainId() || block.chainid == DefaultNetwork.Local.chainId(), @@ -30,21 +40,89 @@ abstract contract PostCheck_BridgeManager_Proposal is BasePostCheck { function _validate_BridgeManager_Proposal() internal { validate_ProposeGlobalProposalAndRelay_addBridgeOperator(); + validate_proposeAndRelay_addBridgeOperator(); validate_canExecuteUpgradeSingleProposal(); + validate_canExcuteUpgradeAllOneProposal(); } - function validate_ProposeGlobalProposalAndRelay_addBridgeOperator() private onPostCheck("validate_ProposeGlobalProposalAndRelay_addBridgeOperator") { + function validate_proposeAndRelay_addBridgeOperator() private onlyOnRoninNetworkOrLocal onPostCheck("validate_proposeAndRelay_addBridgeOperator") { RoninBridgeManager manager = RoninBridgeManager(loadContract(Contract.RoninBridgeManager.key())); - uint256 totalVoteWeight = manager.getTotalWeight(); - uint256 cheatVoteWeight = totalVoteWeight * 2; - address cheatOperator = makeAddr(string.concat("operator-", vm.toString(seed))); - (address cheatGovernor, uint256 cheatGovernorPk) = makeAddrAndKey(string.concat("governor-", vm.toString(seed))); + // Cheat add governor + cheatAddOverWeightedGovernor(address(manager)); + + address[] memory targets = address(manager).toSingletonArray(); + uint256[] memory values = uint256(0).toSingletonArray(); + bytes[] memory calldatas = abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators)).toSingletonArray(); + uint256[] memory gasAmounts = uint256(1_000_000).toSingletonArray(); + + uint256 roninChainId = block.chainid; + + Proposal.ProposalDetail memory proposal = LibProposal.createProposal({ + manager: address(manager), + expiryTimestamp: block.timestamp + 20 minutes, + targets: targets, + values: values, + calldatas: calldatas, + gasAmounts: gasAmounts, + nonce: manager.round(0) + 1 + }); + + vm.prank(_cheatGovernor); + manager.propose(roninChainId, block.timestamp + 20 minutes, address(0x0), targets, values, calldatas, gasAmounts); + + { + TNetwork currentNetwork = CONFIG.getCurrentNetwork(); + (uint256 companionChainId, TNetwork companionNetwork) = currentNetwork.companionNetworkData(); + MainchainBridgeManager mainchainManager = MainchainBridgeManager(_manager[companionChainId]); + console.log("MainchainBridgeManager:", vm.getLabel(address(mainchainManager))); + + CONFIG.createFork(companionNetwork); + CONFIG.switchTo(companionNetwork); + uint256 snapshotId = vm.snapshot(); + + // Cheat add governor + cheatAddOverWeightedGovernor(address(mainchainManager)); + + targets = address(mainchainManager).toSingletonArray(); + + proposal = LibProposal.createProposal({ + manager: address(mainchainManager), + expiryTimestamp: block.timestamp + 20 minutes, + targets: targets, + values: proposal.values, + calldatas: proposal.calldatas, + gasAmounts: proposal.gasAmounts, + nonce: mainchainManager.round(block.chainid) + 1 + }); + + SignatureConsumer.Signature[] memory signatures = proposal.generateSignatures(_cheatGovernorPk.toSingletonArray(), Ballot.VoteType.For); + Ballot.VoteType[] memory _supports = new Ballot.VoteType[](signatures.length); + + uint256 minimumForVoteWeight = mainchainManager.minimumVoteWeight(); + uint256 totalForVoteWeight = mainchainManager.getGovernorWeight(_cheatGovernor); + console.log("Total for vote weight:", totalForVoteWeight); + console.log("Minimum for vote weight:", minimumForVoteWeight); + + vm.prank(_cheatGovernor); + mainchainManager.relayProposal(proposal, _supports, signatures); + for (uint256 i; i < _addingGovernors.length; ++i) { + assertEq(mainchainManager.isBridgeOperator(_addingOperators[i]), true, "isBridgeOperator == false"); + } + + bool reverted = vm.revertTo(snapshotId); + assertTrue(reverted, "Cannot revert to snapshot id"); + CONFIG.switchTo(currentNetwork); + } + } - vm.prank(address(manager)); - bool[] memory addeds = - manager.addBridgeOperators(cheatVoteWeight.toSingletonArray().toUint96sUnsafe(), cheatGovernor.toSingletonArray(), cheatOperator.toSingletonArray()); - assertTrue(addeds[0], "addeds[0] == false"); + function validate_ProposeGlobalProposalAndRelay_addBridgeOperator() + private + onlyOnRoninNetworkOrLocal + onPostCheck("validate_ProposeGlobalProposalAndRelay_addBridgeOperator") + { + RoninBridgeManager manager = RoninBridgeManager(loadContract(Contract.RoninBridgeManager.key())); + cheatAddOverWeightedGovernor(address(manager)); GlobalProposal.TargetOption[] memory targetOptions = new GlobalProposal.TargetOption[](1); targetOptions[0] = GlobalProposal.TargetOption.BridgeManager; @@ -55,43 +133,113 @@ abstract contract PostCheck_BridgeManager_Proposal is BasePostCheck { values: uint256(0).toSingletonArray(), calldatas: abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators)).toSingletonArray(), gasAmounts: uint256(1_000_000).toSingletonArray(), - nonce: manager.round(block.chainid) + 1 + nonce: manager.round(0) + 1 }); - SignatureConsumer.Signature[] memory signatures = globalProposal.generateSignaturesGlobal(cheatGovernorPk.toSingletonArray(), Ballot.VoteType.For); - Ballot.VoteType[] memory _supports = new Ballot.VoteType[](signatures.length); + SignatureConsumer.Signature[] memory signatures; + Ballot.VoteType[] memory _supports; + { + signatures = globalProposal.generateSignaturesGlobal(_cheatGovernorPk.toSingletonArray(), Ballot.VoteType.For); + _supports = new Ballot.VoteType[](signatures.length); - vm.prank(cheatGovernor); - manager.proposeGlobalProposalStructAndCastVotes(globalProposal, _supports, signatures); + vm.prank(_cheatGovernor); + manager.proposeGlobalProposalStructAndCastVotes(globalProposal, _supports, signatures); + } // Check if the proposal is voted - assertEq(manager.globalProposalVoted(globalProposal.nonce, cheatGovernor), true); - // Check if the operator is added - assertTrue(manager.isBridgeOperator(cheatOperator), "operator not added"); - // // Check if the governor is added - // assertTrue(manager.isBridgeGovernor(cheatGovernor), "governor not added"); + assertEq(manager.globalProposalVoted(globalProposal.nonce, _cheatGovernor), true); + for (uint256 i; i < _addingGovernors.length; ++i) { + assertEq(manager.isBridgeOperator(_addingOperators[i]), true, "isBridgeOperator == false"); + } - } + { + TNetwork currentNetwork = CONFIG.getCurrentNetwork(); + (uint256 companionChainId, TNetwork companionNetwork) = currentNetwork.companionNetworkData(); + MainchainBridgeManager mainchainManager = MainchainBridgeManager(_manager[companionChainId]); + + CONFIG.createFork(companionNetwork); + CONFIG.switchTo(companionNetwork); + uint256 snapshotId = vm.snapshot(); - function validate_canExecuteUpgradeSingleProposal() private onlyOnRoninNetwork onPostCheck("validate_canExecuteUpgradeProposal") { - address manager = loadContract(Contract.RoninBridgeManager.key()); - // Get all contracts deployed from the current network - address payable[] memory addrs = CONFIG.getAllAddresses(network()); - - // Identify proxy targets to upgrade with proposal - for (uint256 i; i < addrs.length; ++i) { - address payable proxy = addrs[i].getProxyAdmin({ nullCheck: false }); - if (proxy == manager) { - console.log("Target Proxy to test upgrade with proposal", vm.getLabel(addrs[i])); - _proxyTargets.push(addrs[i]); + cheatAddOverWeightedGovernor(address(mainchainManager)); + + vm.prank(_cheatGovernor); + mainchainManager.relayGlobalProposal(globalProposal, _supports, signatures); + + for (uint256 i; i < _addingGovernors.length; ++i) { + assertEq(mainchainManager.isBridgeOperator(_addingOperators[i]), true, "isBridgeOperator == false"); } + + bool reverted = vm.revertTo(snapshotId); + assertTrue(reverted, "Cannot revert to snapshot id"); + CONFIG.switchTo(currentNetwork); + } + } + + function validate_canExecuteUpgradeSingleProposal() private onlyOnRoninNetworkOrLocal onPostCheck("validate_canExecuteUpgradeSingleProposal") { + TContract[] memory contractTypes = new TContract[](4); + contractTypes[0] = Contract.BridgeSlash.key(); + contractTypes[1] = Contract.BridgeReward.key(); + contractTypes[2] = Contract.BridgeTracking.key(); + contractTypes[3] = Contract.RoninGatewayV3.key(); + + address[] memory targets = new address[](contractTypes.length); + for (uint256 i; i < contractTypes.length; ++i) { + targets[i] = loadContract(contractTypes[i]); } - address[] memory targets = _proxyTargets; for (uint256 i; i < targets.length; ++i) { - TContract contractType = CONFIG.getContractTypeFromCurrentNetwok(targets[i]); console.log("Upgrading contract:", vm.getLabel(targets[i])); - _upgradeProxy(contractType); + _upgradeProxy(contractTypes[i]); + } + } + + function validate_canExcuteUpgradeAllOneProposal() private onlyOnRoninNetworkOrLocal onPostCheck("validate_canExcuteUpgradeAllOneProposal") { + RoninBridgeManager manager = RoninBridgeManager(loadContract(Contract.RoninBridgeManager.key())); + TContract[] memory contractTypes = new TContract[](4); + contractTypes[0] = Contract.BridgeSlash.key(); + contractTypes[1] = Contract.BridgeReward.key(); + contractTypes[2] = Contract.BridgeTracking.key(); + contractTypes[3] = Contract.RoninGatewayV3.key(); + + address[] memory targets = new address[](contractTypes.length); + for (uint256 i; i < contractTypes.length; ++i) { + targets[i] = loadContract(contractTypes[i]); } + + address[] memory logics = new address[](targets.length); + for (uint256 i; i < targets.length; ++i) { + console.log("Deploy contract logic:", vm.getLabel(targets[i])); + logics[i] = _deployLogic(contractTypes[i]); + } + + // Upgrade all contracts with proposal + bytes[] memory calldatas = new bytes[](targets.length); + for (uint256 i; i < targets.length; ++i) { + calldatas[i] = abi.encodeCall(TransparentUpgradeableProxy.upgradeTo, (logics[i])); + } + + Proposal.ProposalDetail memory proposal = LibProposal.createProposal({ + manager: address(manager), + expiryTimestamp: block.timestamp + 20 minutes, + targets: targets, + values: uint256(0).repeat(targets.length), + calldatas: calldatas, + gasAmounts: uint256(1_000_000).repeat(targets.length), + nonce: manager.round(block.chainid) + 1 + }); + + manager.executeProposal(proposal); + } + + function cheatAddOverWeightedGovernor(address manager) private { + uint256 cheatVoteWeight = IBridgeManager(manager).getTotalWeight() * 100; + _cheatOperator = makeAddr(string.concat("cheat-operator-", vm.toString(seed))); + (_cheatGovernor, _cheatGovernorPk) = makeAddrAndKey(string.concat("cheat-governor-", vm.toString(seed))); + + vm.prank(manager); + bool[] memory addeds = IBridgeManager(manager).addBridgeOperators( + cheatVoteWeight.toSingletonArray().toUint96sUnsafe(), _cheatGovernor.toSingletonArray(), _cheatOperator.toSingletonArray() + ); } } diff --git a/script/shared/libraries/LibCompanionNetwork.sol b/script/shared/libraries/LibCompanionNetwork.sol index 60de2cb9..4637ee62 100644 --- a/script/shared/libraries/LibCompanionNetwork.sol +++ b/script/shared/libraries/LibCompanionNetwork.sol @@ -30,7 +30,9 @@ library LibCompanionNetwork { function companionNetworkData(TNetwork network) internal returns (uint256 chainId, TNetwork companionTNetwork) { companionTNetwork = config.getCompanionNetwork(network); + config.createFork(companionTNetwork); config.switchTo(companionTNetwork); chainId = block.chainid; + config.switchTo(network); } } diff --git a/script/shared/libraries/LibProposal.sol b/script/shared/libraries/LibProposal.sol index 80cd9d81..ea32051c 100644 --- a/script/shared/libraries/LibProposal.sol +++ b/script/shared/libraries/LibProposal.sol @@ -16,6 +16,7 @@ import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeMa import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; import { CoreGovernance } from "@ronin/contracts/extensions/sequential-governance/CoreGovernance.sol"; import { LibArray } from "./LibArray.sol"; +import { LibCompanionNetwork } from "./LibCompanionNetwork.sol"; import { LibErrorHandler } from "lib/foundry-deployment-kit/lib/contract-libs/src/LibErrorHandler.sol"; import { VoteStatusConsumer } from "@ronin/contracts/interfaces/consumers/VoteStatusConsumer.sol"; @@ -23,6 +24,7 @@ library LibProposal { using LibArray for *; using ECDSA for bytes32; using LibErrorHandler for bool; + using LibCompanionNetwork for *; using Proposal for Proposal.ProposalDetail; using GlobalProposal for GlobalProposal.GlobalProposalDetail; @@ -35,21 +37,30 @@ library LibProposal { modifier preserveState() { uint256 snapshotId = vm.snapshot(); _; - vm.revertTo(snapshotId); + bool reverted = vm.revertTo(snapshotId); + require(reverted, string.concat("Cannot revert to snapshot id: ", vm.toString(snapshotId))); } - function getBridgeManagerDomain() internal view returns (bytes32) { + function getBridgeManagerDomain() internal returns (bytes32) { + uint256 chainId; + TNetwork currentNetwork = config.getCurrentNetwork(); + if (currentNetwork == Network.EthMainnet.key() || currentNetwork == Network.Goerli.key() || currentNetwork == Network.Sepolia.key()) { + chainId = currentNetwork.companionChainId(); + } else { + chainId = block.chainid; + } return keccak256( abi.encode( keccak256("EIP712Domain(string name,string version,bytes32 salt)"), keccak256("BridgeAdmin"), // name hash keccak256("2"), // version hash - keccak256(abi.encode("BRIDGE_ADMIN", block.chainid)) // salt + keccak256(abi.encode("BRIDGE_ADMIN", chainId)) // salt ) ); } function createProposal( + address manager, uint256 nonce, uint256 expiryTimestamp, address[] memory targets, @@ -57,15 +68,14 @@ library LibProposal { bytes[] memory calldatas, uint256[] memory gasAmounts ) internal returns (Proposal.ProposalDetail memory proposal) { - address manager = config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key()); verifyProposalGasAmount(manager, targets, values, calldatas, gasAmounts); proposal = Proposal.ProposalDetail({ nonce: nonce, chainId: block.chainid, expiryTimestamp: expiryTimestamp, - executor: address(0), targets: targets, + executor: address(0x0), values: values, calldatas: calldatas, gasAmounts: gasAmounts @@ -84,9 +94,9 @@ library LibProposal { proposal = GlobalProposal.GlobalProposalDetail({ nonce: nonce, expiryTimestamp: expiryTimestamp, - executor: address(0), targetOptions: targetOptions, values: values, + executor: address(0x0), calldatas: calldatas, gasAmounts: gasAmounts }); @@ -104,7 +114,17 @@ library LibProposal { } else { vm.broadcast(governor0); } - manager.proposeProposalForCurrentNetwork(proposal.expiryTimestamp, proposal.executor, proposal.targets, proposal.values, proposal.calldatas, proposal.gasAmounts, support); + manager.proposeProposalForCurrentNetwork( + proposal.expiryTimestamp, proposal.executor, proposal.targets, proposal.values, proposal.calldatas, proposal.gasAmounts, support + ); + + voteFor(manager, proposal); + } + + function voteFor(RoninBridgeManager manager, Proposal.ProposalDetail memory proposal) internal { + Ballot.VoteType support = Ballot.VoteType.For; + address[] memory governors = manager.getGovernors(); + bool shouldPrankOnly = config.isPostChecking(); uint256 totalGas = proposal.gasAmounts.sum(); // 20% more gas for each governor @@ -157,12 +177,42 @@ library LibProposal { verifyProposalGasAmount(manager, roninTargets, values, calldatas, gasAmounts); // Verify gas amount for mainchain targets + verifyMainchainProposalGasAmount(companionNetwork, companionManager, mainchainTargets, values, calldatas, gasAmounts); + } + + function verifyMainchainProposalGasAmount( + TNetwork companionNetwork, + address mainchainManager, + address[] memory mainchainTargets, + uint256[] memory values, + bytes[] memory calldatas, + uint256[] memory gasAmounts + ) internal preserveState { + TNetwork currentNetwork = config.getCurrentNetwork(); config.createFork(companionNetwork); config.switchTo(companionNetwork); + uint256 snapshotId = vm.snapshot(); - // Verify gas amount for mainchain targets - verifyProposalGasAmount(companionManager, mainchainTargets, values, calldatas, gasAmounts); + for (uint256 i; i < mainchainTargets.length; i++) { + vm.deal(mainchainManager, values[i]); + vm.prank(mainchainManager); + + uint256 gasUsed = gasleft(); + (bool success, bytes memory returnOrRevertData) = mainchainTargets[i].call{ value: values[i], gas: gasAmounts[i] }(calldatas[i]); + gasUsed = gasUsed - gasleft(); + + if (success) { + console.log("Call", i, ": gasUsed", gasUsed); + } else { + console.log("Call", i, unicode": reverted. ❗ GasUsed", gasUsed); + } + success.handleRevert(bytes4(calldatas[i]), returnOrRevertData); + + if (gasUsed > gasAmounts[i]) revert ErrProposalOutOfGas(block.chainid, bytes4(calldatas[i]), gasUsed); + } + bool reverted = vm.revertTo(snapshotId); + require(reverted, string.concat("Cannot revert to snapshot id: ", vm.toString(snapshotId))); config.switchTo(currentNetwork); } @@ -196,7 +246,7 @@ library LibProposal { Proposal.ProposalDetail memory proposal, uint256[] memory signerPKs, Ballot.VoteType support - ) internal view returns (SignatureConsumer.Signature[] memory sigs) { + ) internal returns (SignatureConsumer.Signature[] memory sigs) { return generateSignaturesFor(proposal.hash(), signerPKs, support); } @@ -204,7 +254,7 @@ library LibProposal { GlobalProposal.GlobalProposalDetail memory proposal, uint256[] memory signerPKs, Ballot.VoteType support - ) internal view returns (SignatureConsumer.Signature[] memory sigs) { + ) internal returns (SignatureConsumer.Signature[] memory sigs) { return generateSignaturesFor(proposal.hash(), signerPKs, support); } @@ -212,7 +262,7 @@ library LibProposal { bytes32 proposalHash, uint256[] memory signerPKs, Ballot.VoteType support - ) internal view returns (SignatureConsumer.Signature[] memory sigs) { + ) internal returns (SignatureConsumer.Signature[] memory sigs) { sigs = new SignatureConsumer.Signature[](signerPKs.length); bytes32 domain = getBridgeManagerDomain(); for (uint256 i; i < signerPKs.length; i++) { From 14ac2787711e67aa4c32330cbc5e4ef16fe8dcf3 Mon Sep 17 00:00:00 2001 From: TuDo1403 Date: Sun, 14 Apr 2024 23:34:00 +0700 Subject: [PATCH 153/180] script: fix and add post check for deposit and withdrawal --- remappings.txt | 2 +- ...40411-p1-deploy-ronin-bridge-manager.s.sol | 1 - script/GeneralConfig.sol | 14 + script/Migration.s.sol | 119 +++++---- script/PostChecker.sol | 59 ++++- .../MainchainBridgeManagerDeploy.s.sol | 15 +- .../contracts/RoninBridgeManagerDeploy.s.sol | 12 + .../deploy-v0.3.1/01_Deploy_RoninBridge.s.sol | 36 ++- .../02_Deploy_MainchainBridge.s.sol | 5 +- script/interfaces/IGeneralConfigExtended.sol | 10 + script/interfaces/IPostCheck.sol | 6 + script/post-check/BasePostCheck.s.sol | 65 ++++- ...ridgeManager_CRUD_addBridgeOperators.s.sol | 63 +++-- ...geManager_CRUD_removeBridgeOperators.s.sol | 31 ++- .../PostCheck_BridgeManager_Proposal.s.sol | 65 ++--- .../gateway/PostCheck_Gateway.s.sol | 10 + ...PostCheck_Gateway_DepositAndWithdraw.s.sol | 243 ++++++++++++++++++ script/shared/libraries/LibProposal.sol | 13 +- script/utils/Contract.sol | 5 +- ...AcknowledgeMainchainWithdrew.Gateway.t.sol | 0 .../bulkDepositAndRecord.Gateway.t.sol | 0 ...lkSubmitWithdrawalSignatures.Gateway.t.sol | 0 .../depositAndRecord.Gateway.t.sol | 0 23 files changed, 609 insertions(+), 165 deletions(-) create mode 100644 script/interfaces/IPostCheck.sol create mode 100644 script/post-check/gateway/PostCheck_Gateway.s.sol create mode 100644 script/post-check/gateway/deposit-withdraw/PostCheck_Gateway_DepositAndWithdraw.s.sol rename test/bridge/integration/{bridge-manager => ronin-gateway}/deposit-and-record/bulkAcknowledgeMainchainWithdrew.Gateway.t.sol (100%) rename test/bridge/integration/{bridge-manager => ronin-gateway}/deposit-and-record/bulkDepositAndRecord.Gateway.t.sol (100%) rename test/bridge/integration/{bridge-manager => ronin-gateway}/deposit-and-record/bulkSubmitWithdrawalSignatures.Gateway.t.sol (100%) rename test/bridge/integration/{bridge-manager => ronin-gateway}/deposit-and-record/depositAndRecord.Gateway.t.sol (100%) diff --git a/remappings.txt b/remappings.txt index 7caef984..082d6472 100644 --- a/remappings.txt +++ b/remappings.txt @@ -1,5 +1,5 @@ ds-test/=lib/forge-std/lib/ds-test/src/ -forge-std/=lib/forge-std/src/ +forge-std/=lib/foundry-deployment-kit/lib/forge-std/src/ @openzeppelin/=lib/openzeppelin-contracts/ hardhat/=node_modules/hardhat/ @ronin/contracts/=src/ diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.s.sol index d7309b67..e2da3e12 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.s.sol @@ -10,7 +10,6 @@ import { LibTokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibToken import { Contract } from "../utils/Contract.sol"; import { Network } from "../utils/Network.sol"; import { Contract } from "../utils/Contract.sol"; -import { IGeneralConfigExtended } from "../interfaces/IGeneralConfigExtended.sol"; import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; import "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; import "@ronin/contracts/mainchain/MainchainGatewayV3.sol"; diff --git a/script/GeneralConfig.sol b/script/GeneralConfig.sol index b7c39a1d..74eeedfd 100644 --- a/script/GeneralConfig.sol +++ b/script/GeneralConfig.sol @@ -6,9 +6,12 @@ import { BaseGeneralConfig } from "@fdk/BaseGeneralConfig.sol"; import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol"; import { Contract } from "./utils/Contract.sol"; import { TNetwork, Network } from "./utils/Network.sol"; +import { IGeneralConfigExtended } from "./interfaces/IGeneralConfigExtended.sol"; import { Utils } from "./utils/Utils.sol"; contract GeneralConfig is BaseGeneralConfig, Utils { + IGeneralConfigExtended.LocalNetwork private _localNetwork; + constructor() BaseGeneralConfig("", "deployments/") { } function _setUpNetworks() internal virtual override { @@ -48,6 +51,14 @@ contract GeneralConfig is BaseGeneralConfig, Utils { revert("Network: Unknown companion network"); } + function getLocalNetwork() public view virtual returns (IGeneralConfigExtended.LocalNetwork) { + return _localNetwork; + } + + function setLocalNetwork(IGeneralConfigExtended.LocalNetwork network) public virtual { + _localNetwork = network; + } + function _setUpContracts() internal virtual override { // map contract name _mapContractName(Contract.BridgeSlash); @@ -62,6 +73,7 @@ contract GeneralConfig is BaseGeneralConfig, Utils { _mapContractName(Contract.MockERC721); _mapContractName(Contract.MockERC1155); _mapContractName(Contract.RoninBridgeManagerConstructor); + _mapContractName(Contract.PostChecker); _contractNameMap[Contract.AXS.key()] = "MockERC20"; _contractNameMap[Contract.SLP.key()] = "MockSLP"; @@ -77,6 +89,8 @@ contract GeneralConfig is BaseGeneralConfig, Utils { _contractAddrMap[Network.Sepolia.chainId()][Contract.WETH.name()] = 0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9; _contractAddrMap[Network.EthMainnet.chainId()][Contract.WETH.name()] = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; + _contractAddrMap[DefaultNetwork.RoninTestnet.chainId()][Contract.AXS.name()] = 0x0eD7e52944161450477ee417DE9Cd3a859b14fD0; + _contractAddrMap[DefaultNetwork.RoninMainnet.chainId()][Contract.WETH.name()] = 0xc99a6A985eD2Cac1ef41640596C5A5f9F4E19Ef5; _contractAddrMap[DefaultNetwork.RoninMainnet.chainId()][Contract.WRON.name()] = 0xe514d9DEB7966c8BE0ca922de8a064264eA6bcd4; diff --git a/script/Migration.s.sol b/script/Migration.s.sol index 146a3c5f..a2f7116b 100644 --- a/script/Migration.s.sol +++ b/script/Migration.s.sol @@ -11,16 +11,17 @@ import { LibProxy } from "@fdk/libraries/LibProxy.sol"; import { GeneralConfig } from "./GeneralConfig.sol"; import { ISharedArgument } from "./interfaces/ISharedArgument.sol"; import { TNetwork, Network } from "./utils/Network.sol"; +import { IGeneralConfigExtended } from "./interfaces/IGeneralConfigExtended.sol"; import { Utils } from "./utils/Utils.sol"; import { LibTokenInfo, TokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; import { Contract, TContract } from "./utils/Contract.sol"; import { GlobalProposal, Proposal, LibProposal } from "script/shared/libraries/LibProposal.sol"; import { TransparentUpgradeableProxy, TransparentUpgradeableProxyV2 } from "@ronin/contracts/extensions/TransparentUpgradeableProxyV2.sol"; import { LibArray } from "script/shared/libraries/LibArray.sol"; -import { PostChecker } from "./PostChecker.sol"; +import { IPostCheck } from "./interfaces/IPostCheck.sol"; import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; -contract Migration is PostChecker, Utils { +contract Migration is BaseMigration, Utils { using LibProxy for *; using LibArray for *; using StdStyle for *; @@ -30,12 +31,17 @@ contract Migration is PostChecker, Utils { uint256 internal constant DEFAULT_PROPOSAL_GAS = 1_000_000; ISharedArgument internal constant config = ISharedArgument(address(CONFIG)); - bool internal _isLocalETH; - function setUp() public virtual override { super.setUp(); } + function _postCheck() internal virtual override { + address postChecker = _deployImmutable(Contract.PostChecker.key()); + vm.allowCheatcodes(postChecker); + vm.makePersistent(postChecker); + IPostCheck(postChecker).run(); + } + function _configByteCode() internal virtual override returns (bytes memory) { return abi.encodePacked(type(GeneralConfig).creationCode); } @@ -166,7 +172,6 @@ contract Migration is PostChecker, Utils { // Ronin Bridge Manager param.roninBridgeManager.num = 2; param.roninBridgeManager.denom = 4; - param.roninBridgeManager.roninChainId = 0; param.roninBridgeManager.roninChainId = block.chainid; param.roninBridgeManager.expiryDuration = 14 days; param.roninBridgeManager.bridgeOperators = operatorAddrs; @@ -188,7 +193,6 @@ contract Migration is PostChecker, Utils { // Mainchain Bridge Manager param.mainchainBridgeManager.num = 2; param.mainchainBridgeManager.denom = 4; - param.mainchainBridgeManager.roninChainId = 0; param.mainchainBridgeManager.roninChainId = block.chainid; param.mainchainBridgeManager.bridgeOperators = operatorAddrs; param.mainchainBridgeManager.governors = governorAddrs; @@ -211,10 +215,23 @@ contract Migration is PostChecker, Utils { } else if (currentNetwork == Network.Sepolia.key() || currentNetwork == Network.Goerli.key() || currentNetwork == Network.EthMainnet.key()) { proxyAdmin = loadContract(Contract.MainchainBridgeManager.key()); } else if (currentNetwork == DefaultNetwork.Local.key()) { - TContract managerContractType = _isLocalETH ? Contract.MainchainBridgeManager.key() : Contract.RoninBridgeManager.key(); - try config.getAddressFromCurrentNetwork(managerContractType) returns (address payable addr) { - proxyAdmin = addr; - } catch { + if (config.getLocalNetwork() == IGeneralConfigExtended.LocalNetwork.Ronin) { + try config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key()) returns (address payable res) { + proxyAdmin = res; + } catch { + console.log("BridgeMigration(_getProxyAdmin): RoninBridgeManager not found".yellow()); + console.log("BridgeMigration(_getProxyAdmin): Using sender as proxy admin".yellow()); + proxyAdmin = sender(); + } + } else if (config.getLocalNetwork() == IGeneralConfigExtended.LocalNetwork.Eth) { + try config.getAddressFromCurrentNetwork(Contract.MainchainBridgeManager.key()) returns (address payable res) { + proxyAdmin = res; + } catch { + console.log("BridgeMigration(_getProxyAdmin): MainchainBridgeManager not found".yellow()); + console.log("BridgeMigration(_getProxyAdmin): Using sender as proxy admin".yellow()); + proxyAdmin = sender(); + } + } else { proxyAdmin = payable(config.sharedArguments().test.proxyAdmin); } } else { @@ -231,60 +248,50 @@ contract Migration is PostChecker, Utils { } assertTrue(proxyAdmin != address(0x0), "BridgeMigration: Invalid {proxyAdmin} or {proxy} is not a Proxy contract"); - address admin = _getProxyAdmin(); TNetwork currentNetwork = network(); - if (proxyAdmin == admin) { - // in case proxyAdmin is GovernanceAdmin - if ( - currentNetwork == DefaultNetwork.RoninTestnet.key() || currentNetwork == DefaultNetwork.RoninMainnet.key() - || currentNetwork == Network.RoninDevnet.key() || currentNetwork == DefaultNetwork.Local.key() - ) { - // handle for ronin network - console.log(StdStyle.yellow("Voting on RoninBridgeManager for upgrading...")); - - RoninBridgeManager manager = RoninBridgeManager(admin); - bytes[] memory callDatas = new bytes[](1); - uint256[] memory values = new uint256[](1); - address[] memory targets = new address[](1); - - targets[0] = proxy; - callDatas[0] = args.length == 0 - ? abi.encodeCall(TransparentUpgradeableProxy.upgradeTo, (logic)) - : abi.encodeCall(TransparentUpgradeableProxy.upgradeToAndCall, (logic, args)); - - Proposal.ProposalDetail memory proposal = LibProposal.createProposal({ - manager: address(manager), - nonce: manager.round(block.chainid) + 1, - expiryTimestamp: block.timestamp + 10 minutes, - targets: targets, - values: values, - calldatas: callDatas, - gasAmounts: uint256(DEFAULT_PROPOSAL_GAS).toSingletonArray() - }); - - manager.executeProposal(proposal); - assertEq(proxy.getProxyImplementation(), logic, "BridgeMigration: Upgrade failed"); - } else if (currentNetwork == Network.Sepolia.key() || currentNetwork == Network.Goerli.key() || currentNetwork == Network.EthMainnet.key()) { - // handle for ethereum - revert("BridgeMigration: Unhandled case for ETH"); - } else { - revert("BridgeMigration: Unhandled case"); - } - } else if (proxyAdmin.code.length == 0) { + if (proxyAdmin.code.length == 0) { // in case proxyAdmin is an eoa console.log(StdStyle.yellow("Upgrading with EOA wallet...")); _prankOrBroadcast(address(proxyAdmin)); if (args.length == 0) TransparentUpgradeableProxyV2(proxy).upgradeTo(logic); else TransparentUpgradeableProxyV2(proxy).upgradeToAndCall(logic, args); + } + // in case proxyAdmin is GovernanceAdmin + else if ( + currentNetwork == DefaultNetwork.RoninTestnet.key() || currentNetwork == DefaultNetwork.RoninMainnet.key() || currentNetwork == Network.RoninDevnet.key() + || currentNetwork == DefaultNetwork.Local.key() + ) { + // handle for ronin network + console.log(StdStyle.yellow("Voting on RoninBridgeManager for upgrading...")); + + RoninBridgeManager manager = RoninBridgeManager(proxyAdmin); + bytes[] memory callDatas = new bytes[](1); + uint256[] memory values = new uint256[](1); + address[] memory targets = new address[](1); + + targets[0] = proxy; + callDatas[0] = args.length == 0 + ? abi.encodeCall(TransparentUpgradeableProxy.upgradeTo, (logic)) + : abi.encodeCall(TransparentUpgradeableProxy.upgradeToAndCall, (logic, args)); + + Proposal.ProposalDetail memory proposal = LibProposal.createProposal({ + manager: address(manager), + nonce: manager.round(block.chainid) + 1, + expiryTimestamp: block.timestamp + 10 minutes, + targets: targets, + values: values, + calldatas: callDatas, + gasAmounts: uint256(DEFAULT_PROPOSAL_GAS).toSingletonArray() + }); + + manager.executeProposal(proposal); + assertEq(proxy.getProxyImplementation(), logic, "BridgeMigration: Upgrade failed"); + } else if (currentNetwork == Network.Sepolia.key() || currentNetwork == Network.Goerli.key() || currentNetwork == Network.EthMainnet.key()) { + // handle for ethereum + revert("BridgeMigration: Unhandled case for ETH"); } else { - console.log(StdStyle.yellow("Upgrading with owner of ProxyAdmin contract...")); - // in case proxyAdmin is a ProxyAdmin contract - ProxyAdmin proxyAdminContract = ProxyAdmin(proxyAdmin); - address authorizedWallet = proxyAdminContract.owner(); - _prankOrBroadcast(authorizedWallet); - if (args.length == 0) proxyAdminContract.upgrade(TransparentUpgradeableProxy(proxy), logic); - else proxyAdminContract.upgradeAndCall(TransparentUpgradeableProxy(proxy), logic, args); + revert("BridgeMigration: Unhandled case"); } } diff --git a/script/PostChecker.sol b/script/PostChecker.sol index 4a1ae8c4..628c8cf8 100644 --- a/script/PostChecker.sol +++ b/script/PostChecker.sol @@ -2,18 +2,46 @@ pragma solidity ^0.8.19; import { BaseMigration } from "@fdk/BaseMigration.s.sol"; -import { Contract } from "script/utils/Contract.sol"; +import { TContract, Contract } from "script/utils/Contract.sol"; import { Network } from "script/utils/Network.sol"; import { TNetwork, DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol"; import { LibCompanionNetwork } from "script/shared/libraries/LibCompanionNetwork.sol"; import { PostCheck_BridgeManager } from "./post-check/bridge-manager/PostCheck_BridgeManager.s.sol"; +import { PostCheck_Gateway } from "./post-check/gateway/PostCheck_Gateway.s.sol"; +import { Migration } from "./Migration.s.sol"; +import { ScriptExtended } from "@fdk/extensions/ScriptExtended.s.sol"; -abstract contract PostChecker is BaseMigration, PostCheck_BridgeManager { +contract PostChecker is Migration, PostCheck_BridgeManager, PostCheck_Gateway { using LibCompanionNetwork for *; - function _postCheck() internal override { + function setUp() public virtual override(BaseMigration, Migration) { + super.setUp(); + } + + function run() external { _loadSysContract(); - _validate_BridgeManager(); + // _validate_BridgeManager(); + _validate_Gateway(); + } + + function _deployLogic(TContract contractType) internal virtual override(BaseMigration, Migration) returns (address payable logic) { + return super._deployLogic(contractType); + } + + function _upgradeRaw(address proxyAdmin, address payable proxy, address logic, bytes memory args) internal virtual override(BaseMigration, Migration) { + super._upgradeRaw(proxyAdmin, proxy, logic, args); + } + + function _postCheck() internal virtual override(ScriptExtended, Migration) { + super._postCheck(); + } + + function _getProxyAdmin() internal virtual override(BaseMigration, Migration) returns (address payable) { + return super._getProxyAdmin(); + } + + function _deployProxy(TContract contractType, bytes memory args) internal virtual override(BaseMigration, Migration) returns (address payable) { + return super._deployProxy(contractType, args); } function _loadSysContract() private { @@ -22,14 +50,21 @@ abstract contract PostChecker is BaseMigration, PostCheck_BridgeManager { currentNetwork == DefaultNetwork.RoninMainnet.key() || currentNetwork == DefaultNetwork.RoninTestnet.key() || currentNetwork == Network.RoninDevnet.key() || currentNetwork == DefaultNetwork.Local.key() ) { - __bridgeSlash = loadContract(Contract.BridgeSlash.key()); - __bridgeReward = loadContract(Contract.BridgeReward.key()); - _gateway[block.chainid] = loadContract(Contract.RoninGatewayV3.key()); - _manager[block.chainid] = loadContract(Contract.RoninBridgeManager.key()); - - (uint256 companionChainId, TNetwork companionNetwork) = currentNetwork.companionNetworkData(); - _gateway[companionChainId] = CONFIG.getAddress(companionNetwork, Contract.MainchainGatewayV3.key()); - _manager[companionChainId] = CONFIG.getAddress(companionNetwork, Contract.MainchainBridgeManager.key()); + bridgeSlash = loadContract(Contract.BridgeSlash.key()); + bridgeReward = loadContract(Contract.BridgeReward.key()); + roninGateway = loadContract(Contract.RoninGatewayV3.key()); + roninBridgeManager = loadContract(Contract.RoninBridgeManager.key()); + + (, TNetwork companionNetwork) = currentNetwork.companionNetworkData(); + mainchainGateway = CONFIG.getAddress(companionNetwork, Contract.MainchainGatewayV3.key()); + mainchainBridgeManager = CONFIG.getAddress(companionNetwork, Contract.MainchainBridgeManager.key()); + + vm.makePersistent(bridgeSlash); + vm.makePersistent(bridgeReward); + vm.makePersistent(roninGateway); + vm.makePersistent(roninBridgeManager); + vm.makePersistent(mainchainGateway); + vm.makePersistent(mainchainBridgeManager); } else { revert(string.concat("Unsupported network: ", currentNetwork.networkName())); } diff --git a/script/contracts/MainchainBridgeManagerDeploy.s.sol b/script/contracts/MainchainBridgeManagerDeploy.s.sol index a0b36941..f680777b 100644 --- a/script/contracts/MainchainBridgeManagerDeploy.s.sol +++ b/script/contracts/MainchainBridgeManagerDeploy.s.sol @@ -2,14 +2,25 @@ pragma solidity ^0.8.19; import { MainchainBridgeManager } from "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; +import { TransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import { Contract } from "../utils/Contract.sol"; +import { LibProxy } from "@fdk/libraries/LibProxy.sol"; import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; import { Migration } from "../Migration.s.sol"; import { MainchainGatewayV3Deploy } from "./MainchainGatewayV3Deploy.s.sol"; contract MainchainBridgeManagerDeploy is Migration { - function run() public virtual returns (MainchainBridgeManager) { - return MainchainBridgeManager(_deployProxy(Contract.MainchainBridgeManager.key())); + using LibProxy for *; + + function run() public virtual returns (MainchainBridgeManager instance) { + instance = MainchainBridgeManager(_deployProxy(Contract.MainchainBridgeManager.key())); + address proxyAdmin = payable(address(instance)).getProxyAdmin(); + + if (proxyAdmin == sender()) { + vm.broadcast(proxyAdmin); + // change proxy admin to self + TransparentUpgradeableProxy(payable(address(instance))).changeAdmin(address(instance)); + } } } diff --git a/script/contracts/RoninBridgeManagerDeploy.s.sol b/script/contracts/RoninBridgeManagerDeploy.s.sol index 764651c8..24acb9a7 100644 --- a/script/contracts/RoninBridgeManagerDeploy.s.sol +++ b/script/contracts/RoninBridgeManagerDeploy.s.sol @@ -1,6 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; +import { console2 } from "forge-std/console2.sol"; +import { TransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import { RoninBridgeManagerConstructor } from "@ronin/contracts/ronin/gateway/RoninBridgeManagerConstructor.sol"; import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; import { Contract } from "../utils/Contract.sol"; @@ -37,7 +39,17 @@ contract RoninBridgeManagerDeploy is Migration { address payable instance = _deployProxy(Contract.RoninBridgeManagerConstructor.key()); address logic = _deployLogic(Contract.RoninBridgeManager.key()); address proxyAdmin = instance.getProxyAdmin(); + console2.log("Proxy admin ", proxyAdmin); + console2.log("Sender: ", sender()); _upgradeRaw(proxyAdmin, instance, logic, EMPTY_ARGS); + + if (proxyAdmin == sender()) { + vm.broadcast(proxyAdmin); + // change proxy admin to self + TransparentUpgradeableProxy(instance).changeAdmin(instance); + } + config.setAddress(network(), Contract.RoninBridgeManager.key(), instance); + return RoninBridgeManager(instance); } } diff --git a/script/deploy-v0.3.1/01_Deploy_RoninBridge.s.sol b/script/deploy-v0.3.1/01_Deploy_RoninBridge.s.sol index 3c296cf4..3791c167 100644 --- a/script/deploy-v0.3.1/01_Deploy_RoninBridge.s.sol +++ b/script/deploy-v0.3.1/01_Deploy_RoninBridge.s.sol @@ -8,14 +8,21 @@ import { TNetwork, Network } from "../utils/Network.sol"; import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol"; import { TContract, Contract } from "../utils/Contract.sol"; import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; +import { IGeneralConfigExtended } from "../interfaces/IGeneralConfigExtended.sol"; import { BridgeSlash, BridgeSlashDeploy } from "../contracts/BridgeSlashDeploy.s.sol"; import { BridgeReward, BridgeRewardDeploy } from "../contracts/BridgeRewardDeploy.s.sol"; import { BridgeTracking, BridgeTrackingDeploy } from "../contracts/BridgeTrackingDeploy.s.sol"; import { RoninGatewayV3, RoninGatewayV3Deploy } from "../contracts/RoninGatewayV3Deploy.s.sol"; +import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; +import { LibProxy } from "@fdk/libraries/LibProxy.sol"; +import { TransparentUpgradeableProxyV2 } from "@ronin/contracts/extensions/TransparentUpgradeableProxyV2.sol"; +import { HasContracts } from "@ronin/contracts/extensions/collections/HasContracts.sol"; import { RoninBridgeManagerConstructor, RoninBridgeManager, RoninBridgeManagerDeploy } from "../contracts/RoninBridgeManagerDeploy.s.sol"; +import { MockValidatorContract_OnlyTiming_ForHardhatTest } from "@ronin/contracts/mocks/ronin/MockValidatorContract_OnlyTiming_ForHardhatTest.sol"; contract Migration_01_Deploy_RoninBridge is Migration { using StdStyle for *; + using LibProxy for *; BridgeSlash private _bridgeSlash; BridgeReward private _bridgeReward; @@ -25,15 +32,12 @@ contract Migration_01_Deploy_RoninBridge is Migration { address private _validatorSet; function run() external { - _roninGatewayV3 = new RoninGatewayV3Deploy().run(); - _bridgeSlash = new BridgeSlashDeploy().run(); - _bridgeReward = new BridgeRewardDeploy().run(); - _bridgeTracking = new BridgeTrackingDeploy().run(); + config.setLocalNetwork(IGeneralConfigExtended.LocalNetwork.Ronin); ISharedArgument.BridgeManagerParam memory param = config.sharedArguments().roninBridgeManager; - address[] memory callbackRegisters = new address[](1); - callbackRegisters[0] = address(_bridgeSlash); - callbackRegisters[1] = address(_roninGatewayV3); + // address[] memory callbackRegisters = new address[](0); + // callbackRegisters[0] = address(_bridgeSlash); + // callbackRegisters[1] = address(_roninGatewayV3); _roninBridgeManager = RoninBridgeManager( new RoninBridgeManagerDeploy().overrideArgs( @@ -56,6 +60,11 @@ contract Migration_01_Deploy_RoninBridge is Migration { ).run() ); + _roninGatewayV3 = new RoninGatewayV3Deploy().run(); + _bridgeSlash = new BridgeSlashDeploy().run(); + _bridgeReward = new BridgeRewardDeploy().run(); + _bridgeTracking = new BridgeTrackingDeploy().run(); + _initBridgeReward(); _initBridgeSlash(); _initRoninGatewayV3(); @@ -85,7 +94,11 @@ contract Migration_01_Deploy_RoninBridge is Migration { } function _initBridgeTracking() internal logFn("Init BridgeTracking") { - _bridgeTracking.initialize({ bridgeContract: address(_roninGatewayV3), validatorContract: _validatorSet, startedAtBlock_: 0 }); + _bridgeTracking.initialize({ + bridgeContract: address(_roninGatewayV3), + validatorContract: address(new MockValidatorContract_OnlyTiming_ForHardhatTest(200)), + startedAtBlock_: 0 + }); _bridgeTracking.initializeV3({ bridgeManager: address(_roninBridgeManager), bridgeSlash: address(_bridgeSlash), @@ -132,5 +145,12 @@ contract Migration_01_Deploy_RoninBridge is Migration { param.standards ); _roninGatewayV3.initializeV3(address(_roninBridgeManager)); + + address admin = payable(address(_roninGatewayV3)).getProxyAdmin(); + vm.startBroadcast(admin); + TransparentUpgradeableProxyV2(payable(address(_roninGatewayV3))).functionDelegateCall( + abi.encodeCall(HasContracts.setContract, (ContractType.BRIDGE_TRACKING, address(_bridgeTracking))) + ); + vm.stopBroadcast(); } } diff --git a/script/deploy-v0.3.1/02_Deploy_MainchainBridge.s.sol b/script/deploy-v0.3.1/02_Deploy_MainchainBridge.s.sol index fa1158e6..38b4efc3 100644 --- a/script/deploy-v0.3.1/02_Deploy_MainchainBridge.s.sol +++ b/script/deploy-v0.3.1/02_Deploy_MainchainBridge.s.sol @@ -10,6 +10,7 @@ import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol"; import { IWETH } from "@ronin/contracts/interfaces/IWETH.sol"; import { WETHDeploy } from "../contracts/token/WETHDeploy.s.sol"; import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; +import { IGeneralConfigExtended } from "../interfaces/IGeneralConfigExtended.sol"; import { LibCompanionNetwork } from "script/shared/libraries/LibCompanionNetwork.sol"; import { MainchainGatewayV3, MainchainGatewayV3Deploy } from "../contracts/MainchainGatewayV3Deploy.s.sol"; import { WethUnwrapper, MainchainWethUnwrapperDeploy } from "../contracts/MainchainWethUnwrapperDeploy.s.sol"; @@ -29,7 +30,7 @@ contract Migration_02_Deploy_MainchainBridge is Migration { } function run() external { - _isLocalETH = true; + config.setLocalNetwork(IGeneralConfigExtended.LocalNetwork.Eth); _mainchainBridgeManager = new MainchainBridgeManagerDeploy().run(); _weth = loadContractOrDeploy(Contract.WETH.key()); @@ -38,8 +39,6 @@ contract Migration_02_Deploy_MainchainBridge is Migration { _initMainchainGatewayV3(); _initMainchainBridgeManager(); - - _isLocalETH = false; } function _initMainchainBridgeManager() internal logFn("Init RoninBridgeManager") { diff --git a/script/interfaces/IGeneralConfigExtended.sol b/script/interfaces/IGeneralConfigExtended.sol index 257b80aa..0a4e0e96 100644 --- a/script/interfaces/IGeneralConfigExtended.sol +++ b/script/interfaces/IGeneralConfigExtended.sol @@ -5,6 +5,12 @@ import { IGeneralConfig } from "@fdk/interfaces/IGeneralConfig.sol"; import { TNetwork } from "@fdk/types/Types.sol"; interface IGeneralConfigExtended is IGeneralConfig { + enum LocalNetwork { + Test, + Ronin, + Eth + } + /** * @dev Returns the companion mainchain network of a roninchain network * @@ -13,4 +19,8 @@ interface IGeneralConfigExtended is IGeneralConfig { * */ function getCompanionNetwork(TNetwork network) external pure returns (TNetwork); + + function getLocalNetwork() external view returns (LocalNetwork); + + function setLocalNetwork(LocalNetwork network) external; } diff --git a/script/interfaces/IPostCheck.sol b/script/interfaces/IPostCheck.sol new file mode 100644 index 00000000..92bedd45 --- /dev/null +++ b/script/interfaces/IPostCheck.sol @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +interface IPostCheck { + function run() external; +} diff --git a/script/post-check/BasePostCheck.s.sol b/script/post-check/BasePostCheck.s.sol index 0033178b..d201fd59 100644 --- a/script/post-check/BasePostCheck.s.sol +++ b/script/post-check/BasePostCheck.s.sol @@ -5,17 +5,34 @@ import { Vm } from "forge-std/Vm.sol"; import { StdStyle } from "forge-std/StdStyle.sol"; import { console2 as console } from "forge-std/console2.sol"; import { BaseMigration } from "@fdk/BaseMigration.s.sol"; +import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol"; +import { TNetwork, Network } from "script/utils/Network.sol"; import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; +import { TransparentUpgradeableProxyV2 } from "@ronin/contracts/extensions/TransparentUpgradeableProxyV2.sol"; +import { LibArray } from "script/shared/libraries/LibArray.sol"; +import { LibProxy } from "@fdk/libraries/LibProxy.sol"; abstract contract BasePostCheck is BaseMigration { using StdStyle for *; + using LibArray for *; + using LibProxy for *; uint256 internal seed = vm.unixTime(); - address internal __bridgeSlash; - address internal __bridgeReward; - address internal __bridgeTracking; - mapping(uint256 chainId => address manager) internal _manager; - mapping(uint256 chainId => address gateway) internal _gateway; + + address payable internal bridgeSlash; + address payable internal bridgeReward; + address payable internal bridgeTracking; + address payable internal roninBridgeManager; + address payable internal roninGateway; + address payable internal mainchainGateway; + address payable internal mainchainBridgeManager; + + address internal cheatGovernor; + address internal cheatOperator; + uint256 internal cheatGovernorPk; + uint256 internal cheatOperatorPk; + + bytes32 internal domainSeparator; modifier onPostCheck(string memory postCheckLabel) { uint256 snapshotId = _beforePostCheck(postCheckLabel); @@ -23,6 +40,44 @@ abstract contract BasePostCheck is BaseMigration { _afterPostCheck(postCheckLabel, snapshotId); } + modifier onlyOnRoninNetworkOrLocal() { + require( + block.chainid == DefaultNetwork.RoninMainnet.chainId() || block.chainid == DefaultNetwork.RoninTestnet.chainId() + || block.chainid == Network.RoninDevnet.chainId() || block.chainid == DefaultNetwork.Local.chainId(), + "chainid != RoninMainnet or RoninTestnet" + ); + _; + } + + function cheatAddOverWeightedGovernor(address manager) internal { + uint256 totalWeight; + try IBridgeManager(manager).getTotalWeight() returns (uint256 res) { + totalWeight = res; + } catch { + (, bytes memory res) = manager.staticcall(abi.encodeWithSignature("getTotalWeights()")); + totalWeight = abi.decode(res, (uint256)); + } + uint256 cheatVoteWeight = totalWeight * 100; + (cheatOperator, cheatOperatorPk) = makeAddrAndKey(string.concat("cheat-operator-", vm.toString(seed))); + (cheatGovernor, cheatGovernorPk) = makeAddrAndKey(string.concat("cheat-governor-", vm.toString(seed))); + + vm.deal(cheatGovernor, 1); + vm.deal(cheatOperator, 1); + + vm.prank(manager); + try TransparentUpgradeableProxyV2(payable(manager)).functionDelegateCall( + abi.encodeCall( + IBridgeManager.addBridgeOperators, + (cheatVoteWeight.toSingletonArray().toUint96sUnsafe(), cheatGovernor.toSingletonArray(), cheatOperator.toSingletonArray()) + ) + ) { } catch { + vm.prank(manager); + IBridgeManager(manager).addBridgeOperators( + cheatVoteWeight.toSingletonArray().toUint96sUnsafe(), cheatGovernor.toSingletonArray(), cheatOperator.toSingletonArray() + ); + } + } + function _beforePostCheck(string memory postCheckLabel) private returns (uint256 snapshotId) { snapshotId = vm.snapshot(); console.log("\n> ".cyan(), postCheckLabel.blue().italic(), "..."); diff --git a/script/post-check/bridge-manager/crud/PostCheck_BridgeManager_CRUD_addBridgeOperators.s.sol b/script/post-check/bridge-manager/crud/PostCheck_BridgeManager_CRUD_addBridgeOperators.s.sol index be54b06a..98955275 100644 --- a/script/post-check/bridge-manager/crud/PostCheck_BridgeManager_CRUD_addBridgeOperators.s.sol +++ b/script/post-check/bridge-manager/crud/PostCheck_BridgeManager_CRUD_addBridgeOperators.s.sol @@ -1,9 +1,11 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; +import { TransparentUpgradeableProxyV2 } from "@ronin/contracts/extensions/TransparentUpgradeableProxyV2.sol"; import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; import { BasePostCheck } from "script/post-check/BasePostCheck.s.sol"; import { LibArray } from "script/shared/libraries/LibArray.sol"; +import { Contract } from "script/utils/Contract.sol"; /** * @title PostCheck_BridgeManager_CRUD_AddBridgeOperators @@ -32,7 +34,7 @@ abstract contract PostCheck_BridgeManager_CRUD_AddBridgeOperators is BasePostChe function validate_RevertWhen_NotSelfCalled_addBridgeOperators() private onPostCheck("validate_RevertWhen_NotSelfCalled_addBridgeOperators") { vm.expectRevert(); vm.prank(any); - IBridgeManager(_manager[block.chainid]).addBridgeOperators( + IBridgeManager(roninBridgeManager).addBridgeOperators( voteWeight.toSingletonArray().toUint96sUnsafe(), operator.toSingletonArray(), governor.toSingletonArray() ); } @@ -45,23 +47,32 @@ abstract contract PostCheck_BridgeManager_CRUD_AddBridgeOperators is BasePostChe onPostCheck("validate_RevertWhen_SelfCalled_TheListHasDuplicate_addBridgeOperators") { vm.expectRevert(); - vm.prank(_manager[block.chainid]); - bool[] memory addeds = IBridgeManager(_manager[block.chainid]).addBridgeOperators( - voteWeight.toSingletonArray().toUint96sUnsafe(), operator.toSingletonArray(), operator.toSingletonArray() + vm.prank(roninBridgeManager); + TransparentUpgradeableProxyV2(payable(roninBridgeManager)).functionDelegateCall( + abi.encodeCall( + IBridgeManager.addBridgeOperators, (voteWeight.toSingletonArray().toUint96sUnsafe(), operator.toSingletonArray(), operator.toSingletonArray()) + ) ); vm.expectRevert(); - vm.prank(_manager[block.chainid]); - addeds = IBridgeManager(_manager[block.chainid]).addBridgeOperators( - voteWeight.toSingletonArray().toUint96sUnsafe(), governor.toSingletonArray(), governor.toSingletonArray() + vm.prank(roninBridgeManager); + TransparentUpgradeableProxyV2(payable(roninBridgeManager)).functionDelegateCall( + abi.encodeCall( + IBridgeManager.addBridgeOperators, (voteWeight.toSingletonArray().toUint96sUnsafe(), governor.toSingletonArray(), governor.toSingletonArray()) + ) ); vm.expectRevert(); - vm.prank(_manager[block.chainid]); - addeds = IBridgeManager(_manager[block.chainid]).addBridgeOperators( - voteWeight.toSingletonArray().toUint96sUnsafe(), - governor.toSingletonArray().extend(operator.toSingletonArray()), - operator.toSingletonArray().extend(governor.toSingletonArray()) + vm.prank(roninBridgeManager); + TransparentUpgradeableProxyV2(payable(roninBridgeManager)).functionDelegateCall( + abi.encodeCall( + IBridgeManager.addBridgeOperators, + ( + voteWeight.toSingletonArray().toUint96sUnsafe(), + governor.toSingletonArray().extend(operator.toSingletonArray()), + operator.toSingletonArray().extend(governor.toSingletonArray()) + ) + ) ); } @@ -72,10 +83,13 @@ abstract contract PostCheck_BridgeManager_CRUD_AddBridgeOperators is BasePostChe private onPostCheck("validate_RevertWhen_SelfCalled_InputArrayLengthMismatch_addBridgeOperators") { - vm.prank(_manager[block.chainid]); + vm.prank(roninBridgeManager); vm.expectRevert(); - IBridgeManager(_manager[block.chainid]).addBridgeOperators( - voteWeight.toSingletonArray().toUint96sUnsafe(), governor.toSingletonArray(), operator.toSingletonArray().extend(governor.toSingletonArray()) + TransparentUpgradeableProxyV2(payable(roninBridgeManager)).functionDelegateCall( + abi.encodeCall( + IBridgeManager.addBridgeOperators, + (voteWeight.toSingletonArray().toUint96sUnsafe(), governor.toSingletonArray(), operator.toSingletonArray().extend(governor.toSingletonArray())) + ) ); } @@ -86,10 +100,13 @@ abstract contract PostCheck_BridgeManager_CRUD_AddBridgeOperators is BasePostChe private onPostCheck("validate_RevertWhen_SelfCalled_ContainsNullVoteWeight_addBridgeOperators") { - vm.prank(_manager[block.chainid]); + vm.prank(roninBridgeManager); vm.expectRevert(); - IBridgeManager(_manager[block.chainid]).addBridgeOperators( - uint256(0).toSingletonArray().toUint96sUnsafe(), governor.toSingletonArray(), operator.toSingletonArray().extend(governor.toSingletonArray()) + TransparentUpgradeableProxyV2(payable(roninBridgeManager)).functionDelegateCall( + abi.encodeCall( + IBridgeManager.addBridgeOperators, + (uint256(0).toSingletonArray().toUint96sUnsafe(), governor.toSingletonArray(), operator.toSingletonArray().extend(governor.toSingletonArray())) + ) ); } @@ -97,15 +114,17 @@ abstract contract PostCheck_BridgeManager_CRUD_AddBridgeOperators is BasePostChe * @dev Validates that the function `addBridgeOperators`. */ function validate_addBridgeOperators() private onPostCheck("validate_addBridgeOperators") { - address manager = _manager[block.chainid]; + address manager = roninBridgeManager; uint256 totalWeightBefore = IBridgeManager(manager).getTotalWeight(); uint256 totalBridgeOperatorsBefore = IBridgeManager(manager).getBridgeOperators().length; vm.prank(manager); - bool[] memory addeds = - IBridgeManager(manager).addBridgeOperators(voteWeight.toSingletonArray().toUint96sUnsafe(), governor.toSingletonArray(), operator.toSingletonArray()); + TransparentUpgradeableProxyV2(payable(manager)).functionDelegateCall( + abi.encodeCall( + IBridgeManager.addBridgeOperators, (voteWeight.toSingletonArray().toUint96sUnsafe(), governor.toSingletonArray(), operator.toSingletonArray()) + ) + ); - assertTrue(addeds[0], "addeds[0] == false"); assertTrue(IBridgeManager(manager).isBridgeOperator(operator), "isBridgeOperator(operator) == false"); assertEq(IBridgeManager(manager).getTotalWeight(), totalWeightBefore + voteWeight, "getTotalWeight() != totalWeightBefore + voteWeight"); assertEq( diff --git a/script/post-check/bridge-manager/crud/PostCheck_BridgeManager_CRUD_removeBridgeOperators.s.sol b/script/post-check/bridge-manager/crud/PostCheck_BridgeManager_CRUD_removeBridgeOperators.s.sol index 1abcd2fc..881a3d92 100644 --- a/script/post-check/bridge-manager/crud/PostCheck_BridgeManager_CRUD_removeBridgeOperators.s.sol +++ b/script/post-check/bridge-manager/crud/PostCheck_BridgeManager_CRUD_removeBridgeOperators.s.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; +import { TransparentUpgradeableProxyV2 } from "@ronin/contracts/extensions/TransparentUpgradeableProxyV2.sol"; import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; import { BasePostCheck } from "script/post-check/BasePostCheck.s.sol"; import { LibArray } from "script/shared/libraries/LibArray.sol"; @@ -14,7 +15,7 @@ abstract contract PostCheck_BridgeManager_CRUD_RemoveBridgeOperators is BasePost address private any = makeAddr(string.concat("any", seedStr)); function _validate_BridgeManager_CRUD_removeBridgeOperators() internal { - address manager = _manager[block.chainid]; + address manager = roninBridgeManager; address[] memory operators = IBridgeManager(manager).getBridgeOperators(); uint256 idx = _bound(seed, 0, operators.length - 1); @@ -31,25 +32,31 @@ abstract contract PostCheck_BridgeManager_CRUD_RemoveBridgeOperators is BasePost function validate_RevertWhen_NotSelfCalled_removeBridgeOperators() private onPostCheck("validate_RevertWhen_NotSelfCalled_removeBridgeOperators") { vm.prank(any); vm.expectRevert(); - IBridgeManager(_manager[block.chainid]).removeBridgeOperators(operatorToRemove.toSingletonArray()); + TransparentUpgradeableProxyV2(payable(roninBridgeManager)).functionDelegateCall( + abi.encodeCall(IBridgeManager.removeBridgeOperators, (operatorToRemove.toSingletonArray())) + ); } function validate_RevertWhen_SelfCalled_TheListHasDuplicate_removeBridgeOperators() private onPostCheck("validate_RevertWhen_SelfCalled_TheListHasDuplicate_removeBridgeOperators") { - vm.prank(_manager[block.chainid]); + vm.prank(roninBridgeManager); vm.expectRevert(); - IBridgeManager(_manager[block.chainid]).removeBridgeOperators(operatorToRemove.toSingletonArray().extend(operatorToRemove.toSingletonArray())); + TransparentUpgradeableProxyV2(payable(roninBridgeManager)).functionDelegateCall( + abi.encodeCall(IBridgeManager.removeBridgeOperators, (operatorToRemove.toSingletonArray().extend(operatorToRemove.toSingletonArray()))) + ); } function validate_RevertWhen_SelfCalled_TheListHasNull_removeBridgeOperators() private onPostCheck("validate_RevertWhen_SelfCalled_TheListHasNull_removeBridgeOperators") { - vm.prank(_manager[block.chainid]); + vm.prank(roninBridgeManager); vm.expectRevert(); - IBridgeManager(_manager[block.chainid]).removeBridgeOperators(address(0).toSingletonArray()); + TransparentUpgradeableProxyV2(payable(roninBridgeManager)).functionDelegateCall( + abi.encodeCall(IBridgeManager.removeBridgeOperators, (address(0).toSingletonArray())) + ); } function validate_RevertWhen_SelfCalled_RemovedOperatorIsNotInTheList_removeBridgeOperators() @@ -57,18 +64,22 @@ abstract contract PostCheck_BridgeManager_CRUD_RemoveBridgeOperators is BasePost onPostCheck("validate_RevertWhen_SelfCalled_RemovedOperatorIsNotInTheList_removeBridgeOperators") { vm.expectRevert(); - vm.prank(_manager[block.chainid]); - IBridgeManager(_manager[block.chainid]).removeBridgeOperators(any.toSingletonArray()); + vm.prank(roninBridgeManager); + TransparentUpgradeableProxyV2(payable(roninBridgeManager)).functionDelegateCall( + abi.encodeCall(IBridgeManager.removeBridgeOperators, (any.toSingletonArray())) + ); } function validate_removeBridgeOperators() private onPostCheck("validate_removeBridgeOperators") { - address manager = _manager[block.chainid]; + address manager = roninBridgeManager; uint256 total = IBridgeManager(manager).totalBridgeOperator(); uint256 totalWeightBefore = IBridgeManager(manager).getTotalWeight(); uint256 expected = total - 1; vm.prank(manager); - IBridgeManager(manager).removeBridgeOperators(operatorToRemove.toSingletonArray()); + TransparentUpgradeableProxyV2(payable(roninBridgeManager)).functionDelegateCall( + abi.encodeCall(IBridgeManager.removeBridgeOperators, (operatorToRemove.toSingletonArray())) + ); uint256 actual = IBridgeManager(manager).totalBridgeOperator(); assertEq(actual, expected, "Bridge operator is not removed"); diff --git a/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol b/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol index 9de9e916..13c13edd 100644 --- a/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol +++ b/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.0; import { console } from "forge-std/console.sol"; -import { TransparentUpgradeableProxy } from "@ronin/contracts/extensions/TransparentUpgradeableProxyV2.sol"; +import { TransparentUpgradeableProxyV2, TransparentUpgradeableProxy } from "@ronin/contracts/extensions/TransparentUpgradeableProxyV2.sol"; import { BasePostCheck } from "../../BasePostCheck.s.sol"; import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; @@ -21,23 +21,10 @@ abstract contract PostCheck_BridgeManager_Proposal is BasePostCheck { using LibProposal for *; using LibCompanionNetwork for *; - address private _cheatGovernor; - address private _cheatOperator; - uint256 private _cheatGovernorPk; - uint96[] private _voteWeights = [100, 100]; address[] private _addingGovernors = [makeAddr("governor-1"), makeAddr("governor-2")]; address[] private _addingOperators = [makeAddr("operator-1"), makeAddr("operator-2")]; - modifier onlyOnRoninNetworkOrLocal() { - require( - block.chainid == DefaultNetwork.RoninMainnet.chainId() || block.chainid == DefaultNetwork.RoninTestnet.chainId() - || block.chainid == Network.RoninDevnet.chainId() || block.chainid == DefaultNetwork.Local.chainId(), - "chainid != RoninMainnet or RoninTestnet" - ); - _; - } - function _validate_BridgeManager_Proposal() internal { validate_ProposeGlobalProposalAndRelay_addBridgeOperator(); validate_proposeAndRelay_addBridgeOperator(); @@ -53,7 +40,10 @@ abstract contract PostCheck_BridgeManager_Proposal is BasePostCheck { address[] memory targets = address(manager).toSingletonArray(); uint256[] memory values = uint256(0).toSingletonArray(); - bytes[] memory calldatas = abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators)).toSingletonArray(); + bytes[] memory calldatas = abi.encodeCall( + TransparentUpgradeableProxyV2.functionDelegateCall, + (abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators))) + ).toSingletonArray(); uint256[] memory gasAmounts = uint256(1_000_000).toSingletonArray(); uint256 roninChainId = block.chainid; @@ -68,17 +58,18 @@ abstract contract PostCheck_BridgeManager_Proposal is BasePostCheck { nonce: manager.round(0) + 1 }); - vm.prank(_cheatGovernor); + vm.prank(cheatGovernor); manager.propose(roninChainId, block.timestamp + 20 minutes, address(0x0), targets, values, calldatas, gasAmounts); { TNetwork currentNetwork = CONFIG.getCurrentNetwork(); - (uint256 companionChainId, TNetwork companionNetwork) = currentNetwork.companionNetworkData(); - MainchainBridgeManager mainchainManager = MainchainBridgeManager(_manager[companionChainId]); - console.log("MainchainBridgeManager:", vm.getLabel(address(mainchainManager))); + (, TNetwork companionNetwork) = currentNetwork.companionNetworkData(); CONFIG.createFork(companionNetwork); CONFIG.switchTo(companionNetwork); + + MainchainBridgeManager mainchainManager = MainchainBridgeManager(loadContract(Contract.MainchainBridgeManager.key())); + uint256 snapshotId = vm.snapshot(); // Cheat add governor @@ -96,15 +87,15 @@ abstract contract PostCheck_BridgeManager_Proposal is BasePostCheck { nonce: mainchainManager.round(block.chainid) + 1 }); - SignatureConsumer.Signature[] memory signatures = proposal.generateSignatures(_cheatGovernorPk.toSingletonArray(), Ballot.VoteType.For); + SignatureConsumer.Signature[] memory signatures = proposal.generateSignatures(cheatGovernorPk.toSingletonArray(), Ballot.VoteType.For); Ballot.VoteType[] memory _supports = new Ballot.VoteType[](signatures.length); uint256 minimumForVoteWeight = mainchainManager.minimumVoteWeight(); - uint256 totalForVoteWeight = mainchainManager.getGovernorWeight(_cheatGovernor); + uint256 totalForVoteWeight = mainchainManager.getGovernorWeight(cheatGovernor); console.log("Total for vote weight:", totalForVoteWeight); console.log("Minimum for vote weight:", minimumForVoteWeight); - vm.prank(_cheatGovernor); + vm.prank(cheatGovernor); mainchainManager.relayProposal(proposal, _supports, signatures); for (uint256 i; i < _addingGovernors.length; ++i) { assertEq(mainchainManager.isBridgeOperator(_addingOperators[i]), true, "isBridgeOperator == false"); @@ -131,7 +122,10 @@ abstract contract PostCheck_BridgeManager_Proposal is BasePostCheck { expiryTimestamp: block.timestamp + 20 minutes, targetOptions: targetOptions, values: uint256(0).toSingletonArray(), - calldatas: abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators)).toSingletonArray(), + calldatas: abi.encodeCall( + TransparentUpgradeableProxyV2.functionDelegateCall, + (abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators))) + ).toSingletonArray(), gasAmounts: uint256(1_000_000).toSingletonArray(), nonce: manager.round(0) + 1 }); @@ -139,31 +133,33 @@ abstract contract PostCheck_BridgeManager_Proposal is BasePostCheck { SignatureConsumer.Signature[] memory signatures; Ballot.VoteType[] memory _supports; { - signatures = globalProposal.generateSignaturesGlobal(_cheatGovernorPk.toSingletonArray(), Ballot.VoteType.For); + signatures = globalProposal.generateSignaturesGlobal(cheatGovernorPk.toSingletonArray(), Ballot.VoteType.For); _supports = new Ballot.VoteType[](signatures.length); - vm.prank(_cheatGovernor); + vm.prank(cheatGovernor); manager.proposeGlobalProposalStructAndCastVotes(globalProposal, _supports, signatures); } // Check if the proposal is voted - assertEq(manager.globalProposalVoted(globalProposal.nonce, _cheatGovernor), true); + assertEq(manager.globalProposalVoted(globalProposal.nonce, cheatGovernor), true); for (uint256 i; i < _addingGovernors.length; ++i) { assertEq(manager.isBridgeOperator(_addingOperators[i]), true, "isBridgeOperator == false"); } { TNetwork currentNetwork = CONFIG.getCurrentNetwork(); - (uint256 companionChainId, TNetwork companionNetwork) = currentNetwork.companionNetworkData(); - MainchainBridgeManager mainchainManager = MainchainBridgeManager(_manager[companionChainId]); + (, TNetwork companionNetwork) = currentNetwork.companionNetworkData(); CONFIG.createFork(companionNetwork); CONFIG.switchTo(companionNetwork); + + MainchainBridgeManager mainchainManager = MainchainBridgeManager(loadContract(Contract.MainchainBridgeManager.key())); + uint256 snapshotId = vm.snapshot(); cheatAddOverWeightedGovernor(address(mainchainManager)); - vm.prank(_cheatGovernor); + vm.prank(cheatGovernor); mainchainManager.relayGlobalProposal(globalProposal, _supports, signatures); for (uint256 i; i < _addingGovernors.length; ++i) { @@ -231,15 +227,4 @@ abstract contract PostCheck_BridgeManager_Proposal is BasePostCheck { manager.executeProposal(proposal); } - - function cheatAddOverWeightedGovernor(address manager) private { - uint256 cheatVoteWeight = IBridgeManager(manager).getTotalWeight() * 100; - _cheatOperator = makeAddr(string.concat("cheat-operator-", vm.toString(seed))); - (_cheatGovernor, _cheatGovernorPk) = makeAddrAndKey(string.concat("cheat-governor-", vm.toString(seed))); - - vm.prank(manager); - bool[] memory addeds = IBridgeManager(manager).addBridgeOperators( - cheatVoteWeight.toSingletonArray().toUint96sUnsafe(), _cheatGovernor.toSingletonArray(), _cheatOperator.toSingletonArray() - ); - } } diff --git a/script/post-check/gateway/PostCheck_Gateway.s.sol b/script/post-check/gateway/PostCheck_Gateway.s.sol new file mode 100644 index 00000000..0abd1f0a --- /dev/null +++ b/script/post-check/gateway/PostCheck_Gateway.s.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { PostCheck_Gateway_DepositAndWithdraw } from "./deposit-withdraw/PostCheck_Gateway_DepositAndWithdraw.s.sol"; + +abstract contract PostCheck_Gateway is PostCheck_Gateway_DepositAndWithdraw { + function _validate_Gateway() internal onPostCheck("_validate_Gateway") { + _validate_Gateway_DepositAndWithdraw(); + } +} diff --git a/script/post-check/gateway/deposit-withdraw/PostCheck_Gateway_DepositAndWithdraw.s.sol b/script/post-check/gateway/deposit-withdraw/PostCheck_Gateway_DepositAndWithdraw.s.sol new file mode 100644 index 00000000..bd372e4c --- /dev/null +++ b/script/post-check/gateway/deposit-withdraw/PostCheck_Gateway_DepositAndWithdraw.s.sol @@ -0,0 +1,243 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { console } from "forge-std/console.sol"; +import { Vm, VmSafe } from "forge-std/Vm.sol"; +import { BasePostCheck } from "script/post-check/BasePostCheck.s.sol"; +import { MockERC20 } from "@ronin/contracts/mocks/token/MockERC20.sol"; +import { Contract } from "script/utils/Contract.sol"; +import { LibTokenInfo, TokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; +import { Transfer as LibTransfer } from "@ronin/contracts/libraries/Transfer.sol"; +import { TNetwork, Network } from "script/utils/Network.sol"; +import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol"; +import { Proposal, LibProposal } from "script/shared/libraries/LibProposal.sol"; +import { LibProxy } from "@fdk/libraries/LibProxy.sol"; +import { LibCompanionNetwork } from "script/shared/libraries/LibCompanionNetwork.sol"; +import { StdStorage, stdStorage } from "forge-std/StdStorage.sol"; +import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; +import { LibArray } from "script/shared/libraries/LibArray.sol"; +import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; +import { IRoninGatewayV3, RoninGatewayV3 } from "@ronin/contracts/ronin/gateway/RoninGatewayV3.sol"; +import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; +import { MainchainBridgeManager } from "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; +import { IMainchainGatewayV3, MainchainGatewayV3 } from "@ronin/contracts/mainchain/MainchainGatewayV3.sol"; +import { TransparentUpgradeableProxyV2 } from "@ronin/contracts/extensions/TransparentUpgradeableProxyV2.sol"; + +abstract contract PostCheck_Gateway_DepositAndWithdraw is BasePostCheck, SignatureConsumer { + using LibProxy for *; + using LibArray for *; + using LibProposal for *; + using stdStorage for StdStorage; + using LibCompanionNetwork for *; + using LibTransfer for LibTransfer.Request; + using LibTransfer for LibTransfer.Receipt; + + address private user = makeAddr("user"); + uint256 private quantity; + + LibTransfer.Request depositRequest; + LibTransfer.Request withdrawRequest; + + MockERC20 private roninERC20; + MockERC20 private mainchainERC20; + + address[] private roninTokens; + address[] private mainchainTokens; + TokenStandard[] private standards = [TokenStandard.ERC20]; + + uint256 private roninChainId; + uint256 private mainchainChainId; + + TNetwork private currentNetwork; + TNetwork private companionNetwork; + + function _setUp() private onlyOnRoninNetworkOrLocal { + console.log("RoninBridgeManager", roninBridgeManager); + console.log("MainchainBridgeManager", mainchainBridgeManager); + + console.log("RoninGateway", roninGateway); + console.log("MainchainGateway", mainchainGateway); + + _setUpOnRonin(); + _setUpOnMainchain(); + _mapTokenRonin(); + _mapTokenMainchain(); + } + + function _mapTokenRonin() private { + uint256[] memory chainIds = new uint256[](1); + chainIds[0] = network().companionChainId(); + address admin = roninGateway.getProxyAdmin(); + console.log("Admin", admin); + vm.prank(address(admin)); + TransparentUpgradeableProxyV2(payable(address(roninGateway))).functionDelegateCall( + abi.encodeCall(RoninGatewayV3.mapTokens, (roninTokens, mainchainTokens, chainIds, standards)) + ); + } + + function _mapTokenMainchain() private { + (, companionNetwork) = network().companionNetworkData(); + CONFIG.createFork(companionNetwork); + CONFIG.switchTo(companionNetwork); + + uint256[][4] memory thresholds; + thresholds[0] = new uint256[](1); + thresholds[0][0] = 200_000_000 ether; + thresholds[1] = new uint256[](1); + thresholds[1][0] = 800_000_000 ether; + thresholds[2] = new uint256[](1); + thresholds[2][0] = 10; + thresholds[3] = new uint256[](1); + thresholds[3][0] = 500_000_000 ether; + + console.log("Mainchain Gateway", address(mainchainGateway)); + address admin = mainchainGateway.getProxyAdmin(); + console.log("Admin", admin); + + vm.prank(admin); + TransparentUpgradeableProxyV2(payable(address(mainchainGateway))).functionDelegateCall( + abi.encodeCall(MainchainGatewayV3.mapTokensAndThresholds, (mainchainTokens, roninTokens, standards, thresholds)) + ); + + CONFIG.switchTo(currentNetwork); + } + + function _setUpOnRonin() private { + roninERC20 = new MockERC20("RoninERC20", "RERC20"); + // roninERC20.initialize("RoninERC20", "RERC20", 18); + roninTokens.push(address(roninERC20)); + roninChainId = block.chainid; + currentNetwork = network(); + + cheatAddOverWeightedGovernor(address(roninBridgeManager)); + + vm.deal(user, 10 ether); + deal(address(roninERC20), user, 1000 ether); + } + + function _setUpOnMainchain() private { + (, companionNetwork) = network().companionNetworkData(); + CONFIG.createFork(companionNetwork); + CONFIG.switchTo(companionNetwork); + + mainchainChainId = block.chainid; + domainSeparator = MainchainBridgeManager(mainchainBridgeManager).DOMAIN_SEPARATOR(); + + cheatAddOverWeightedGovernor(address(mainchainBridgeManager)); + + mainchainERC20 = new MockERC20("MainchainERC20", "MERC20"); + // mainchainERC20.initialize("MainchainERC20", "MERC20", 18); + mainchainTokens.push(address(mainchainERC20)); + + vm.deal(user, 10 ether); + deal(address(mainchainERC20), user, 1000 ether); + + CONFIG.switchTo(currentNetwork); + } + + function _validate_Gateway_DepositAndWithdraw() internal onlyOnRoninNetworkOrLocal { + _setUp(); + validate_Gateway_depositERC20(); + validate_Gateway_withdrawERC20(); + } + + function validate_Gateway_depositERC20() private onPostCheck("validate_Gateway_depositERC20") { + depositRequest.recipientAddr = makeAddr("ronin-recipient"); + depositRequest.tokenAddr = address(mainchainERC20); + depositRequest.info.erc = TokenStandard.ERC20; + depositRequest.info.id = 0; + depositRequest.info.quantity = 100 ether; + + CONFIG.createFork(companionNetwork); + CONFIG.switchTo(companionNetwork); + + vm.prank(user); + mainchainERC20.approve(address(mainchainGateway), 100 ether); + vm.prank(user); + vm.recordLogs(); + MainchainGatewayV3(mainchainGateway).requestDepositFor(depositRequest); + + VmSafe.Log[] memory logs = vm.getRecordedLogs(); + LibTransfer.Receipt memory receipt; + bytes32 receiptHash; + for (uint256 i; i < logs.length; ++i) { + if (logs[i].emitter == address(mainchainGateway) && logs[i].topics[0] == IMainchainGatewayV3.DepositRequested.selector) { + (receiptHash, receipt) = abi.decode(logs[i].data, (bytes32, LibTransfer.Receipt)); + } + } + + CONFIG.switchTo(currentNetwork); + + vm.prank(cheatOperator); + RoninGatewayV3(roninGateway).depositFor(receipt); + + assertEq(roninERC20.balanceOf(depositRequest.recipientAddr), 100 ether); + } + + function validate_Gateway_withdrawERC20() private onPostCheck("validate_Gateway_withdrawERC20") { + withdrawRequest.recipientAddr = makeAddr("mainchain-recipient"); + withdrawRequest.tokenAddr = address(roninERC20); + withdrawRequest.info.erc = TokenStandard.ERC20; + withdrawRequest.info.id = 0; + withdrawRequest.info.quantity = 100 ether; + + // uint256 _numOperatorsForVoteExecuted = (RoninBridgeManager(_manager[block.chainid]).minimumVoteWeight() - 1) / 100 + 1; + vm.prank(user); + roninERC20.approve(address(roninGateway), 100 ether); + vm.prank(user); + vm.recordLogs(); + RoninGatewayV3(payable(address(roninGateway))).requestWithdrawalFor(withdrawRequest, mainchainChainId); + + VmSafe.Log[] memory logs = vm.getRecordedLogs(); + LibTransfer.Receipt memory receipt; + bytes32 receiptHash; + for (uint256 i; i < logs.length; ++i) { + if (logs[i].emitter == address(roninGateway) && logs[i].topics[0] == IRoninGatewayV3.WithdrawalRequested.selector) { + (receiptHash, receipt) = abi.decode(logs[i].data, (bytes32, LibTransfer.Receipt)); + } + } + + bytes32 receiptDigest = LibTransfer.receiptDigest(domainSeparator, receiptHash); + + (uint8 v, bytes32 r, bytes32 s) = vm.sign(cheatOperatorPk, receiptDigest); + + Signature[] memory sigs = new Signature[](1); + sigs[0] = Signature(v, r, s); + + CONFIG.createFork(companionNetwork); + CONFIG.switchTo(companionNetwork); + + MainchainGatewayV3(payable(mainchainGateway)).submitWithdrawal(receipt, sigs); + + assertEq(mainchainERC20.balanceOf(withdrawRequest.recipientAddr), 100 ether); + + CONFIG.switchTo(currentNetwork); + } + + // Set the balance of an account for any ERC20 token + // Use the alternative signature to update `totalSupply` + function deal(address token, address to, uint256 give) internal virtual { + deal(token, to, give, false); + } + + function deal(address token, address to, uint256 give, bool adjust) internal virtual { + // get current balance + (, bytes memory balData) = token.staticcall(abi.encodeWithSelector(0x70a08231, to)); + uint256 prevBal = abi.decode(balData, (uint256)); + + // update balance + stdstore.target(token).sig(0x70a08231).with_key(to).checked_write(give); + + // update total supply + if (adjust) { + (, bytes memory totSupData) = token.staticcall(abi.encodeWithSelector(0x18160ddd)); + uint256 totSup = abi.decode(totSupData, (uint256)); + if (give < prevBal) { + totSup -= (prevBal - give); + } else { + totSup += (give - prevBal); + } + stdstore.target(token).sig(0x18160ddd).checked_write(totSup); + } + } +} diff --git a/script/shared/libraries/LibProposal.sol b/script/shared/libraries/LibProposal.sol index ea32051c..2f0b0ad3 100644 --- a/script/shared/libraries/LibProposal.sol +++ b/script/shared/libraries/LibProposal.sol @@ -2,6 +2,7 @@ pragma solidity ^0.8.0; import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; +import { TransparentUpgradeableProxyV2 } from "@ronin/contracts/extensions/TransparentUpgradeableProxyV2.sol"; import { Vm } from "forge-std/Vm.sol"; import { console2 as console } from "forge-std/console2.sol"; import { IGeneralConfigExtended } from "script/interfaces/IGeneralConfigExtended.sol"; @@ -16,12 +17,14 @@ import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeMa import { SignatureConsumer } from "@ronin/contracts/interfaces/consumers/SignatureConsumer.sol"; import { CoreGovernance } from "@ronin/contracts/extensions/sequential-governance/CoreGovernance.sol"; import { LibArray } from "./LibArray.sol"; +import { LibProxy } from "@fdk/libraries/LibProxy.sol"; import { LibCompanionNetwork } from "./LibCompanionNetwork.sol"; import { LibErrorHandler } from "lib/foundry-deployment-kit/lib/contract-libs/src/LibErrorHandler.sol"; import { VoteStatusConsumer } from "@ronin/contracts/interfaces/consumers/VoteStatusConsumer.sol"; library LibProposal { using LibArray for *; + using LibProxy for *; using ECDSA for bytes32; using LibErrorHandler for bool; using LibCompanionNetwork for *; @@ -52,9 +55,9 @@ library LibProposal { return keccak256( abi.encode( keccak256("EIP712Domain(string name,string version,bytes32 salt)"), - keccak256("BridgeAdmin"), // name hash - keccak256("2"), // version hash - keccak256(abi.encode("BRIDGE_ADMIN", chainId)) // salt + keccak256("BridgeManager"), // name hash + keccak256("3"), // version hash + keccak256(abi.encode("BRIDGE_MANAGER", chainId)) // salt ) ); } @@ -160,7 +163,7 @@ library LibProposal { address[] memory roninTargets = new address[](targetOptions.length); address[] memory mainchainTargets = new address[](targetOptions.length); - if (currentNetwork == Network.EthMainnet.key() || currentNetwork == Network.Goerli.key()) { + if (currentNetwork == Network.EthMainnet.key() || currentNetwork == Network.Goerli.key() || currentNetwork == Network.Sepolia.key()) { manager = config.getAddress(currentNetwork, Contract.MainchainBridgeManager.key()); companionManager = config.getAddress(companionNetwork, Contract.RoninBridgeManager.key()); } else { @@ -199,6 +202,7 @@ library LibProposal { uint256 gasUsed = gasleft(); (bool success, bytes memory returnOrRevertData) = mainchainTargets[i].call{ value: values[i], gas: gasAmounts[i] }(calldatas[i]); + gasUsed = gasUsed - gasleft(); if (success) { @@ -228,6 +232,7 @@ library LibProposal { vm.prank(governance); uint256 gasUsed = gasleft(); + (bool success, bytes memory returnOrRevertData) = targets[i].call{ value: values[i], gas: gasAmounts[i] }(calldatas[i]); gasUsed = gasUsed - gasleft(); diff --git a/script/utils/Contract.sol b/script/utils/Contract.sol index e0ed8376..e943ea15 100644 --- a/script/utils/Contract.sol +++ b/script/utils/Contract.sol @@ -22,7 +22,8 @@ enum Contract { MainchainGatewayV3, MainchainBridgeManager, MainchainWethUnwrapper, - MainchainGatewayBatcher + MainchainGatewayBatcher, + PostChecker } using { key, name } for Contract global; @@ -54,5 +55,7 @@ function name(Contract contractEnum) pure returns (string memory) { if (contractEnum == Contract.MainchainBridgeManager) return "MainchainBridgeManager"; if (contractEnum == Contract.MainchainWethUnwrapper) return "WethUnwrapper"; + if (contractEnum == Contract.PostChecker) return "PostChecker"; + revert("Contract: Unknown contract"); } diff --git a/test/bridge/integration/bridge-manager/deposit-and-record/bulkAcknowledgeMainchainWithdrew.Gateway.t.sol b/test/bridge/integration/ronin-gateway/deposit-and-record/bulkAcknowledgeMainchainWithdrew.Gateway.t.sol similarity index 100% rename from test/bridge/integration/bridge-manager/deposit-and-record/bulkAcknowledgeMainchainWithdrew.Gateway.t.sol rename to test/bridge/integration/ronin-gateway/deposit-and-record/bulkAcknowledgeMainchainWithdrew.Gateway.t.sol diff --git a/test/bridge/integration/bridge-manager/deposit-and-record/bulkDepositAndRecord.Gateway.t.sol b/test/bridge/integration/ronin-gateway/deposit-and-record/bulkDepositAndRecord.Gateway.t.sol similarity index 100% rename from test/bridge/integration/bridge-manager/deposit-and-record/bulkDepositAndRecord.Gateway.t.sol rename to test/bridge/integration/ronin-gateway/deposit-and-record/bulkDepositAndRecord.Gateway.t.sol diff --git a/test/bridge/integration/bridge-manager/deposit-and-record/bulkSubmitWithdrawalSignatures.Gateway.t.sol b/test/bridge/integration/ronin-gateway/deposit-and-record/bulkSubmitWithdrawalSignatures.Gateway.t.sol similarity index 100% rename from test/bridge/integration/bridge-manager/deposit-and-record/bulkSubmitWithdrawalSignatures.Gateway.t.sol rename to test/bridge/integration/ronin-gateway/deposit-and-record/bulkSubmitWithdrawalSignatures.Gateway.t.sol diff --git a/test/bridge/integration/bridge-manager/deposit-and-record/depositAndRecord.Gateway.t.sol b/test/bridge/integration/ronin-gateway/deposit-and-record/depositAndRecord.Gateway.t.sol similarity index 100% rename from test/bridge/integration/bridge-manager/deposit-and-record/depositAndRecord.Gateway.t.sol rename to test/bridge/integration/ronin-gateway/deposit-and-record/depositAndRecord.Gateway.t.sol From 10096bb78ed8e662c2512fb255df7a75bd6b634e Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 15 Apr 2024 14:48:52 +0700 Subject: [PATCH 154/180] script: fix script for full flow --- ...0240411-deploy-bridge-manager-helper.s.sol | 93 +++++++++++ .../20240411-helper.s.sol | 2 - ...40411-p1-deploy-ronin-bridge-manager.s.sol | 64 +------- ...240411-p2-upgrade-bridge-ronin-chain.s.sol | 34 ++-- ...0240411-p3-upgrade-bridge-main-chain.s.sol | 152 +++++++++--------- .../verify-script.s.sol | 23 +++ script/Migration.s.sol | 24 ++- .../contracts/RoninBridgeManagerDeploy.s.sol | 2 +- script/post-check/BasePostCheck.s.sol | 4 +- 9 files changed, 231 insertions(+), 167 deletions(-) create mode 100644 script/20240411-upgrade-v3.2.0-testnet/20240411-deploy-bridge-manager-helper.s.sol create mode 100644 script/20240411-upgrade-v3.2.0-testnet/verify-script.s.sol diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-deploy-bridge-manager-helper.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-deploy-bridge-manager-helper.s.sol new file mode 100644 index 00000000..39f5604f --- /dev/null +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-deploy-bridge-manager-helper.s.sol @@ -0,0 +1,93 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { console2 } from "forge-std/console2.sol"; +import { StdStyle } from "forge-std/StdStyle.sol"; +import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeManager.sol"; +import { IMainchainGatewayV3 } from "@ronin/contracts/interfaces/IMainchainGatewayV3.sol"; +import { GlobalProposal } from "@ronin/contracts/libraries/GlobalProposal.sol"; +import { LibTokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibTokenInfo.sol"; +import { Contract } from "../utils/Contract.sol"; +import { Network } from "../utils/Network.sol"; +import { Contract } from "../utils/Contract.sol"; +import { IGeneralConfigExtended } from "../interfaces/IGeneralConfigExtended.sol"; +import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; +import "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; +import "@ronin/contracts/mainchain/MainchainGatewayV3.sol"; +import "@ronin/contracts/libraries/Proposal.sol"; +import "@ronin/contracts/libraries/Ballot.sol"; + +import { MockSLP } from "@ronin/contracts/mocks/token/MockSLP.sol"; +import { SLPDeploy } from "@ronin/script/contracts/token/SLPDeploy.s.sol"; +import { MainchainBridgeAdminUtils } from "test/helpers/MainchainBridgeAdminUtils.t.sol"; +import "@ronin/script/contracts/RoninBridgeManagerDeploy.s.sol"; + +import "../Migration.s.sol"; + +contract Migration__2024041_DeployRoninBridgeManagerHelper is Migration { + RoninBridgeManager _newRoninBridgeManager; + + function _deployRoninBridgeManager() internal returns (RoninBridgeManager) { + ISharedArgument.SharedParameter memory param; + + param.roninBridgeManager.num = 7; + param.roninBridgeManager.denom = 10; + param.roninBridgeManager.roninChainId = block.chainid; + param.roninBridgeManager.expiryDuration = 60 * 60 * 24 * 14; // 14 days + param.roninBridgeManager.bridgeContract = config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); + param.roninBridgeManager.bridgeOperators = new address[](4); + param.roninBridgeManager.bridgeOperators[0] = 0x2e82D2b56f858f79DeeF11B160bFC4631873da2B; + param.roninBridgeManager.bridgeOperators[1] = 0xBcb61783dd2403FE8cC9B89B27B1A9Bb03d040Cb; + param.roninBridgeManager.bridgeOperators[2] = 0xB266Bf53Cf7EAc4E2065A404598DCB0E15E9462c; + param.roninBridgeManager.bridgeOperators[3] = 0xcc5Fc5B6c8595F56306Da736F6CD02eD9141C84A; + + param.roninBridgeManager.governors = new address[](4); + param.roninBridgeManager.governors[0] = 0xd24D87DDc1917165435b306aAC68D99e0F49A3Fa; + param.roninBridgeManager.governors[1] = 0xb033ba62EC622dC54D0ABFE0254e79692147CA26; + param.roninBridgeManager.governors[2] = 0x087D08e3ba42e64E3948962dd1371F906D1278b9; + param.roninBridgeManager.governors[3] = 0x52ec2e6BBcE45AfFF8955Da6410bb13812F4289F; + + param.roninBridgeManager.voteWeights = new uint96[](4); + param.roninBridgeManager.voteWeights[0] = 100; + param.roninBridgeManager.voteWeights[1] = 100; + param.roninBridgeManager.voteWeights[2] = 100; + param.roninBridgeManager.voteWeights[3] = 100; + + param.roninBridgeManager.targetOptions = new GlobalProposal.TargetOption[](5); + param.roninBridgeManager.targetOptions[0] = GlobalProposal.TargetOption.GatewayContract; + param.roninBridgeManager.targetOptions[1] = GlobalProposal.TargetOption.BridgeReward; + param.roninBridgeManager.targetOptions[2] = GlobalProposal.TargetOption.BridgeSlash; + param.roninBridgeManager.targetOptions[3] = GlobalProposal.TargetOption.BridgeTracking; + param.roninBridgeManager.targetOptions[4] = GlobalProposal.TargetOption.PauseEnforcer; + + param.roninBridgeManager.targets = new address[](5); + param.roninBridgeManager.targets[0] = config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); + param.roninBridgeManager.targets[1] = config.getAddressFromCurrentNetwork(Contract.BridgeReward.key()); + param.roninBridgeManager.targets[2] = config.getAddressFromCurrentNetwork(Contract.BridgeSlash.key()); + param.roninBridgeManager.targets[3] = config.getAddressFromCurrentNetwork(Contract.BridgeTracking.key()); + param.roninBridgeManager.targets[4] = config.getAddressFromCurrentNetwork(Contract.RoninPauseEnforcer.key()); + + _newRoninBridgeManager = RoninBridgeManager( + new RoninBridgeManagerDeploy().overrideArgs( + abi.encodeCall( + RoninBridgeManagerConstructor.initialize, + ( + param.roninBridgeManager.num, + param.roninBridgeManager.denom, + param.roninBridgeManager.roninChainId, + param.roninBridgeManager.expiryDuration, + param.roninBridgeManager.bridgeContract, + param.roninBridgeManager.callbackRegisters, + param.roninBridgeManager.bridgeOperators, + param.roninBridgeManager.governors, + param.roninBridgeManager.voteWeights, + param.roninBridgeManager.targetOptions, + param.roninBridgeManager.targets + ) + ) + ).run() + ); + + return _newRoninBridgeManager; + } +} diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol index 84749f17..ce9652fd 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol @@ -19,14 +19,12 @@ contract Migration__20240409_Helper is Migration { address[] internal _voters; RoninBridgeManager internal _currRoninBridgeManager; - RoninBridgeManager internal _newRoninBridgeManager; function _helperProposeForCurrentNetwork(LegacyProposalDetail memory proposal) internal { vm.broadcast(_governor); address(_currRoninBridgeManager).call( abi.encodeWithSignature( "proposeProposalForCurrentNetwork(uint256,address[],uint256[],bytes[],uint256[],uint8)", - // proposal.chainId, proposal.expiryTimestamp, proposal.targets, proposal.values, diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.s.sol index e2da3e12..f13e088e 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.s.sol @@ -21,75 +21,17 @@ import { SLPDeploy } from "@ronin/script/contracts/token/SLPDeploy.s.sol"; import { MainchainBridgeAdminUtils } from "test/helpers/MainchainBridgeAdminUtils.t.sol"; import "@ronin/script/contracts/RoninBridgeManagerDeploy.s.sol"; +import "./20240411-deploy-bridge-manager-helper.s.sol"; import "../Migration.s.sol"; -contract Migration__20240409_P1_DeployRoninBridgeManager is Migration { +contract Migration__20240409_P1_DeployRoninBridgeManager is Migration, Migration__2024041_DeployRoninBridgeManagerHelper { ISharedArgument.SharedParameter _param; - RoninBridgeManager _newRoninBridgeManager; function setUp() public override { super.setUp(); } function run() public onlyOn(DefaultNetwork.RoninTestnet.key()) { - ISharedArgument.SharedParameter memory param; - - param.roninBridgeManager.num = 7; - param.roninBridgeManager.denom = 10; - param.roninBridgeManager.roninChainId = block.chainid; - param.roninBridgeManager.expiryDuration = 60 * 60 * 24 * 14; // 14 days - param.roninBridgeManager.bridgeContract = config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); - param.roninBridgeManager.bridgeOperators = new address[](4); - param.roninBridgeManager.bridgeOperators[0] = 0x2e82D2b56f858f79DeeF11B160bFC4631873da2B; - param.roninBridgeManager.bridgeOperators[1] = 0xBcb61783dd2403FE8cC9B89B27B1A9Bb03d040Cb; - param.roninBridgeManager.bridgeOperators[2] = 0xB266Bf53Cf7EAc4E2065A404598DCB0E15E9462c; - param.roninBridgeManager.bridgeOperators[3] = 0xcc5Fc5B6c8595F56306Da736F6CD02eD9141C84A; - - param.roninBridgeManager.governors = new address[](4); - param.roninBridgeManager.governors[0] = 0xd24D87DDc1917165435b306aAC68D99e0F49A3Fa; - param.roninBridgeManager.governors[1] = 0xb033ba62EC622dC54D0ABFE0254e79692147CA26; - param.roninBridgeManager.governors[2] = 0x087D08e3ba42e64E3948962dd1371F906D1278b9; - param.roninBridgeManager.governors[3] = 0x52ec2e6BBcE45AfFF8955Da6410bb13812F4289F; - - param.roninBridgeManager.voteWeights = new uint96[](4); - param.roninBridgeManager.voteWeights[0] = 100; - param.roninBridgeManager.voteWeights[1] = 100; - param.roninBridgeManager.voteWeights[2] = 100; - param.roninBridgeManager.voteWeights[3] = 100; - - param.roninBridgeManager.targetOptions = new GlobalProposal.TargetOption[](5); - param.roninBridgeManager.targetOptions[0] = GlobalProposal.TargetOption.GatewayContract; - param.roninBridgeManager.targetOptions[1] = GlobalProposal.TargetOption.BridgeReward; - param.roninBridgeManager.targetOptions[2] = GlobalProposal.TargetOption.BridgeSlash; - param.roninBridgeManager.targetOptions[3] = GlobalProposal.TargetOption.BridgeTracking; - param.roninBridgeManager.targetOptions[4] = GlobalProposal.TargetOption.PauseEnforcer; - - param.roninBridgeManager.targets = new address[](4); - param.roninBridgeManager.targets[0] = config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); - param.roninBridgeManager.targets[1] = config.getAddressFromCurrentNetwork(Contract.BridgeReward.key()); - param.roninBridgeManager.targets[2] = config.getAddressFromCurrentNetwork(Contract.BridgeSlash.key()); - param.roninBridgeManager.targets[3] = config.getAddressFromCurrentNetwork(Contract.BridgeTracking.key()); - param.roninBridgeManager.targets[4] = config.getAddressFromCurrentNetwork(Contract.RoninPauseEnforcer.key()); - - _newRoninBridgeManager = RoninBridgeManager( - new RoninBridgeManagerDeploy().overrideArgs( - abi.encodeCall( - RoninBridgeManagerConstructor.initialize, - ( - param.roninBridgeManager.num, - param.roninBridgeManager.denom, - param.roninBridgeManager.roninChainId, - param.roninBridgeManager.expiryDuration, - param.roninBridgeManager.bridgeContract, - param.roninBridgeManager.callbackRegisters, - param.roninBridgeManager.bridgeOperators, - param.roninBridgeManager.governors, - param.roninBridgeManager.voteWeights, - param.roninBridgeManager.targetOptions, - param.roninBridgeManager.targets - ) - ) - ).run() - ); + _deployRoninBridgeManager(); } } diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol index d231c4d9..5a1ae5f5 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol @@ -20,30 +20,31 @@ import { MockSLP } from "@ronin/contracts/mocks/token/MockSLP.sol"; import { SLPDeploy } from "@ronin/script/contracts/token/SLPDeploy.s.sol"; import { MainchainBridgeAdminUtils } from "test/helpers/MainchainBridgeAdminUtils.t.sol"; import "@ronin/script/contracts/RoninBridgeManagerDeploy.s.sol"; - +import { DefaultContract } from "@fdk/utils/DefaultContract.sol"; +import "./20240411-deploy-bridge-manager-helper.s.sol"; import "./20240411-helper.s.sol"; -contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_Helper { +contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_Helper, Migration__2024041_DeployRoninBridgeManagerHelper { ISharedArgument.SharedParameter _param; - function setUp() public override { + function setUp() public virtual override { super.setUp(); + } - _newRoninBridgeManager = RoninBridgeManager(address(0xdeadbeef)); // TODO: fulfill here + function run() public virtual onlyOn(DefaultNetwork.RoninTestnet.key()) { _currRoninBridgeManager = RoninBridgeManager(config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); - } + _newRoninBridgeManager = _deployRoninBridgeManager(); - function run() public onlyOn(DefaultNetwork.RoninTestnet.key()) { _governor = 0xd24D87DDc1917165435b306aAC68D99e0F49A3Fa; _voters.push(0xb033ba62EC622dC54D0ABFE0254e79692147CA26); _voters.push(0x087D08e3ba42e64E3948962dd1371F906D1278b9); _voters.push(0x52ec2e6BBcE45AfFF8955Da6410bb13812F4289F); _changeAdminOfEnforcer(); - _upgradeBridge(); + _upgradeBridgeRoninchain(); } - function _changeAdminOfEnforcer() internal { + function _changeAdminOfEnforcer() private { RoninBridgeManager roninGA = RoninBridgeManager(0x53Ea388CB72081A3a397114a43741e7987815896); address pauseEnforcerProxy = config.getAddressFromCurrentNetwork(Contract.RoninPauseEnforcer.key()); @@ -91,7 +92,7 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H } } - function _upgradeBridge() internal { + function _upgradeBridgeRoninchain() private { address bridgeRewardLogic = _deployLogic(Contract.BridgeReward.key()); address bridgeSlashLogic = _deployLogic(Contract.BridgeSlash.key()); address bridgeTrackingLogic = _deployLogic(Contract.BridgeTracking.key()); @@ -105,7 +106,7 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H address roninGatewayV3Proxy = config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); uint256 expiredTime = block.timestamp + 14 days; - uint N = 10; + uint N = 11; address[] memory targets = new address[](N); uint256[] memory values = new uint256[](N); bytes[] memory calldatas = new bytes[](N); @@ -119,8 +120,9 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H targets[5] = bridgeSlashProxy; targets[6] = bridgeTrackingProxy; targets[7] = roninGatewayV3Proxy; - targets[8] = pauseEnforcerProxy; + targets[8] = roninGatewayV3Proxy; targets[9] = pauseEnforcerProxy; + targets[10] = pauseEnforcerProxy; calldatas[0] = abi.encodeWithSignature("upgradeTo(address)", bridgeRewardLogic); calldatas[1] = abi.encodeWithSignature("upgradeTo(address)", bridgeSlashLogic); @@ -129,9 +131,13 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H calldatas[4] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); calldatas[5] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); calldatas[6] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); - calldatas[7] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); - calldatas[8] = abi.encodeWithSignature("upgradeTo(address)", pauseEnforcerLogic); - calldatas[9] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); + calldatas[7] = abi.encodeWithSignature( + "functionDelegateCall(bytes)", + (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newRoninBridgeManager))) + ); + calldatas[8] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); + calldatas[9] = abi.encodeWithSignature("upgradeTo(address)", pauseEnforcerLogic); + calldatas[10] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); for (uint i; i < N; ++i) { gasAmounts[i] = 1_000_000; diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol index 213649bb..fea4c058 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol @@ -23,37 +23,28 @@ import { MainchainBridgeAdminUtils } from "test/helpers/MainchainBridgeAdminUtil import "@ronin/script/contracts/MainchainBridgeManagerDeploy.s.sol"; import "@ronin/script/contracts/MainchainWethUnwrapperDeploy.s.sol"; +import "./20240411-helper.s.sol"; import "./20240411-operators-key.s.sol"; import "../Migration.s.sol"; -struct LegacyProposalDetail { - uint256 nonce; - uint256 chainId; - uint256 expiryTimestamp; - address[] targets; - uint256[] values; - bytes[] calldatas; - uint256[] gasAmounts; -} - contract Migration__20240409_P3_UpgradeBridgeMainchain is Migration, Migration__20240409_GovernorsKey { - ISharedArgument.SharedParameter _param; MainchainBridgeManager _currMainchainBridgeManager; MainchainBridgeManager _newMainchainBridgeManager; address private _governor; address[] private _voters; - address PROXY_ADMIN = 0x968D0Cd7343f711216817E617d3f92a23dC91c07; + address TESTNET_ADMIN = 0x968D0Cd7343f711216817E617d3f92a23dC91c07; - function setUp() public override { + function setUp() public virtual override { super.setUp(); - CONFIG.setAddress(network(), DefaultContract.ProxyAdmin.key(), PROXY_ADMIN); + } + + function run() public virtual onlyOn(Network.Sepolia.key()) { + CONFIG.setAddress(network(), DefaultContract.ProxyAdmin.key(), TESTNET_ADMIN); _currMainchainBridgeManager = MainchainBridgeManager(config.getAddressFromCurrentNetwork(Contract.MainchainBridgeManager.key())); - } - function run() public onlyOn(Network.Sepolia.key()) { _governor = 0xd24D87DDc1917165435b306aAC68D99e0F49A3Fa; _voters.push(0xb033ba62EC622dC54D0ABFE0254e79692147CA26); _voters.push(0x087D08e3ba42e64E3948962dd1371F906D1278b9); @@ -61,7 +52,7 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is Migration, Migration__ _changeTempAdmin(); _deployMainchainBridgeManager(); - _upgradeBridge(); + _upgradeBridgeMainchain(); } function _changeTempAdmin() internal { @@ -74,9 +65,62 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is Migration, Migration__ vm.stopBroadcast(); } - function _upgradeBridge() internal { - _newMainchainBridgeManager = new MainchainBridgeManagerDeploy().run(); + function _deployMainchainBridgeManager() internal returns (address mainchainBM) { + ISharedArgument.SharedParameter memory param; + + param.mainchainBridgeManager.num = 7; + param.mainchainBridgeManager.denom = 10; + param.mainchainBridgeManager.roninChainId = 2021; + param.mainchainBridgeManager.expiryDuration = 60 * 60 * 24 * 14; // 14 days + param.mainchainBridgeManager.bridgeContract = config.getAddressFromCurrentNetwork(Contract.MainchainGatewayV3.key()); + param.mainchainBridgeManager.bridgeOperators = new address[](4); + param.mainchainBridgeManager.bridgeOperators[0] = 0x2e82D2b56f858f79DeeF11B160bFC4631873da2B; + param.mainchainBridgeManager.bridgeOperators[1] = 0xBcb61783dd2403FE8cC9B89B27B1A9Bb03d040Cb; + param.mainchainBridgeManager.bridgeOperators[2] = 0xB266Bf53Cf7EAc4E2065A404598DCB0E15E9462c; + param.mainchainBridgeManager.bridgeOperators[3] = 0xcc5Fc5B6c8595F56306Da736F6CD02eD9141C84A; + + param.mainchainBridgeManager.governors = new address[](4); + param.mainchainBridgeManager.governors[0] = 0xd24D87DDc1917165435b306aAC68D99e0F49A3Fa; + param.mainchainBridgeManager.governors[1] = 0xb033ba62EC622dC54D0ABFE0254e79692147CA26; + param.mainchainBridgeManager.governors[2] = 0x087D08e3ba42e64E3948962dd1371F906D1278b9; + param.mainchainBridgeManager.governors[3] = 0x52ec2e6BBcE45AfFF8955Da6410bb13812F4289F; + + param.mainchainBridgeManager.voteWeights = new uint96[](4); + param.mainchainBridgeManager.voteWeights[0] = 100; + param.mainchainBridgeManager.voteWeights[1] = 100; + param.mainchainBridgeManager.voteWeights[2] = 100; + param.mainchainBridgeManager.voteWeights[3] = 100; + + param.mainchainBridgeManager.targetOptions = new GlobalProposal.TargetOption[](2); + param.mainchainBridgeManager.targetOptions[0] = GlobalProposal.TargetOption.GatewayContract; + param.mainchainBridgeManager.targetOptions[1] = GlobalProposal.TargetOption.PauseEnforcer; + param.mainchainBridgeManager.targets = new address[](2); + param.mainchainBridgeManager.targets[0] = config.getAddressFromCurrentNetwork(Contract.MainchainGatewayV3.key()); + param.mainchainBridgeManager.targets[1] = config.getAddressFromCurrentNetwork(Contract.MainchainPauseEnforcer.key()); + + _newMainchainBridgeManager = MainchainBridgeManager( + new MainchainBridgeManagerDeploy().overrideArgs( + abi.encodeCall( + _newMainchainBridgeManager.initialize, + ( + param.mainchainBridgeManager.num, + param.mainchainBridgeManager.denom, + param.mainchainBridgeManager.roninChainId, + param.mainchainBridgeManager.bridgeContract, + param.mainchainBridgeManager.callbackRegisters, + param.mainchainBridgeManager.bridgeOperators, + param.mainchainBridgeManager.governors, + param.mainchainBridgeManager.voteWeights, + param.mainchainBridgeManager.targetOptions, + param.mainchainBridgeManager.targets + ) + ) + ).run() + ); + } + + function _upgradeBridgeMainchain() internal { address weth = config.getAddressFromCurrentNetwork(Contract.WETH.key()); address wethUnwrapper = new MainchainWethUnwrapperDeploy().overrideArgs(abi.encode(weth)).run(); @@ -87,7 +131,7 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is Migration, Migration__ address mainchainGatewayV3Proxy = config.getAddressFromCurrentNetwork(Contract.MainchainGatewayV3.key()); uint256 expiredTime = block.timestamp + 14 days; - uint N = 4; + uint N = 5; address[] memory targets = new address[](N); uint256[] memory values = new uint256[](N); bytes[] memory calldatas = new bytes[](N); @@ -95,15 +139,20 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is Migration, Migration__ targets[0] = mainchainGatewayV3Proxy; targets[1] = mainchainGatewayV3Proxy; - targets[2] = pauseEnforcerProxy; + targets[2] = mainchainGatewayV3Proxy; targets[3] = pauseEnforcerProxy; + targets[4] = pauseEnforcerProxy; calldatas[0] = abi.encodeWithSignature( "upgradeToAndCall(address,bytes)", mainchainGatewayV3Logic, abi.encodeWithSelector(MainchainGatewayV3.initializeV4.selector, wethUnwrapper) ); - calldatas[1] = abi.encodeWithSignature("changeAdmin(address)", address(_newMainchainBridgeManager)); - calldatas[2] = abi.encodeWithSignature("upgradeTo(address)", pauseEnforcerLogic); - calldatas[3] = abi.encodeWithSignature("changeAdmin(address)", address(_newMainchainBridgeManager)); + calldatas[1] = abi.encodeWithSignature( + "functionDelegateCall(bytes)", + (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newMainchainBridgeManager))) + ); + calldatas[2] = abi.encodeWithSignature("changeAdmin(address)", address(_newMainchainBridgeManager)); + calldatas[3] = abi.encodeWithSignature("upgradeTo(address)", pauseEnforcerLogic); + calldatas[4] = abi.encodeWithSignature("changeAdmin(address)", address(_newMainchainBridgeManager)); for (uint i; i < N; ++i) { gasAmounts[i] = 1_000_000; @@ -197,59 +246,4 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is Migration, Migration__ digest_ := keccak256(ptr, 0x100) } } - - function _deployMainchainBridgeManager() internal returns (address mainchainBM) { - ISharedArgument.SharedParameter memory param; - - param.mainchainBridgeManager.num = 7; - param.mainchainBridgeManager.denom = 10; - param.mainchainBridgeManager.roninChainId = 2021; - param.mainchainBridgeManager.expiryDuration = 60 * 60 * 24 * 14; // 14 days - param.mainchainBridgeManager.bridgeContract = config.getAddressFromCurrentNetwork(Contract.MainchainGatewayV3.key()); - param.mainchainBridgeManager.bridgeOperators = new address[](4); - param.mainchainBridgeManager.bridgeOperators[0] = 0x2e82D2b56f858f79DeeF11B160bFC4631873da2B; - param.mainchainBridgeManager.bridgeOperators[1] = 0xBcb61783dd2403FE8cC9B89B27B1A9Bb03d040Cb; - param.mainchainBridgeManager.bridgeOperators[2] = 0xB266Bf53Cf7EAc4E2065A404598DCB0E15E9462c; - param.mainchainBridgeManager.bridgeOperators[3] = 0xcc5Fc5B6c8595F56306Da736F6CD02eD9141C84A; - - param.mainchainBridgeManager.governors = new address[](4); - param.mainchainBridgeManager.governors[0] = 0xd24D87DDc1917165435b306aAC68D99e0F49A3Fa; - param.mainchainBridgeManager.governors[1] = 0xb033ba62EC622dC54D0ABFE0254e79692147CA26; - param.mainchainBridgeManager.governors[2] = 0x087D08e3ba42e64E3948962dd1371F906D1278b9; - param.mainchainBridgeManager.governors[3] = 0x52ec2e6BBcE45AfFF8955Da6410bb13812F4289F; - - param.mainchainBridgeManager.voteWeights = new uint96[](4); - param.mainchainBridgeManager.voteWeights[0] = 100; - param.mainchainBridgeManager.voteWeights[1] = 100; - param.mainchainBridgeManager.voteWeights[2] = 100; - param.mainchainBridgeManager.voteWeights[3] = 100; - - param.mainchainBridgeManager.targetOptions = new GlobalProposal.TargetOption[](2); - param.mainchainBridgeManager.targetOptions[0] = GlobalProposal.TargetOption.GatewayContract; - param.mainchainBridgeManager.targetOptions[1] = GlobalProposal.TargetOption.PauseEnforcer; - - param.mainchainBridgeManager.targets = new address[](2); - param.mainchainBridgeManager.targets[0] = config.getAddressFromCurrentNetwork(Contract.MainchainGatewayV3.key()); - param.mainchainBridgeManager.targets[1] = config.getAddressFromCurrentNetwork(Contract.MainchainPauseEnforcer.key()); - - _newMainchainBridgeManager = MainchainBridgeManager( - new MainchainBridgeManagerDeploy().overrideArgs( - abi.encodeCall( - _newMainchainBridgeManager.initialize, - ( - param.mainchainBridgeManager.num, - param.mainchainBridgeManager.denom, - param.mainchainBridgeManager.roninChainId, - param.mainchainBridgeManager.bridgeContract, - param.mainchainBridgeManager.callbackRegisters, - param.mainchainBridgeManager.bridgeOperators, - param.mainchainBridgeManager.governors, - param.mainchainBridgeManager.voteWeights, - param.mainchainBridgeManager.targetOptions, - param.mainchainBridgeManager.targets - ) - ) - ).run() - ); - } } diff --git a/script/20240411-upgrade-v3.2.0-testnet/verify-script.s.sol b/script/20240411-upgrade-v3.2.0-testnet/verify-script.s.sol new file mode 100644 index 00000000..cc3bb4de --- /dev/null +++ b/script/20240411-upgrade-v3.2.0-testnet/verify-script.s.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import "./20240411-p2-upgrade-bridge-ronin-chain.s.sol"; +import "./20240411-p3-upgrade-bridge-main-chain.s.sol"; + +contract Verify_Script_20240411 is Migration__20240409_P2_UpgradeBridgeRoninchain, Migration__20240409_P3_UpgradeBridgeMainchain { + function setUp() public override(Migration__20240409_P2_UpgradeBridgeRoninchain, Migration__20240409_P3_UpgradeBridgeMainchain) { + Migration__20240409_P2_UpgradeBridgeRoninchain.setUp(); + } + + function run() public override(Migration__20240409_P2_UpgradeBridgeRoninchain, Migration__20240409_P3_UpgradeBridgeMainchain) { + TNetwork currentNetwork = network(); + TNetwork companionNetwork = config.getCompanionNetwork(currentNetwork); + Migration__20240409_P2_UpgradeBridgeRoninchain.run(); + + CONFIG.createFork(companionNetwork); + CONFIG.switchTo(companionNetwork); + Migration__20240409_P3_UpgradeBridgeMainchain.run(); + + CONFIG.switchTo(currentNetwork); + } +} \ No newline at end of file diff --git a/script/Migration.s.sol b/script/Migration.s.sol index a2f7116b..999048ee 100644 --- a/script/Migration.s.sol +++ b/script/Migration.s.sol @@ -208,13 +208,19 @@ contract Migration is BaseMigration, Utils { function _getProxyAdmin() internal virtual override returns (address payable proxyAdmin) { TNetwork currentNetwork = network(); + console.log("[>] _getProxyAdmin", "Network name:".yellow(), currentNetwork.networkName()); + if ( currentNetwork == DefaultNetwork.RoninTestnet.key() || currentNetwork == DefaultNetwork.RoninMainnet.key() || currentNetwork == Network.RoninDevnet.key() ) { - proxyAdmin = loadContract(Contract.RoninBridgeManager.key()); - } else if (currentNetwork == Network.Sepolia.key() || currentNetwork == Network.Goerli.key() || currentNetwork == Network.EthMainnet.key()) { - proxyAdmin = loadContract(Contract.MainchainBridgeManager.key()); - } else if (currentNetwork == DefaultNetwork.Local.key()) { + return loadContract(Contract.RoninBridgeManager.key()); + } + + if (currentNetwork == Network.Sepolia.key() || currentNetwork == Network.Goerli.key() || currentNetwork == Network.EthMainnet.key()) { + return loadContract(Contract.MainchainBridgeManager.key()); + } + + if (currentNetwork == DefaultNetwork.Local.key()) { if (config.getLocalNetwork() == IGeneralConfigExtended.LocalNetwork.Ronin) { try config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key()) returns (address payable res) { proxyAdmin = res; @@ -234,11 +240,13 @@ contract Migration is BaseMigration, Utils { } else { proxyAdmin = payable(config.sharedArguments().test.proxyAdmin); } - } else { - console.log("Network not supported".yellow(), currentNetwork.networkName()); - console.log("Chain Id".yellow(), block.chainid); - revert("BridgeMigration(_getProxyAdmin): Unhandled case"); + + return proxyAdmin; } + + console.log("Network not supported".yellow(), currentNetwork.networkName()); + console.log("Chain Id".yellow(), block.chainid); + revert("BridgeMigration(_getProxyAdmin): Unhandled case"); } function _upgradeRaw(address proxyAdmin, address payable proxy, address logic, bytes memory args) internal virtual override { diff --git a/script/contracts/RoninBridgeManagerDeploy.s.sol b/script/contracts/RoninBridgeManagerDeploy.s.sol index 24acb9a7..86361339 100644 --- a/script/contracts/RoninBridgeManagerDeploy.s.sol +++ b/script/contracts/RoninBridgeManagerDeploy.s.sol @@ -36,7 +36,7 @@ contract RoninBridgeManagerDeploy is Migration { } function run() public virtual returns (RoninBridgeManager) { - address payable instance = _deployProxy(Contract.RoninBridgeManagerConstructor.key()); + address payable instance = _deployProxy(Contract.RoninBridgeManagerConstructor.key(), sender()); address logic = _deployLogic(Contract.RoninBridgeManager.key()); address proxyAdmin = instance.getProxyAdmin(); console2.log("Proxy admin ", proxyAdmin); diff --git a/script/post-check/BasePostCheck.s.sol b/script/post-check/BasePostCheck.s.sol index d201fd59..6d368cb7 100644 --- a/script/post-check/BasePostCheck.s.sol +++ b/script/post-check/BasePostCheck.s.sol @@ -61,8 +61,8 @@ abstract contract BasePostCheck is BaseMigration { (cheatOperator, cheatOperatorPk) = makeAddrAndKey(string.concat("cheat-operator-", vm.toString(seed))); (cheatGovernor, cheatGovernorPk) = makeAddrAndKey(string.concat("cheat-governor-", vm.toString(seed))); - vm.deal(cheatGovernor, 1); - vm.deal(cheatOperator, 1); + vm.deal(cheatGovernor, 1); // Check created EOA + vm.deal(cheatOperator, 1); // Check created EOA vm.prank(manager); try TransparentUpgradeableProxyV2(payable(manager)).functionDelegateCall( From 55da8ef2c84d71e8d77c551d880a69000997475d Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 15 Apr 2024 15:04:35 +0700 Subject: [PATCH 155/180] clean up --- .../20240411-p2-upgrade-bridge-ronin-chain.s.sol | 6 ++---- .../20240411-p3-upgrade-bridge-main-chain.s.sol | 6 ++---- script/20240411-upgrade-v3.2.0-testnet/verify-script.s.sol | 2 +- .../proposal/PostCheck_BridgeManager_Proposal.s.sol | 2 +- script/utils/Network.sol | 4 ---- 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol index 5a1ae5f5..b62e65e6 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol @@ -131,10 +131,8 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H calldatas[4] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); calldatas[5] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); calldatas[6] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); - calldatas[7] = abi.encodeWithSignature( - "functionDelegateCall(bytes)", - (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newRoninBridgeManager))) - ); + calldatas[7] = + abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newRoninBridgeManager)))); calldatas[8] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); calldatas[9] = abi.encodeWithSignature("upgradeTo(address)", pauseEnforcerLogic); calldatas[10] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol index fea4c058..a2de1fd9 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol @@ -146,10 +146,8 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is Migration, Migration__ calldatas[0] = abi.encodeWithSignature( "upgradeToAndCall(address,bytes)", mainchainGatewayV3Logic, abi.encodeWithSelector(MainchainGatewayV3.initializeV4.selector, wethUnwrapper) ); - calldatas[1] = abi.encodeWithSignature( - "functionDelegateCall(bytes)", - (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newMainchainBridgeManager))) - ); + calldatas[1] = + abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newMainchainBridgeManager)))); calldatas[2] = abi.encodeWithSignature("changeAdmin(address)", address(_newMainchainBridgeManager)); calldatas[3] = abi.encodeWithSignature("upgradeTo(address)", pauseEnforcerLogic); calldatas[4] = abi.encodeWithSignature("changeAdmin(address)", address(_newMainchainBridgeManager)); diff --git a/script/20240411-upgrade-v3.2.0-testnet/verify-script.s.sol b/script/20240411-upgrade-v3.2.0-testnet/verify-script.s.sol index cc3bb4de..a40ff287 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/verify-script.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/verify-script.s.sol @@ -20,4 +20,4 @@ contract Verify_Script_20240411 is Migration__20240409_P2_UpgradeBridgeRoninchai CONFIG.switchTo(currentNetwork); } -} \ No newline at end of file +} diff --git a/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol b/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol index 13c13edd..80c7d243 100644 --- a/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol +++ b/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol @@ -125,7 +125,7 @@ abstract contract PostCheck_BridgeManager_Proposal is BasePostCheck { calldatas: abi.encodeCall( TransparentUpgradeableProxyV2.functionDelegateCall, (abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators))) - ).toSingletonArray(), + ).toSingletonArray(), gasAmounts: uint256(1_000_000).toSingletonArray(), nonce: manager.round(0) + 1 }); diff --git a/script/utils/Network.sol b/script/utils/Network.sol index 5e8c8711..6084c371 100644 --- a/script/utils/Network.sol +++ b/script/utils/Network.sol @@ -16,7 +16,6 @@ function chainId(Network network) pure returns (uint256) { if (network == Network.Goerli) return 5; if (network == Network.Sepolia) return 11155111; if (network == Network.EthMainnet) return 1; - if (network == Network.Sepolia) return 11155111; if (network == Network.RoninDevnet) return 2022; revert("Network: Unknown chain id"); @@ -30,8 +29,6 @@ function explorer(Network network) pure returns (string memory link) { if (network == Network.Goerli) return "https://goerli.etherscan.io/"; if (network == Network.Sepolia) return "https://sepolia.etherscan.io/"; if (network == Network.EthMainnet) return "https://etherscan.io/"; - if (network == Network.Goerli) return "https://goerli.etherscan.io/"; - if (network == Network.Sepolia) return "hhttps://sepolia.etherscan.io/"; } function name(Network network) pure returns (string memory) { @@ -62,7 +59,6 @@ function envLabel(Network network) pure returns (string memory) { } function chainAlias(Network network) pure returns (string memory) { - if (network == Network.Sepolia) return "sepolia"; if (network == Network.Goerli) return "goerli"; if (network == Network.Sepolia) return "sepolia"; if (network == Network.EthMainnet) return "ethereum"; From e183921d1023dc9bac5a162aeb7c37aea249fe84 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 15 Apr 2024 17:18:53 +0700 Subject: [PATCH 156/180] script: fix ronin script to init v2 and set bridge manager --- ...240411-p2-upgrade-bridge-ronin-chain.s.sol | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol index b62e65e6..7a5a5212 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol @@ -11,6 +11,7 @@ import { Contract } from "../utils/Contract.sol"; import { Network } from "../utils/Network.sol"; import { Contract } from "../utils/Contract.sol"; import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; +import "@ronin/contracts/ronin/gateway/BridgeReward.sol"; import "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; import "@ronin/contracts/mainchain/MainchainGatewayV3.sol"; import "@ronin/contracts/libraries/Proposal.sol"; @@ -106,7 +107,7 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H address roninGatewayV3Proxy = config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); uint256 expiredTime = block.timestamp + 14 days; - uint N = 11; + uint N = 14; address[] memory targets = new address[](N); uint256[] memory values = new uint256[](N); bytes[] memory calldatas = new bytes[](N); @@ -120,22 +121,32 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H targets[5] = bridgeSlashProxy; targets[6] = bridgeTrackingProxy; targets[7] = roninGatewayV3Proxy; - targets[8] = roninGatewayV3Proxy; - targets[9] = pauseEnforcerProxy; - targets[10] = pauseEnforcerProxy; - - calldatas[0] = abi.encodeWithSignature("upgradeTo(address)", bridgeRewardLogic); + targets[8] = bridgeRewardProxy; + targets[9] = bridgeSlashProxy; + targets[10] = bridgeTrackingProxy; + targets[11] = roninGatewayV3Proxy; + targets[12] = pauseEnforcerProxy; + targets[13] = pauseEnforcerProxy; + + calldatas[0] = abi.encodeWithSignature("upgradeToAndCall(address,bytes)", bridgeRewardLogic, abi.encodeWithSelector(BridgeReward.initializeV2.selector)); calldatas[1] = abi.encodeWithSignature("upgradeTo(address)", bridgeSlashLogic); calldatas[2] = abi.encodeWithSignature("upgradeTo(address)", bridgeTrackingLogic); calldatas[3] = abi.encodeWithSignature("upgradeTo(address)", roninGatewayV3Logic); - calldatas[4] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); - calldatas[5] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); - calldatas[6] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); + calldatas[4] = + abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newRoninBridgeManager)))); + calldatas[5] = + abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newRoninBridgeManager)))); + calldatas[6] = + abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newRoninBridgeManager)))); calldatas[7] = abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newRoninBridgeManager)))); calldatas[8] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); - calldatas[9] = abi.encodeWithSignature("upgradeTo(address)", pauseEnforcerLogic); + calldatas[9] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); calldatas[10] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); + calldatas[11] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); + + calldatas[12] = abi.encodeWithSignature("upgradeTo(address)", pauseEnforcerLogic); + calldatas[13] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); for (uint i; i < N; ++i) { gasAmounts[i] = 1_000_000; From d6170ef8b5f4aeefd3d5aaeb005cce8516a2217c Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 15 Apr 2024 17:19:24 +0700 Subject: [PATCH 157/180] script: nominate sender in mainchain bridge --- script/contracts/MainchainBridgeManagerDeploy.s.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/contracts/MainchainBridgeManagerDeploy.s.sol b/script/contracts/MainchainBridgeManagerDeploy.s.sol index f680777b..8f3a9cfa 100644 --- a/script/contracts/MainchainBridgeManagerDeploy.s.sol +++ b/script/contracts/MainchainBridgeManagerDeploy.s.sol @@ -14,7 +14,7 @@ contract MainchainBridgeManagerDeploy is Migration { using LibProxy for *; function run() public virtual returns (MainchainBridgeManager instance) { - instance = MainchainBridgeManager(_deployProxy(Contract.MainchainBridgeManager.key())); + instance = MainchainBridgeManager(_deployProxy(Contract.MainchainBridgeManager.key(), sender())); address proxyAdmin = payable(address(instance)).getProxyAdmin(); if (proxyAdmin == sender()) { From 576b68398425b50a1f0c0d59e08b2dd2b60ec29c Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 15 Apr 2024 18:30:40 +0700 Subject: [PATCH 158/180] feat: remove `returns` array and reduce code size --- src/extensions/GatewayV3.sol | 20 ++++---- src/extensions/MinimumWithdrawal.sol | 2 +- src/extensions/WithdrawalLimitation.sol | 14 +++--- .../BridgeManager.sol | 24 ++++------ .../BridgeManagerCallbackRegister.sol | 26 +++++------ .../BridgeManagerQuorum.sol | 21 +++++---- src/extensions/collections/HasContracts.sol | 2 +- src/extensions/collections/HasProxyAdmin.sol | 10 ++-- src/interfaces/IQuorum.sol | 2 +- src/interfaces/bridge/IBridgeManager.sol | 46 +------------------ .../bridge/IBridgeManagerCallbackRegister.sol | 7 ++- src/mainchain/MainchainGatewayV3.sol | 6 +-- src/ronin/gateway/RoninGatewayV3.sol | 4 +- test/mocks/MockBridgeManager.sol | 5 +- 14 files changed, 69 insertions(+), 120 deletions(-) diff --git a/src/extensions/GatewayV3.sol b/src/extensions/GatewayV3.sol index 43c55b9e..55eca141 100644 --- a/src/extensions/GatewayV3.sol +++ b/src/extensions/GatewayV3.sol @@ -23,7 +23,7 @@ abstract contract GatewayV3 is HasProxyAdmin, Pausable, IQuorum { /** * @dev Grant emergency pauser role for `_addr`. */ - function setEmergencyPauser(address _addr) external onlyAdmin { + function setEmergencyPauser(address _addr) external onlyProxyAdmin { emergencyPauser = _addr; } @@ -44,7 +44,7 @@ abstract contract GatewayV3 is HasProxyAdmin, Pausable, IQuorum { /** * @inheritdoc IQuorum */ - function setThreshold(uint256 _numerator, uint256 _denominator) external virtual onlyAdmin returns (uint256, uint256) { + function setThreshold(uint256 _numerator, uint256 _denominator) external virtual onlyProxyAdmin { return _setThreshold(_numerator, _denominator); } @@ -77,14 +77,14 @@ abstract contract GatewayV3 is HasProxyAdmin, Pausable, IQuorum { * Emits the `ThresholdUpdated` event. * */ - function _setThreshold(uint256 _numerator, uint256 _denominator) internal virtual returns (uint256 _previousNum, uint256 _previousDenom) { - if (_numerator > _denominator) revert ErrInvalidThreshold(msg.sig); - _previousNum = _num; - _previousDenom = _denom; - _num = _numerator; - _denom = _denominator; + function _setThreshold(uint256 num, uint256 denom) internal virtual { + if (num > denom) revert ErrInvalidThreshold(msg.sig); + uint256 prevNum = _num; + uint256 prevDenom = _denom; + _num = num; + _denom = denom; unchecked { - emit ThresholdUpdated(nonce++, _numerator, _denominator, _previousNum, _previousDenom); + emit ThresholdUpdated(nonce++, num, denom, prevNum, prevDenom); } } @@ -104,7 +104,7 @@ abstract contract GatewayV3 is HasProxyAdmin, Pausable, IQuorum { * */ function _requireAuth() private view { - if (!(msg.sender == _getAdmin() || msg.sender == emergencyPauser)) { + if (!(msg.sender == _getProxyAdmin() || msg.sender == emergencyPauser)) { revert ErrUnauthorized(msg.sig, RoleAccess.ADMIN); } } diff --git a/src/extensions/MinimumWithdrawal.sol b/src/extensions/MinimumWithdrawal.sol index acf49592..df2fc7e5 100644 --- a/src/extensions/MinimumWithdrawal.sol +++ b/src/extensions/MinimumWithdrawal.sol @@ -30,7 +30,7 @@ abstract contract MinimumWithdrawal is HasProxyAdmin { * Emits the `MinimumThresholdsUpdated` event. * */ - function setMinimumThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) external virtual onlyAdmin { + function setMinimumThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) external virtual onlyProxyAdmin { if (_tokens.length == 0) revert ErrEmptyArray(); _setMinimumThresholds(_tokens, _thresholds); } diff --git a/src/extensions/WithdrawalLimitation.sol b/src/extensions/WithdrawalLimitation.sol index 586af812..97a9e941 100644 --- a/src/extensions/WithdrawalLimitation.sol +++ b/src/extensions/WithdrawalLimitation.sol @@ -52,8 +52,8 @@ abstract contract WithdrawalLimitation is GatewayV3 { * - The high-tier vote weight threshold must equal to or larger than the normal threshold. * */ - function setThreshold(uint256 _numerator, uint256 _denominator) external virtual override onlyAdmin returns (uint256 _previousNum, uint256 _previousDenom) { - (_previousNum, _previousDenom) = _setThreshold(_numerator, _denominator); + function setThreshold(uint256 num, uint256 denom) external virtual override onlyProxyAdmin { + _setThreshold(num, denom); _verifyThresholds(); } @@ -84,7 +84,7 @@ abstract contract WithdrawalLimitation is GatewayV3 { function setHighTierVoteWeightThreshold( uint256 _numerator, uint256 _denominator - ) external virtual onlyAdmin returns (uint256 _previousNum, uint256 _previousDenom) { + ) external virtual onlyProxyAdmin returns (uint256 _previousNum, uint256 _previousDenom) { (_previousNum, _previousDenom) = _setHighTierVoteWeightThreshold(_numerator, _denominator); _verifyThresholds(); } @@ -99,7 +99,7 @@ abstract contract WithdrawalLimitation is GatewayV3 { * Emits the `HighTierThresholdsUpdated` event. * */ - function setHighTierThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) external virtual onlyAdmin { + function setHighTierThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) external virtual onlyProxyAdmin { if (_tokens.length == 0) revert ErrEmptyArray(); _setHighTierThresholds(_tokens, _thresholds); } @@ -114,7 +114,7 @@ abstract contract WithdrawalLimitation is GatewayV3 { * Emits the `LockedThresholdsUpdated` event. * */ - function setLockedThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) external virtual onlyAdmin { + function setLockedThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) external virtual onlyProxyAdmin { if (_tokens.length == 0) revert ErrEmptyArray(); _setLockedThresholds(_tokens, _thresholds); } @@ -129,7 +129,7 @@ abstract contract WithdrawalLimitation is GatewayV3 { * Emits the `UnlockFeePercentagesUpdated` event. * */ - function setUnlockFeePercentages(address[] calldata _tokens, uint256[] calldata _percentages) external virtual onlyAdmin { + function setUnlockFeePercentages(address[] calldata _tokens, uint256[] calldata _percentages) external virtual onlyProxyAdmin { if (_tokens.length == 0) revert ErrEmptyArray(); _setUnlockFeePercentages(_tokens, _percentages); } @@ -144,7 +144,7 @@ abstract contract WithdrawalLimitation is GatewayV3 { * Emits the `DailyWithdrawalLimitsUpdated` event. * */ - function setDailyWithdrawalLimits(address[] calldata _tokens, uint256[] calldata _limits) external virtual onlyAdmin { + function setDailyWithdrawalLimits(address[] calldata _tokens, uint256[] calldata _limits) external virtual onlyProxyAdmin { if (_tokens.length == 0) revert ErrEmptyArray(); _setDailyWithdrawalLimits(_tokens, _limits); } diff --git a/src/extensions/bridge-operator-governance/BridgeManager.sol b/src/extensions/bridge-operator-governance/BridgeManager.sol index 65f3f1e4..f4d5ca36 100644 --- a/src/extensions/bridge-operator-governance/BridgeManager.sol +++ b/src/extensions/bridge-operator-governance/BridgeManager.sol @@ -13,7 +13,7 @@ import { TUint256Slot } from "../../types/Types.sol"; import "../../utils/CommonErrors.sol"; import "./BridgeManagerQuorum.sol"; -abstract contract BridgeManager is IBridgeManager, Initializable, HasContracts, BridgeManagerQuorum, BridgeManagerCallbackRegister { +abstract contract BridgeManager is IBridgeManager, BridgeManagerQuorum, BridgeManagerCallbackRegister { using AddressArrayUtils for address[]; struct BridgeManagerStorage { @@ -96,7 +96,7 @@ abstract contract BridgeManager is IBridgeManager, Initializable, HasContracts, /** * @inheritdoc IHasContracts */ - function setContract(ContractType contractType, address addr) external override onlySelfCall { + function setContract(ContractType contractType, address addr) external override onlyProxyAdmin { _requireHasCode(addr); _setContract(contractType, addr); } @@ -104,7 +104,7 @@ abstract contract BridgeManager is IBridgeManager, Initializable, HasContracts, /** * @inheritdoc IBridgeManager */ - function setMinRequiredGovernor(uint min) external override onlySelfCall { + function setMinRequiredGovernor(uint min) external override onlyProxyAdmin { _setMinRequiredGovernor(min); } @@ -134,8 +134,7 @@ abstract contract BridgeManager is IBridgeManager, Initializable, HasContracts, } function _totalWeight() internal view override returns (uint256) { - BridgeManagerStorage storage $ = _getBridgeManagerStorage(); - return $._totalWeight; + return _getBridgeManagerStorage()._totalWeight; } /** @@ -168,8 +167,7 @@ abstract contract BridgeManager is IBridgeManager, Initializable, HasContracts, * @dev Internal function to retrieve the vote weight of a specific governor. */ function _getGovernorWeight(address governor) internal view returns (uint96) { - BridgeManagerStorage storage $ = _getBridgeManagerStorage(); - return $._governorWeight[governor]; + return _getBridgeManagerStorage()._governorWeight[governor]; } /** @@ -215,19 +213,15 @@ abstract contract BridgeManager is IBridgeManager, Initializable, HasContracts, /** * @inheritdoc IBridgeManager */ - function addBridgeOperators( - uint96[] calldata voteWeights, - address[] calldata governors, - address[] calldata bridgeOperators - ) external onlySelfCall returns (bool[] memory addeds) { - addeds = _addBridgeOperators(voteWeights, governors, bridgeOperators); + function addBridgeOperators(uint96[] calldata voteWeights, address[] calldata governors, address[] calldata bridgeOperators) external onlyProxyAdmin { + _addBridgeOperators(voteWeights, governors, bridgeOperators); } /** * @inheritdoc IBridgeManager */ - function removeBridgeOperators(address[] calldata bridgeOperators) external onlySelfCall returns (bool[] memory removeds) { - removeds = _removeBridgeOperators(bridgeOperators); + function removeBridgeOperators(address[] calldata bridgeOperators) external onlyProxyAdmin { + _removeBridgeOperators(bridgeOperators); } /** diff --git a/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol b/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol index 163838bf..04714357 100644 --- a/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol +++ b/src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol @@ -5,13 +5,14 @@ import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import { IBridgeManagerCallbackRegister } from "../../interfaces/bridge/IBridgeManagerCallbackRegister.sol"; import { IBridgeManagerCallback } from "../../interfaces/bridge/IBridgeManagerCallback.sol"; +import { HasContracts } from "../../extensions/collections/HasContracts.sol"; import { TransparentUpgradeableProxyV2, IdentityGuard } from "../../utils/IdentityGuard.sol"; /** * @title BridgeManagerCallbackRegister * @dev A contract that manages callback registrations and execution for a bridge. */ -abstract contract BridgeManagerCallbackRegister is Initializable, IdentityGuard, IBridgeManagerCallbackRegister { +abstract contract BridgeManagerCallbackRegister is IBridgeManagerCallbackRegister, IdentityGuard, Initializable, HasContracts { using EnumerableSet for EnumerableSet.AddressSet; /** @@ -27,20 +28,18 @@ abstract contract BridgeManagerCallbackRegister is Initializable, IdentityGuard, /** * @inheritdoc IBridgeManagerCallbackRegister */ - function registerCallbacks(address[] calldata registers) external onlySelfCall returns (bool[] memory registereds) { - registereds = _registerCallbacks(registers); + function registerCallbacks(address[] calldata registers) external onlyProxyAdmin { + _registerCallbacks(registers); } /** * @inheritdoc IBridgeManagerCallbackRegister */ - function unregisterCallbacks(address[] calldata registers) external onlySelfCall nonDuplicate(registers) returns (bool[] memory unregistereds) { - uint256 length = registers.length; - unregistereds = new bool[](length); + function unregisterCallbacks(address[] calldata registers) external onlyProxyAdmin nonDuplicate(registers) { EnumerableSet.AddressSet storage _callbackRegisters = _getCallbackRegisters(); - for (uint256 i; i < length; i++) { - unregistereds[i] = _callbackRegisters.remove(registers[i]); + for (uint256 i; i < registers.length; i++) { + _callbackRegisters.remove(registers[i]); } } @@ -54,14 +53,11 @@ abstract contract BridgeManagerCallbackRegister is Initializable, IdentityGuard, /** * @dev Internal function to register multiple callbacks with the bridge. * @param registers The array of callback addresses to register. - * @return registereds An array indicating the success status of each registration. */ - function _registerCallbacks(address[] memory registers) internal nonDuplicate(registers) returns (bool[] memory registereds) { - registereds = new bool[](registers.length); - if (registers.length == 0) return registereds; - + function _registerCallbacks(address[] memory registers) internal nonDuplicate(registers) { EnumerableSet.AddressSet storage _callbackRegisters = _getCallbackRegisters(); address register; + bool regSuccess; for (uint256 i; i < registers.length; i++) { register = registers[i]; @@ -69,7 +65,9 @@ abstract contract BridgeManagerCallbackRegister is Initializable, IdentityGuard, _requireHasCode(register); _requireSupportsInterface(register, type(IBridgeManagerCallback).interfaceId); - registereds[i] = _callbackRegisters.add(register); + regSuccess = _callbackRegisters.add(register); + + emit CallbackRegistered(register, regSuccess); } } diff --git a/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol b/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol index 5a05c5aa..b91218c4 100644 --- a/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol +++ b/src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol @@ -4,9 +4,10 @@ pragma solidity ^0.8.23; import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import { IQuorum } from "../../interfaces/IQuorum.sol"; import { IdentityGuard } from "../../utils/IdentityGuard.sol"; +import { HasContracts } from "../../extensions/collections/HasContracts.sol"; import "../../utils/CommonErrors.sol"; -abstract contract BridgeManagerQuorum is IQuorum, Initializable, IdentityGuard { +abstract contract BridgeManagerQuorum is IQuorum, IdentityGuard, Initializable, HasContracts { struct BridgeManagerQuorumStorage { uint256 _nonce; uint256 _numerator; @@ -32,8 +33,8 @@ abstract contract BridgeManagerQuorum is IQuorum, Initializable, IdentityGuard { /** * @inheritdoc IQuorum */ - function setThreshold(uint256 numerator, uint256 denominator) external override onlySelfCall returns (uint256, uint256) { - return _setThreshold(numerator, denominator); + function setThreshold(uint256 num, uint256 denom) external override onlyProxyAdmin { + _setThreshold(num, denom); } /** @@ -59,18 +60,18 @@ abstract contract BridgeManagerQuorum is IQuorum, Initializable, IdentityGuard { * Emits the `ThresholdUpdated` event. * */ - function _setThreshold(uint256 numerator, uint256 denominator) internal virtual returns (uint256 previousNum, uint256 previousDenom) { - if (numerator > denominator || denominator <= 1) revert ErrInvalidThreshold(msg.sig); + function _setThreshold(uint256 num, uint256 denom) internal virtual { + if (num > denom || denom <= 1) revert ErrInvalidThreshold(msg.sig); BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage(); - previousNum = $._numerator; - previousDenom = $._denominator; + uint256 prevNum = $._numerator; + uint256 prevDenom = $._denominator; - $._numerator = numerator; - $._denominator = denominator; + $._numerator = num; + $._denominator = denom; - emit ThresholdUpdated($._nonce++, numerator, denominator, previousNum, previousDenom); + emit ThresholdUpdated($._nonce++, num, denom, prevNum, prevDenom); } function _totalWeight() internal view virtual returns (uint256); diff --git a/src/extensions/collections/HasContracts.sol b/src/extensions/collections/HasContracts.sol index 5a09d6c4..ce765613 100644 --- a/src/extensions/collections/HasContracts.sol +++ b/src/extensions/collections/HasContracts.sol @@ -26,7 +26,7 @@ abstract contract HasContracts is HasProxyAdmin, IHasContracts, IdentityGuard { /** * @inheritdoc IHasContracts */ - function setContract(ContractType contractType, address addr) external virtual onlyAdmin { + function setContract(ContractType contractType, address addr) external virtual onlyProxyAdmin { _requireHasCode(addr); _setContract(contractType, addr); } diff --git a/src/extensions/collections/HasProxyAdmin.sol b/src/extensions/collections/HasProxyAdmin.sol index 3e6db341..53255900 100644 --- a/src/extensions/collections/HasProxyAdmin.sol +++ b/src/extensions/collections/HasProxyAdmin.sol @@ -8,19 +8,19 @@ abstract contract HasProxyAdmin { // bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1)); bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; - modifier onlyAdmin() { - _requireAdmin(); + modifier onlyProxyAdmin() { + _requireProxyAdmin(); _; } /** * @dev Returns proxy admin. */ - function _getAdmin() internal view virtual returns (address) { + function _getProxyAdmin() internal view virtual returns (address) { return StorageSlot.getAddressSlot(_ADMIN_SLOT).value; } - function _requireAdmin() internal view { - if (msg.sender != _getAdmin()) revert ErrUnauthorized(msg.sig, RoleAccess.ADMIN); + function _requireProxyAdmin() internal view { + if (msg.sender != _getProxyAdmin()) revert ErrUnauthorized(msg.sig, RoleAccess.ADMIN); } } diff --git a/src/interfaces/IQuorum.sol b/src/interfaces/IQuorum.sol index 97619626..d6032b65 100644 --- a/src/interfaces/IQuorum.sol +++ b/src/interfaces/IQuorum.sol @@ -29,5 +29,5 @@ interface IQuorum { * Emits the `ThresholdUpdated` event. * */ - function setThreshold(uint256 _numerator, uint256 _denominator) external returns (uint256 _previousNum, uint256 _previousDenom); + function setThreshold(uint256 numerator, uint256 denominator) external; } diff --git a/src/interfaces/bridge/IBridgeManager.sol b/src/interfaces/bridge/IBridgeManager.sol index a7ba8907..dd532565 100644 --- a/src/interfaces/bridge/IBridgeManager.sol +++ b/src/interfaces/bridge/IBridgeManager.sol @@ -119,56 +119,14 @@ interface IBridgeManager is IBridgeManagerEvents { * @dev Adds multiple bridge operators. * @param governors An array of addresses of hot/cold wallets for bridge operator to update their node address. * @param bridgeOperators An array of addresses representing the bridge operators to add. - * @return addeds An array of booleans indicating whether each bridge operator was added successfully. - * - * Note: return boolean array `addeds` indicates whether a group (voteWeight, governor, operator) are recorded. - * It is expected that FE/BE staticcall to the function first to get the return values and handle it correctly. - * Governors are expected to see the outcome of this function and decide if they want to vote for the proposal or not. - * - * Example Usage: - * Making an `eth_call` in ethers.js - * ``` - * const {addeds} = await bridgeManagerContract.callStatic.addBridgeOperators( - * voteWeights, - * governors, - * bridgeOperators, - * // overriding the caller to the contract itself since we use `onlySelfCall` guard - * {from: bridgeManagerContract.address} - * ) - * const filteredOperators = bridgeOperators.filter((_, index) => addeds[index]); - * const filteredWeights = weights.filter((_, index) => addeds[index]); - * const filteredGovernors = governors.filter((_, index) => addeds[index]); - * // ... (Process or use the information as required) ... - * ``` */ - function addBridgeOperators( - uint96[] calldata voteWeights, - address[] calldata governors, - address[] calldata bridgeOperators - ) external returns (bool[] memory addeds); + function addBridgeOperators(uint96[] calldata voteWeights, address[] calldata governors, address[] calldata bridgeOperators) external; /** * @dev Removes multiple bridge operators. * @param bridgeOperators An array of addresses representing the bridge operators to remove. - * @return removeds An array of booleans indicating whether each bridge operator was removed successfully. - * - * * Note: return boolean array `removeds` indicates whether a group (voteWeight, governor, operator) are recorded. - * It is expected that FE/BE staticcall to the function first to get the return values and handle it correctly. - * Governors are expected to see the outcome of this function and decide if they want to vote for the proposal or not. - * - * Example Usage: - * Making an `eth_call` in ethers.js - * ``` - * const {removeds} = await bridgeManagerContract.callStatic.removeBridgeOperators( - * bridgeOperators, - * // overriding the caller to the contract itself since we use `onlySelfCall` guard - * {from: bridgeManagerContract.address} - * ) - * const filteredOperators = bridgeOperators.filter((_, index) => removeds[index]); - * // ... (Process or use the information as required) ... - * ``` */ - function removeBridgeOperators(address[] calldata bridgeOperators) external returns (bool[] memory removeds); + function removeBridgeOperators(address[] calldata bridgeOperators) external; /** * @dev Self-call to update the minimum required governor. diff --git a/src/interfaces/bridge/IBridgeManagerCallbackRegister.sol b/src/interfaces/bridge/IBridgeManagerCallbackRegister.sol index 85177ad0..b80d297e 100644 --- a/src/interfaces/bridge/IBridgeManagerCallbackRegister.sol +++ b/src/interfaces/bridge/IBridgeManagerCallbackRegister.sol @@ -4,6 +4,7 @@ pragma solidity ^0.8.0; interface IBridgeManagerCallbackRegister { error ErrExistOneInternalCallFailed(address sender, bytes4 msgSig, bytes callData); + event CallbackRegistered(address, bool); /** * @dev Emitted when the contract notifies multiple registers with statuses and return data. */ @@ -18,14 +19,12 @@ interface IBridgeManagerCallbackRegister { /** * @dev Registers multiple callbacks with the bridge. * @param registers The array of callback addresses to register. - * @return registereds An array indicating the success status of each registration. */ - function registerCallbacks(address[] calldata registers) external returns (bool[] memory registereds); + function registerCallbacks(address[] calldata registers) external; /** * @dev Unregisters multiple callbacks from the bridge. * @param registers The array of callback addresses to unregister. - * @return unregistereds An array indicating the success status of each unregistration. */ - function unregisterCallbacks(address[] calldata registers) external returns (bool[] memory unregistereds); + function unregisterCallbacks(address[] calldata registers) external; } diff --git a/src/mainchain/MainchainGatewayV3.sol b/src/mainchain/MainchainGatewayV3.sol index 5045273b..d78df506 100644 --- a/src/mainchain/MainchainGatewayV3.sol +++ b/src/mainchain/MainchainGatewayV3.sol @@ -145,7 +145,7 @@ contract MainchainGatewayV3 is /** * @inheritdoc IMainchainGatewayV3 */ - function setWrappedNativeTokenContract(IWETH _wrappedToken) external virtual onlyAdmin { + function setWrappedNativeTokenContract(IWETH _wrappedToken) external virtual onlyProxyAdmin { _setWrappedNativeTokenContract(_wrappedToken); } @@ -196,7 +196,7 @@ contract MainchainGatewayV3 is /** * @inheritdoc IMainchainGatewayV3 */ - function mapTokens(address[] calldata _mainchainTokens, address[] calldata _roninTokens, TokenStandard[] calldata _standards) external virtual onlyAdmin { + function mapTokens(address[] calldata _mainchainTokens, address[] calldata _roninTokens, TokenStandard[] calldata _standards) external virtual onlyProxyAdmin { if (_mainchainTokens.length == 0) revert ErrEmptyArray(); _mapTokens(_mainchainTokens, _roninTokens, _standards); } @@ -213,7 +213,7 @@ contract MainchainGatewayV3 is // _thresholds[2]: unlockFeePercentages // _thresholds[3]: dailyWithdrawalLimit uint256[][4] calldata _thresholds - ) external virtual onlyAdmin { + ) external virtual onlyProxyAdmin { if (_mainchainTokens.length == 0) revert ErrEmptyArray(); _mapTokens(_mainchainTokens, _roninTokens, _standards); _setHighTierThresholds(_mainchainTokens, _thresholds[0]); diff --git a/src/ronin/gateway/RoninGatewayV3.sol b/src/ronin/gateway/RoninGatewayV3.sol index a4aed59c..e4bdf31f 100644 --- a/src/ronin/gateway/RoninGatewayV3.sol +++ b/src/ronin/gateway/RoninGatewayV3.sol @@ -272,7 +272,7 @@ contract RoninGatewayV3 is address[] calldata _mainchainTokens, uint256[] calldata _chainIds, TokenStandard[] calldata _standards - ) external onlyAdmin { + ) external onlyProxyAdmin { if (_roninTokens.length == 0) revert ErrLengthMismatch(msg.sig); _mapTokens(_roninTokens, _mainchainTokens, _chainIds, _standards); } @@ -458,7 +458,7 @@ contract RoninGatewayV3 is } } - function setTrustedThreshold(uint256 _trustedNumerator, uint256 _trustedDenominator) external virtual onlyAdmin returns (uint256, uint256) { + function setTrustedThreshold(uint256 _trustedNumerator, uint256 _trustedDenominator) external virtual onlyProxyAdmin returns (uint256, uint256) { return _setTrustedThreshold(_trustedNumerator, _trustedDenominator); } diff --git a/test/mocks/MockBridgeManager.sol b/test/mocks/MockBridgeManager.sol index 614117ed..202fe7d9 100644 --- a/test/mocks/MockBridgeManager.sol +++ b/test/mocks/MockBridgeManager.sol @@ -29,13 +29,12 @@ contract MockBridgeManager is IBridgeManager { } } - function addBridgeOperators(uint96[] calldata weights, address[] calldata governors, address[] calldata operators) external returns (bool[] memory addeds) { + function addBridgeOperators(uint96[] calldata weights, address[] calldata governors, address[] calldata operators) external { for (uint i; i < weights.length; i++) { _governors[governors[i]] = true; _operators[operators[i]] = true; _weights[governors[i]] = weights[i]; _weights[operators[i]] = weights[i]; - addeds[i] = true; } } @@ -76,7 +75,7 @@ contract MockBridgeManager is IBridgeManager { return _weights[addr] > 0; } - function removeBridgeOperators(address[] calldata bridgeOperators) external returns (bool[] memory removeds) { } + function removeBridgeOperators(address[] calldata bridgeOperators) external { } function sumGovernorsWeight(address[] calldata governors) external view returns (uint256 sum) { } From 97f94428c2e181109db8d9f6645352013af4c43b Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 15 Apr 2024 18:31:08 +0700 Subject: [PATCH 159/180] test: adapt test of add/remove operators --- .../concrete/bridge-manager/add/add.t.sol | 36 +++++++++++++------ .../bridge-manager/remove/remove.t.sol | 24 ++++++++----- .../fuzz/bridge-manager/BridgeSlash.t.sol | 11 ++++-- 3 files changed, 50 insertions(+), 21 deletions(-) diff --git a/test/bridge/unit/concrete/bridge-manager/add/add.t.sol b/test/bridge/unit/concrete/bridge-manager/add/add.t.sol index fe92ff02..368240da 100644 --- a/test/bridge/unit/concrete/bridge-manager/add/add.t.sol +++ b/test/bridge/unit/concrete/bridge-manager/add/add.t.sol @@ -11,6 +11,8 @@ import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManage import { BridgeManager_Unit_Concrete_Test } from "../BridgeManager.t.sol"; +event BridgeOperatorsAdded(bool[] statuses, uint96[] voteWeights, address[] governors, address[] bridgeOperators); + contract Add_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { function setUp() public virtual override { BridgeManager_Unit_Concrete_Test.setUp(); @@ -87,40 +89,52 @@ contract Add_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { (address[] memory addingOperators, address[] memory addingGovernors, uint96[] memory addingWeights) = _generateNewOperators(); addingGovernors[0] = _governors[0]; - bool[] memory addeds = _bridgeManager.addBridgeOperators(addingWeights, addingGovernors, addingOperators); + bool[] memory expectedAddeds = new bool[](1); expectedAddeds[0] = false; - assertEq(addeds, expectedAddeds); + vm.expectEmit(true, false, false, false); + emit BridgeOperatorsAdded(expectedAddeds, new uint96[](0), new address[](0), new address[](0)); + + _bridgeManager.addBridgeOperators(addingWeights, addingGovernors, addingOperators); } function test_AddOperators_DuplicatedBridgeOperator() external assertStateNotChange { (address[] memory addingOperators, address[] memory addingGovernors, uint96[] memory addingWeights) = _generateNewOperators(); addingOperators[0] = _bridgeOperators[0]; - bool[] memory addeds = _bridgeManager.addBridgeOperators(addingWeights, addingGovernors, addingOperators); + bool[] memory expectedAddeds = new bool[](1); expectedAddeds[0] = false; - assertEq(addeds, expectedAddeds); + vm.expectEmit(true, false, false, false); + emit BridgeOperatorsAdded(expectedAddeds, new uint96[](0), new address[](0), new address[](0)); + + _bridgeManager.addBridgeOperators(addingWeights, addingGovernors, addingOperators); } function test_AddOperators_DuplicatedGovernorWithExistedBridgeOperator() external assertStateNotChange { (address[] memory addingOperators, address[] memory addingGovernors, uint96[] memory addingWeights) = _generateNewOperators(); addingGovernors[0] = _bridgeOperators[0]; - bool[] memory addeds = _bridgeManager.addBridgeOperators(addingWeights, addingGovernors, addingOperators); + bool[] memory expectedAddeds = new bool[](1); expectedAddeds[0] = false; - assertEq(addeds, expectedAddeds); + vm.expectEmit(true, false, false, false); + emit BridgeOperatorsAdded(expectedAddeds, new uint96[](0), new address[](0), new address[](0)); + + _bridgeManager.addBridgeOperators(addingWeights, addingGovernors, addingOperators); } function test_AddOperators_DuplicatedBridgeOperatorWithExistedGovernor() external assertStateNotChange { (address[] memory addingOperators, address[] memory addingGovernors, uint96[] memory addingWeights) = _generateNewOperators(); addingOperators[0] = _governors[0]; - bool[] memory addeds = _bridgeManager.addBridgeOperators(addingWeights, addingGovernors, addingOperators); + bool[] memory expectedAddeds = new bool[](1); expectedAddeds[0] = false; - assertEq(addeds, expectedAddeds); + vm.expectEmit(true, false, false, false); + emit BridgeOperatorsAdded(expectedAddeds, new uint96[](0), new address[](0), new address[](0)); + + _bridgeManager.addBridgeOperators(addingWeights, addingGovernors, addingOperators); } function test_AddOperators_AllInfoIsValid() external { @@ -128,10 +142,12 @@ contract Add_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { (address[] memory beforeBridgeOperators, address[] memory beforeGovernors, uint96[] memory beforeVoteWeights) = _getBridgeMembers(); (address[] memory addingOperators, address[] memory addingGovernors, uint96[] memory addingWeights) = _generateNewOperators(); - bool[] memory addeds = _bridgeManager.addBridgeOperators(addingWeights, addingGovernors, addingOperators); bool[] memory expectedAddeds = new bool[](1); expectedAddeds[0] = true; - assertEq(addeds, expectedAddeds); + vm.expectEmit(true, false, false, false); + emit BridgeOperatorsAdded(expectedAddeds, new uint96[](0), new address[](0), new address[](0)); + + _bridgeManager.addBridgeOperators(addingWeights, addingGovernors, addingOperators); // Compare after and before state (address[] memory afterBridgeOperators, address[] memory afterGovernors, uint96[] memory afterVoteWeights) = _getBridgeMembers(); diff --git a/test/bridge/unit/concrete/bridge-manager/remove/remove.t.sol b/test/bridge/unit/concrete/bridge-manager/remove/remove.t.sol index a37ea153..4c08a9cc 100644 --- a/test/bridge/unit/concrete/bridge-manager/remove/remove.t.sol +++ b/test/bridge/unit/concrete/bridge-manager/remove/remove.t.sol @@ -12,6 +12,8 @@ import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManage import { BridgeManager_Unit_Concrete_Test } from "../BridgeManager.t.sol"; +event BridgeOperatorsRemoved(bool[] statuses, address[] bridgeOperators); + contract Remove_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { function setUp() public virtual override { BridgeManager_Unit_Concrete_Test.setUp(); @@ -47,10 +49,12 @@ contract Remove_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { uint96[] memory remainingWeights ) = _generateRemovingOperators(1); - bool[] memory removeds = _bridgeManager.removeBridgeOperators(removingOperators); - bool[] memory expectedRemoved = new bool[](1); - expectedRemoved[0] = true; - assertEq(removeds, expectedRemoved); + bool[] memory expectedRemoveds = new bool[](1); + expectedRemoveds[0] = true; + vm.expectEmit(true, false, false, false); + emit BridgeOperatorsRemoved(expectedRemoveds, new address[](0)); + + _bridgeManager.removeBridgeOperators(removingOperators); assertEq(_bridgeManager.totalBridgeOperator(), _bridgeOperators.length - 1, "wrong total bridge operator"); assertEq(_bridgeManager.getTotalWeight(), _totalWeight - removingWeights[0], "wrong total total weight"); @@ -99,11 +103,13 @@ contract Remove_Unit_Concrete_Test is BridgeManager_Unit_Concrete_Test { uint96[] memory remainingWeights ) = _generateRemovingOperators(TO_REMOVE_NUM); - bool[] memory removeds = _bridgeManager.removeBridgeOperators(removingOperators); - bool[] memory expectedRemoved = new bool[](TO_REMOVE_NUM); - expectedRemoved[0] = true; - expectedRemoved[1] = true; - assertEq(removeds, expectedRemoved); + bool[] memory expectedRemoveds = new bool[](TO_REMOVE_NUM); + expectedRemoveds[0] = true; + expectedRemoveds[1] = true; + vm.expectEmit(true, false, false, false); + emit BridgeOperatorsRemoved(expectedRemoveds, new address[](0)); + + _bridgeManager.removeBridgeOperators(removingOperators); address[] memory zeroAddressArrays = new address[](TO_REMOVE_NUM); zeroAddressArrays[0] = address(0); diff --git a/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol b/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol index c3ee142a..21079d76 100644 --- a/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol +++ b/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol @@ -167,8 +167,15 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { // Add the newly added operators using the bridge manager contract vm.prank(_bridgeManagerContract, _bridgeManagerContract); - bool[] memory addeds = IBridgeManager(_bridgeManagerContract).addBridgeOperators(newlyAddedWeights, newlyAddedGovernors, newlyAddedOperators); - vm.assume(addeds.sum() == addeds.length); + + bool[] memory expectedAddeds = new bool[](newlyAddedGovernors.length); + for (uint i; i < newlyAddedGovernors.length; ++i) { + expectedAddeds[i] = true; + } + vm.expectEmit(true, false, false, false); + emit BridgeOperatorsAdded(expectedAddeds, new uint96[](0), new address[](0), new address[](0)); + + IBridgeManager(_bridgeManagerContract).addBridgeOperators(newlyAddedWeights, newlyAddedGovernors, newlyAddedOperators); // Retrieve the added periods for the newly added operators newlyAddedAtPeriods = IBridgeSlash(_bridgeSlashContract).getAddedPeriodOf(newlyAddedOperators); } From d53cb75752f69982885c978292459499c1597f3d Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 15 Apr 2024 22:07:12 +0700 Subject: [PATCH 160/180] script: add callbacks --- ...0240411-deploy-bridge-manager-helper.s.sol | 22 ++++++++++- ...240411-p2-upgrade-bridge-ronin-chain.s.sol | 37 ++++++++----------- ...0240411-p3-upgrade-bridge-main-chain.s.sol | 28 +++++++++++--- .../MainchainBridgeManagerDeploy.s.sol | 10 ++--- .../contracts/RoninBridgeManagerDeploy.s.sol | 10 ++--- .../fuzz/bridge-manager/BridgeSlash.t.sol | 4 +- 6 files changed, 71 insertions(+), 40 deletions(-) diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-deploy-bridge-manager-helper.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-deploy-bridge-manager-helper.s.sol index 39f5604f..29162711 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-deploy-bridge-manager-helper.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-deploy-bridge-manager-helper.s.sol @@ -10,6 +10,7 @@ import { LibTokenInfo, TokenStandard } from "@ronin/contracts/libraries/LibToken import { Contract } from "../utils/Contract.sol"; import { Network } from "../utils/Network.sol"; import { Contract } from "../utils/Contract.sol"; +import { LibProxy } from "@fdk/libraries/LibProxy.sol"; import { IGeneralConfigExtended } from "../interfaces/IGeneralConfigExtended.sol"; import { ISharedArgument } from "../interfaces/ISharedArgument.sol"; import "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; @@ -25,6 +26,8 @@ import "@ronin/script/contracts/RoninBridgeManagerDeploy.s.sol"; import "../Migration.s.sol"; contract Migration__2024041_DeployRoninBridgeManagerHelper is Migration { + using LibProxy for *; + RoninBridgeManager _newRoninBridgeManager; function _deployRoninBridgeManager() internal returns (RoninBridgeManager) { @@ -77,7 +80,7 @@ contract Migration__2024041_DeployRoninBridgeManagerHelper is Migration { param.roninBridgeManager.roninChainId, param.roninBridgeManager.expiryDuration, param.roninBridgeManager.bridgeContract, - param.roninBridgeManager.callbackRegisters, + new address[](0), param.roninBridgeManager.bridgeOperators, param.roninBridgeManager.governors, param.roninBridgeManager.voteWeights, @@ -88,6 +91,23 @@ contract Migration__2024041_DeployRoninBridgeManagerHelper is Migration { ).run() ); + param.roninBridgeManager.callbackRegisters = new address[](1); + param.roninBridgeManager.callbackRegisters[0] = config.getAddressFromCurrentNetwork(Contract.BridgeSlash.key()); + + address proxyAdmin = LibProxy.getProxyAdmin(payable(address(_newRoninBridgeManager))); + vm.broadcast(proxyAdmin); + address(_newRoninBridgeManager).call( + abi.encodeWithSignature("functionDelegateCall(bytes)", ( + abi.encodeWithSignature("registerCallbacks(address[])", param.roninBridgeManager.callbackRegisters)) + ) + ); + + if (proxyAdmin != address(_newRoninBridgeManager)) { + vm.broadcast(proxyAdmin); + // change proxy admin to self + TransparentUpgradeableProxy(payable(address(_newRoninBridgeManager))).changeAdmin(address(_newRoninBridgeManager)); + } + return _newRoninBridgeManager; } } diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol index 7a5a5212..9c3b653d 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol @@ -107,7 +107,7 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H address roninGatewayV3Proxy = config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); uint256 expiredTime = block.timestamp + 14 days; - uint N = 14; + uint N = 15; address[] memory targets = new address[](N); uint256[] memory values = new uint256[](N); bytes[] memory calldatas = new bytes[](N); @@ -117,35 +117,30 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H targets[1] = bridgeSlashProxy; targets[2] = bridgeTrackingProxy; targets[3] = roninGatewayV3Proxy; - targets[4] = bridgeRewardProxy; - targets[5] = bridgeSlashProxy; - targets[6] = bridgeTrackingProxy; - targets[7] = roninGatewayV3Proxy; - targets[8] = bridgeRewardProxy; - targets[9] = bridgeSlashProxy; - targets[10] = bridgeTrackingProxy; - targets[11] = roninGatewayV3Proxy; - targets[12] = pauseEnforcerProxy; + targets[4] = pauseEnforcerProxy; + targets[5] = bridgeRewardProxy; + targets[6] = bridgeSlashProxy; + targets[7] = bridgeTrackingProxy; + targets[8] = roninGatewayV3Proxy; + targets[9] = bridgeRewardProxy; + targets[10] = bridgeSlashProxy; + targets[11] = bridgeTrackingProxy; + targets[12] = roninGatewayV3Proxy; targets[13] = pauseEnforcerProxy; calldatas[0] = abi.encodeWithSignature("upgradeToAndCall(address,bytes)", bridgeRewardLogic, abi.encodeWithSelector(BridgeReward.initializeV2.selector)); calldatas[1] = abi.encodeWithSignature("upgradeTo(address)", bridgeSlashLogic); calldatas[2] = abi.encodeWithSignature("upgradeTo(address)", bridgeTrackingLogic); calldatas[3] = abi.encodeWithSignature("upgradeTo(address)", roninGatewayV3Logic); - calldatas[4] = - abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newRoninBridgeManager)))); - calldatas[5] = - abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newRoninBridgeManager)))); - calldatas[6] = - abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newRoninBridgeManager)))); - calldatas[7] = - abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newRoninBridgeManager)))); - calldatas[8] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); + calldatas[4] = abi.encodeWithSignature("upgradeTo(address)", pauseEnforcerLogic); + calldatas[5] = abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newRoninBridgeManager)))); + calldatas[6] = abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newRoninBridgeManager)))); + calldatas[7] = abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newRoninBridgeManager)))); + calldatas[8] = abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newRoninBridgeManager)))); calldatas[9] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); calldatas[10] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); calldatas[11] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); - - calldatas[12] = abi.encodeWithSignature("upgradeTo(address)", pauseEnforcerLogic); + calldatas[12] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); calldatas[13] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); for (uint i; i < N; ++i) { diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol index a2de1fd9..b2832768 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol @@ -16,6 +16,7 @@ import "@ronin/contracts/mainchain/MainchainGatewayV3.sol"; import "@ronin/contracts/libraries/Proposal.sol"; import "@ronin/contracts/libraries/Ballot.sol"; +import { LibProxy } from "@fdk/libraries/LibProxy.sol"; import { DefaultContract } from "@fdk/utils/DefaultContract.sol"; import { MockSLP } from "@ronin/contracts/mocks/token/MockSLP.sol"; import { SLPDeploy } from "@ronin/script/contracts/token/SLPDeploy.s.sol"; @@ -108,7 +109,7 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is Migration, Migration__ param.mainchainBridgeManager.denom, param.mainchainBridgeManager.roninChainId, param.mainchainBridgeManager.bridgeContract, - param.mainchainBridgeManager.callbackRegisters, + new address[](0), param.mainchainBridgeManager.bridgeOperators, param.mainchainBridgeManager.governors, param.mainchainBridgeManager.voteWeights, @@ -118,6 +119,23 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is Migration, Migration__ ) ).run() ); + + param.mainchainBridgeManager.callbackRegisters = new address[](1); + param.mainchainBridgeManager.callbackRegisters[0] = config.getAddressFromCurrentNetwork(Contract.MainchainGatewayV3.key()); + + address proxyAdmin = LibProxy.getProxyAdmin(payable(address(_newMainchainBridgeManager))); + vm.broadcast(proxyAdmin); + address(_newMainchainBridgeManager).call( + abi.encodeWithSignature("functionDelegateCall(bytes)", ( + abi.encodeWithSignature("registerCallbacks(address[])", param.mainchainBridgeManager.callbackRegisters)) + ) + ); + + if (proxyAdmin != address(_newMainchainBridgeManager)) { + vm.broadcast(proxyAdmin); + // change proxy admin to self + TransparentUpgradeableProxy(payable(address(_newMainchainBridgeManager))).changeAdmin(address(_newMainchainBridgeManager)); + } } function _upgradeBridgeMainchain() internal { @@ -143,11 +161,8 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is Migration, Migration__ targets[3] = pauseEnforcerProxy; targets[4] = pauseEnforcerProxy; - calldatas[0] = abi.encodeWithSignature( - "upgradeToAndCall(address,bytes)", mainchainGatewayV3Logic, abi.encodeWithSelector(MainchainGatewayV3.initializeV4.selector, wethUnwrapper) - ); - calldatas[1] = - abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newMainchainBridgeManager)))); + calldatas[0] = abi.encodeWithSignature("upgradeToAndCall(address,bytes)", mainchainGatewayV3Logic, abi.encodeWithSelector(MainchainGatewayV3.initializeV4.selector, wethUnwrapper)); + calldatas[1] = abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newMainchainBridgeManager)))); calldatas[2] = abi.encodeWithSignature("changeAdmin(address)", address(_newMainchainBridgeManager)); calldatas[3] = abi.encodeWithSignature("upgradeTo(address)", pauseEnforcerLogic); calldatas[4] = abi.encodeWithSignature("changeAdmin(address)", address(_newMainchainBridgeManager)); @@ -181,6 +196,7 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is Migration, Migration__ ); } + function getDomain() public pure returns (bytes32) { return keccak256( abi.encode( diff --git a/script/contracts/MainchainBridgeManagerDeploy.s.sol b/script/contracts/MainchainBridgeManagerDeploy.s.sol index 8f3a9cfa..6b1de624 100644 --- a/script/contracts/MainchainBridgeManagerDeploy.s.sol +++ b/script/contracts/MainchainBridgeManagerDeploy.s.sol @@ -17,10 +17,10 @@ contract MainchainBridgeManagerDeploy is Migration { instance = MainchainBridgeManager(_deployProxy(Contract.MainchainBridgeManager.key(), sender())); address proxyAdmin = payable(address(instance)).getProxyAdmin(); - if (proxyAdmin == sender()) { - vm.broadcast(proxyAdmin); - // change proxy admin to self - TransparentUpgradeableProxy(payable(address(instance))).changeAdmin(address(instance)); - } + // if (proxyAdmin != address(instance)) { + // vm.broadcast(proxyAdmin); + // // change proxy admin to self + // TransparentUpgradeableProxy(payable(address(instance))).changeAdmin(address(instance)); + // } } } diff --git a/script/contracts/RoninBridgeManagerDeploy.s.sol b/script/contracts/RoninBridgeManagerDeploy.s.sol index 86361339..cae1bac1 100644 --- a/script/contracts/RoninBridgeManagerDeploy.s.sol +++ b/script/contracts/RoninBridgeManagerDeploy.s.sol @@ -43,11 +43,11 @@ contract RoninBridgeManagerDeploy is Migration { console2.log("Sender: ", sender()); _upgradeRaw(proxyAdmin, instance, logic, EMPTY_ARGS); - if (proxyAdmin == sender()) { - vm.broadcast(proxyAdmin); - // change proxy admin to self - TransparentUpgradeableProxy(instance).changeAdmin(instance); - } + // if (proxyAdmin != instance) { + // vm.broadcast(proxyAdmin); + // // change proxy admin to self + // TransparentUpgradeableProxy(instance).changeAdmin(instance); + // } config.setAddress(network(), Contract.RoninBridgeManager.key(), instance); return RoninBridgeManager(instance); diff --git a/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol b/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol index 21079d76..b7ae2617 100644 --- a/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol +++ b/test/bridge/unit/fuzz/bridge-manager/BridgeSlash.t.sol @@ -169,8 +169,8 @@ contract BridgeSlashTest is IBridgeSlashEvents, BridgeManagerUtils { vm.prank(_bridgeManagerContract, _bridgeManagerContract); bool[] memory expectedAddeds = new bool[](newlyAddedGovernors.length); - for (uint i; i < newlyAddedGovernors.length; ++i) { - expectedAddeds[i] = true; + for (uint j; j < newlyAddedGovernors.length; ++j) { + expectedAddeds[j] = true; } vm.expectEmit(true, false, false, false); emit BridgeOperatorsAdded(expectedAddeds, new uint96[](0), new address[](0), new address[](0)); From 63c4792911e2be8099d105812a260ce7103d9168 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 15 Apr 2024 22:37:17 +0700 Subject: [PATCH 161/180] fix(MainchainGateway): interface id of IBridgeManagerCallback --- ...0240411-deploy-bridge-manager-helper.s.sol | 17 +++---------- ...240411-p2-upgrade-bridge-ronin-chain.s.sol | 13 +++++++--- ...0240411-p3-upgrade-bridge-main-chain.s.sol | 25 ++++++++----------- src/mainchain/MainchainGatewayV3.sol | 2 +- 4 files changed, 24 insertions(+), 33 deletions(-) diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-deploy-bridge-manager-helper.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-deploy-bridge-manager-helper.s.sol index 29162711..6aa95cc4 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-deploy-bridge-manager-helper.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-deploy-bridge-manager-helper.s.sol @@ -31,6 +31,8 @@ contract Migration__2024041_DeployRoninBridgeManagerHelper is Migration { RoninBridgeManager _newRoninBridgeManager; function _deployRoninBridgeManager() internal returns (RoninBridgeManager) { + address currRoninBridgeManager = config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key()); + ISharedArgument.SharedParameter memory param; param.roninBridgeManager.num = 7; @@ -91,22 +93,9 @@ contract Migration__2024041_DeployRoninBridgeManagerHelper is Migration { ).run() ); - param.roninBridgeManager.callbackRegisters = new address[](1); - param.roninBridgeManager.callbackRegisters[0] = config.getAddressFromCurrentNetwork(Contract.BridgeSlash.key()); - address proxyAdmin = LibProxy.getProxyAdmin(payable(address(_newRoninBridgeManager))); vm.broadcast(proxyAdmin); - address(_newRoninBridgeManager).call( - abi.encodeWithSignature("functionDelegateCall(bytes)", ( - abi.encodeWithSignature("registerCallbacks(address[])", param.roninBridgeManager.callbackRegisters)) - ) - ); - - if (proxyAdmin != address(_newRoninBridgeManager)) { - vm.broadcast(proxyAdmin); - // change proxy admin to self - TransparentUpgradeableProxy(payable(address(_newRoninBridgeManager))).changeAdmin(address(_newRoninBridgeManager)); - } + TransparentUpgradeableProxy(payable(address(_newRoninBridgeManager))).changeAdmin(address(currRoninBridgeManager)); return _newRoninBridgeManager; } diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol index 9c3b653d..2b302d5d 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol @@ -106,8 +106,11 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H address pauseEnforcerProxy = config.getAddressFromCurrentNetwork(Contract.RoninPauseEnforcer.key()); address roninGatewayV3Proxy = config.getAddressFromCurrentNetwork(Contract.RoninGatewayV3.key()); - uint256 expiredTime = block.timestamp + 14 days; - uint N = 15; + ISharedArgument.SharedParameter memory param; + param.roninBridgeManager.callbackRegisters = new address[](1); + param.roninBridgeManager.callbackRegisters[0] = config.getAddressFromCurrentNetwork(Contract.BridgeSlash.key()); + + uint N = 17; address[] memory targets = new address[](N); uint256[] memory values = new uint256[](N); bytes[] memory calldatas = new bytes[](N); @@ -127,6 +130,8 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H targets[11] = bridgeTrackingProxy; targets[12] = roninGatewayV3Proxy; targets[13] = pauseEnforcerProxy; + targets[14] = address(_newRoninBridgeManager); + targets[15] = address(_newRoninBridgeManager); calldatas[0] = abi.encodeWithSignature("upgradeToAndCall(address,bytes)", bridgeRewardLogic, abi.encodeWithSelector(BridgeReward.initializeV2.selector)); calldatas[1] = abi.encodeWithSignature("upgradeTo(address)", bridgeSlashLogic); @@ -142,6 +147,8 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H calldatas[11] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); calldatas[12] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); calldatas[13] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); + calldatas[14] = abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("registerCallbacks(address[])", param.roninBridgeManager.callbackRegisters))); + calldatas[15] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); for (uint i; i < N; ++i) { gasAmounts[i] = 1_000_000; @@ -150,7 +157,7 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H LegacyProposalDetail memory proposal; proposal.nonce = _currRoninBridgeManager.round(block.chainid) + 1; proposal.chainId = block.chainid; - proposal.expiryTimestamp = expiredTime; + proposal.expiryTimestamp = block.timestamp + 14 days; proposal.targets = targets; proposal.values = values; proposal.calldatas = calldatas; diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol index b2832768..560c5c83 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol @@ -120,22 +120,9 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is Migration, Migration__ ).run() ); - param.mainchainBridgeManager.callbackRegisters = new address[](1); - param.mainchainBridgeManager.callbackRegisters[0] = config.getAddressFromCurrentNetwork(Contract.MainchainGatewayV3.key()); - address proxyAdmin = LibProxy.getProxyAdmin(payable(address(_newMainchainBridgeManager))); vm.broadcast(proxyAdmin); - address(_newMainchainBridgeManager).call( - abi.encodeWithSignature("functionDelegateCall(bytes)", ( - abi.encodeWithSignature("registerCallbacks(address[])", param.mainchainBridgeManager.callbackRegisters)) - ) - ); - - if (proxyAdmin != address(_newMainchainBridgeManager)) { - vm.broadcast(proxyAdmin); - // change proxy admin to self - TransparentUpgradeableProxy(payable(address(_newMainchainBridgeManager))).changeAdmin(address(_newMainchainBridgeManager)); - } + TransparentUpgradeableProxy(payable(address(_newMainchainBridgeManager))).changeAdmin(address(_currMainchainBridgeManager)); } function _upgradeBridgeMainchain() internal { @@ -148,8 +135,12 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is Migration, Migration__ address pauseEnforcerProxy = config.getAddressFromCurrentNetwork(Contract.MainchainPauseEnforcer.key()); address mainchainGatewayV3Proxy = config.getAddressFromCurrentNetwork(Contract.MainchainGatewayV3.key()); + ISharedArgument.SharedParameter memory param; + param.mainchainBridgeManager.callbackRegisters = new address[](1); + param.mainchainBridgeManager.callbackRegisters[0] = config.getAddressFromCurrentNetwork(Contract.MainchainGatewayV3.key()); + uint256 expiredTime = block.timestamp + 14 days; - uint N = 5; + uint N = 7; address[] memory targets = new address[](N); uint256[] memory values = new uint256[](N); bytes[] memory calldatas = new bytes[](N); @@ -160,12 +151,16 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is Migration, Migration__ targets[2] = mainchainGatewayV3Proxy; targets[3] = pauseEnforcerProxy; targets[4] = pauseEnforcerProxy; + targets[5] = address(_newMainchainBridgeManager); + targets[6] = address(_newMainchainBridgeManager); calldatas[0] = abi.encodeWithSignature("upgradeToAndCall(address,bytes)", mainchainGatewayV3Logic, abi.encodeWithSelector(MainchainGatewayV3.initializeV4.selector, wethUnwrapper)); calldatas[1] = abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newMainchainBridgeManager)))); calldatas[2] = abi.encodeWithSignature("changeAdmin(address)", address(_newMainchainBridgeManager)); calldatas[3] = abi.encodeWithSignature("upgradeTo(address)", pauseEnforcerLogic); calldatas[4] = abi.encodeWithSignature("changeAdmin(address)", address(_newMainchainBridgeManager)); + calldatas[5] = abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("registerCallbacks(address[])", param.mainchainBridgeManager.callbackRegisters))); + calldatas[6] = abi.encodeWithSignature("changeAdmin(address)", address(_newMainchainBridgeManager)); for (uint i; i < N; ++i) { gasAmounts[i] = 1_000_000; diff --git a/src/mainchain/MainchainGatewayV3.sol b/src/mainchain/MainchainGatewayV3.sol index d78df506..042d79cd 100644 --- a/src/mainchain/MainchainGatewayV3.sol +++ b/src/mainchain/MainchainGatewayV3.sol @@ -518,6 +518,6 @@ contract MainchainGatewayV3 is } function supportsInterface(bytes4 interfaceId) public view override(AccessControlEnumerable, IERC165, ERC1155Receiver) returns (bool) { - return interfaceId == type(IMainchainGatewayV3).interfaceId || super.supportsInterface(interfaceId); + return interfaceId == type(IMainchainGatewayV3).interfaceId || interfaceId == type(IBridgeManagerCallback).interfaceId || super.supportsInterface(interfaceId); } } From 6964a9779b2e1750a5ab318f16dd2e4e0054e307 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Mon, 15 Apr 2024 22:56:04 +0700 Subject: [PATCH 162/180] script: fix withdrawal post-check --- script/post-check/BasePostCheck.s.sol | 2 +- .../PostCheck_Gateway_DepositAndWithdraw.s.sol | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/script/post-check/BasePostCheck.s.sol b/script/post-check/BasePostCheck.s.sol index 6d368cb7..7a5c96d4 100644 --- a/script/post-check/BasePostCheck.s.sol +++ b/script/post-check/BasePostCheck.s.sol @@ -32,7 +32,7 @@ abstract contract BasePostCheck is BaseMigration { uint256 internal cheatGovernorPk; uint256 internal cheatOperatorPk; - bytes32 internal domainSeparator; + bytes32 internal gwDomainSeparator; modifier onPostCheck(string memory postCheckLabel) { uint256 snapshotId = _beforePostCheck(postCheckLabel); diff --git a/script/post-check/gateway/deposit-withdraw/PostCheck_Gateway_DepositAndWithdraw.s.sol b/script/post-check/gateway/deposit-withdraw/PostCheck_Gateway_DepositAndWithdraw.s.sol index bd372e4c..c7e915de 100644 --- a/script/post-check/gateway/deposit-withdraw/PostCheck_Gateway_DepositAndWithdraw.s.sol +++ b/script/post-check/gateway/deposit-withdraw/PostCheck_Gateway_DepositAndWithdraw.s.sol @@ -121,7 +121,7 @@ abstract contract PostCheck_Gateway_DepositAndWithdraw is BasePostCheck, Signatu CONFIG.switchTo(companionNetwork); mainchainChainId = block.chainid; - domainSeparator = MainchainBridgeManager(mainchainBridgeManager).DOMAIN_SEPARATOR(); + gwDomainSeparator = MainchainGatewayV3(payable(mainchainGateway)).DOMAIN_SEPARATOR(); cheatAddOverWeightedGovernor(address(mainchainBridgeManager)); @@ -197,7 +197,7 @@ abstract contract PostCheck_Gateway_DepositAndWithdraw is BasePostCheck, Signatu } } - bytes32 receiptDigest = LibTransfer.receiptDigest(domainSeparator, receiptHash); + bytes32 receiptDigest = LibTransfer.receiptDigest(gwDomainSeparator, receiptHash); (uint8 v, bytes32 r, bytes32 s) = vm.sign(cheatOperatorPk, receiptDigest); From 29853db60bfbf4171a626996c4270ff63885d30f Mon Sep 17 00:00:00 2001 From: TuDo1403 Date: Tue, 16 Apr 2024 11:06:07 +0700 Subject: [PATCH 163/180] script: add admin postcheck & quorum post check --- .../PostCheck_BridgeManager.s.sol | 3 ++ .../PostCheck_BridgeManager_Quorum.s.sol | 34 +++++++++++++++++++ ...PostCheck_Gateway_DepositAndWithdraw.s.sol | 19 +++++++++++ 3 files changed, 56 insertions(+) create mode 100644 script/post-check/bridge-manager/quorum/PostCheck_BridgeManager_Quorum.s.sol diff --git a/script/post-check/bridge-manager/PostCheck_BridgeManager.s.sol b/script/post-check/bridge-manager/PostCheck_BridgeManager.s.sol index 24e113d4..5face6bf 100644 --- a/script/post-check/bridge-manager/PostCheck_BridgeManager.s.sol +++ b/script/post-check/bridge-manager/PostCheck_BridgeManager.s.sol @@ -4,8 +4,10 @@ pragma solidity ^0.8.19; import { PostCheck_BridgeManager_CRUD_AddBridgeOperators } from "./crud/PostCheck_BridgeManager_CRUD_AddBridgeOperators.s.sol"; import { PostCheck_BridgeManager_CRUD_RemoveBridgeOperators } from "./crud/PostCheck_BridgeManager_CRUD_RemoveBridgeOperators.s.sol"; import { PostCheck_BridgeManager_Proposal } from "./proposal/PostCheck_BridgeManager_Proposal.s.sol"; +import { PostCheck_BridgeManager_Quorum } from "./quorum/PostCheck_BridgeManager_Quorum.s.sol"; abstract contract PostCheck_BridgeManager is + PostCheck_BridgeManager_Quorum, PostCheck_BridgeManager_Proposal, PostCheck_BridgeManager_CRUD_AddBridgeOperators, PostCheck_BridgeManager_CRUD_RemoveBridgeOperators @@ -14,5 +16,6 @@ abstract contract PostCheck_BridgeManager is _validate_BridgeManager_CRUD_addBridgeOperators(); _validate_BridgeManager_CRUD_removeBridgeOperators(); _validate_BridgeManager_Proposal(); + _validate_BridgeManager_Quorum(); } } diff --git a/script/post-check/bridge-manager/quorum/PostCheck_BridgeManager_Quorum.s.sol b/script/post-check/bridge-manager/quorum/PostCheck_BridgeManager_Quorum.s.sol new file mode 100644 index 00000000..f2d2db9f --- /dev/null +++ b/script/post-check/bridge-manager/quorum/PostCheck_BridgeManager_Quorum.s.sol @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import { TransparentUpgradeableProxyV2 } from "@ronin/contracts/extensions/TransparentUpgradeableProxyV2.sol"; +import { IBridgeManager } from "@ronin/contracts/interfaces/bridge/IBridgeManager.sol"; +import { IQuorum } from "@ronin/contracts/interfaces/IQuorum.sol"; +import { BasePostCheck } from "script/post-check/BasePostCheck.s.sol"; +import { LibArray } from "script/shared/libraries/LibArray.sol"; +import { Contract } from "script/utils/Contract.sol"; +import { TNetwork } from "@fdk/types/Types.sol"; +import { Network } from "script/utils/Network.sol"; +import { LibCompanionNetwork } from "script/shared/libraries/LibCompanionNetwork.sol"; + +abstract contract PostCheck_BridgeManager_Quorum is BasePostCheck { + using LibArray for *; + using LibCompanionNetwork for *; + + function _validate_BridgeManager_Quorum() internal { + validate_NonZero_MinimumVoteWeight(); + } + + function validate_NonZero_MinimumVoteWeight() private onlyOnRoninNetworkOrLocal onPostCheck("validate_NonZero_MinimumVoteWeight") { + assertTrue(IQuorum(roninBridgeManager).minimumVoteWeight() > 0, "Ronin: Minimum vote weight must be greater than 0"); + TNetwork currentNetwork = network(); + + (, TNetwork companionNetwork) = currentNetwork.companionNetworkData(); + CONFIG.createFork(companionNetwork); + CONFIG.switchTo(companionNetwork); + + assertTrue(IQuorum(mainchainBridgeManager).minimumVoteWeight() > 0, "Mainchain: Minimum vote weight must be greater than 0"); + + CONFIG.switchTo(currentNetwork); + } +} diff --git a/script/post-check/gateway/deposit-withdraw/PostCheck_Gateway_DepositAndWithdraw.s.sol b/script/post-check/gateway/deposit-withdraw/PostCheck_Gateway_DepositAndWithdraw.s.sol index c7e915de..da06ba50 100644 --- a/script/post-check/gateway/deposit-withdraw/PostCheck_Gateway_DepositAndWithdraw.s.sol +++ b/script/post-check/gateway/deposit-withdraw/PostCheck_Gateway_DepositAndWithdraw.s.sol @@ -22,6 +22,8 @@ import { RoninBridgeManager } from "@ronin/contracts/ronin/gateway/RoninBridgeMa import { MainchainBridgeManager } from "@ronin/contracts/mainchain/MainchainBridgeManager.sol"; import { IMainchainGatewayV3, MainchainGatewayV3 } from "@ronin/contracts/mainchain/MainchainGatewayV3.sol"; import { TransparentUpgradeableProxyV2 } from "@ronin/contracts/extensions/TransparentUpgradeableProxyV2.sol"; +import { HasContracts } from "@ronin/contracts/extensions/collections/HasContracts.sol"; +import { ContractType } from "@ronin/contracts/utils/ContractType.sol"; abstract contract PostCheck_Gateway_DepositAndWithdraw is BasePostCheck, SignatureConsumer { using LibProxy for *; @@ -137,10 +139,27 @@ abstract contract PostCheck_Gateway_DepositAndWithdraw is BasePostCheck, Signatu function _validate_Gateway_DepositAndWithdraw() internal onlyOnRoninNetworkOrLocal { _setUp(); + validate_HasBridgeManager(); validate_Gateway_depositERC20(); validate_Gateway_withdrawERC20(); } + function validate_HasBridgeManager() internal onPostCheck("validate_HasBridgeManager") { + assertEq(roninBridgeManager.getProxyAdmin(), roninBridgeManager, "Invalid ProxyAdmin in RoninBridgeManager, expected self"); + assertEq(HasContracts(roninGateway).getContract(ContractType.BRIDGE_MANAGER), roninBridgeManager, "Invalid RoninBridgeManager in roninGateway"); + assertEq(HasContracts(bridgeTracking).getContract(ContractType.BRIDGE_MANAGER), roninBridgeManager, "Invalid RoninBridgeManager in bridgeTracking"); + assertEq(HasContracts(bridgeReward).getContract(ContractType.BRIDGE_MANAGER), roninBridgeManager, "Invalid RoninBridgeManager in bridgeReward"); + assertEq(HasContracts(bridgeSlash).getContract(ContractType.BRIDGE_MANAGER), roninBridgeManager, "Invalid RoninBridgeManager in bridgeSlash"); + + CONFIG.createFork(companionNetwork); + CONFIG.switchTo(companionNetwork); + + assertEq(mainchainBridgeManager.getProxyAdmin(), mainchainBridgeManager, "Invalid MainchainBridgeManager in mainchainBridgeManager"); + assertEq( + HasContracts(mainchainGateway).getContract(ContractType.BRIDGE_MANAGER), mainchainBridgeManager, "Invalid MainchainBridgeManager in mainchainGateway" + ); + } + function validate_Gateway_depositERC20() private onPostCheck("validate_Gateway_depositERC20") { depositRequest.recipientAddr = makeAddr("ronin-recipient"); depositRequest.tokenAddr = address(mainchainERC20); From f849a84473557407370ab1cfbde2388af55f36a6 Mon Sep 17 00:00:00 2001 From: TuDo1403 Date: Tue, 16 Apr 2024 11:07:16 +0700 Subject: [PATCH 164/180] fix: fix validate has bridge manager post check --- .../deposit-withdraw/PostCheck_Gateway_DepositAndWithdraw.s.sol | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script/post-check/gateway/deposit-withdraw/PostCheck_Gateway_DepositAndWithdraw.s.sol b/script/post-check/gateway/deposit-withdraw/PostCheck_Gateway_DepositAndWithdraw.s.sol index da06ba50..94ef9cb4 100644 --- a/script/post-check/gateway/deposit-withdraw/PostCheck_Gateway_DepositAndWithdraw.s.sol +++ b/script/post-check/gateway/deposit-withdraw/PostCheck_Gateway_DepositAndWithdraw.s.sol @@ -158,6 +158,8 @@ abstract contract PostCheck_Gateway_DepositAndWithdraw is BasePostCheck, Signatu assertEq( HasContracts(mainchainGateway).getContract(ContractType.BRIDGE_MANAGER), mainchainBridgeManager, "Invalid MainchainBridgeManager in mainchainGateway" ); + + CONFIG.switchTo(currentNetwork); } function validate_Gateway_depositERC20() private onPostCheck("validate_Gateway_depositERC20") { From 38aa7256f079d8acbc3f5c5f3a0c190cec31f16a Mon Sep 17 00:00:00 2001 From: TuDo1403 Date: Tue, 16 Apr 2024 11:17:16 +0700 Subject: [PATCH 165/180] script: add warning --- script/post-check/BasePostCheck.s.sol | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/script/post-check/BasePostCheck.s.sol b/script/post-check/BasePostCheck.s.sol index 7a5c96d4..c1a7043b 100644 --- a/script/post-check/BasePostCheck.s.sol +++ b/script/post-check/BasePostCheck.s.sol @@ -64,14 +64,18 @@ abstract contract BasePostCheck is BaseMigration { vm.deal(cheatGovernor, 1); // Check created EOA vm.deal(cheatOperator, 1); // Check created EOA - vm.prank(manager); + address proxyAdmin = payable(manager).getProxyAdmin(); + if (proxyAdmin != manager) { + console.log(unicode"⚠ WARNING: ProxyAdmin is not the manager!".yellow()); + } + vm.prank(proxyAdmin); try TransparentUpgradeableProxyV2(payable(manager)).functionDelegateCall( abi.encodeCall( IBridgeManager.addBridgeOperators, (cheatVoteWeight.toSingletonArray().toUint96sUnsafe(), cheatGovernor.toSingletonArray(), cheatOperator.toSingletonArray()) ) ) { } catch { - vm.prank(manager); + vm.prank(proxyAdmin); IBridgeManager(manager).addBridgeOperators( cheatVoteWeight.toSingletonArray().toUint96sUnsafe(), cheatGovernor.toSingletonArray(), cheatOperator.toSingletonArray() ); From 1f1d640b6961d0f41b0d8560d996a81a6be4be3f Mon Sep 17 00:00:00 2001 From: TuDo1403 Date: Tue, 16 Apr 2024 11:23:03 +0700 Subject: [PATCH 166/180] script: load bridge tracking in post check --- script/PostChecker.sol | 1 + .../deposit-withdraw/PostCheck_Gateway_DepositAndWithdraw.s.sol | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/script/PostChecker.sol b/script/PostChecker.sol index 628c8cf8..383d5f65 100644 --- a/script/PostChecker.sol +++ b/script/PostChecker.sol @@ -53,6 +53,7 @@ contract PostChecker is Migration, PostCheck_BridgeManager, PostCheck_Gateway { bridgeSlash = loadContract(Contract.BridgeSlash.key()); bridgeReward = loadContract(Contract.BridgeReward.key()); roninGateway = loadContract(Contract.RoninGatewayV3.key()); + bridgeTracking = loadContract(Contract.BridgeTracking.key()); roninBridgeManager = loadContract(Contract.RoninBridgeManager.key()); (, TNetwork companionNetwork) = currentNetwork.companionNetworkData(); diff --git a/script/post-check/gateway/deposit-withdraw/PostCheck_Gateway_DepositAndWithdraw.s.sol b/script/post-check/gateway/deposit-withdraw/PostCheck_Gateway_DepositAndWithdraw.s.sol index 94ef9cb4..c030a536 100644 --- a/script/post-check/gateway/deposit-withdraw/PostCheck_Gateway_DepositAndWithdraw.s.sol +++ b/script/post-check/gateway/deposit-withdraw/PostCheck_Gateway_DepositAndWithdraw.s.sol @@ -154,7 +154,7 @@ abstract contract PostCheck_Gateway_DepositAndWithdraw is BasePostCheck, Signatu CONFIG.createFork(companionNetwork); CONFIG.switchTo(companionNetwork); - assertEq(mainchainBridgeManager.getProxyAdmin(), mainchainBridgeManager, "Invalid MainchainBridgeManager in mainchainBridgeManager"); + assertEq(mainchainBridgeManager.getProxyAdmin(), mainchainBridgeManager, "Invalid ProxyAdmin in MainchainBridgeManager, expected self"); assertEq( HasContracts(mainchainGateway).getContract(ContractType.BRIDGE_MANAGER), mainchainBridgeManager, "Invalid MainchainBridgeManager in mainchainGateway" ); From 53b01ea93fad5c0e0fdc1ae25a6e8d0030c3357f Mon Sep 17 00:00:00 2001 From: TuDo1403 Date: Tue, 16 Apr 2024 11:23:23 +0700 Subject: [PATCH 167/180] script: update fdk version --- lib/foundry-deployment-kit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/foundry-deployment-kit b/lib/foundry-deployment-kit index 2f48f7db..68f4fd8b 160000 --- a/lib/foundry-deployment-kit +++ b/lib/foundry-deployment-kit @@ -1 +1 @@ -Subproject commit 2f48f7dbed4b99688ecd2b42109e3400d296b3a3 +Subproject commit 68f4fd8bedc1d5532d1e9df6403eb83363bf9877 From aa60e55bc3b6a10d75fc12d323ead543ae132c57 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 16 Apr 2024 12:40:15 +0700 Subject: [PATCH 168/180] script: fix ronin script --- .../20240411-helper.s.sol | 2 +- ...40411-p1-deploy-ronin-bridge-manager.s.sol | 1 + ...240411-p2-upgrade-bridge-ronin-chain.s.sol | 32 +++++++++++++------ ...0240411-p3-upgrade-bridge-main-chain.s.sol | 12 ++++--- script/PostChecker.sol | 2 +- 5 files changed, 34 insertions(+), 15 deletions(-) diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol index ce9652fd..2775424a 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol @@ -36,7 +36,7 @@ contract Migration__20240409_Helper is Migration { } function _helperVoteForCurrentNetwork(LegacyProposalDetail memory proposal) internal { - for (uint i; i < _voters.length; ++i) { + for (uint i; i < _voters.length - 1; ++i) { vm.broadcast(_voters[i]); address(_currRoninBridgeManager).call( abi.encodeWithSignature( diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.s.sol index f13e088e..d0be13ac 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p1-deploy-ronin-bridge-manager.s.sol @@ -24,6 +24,7 @@ import "@ronin/script/contracts/RoninBridgeManagerDeploy.s.sol"; import "./20240411-deploy-bridge-manager-helper.s.sol"; import "../Migration.s.sol"; +// Run this script with `optimizer_runs = 1`. contract Migration__20240409_P1_DeployRoninBridgeManager is Migration, Migration__2024041_DeployRoninBridgeManagerHelper { ISharedArgument.SharedParameter _param; diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol index 2b302d5d..ed4a3b8e 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol @@ -34,7 +34,7 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H function run() public virtual onlyOn(DefaultNetwork.RoninTestnet.key()) { _currRoninBridgeManager = RoninBridgeManager(config.getAddressFromCurrentNetwork(Contract.RoninBridgeManager.key())); - _newRoninBridgeManager = _deployRoninBridgeManager(); + _newRoninBridgeManager = RoninBridgeManager(0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF); _governor = 0xd24D87DDc1917165435b306aAC68D99e0F49A3Fa; _voters.push(0xb033ba62EC622dC54D0ABFE0254e79692147CA26); @@ -43,6 +43,8 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H _changeAdminOfEnforcer(); _upgradeBridgeRoninchain(); + + config.setAddress(network(), Contract.RoninBridgeManager.key(), address(_newRoninBridgeManager)); } function _changeAdminOfEnforcer() private { @@ -69,7 +71,13 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H proposal.calldatas = calldatas; proposal.gasAmounts = gasAmounts; - vm.broadcast(_governor); + address gaGovernor = 0x52ec2e6BBcE45AfFF8955Da6410bb13812F4289F; + address[] memory gaVoters = new address[](3); + gaVoters[0] = 0x087D08e3ba42e64E3948962dd1371F906D1278b9; + gaVoters[1] = 0x06f8Af58F656B507918d91B0B6F8B89bfCC556f9; + gaVoters[2] = 0xe1100401454B5f850b09f3b92cE7f071C5F1CEF4; + + vm.broadcast(gaGovernor); address(roninGA).call( abi.encodeWithSignature( "proposeProposalForCurrentNetwork(uint256,address[],uint256[],bytes[],uint256[],uint8)", @@ -83,8 +91,8 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H ) ); - for (uint i; i < _voters.length; ++i) { - vm.broadcast(_voters[i]); + for (uint i; i < gaVoters.length; ++i) { + vm.broadcast(gaVoters[i]); address(roninGA).call( abi.encodeWithSignature( "castProposalVoteForCurrentNetwork((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8)", proposal, Ballot.VoteType.For @@ -138,16 +146,22 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H calldatas[2] = abi.encodeWithSignature("upgradeTo(address)", bridgeTrackingLogic); calldatas[3] = abi.encodeWithSignature("upgradeTo(address)", roninGatewayV3Logic); calldatas[4] = abi.encodeWithSignature("upgradeTo(address)", pauseEnforcerLogic); - calldatas[5] = abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newRoninBridgeManager)))); - calldatas[6] = abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newRoninBridgeManager)))); - calldatas[7] = abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newRoninBridgeManager)))); - calldatas[8] = abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newRoninBridgeManager)))); + calldatas[5] = + abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newRoninBridgeManager)))); + calldatas[6] = + abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newRoninBridgeManager)))); + calldatas[7] = + abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newRoninBridgeManager)))); + calldatas[8] = + abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newRoninBridgeManager)))); calldatas[9] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); calldatas[10] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); calldatas[11] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); calldatas[12] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); calldatas[13] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); - calldatas[14] = abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("registerCallbacks(address[])", param.roninBridgeManager.callbackRegisters))); + calldatas[14] = abi.encodeWithSignature( + "functionDelegateCall(bytes)", (abi.encodeWithSignature("registerCallbacks(address[])", param.roninBridgeManager.callbackRegisters)) + ); calldatas[15] = abi.encodeWithSignature("changeAdmin(address)", address(_newRoninBridgeManager)); for (uint i; i < N; ++i) { diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol index 560c5c83..6995e701 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol @@ -154,12 +154,17 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is Migration, Migration__ targets[5] = address(_newMainchainBridgeManager); targets[6] = address(_newMainchainBridgeManager); - calldatas[0] = abi.encodeWithSignature("upgradeToAndCall(address,bytes)", mainchainGatewayV3Logic, abi.encodeWithSelector(MainchainGatewayV3.initializeV4.selector, wethUnwrapper)); - calldatas[1] = abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newMainchainBridgeManager)))); + calldatas[0] = abi.encodeWithSignature( + "upgradeToAndCall(address,bytes)", mainchainGatewayV3Logic, abi.encodeWithSelector(MainchainGatewayV3.initializeV4.selector, wethUnwrapper) + ); + calldatas[1] = + abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("setContract(uint8,address)", 11, address(_newMainchainBridgeManager)))); calldatas[2] = abi.encodeWithSignature("changeAdmin(address)", address(_newMainchainBridgeManager)); calldatas[3] = abi.encodeWithSignature("upgradeTo(address)", pauseEnforcerLogic); calldatas[4] = abi.encodeWithSignature("changeAdmin(address)", address(_newMainchainBridgeManager)); - calldatas[5] = abi.encodeWithSignature("functionDelegateCall(bytes)", (abi.encodeWithSignature("registerCallbacks(address[])", param.mainchainBridgeManager.callbackRegisters))); + calldatas[5] = abi.encodeWithSignature( + "functionDelegateCall(bytes)", (abi.encodeWithSignature("registerCallbacks(address[])", param.mainchainBridgeManager.callbackRegisters)) + ); calldatas[6] = abi.encodeWithSignature("changeAdmin(address)", address(_newMainchainBridgeManager)); for (uint i; i < N; ++i) { @@ -191,7 +196,6 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is Migration, Migration__ ); } - function getDomain() public pure returns (bytes32) { return keccak256( abi.encode( diff --git a/script/PostChecker.sol b/script/PostChecker.sol index 383d5f65..eba216dc 100644 --- a/script/PostChecker.sol +++ b/script/PostChecker.sol @@ -20,7 +20,7 @@ contract PostChecker is Migration, PostCheck_BridgeManager, PostCheck_Gateway { function run() external { _loadSysContract(); - // _validate_BridgeManager(); + _validate_BridgeManager(); _validate_Gateway(); } From d1effffee9502ab6d7a86c80e391ac866938bc78 Mon Sep 17 00:00:00 2001 From: TuDo1403 Date: Tue, 16 Apr 2024 13:34:11 +0700 Subject: [PATCH 169/180] script: add relay upgrade post check --- .../PostCheck_BridgeManager_Proposal.s.sol | 66 ++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol b/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol index 80c7d243..28bafda8 100644 --- a/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol +++ b/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol @@ -26,6 +26,7 @@ abstract contract PostCheck_BridgeManager_Proposal is BasePostCheck { address[] private _addingOperators = [makeAddr("operator-1"), makeAddr("operator-2")]; function _validate_BridgeManager_Proposal() internal { + validate_relayUpgradeProposal(); validate_ProposeGlobalProposalAndRelay_addBridgeOperator(); validate_proposeAndRelay_addBridgeOperator(); validate_canExecuteUpgradeSingleProposal(); @@ -107,6 +108,69 @@ abstract contract PostCheck_BridgeManager_Proposal is BasePostCheck { } } + function validate_relayUpgradeProposal() private onPostCheck("validate_relayUpgradeProposal") { + TNetwork currentNetwork = CONFIG.getCurrentNetwork(); + (, TNetwork companionNetwork) = currentNetwork.companionNetworkData(); + + CONFIG.createFork(companionNetwork); + CONFIG.switchTo(companionNetwork); + + MainchainBridgeManager mainchainManager = MainchainBridgeManager(loadContract(Contract.MainchainBridgeManager.key())); + + uint256 snapshotId = vm.snapshot(); + + // Cheat add governor + { + cheatAddOverWeightedGovernor(address(mainchainManager)); + + address[] memory targets = new address[](2); + uint256[] memory values = new uint256[](2); + uint256[] memory gasAmounts = new uint256[](2); + bytes[] memory calldatas = new bytes[](2); + address[] memory logics = new address[](2); + + targets[0] = address(mainchainManager); + targets[1] = loadContract(Contract.MainchainGatewayV3.key()); + + logics[0] = _deployLogic(Contract.MainchainBridgeManager.key()); + logics[1] = _deployLogic(Contract.MainchainGatewayV3.key()); + + calldatas[0] = abi.encodeCall(TransparentUpgradeableProxy.upgradeTo, (logics[0])); + calldatas[1] = abi.encodeCall(TransparentUpgradeableProxy.upgradeTo, (logics[1])); + + gasAmounts[0] = 1_000_000; + gasAmounts[1] = 1_000_000; + + Proposal.ProposalDetail memory proposal = LibProposal.createProposal({ + manager: address(mainchainManager), + expiryTimestamp: block.timestamp + 20 minutes, + targets: targets, + values: values, + calldatas: calldatas, + gasAmounts: gasAmounts, + nonce: mainchainManager.round(block.chainid) + 1 + }); + + SignatureConsumer.Signature[] memory signatures = proposal.generateSignatures(cheatGovernorPk.toSingletonArray(), Ballot.VoteType.For); + Ballot.VoteType[] memory _supports = new Ballot.VoteType[](signatures.length); + + uint256 minimumForVoteWeight = mainchainManager.minimumVoteWeight(); + uint256 totalForVoteWeight = mainchainManager.getGovernorWeight(cheatGovernor); + console.log("Total for vote weight:", totalForVoteWeight); + console.log("Minimum for vote weight:", minimumForVoteWeight); + + vm.prank(cheatGovernor); + mainchainManager.relayProposal(proposal, _supports, signatures); + + assertEq(payable(address(mainchainManager)).getProxyImplementation(), logics[0], "MainchainBridgeManager logic is not upgraded"); + assertEq(loadContract(Contract.MainchainGatewayV3.key()).getProxyImplementation(), logics[1], "MainchainGatewayV3 logic is not upgraded"); + } + + bool reverted = vm.revertTo(snapshotId); + assertTrue(reverted, "Cannot revert to snapshot id"); + CONFIG.switchTo(currentNetwork); + } + function validate_ProposeGlobalProposalAndRelay_addBridgeOperator() private onlyOnRoninNetworkOrLocal @@ -125,7 +189,7 @@ abstract contract PostCheck_BridgeManager_Proposal is BasePostCheck { calldatas: abi.encodeCall( TransparentUpgradeableProxyV2.functionDelegateCall, (abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators))) - ).toSingletonArray(), + ).toSingletonArray(), gasAmounts: uint256(1_000_000).toSingletonArray(), nonce: manager.round(0) + 1 }); From 4ad3d48278160d797bf6d84c10fa73b3c06c299f Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 16 Apr 2024 13:46:16 +0700 Subject: [PATCH 170/180] script: add pause enforcer to the post check --- .../PostCheck_BridgeManager_Proposal.s.sol | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol b/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol index 28bafda8..0bff45bb 100644 --- a/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol +++ b/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol @@ -123,23 +123,27 @@ abstract contract PostCheck_BridgeManager_Proposal is BasePostCheck { { cheatAddOverWeightedGovernor(address(mainchainManager)); - address[] memory targets = new address[](2); - uint256[] memory values = new uint256[](2); - uint256[] memory gasAmounts = new uint256[](2); - bytes[] memory calldatas = new bytes[](2); - address[] memory logics = new address[](2); + address[] memory targets = new address[](3); + uint256[] memory values = new uint256[](3); + uint256[] memory gasAmounts = new uint256[](3); + bytes[] memory calldatas = new bytes[](3); + address[] memory logics = new address[](3); targets[0] = address(mainchainManager); targets[1] = loadContract(Contract.MainchainGatewayV3.key()); + targets[2] = loadContract(Contract.MainchainPauseEnforcer.key()); logics[0] = _deployLogic(Contract.MainchainBridgeManager.key()); logics[1] = _deployLogic(Contract.MainchainGatewayV3.key()); + logics[2] = _deployLogic(Contract.MainchainPauseEnforcer.key()); calldatas[0] = abi.encodeCall(TransparentUpgradeableProxy.upgradeTo, (logics[0])); calldatas[1] = abi.encodeCall(TransparentUpgradeableProxy.upgradeTo, (logics[1])); + calldatas[2] = abi.encodeCall(TransparentUpgradeableProxy.upgradeTo, (logics[2])); gasAmounts[0] = 1_000_000; gasAmounts[1] = 1_000_000; + gasAmounts[2] = 1_000_000; Proposal.ProposalDetail memory proposal = LibProposal.createProposal({ manager: address(mainchainManager), @@ -164,6 +168,7 @@ abstract contract PostCheck_BridgeManager_Proposal is BasePostCheck { assertEq(payable(address(mainchainManager)).getProxyImplementation(), logics[0], "MainchainBridgeManager logic is not upgraded"); assertEq(loadContract(Contract.MainchainGatewayV3.key()).getProxyImplementation(), logics[1], "MainchainGatewayV3 logic is not upgraded"); + assertEq(loadContract(Contract.MainchainPauseEnforcer.key()).getProxyImplementation(), logics[2], "MainchainPauseEnforcer logic is not upgraded"); } bool reverted = vm.revertTo(snapshotId); @@ -256,11 +261,12 @@ abstract contract PostCheck_BridgeManager_Proposal is BasePostCheck { function validate_canExcuteUpgradeAllOneProposal() private onlyOnRoninNetworkOrLocal onPostCheck("validate_canExcuteUpgradeAllOneProposal") { RoninBridgeManager manager = RoninBridgeManager(loadContract(Contract.RoninBridgeManager.key())); - TContract[] memory contractTypes = new TContract[](4); + TContract[] memory contractTypes = new TContract[](5); contractTypes[0] = Contract.BridgeSlash.key(); contractTypes[1] = Contract.BridgeReward.key(); contractTypes[2] = Contract.BridgeTracking.key(); contractTypes[3] = Contract.RoninGatewayV3.key(); + contractTypes[4] = Contract.RoninPauseEnforcer.key(); address[] memory targets = new address[](contractTypes.length); for (uint256 i; i < contractTypes.length; ++i) { From 299b38b8dd4b149fd20af6380313f2a76d09a3b5 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 16 Apr 2024 11:14:52 +0700 Subject: [PATCH 171/180] chore: add RoninBridgeManager artifact --- .../RoninBridgeManagerConstructorLogic.json | 2113 ++++++++++++ .../RoninBridgeManagerConstructorProxy.json | 218 ++ .../RoninBridgeManagerLogic.json | 2952 +++++++++++++++++ 3 files changed, 5283 insertions(+) create mode 100644 deployments/ronin-testnet/RoninBridgeManagerConstructorLogic.json create mode 100644 deployments/ronin-testnet/RoninBridgeManagerConstructorProxy.json create mode 100644 deployments/ronin-testnet/RoninBridgeManagerLogic.json diff --git a/deployments/ronin-testnet/RoninBridgeManagerConstructorLogic.json b/deployments/ronin-testnet/RoninBridgeManagerConstructorLogic.json new file mode 100644 index 00000000..7541daf9 --- /dev/null +++ b/deployments/ronin-testnet/RoninBridgeManagerConstructorLogic.json @@ -0,0 +1,2113 @@ +{ + "abi": [ + { + "type": "function", + "name": "DOMAIN_SEPARATOR", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "addBridgeOperators", + "inputs": [ + { + "name": "voteWeights", + "type": "uint96[]", + "internalType": "uint96[]" + }, + { + "name": "governors", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "bridgeOperators", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "checkThreshold", + "inputs": [ + { + "name": "voteWeight", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getBridgeOperatorWeight", + "inputs": [ + { + "name": "bridgeOperator", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "weight", + "type": "uint96", + "internalType": "uint96" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getBridgeOperators", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address[]", + "internalType": "address[]" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getCallbackRegisters", + "inputs": [], + "outputs": [ + { + "name": "registers", + "type": "address[]", + "internalType": "address[]" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getContract", + "inputs": [ + { + "name": "contractType", + "type": "uint8", + "internalType": "enum ContractType" + } + ], + "outputs": [ + { + "name": "contract_", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getFullBridgeOperatorInfos", + "inputs": [], + "outputs": [ + { + "name": "governors", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "bridgeOperators", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "weights", + "type": "uint96[]", + "internalType": "uint96[]" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getGlobalProposalSignatures", + "inputs": [ + { + "name": "round_", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "voters", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "supports_", + "type": "uint8[]", + "internalType": "enum Ballot.VoteType[]" + }, + { + "name": "signatures", + "type": "tuple[]", + "internalType": "struct SignatureConsumer.Signature[]", + "components": [ + { + "name": "v", + "type": "uint8", + "internalType": "uint8" + }, + { + "name": "r", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "s", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getGovernorOf", + "inputs": [ + { + "name": "operator", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "governor", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getGovernorWeight", + "inputs": [ + { + "name": "governor", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "weight", + "type": "uint96", + "internalType": "uint96" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getGovernorWeights", + "inputs": [ + { + "name": "governors", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [ + { + "name": "weights", + "type": "uint96[]", + "internalType": "uint96[]" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getGovernors", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address[]", + "internalType": "address[]" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getOperatorOf", + "inputs": [ + { + "name": "governor", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "operator", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getProposalSignatures", + "inputs": [ + { + "name": "_chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_round", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "_voters", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "_supports", + "type": "uint8[]", + "internalType": "enum Ballot.VoteType[]" + }, + { + "name": "_signatures", + "type": "tuple[]", + "internalType": "struct SignatureConsumer.Signature[]", + "components": [ + { + "name": "v", + "type": "uint8", + "internalType": "uint8" + }, + { + "name": "r", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "s", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getThreshold", + "inputs": [], + "outputs": [ + { + "name": "num", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "denom", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getTotalWeight", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "globalProposalVoted", + "inputs": [ + { + "name": "round_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "voter", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "initialize", + "inputs": [ + { + "name": "num", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "denom", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "roninChainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiryDuration", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "bridgeContract", + "type": "address", + "internalType": "address" + }, + { + "name": "callbackRegisters", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "bridgeOperators", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "governors", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "voteWeights", + "type": "uint96[]", + "internalType": "uint96[]" + }, + { + "name": "targetOptions", + "type": "uint8[]", + "internalType": "enum GlobalProposal.TargetOption[]" + }, + { + "name": "targets", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "isBridgeOperator", + "inputs": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "minimumVoteWeight", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "proposalVoted", + "inputs": [ + { + "name": "_chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_round", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_voter", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "registerCallbacks", + "inputs": [ + { + "name": "registers", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "removeBridgeOperators", + "inputs": [ + { + "name": "bridgeOperators", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "resolveTargets", + "inputs": [ + { + "name": "targetOptions", + "type": "uint8[]", + "internalType": "enum GlobalProposal.TargetOption[]" + } + ], + "outputs": [ + { + "name": "targets", + "type": "address[]", + "internalType": "address[]" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "round", + "inputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "setContract", + "inputs": [ + { + "name": "contractType", + "type": "uint8", + "internalType": "enum ContractType" + }, + { + "name": "addr", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "setMinRequiredGovernor", + "inputs": [ + { + "name": "min", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "setThreshold", + "inputs": [ + { + "name": "num", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "denom", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "sumGovernorsWeight", + "inputs": [ + { + "name": "governors", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [ + { + "name": "sum", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "totalBridgeOperator", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "unregisterCallbacks", + "inputs": [ + { + "name": "registers", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "updateManyTargetOption", + "inputs": [ + { + "name": "targetOptions", + "type": "uint8[]", + "internalType": "enum GlobalProposal.TargetOption[]" + }, + { + "name": "targets", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "vote", + "inputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "status", + "type": "uint8", + "internalType": "enum VoteStatusConsumer.VoteStatus" + }, + { + "name": "hash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "againstVoteWeight", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "forVoteWeight", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiryTimestamp", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "event", + "name": "BridgeOperatorAddingFailed", + "inputs": [ + { + "name": "operator", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "BridgeOperatorRemovingFailed", + "inputs": [ + { + "name": "operator", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "BridgeOperatorUpdated", + "inputs": [ + { + "name": "governor", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "fromBridgeOperator", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "toBridgeOperator", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "BridgeOperatorsAdded", + "inputs": [ + { + "name": "statuses", + "type": "bool[]", + "indexed": false, + "internalType": "bool[]" + }, + { + "name": "voteWeights", + "type": "uint96[]", + "indexed": false, + "internalType": "uint96[]" + }, + { + "name": "governors", + "type": "address[]", + "indexed": false, + "internalType": "address[]" + }, + { + "name": "bridgeOperators", + "type": "address[]", + "indexed": false, + "internalType": "address[]" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "BridgeOperatorsRemoved", + "inputs": [ + { + "name": "statuses", + "type": "bool[]", + "indexed": false, + "internalType": "bool[]" + }, + { + "name": "bridgeOperators", + "type": "address[]", + "indexed": false, + "internalType": "address[]" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "CallbackRegistered", + "inputs": [ + { + "name": "", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "", + "type": "bool", + "indexed": false, + "internalType": "bool" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ContractUpdated", + "inputs": [ + { + "name": "contractType", + "type": "uint8", + "indexed": true, + "internalType": "enum ContractType" + }, + { + "name": "addr", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "GlobalProposalCreated", + "inputs": [ + { + "name": "round", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "proposalHash", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "proposal", + "type": "tuple", + "indexed": false, + "internalType": "struct Proposal.ProposalDetail", + "components": [ + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiryTimestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "executor", + "type": "address", + "internalType": "address" + }, + { + "name": "targets", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "values", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "calldatas", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "gasAmounts", + "type": "uint256[]", + "internalType": "uint256[]" + } + ] + }, + { + "name": "globalProposalHash", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + }, + { + "name": "globalProposal", + "type": "tuple", + "indexed": false, + "internalType": "struct GlobalProposal.GlobalProposalDetail", + "components": [ + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiryTimestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "executor", + "type": "address", + "internalType": "address" + }, + { + "name": "targetOptions", + "type": "uint8[]", + "internalType": "enum GlobalProposal.TargetOption[]" + }, + { + "name": "values", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "calldatas", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "gasAmounts", + "type": "uint256[]", + "internalType": "uint256[]" + } + ] + }, + { + "name": "creator", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Initialized", + "inputs": [ + { + "name": "version", + "type": "uint8", + "indexed": false, + "internalType": "uint8" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "MinRequiredGovernorUpdated", + "inputs": [ + { + "name": "min", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Notified", + "inputs": [ + { + "name": "callData", + "type": "bytes", + "indexed": false, + "internalType": "bytes" + }, + { + "name": "registers", + "type": "address[]", + "indexed": false, + "internalType": "address[]" + }, + { + "name": "statuses", + "type": "bool[]", + "indexed": false, + "internalType": "bool[]" + }, + { + "name": "returnDatas", + "type": "bytes[]", + "indexed": false, + "internalType": "bytes[]" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ProposalApproved", + "inputs": [ + { + "name": "proposalHash", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ProposalCreated", + "inputs": [ + { + "name": "chainId", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "round", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "proposalHash", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "proposal", + "type": "tuple", + "indexed": false, + "internalType": "struct Proposal.ProposalDetail", + "components": [ + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiryTimestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "executor", + "type": "address", + "internalType": "address" + }, + { + "name": "targets", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "values", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "calldatas", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "gasAmounts", + "type": "uint256[]", + "internalType": "uint256[]" + } + ] + }, + { + "name": "creator", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ProposalExecuted", + "inputs": [ + { + "name": "proposalHash", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "successCalls", + "type": "bool[]", + "indexed": false, + "internalType": "bool[]" + }, + { + "name": "returnDatas", + "type": "bytes[]", + "indexed": false, + "internalType": "bytes[]" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ProposalExpired", + "inputs": [ + { + "name": "proposalHash", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ProposalExpiryDurationChanged", + "inputs": [ + { + "name": "duration", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ProposalRejected", + "inputs": [ + { + "name": "proposalHash", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ProposalVoted", + "inputs": [ + { + "name": "proposalHash", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "voter", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "support", + "type": "uint8", + "indexed": false, + "internalType": "enum Ballot.VoteType" + }, + { + "name": "weight", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "TargetOptionUpdated", + "inputs": [ + { + "name": "targetOption", + "type": "uint8", + "indexed": true, + "internalType": "enum GlobalProposal.TargetOption" + }, + { + "name": "addr", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ThresholdUpdated", + "inputs": [ + { + "name": "nonce", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "numerator", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "denominator", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "previousNumerator", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "previousDenominator", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "ErrBelowMinRequiredGovernors", + "inputs": [] + }, + { + "type": "error", + "name": "ErrContractTypeNotFound", + "inputs": [ + { + "name": "contractType", + "type": "uint8", + "internalType": "enum ContractType" + } + ] + }, + { + "type": "error", + "name": "ErrCurrentProposalIsNotCompleted", + "inputs": [] + }, + { + "type": "error", + "name": "ErrDuplicated", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrExistOneInternalCallFailed", + "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address" + }, + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + }, + { + "name": "callData", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "type": "error", + "name": "ErrGovernorNotFound", + "inputs": [ + { + "name": "governor", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ErrGovernorNotMatch", + "inputs": [ + { + "name": "required", + "type": "address", + "internalType": "address" + }, + { + "name": "sender", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ErrInvalidArguments", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrInvalidInput", + "inputs": [] + }, + { + "type": "error", + "name": "ErrInvalidThreshold", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrInvalidVoteWeight", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrLengthMismatch", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrOnlySelfCall", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrOperatorNotFound", + "inputs": [ + { + "name": "operator", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ErrUnauthorized", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + }, + { + "name": "expectedRole", + "type": "uint8", + "internalType": "enum RoleAccess" + } + ] + }, + { + "type": "error", + "name": "ErrUnsupportedInterface", + "inputs": [ + { + "name": "interfaceId", + "type": "bytes4", + "internalType": "bytes4" + }, + { + "name": "addr", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ErrVoteIsFinalized", + "inputs": [] + }, + { + "type": "error", + "name": "ErrZeroAddress", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrZeroCodeContract", + "inputs": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + } + ] + } + ], + "address": "0xD05A72c0A593983Aa8336C997736e2172E745fF1", + "args": "0x", + "ast": "", + "blockNumber": 26511796, + "bytecode": "0x60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61398280620000f46000396000f3fe608060405234801561001057600080fd5b50600436106101965760003560e01c806301a5f43f1461019b57806306aba0e1146101b05780630a44fa43146101cb5780630f7c3189146101de5780631c905e39146101f35780631f425338146102155780632c5e6520146102285780632d6d7d731461024b57806334d5f37b1461025e57806335da81211461027e5780633644e515146102915780637d4c1d781461029a5780637de5dedd146102ad5780637f7fe058146102b5578063800eaab3146102d5578063828fc1a1146102e8578063865e6fd3146102fb578063901979d51461030e5780639b19dbfd14610339578063a64a838014610341578063aee1767f14610354578063b384abef14610367578063b405aaf2146103c2578063b9c36209146103d5578063bc4e068f146103e8578063c441c4a8146103fb578063cc7e6b3b14610412578063d0a50db014610432578063d78392f81461043a578063dafae4081461044d578063de981f1b14610460578063e75235b814610473578063e9c0349814610490578063f80b5352146104a3575b600080fd5b6101ae6101a9366004612d91565b6104ab565b005b6101b861055a565b6040519081526020015b60405180910390f35b6101b86101d9366004612e2a565b610569565b6101e66105ee565b6040516101c29190612eb0565b610206610201366004612ec3565b610600565b6040516101c293929190612efb565b6101ae610223366004612e2a565b61061c565b61023b610236366004612fce565b6106bb565b60405190151581526020016101c2565b6101e6610259366004612e2a565b6106c8565b6101b861026c366004613003565b60026020526000908152604090205481565b6101ae61028c366004612e2a565b61070f565b6101b860015481565b6101ae6102a83660046131dd565b610757565b6101b8610893565b6102c86102c3366004613317565b6108e9565b6040516101c29190613332565b6101ae6102e3366004613346565b61095c565b61023b6102f63660046133a9565b610994565b6101ae6103093660046133e4565b6109a2565b61032161031c366004613317565b6109bd565b6040516001600160601b0390911681526020016101c2565b6101e66109f3565b6101ae61034f366004613003565b610a5e565b6102c8610362366004613317565b610a72565b6103b1610375366004612ec3565b600360208181526000938452604080852090915291835291208054600182015460028301549383015460069093015460ff909216939092909185565b6040516101c295949392919061340e565b61023b6103d0366004613317565b610a84565b6101ae6103e3366004612ec3565b610abc565b6102066103f6366004613003565b610ace565b610403610aeb565b6040516101c29392919061347d565b610425610420366004612e2a565b610bc5565b6040516101c291906134c0565b6101b8610c03565b610321610448366004613317565b610c16565b61023b61045b366004613003565b610c21565b6102c861046e3660046134d3565b610c5d565b61047b610cbf565b604080519283526020830191909152016101c2565b6101ae61049e366004612e2a565b610ce1565b6101e6610d2a565b6104b3610d8d565b61055186868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808a0282810182019093528982529093508992508891829185019084908082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250610de992505050565b50505050505050565b600061056461114b565b905090565b60008282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506105aa925083915061115e9050565b6105e684848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061119392505050565b949350505050565b60606105646105fb611218565b61123c565b606080606061060f8585611250565b9250925092509250925092565b610624610d8d565b818180806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610663925083915061115e9050565b600061066d611218565b905060005b838110156106b4576106ab85858381811061068f5761068f6134ee565b90506020020160208101906106a49190613317565b8390611639565b50600101610672565b5050505050565b60006105e684848461164e565b606061070683838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250611684915050565b90505b92915050565b610717610d8d565b6107538282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506117d792505050565b5050565b600054610100900460ff16158080156107775750600054600160ff909116105b806107915750303b158015610791575060005460ff166001145b6107f95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff19166001179055801561081c576000805461ff0019166101001790555b61082589611892565b61082f83836118c2565b61083f8c8c8c8b8b8b8b8b6118f3565b8015610885576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050505050565b60008061089e611944565b90506000806108ab610cbf565b91509150806001828560040154856108c3919061351a565b6108cd9190613531565b6108d79190613544565b6108e19190613557565b935050505090565b60008060006108ff6108f9611944565b85611968565b9150915081610923578360405163141e2e1f60e11b81526004016107f09190613332565b61092b611944565b600101818154811061093f5761093f6134ee565b6000918252602090912001546001600160a01b0316949350505050565b33301461098a576000356001600160e01b0319166040516307337e1960e41b81526004016107f09190613579565b61075382826119cd565b60006107066000848461164e565b6109aa610d8d565b6109b381611a76565b6107538282611aa3565b6000806109c8611944565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b031690565b60606109fd611944565b600101805480602002602001604051908101604052809291908181526020018280548015610a5457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610a36575b5050505050905090565b610a66610d8d565b610a6f81611b2e565b50565b6000610a7d82611b9b565b5092915050565b600080610a8f611944565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b0316151590565b610ac4610d8d565b6107538282611c12565b6060806060610ade600085611250565b9250925092509193909250565b60608060606000610afa611944565b805460408051602080840282018101909252828152929350839190830182828015610b4e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b30575b5050505050935080600101805480602002602001604051908101604052809291908181526020018280548015610bad57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b8f575b50505050509250610bbd84611cc4565b915050909192565b6060610706838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611cc492505050565b6000610c0d611944565b60010154919050565b600061070982611db0565b600080610c2c611de5565b9050610c3661114b565b8160010154610c45919061351a565b6002820154610c54908561351a565b10159392505050565b6000610c67611e09565b600083600f811115610c7b57610c7b612ee5565b60ff1681526020810191909152604001600020546001600160a01b0316905080610cba578160405163409140df60e11b81526004016107f0919061358e565b919050565b6000806000610ccc611de5565b90508060010154816002015492509250509091565b610ce9610d8d565b610d25828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611e2d92505050565b505050565b6060610d34611944565b805460408051602080840282018101909252828152929190830182828015610a54576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610a36575050505050905090565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610de7576000356001600160e01b0319166001604051620f948f60ea1b81526004016107f09291906135a8565b565b6060610df58383612213565b610dfe8161115e565b6000610e08611944565b845187519192509081148015610e1e5750855181145b610e49576000356001600160e01b0319166040516306b5667560e21b81526004016107f09190613579565b806001600160401b03811115610e6157610e6161301c565b604051908082528060200260200182016040528015610e8a578160200160208202803683370190505b50935080600003610e9c575050611143565b60008060008060005b858110156110af578a8181518110610ebf57610ebf6134ee565b60200260200101519450898181518110610edb57610edb6134ee565b602002602001015193508b8181518110610ef757610ef76134ee565b60200260200101519250610f0a8561231d565b610f138461231d565b826001600160601b0316600003610f4b576000356001600160e01b031916604051637f11b8a360e11b81526004016107f09190613579565b6001600160a01b03808616600081815260038a01602090815260408083205494891683528083205460028d0190925280832054938352909120546001600160601b039384169391821692610fa39290811691166135d6565b610fad91906135d6565b610fb791906135d6565b6001600160601b0316600014898281518110610fd557610fd56134ee565b602002602001019015159081151581525050888181518110610ff957610ff96134ee565b6020026020010151156110a7578654600181810189556000898152602080822090930180546001600160a01b03808b166001600160a01b0319928316811790935591835260028c018552604080842080546001600160601b038b166001600160601b03199182168117909255868f018054978801815586528786209096018054948c1694909316841790925591835260038c0190945290208054909116821790556110a49083613531565b91505b600101610ea5565b50808660040160008282546110c49190613531565b90915550506040516110ff906347c28ec560e11b906110eb908c908f908d90602001613629565b604051602081830303815290604052612352565b7f897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b78888c8c8c6040516111349493929190613662565b60405180910390a15050505050505b509392505050565b6000611155611944565b60040154905090565b6111678161237f565b15610a6f576000356001600160e01b031916604051630d697db160e11b81526004016107f09190613579565b60008161119f8161115e565b60006111a9611944565b905060005b8451811015611210578160020160008683815181106111cf576111cf6134ee565b6020908102919091018101516001600160a01b0316825281019190915260400160002054611206906001600160601b031685613531565b93506001016111ae565b505050919050565b7f5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd97624090565b606060006112498361241e565b9392505050565b600082815260036020908152604080832084845290915281206004810154600582015460609384938493909290916112888284613531565b9050806001600160401b038111156112a2576112a261301c565b6040519080825280602002602001820160405280156112cb578160200160208202803683370190505b509550806001600160401b038111156112e6576112e661301c565b60405190808252806020026020018201604052801561133157816020015b60408051606081018252600080825260208083018290529282015282526000199092019101816113045790505b509450806001600160401b0381111561134c5761134c61301c565b604051908082528060200260200182016040528015611375578160200160208202803683370190505b50965060005b838110156114ca576000878281518110611397576113976134ee565b602002602001019060018111156113b0576113b0612ee5565b908160018111156113c3576113c3612ee5565b90525060008a81526003602090815260408083208c8452909152812060048701805460079092019291849081106113fc576113fc6134ee565b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815460ff1681526001820154938101939093526002015490820152865187908390811061145a5761145a6134ee565b602002602001018190525084600401818154811061147a5761147a6134ee565b9060005260206000200160009054906101000a90046001600160a01b03168882815181106114aa576114aa6134ee565b6001600160a01b039092166020928302919091019091015260010161137b565b5060005b8281101561162d576001876114e38684613531565b815181106114f3576114f36134ee565b6020026020010190600181111561150c5761150c612ee5565b9081600181111561151f5761151f612ee5565b90525060008a81526003602090815260408083208c845290915281206005870180546007909201929184908110611558576115586134ee565b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815460ff1681526001820154938101939093526002015490820152866115ad8684613531565b815181106115bd576115bd6134ee565b60200260200101819052508460050181815481106115dd576115dd6134ee565b6000918252602090912001546001600160a01b0316886115fd8684613531565b8151811061160d5761160d6134ee565b6001600160a01b03909216602092830291909101909101526001016114ce565b50505050509250925092565b6000610706836001600160a01b03841661247a565b600083815260036020908152604080832085845282528083206001600160a01b038516845260080190915281205460ff166105e6565b606082516001600160401b0381111561169f5761169f61301c565b6040519080825280602002602001820160405280156116c8578160200160208202803683370190505b50905060005b8351811015610a7d57600560008583815181106116ed576116ed6134ee565b6020026020010151600581111561170657611706612ee5565b600581111561171757611717612ee5565b815260200190815260200160002060009054906101000a90046001600160a01b031682828151811061174b5761174b6134ee565b60200260200101906001600160a01b031690816001600160a01b0316815250508280156117a3575060006001600160a01b0316828281518110611790576117906134ee565b60200260200101516001600160a01b0316145b156117cf576000356001600160e01b03191660405163053265f160e01b81526004016107f09190613579565b6001016116ce565b806117e18161115e565b60006117eb611218565b905060008060005b855181101561188a5785818151811061180e5761180e6134ee565b6020026020010151925061182183611a76565b611832836312c0151560e21b61256d565b61183c8484612700565b604080516001600160a01b038616815282151560208201529193507fb85c58eeff9fe423669ae0841666f4c8499e8731b8275eb462e4fa1720ec420e910160405180910390a16001016117f3565b505050505050565b600054610100900460ff166118b95760405162461bcd60e51b81526004016107f0906136ba565b610a6f81612715565b600054610100900460ff166118e95760405162461bcd60e51b81526004016107f0906136ba565b6107538282612745565b600054610100900460ff1661191a5760405162461bcd60e51b81526004016107f0906136ba565b6119248888612777565b61192d846127b8565b61193a86868585856127e8565b5050505050505050565b7fc648703095712c0419b6431ae642c061f0a105ac2d7c3d9604061ef4ebc3830090565b60008060005b84548110156119bb57848181548110611989576119896134ee565b6000918252602090912001546001600160a01b03908116908516036119b3576001925090506119c6565b60010161196e565b506000600019915091505b9250929050565b60005b8251811015610d2557306001600160a01b03168282815181106119f5576119f56134ee565b60200260200101516001600160a01b031603611a32576000356001600160e01b03191660405163053265f160e01b81526004016107f09190613579565b611a6e838281518110611a4757611a476134ee565b6020026020010151838381518110611a6157611a616134ee565b6020026020010151612912565b6001016119d0565b806001600160a01b03163b600003610a6f5780604051630bfc64a360e21b81526004016107f09190613332565b80611aac611e09565b600084600f811115611ac057611ac0612ee5565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115611b0157611b01612ee5565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b6003811015611b50576040516305f4dee960e31b815260040160405180910390fd5b6000611b5a611944565b600581018390556040518381529091507f22d5bb5059ffe2949a098666fc198587200c8118483074120d3ca7050c7753f19060200160405180910390a15050565b600080600080611bb5611bac611944565b60010186611968565b9150915081611bd957846040516326527e1760e01b81526004016107f09190613332565b611be1611944565b805482908110611bf357611bf36134ee565b6000918252602090912001546001600160a01b03169590945092505050565b80821180611c21575060018111155b15611c4d576000356001600160e01b0319166040516387f6f09560e01b81526004016107f09190613579565b6000611c57611de5565b6001810180546002830180549287905585905582549293509184908690856000611c8083613705565b9091555060408051868152602081018690527f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a45050505050565b60606000611cd0611944565b905082516001600160401b03811115611ceb57611ceb61301c565b604051908082528060200260200182016040528015611d14578160200160208202803683370190505b50915060005b8351811015611da957816002016000858381518110611d3b57611d3b6134ee565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160601b0316838281518110611d8957611d896134ee565b6001600160601b0390921660209283029190910190910152600101611d1a565b5050919050565b6000611dba611944565b6001600160a01b0390921660009081526002929092016020525060409020546001600160601b031690565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f0090565b7fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb90565b606081611e398161115e565b6000611e43611944565b8451909150806001600160401b03811115611e6057611e6061301c565b604051908082528060200260200182016040528015611e89578160200160208202803683370190505b50935080600003611e9b57505061220d565b60058201548254611ead908390613544565b1015611ecc5760405163b2e765cb60e01b815260040160405180910390fd5b60008060008060005b8581101561219357898181518110611eef57611eef6134ee565b60200260200101519350611f0284611b9b565b9095509150611f108561231d565b611f198461231d565b6001600160a01b03851660009081526002880160205260409020546001600160601b031615801590611f6d57506001600160a01b03841660009081526003880160205260409020546001600160601b031615155b898281518110611f7f57611f7f6134ee565b602002602001019015159081151581525050888181518110611fa357611fa36134ee565b60200260200101511561218b576001600160a01b038516600090815260028801602052604081205488546001600160601b039091169190611fe690600190613544565b9050886000018181548110611ffd57611ffd6134ee565b60009182526020909120015489546001600160a01b03909116908a9086908110612029576120296134ee565b600091825260209091200180546001600160a01b0319166001600160a01b039290921691909117905588548990806120635761206361371e565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038916825260028b0190526040902080546001600160601b0319169055600189018054829081106120c3576120c36134ee565b60009182526020909120015460018a0180546001600160a01b0390921691869081106120f1576120f16134ee565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550886001018054806121325761213261371e565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038816825260038b0190526040902080546001600160601b03191690556121868286613531565b945050505b600101611ed5565b50818660040160008282546121a89190613544565b90915550506040516121cd90636242a4ef60e11b906110eb908c908c90602001613734565b7fdf3dcd7987202f64648f3acdbf12401e3a2bb23e77e19f99826b5475cbb86369888a6040516121fe929190613762565b60405180910390a15050505050505b50919050565b81518151606091908082016001600160401b038111156122355761223561301c565b60405190808252806020026020018201604052801561225e578160200160208202803683370190505b50925060005b828110156122b85785818151811061227e5761227e6134ee565b6020026020010151848281518110612298576122986134ee565b6001600160a01b0390921660209283029190910190910152600101612264565b60005b82811015612313578581815181106122d5576122d56134ee565b60200260200101518583815181106122ef576122ef6134ee565b6001600160a01b0390921660209283029190910190910152600191820191016122bb565b5050505092915050565b6001600160a01b038116610a6f576000356001600160e01b03191660405163104c66df60e31b81526004016107f09190613579565b61235c82826129a5565b610753573382826040516319b5fdcb60e31b81526004016107f0939291906137d7565b6000815160000361239257506000919050565b60005b600183510381101561241557600181015b835181101561240c578381815181106123c1576123c16134ee565b60200260200101516001600160a01b03168483815181106123e4576123e46134ee565b60200260200101516001600160a01b031603612404575060019392505050565b6001016123a6565b50600101612395565b50600092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561246e57602002820191906000526020600020905b81548152602001906001019080831161245a575b50505050509050919050565b6000818152600183016020526040812054801561256357600061249e600183613544565b85549091506000906124b290600190613544565b90508181146125175760008660000182815481106124d2576124d26134ee565b90600052602060002001549050808760000184815481106124f5576124f56134ee565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806125285761252861371e565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610709565b6000915050610709565b6000816040516024016125809190613579565b60408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b1790525190915060009081906001600160a01b038616906125c990859061380b565b600060405180830381855afa9150503d8060008114612604576040519150601f19603f3d011682016040523d82523d6000602084013e612609565b606091505b5091509150816126cb57846001600160a01b03168360405160240161262e9190613827565b60408051601f198184030181529181526020820180516001600160e01b03166325da93a560e11b17905251612663919061380b565b600060405180830381855afa9150503d806000811461269e576040519150601f19603f3d011682016040523d82523d6000602084013e6126a3565b606091505b509092509050816126cb57838560405163069d427960e11b81526004016107f092919061383a565b808060200190518101906126df919061385d565b6106b457838560405163069d427960e11b81526004016107f092919061383a565b6000610706836001600160a01b038416612ccb565b600054610100900460ff1661273c5760405162461bcd60e51b81526004016107f0906136ba565b610a6f81612d1a565b600054610100900460ff1661276c5760405162461bcd60e51b81526004016107f0906136ba565b61098a600030612912565b600054610100900460ff1661279e5760405162461bcd60e51b81526004016107f0906136ba565b60006127a8611de5565b600181559050610d258383611c12565b600054610100900460ff166127df5760405162461bcd60e51b81526004016107f0906136ba565b610a6f816117d7565b600054610100900460ff1661280f5760405162461bcd60e51b81526004016107f0906136ba565b61281a600285611aa3565b604080516020808201839052600e60608301526d212924a223a2afa6a0a720a3a2a960911b6080808401919091528284018990528351808403909101815260a0830184528051908201207f599a80fcaa47b95e2323ab4d34d34e0cc9feda4b843edafcc30c7bdf60ea15bf60c08401527fe4d2346818310a10fac5a6d073d3dce255578caf4aa81ddcbcc7c2b98405eef060e08401527f2a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4de61010084015261012080840191909152835180840390910181526101409092019092528051910120600155612907818385610de9565b506106b46003611b2e565b806005600084600581111561292957612929612ee5565b600581111561293a5761293a612ee5565b8152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600581111561297857612978612ee5565b6040517f356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d90600090a35050565b600160006129b46105fb611218565b805190915060008190036129c9575050610709565b6000816001600160401b038111156129e3576129e361301c565b604051908082528060200260200182016040528015612a0c578160200160208202803683370190505b5090506000826001600160401b03811115612a2957612a2961301c565b604051908082528060200260200182016040528015612a5c57816020015b6060815260200190600190039081612a475790505b50905060008787604051602001612a7492919061387f565b6040516020818303038152906040529050600081604051602401612a989190613827565b60408051601f198184030181529190526020810180516001600160e01b03166325da93a560e11b179052905060005b85811015612c8157868181518110612ae157612ae16134ee565b60200260200101516001600160a01b031683604051612b00919061380b565b6000604051808303816000865af19150503d8060008114612b3d576040519150601f19603f3d011682016040523d82523d6000602084013e612b42565b606091505b50868381518110612b5557612b556134ee565b60200260200101868481518110612b6e57612b6e6134ee565b6020026020010182905282151515158152505050848181518110612b9457612b946134ee565b6020026020010151612c7957868181518110612bb257612bb26134ee565b60200260200101516001600160a01b031682604051612bd1919061380b565b6000604051808303816000865af19150503d8060008114612c0e576040519150601f19603f3d011682016040523d82523d6000602084013e612c13565b606091505b50868381518110612c2657612c266134ee565b60200260200101868481518110612c3f57612c3f6134ee565b6020026020010182905282151515158152505050878015612c765750848181518110612c6d57612c6d6134ee565b60200260200101515b97505b600101612ac7565b507fc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b6382878686604051612cb794939291906138b0565b60405180910390a150505050505092915050565b6000818152600183016020526040812054612d1257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610709565b506000610709565b600481905560405181907fe5cd1c123a8cf63fa1b7229678db61fe8ae99dbbd27889370b6667c8cae97da190600090a250565b60008083601f840112612d5f57600080fd5b5081356001600160401b03811115612d7657600080fd5b6020830191508360208260051b85010111156119c657600080fd5b60008060008060008060608789031215612daa57600080fd5b86356001600160401b0380821115612dc157600080fd5b612dcd8a838b01612d4d565b90985096506020890135915080821115612de657600080fd5b612df28a838b01612d4d565b90965094506040890135915080821115612e0b57600080fd5b50612e1889828a01612d4d565b979a9699509497509295939492505050565b60008060208385031215612e3d57600080fd5b82356001600160401b03811115612e5357600080fd5b612e5f85828601612d4d565b90969095509350505050565b60008151808452602080850194506020840160005b83811015612ea55781516001600160a01b031687529582019590820190600101612e80565b509495945050505050565b6020815260006107066020830184612e6b565b60008060408385031215612ed657600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60006060808352612f0f6060840187612e6b565b83810360208581019190915286518083528782019282019060005b81811015612f5657845160028110612f4457612f44612ee5565b83529383019391830191600101612f2a565b50506040925085810360408701528087518083528383019150838901925060005b81811015612fa7578351805160ff1684528581015186850152860151868401529284019291860191600101612f77565b50909a9950505050505050505050565b80356001600160a01b0381168114610cba57600080fd5b600080600060608486031215612fe357600080fd5b8335925060208401359150612ffa60408501612fb7565b90509250925092565b60006020828403121561301557600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561305a5761305a61301c565b604052919050565b60006001600160401b0382111561307b5761307b61301c565b5060051b60200190565b600082601f83011261309657600080fd5b813560206130ab6130a683613062565b613032565b8083825260208201915060208460051b8701019350868411156130cd57600080fd5b602086015b848110156130f0576130e381612fb7565b83529183019183016130d2565b509695505050505050565b600082601f83011261310c57600080fd5b8135602061311c6130a683613062565b8083825260208201915060208460051b87010193508684111561313e57600080fd5b602086015b848110156130f05780356001600160601b03811681146131635760008081fd5b8352918301918301613143565b600082601f83011261318157600080fd5b813560206131916130a683613062565b8083825260208201915060208460051b8701019350868411156131b357600080fd5b602086015b848110156130f0578035600681106131d05760008081fd5b83529183019183016131b8565b60008060008060008060008060008060006101608c8e0312156131ff57600080fd5b8b359a5060208c0135995060408c0135985060608c0135975061322460808d01612fb7565b96506001600160401b0360a08d013581101561323f57600080fd5b61324f8e60a08f01358f01613085565b96508060c08e0135111561326257600080fd5b6132728e60c08f01358f01613085565b95508060e08e0135111561328557600080fd5b6132958e60e08f01358f01613085565b9450806101008e013511156132a957600080fd5b6132ba8e6101008f01358f016130fb565b9350806101208e013511156132ce57600080fd5b6132df8e6101208f01358f01613170565b9250806101408e013511156132f357600080fd5b506133058d6101408e01358e01613085565b90509295989b509295989b9093969950565b60006020828403121561332957600080fd5b61070682612fb7565b6001600160a01b0391909116815260200190565b6000806040838503121561335957600080fd5b82356001600160401b038082111561337057600080fd5b61337c86838701613170565b9350602085013591508082111561339257600080fd5b5061339f85828601613085565b9150509250929050565b600080604083850312156133bc57600080fd5b823591506133cc60208401612fb7565b90509250929050565b803560108110610cba57600080fd5b600080604083850312156133f757600080fd5b613400836133d5565b91506133cc60208401612fb7565b60a081016005871061342257613422612ee5565b95815260208101949094526040840192909252606083015260809091015290565b60008151808452602080850194506020840160005b83811015612ea55781516001600160601b031687529582019590820190600101613458565b6060815260006134906060830186612e6b565b82810360208401526134a28186612e6b565b905082810360408401526134b68185613443565b9695505050505050565b6020815260006107066020830184613443565b6000602082840312156134e557600080fd5b610706826133d5565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761070957610709613504565b8082018082111561070957610709613504565b8181038181111561070957610709613504565b60008261357457634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031991909116815260200190565b60208101601083106135a2576135a2612ee5565b91905290565b6001600160e01b03198316815260408101600b83106135c9576135c9612ee5565b8260208301529392505050565b6001600160601b03818116838216019080821115610a7d57610a7d613504565b60008151808452602080850194506020840160005b83811015612ea557815115158752958201959082019060010161360b565b60608152600061363c6060830186612e6b565b828103602084015261364e8186613443565b905082810360408401526134b681856135f6565b60808152600061367560808301876135f6565b82810360208401526136878187613443565b9050828103604084015261369b8186612e6b565b905082810360608401526136af8185612e6b565b979650505050505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60006001820161371757613717613504565b5060010190565b634e487b7160e01b600052603160045260246000fd5b6040815260006137476040830185612e6b565b828103602084015261375981856135f6565b95945050505050565b60408152600061377560408301856135f6565b82810360208401526137598185612e6b565b60005b838110156137a257818101518382015260200161378a565b50506000910152565b600081518084526137c3816020860160208601613787565b601f01601f19169290920160200192915050565b6001600160a01b03841681526001600160e01b031983166020820152606060408201819052600090613759908301846137ab565b6000825161381d818460208701613787565b9190910192915050565b60208152600061070660208301846137ab565b6001600160e01b03199290921682526001600160a01b0316602082015260400190565b60006020828403121561386f57600080fd5b8151801515811461124957600080fd5b6001600160e01b03198316815281516000906138a2816004850160208701613787565b919091016004019392505050565b6080815260006138c360808301876137ab565b6020838203818501526138d68288612e6b565b915083820360408501526138ea82876135f6565b915083820360608501528185518084528284019150828160051b85010183880160005b8381101561393b57601f198784030185526139298383516137ab565b9486019492509085019060010161390d565b50909b9a505050505050505050505056fea2646970667358221220d83003b43962afe3120b34eb387ecaaf4912a01d9c682ac0fb953cf65d90b77c64736f6c63430008170033", + "chainId": 2021, + "contractAbsolutePath": "RoninBridgeManagerConstructor.sol", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101965760003560e01c806301a5f43f1461019b57806306aba0e1146101b05780630a44fa43146101cb5780630f7c3189146101de5780631c905e39146101f35780631f425338146102155780632c5e6520146102285780632d6d7d731461024b57806334d5f37b1461025e57806335da81211461027e5780633644e515146102915780637d4c1d781461029a5780637de5dedd146102ad5780637f7fe058146102b5578063800eaab3146102d5578063828fc1a1146102e8578063865e6fd3146102fb578063901979d51461030e5780639b19dbfd14610339578063a64a838014610341578063aee1767f14610354578063b384abef14610367578063b405aaf2146103c2578063b9c36209146103d5578063bc4e068f146103e8578063c441c4a8146103fb578063cc7e6b3b14610412578063d0a50db014610432578063d78392f81461043a578063dafae4081461044d578063de981f1b14610460578063e75235b814610473578063e9c0349814610490578063f80b5352146104a3575b600080fd5b6101ae6101a9366004612d91565b6104ab565b005b6101b861055a565b6040519081526020015b60405180910390f35b6101b86101d9366004612e2a565b610569565b6101e66105ee565b6040516101c29190612eb0565b610206610201366004612ec3565b610600565b6040516101c293929190612efb565b6101ae610223366004612e2a565b61061c565b61023b610236366004612fce565b6106bb565b60405190151581526020016101c2565b6101e6610259366004612e2a565b6106c8565b6101b861026c366004613003565b60026020526000908152604090205481565b6101ae61028c366004612e2a565b61070f565b6101b860015481565b6101ae6102a83660046131dd565b610757565b6101b8610893565b6102c86102c3366004613317565b6108e9565b6040516101c29190613332565b6101ae6102e3366004613346565b61095c565b61023b6102f63660046133a9565b610994565b6101ae6103093660046133e4565b6109a2565b61032161031c366004613317565b6109bd565b6040516001600160601b0390911681526020016101c2565b6101e66109f3565b6101ae61034f366004613003565b610a5e565b6102c8610362366004613317565b610a72565b6103b1610375366004612ec3565b600360208181526000938452604080852090915291835291208054600182015460028301549383015460069093015460ff909216939092909185565b6040516101c295949392919061340e565b61023b6103d0366004613317565b610a84565b6101ae6103e3366004612ec3565b610abc565b6102066103f6366004613003565b610ace565b610403610aeb565b6040516101c29392919061347d565b610425610420366004612e2a565b610bc5565b6040516101c291906134c0565b6101b8610c03565b610321610448366004613317565b610c16565b61023b61045b366004613003565b610c21565b6102c861046e3660046134d3565b610c5d565b61047b610cbf565b604080519283526020830191909152016101c2565b6101ae61049e366004612e2a565b610ce1565b6101e6610d2a565b6104b3610d8d565b61055186868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808a0282810182019093528982529093508992508891829185019084908082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250610de992505050565b50505050505050565b600061056461114b565b905090565b60008282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506105aa925083915061115e9050565b6105e684848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061119392505050565b949350505050565b60606105646105fb611218565b61123c565b606080606061060f8585611250565b9250925092509250925092565b610624610d8d565b818180806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610663925083915061115e9050565b600061066d611218565b905060005b838110156106b4576106ab85858381811061068f5761068f6134ee565b90506020020160208101906106a49190613317565b8390611639565b50600101610672565b5050505050565b60006105e684848461164e565b606061070683838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250611684915050565b90505b92915050565b610717610d8d565b6107538282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506117d792505050565b5050565b600054610100900460ff16158080156107775750600054600160ff909116105b806107915750303b158015610791575060005460ff166001145b6107f95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff19166001179055801561081c576000805461ff0019166101001790555b61082589611892565b61082f83836118c2565b61083f8c8c8c8b8b8b8b8b6118f3565b8015610885576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050505050565b60008061089e611944565b90506000806108ab610cbf565b91509150806001828560040154856108c3919061351a565b6108cd9190613531565b6108d79190613544565b6108e19190613557565b935050505090565b60008060006108ff6108f9611944565b85611968565b9150915081610923578360405163141e2e1f60e11b81526004016107f09190613332565b61092b611944565b600101818154811061093f5761093f6134ee565b6000918252602090912001546001600160a01b0316949350505050565b33301461098a576000356001600160e01b0319166040516307337e1960e41b81526004016107f09190613579565b61075382826119cd565b60006107066000848461164e565b6109aa610d8d565b6109b381611a76565b6107538282611aa3565b6000806109c8611944565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b031690565b60606109fd611944565b600101805480602002602001604051908101604052809291908181526020018280548015610a5457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610a36575b5050505050905090565b610a66610d8d565b610a6f81611b2e565b50565b6000610a7d82611b9b565b5092915050565b600080610a8f611944565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b0316151590565b610ac4610d8d565b6107538282611c12565b6060806060610ade600085611250565b9250925092509193909250565b60608060606000610afa611944565b805460408051602080840282018101909252828152929350839190830182828015610b4e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b30575b5050505050935080600101805480602002602001604051908101604052809291908181526020018280548015610bad57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b8f575b50505050509250610bbd84611cc4565b915050909192565b6060610706838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611cc492505050565b6000610c0d611944565b60010154919050565b600061070982611db0565b600080610c2c611de5565b9050610c3661114b565b8160010154610c45919061351a565b6002820154610c54908561351a565b10159392505050565b6000610c67611e09565b600083600f811115610c7b57610c7b612ee5565b60ff1681526020810191909152604001600020546001600160a01b0316905080610cba578160405163409140df60e11b81526004016107f0919061358e565b919050565b6000806000610ccc611de5565b90508060010154816002015492509250509091565b610ce9610d8d565b610d25828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611e2d92505050565b505050565b6060610d34611944565b805460408051602080840282018101909252828152929190830182828015610a54576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610a36575050505050905090565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610de7576000356001600160e01b0319166001604051620f948f60ea1b81526004016107f09291906135a8565b565b6060610df58383612213565b610dfe8161115e565b6000610e08611944565b845187519192509081148015610e1e5750855181145b610e49576000356001600160e01b0319166040516306b5667560e21b81526004016107f09190613579565b806001600160401b03811115610e6157610e6161301c565b604051908082528060200260200182016040528015610e8a578160200160208202803683370190505b50935080600003610e9c575050611143565b60008060008060005b858110156110af578a8181518110610ebf57610ebf6134ee565b60200260200101519450898181518110610edb57610edb6134ee565b602002602001015193508b8181518110610ef757610ef76134ee565b60200260200101519250610f0a8561231d565b610f138461231d565b826001600160601b0316600003610f4b576000356001600160e01b031916604051637f11b8a360e11b81526004016107f09190613579565b6001600160a01b03808616600081815260038a01602090815260408083205494891683528083205460028d0190925280832054938352909120546001600160601b039384169391821692610fa39290811691166135d6565b610fad91906135d6565b610fb791906135d6565b6001600160601b0316600014898281518110610fd557610fd56134ee565b602002602001019015159081151581525050888181518110610ff957610ff96134ee565b6020026020010151156110a7578654600181810189556000898152602080822090930180546001600160a01b03808b166001600160a01b0319928316811790935591835260028c018552604080842080546001600160601b038b166001600160601b03199182168117909255868f018054978801815586528786209096018054948c1694909316841790925591835260038c0190945290208054909116821790556110a49083613531565b91505b600101610ea5565b50808660040160008282546110c49190613531565b90915550506040516110ff906347c28ec560e11b906110eb908c908f908d90602001613629565b604051602081830303815290604052612352565b7f897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b78888c8c8c6040516111349493929190613662565b60405180910390a15050505050505b509392505050565b6000611155611944565b60040154905090565b6111678161237f565b15610a6f576000356001600160e01b031916604051630d697db160e11b81526004016107f09190613579565b60008161119f8161115e565b60006111a9611944565b905060005b8451811015611210578160020160008683815181106111cf576111cf6134ee565b6020908102919091018101516001600160a01b0316825281019190915260400160002054611206906001600160601b031685613531565b93506001016111ae565b505050919050565b7f5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd97624090565b606060006112498361241e565b9392505050565b600082815260036020908152604080832084845290915281206004810154600582015460609384938493909290916112888284613531565b9050806001600160401b038111156112a2576112a261301c565b6040519080825280602002602001820160405280156112cb578160200160208202803683370190505b509550806001600160401b038111156112e6576112e661301c565b60405190808252806020026020018201604052801561133157816020015b60408051606081018252600080825260208083018290529282015282526000199092019101816113045790505b509450806001600160401b0381111561134c5761134c61301c565b604051908082528060200260200182016040528015611375578160200160208202803683370190505b50965060005b838110156114ca576000878281518110611397576113976134ee565b602002602001019060018111156113b0576113b0612ee5565b908160018111156113c3576113c3612ee5565b90525060008a81526003602090815260408083208c8452909152812060048701805460079092019291849081106113fc576113fc6134ee565b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815460ff1681526001820154938101939093526002015490820152865187908390811061145a5761145a6134ee565b602002602001018190525084600401818154811061147a5761147a6134ee565b9060005260206000200160009054906101000a90046001600160a01b03168882815181106114aa576114aa6134ee565b6001600160a01b039092166020928302919091019091015260010161137b565b5060005b8281101561162d576001876114e38684613531565b815181106114f3576114f36134ee565b6020026020010190600181111561150c5761150c612ee5565b9081600181111561151f5761151f612ee5565b90525060008a81526003602090815260408083208c845290915281206005870180546007909201929184908110611558576115586134ee565b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815460ff1681526001820154938101939093526002015490820152866115ad8684613531565b815181106115bd576115bd6134ee565b60200260200101819052508460050181815481106115dd576115dd6134ee565b6000918252602090912001546001600160a01b0316886115fd8684613531565b8151811061160d5761160d6134ee565b6001600160a01b03909216602092830291909101909101526001016114ce565b50505050509250925092565b6000610706836001600160a01b03841661247a565b600083815260036020908152604080832085845282528083206001600160a01b038516845260080190915281205460ff166105e6565b606082516001600160401b0381111561169f5761169f61301c565b6040519080825280602002602001820160405280156116c8578160200160208202803683370190505b50905060005b8351811015610a7d57600560008583815181106116ed576116ed6134ee565b6020026020010151600581111561170657611706612ee5565b600581111561171757611717612ee5565b815260200190815260200160002060009054906101000a90046001600160a01b031682828151811061174b5761174b6134ee565b60200260200101906001600160a01b031690816001600160a01b0316815250508280156117a3575060006001600160a01b0316828281518110611790576117906134ee565b60200260200101516001600160a01b0316145b156117cf576000356001600160e01b03191660405163053265f160e01b81526004016107f09190613579565b6001016116ce565b806117e18161115e565b60006117eb611218565b905060008060005b855181101561188a5785818151811061180e5761180e6134ee565b6020026020010151925061182183611a76565b611832836312c0151560e21b61256d565b61183c8484612700565b604080516001600160a01b038616815282151560208201529193507fb85c58eeff9fe423669ae0841666f4c8499e8731b8275eb462e4fa1720ec420e910160405180910390a16001016117f3565b505050505050565b600054610100900460ff166118b95760405162461bcd60e51b81526004016107f0906136ba565b610a6f81612715565b600054610100900460ff166118e95760405162461bcd60e51b81526004016107f0906136ba565b6107538282612745565b600054610100900460ff1661191a5760405162461bcd60e51b81526004016107f0906136ba565b6119248888612777565b61192d846127b8565b61193a86868585856127e8565b5050505050505050565b7fc648703095712c0419b6431ae642c061f0a105ac2d7c3d9604061ef4ebc3830090565b60008060005b84548110156119bb57848181548110611989576119896134ee565b6000918252602090912001546001600160a01b03908116908516036119b3576001925090506119c6565b60010161196e565b506000600019915091505b9250929050565b60005b8251811015610d2557306001600160a01b03168282815181106119f5576119f56134ee565b60200260200101516001600160a01b031603611a32576000356001600160e01b03191660405163053265f160e01b81526004016107f09190613579565b611a6e838281518110611a4757611a476134ee565b6020026020010151838381518110611a6157611a616134ee565b6020026020010151612912565b6001016119d0565b806001600160a01b03163b600003610a6f5780604051630bfc64a360e21b81526004016107f09190613332565b80611aac611e09565b600084600f811115611ac057611ac0612ee5565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115611b0157611b01612ee5565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b6003811015611b50576040516305f4dee960e31b815260040160405180910390fd5b6000611b5a611944565b600581018390556040518381529091507f22d5bb5059ffe2949a098666fc198587200c8118483074120d3ca7050c7753f19060200160405180910390a15050565b600080600080611bb5611bac611944565b60010186611968565b9150915081611bd957846040516326527e1760e01b81526004016107f09190613332565b611be1611944565b805482908110611bf357611bf36134ee565b6000918252602090912001546001600160a01b03169590945092505050565b80821180611c21575060018111155b15611c4d576000356001600160e01b0319166040516387f6f09560e01b81526004016107f09190613579565b6000611c57611de5565b6001810180546002830180549287905585905582549293509184908690856000611c8083613705565b9091555060408051868152602081018690527f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a45050505050565b60606000611cd0611944565b905082516001600160401b03811115611ceb57611ceb61301c565b604051908082528060200260200182016040528015611d14578160200160208202803683370190505b50915060005b8351811015611da957816002016000858381518110611d3b57611d3b6134ee565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160601b0316838281518110611d8957611d896134ee565b6001600160601b0390921660209283029190910190910152600101611d1a565b5050919050565b6000611dba611944565b6001600160a01b0390921660009081526002929092016020525060409020546001600160601b031690565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f0090565b7fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb90565b606081611e398161115e565b6000611e43611944565b8451909150806001600160401b03811115611e6057611e6061301c565b604051908082528060200260200182016040528015611e89578160200160208202803683370190505b50935080600003611e9b57505061220d565b60058201548254611ead908390613544565b1015611ecc5760405163b2e765cb60e01b815260040160405180910390fd5b60008060008060005b8581101561219357898181518110611eef57611eef6134ee565b60200260200101519350611f0284611b9b565b9095509150611f108561231d565b611f198461231d565b6001600160a01b03851660009081526002880160205260409020546001600160601b031615801590611f6d57506001600160a01b03841660009081526003880160205260409020546001600160601b031615155b898281518110611f7f57611f7f6134ee565b602002602001019015159081151581525050888181518110611fa357611fa36134ee565b60200260200101511561218b576001600160a01b038516600090815260028801602052604081205488546001600160601b039091169190611fe690600190613544565b9050886000018181548110611ffd57611ffd6134ee565b60009182526020909120015489546001600160a01b03909116908a9086908110612029576120296134ee565b600091825260209091200180546001600160a01b0319166001600160a01b039290921691909117905588548990806120635761206361371e565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038916825260028b0190526040902080546001600160601b0319169055600189018054829081106120c3576120c36134ee565b60009182526020909120015460018a0180546001600160a01b0390921691869081106120f1576120f16134ee565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550886001018054806121325761213261371e565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038816825260038b0190526040902080546001600160601b03191690556121868286613531565b945050505b600101611ed5565b50818660040160008282546121a89190613544565b90915550506040516121cd90636242a4ef60e11b906110eb908c908c90602001613734565b7fdf3dcd7987202f64648f3acdbf12401e3a2bb23e77e19f99826b5475cbb86369888a6040516121fe929190613762565b60405180910390a15050505050505b50919050565b81518151606091908082016001600160401b038111156122355761223561301c565b60405190808252806020026020018201604052801561225e578160200160208202803683370190505b50925060005b828110156122b85785818151811061227e5761227e6134ee565b6020026020010151848281518110612298576122986134ee565b6001600160a01b0390921660209283029190910190910152600101612264565b60005b82811015612313578581815181106122d5576122d56134ee565b60200260200101518583815181106122ef576122ef6134ee565b6001600160a01b0390921660209283029190910190910152600191820191016122bb565b5050505092915050565b6001600160a01b038116610a6f576000356001600160e01b03191660405163104c66df60e31b81526004016107f09190613579565b61235c82826129a5565b610753573382826040516319b5fdcb60e31b81526004016107f0939291906137d7565b6000815160000361239257506000919050565b60005b600183510381101561241557600181015b835181101561240c578381815181106123c1576123c16134ee565b60200260200101516001600160a01b03168483815181106123e4576123e46134ee565b60200260200101516001600160a01b031603612404575060019392505050565b6001016123a6565b50600101612395565b50600092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561246e57602002820191906000526020600020905b81548152602001906001019080831161245a575b50505050509050919050565b6000818152600183016020526040812054801561256357600061249e600183613544565b85549091506000906124b290600190613544565b90508181146125175760008660000182815481106124d2576124d26134ee565b90600052602060002001549050808760000184815481106124f5576124f56134ee565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806125285761252861371e565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610709565b6000915050610709565b6000816040516024016125809190613579565b60408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b1790525190915060009081906001600160a01b038616906125c990859061380b565b600060405180830381855afa9150503d8060008114612604576040519150601f19603f3d011682016040523d82523d6000602084013e612609565b606091505b5091509150816126cb57846001600160a01b03168360405160240161262e9190613827565b60408051601f198184030181529181526020820180516001600160e01b03166325da93a560e11b17905251612663919061380b565b600060405180830381855afa9150503d806000811461269e576040519150601f19603f3d011682016040523d82523d6000602084013e6126a3565b606091505b509092509050816126cb57838560405163069d427960e11b81526004016107f092919061383a565b808060200190518101906126df919061385d565b6106b457838560405163069d427960e11b81526004016107f092919061383a565b6000610706836001600160a01b038416612ccb565b600054610100900460ff1661273c5760405162461bcd60e51b81526004016107f0906136ba565b610a6f81612d1a565b600054610100900460ff1661276c5760405162461bcd60e51b81526004016107f0906136ba565b61098a600030612912565b600054610100900460ff1661279e5760405162461bcd60e51b81526004016107f0906136ba565b60006127a8611de5565b600181559050610d258383611c12565b600054610100900460ff166127df5760405162461bcd60e51b81526004016107f0906136ba565b610a6f816117d7565b600054610100900460ff1661280f5760405162461bcd60e51b81526004016107f0906136ba565b61281a600285611aa3565b604080516020808201839052600e60608301526d212924a223a2afa6a0a720a3a2a960911b6080808401919091528284018990528351808403909101815260a0830184528051908201207f599a80fcaa47b95e2323ab4d34d34e0cc9feda4b843edafcc30c7bdf60ea15bf60c08401527fe4d2346818310a10fac5a6d073d3dce255578caf4aa81ddcbcc7c2b98405eef060e08401527f2a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4de61010084015261012080840191909152835180840390910181526101409092019092528051910120600155612907818385610de9565b506106b46003611b2e565b806005600084600581111561292957612929612ee5565b600581111561293a5761293a612ee5565b8152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600581111561297857612978612ee5565b6040517f356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d90600090a35050565b600160006129b46105fb611218565b805190915060008190036129c9575050610709565b6000816001600160401b038111156129e3576129e361301c565b604051908082528060200260200182016040528015612a0c578160200160208202803683370190505b5090506000826001600160401b03811115612a2957612a2961301c565b604051908082528060200260200182016040528015612a5c57816020015b6060815260200190600190039081612a475790505b50905060008787604051602001612a7492919061387f565b6040516020818303038152906040529050600081604051602401612a989190613827565b60408051601f198184030181529190526020810180516001600160e01b03166325da93a560e11b179052905060005b85811015612c8157868181518110612ae157612ae16134ee565b60200260200101516001600160a01b031683604051612b00919061380b565b6000604051808303816000865af19150503d8060008114612b3d576040519150601f19603f3d011682016040523d82523d6000602084013e612b42565b606091505b50868381518110612b5557612b556134ee565b60200260200101868481518110612b6e57612b6e6134ee565b6020026020010182905282151515158152505050848181518110612b9457612b946134ee565b6020026020010151612c7957868181518110612bb257612bb26134ee565b60200260200101516001600160a01b031682604051612bd1919061380b565b6000604051808303816000865af19150503d8060008114612c0e576040519150601f19603f3d011682016040523d82523d6000602084013e612c13565b606091505b50868381518110612c2657612c266134ee565b60200260200101868481518110612c3f57612c3f6134ee565b6020026020010182905282151515158152505050878015612c765750848181518110612c6d57612c6d6134ee565b60200260200101515b97505b600101612ac7565b507fc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b6382878686604051612cb794939291906138b0565b60405180910390a150505050505092915050565b6000818152600183016020526040812054612d1257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610709565b506000610709565b600481905560405181907fe5cd1c123a8cf63fa1b7229678db61fe8ae99dbbd27889370b6667c8cae97da190600090a250565b60008083601f840112612d5f57600080fd5b5081356001600160401b03811115612d7657600080fd5b6020830191508360208260051b85010111156119c657600080fd5b60008060008060008060608789031215612daa57600080fd5b86356001600160401b0380821115612dc157600080fd5b612dcd8a838b01612d4d565b90985096506020890135915080821115612de657600080fd5b612df28a838b01612d4d565b90965094506040890135915080821115612e0b57600080fd5b50612e1889828a01612d4d565b979a9699509497509295939492505050565b60008060208385031215612e3d57600080fd5b82356001600160401b03811115612e5357600080fd5b612e5f85828601612d4d565b90969095509350505050565b60008151808452602080850194506020840160005b83811015612ea55781516001600160a01b031687529582019590820190600101612e80565b509495945050505050565b6020815260006107066020830184612e6b565b60008060408385031215612ed657600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60006060808352612f0f6060840187612e6b565b83810360208581019190915286518083528782019282019060005b81811015612f5657845160028110612f4457612f44612ee5565b83529383019391830191600101612f2a565b50506040925085810360408701528087518083528383019150838901925060005b81811015612fa7578351805160ff1684528581015186850152860151868401529284019291860191600101612f77565b50909a9950505050505050505050565b80356001600160a01b0381168114610cba57600080fd5b600080600060608486031215612fe357600080fd5b8335925060208401359150612ffa60408501612fb7565b90509250925092565b60006020828403121561301557600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561305a5761305a61301c565b604052919050565b60006001600160401b0382111561307b5761307b61301c565b5060051b60200190565b600082601f83011261309657600080fd5b813560206130ab6130a683613062565b613032565b8083825260208201915060208460051b8701019350868411156130cd57600080fd5b602086015b848110156130f0576130e381612fb7565b83529183019183016130d2565b509695505050505050565b600082601f83011261310c57600080fd5b8135602061311c6130a683613062565b8083825260208201915060208460051b87010193508684111561313e57600080fd5b602086015b848110156130f05780356001600160601b03811681146131635760008081fd5b8352918301918301613143565b600082601f83011261318157600080fd5b813560206131916130a683613062565b8083825260208201915060208460051b8701019350868411156131b357600080fd5b602086015b848110156130f0578035600681106131d05760008081fd5b83529183019183016131b8565b60008060008060008060008060008060006101608c8e0312156131ff57600080fd5b8b359a5060208c0135995060408c0135985060608c0135975061322460808d01612fb7565b96506001600160401b0360a08d013581101561323f57600080fd5b61324f8e60a08f01358f01613085565b96508060c08e0135111561326257600080fd5b6132728e60c08f01358f01613085565b95508060e08e0135111561328557600080fd5b6132958e60e08f01358f01613085565b9450806101008e013511156132a957600080fd5b6132ba8e6101008f01358f016130fb565b9350806101208e013511156132ce57600080fd5b6132df8e6101208f01358f01613170565b9250806101408e013511156132f357600080fd5b506133058d6101408e01358e01613085565b90509295989b509295989b9093969950565b60006020828403121561332957600080fd5b61070682612fb7565b6001600160a01b0391909116815260200190565b6000806040838503121561335957600080fd5b82356001600160401b038082111561337057600080fd5b61337c86838701613170565b9350602085013591508082111561339257600080fd5b5061339f85828601613085565b9150509250929050565b600080604083850312156133bc57600080fd5b823591506133cc60208401612fb7565b90509250929050565b803560108110610cba57600080fd5b600080604083850312156133f757600080fd5b613400836133d5565b91506133cc60208401612fb7565b60a081016005871061342257613422612ee5565b95815260208101949094526040840192909252606083015260809091015290565b60008151808452602080850194506020840160005b83811015612ea55781516001600160601b031687529582019590820190600101613458565b6060815260006134906060830186612e6b565b82810360208401526134a28186612e6b565b905082810360408401526134b68185613443565b9695505050505050565b6020815260006107066020830184613443565b6000602082840312156134e557600080fd5b610706826133d5565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761070957610709613504565b8082018082111561070957610709613504565b8181038181111561070957610709613504565b60008261357457634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031991909116815260200190565b60208101601083106135a2576135a2612ee5565b91905290565b6001600160e01b03198316815260408101600b83106135c9576135c9612ee5565b8260208301529392505050565b6001600160601b03818116838216019080821115610a7d57610a7d613504565b60008151808452602080850194506020840160005b83811015612ea557815115158752958201959082019060010161360b565b60608152600061363c6060830186612e6b565b828103602084015261364e8186613443565b905082810360408401526134b681856135f6565b60808152600061367560808301876135f6565b82810360208401526136878187613443565b9050828103604084015261369b8186612e6b565b905082810360608401526136af8185612e6b565b979650505050505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60006001820161371757613717613504565b5060010190565b634e487b7160e01b600052603160045260246000fd5b6040815260006137476040830185612e6b565b828103602084015261375981856135f6565b95945050505050565b60408152600061377560408301856135f6565b82810360208401526137598185612e6b565b60005b838110156137a257818101518382015260200161378a565b50506000910152565b600081518084526137c3816020860160208601613787565b601f01601f19169290920160200192915050565b6001600160a01b03841681526001600160e01b031983166020820152606060408201819052600090613759908301846137ab565b6000825161381d818460208701613787565b9190910192915050565b60208152600061070660208301846137ab565b6001600160e01b03199290921682526001600160a01b0316602082015260400190565b60006020828403121561386f57600080fd5b8151801515811461124957600080fd5b6001600160e01b03198316815281516000906138a2816004850160208701613787565b919091016004019392505050565b6080815260006138c360808301876137ab565b6020838203818501526138d68288612e6b565b915083820360408501526138ea82876135f6565b915083820360608501528185518084528284019150828160051b85010183880160005b8381101561393b57601f198784030185526139298383516137ab565b9486019492509085019060010161390d565b50909b9a505050505050505050505056fea2646970667358221220d83003b43962afe3120b34eb387ecaaf4912a01d9c682ac0fb953cf65d90b77c64736f6c63430008170033", + "deployer": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "devdoc": { + "version": 1, + "kind": "dev", + "methods": { + "addBridgeOperators(uint96[],address[],address[])": { + "details": "Adds multiple bridge operators.", + "params": { + "bridgeOperators": "An array of addresses representing the bridge operators to add.", + "governors": "An array of addresses of hot/cold wallets for bridge operator to update their node address." + } + }, + "checkThreshold(uint256)": { + "details": "Checks whether the `_voteWeight` passes the threshold." + }, + "getBridgeOperatorWeight(address)": { + "details": "External function to retrieve the vote weight of a specific bridge operator.", + "params": { + "bridgeOperator": "The address of the bridge operator to get the vote weight for." + }, + "returns": { + "weight": "The vote weight of the specified bridge operator." + } + }, + "getBridgeOperators()": { + "details": "Returns an array of all bridge operators.", + "returns": { + "_0": "An array containing the addresses of all bridge operators." + } + }, + "getCallbackRegisters()": { + "details": "Retrieves the addresses of registered callbacks.", + "returns": { + "registers": "An array containing the addresses of registered callbacks." + } + }, + "getContract(uint8)": { + "details": "Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.", + "params": { + "contractType": "The role of the contract to retrieve." + }, + "returns": { + "contract_": "The address of the contract with the specified role." + } + }, + "getFullBridgeOperatorInfos()": { + "details": "Retrieves the full information of all registered bridge operators. This external function allows external callers to obtain the full information of all the registered bridge operators. The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.", + "returns": { + "bridgeOperators": "An array of addresses representing the registered bridge operators.", + "governors": "An array of addresses representing the governors of each bridge operator.", + "weights": "An array of uint256 values representing the vote weights of each bridge operator. Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator. Example Usage: ``` (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos(); for (uint256 i = 0; i < bridgeOperators.length; i++) { // Access individual information for each bridge operator. address governor = governors[i]; address bridgeOperator = bridgeOperators[i]; uint256 weight = weights[i]; // ... (Process or use the information as required) ... } ```" + } + }, + "getGlobalProposalSignatures(uint256)": { + "details": "See {CommonGovernanceProposal-_getProposalSignatures}" + }, + "getGovernorOf(address)": { + "details": "Returns the corresponding `governor` of a `operator`." + }, + "getGovernorWeight(address)": { + "details": "External function to retrieve the vote weight of a specific governor.", + "params": { + "governor": "The address of the governor to get the vote weight for." + }, + "returns": { + "weight": "voteWeight The vote weight of the specified governor." + } + }, + "getGovernorWeights(address[])": { + "details": "Returns the weights of a list of governor addresses." + }, + "getGovernors()": { + "details": "Returns an array of all governors.", + "returns": { + "_0": "An array containing the addresses of all governors." + } + }, + "getOperatorOf(address)": { + "details": "Returns the corresponding `operator` of a `governor`." + }, + "getProposalSignatures(uint256,uint256)": { + "details": "See {CommonGovernanceProposal-_getProposalSignatures}" + }, + "getThreshold()": { + "details": "Returns the threshold." + }, + "getTotalWeight()": { + "details": "Returns total weights." + }, + "globalProposalVoted(uint256,address)": { + "details": "See {CommonGovernanceProposal-_proposalVoted}" + }, + "isBridgeOperator(address)": { + "details": "Checks if the given address is a bridge operator.", + "params": { + "addr": "The address to check." + }, + "returns": { + "_0": "A boolean indicating whether the address is a bridge operator." + } + }, + "minimumVoteWeight()": { + "details": "Returns the minimum vote weight to pass the threshold." + }, + "proposalVoted(uint256,uint256,address)": { + "details": "See {CommonGovernanceProposal-_proposalVoted}" + }, + "registerCallbacks(address[])": { + "details": "Registers multiple callbacks with the bridge.", + "params": { + "registers": "The array of callback addresses to register." + } + }, + "removeBridgeOperators(address[])": { + "details": "Removes multiple bridge operators.", + "params": { + "bridgeOperators": "An array of addresses representing the bridge operators to remove." + } + }, + "resolveTargets(uint8[])": { + "details": "Returns corresponding address of target options. Return address(0) on non-existent target." + }, + "setContract(uint8,address)": { + "details": "Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.", + "params": { + "addr": "The address of the contract to set.", + "contractType": "The role of the contract to set." + } + }, + "setMinRequiredGovernor(uint256)": { + "details": "Self-call to update the minimum required governor.", + "params": { + "min": "The minimum number, this must not less than 3." + } + }, + "setThreshold(uint256,uint256)": { + "details": "Sets the threshold. Requirements: - The method caller is admin. Emits the `ThresholdUpdated` event." + }, + "sumGovernorsWeight(address[])": { + "details": "Returns total weights of the governor list." + }, + "totalBridgeOperator()": { + "details": "Returns the total number of bridge operators.", + "returns": { + "_0": "The total number of bridge operators." + } + }, + "unregisterCallbacks(address[])": { + "details": "Unregisters multiple callbacks from the bridge.", + "params": { + "registers": "The array of callback addresses to unregister." + } + }, + "updateManyTargetOption(uint8[],address[])": { + "details": "Updates list of `targetOptions` to `targets`. Requirement: - Only allow self-call through proposal." + } + }, + "events": { + "BridgeOperatorAddingFailed(address)": { + "details": "Emitted when a bridge operator is failed to add." + }, + "BridgeOperatorRemovingFailed(address)": { + "details": "Emitted when a bridge operator is failed to remove." + }, + "BridgeOperatorUpdated(address,address,address)": { + "details": "Emitted when a bridge operator is updated." + }, + "BridgeOperatorsAdded(bool[],uint96[],address[],address[])": { + "details": "Emitted when new bridge operators are added." + }, + "BridgeOperatorsRemoved(bool[],address[])": { + "details": "Emitted when bridge operators are removed." + }, + "ContractUpdated(uint8,address)": { + "details": "Emitted when a contract is updated." + }, + "GlobalProposalCreated(uint256,bytes32,(uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),bytes32,(uint256,uint256,address,uint8[],uint256[],bytes[],uint256[]),address)": { + "details": "Emitted when a proposal is created" + }, + "Initialized(uint8)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "MinRequiredGovernorUpdated(uint256)": { + "details": "Emitted when the minimum number of required governors is updated." + }, + "Notified(bytes,address[],bool[],bytes[])": { + "details": "Emitted when the contract notifies multiple registers with statuses and return data." + }, + "ProposalApproved(bytes32)": { + "details": "Emitted when the proposal is approved" + }, + "ProposalCreated(uint256,uint256,bytes32,(uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),address)": { + "details": "Emitted when a proposal is created" + }, + "ProposalExecuted(bytes32,bool[],bytes[])": { + "details": "Emitted when the proposal is executed" + }, + "ProposalExpired(bytes32)": { + "details": "Emitted when the vote is expired" + }, + "ProposalExpiryDurationChanged(uint256)": { + "details": "Emitted when the proposal expiry duration is changed." + }, + "ProposalRejected(bytes32)": { + "details": "Emitted when the vote is reject" + }, + "ProposalVoted(bytes32,address,uint8,uint256)": { + "details": "Emitted when the proposal is voted" + }, + "TargetOptionUpdated(uint8,address)": { + "details": "Emitted when the target options are updated" + }, + "ThresholdUpdated(uint256,uint256,uint256,uint256,uint256)": { + "details": "Emitted when the threshold is updated" + } + }, + "errors": { + "ErrContractTypeNotFound(uint8)": [ + { + "details": "Error of invalid role." + } + ], + "ErrCurrentProposalIsNotCompleted()": [ + { + "details": "Error thrown when the current proposal is not completed." + } + ], + "ErrDuplicated(bytes4)": [ + { + "details": "Error thrown when a duplicated element is detected in an array.", + "params": { + "msgSig": "The function signature that invoke the error." + } + } + ], + "ErrInvalidArguments(bytes4)": [ + { + "details": "Error indicating that arguments are invalid." + } + ], + "ErrInvalidThreshold(bytes4)": [ + { + "details": "Error indicating that the provided threshold is invalid for a specific function signature.", + "params": { + "msgSig": "The function signature (bytes4) that the invalid threshold applies to." + } + } + ], + "ErrInvalidVoteWeight(bytes4)": [ + { + "details": "Error indicating that a vote weight is invalid for a specific function signature.", + "params": { + "msgSig": "The function signature (bytes4) that encountered an invalid vote weight." + } + } + ], + "ErrLengthMismatch(bytes4)": [ + { + "details": "Error indicating a mismatch in the length of input parameters or arrays for a specific function.", + "params": { + "msgSig": "The function signature (bytes4) that has a length mismatch." + } + } + ], + "ErrOnlySelfCall(bytes4)": [ + { + "details": "Error indicating that a function can only be called by the contract itself.", + "params": { + "msgSig": "The function signature (bytes4) that can only be called by the contract itself." + } + } + ], + "ErrUnauthorized(bytes4,uint8)": [ + { + "details": "Error indicating that the caller is unauthorized to perform a specific function.", + "params": { + "expectedRole": "The role required to perform the function.", + "msgSig": "The function signature (bytes4) that the caller is unauthorized to perform." + } + } + ], + "ErrUnsupportedInterface(bytes4,address)": [ + { + "details": "The error indicating an unsupported interface.", + "params": { + "addr": "The address where the unsupported interface was encountered.", + "interfaceId": "The bytes4 interface identifier that is not supported." + } + } + ], + "ErrVoteIsFinalized()": [ + { + "details": "Error thrown when attempting to interact with a finalized vote." + } + ], + "ErrZeroAddress(bytes4)": [ + { + "details": "Error indicating that given address is null when it should not." + } + ], + "ErrZeroCodeContract(address)": [ + { + "details": "Error of set to non-contract." + } + ] + } + }, + "isFoundry": true, + "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"ErrBelowMinRequiredGovernors\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"ErrContractTypeNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrCurrentProposalIsNotCompleted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrDuplicated\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"name\":\"ErrExistOneInternalCallFailed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"}],\"name\":\"ErrGovernorNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"required\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ErrGovernorNotMatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidArguments\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidInput\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidThreshold\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidVoteWeight\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrLengthMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrOnlySelfCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"ErrOperatorNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum RoleAccess\",\"name\":\"expectedRole\",\"type\":\"uint8\"}],\"name\":\"ErrUnauthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrUnsupportedInterface\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrVoteIsFinalized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrZeroAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrZeroCodeContract\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"BridgeOperatorAddingFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"BridgeOperatorRemovingFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fromBridgeOperator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"toBridgeOperator\",\"type\":\"address\"}],\"name\":\"BridgeOperatorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"statuses\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"uint96[]\",\"name\":\"voteWeights\",\"type\":\"uint96[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"BridgeOperatorsAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"statuses\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"BridgeOperatorsRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"name\":\"CallbackRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ContractUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"round\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"indexed\":false,\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"globalProposalHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"indexed\":false,\"internalType\":\"struct GlobalProposal.GlobalProposalDetail\",\"name\":\"globalProposal\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"}],\"name\":\"GlobalProposalCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"}],\"name\":\"MinRequiredGovernorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"statuses\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"returnDatas\",\"type\":\"bytes[]\"}],\"name\":\"Notified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ProposalApproved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"round\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"indexed\":false,\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"}],\"name\":\"ProposalCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"successCalls\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"returnDatas\",\"type\":\"bytes[]\"}],\"name\":\"ProposalExecuted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ProposalExpired\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"ProposalExpiryDurationChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ProposalRejected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"enum Ballot.VoteType\",\"name\":\"support\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\"}],\"name\":\"ProposalVoted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum GlobalProposal.TargetOption\",\"name\":\"targetOption\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"TargetOptionUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"numerator\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"denominator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousNumerator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousDenominator\",\"type\":\"uint256\"}],\"name\":\"ThresholdUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96[]\",\"name\":\"voteWeights\",\"type\":\"uint96[]\"},{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"addBridgeOperators\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"voteWeight\",\"type\":\"uint256\"}],\"name\":\"checkThreshold\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeOperator\",\"type\":\"address\"}],\"name\":\"getBridgeOperatorWeight\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"weight\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBridgeOperators\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCallbackRegisters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"getContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"contract_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFullBridgeOperatorInfos\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"},{\"internalType\":\"uint96[]\",\"name\":\"weights\",\"type\":\"uint96[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"round_\",\"type\":\"uint256\"}],\"name\":\"getGlobalProposalSignatures\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"voters\",\"type\":\"address[]\"},{\"internalType\":\"enum Ballot.VoteType[]\",\"name\":\"supports_\",\"type\":\"uint8[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"signatures\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"getGovernorOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"}],\"name\":\"getGovernorWeight\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"weight\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"}],\"name\":\"getGovernorWeights\",\"outputs\":[{\"internalType\":\"uint96[]\",\"name\":\"weights\",\"type\":\"uint96[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGovernors\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"}],\"name\":\"getOperatorOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"getProposalSignatures\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"_voters\",\"type\":\"address[]\"},{\"internalType\":\"enum Ballot.VoteType[]\",\"name\":\"_supports\",\"type\":\"uint8[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"_signatures\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"round_\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"globalProposalVoted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"roninChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryDuration\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"bridgeContract\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"callbackRegisters\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"internalType\":\"uint96[]\",\"name\":\"voteWeights\",\"type\":\"uint96[]\"},{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isBridgeOperator\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minimumVoteWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_voter\",\"type\":\"address\"}],\"name\":\"proposalVoted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"}],\"name\":\"registerCallbacks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"removeBridgeOperators\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"}],\"name\":\"resolveTargets\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"round\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"}],\"name\":\"setMinRequiredGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom\",\"type\":\"uint256\"}],\"name\":\"setThreshold\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"}],\"name\":\"sumGovernorsWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"sum\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalBridgeOperator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"}],\"name\":\"unregisterCallbacks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"}],\"name\":\"updateManyTargetOption\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"vote\",\"outputs\":[{\"internalType\":\"enum VoteStatusConsumer.VoteStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"againstVoteWeight\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"forVoteWeight\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"ErrContractTypeNotFound(uint8)\":[{\"details\":\"Error of invalid role.\"}],\"ErrCurrentProposalIsNotCompleted()\":[{\"details\":\"Error thrown when the current proposal is not completed.\"}],\"ErrDuplicated(bytes4)\":[{\"details\":\"Error thrown when a duplicated element is detected in an array.\",\"params\":{\"msgSig\":\"The function signature that invoke the error.\"}}],\"ErrInvalidArguments(bytes4)\":[{\"details\":\"Error indicating that arguments are invalid.\"}],\"ErrInvalidThreshold(bytes4)\":[{\"details\":\"Error indicating that the provided threshold is invalid for a specific function signature.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that the invalid threshold applies to.\"}}],\"ErrInvalidVoteWeight(bytes4)\":[{\"details\":\"Error indicating that a vote weight is invalid for a specific function signature.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that encountered an invalid vote weight.\"}}],\"ErrLengthMismatch(bytes4)\":[{\"details\":\"Error indicating a mismatch in the length of input parameters or arrays for a specific function.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that has a length mismatch.\"}}],\"ErrOnlySelfCall(bytes4)\":[{\"details\":\"Error indicating that a function can only be called by the contract itself.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that can only be called by the contract itself.\"}}],\"ErrUnauthorized(bytes4,uint8)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"expectedRole\":\"The role required to perform the function.\",\"msgSig\":\"The function signature (bytes4) that the caller is unauthorized to perform.\"}}],\"ErrUnsupportedInterface(bytes4,address)\":[{\"details\":\"The error indicating an unsupported interface.\",\"params\":{\"addr\":\"The address where the unsupported interface was encountered.\",\"interfaceId\":\"The bytes4 interface identifier that is not supported.\"}}],\"ErrVoteIsFinalized()\":[{\"details\":\"Error thrown when attempting to interact with a finalized vote.\"}],\"ErrZeroAddress(bytes4)\":[{\"details\":\"Error indicating that given address is null when it should not.\"}],\"ErrZeroCodeContract(address)\":[{\"details\":\"Error of set to non-contract.\"}]},\"events\":{\"BridgeOperatorAddingFailed(address)\":{\"details\":\"Emitted when a bridge operator is failed to add.\"},\"BridgeOperatorRemovingFailed(address)\":{\"details\":\"Emitted when a bridge operator is failed to remove.\"},\"BridgeOperatorUpdated(address,address,address)\":{\"details\":\"Emitted when a bridge operator is updated.\"},\"BridgeOperatorsAdded(bool[],uint96[],address[],address[])\":{\"details\":\"Emitted when new bridge operators are added.\"},\"BridgeOperatorsRemoved(bool[],address[])\":{\"details\":\"Emitted when bridge operators are removed.\"},\"ContractUpdated(uint8,address)\":{\"details\":\"Emitted when a contract is updated.\"},\"GlobalProposalCreated(uint256,bytes32,(uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),bytes32,(uint256,uint256,address,uint8[],uint256[],bytes[],uint256[]),address)\":{\"details\":\"Emitted when a proposal is created\"},\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"MinRequiredGovernorUpdated(uint256)\":{\"details\":\"Emitted when the minimum number of required governors is updated.\"},\"Notified(bytes,address[],bool[],bytes[])\":{\"details\":\"Emitted when the contract notifies multiple registers with statuses and return data.\"},\"ProposalApproved(bytes32)\":{\"details\":\"Emitted when the proposal is approved\"},\"ProposalCreated(uint256,uint256,bytes32,(uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),address)\":{\"details\":\"Emitted when a proposal is created\"},\"ProposalExecuted(bytes32,bool[],bytes[])\":{\"details\":\"Emitted when the proposal is executed\"},\"ProposalExpired(bytes32)\":{\"details\":\"Emitted when the vote is expired\"},\"ProposalExpiryDurationChanged(uint256)\":{\"details\":\"Emitted when the proposal expiry duration is changed.\"},\"ProposalRejected(bytes32)\":{\"details\":\"Emitted when the vote is reject\"},\"ProposalVoted(bytes32,address,uint8,uint256)\":{\"details\":\"Emitted when the proposal is voted\"},\"TargetOptionUpdated(uint8,address)\":{\"details\":\"Emitted when the target options are updated\"},\"ThresholdUpdated(uint256,uint256,uint256,uint256,uint256)\":{\"details\":\"Emitted when the threshold is updated\"}},\"kind\":\"dev\",\"methods\":{\"addBridgeOperators(uint96[],address[],address[])\":{\"details\":\"Adds multiple bridge operators.\",\"params\":{\"bridgeOperators\":\"An array of addresses representing the bridge operators to add.\",\"governors\":\"An array of addresses of hot/cold wallets for bridge operator to update their node address.\"}},\"checkThreshold(uint256)\":{\"details\":\"Checks whether the `_voteWeight` passes the threshold.\"},\"getBridgeOperatorWeight(address)\":{\"details\":\"External function to retrieve the vote weight of a specific bridge operator.\",\"params\":{\"bridgeOperator\":\"The address of the bridge operator to get the vote weight for.\"},\"returns\":{\"weight\":\"The vote weight of the specified bridge operator.\"}},\"getBridgeOperators()\":{\"details\":\"Returns an array of all bridge operators.\",\"returns\":{\"_0\":\"An array containing the addresses of all bridge operators.\"}},\"getCallbackRegisters()\":{\"details\":\"Retrieves the addresses of registered callbacks.\",\"returns\":{\"registers\":\"An array containing the addresses of registered callbacks.\"}},\"getContract(uint8)\":{\"details\":\"Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.\",\"params\":{\"contractType\":\"The role of the contract to retrieve.\"},\"returns\":{\"contract_\":\"The address of the contract with the specified role.\"}},\"getFullBridgeOperatorInfos()\":{\"details\":\"Retrieves the full information of all registered bridge operators. This external function allows external callers to obtain the full information of all the registered bridge operators. The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.\",\"returns\":{\"bridgeOperators\":\"An array of addresses representing the registered bridge operators.\",\"governors\":\"An array of addresses representing the governors of each bridge operator.\",\"weights\":\"An array of uint256 values representing the vote weights of each bridge operator. Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator. Example Usage: ``` (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos(); for (uint256 i = 0; i < bridgeOperators.length; i++) { // Access individual information for each bridge operator. address governor = governors[i]; address bridgeOperator = bridgeOperators[i]; uint256 weight = weights[i]; // ... (Process or use the information as required) ... } ```\"}},\"getGlobalProposalSignatures(uint256)\":{\"details\":\"See {CommonGovernanceProposal-_getProposalSignatures}\"},\"getGovernorOf(address)\":{\"details\":\"Returns the corresponding `governor` of a `operator`.\"},\"getGovernorWeight(address)\":{\"details\":\"External function to retrieve the vote weight of a specific governor.\",\"params\":{\"governor\":\"The address of the governor to get the vote weight for.\"},\"returns\":{\"weight\":\"voteWeight The vote weight of the specified governor.\"}},\"getGovernorWeights(address[])\":{\"details\":\"Returns the weights of a list of governor addresses.\"},\"getGovernors()\":{\"details\":\"Returns an array of all governors.\",\"returns\":{\"_0\":\"An array containing the addresses of all governors.\"}},\"getOperatorOf(address)\":{\"details\":\"Returns the corresponding `operator` of a `governor`.\"},\"getProposalSignatures(uint256,uint256)\":{\"details\":\"See {CommonGovernanceProposal-_getProposalSignatures}\"},\"getThreshold()\":{\"details\":\"Returns the threshold.\"},\"getTotalWeight()\":{\"details\":\"Returns total weights.\"},\"globalProposalVoted(uint256,address)\":{\"details\":\"See {CommonGovernanceProposal-_proposalVoted}\"},\"isBridgeOperator(address)\":{\"details\":\"Checks if the given address is a bridge operator.\",\"params\":{\"addr\":\"The address to check.\"},\"returns\":{\"_0\":\"A boolean indicating whether the address is a bridge operator.\"}},\"minimumVoteWeight()\":{\"details\":\"Returns the minimum vote weight to pass the threshold.\"},\"proposalVoted(uint256,uint256,address)\":{\"details\":\"See {CommonGovernanceProposal-_proposalVoted}\"},\"registerCallbacks(address[])\":{\"details\":\"Registers multiple callbacks with the bridge.\",\"params\":{\"registers\":\"The array of callback addresses to register.\"}},\"removeBridgeOperators(address[])\":{\"details\":\"Removes multiple bridge operators.\",\"params\":{\"bridgeOperators\":\"An array of addresses representing the bridge operators to remove.\"}},\"resolveTargets(uint8[])\":{\"details\":\"Returns corresponding address of target options. Return address(0) on non-existent target.\"},\"setContract(uint8,address)\":{\"details\":\"Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.\",\"params\":{\"addr\":\"The address of the contract to set.\",\"contractType\":\"The role of the contract to set.\"}},\"setMinRequiredGovernor(uint256)\":{\"details\":\"Self-call to update the minimum required governor.\",\"params\":{\"min\":\"The minimum number, this must not less than 3.\"}},\"setThreshold(uint256,uint256)\":{\"details\":\"Sets the threshold. Requirements: - The method caller is admin. Emits the `ThresholdUpdated` event.\"},\"sumGovernorsWeight(address[])\":{\"details\":\"Returns total weights of the governor list.\"},\"totalBridgeOperator()\":{\"details\":\"Returns the total number of bridge operators.\",\"returns\":{\"_0\":\"The total number of bridge operators.\"}},\"unregisterCallbacks(address[])\":{\"details\":\"Unregisters multiple callbacks from the bridge.\",\"params\":{\"registers\":\"The array of callback addresses to unregister.\"}},\"updateManyTargetOption(uint8[],address[])\":{\"details\":\"Updates list of `targetOptions` to `targets`. Requirement: - Only allow self-call through proposal.\"}},\"version\":1},\"userdoc\":{\"errors\":{\"ErrBelowMinRequiredGovernors()\":[{\"notice\":\"Error indicating that the governors list will go below minimum number of required governor.\"}],\"ErrGovernorNotFound(address)\":[{\"notice\":\"Error indicating that cannot find the querying governor\"}],\"ErrGovernorNotMatch(address,address)\":[{\"notice\":\"Error indicating that the msg.sender is not match the required governor\"}],\"ErrInvalidInput()\":[{\"notice\":\"Common invalid input error\"}],\"ErrOperatorNotFound(address)\":[{\"notice\":\"Error indicating that cannot find the querying operator\"}]},\"kind\":\"user\",\"methods\":{\"round(uint256)\":{\"notice\":\"chain id = 0 for global proposal\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/ronin/gateway/RoninBridgeManagerConstructor.sol\":\"RoninBridgeManagerConstructor\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[\":@fdk/=lib/foundry-deployment-kit/script/\",\":@openzeppelin/=lib/openzeppelin-contracts/\",\":@prb/math/=lib/prb-math/\",\":@prb/test/=lib/prb-test/src/\",\":@ronin/contracts/=src/\",\":@ronin/script/=script/\",\":@ronin/test/=test/\",\":contract-libs/=lib/foundry-deployment-kit/lib/contract-libs/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/foundry-deployment-kit/lib/forge-std/src/\",\":foundry-deployment-kit/=lib/foundry-deployment-kit/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/contracts/\",\":prb-math/=lib/prb-math/src/\",\":prb-test/=lib/prb-test/src/\",\":solady/=lib/solady/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0xa6a787e7a901af6511e19aa53e1a00352db215a011d2c7a438d0582dd5da76f9\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2a21b14ff90012878752f230d3ffd5c3405e5938d06c97a7d89c0a64561d0d66\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _HEX_SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n // Inspired by OraclizeAPI's implementation - MIT licence\\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\\n\\n if (value == 0) {\\n return \\\"0\\\";\\n }\\n uint256 temp = value;\\n uint256 digits;\\n while (temp != 0) {\\n digits++;\\n temp /= 10;\\n }\\n bytes memory buffer = new bytes(digits);\\n while (value != 0) {\\n digits -= 1;\\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\\n value /= 10;\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n if (value == 0) {\\n return \\\"0x00\\\";\\n }\\n uint256 temp = value;\\n uint256 length = 0;\\n while (temp != 0) {\\n length++;\\n temp >>= 8;\\n }\\n return toHexString(value, length);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xaf159a8b1923ad2a26d516089bceca9bdeaeacd04be50983ea00ba63070f08a3\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.3) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSA {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n } else if (error == RecoverError.InvalidSignatureV) {\\n revert(\\\"ECDSA: invalid signature 'v' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n if (v != 27 && v != 28) {\\n return (address(0), RecoverError.InvalidSignatureV);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", Strings.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0xdb7f5c28fc61cda0bd8ab60ce288e206b791643bcd3ba464a70cbec18895a2f5\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n *\\n * [WARNING]\\n * ====\\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.\\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\\n *\\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.\\n * ====\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n bytes32 lastValue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastValue;\\n // Update the index for the moved value\\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n return set._values[index];\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function _values(Set storage set) private view returns (bytes32[] memory) {\\n return set._values;\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\\n return _values(set._inner);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(AddressSet storage set) internal view returns (address[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n address[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(UintSet storage set) internal view returns (uint256[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n uint256[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0x5050943b32b6a8f282573d166b2e9d87ab7eb4dbba4ab6acf36ecb54fe6995e4\",\"license\":\"MIT\"},\"src/extensions/TransparentUpgradeableProxyV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\\\";\\n\\ncontract TransparentUpgradeableProxyV2 is TransparentUpgradeableProxy {\\n constructor(address _logic, address admin_, bytes memory _data) payable TransparentUpgradeableProxy(_logic, admin_, _data) { }\\n\\n /**\\n * @dev Calls a function from the current implementation as specified by `_data`, which should be an encoded function call.\\n *\\n * Requirements:\\n * - Only the admin can call this function.\\n *\\n * Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid\\n * triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider\\n * reviewing the encoded data `_data` and the method which is called before using this.\\n *\\n */\\n function functionDelegateCall(bytes memory _data) public payable ifAdmin {\\n address _addr = _implementation();\\n assembly {\\n let _result := delegatecall(gas(), _addr, add(_data, 32), mload(_data), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n switch _result\\n case 0 { revert(0, returndatasize()) }\\n default { return(0, returndatasize()) }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x45fc7b71d09da99414b977a56e586b3604670d865e5f36f395d5c98bc4ba64af\",\"license\":\"MIT\"},\"src/extensions/bridge-operator-governance/BridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.23;\\n\\nimport { Initializable } from \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport { IBridgeManagerCallback, BridgeManagerCallbackRegister } from \\\"./BridgeManagerCallbackRegister.sol\\\";\\nimport { IHasContracts, HasContracts } from \\\"../../extensions/collections/HasContracts.sol\\\";\\n\\nimport { IBridgeManager } from \\\"../../interfaces/bridge/IBridgeManager.sol\\\";\\nimport { AddressArrayUtils } from \\\"../../libraries/AddressArrayUtils.sol\\\";\\nimport { ContractType } from \\\"../../utils/ContractType.sol\\\";\\nimport { RoleAccess } from \\\"../../utils/RoleAccess.sol\\\";\\nimport { TUint256Slot } from \\\"../../types/Types.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\nimport \\\"./BridgeManagerQuorum.sol\\\";\\n\\nabstract contract BridgeManager is IBridgeManager, BridgeManagerQuorum, BridgeManagerCallbackRegister {\\n using AddressArrayUtils for address[];\\n\\n struct BridgeManagerStorage {\\n /// @notice List of the governors.\\n /// @dev We do not use EnumerableSet here to maintain identical order of `governors` and `operators`. If `.contains` is needed, use the corresponding weight mapping.\\n address[] _governors;\\n address[] _operators;\\n /// @dev Mapping from address to the governor weight\\n mapping(address governor => uint96 weight) _governorWeight;\\n /// @dev Mapping from address to the operator weight. This must always be identical `_governorWeight`.\\n mapping(address operator => uint96 weight) _operatorWeight;\\n /// @dev Total weight of all governors / operators.\\n uint256 _totalWeight;\\n /// @dev The minimum number of governors that must exist in the contract, to avoid the contract become non-accessible.\\n uint256 _minRequiredGovernor;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"ronin.storage.BridgeManagerStorageLocation\\\")) - 1)) & ~bytes32(uint256(0xff))\\n bytes32 private constant $$_BridgeManagerStorageLocation = 0xc648703095712c0419b6431ae642c061f0a105ac2d7c3d9604061ef4ebc38300;\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n bytes32 public DOMAIN_SEPARATOR;\\n\\n modifier onlyGovernor() virtual {\\n _requireGovernor(msg.sender);\\n _;\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n function __BridgeManager_init(\\n uint256 num,\\n uint256 denom,\\n uint256 roninChainId,\\n address bridgeContract,\\n address[] memory callbackRegisters,\\n address[] memory bridgeOperators,\\n address[] memory governors,\\n uint96[] memory voteWeights\\n ) internal onlyInitializing {\\n __BridgeManagerQuorum_init_unchained(num, denom);\\n __BridgeManagerCallbackRegister_init_unchained(callbackRegisters);\\n __BridgeManager_init_unchained(roninChainId, bridgeContract, bridgeOperators, governors, voteWeights);\\n }\\n\\n function __BridgeManager_init_unchained(\\n uint256 roninChainId,\\n address bridgeContract,\\n address[] memory bridgeOperators,\\n address[] memory governors,\\n uint96[] memory voteWeights\\n ) internal onlyInitializing {\\n _setContract(ContractType.BRIDGE, bridgeContract);\\n\\n DOMAIN_SEPARATOR = keccak256(\\n abi.encode(\\n keccak256(\\\"EIP712Domain(string name,string version,bytes32 salt)\\\"),\\n keccak256(\\\"BridgeManager\\\"), // name hash\\n keccak256(\\\"3\\\"), // version hash\\n keccak256(abi.encode(\\\"BRIDGE_MANAGER\\\", roninChainId)) // salt\\n )\\n );\\n\\n _addBridgeOperators(voteWeights, governors, bridgeOperators);\\n _setMinRequiredGovernor(3);\\n }\\n\\n function _getBridgeManagerStorage() private pure returns (BridgeManagerStorage storage $) {\\n assembly {\\n $.slot := $$_BridgeManagerStorageLocation\\n }\\n }\\n\\n // ===================== CONFIG ========================\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function setContract(ContractType contractType, address addr) external override onlyProxyAdmin {\\n _requireHasCode(addr);\\n _setContract(contractType, addr);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function setMinRequiredGovernor(uint min) external override onlyProxyAdmin {\\n _setMinRequiredGovernor(min);\\n }\\n\\n function _setMinRequiredGovernor(uint min) internal {\\n if (min < 3) revert ErrInvalidInput();\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n $._minRequiredGovernor = min;\\n emit MinRequiredGovernorUpdated(min);\\n }\\n\\n /**\\n * @dev Internal function to require that the caller has governor role access.\\n */\\n function _requireGovernor(address addr) internal view {\\n if (_getGovernorWeight(addr) == 0) {\\n revert ErrUnauthorized(msg.sig, RoleAccess.GOVERNOR);\\n }\\n }\\n\\n // ===================== WEIGHTS METHOD ========================\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getTotalWeight() public view returns (uint256) {\\n return _totalWeight();\\n }\\n\\n function _totalWeight() internal view override returns (uint256) {\\n return _getBridgeManagerStorage()._totalWeight;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getGovernorWeights(address[] calldata governors) external view returns (uint96[] memory weights) {\\n weights = _getGovernorWeights(governors);\\n }\\n\\n /**\\n * @dev Internal function to get the vote weights of a given array of governors.\\n */\\n function _getGovernorWeights(address[] memory governors) internal view returns (uint96[] memory weights) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n weights = new uint96[](governors.length);\\n\\n for (uint256 i; i < governors.length; i++) {\\n weights[i] = $._governorWeight[governors[i]];\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getGovernorWeight(address governor) external view returns (uint96 weight) {\\n weight = _getGovernorWeight(governor);\\n }\\n\\n /**\\n * @dev Internal function to retrieve the vote weight of a specific governor.\\n */\\n function _getGovernorWeight(address governor) internal view returns (uint96) {\\n return _getBridgeManagerStorage()._governorWeight[governor];\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function sumGovernorsWeight(address[] calldata governors) external view nonDuplicate(governors) returns (uint256 sum) {\\n sum = _sumGovernorsWeight(governors);\\n }\\n\\n /**\\n * @dev Internal function to calculate the sum of vote weights for a given array of governors.\\n * @param governors The non-duplicated input.\\n */\\n function _sumGovernorsWeight(address[] memory governors) internal view nonDuplicate(governors) returns (uint256 sum) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n for (uint256 i; i < governors.length; i++) {\\n sum += $._governorWeight[governors[i]];\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint96 weight) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n return $._operatorWeight[bridgeOperator];\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function minimumVoteWeight() public view virtual returns (uint256) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n (uint256 numerator, uint256 denominator) = getThreshold();\\n return (numerator * $._totalWeight + denominator - 1) / denominator;\\n }\\n\\n // ===================== MANAGER CRUD ========================\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function addBridgeOperators(uint96[] calldata voteWeights, address[] calldata governors, address[] calldata bridgeOperators) external onlyProxyAdmin {\\n _addBridgeOperators(voteWeights, governors, bridgeOperators);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function removeBridgeOperators(address[] calldata bridgeOperators) external onlyProxyAdmin {\\n _removeBridgeOperators(bridgeOperators);\\n }\\n\\n /**\\n * @dev Internal function to add bridge operators.\\n *\\n * This function adds the specified `bridgeOperators` to the bridge operator set and establishes the associated mappings.\\n *\\n * Requirements:\\n * - The caller must have the necessary permission to add bridge operators.\\n * - The lengths of `voteWeights`, `governors`, and `bridgeOperators` arrays must be equal.\\n *\\n * @return addeds An array of boolean values indicating whether each bridge operator was successfully added.\\n */\\n function _addBridgeOperators(\\n uint96[] memory voteWeights,\\n address[] memory newGovernors,\\n address[] memory newOperators\\n ) internal nonDuplicate(newGovernors.extend(newOperators)) returns (bool[] memory addeds) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n uint256 length = newOperators.length;\\n if (!(length == voteWeights.length && length == newGovernors.length)) revert ErrLengthMismatch(msg.sig);\\n addeds = new bool[](length);\\n\\n // simply skip add operations if inputs are empty.\\n if (length == 0) return addeds;\\n\\n address iGovernor;\\n address iOperator;\\n uint96 iVoteWeight;\\n uint256 accumulatedWeight;\\n\\n for (uint256 i; i < length; i++) {\\n iGovernor = newGovernors[i];\\n iOperator = newOperators[i];\\n iVoteWeight = voteWeights[i];\\n\\n // Check non-zero inputs\\n _requireNonZeroAddress(iGovernor);\\n _requireNonZeroAddress(iOperator);\\n if (iVoteWeight == 0) revert ErrInvalidVoteWeight(msg.sig);\\n\\n // Check not yet added operators\\n addeds[i] = ($._governorWeight[iGovernor] + $._governorWeight[iOperator] + $._operatorWeight[iOperator] + $._operatorWeight[iGovernor]) == 0;\\n\\n // Only add the valid operator\\n if (addeds[i]) {\\n // Add governor to list, update governor weight\\n $._governors.push(iGovernor);\\n $._governorWeight[iGovernor] = iVoteWeight;\\n\\n // Add operator to list, update governor weight\\n $._operators.push(iOperator);\\n $._operatorWeight[iOperator] = iVoteWeight;\\n\\n accumulatedWeight += iVoteWeight;\\n }\\n }\\n\\n $._totalWeight += accumulatedWeight;\\n\\n _notifyRegisters(IBridgeManagerCallback.onBridgeOperatorsAdded.selector, abi.encode(newOperators, voteWeights, addeds));\\n\\n emit BridgeOperatorsAdded(addeds, voteWeights, newGovernors, newOperators);\\n }\\n\\n /**\\n * @dev Internal function to remove bridge operators.\\n *\\n * This function removes the specified `bridgeOperators` from the bridge operator set and related mappings.\\n *\\n * Requirements:\\n * - The caller must have the necessary permission to remove bridge operators.\\n *\\n * @param removingOperators An array of addresses representing the bridge operators to be removed.\\n * @return removeds An array of boolean values indicating whether each bridge operator was successfully removed.\\n */\\n function _removeBridgeOperators(address[] memory removingOperators) internal nonDuplicate(removingOperators) returns (bool[] memory removeds) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n uint256 length = removingOperators.length;\\n removeds = new bool[](length);\\n\\n // simply skip remove operations if inputs are empty.\\n if (length == 0) return removeds;\\n if ($._governors.length - length < $._minRequiredGovernor) {\\n revert ErrBelowMinRequiredGovernors();\\n }\\n\\n address iGovernor;\\n address iOperator;\\n uint256 accumulatedWeight;\\n uint idx;\\n\\n for (uint256 i; i < length; i++) {\\n iOperator = removingOperators[i];\\n\\n // Check non-zero inputs\\n (iGovernor, idx) = _getGovernorOf(iOperator);\\n _requireNonZeroAddress(iGovernor);\\n _requireNonZeroAddress(iOperator);\\n\\n // Check existing operators\\n removeds[i] = $._governorWeight[iGovernor] > 0 && $._operatorWeight[iOperator] > 0;\\n\\n // Only remove the valid operator\\n if (removeds[i]) {\\n uint removingVoteWeight = $._governorWeight[iGovernor];\\n\\n // Remove governor from list, update governor weight\\n uint lastIdx = $._governors.length - 1;\\n $._governors[idx] = $._governors[lastIdx];\\n $._governors.pop();\\n delete $._governorWeight[iGovernor];\\n\\n // Remove operator from list, update operator weight\\n $._operators[idx] = $._operators[lastIdx];\\n $._operators.pop();\\n delete $._operatorWeight[iOperator];\\n\\n accumulatedWeight += removingVoteWeight;\\n }\\n }\\n\\n $._totalWeight -= accumulatedWeight;\\n\\n _notifyRegisters(IBridgeManagerCallback.onBridgeOperatorsRemoved.selector, abi.encode(removingOperators, removeds));\\n\\n emit BridgeOperatorsRemoved(removeds, removingOperators);\\n }\\n\\n function _findInArray(address[] storage $_array, address addr) internal view returns (bool found, uint idx) {\\n for (uint i; i < $_array.length; i++) {\\n if (addr == $_array[i]) {\\n return (true, i);\\n }\\n }\\n\\n return (false, type(uint256).max);\\n }\\n\\n // ================= MANAGER VIEW METHODS =============\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function totalBridgeOperator() external view returns (uint256) {\\n return _getBridgeManagerStorage()._operators.length;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function isBridgeOperator(address addr) external view returns (bool) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n return $._operatorWeight[addr] > 0;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getBridgeOperators() external view returns (address[] memory) {\\n return _getBridgeManagerStorage()._operators;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getGovernors() external view returns (address[] memory) {\\n return _getBridgeManagerStorage()._governors;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getOperatorOf(address governor) external view returns (address operator) {\\n (bool found, uint idx) = _findInArray(_getBridgeManagerStorage()._governors, governor);\\n if (!found) revert ErrGovernorNotFound(governor);\\n\\n return _getBridgeManagerStorage()._operators[idx];\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getGovernorOf(address operator) external view returns (address governor) {\\n (governor,) = _getGovernorOf(operator);\\n }\\n\\n function _getGovernorOf(address operator) internal view returns (address governor, uint idx) {\\n (bool found, uint foundId) = _findInArray(_getBridgeManagerStorage()._operators, operator);\\n if (!found) revert ErrOperatorNotFound(operator);\\n\\n return (_getBridgeManagerStorage()._governors[foundId], foundId);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getFullBridgeOperatorInfos() external view returns (address[] memory governors, address[] memory bridgeOperators, uint96[] memory weights) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n governors = $._governors;\\n bridgeOperators = $._operators;\\n weights = _getGovernorWeights(governors);\\n }\\n}\\n\",\"keccak256\":\"0xa66d73d33f953f3262714999043f99fb7b7542d1d29c481e376d9ecd2b15b28b\",\"license\":\"MIT\"},\"src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { Initializable } from \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport { EnumerableSet } from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\nimport { IBridgeManagerCallbackRegister } from \\\"../../interfaces/bridge/IBridgeManagerCallbackRegister.sol\\\";\\nimport { IBridgeManagerCallback } from \\\"../../interfaces/bridge/IBridgeManagerCallback.sol\\\";\\nimport { HasContracts } from \\\"../../extensions/collections/HasContracts.sol\\\";\\nimport { TransparentUpgradeableProxyV2, IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\n\\n/**\\n * @title BridgeManagerCallbackRegister\\n * @dev A contract that manages callback registrations and execution for a bridge.\\n */\\nabstract contract BridgeManagerCallbackRegister is IBridgeManagerCallbackRegister, IdentityGuard, Initializable, HasContracts {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n /**\\n * @dev Storage slot for the address set of callback registers.\\n * @dev Value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeAdmin.callbackRegisters.slot\\\") - 1.\\n */\\n bytes32 private constant CALLBACK_REGISTERS_SLOT = 0x5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd976240;\\n\\n function __BridgeManagerCallbackRegister_init_unchained(address[] memory callbackRegisters) internal onlyInitializing {\\n _registerCallbacks(callbackRegisters);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallbackRegister\\n */\\n function registerCallbacks(address[] calldata registers) external onlyProxyAdmin {\\n _registerCallbacks(registers);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallbackRegister\\n */\\n function unregisterCallbacks(address[] calldata registers) external onlyProxyAdmin nonDuplicate(registers) {\\n EnumerableSet.AddressSet storage _callbackRegisters = _getCallbackRegisters();\\n\\n for (uint256 i; i < registers.length; i++) {\\n _callbackRegisters.remove(registers[i]);\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallbackRegister\\n */\\n function getCallbackRegisters() external view returns (address[] memory registers) {\\n registers = _getCallbackRegisters().values();\\n }\\n\\n /**\\n * @dev Internal function to register multiple callbacks with the bridge.\\n * @param registers The array of callback addresses to register.\\n */\\n function _registerCallbacks(address[] memory registers) internal nonDuplicate(registers) {\\n EnumerableSet.AddressSet storage _callbackRegisters = _getCallbackRegisters();\\n address register;\\n bool regSuccess;\\n\\n for (uint256 i; i < registers.length; i++) {\\n register = registers[i];\\n\\n _requireHasCode(register);\\n _requireSupportsInterface(register, type(IBridgeManagerCallback).interfaceId);\\n\\n regSuccess = _callbackRegisters.add(register);\\n\\n emit CallbackRegistered(register, regSuccess);\\n }\\n }\\n\\n /**\\n * @dev Same as {_notifyRegistersUnsafe} but revert when there at least one failed internal call.\\n */\\n function _notifyRegisters(bytes4 callbackFnSig, bytes memory inputs) internal {\\n if (!_notifyRegistersUnsafe(callbackFnSig, inputs)) {\\n revert ErrExistOneInternalCallFailed(msg.sender, callbackFnSig, inputs);\\n }\\n }\\n\\n /**\\n * @dev Internal function to notify all registered callbacks with the provided function signature and data.\\n * @param callbackFnSig The function signature of the callback method.\\n * @param inputs The data to pass to the callback method.\\n * @return allSuccess Return true if all internal calls are success\\n */\\n function _notifyRegistersUnsafe(bytes4 callbackFnSig, bytes memory inputs) internal returns (bool allSuccess) {\\n allSuccess = true;\\n\\n address[] memory registers = _getCallbackRegisters().values();\\n uint256 length = registers.length;\\n if (length == 0) return allSuccess;\\n\\n bool[] memory successes = new bool[](length);\\n bytes[] memory returnDatas = new bytes[](length);\\n bytes memory callData = abi.encodePacked(callbackFnSig, inputs);\\n bytes memory proxyCallData = abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (callData));\\n\\n for (uint256 i; i < length; i++) {\\n // First, attempt to call normally\\n (successes[i], returnDatas[i]) = registers[i].call(callData);\\n\\n // If cannot call normally, attempt to call as the recipient is the proxy, and this caller is its admin.\\n if (!successes[i]) {\\n (successes[i], returnDatas[i]) = registers[i].call(proxyCallData);\\n allSuccess = allSuccess && successes[i];\\n }\\n }\\n\\n emit Notified(callData, registers, successes, returnDatas);\\n }\\n\\n /**\\n * @dev Internal function to retrieve the address set of callback registers.\\n * @return callbackRegisters The storage reference to the callback registers.\\n */\\n function _getCallbackRegisters() internal pure returns (EnumerableSet.AddressSet storage callbackRegisters) {\\n assembly (\\\"memory-safe\\\") {\\n callbackRegisters.slot := CALLBACK_REGISTERS_SLOT\\n }\\n }\\n}\\n\",\"keccak256\":\"0xee1c849d6b50cda917d6c918a23116cc288488958f58ef215707204e7c2f847f\",\"license\":\"MIT\"},\"src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.23;\\n\\nimport { Initializable } from \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport { IQuorum } from \\\"../../interfaces/IQuorum.sol\\\";\\nimport { IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\nimport { HasContracts } from \\\"../../extensions/collections/HasContracts.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\n\\nabstract contract BridgeManagerQuorum is IQuorum, IdentityGuard, Initializable, HasContracts {\\n struct BridgeManagerQuorumStorage {\\n uint256 _nonce;\\n uint256 _numerator;\\n uint256 _denominator;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"ronin.storage.BridgeManagerQuorumStorage\\\")) - 1)) & ~bytes32(uint256(0xff))\\n bytes32 private constant $$_BridgeManagerQuorumStorage = 0xf3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00;\\n\\n function __BridgeManagerQuorum_init_unchained(uint256 num, uint256 denom) internal onlyInitializing {\\n BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage();\\n $._nonce = 1;\\n\\n _setThreshold(num, denom);\\n }\\n\\n function _getBridgeManagerQuorumStorage() private pure returns (BridgeManagerQuorumStorage storage $) {\\n assembly {\\n $.slot := $$_BridgeManagerQuorumStorage\\n }\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function setThreshold(uint256 num, uint256 denom) external override onlyProxyAdmin {\\n _setThreshold(num, denom);\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function getThreshold() public view virtual returns (uint256 num, uint256 denom) {\\n BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage();\\n return ($._numerator, $._denominator);\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function checkThreshold(uint256 voteWeight) external view virtual returns (bool) {\\n BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage();\\n\\n return voteWeight * $._denominator >= $._numerator * _totalWeight();\\n }\\n\\n /**\\n * @dev Sets threshold and returns the old one.\\n *\\n * Emits the `ThresholdUpdated` event.\\n *\\n */\\n function _setThreshold(uint256 num, uint256 denom) internal virtual {\\n if (num > denom || denom <= 1) revert ErrInvalidThreshold(msg.sig);\\n\\n BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage();\\n\\n uint256 prevNum = $._numerator;\\n uint256 prevDenom = $._denominator;\\n\\n $._numerator = num;\\n $._denominator = denom;\\n\\n emit ThresholdUpdated($._nonce++, num, denom, prevNum, prevDenom);\\n }\\n\\n function _totalWeight() internal view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0xd49face0efa89eac09d2d6a5eb69598fd706ba1aac8d431b22212643a507b74e\",\"license\":\"MIT\"},\"src/extensions/collections/HasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { HasProxyAdmin } from \\\"./HasProxyAdmin.sol\\\";\\nimport \\\"../../interfaces/collections/IHasContracts.sol\\\";\\nimport { IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\nimport { ErrUnexpectedInternalCall } from \\\"../../utils/CommonErrors.sol\\\";\\n\\n/**\\n * @title HasContracts\\n * @dev A contract that provides functionality to manage multiple contracts with different roles.\\n */\\nabstract contract HasContracts is HasProxyAdmin, IHasContracts, IdentityGuard {\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.collections.HasContracts.slot\\\") - 1\\n bytes32 private constant _STORAGE_SLOT = 0xdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb;\\n\\n /**\\n * @dev Modifier to restrict access to functions only to contracts with a specific role.\\n * @param contractType The contract type that allowed to call\\n */\\n modifier onlyContract(ContractType contractType) virtual {\\n _requireContract(contractType);\\n _;\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function setContract(ContractType contractType, address addr) external virtual onlyProxyAdmin {\\n _requireHasCode(addr);\\n _setContract(contractType, addr);\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function getContract(ContractType contractType) public view returns (address contract_) {\\n contract_ = _getContractMap()[uint8(contractType)];\\n if (contract_ == address(0)) revert ErrContractTypeNotFound(contractType);\\n }\\n\\n /**\\n * @dev Internal function to set the address of a contract with a specific role.\\n * @param contractType The contract type of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function _setContract(ContractType contractType, address addr) internal virtual {\\n _getContractMap()[uint8(contractType)] = addr;\\n emit ContractUpdated(contractType, addr);\\n }\\n\\n /**\\n * @dev Internal function to access the mapping of contract addresses with roles.\\n * @return contracts_ The mapping of contract addresses with roles.\\n */\\n function _getContractMap() private pure returns (mapping(uint8 => address) storage contracts_) {\\n assembly {\\n contracts_.slot := _STORAGE_SLOT\\n }\\n }\\n\\n /**\\n * @dev Internal function to check if the calling contract has a specific role.\\n * @param contractType The contract type that the calling contract must have.\\n * @dev Throws an error if the calling contract does not have the specified role.\\n */\\n function _requireContract(ContractType contractType) private view {\\n if (msg.sender != getContract(contractType)) {\\n revert ErrUnexpectedInternalCall(msg.sig, contractType, msg.sender);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7dbefa31230e6e4bd319f02d94893cbfd07ee12a0e016f5fadc57660df01891\",\"license\":\"MIT\"},\"src/extensions/collections/HasProxyAdmin.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/StorageSlot.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\n\\nabstract contract HasProxyAdmin {\\n // bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n modifier onlyProxyAdmin() {\\n _requireProxyAdmin();\\n _;\\n }\\n\\n /**\\n * @dev Returns proxy admin.\\n */\\n function _getProxyAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n function _requireProxyAdmin() internal view {\\n if (msg.sender != _getProxyAdmin()) revert ErrUnauthorized(msg.sig, RoleAccess.ADMIN);\\n }\\n}\\n\",\"keccak256\":\"0xad3db02c99a960b60151f2ad45eed46073d14fe1ed861f496c7aeefacbbc528e\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/CoreGovernance.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport \\\"../../libraries/Proposal.sol\\\";\\nimport \\\"../../libraries/GlobalProposal.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\nimport \\\"../../libraries/Ballot.sol\\\";\\nimport \\\"../../interfaces/consumers/ChainTypeConsumer.sol\\\";\\nimport \\\"../../interfaces/consumers/SignatureConsumer.sol\\\";\\nimport \\\"../../interfaces/consumers/VoteStatusConsumer.sol\\\";\\n\\nabstract contract CoreGovernance is Initializable, SignatureConsumer, VoteStatusConsumer, ChainTypeConsumer {\\n using Proposal for Proposal.ProposalDetail;\\n\\n /**\\n * @dev Error thrown when attempting to interact with a finalized vote.\\n */\\n error ErrVoteIsFinalized();\\n\\n /**\\n * @dev Error thrown when the current proposal is not completed.\\n */\\n error ErrCurrentProposalIsNotCompleted();\\n\\n struct ProposalVote {\\n VoteStatus status;\\n bytes32 hash;\\n uint256 againstVoteWeight; // Total weight of against votes\\n uint256 forVoteWeight; // Total weight of for votes\\n address[] forVoteds; // Array of addresses voting for\\n address[] againstVoteds; // Array of addresses voting against\\n uint256 expiryTimestamp;\\n mapping(address => Signature) sig;\\n mapping(address => bool) voted;\\n }\\n\\n /// @dev Emitted when a proposal is created\\n event ProposalCreated(uint256 indexed chainId, uint256 indexed round, bytes32 indexed proposalHash, Proposal.ProposalDetail proposal, address creator);\\n /// @dev Emitted when the proposal is voted\\n event ProposalVoted(bytes32 indexed proposalHash, address indexed voter, Ballot.VoteType support, uint256 weight);\\n /// @dev Emitted when the proposal is approved\\n event ProposalApproved(bytes32 indexed proposalHash);\\n /// @dev Emitted when the vote is reject\\n event ProposalRejected(bytes32 indexed proposalHash);\\n /// @dev Emitted when the vote is expired\\n event ProposalExpired(bytes32 indexed proposalHash);\\n /// @dev Emitted when the proposal is executed\\n event ProposalExecuted(bytes32 indexed proposalHash, bool[] successCalls, bytes[] returnDatas);\\n /// @dev Emitted when the proposal expiry duration is changed.\\n event ProposalExpiryDurationChanged(uint256 indexed duration);\\n\\n /// @dev Mapping from chain id => vote round\\n /// @notice chain id = 0 for global proposal\\n mapping(uint256 => uint256) public round;\\n /// @dev Mapping from chain id => vote round => proposal vote\\n mapping(uint256 => mapping(uint256 => ProposalVote)) public vote;\\n\\n uint256 internal _proposalExpiryDuration;\\n\\n function __CoreGovernance_init(uint256 expiryDuration) internal onlyInitializing {\\n __CoreGovernance_init_unchained(expiryDuration);\\n }\\n\\n function __CoreGovernance_init_unchained(uint256 expiryDuration) internal onlyInitializing {\\n _setProposalExpiryDuration(expiryDuration);\\n }\\n\\n /**\\n * @dev Creates new voting round by calculating the `_round` number of chain `_chainId`.\\n * Increases the `_round` number if the previous one is not expired. Delete the previous proposal\\n * if it is expired and not increase the `_round`.\\n */\\n function _createVotingRound(uint256 _chainId) internal returns (uint256 _round) {\\n _round = round[_chainId];\\n // Skip checking for the first ever round\\n if (_round == 0) {\\n _round = round[_chainId] = 1;\\n } else {\\n ProposalVote storage _latestProposalVote = vote[_chainId][_round];\\n bool _isExpired = _tryDeleteExpiredVotingRound(_latestProposalVote);\\n // Skip increasing round number if the latest round is expired, allow the vote to be overridden\\n if (!_isExpired) {\\n if (_latestProposalVote.status == VoteStatus.Pending) revert ErrCurrentProposalIsNotCompleted();\\n unchecked {\\n _round = ++round[_chainId];\\n }\\n }\\n }\\n }\\n\\n /**\\n * @dev Saves new round voting for the proposal `_proposalHash` of chain `_chainId`.\\n */\\n function _saveVotingRound(ProposalVote storage _vote, bytes32 _proposalHash, uint256 _expiryTimestamp) internal {\\n _vote.hash = _proposalHash;\\n _vote.expiryTimestamp = _expiryTimestamp;\\n }\\n\\n /**\\n * @dev Proposes proposal struct.\\n *\\n * Requirements:\\n * - The chain id is not equal to 0.\\n * - The proposal nonce is equal to the new round.\\n *\\n * Emits the `ProposalCreated` event.\\n *\\n */\\n function _proposeProposalStruct(Proposal.ProposalDetail memory proposal, address creator) internal virtual returns (uint256 round_) {\\n uint256 chainId = proposal.chainId;\\n if (chainId == 0) revert ErrInvalidChainId(msg.sig, 0, block.chainid);\\n proposal.validate(_proposalExpiryDuration);\\n\\n bytes32 proposalHash = proposal.hash();\\n round_ = _createVotingRound(chainId);\\n _saveVotingRound(vote[chainId][round_], proposalHash, proposal.expiryTimestamp);\\n if (round_ != proposal.nonce) revert ErrInvalidProposalNonce(msg.sig);\\n emit ProposalCreated(chainId, round_, proposalHash, proposal, creator);\\n }\\n\\n /**\\n * @dev Casts vote for the proposal with data and returns whether the voting is done.\\n *\\n * Requirements:\\n * - The proposal nonce is equal to the round.\\n * - The vote is not finalized.\\n * - The voter has not voted for the round.\\n *\\n * Emits the `ProposalVoted` event. Emits the `ProposalApproved`, `ProposalExecuted` or `ProposalRejected` once the\\n * proposal is approved, executed or rejected.\\n *\\n */\\n function _castVote(\\n Proposal.ProposalDetail memory proposal,\\n Ballot.VoteType support,\\n uint256 minimumForVoteWeight,\\n uint256 minimumAgainstVoteWeight,\\n address voter,\\n Signature memory signature,\\n uint256 voterWeight\\n ) internal virtual returns (bool done) {\\n uint256 chainId = proposal.chainId;\\n uint256 round_ = proposal.nonce;\\n ProposalVote storage _vote = vote[chainId][round_];\\n\\n if (_tryDeleteExpiredVotingRound(_vote)) {\\n return true;\\n }\\n\\n if (round[proposal.chainId] != round_) revert ErrInvalidProposalNonce(msg.sig);\\n if (_vote.status != VoteStatus.Pending) revert ErrVoteIsFinalized();\\n if (_voted(_vote, voter)) revert ErrAlreadyVoted(voter);\\n\\n _vote.voted[voter] = true;\\n // Stores the signature if it is not empty\\n if (signature.r > 0 || signature.s > 0 || signature.v > 0) {\\n _vote.sig[voter] = signature;\\n }\\n emit ProposalVoted(_vote.hash, voter, support, voterWeight);\\n\\n uint256 _forVoteWeight;\\n uint256 _againstVoteWeight;\\n if (support == Ballot.VoteType.For) {\\n _vote.forVoteds.push(voter);\\n _forVoteWeight = _vote.forVoteWeight += voterWeight;\\n } else if (support == Ballot.VoteType.Against) {\\n _vote.againstVoteds.push(voter);\\n _againstVoteWeight = _vote.againstVoteWeight += voterWeight;\\n } else {\\n revert ErrUnsupportedVoteType(msg.sig);\\n }\\n\\n if (_forVoteWeight >= minimumForVoteWeight) {\\n done = true;\\n _vote.status = VoteStatus.Approved;\\n emit ProposalApproved(_vote.hash);\\n if (proposal.isAutoExecute()) {\\n _tryExecute(_vote, proposal);\\n }\\n } else if (_againstVoteWeight >= minimumAgainstVoteWeight) {\\n done = true;\\n _vote.status = VoteStatus.Rejected;\\n emit ProposalRejected(_vote.hash);\\n }\\n }\\n\\n /**\\n * @dev The specified executor executes the proposal on an approved proposal.\\n */\\n function _executeWithCaller(Proposal.ProposalDetail memory proposal, address caller) internal {\\n bytes32 proposalHash = proposal.hash();\\n ProposalVote storage _vote = vote[proposal.chainId][proposal.nonce];\\n\\n if (_vote.hash != proposalHash) {\\n revert ErrInvalidProposal(proposalHash, _vote.hash);\\n }\\n\\n if (_vote.status != VoteStatus.Approved) revert ErrProposalNotApproved();\\n if (caller != proposal.executor) revert ErrInvalidExecutor();\\n\\n _tryExecute(_vote, proposal);\\n }\\n\\n /**\\n * @dev When the contract is on Ronin chain, checks whether the proposal is expired and delete it if is expired.\\n *\\n * Emits the event `ProposalExpired` if the vote is expired.\\n *\\n * Note: This function assumes the vote `_proposalVote` is already created, consider verifying the vote's existence\\n * before or it will emit an unexpected event of `ProposalExpired`.\\n */\\n function _tryDeleteExpiredVotingRound(ProposalVote storage proposalVote) internal returns (bool isExpired) {\\n isExpired = _getChainType() == ChainType.RoninChain && proposalVote.status == VoteStatus.Pending && proposalVote.expiryTimestamp <= block.timestamp;\\n\\n if (isExpired) {\\n emit ProposalExpired(proposalVote.hash);\\n\\n for (uint256 _i; _i < proposalVote.forVoteds.length;) {\\n delete proposalVote.voted[proposalVote.forVoteds[_i]];\\n delete proposalVote.sig[proposalVote.forVoteds[_i]];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n for (uint256 _i; _i < proposalVote.againstVoteds.length;) {\\n delete proposalVote.voted[proposalVote.againstVoteds[_i]];\\n delete proposalVote.sig[proposalVote.againstVoteds[_i]];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n delete proposalVote.status;\\n delete proposalVote.hash;\\n delete proposalVote.againstVoteWeight;\\n delete proposalVote.forVoteWeight;\\n delete proposalVote.forVoteds;\\n delete proposalVote.againstVoteds;\\n delete proposalVote.expiryTimestamp;\\n }\\n }\\n\\n /**\\n * @dev Executes the proposal and update the vote status once the proposal is executable.\\n */\\n function _tryExecute(ProposalVote storage vote_, Proposal.ProposalDetail memory proposal) internal {\\n if (proposal.executable()) {\\n vote_.status = VoteStatus.Executed;\\n (bool[] memory _successCalls, bytes[] memory _returnDatas) = proposal.execute();\\n emit ProposalExecuted(vote_.hash, _successCalls, _returnDatas);\\n }\\n }\\n\\n /**\\n * @dev Sets the expiry duration for a new proposal.\\n */\\n function _setProposalExpiryDuration(uint256 expiryDuration) internal {\\n _proposalExpiryDuration = expiryDuration;\\n emit ProposalExpiryDurationChanged(expiryDuration);\\n }\\n\\n /**\\n * @dev Returns whether the voter casted for the proposal.\\n */\\n function _voted(ProposalVote storage vote_, address voter) internal view returns (bool) {\\n return vote_.voted[voter];\\n }\\n\\n /**\\n * @dev Returns total weight from validators.\\n */\\n function _getTotalWeight() internal view virtual returns (uint256);\\n\\n /**\\n * @dev Returns minimum vote to pass a proposal.\\n */\\n function _getMinimumVoteWeight() internal view virtual returns (uint256);\\n\\n /**\\n * @dev Returns current context is running on whether Ronin chain or on mainchain.\\n */\\n function _getChainType() internal view virtual returns (ChainType);\\n}\\n\",\"keccak256\":\"0xa8dfef02fbfbda8ec1cc681a59719d1d570fb8b652f6775b7d9af9c3e32fed26\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/GlobalCoreGovernance.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../libraries/Proposal.sol\\\";\\nimport \\\"../../libraries/GlobalProposal.sol\\\";\\nimport \\\"./CoreGovernance.sol\\\";\\n\\nabstract contract GlobalCoreGovernance is CoreGovernance {\\n using Proposal for Proposal.ProposalDetail;\\n using GlobalProposal for GlobalProposal.GlobalProposalDetail;\\n\\n mapping(GlobalProposal.TargetOption => address) internal _targetOptionsMap;\\n\\n /// @dev Emitted when a proposal is created\\n event GlobalProposalCreated(\\n uint256 indexed round,\\n bytes32 indexed proposalHash,\\n Proposal.ProposalDetail proposal,\\n bytes32 globalProposalHash,\\n GlobalProposal.GlobalProposalDetail globalProposal,\\n address creator\\n );\\n\\n /// @dev Emitted when the target options are updated\\n event TargetOptionUpdated(GlobalProposal.TargetOption indexed targetOption, address indexed addr);\\n\\n function __GlobalCoreGovernance_init(GlobalProposal.TargetOption[] memory targetOptions, address[] memory addrs) internal onlyInitializing {\\n __GlobalCoreGovernance_init_unchained(targetOptions, addrs);\\n }\\n\\n function __GlobalCoreGovernance_init_unchained(GlobalProposal.TargetOption[] memory targetOptions, address[] memory addrs) internal onlyInitializing {\\n _updateTargetOption(GlobalProposal.TargetOption.BridgeManager, address(this));\\n _updateManyTargetOption(targetOptions, addrs);\\n }\\n\\n /**\\n * @dev Proposes for a global proposal.\\n *\\n * Emits the `GlobalProposalCreated` event.\\n *\\n */\\n function _proposeGlobal(\\n uint256 expiryTimestamp,\\n GlobalProposal.TargetOption[] calldata targetOptions,\\n address executor,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n uint256[] memory gasAmounts,\\n address creator\\n ) internal virtual {\\n uint256 round_ = _createVotingRound(0);\\n GlobalProposal.GlobalProposalDetail memory globalProposal =\\n GlobalProposal.GlobalProposalDetail(round_, expiryTimestamp, executor, targetOptions, values, calldatas, gasAmounts);\\n Proposal.ProposalDetail memory proposal = globalProposal.intoProposalDetail(_resolveTargets({ targetOptions: targetOptions, strict: true }));\\n proposal.validate(_proposalExpiryDuration);\\n\\n bytes32 proposalHash = proposal.hash();\\n _saveVotingRound(vote[0][round_], proposalHash, expiryTimestamp);\\n emit GlobalProposalCreated(round_, proposalHash, proposal, globalProposal.hash(), globalProposal, creator);\\n }\\n\\n /**\\n * @dev Proposes global proposal struct.\\n *\\n * Requirements:\\n * - The proposal nonce is equal to the new round.\\n *\\n * Emits the `GlobalProposalCreated` event.\\n *\\n */\\n function _proposeGlobalStruct(\\n GlobalProposal.GlobalProposalDetail memory globalProposal,\\n address creator\\n ) internal virtual returns (Proposal.ProposalDetail memory proposal) {\\n proposal = globalProposal.intoProposalDetail(_resolveTargets({ targetOptions: globalProposal.targetOptions, strict: true }));\\n proposal.validate(_proposalExpiryDuration);\\n\\n bytes32 proposalHash = proposal.hash();\\n uint256 round_ = _createVotingRound(0);\\n _saveVotingRound(vote[0][round_], proposalHash, globalProposal.expiryTimestamp);\\n\\n if (round_ != proposal.nonce) revert ErrInvalidProposalNonce(msg.sig);\\n emit GlobalProposalCreated(round_, proposalHash, proposal, globalProposal.hash(), globalProposal, creator);\\n }\\n\\n /**\\n * @dev Returns corresponding address of target options. Return address(0) on non-existent target.\\n */\\n function resolveTargets(GlobalProposal.TargetOption[] calldata targetOptions) external view returns (address[] memory targets) {\\n return _resolveTargets({ targetOptions: targetOptions, strict: false });\\n }\\n\\n /**\\n * @dev Internal helper of {resolveTargets}.\\n *\\n * @param strict When the param is set to `true`, revert on non-existent target.\\n */\\n function _resolveTargets(GlobalProposal.TargetOption[] memory targetOptions, bool strict) internal view returns (address[] memory targets) {\\n targets = new address[](targetOptions.length);\\n\\n for (uint256 i; i < targetOptions.length; ++i) {\\n targets[i] = _targetOptionsMap[targetOptions[i]];\\n if (strict && targets[i] == address(0)) revert ErrInvalidArguments(msg.sig);\\n }\\n }\\n\\n /**\\n * @dev Updates list of `targetOptions` to `targets`.\\n *\\n * Requirement:\\n * - Only allow self-call through proposal.\\n *\\n */\\n function updateManyTargetOption(GlobalProposal.TargetOption[] memory targetOptions, address[] memory targets) external {\\n // HACK: Cannot reuse the existing library due to too deep stack\\n if (msg.sender != address(this)) revert ErrOnlySelfCall(msg.sig);\\n _updateManyTargetOption(targetOptions, targets);\\n }\\n\\n /**\\n * @dev Updates list of `targetOptions` to `targets`.\\n */\\n function _updateManyTargetOption(GlobalProposal.TargetOption[] memory targetOptions, address[] memory targets) internal {\\n for (uint256 i; i < targetOptions.length; ++i) {\\n if (targets[i] == address(this)) revert ErrInvalidArguments(msg.sig);\\n _updateTargetOption(targetOptions[i], targets[i]);\\n }\\n }\\n\\n /**\\n * @dev Updates `targetOption` to `target`.\\n *\\n * Requirement:\\n * - Emit a `TargetOptionUpdated` event.\\n */\\n function _updateTargetOption(GlobalProposal.TargetOption targetOption, address target) internal {\\n _targetOptionsMap[targetOption] = target;\\n emit TargetOptionUpdated(targetOption, target);\\n }\\n}\\n\",\"keccak256\":\"0xe5db4e1b31d9ff83e8962d17a815d39e72f5945023e6309172d875b47d5a1c3d\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/governance-proposal/CommonGovernanceProposal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../CoreGovernance.sol\\\";\\n\\nabstract contract CommonGovernanceProposal is CoreGovernance {\\n using Proposal for Proposal.ProposalDetail;\\n\\n /**\\n * @dev Casts votes by signatures.\\n *\\n * Note: This method does not verify the proposal hash with the vote hash. Please consider checking it before.\\n *\\n */\\n function _castVotesBySignatures(\\n Proposal.ProposalDetail memory _proposal,\\n Ballot.VoteType[] calldata _supports,\\n Signature[] calldata _signatures,\\n bytes32 proposalHash\\n ) internal {\\n if (!(_supports.length != 0 && _supports.length == _signatures.length)) revert ErrLengthMismatch(msg.sig);\\n\\n bytes32 _forDigest = ECDSA.toTypedDataHash(_proposalDomainSeparator(), Ballot.hash(proposalHash, Ballot.VoteType.For));\\n bytes32 _againstDigest = ECDSA.toTypedDataHash(_proposalDomainSeparator(), Ballot.hash(proposalHash, Ballot.VoteType.Against));\\n\\n uint256 _minimumForVoteWeight = _getMinimumVoteWeight();\\n uint256 _minimumAgainstVoteWeight = _getTotalWeight() - _minimumForVoteWeight + 1;\\n\\n address _lastSigner;\\n\\n for (uint256 _i; _i < _signatures.length;) {\\n Signature calldata _sig;\\n address _signer;\\n _sig = _signatures[_i];\\n\\n if (_supports[_i] == Ballot.VoteType.For) {\\n _signer = ECDSA.recover(_forDigest, _sig.v, _sig.r, _sig.s);\\n } else if (_supports[_i] == Ballot.VoteType.Against) {\\n _signer = ECDSA.recover(_againstDigest, _sig.v, _sig.r, _sig.s);\\n } else {\\n revert ErrUnsupportedVoteType(msg.sig);\\n }\\n\\n if (_lastSigner >= _signer) revert ErrInvalidOrder(msg.sig);\\n _lastSigner = _signer;\\n\\n uint256 _weight = _getWeight(_signer);\\n\\n if (_weight == 0) revert ErrInvalidSignatures(msg.sig);\\n\\n if (_castVote(_proposal, _supports[_i], _minimumForVoteWeight, _minimumAgainstVoteWeight, _signer, _sig, _weight)) {\\n return;\\n }\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n }\\n\\n /**\\n * @dev Returns the voted signatures for the proposals.\\n *\\n * Note: The signatures can be empty in case the proposal is voted on the current network.\\n *\\n */\\n function _getProposalSignatures(\\n uint256 _chainId,\\n uint256 _round\\n ) internal view returns (address[] memory _voters, Ballot.VoteType[] memory _supports, Signature[] memory _signatures) {\\n ProposalVote storage _vote = vote[_chainId][_round];\\n\\n uint256 _forLength = _vote.forVoteds.length;\\n uint256 _againstLength = _vote.againstVoteds.length;\\n uint256 _voterLength = _forLength + _againstLength;\\n\\n _supports = new Ballot.VoteType[](_voterLength);\\n _signatures = new Signature[](_voterLength);\\n _voters = new address[](_voterLength);\\n for (uint256 _i; _i < _forLength;) {\\n _supports[_i] = Ballot.VoteType.For;\\n _signatures[_i] = vote[_chainId][_round].sig[_vote.forVoteds[_i]];\\n _voters[_i] = _vote.forVoteds[_i];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n for (uint256 _i; _i < _againstLength;) {\\n _supports[_i + _forLength] = Ballot.VoteType.Against;\\n _signatures[_i + _forLength] = vote[_chainId][_round].sig[_vote.againstVoteds[_i]];\\n _voters[_i + _forLength] = _vote.againstVoteds[_i];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n }\\n\\n /**\\n * @dev Returns whether the voter `_voter` casted vote for the proposal.\\n */\\n function _proposalVoted(uint256 _chainId, uint256 _round, address _voter) internal view returns (bool) {\\n return _voted(vote[_chainId][_round], _voter);\\n }\\n\\n /**\\n * @dev Returns the weight of a governor.\\n */\\n function _getWeight(address _governor) internal view virtual returns (uint256);\\n\\n function _proposalDomainSeparator() internal view virtual returns (bytes32);\\n}\\n\",\"keccak256\":\"0xa7fbe65047096bcf4269cfe42e4529eb9a8bbbf93aff9207edd46b04e9661949\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/governance-proposal/GlobalGovernanceProposal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../../libraries/Proposal.sol\\\";\\nimport \\\"../GlobalCoreGovernance.sol\\\";\\nimport \\\"./CommonGovernanceProposal.sol\\\";\\n\\nabstract contract GlobalGovernanceProposal is GlobalCoreGovernance, CommonGovernanceProposal {\\n using Proposal for Proposal.ProposalDetail;\\n using GlobalProposal for GlobalProposal.GlobalProposalDetail;\\n\\n /**\\n * @dev Proposes and casts votes for a global proposal by signatures.\\n */\\n function _proposeGlobalProposalStructAndCastVotes(\\n GlobalProposal.GlobalProposalDetail calldata globalProposal,\\n Ballot.VoteType[] calldata supports_,\\n Signature[] calldata signatures,\\n address creator\\n ) internal returns (Proposal.ProposalDetail memory proposal) {\\n proposal = _proposeGlobalStruct(globalProposal, creator);\\n _castVotesBySignatures(proposal, supports_, signatures, globalProposal.hash());\\n }\\n\\n /**\\n * @dev Casts votes for a global proposal by signatures.\\n */\\n function _castGlobalProposalBySignatures(\\n GlobalProposal.GlobalProposalDetail calldata globalProposal,\\n Ballot.VoteType[] calldata supports_,\\n Signature[] calldata signatures\\n ) internal {\\n Proposal.ProposalDetail memory _proposal = globalProposal.intoProposalDetail(_resolveTargets({ targetOptions: globalProposal.targetOptions, strict: true }));\\n\\n bytes32 proposalHash = _proposal.hash();\\n if (vote[0][_proposal.nonce].hash != proposalHash) {\\n revert ErrInvalidProposal(proposalHash, vote[0][_proposal.nonce].hash);\\n }\\n\\n _castVotesBySignatures(_proposal, supports_, signatures, globalProposal.hash());\\n }\\n\\n /**\\n * @dev See {CommonGovernanceProposal-_getProposalSignatures}\\n */\\n function getGlobalProposalSignatures(uint256 round_)\\n external\\n view\\n returns (address[] memory voters, Ballot.VoteType[] memory supports_, Signature[] memory signatures)\\n {\\n return _getProposalSignatures(0, round_);\\n }\\n\\n /**\\n * @dev See {CommonGovernanceProposal-_proposalVoted}\\n */\\n function globalProposalVoted(uint256 round_, address voter) external view returns (bool) {\\n return _proposalVoted(0, round_, voter);\\n }\\n}\\n\",\"keccak256\":\"0x3905efdfd61681db17bcc392cf93d6571e94bf752f813eacd2504662241231c8\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/governance-proposal/GovernanceProposal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../CoreGovernance.sol\\\";\\nimport \\\"./CommonGovernanceProposal.sol\\\";\\n\\nabstract contract GovernanceProposal is CoreGovernance, CommonGovernanceProposal {\\n using Proposal for Proposal.ProposalDetail;\\n\\n /**\\n * @dev Proposes a proposal struct and casts votes by signature.\\n */\\n function _proposeProposalStructAndCastVotes(\\n Proposal.ProposalDetail calldata _proposal,\\n Ballot.VoteType[] calldata _supports,\\n Signature[] calldata _signatures,\\n address _creator\\n ) internal {\\n _proposeProposalStruct(_proposal, _creator);\\n _castVotesBySignatures(_proposal, _supports, _signatures, _proposal.hash());\\n }\\n\\n /**\\n * @dev Proposes a proposal struct and casts votes by signature.\\n */\\n function _castProposalBySignatures(\\n Proposal.ProposalDetail calldata _proposal,\\n Ballot.VoteType[] calldata _supports,\\n Signature[] calldata _signatures\\n ) internal {\\n bytes32 _proposalHash = _proposal.hash();\\n\\n if (vote[_proposal.chainId][_proposal.nonce].hash != _proposalHash) {\\n revert ErrInvalidProposal(_proposalHash, vote[_proposal.chainId][_proposal.nonce].hash);\\n }\\n\\n _castVotesBySignatures(_proposal, _supports, _signatures, _proposal.hash());\\n }\\n\\n /**\\n * @dev See `castProposalVoteForCurrentNetwork`.\\n */\\n function _castProposalVoteForCurrentNetwork(address _voter, Proposal.ProposalDetail memory _proposal, Ballot.VoteType _support) internal {\\n if (_proposal.chainId != block.chainid) revert ErrInvalidChainId(msg.sig, _proposal.chainId, block.chainid);\\n\\n bytes32 proposalHash = _proposal.hash();\\n if (vote[_proposal.chainId][_proposal.nonce].hash != proposalHash) {\\n revert ErrInvalidProposal(proposalHash, vote[_proposal.chainId][_proposal.nonce].hash);\\n }\\n\\n uint256 _minimumForVoteWeight = _getMinimumVoteWeight();\\n uint256 _minimumAgainstVoteWeight = _getTotalWeight() - _minimumForVoteWeight + 1;\\n Signature memory _emptySignature;\\n _castVote(_proposal, _support, _minimumForVoteWeight, _minimumAgainstVoteWeight, _voter, _emptySignature, _getWeight(_voter));\\n }\\n\\n /**\\n * @dev See {CommonGovernanceProposal-_getProposalSignatures}\\n */\\n function getProposalSignatures(\\n uint256 _chainId,\\n uint256 _round\\n ) external view returns (address[] memory _voters, Ballot.VoteType[] memory _supports, Signature[] memory _signatures) {\\n return _getProposalSignatures(_chainId, _round);\\n }\\n\\n /**\\n * @dev See {CommonGovernanceProposal-_proposalVoted}\\n */\\n function proposalVoted(uint256 _chainId, uint256 _round, address _voter) external view returns (bool) {\\n return _proposalVoted(_chainId, _round, _voter);\\n }\\n}\\n\",\"keccak256\":\"0x820788183e3300ede4a19be84a3d7c991ac579017f78a098b26d1bbebc411ec4\",\"license\":\"MIT\"},\"src/interfaces/IQuorum.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IQuorum {\\n /// @dev Emitted when the threshold is updated\\n event ThresholdUpdated(uint256 indexed nonce, uint256 indexed numerator, uint256 indexed denominator, uint256 previousNumerator, uint256 previousDenominator);\\n\\n /**\\n * @dev Returns the threshold.\\n */\\n function getThreshold() external view returns (uint256 _num, uint256 _denom);\\n\\n /**\\n * @dev Checks whether the `_voteWeight` passes the threshold.\\n */\\n function checkThreshold(uint256 _voteWeight) external view returns (bool);\\n\\n /**\\n * @dev Returns the minimum vote weight to pass the threshold.\\n */\\n function minimumVoteWeight() external view returns (uint256);\\n\\n /**\\n * @dev Sets the threshold.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `ThresholdUpdated` event.\\n *\\n */\\n function setThreshold(uint256 numerator, uint256 denominator) external;\\n}\\n\",\"keccak256\":\"0xc924e9480f59acc9bc8c033f05d3be9451de5cee0c224d76d4542fa5b67fa10f\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IBridgeManagerEvents } from \\\"./events/IBridgeManagerEvents.sol\\\";\\n\\n/**\\n * @title IBridgeManager\\n * @dev The interface for managing bridge operators.\\n */\\ninterface IBridgeManager is IBridgeManagerEvents {\\n /// @notice Error indicating that cannot find the querying operator\\n error ErrOperatorNotFound(address operator);\\n /// @notice Error indicating that cannot find the querying governor\\n error ErrGovernorNotFound(address governor);\\n /// @notice Error indicating that the msg.sender is not match the required governor\\n error ErrGovernorNotMatch(address required, address sender);\\n /// @notice Error indicating that the governors list will go below minimum number of required governor.\\n error ErrBelowMinRequiredGovernors();\\n /// @notice Common invalid input error\\n error ErrInvalidInput();\\n\\n /**\\n * @dev The domain separator used for computing hash digests in the contract.\\n */\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n\\n /**\\n * @dev Returns the total number of bridge operators.\\n * @return The total number of bridge operators.\\n */\\n function totalBridgeOperator() external view returns (uint256);\\n\\n /**\\n * @dev Checks if the given address is a bridge operator.\\n * @param addr The address to check.\\n * @return A boolean indicating whether the address is a bridge operator.\\n */\\n function isBridgeOperator(address addr) external view returns (bool);\\n\\n /**\\n * @dev Retrieves the full information of all registered bridge operators.\\n *\\n * This external function allows external callers to obtain the full information of all the registered bridge operators.\\n * The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.\\n *\\n * @return governors An array of addresses representing the governors of each bridge operator.\\n * @return bridgeOperators An array of addresses representing the registered bridge operators.\\n * @return weights An array of uint256 values representing the vote weights of each bridge operator.\\n *\\n * Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator.\\n *\\n * Example Usage:\\n * ```\\n * (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos();\\n * for (uint256 i = 0; i < bridgeOperators.length; i++) {\\n * // Access individual information for each bridge operator.\\n * address governor = governors[i];\\n * address bridgeOperator = bridgeOperators[i];\\n * uint256 weight = weights[i];\\n * // ... (Process or use the information as required) ...\\n * }\\n * ```\\n *\\n */\\n function getFullBridgeOperatorInfos() external view returns (address[] memory governors, address[] memory bridgeOperators, uint96[] memory weights);\\n\\n /**\\n * @dev Returns total weights of the governor list.\\n */\\n function sumGovernorsWeight(address[] calldata governors) external view returns (uint256 sum);\\n\\n /**\\n * @dev Returns total weights.\\n */\\n function getTotalWeight() external view returns (uint256);\\n\\n /**\\n * @dev Returns an array of all bridge operators.\\n * @return An array containing the addresses of all bridge operators.\\n */\\n function getBridgeOperators() external view returns (address[] memory);\\n\\n /**\\n * @dev Returns the corresponding `operator` of a `governor`.\\n */\\n function getOperatorOf(address governor) external view returns (address operator);\\n\\n /**\\n * @dev Returns the corresponding `governor` of a `operator`.\\n */\\n function getGovernorOf(address operator) external view returns (address governor);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific governor.\\n * @param governor The address of the governor to get the vote weight for.\\n * @return voteWeight The vote weight of the specified governor.\\n */\\n function getGovernorWeight(address governor) external view returns (uint96);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific bridge operator.\\n * @param bridgeOperator The address of the bridge operator to get the vote weight for.\\n * @return weight The vote weight of the specified bridge operator.\\n */\\n function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint96 weight);\\n\\n /**\\n * @dev Returns the weights of a list of governor addresses.\\n */\\n function getGovernorWeights(address[] calldata governors) external view returns (uint96[] memory weights);\\n\\n /**\\n * @dev Returns an array of all governors.\\n * @return An array containing the addresses of all governors.\\n */\\n function getGovernors() external view returns (address[] memory);\\n\\n /**\\n * @dev Adds multiple bridge operators.\\n * @param governors An array of addresses of hot/cold wallets for bridge operator to update their node address.\\n * @param bridgeOperators An array of addresses representing the bridge operators to add.\\n */\\n function addBridgeOperators(uint96[] calldata voteWeights, address[] calldata governors, address[] calldata bridgeOperators) external;\\n\\n /**\\n * @dev Removes multiple bridge operators.\\n * @param bridgeOperators An array of addresses representing the bridge operators to remove.\\n */\\n function removeBridgeOperators(address[] calldata bridgeOperators) external;\\n\\n /**\\n * @dev Self-call to update the minimum required governor.\\n * @param min The minimum number, this must not less than 3.\\n */\\n function setMinRequiredGovernor(uint min) external;\\n}\\n\",\"keccak256\":\"0xefc46318a240371031e77ef3c355e2c18432e4479145378de6782277f9b44923\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManagerCallback.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @title IBridgeManagerCallback\\n * @dev Interface for the callback functions to be implemented by the Bridge Manager contract.\\n */\\ninterface IBridgeManagerCallback is IERC165 {\\n /**\\n * @dev Handles the event when bridge operators are added.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @param addeds The corresponding boolean values indicating whether the operators were added or not.\\n * @return selector The selector of the function being called.\\n */\\n function onBridgeOperatorsAdded(address[] memory bridgeOperators, uint96[] calldata weights, bool[] memory addeds) external returns (bytes4 selector);\\n\\n /**\\n * @dev Handles the event when bridge operators are removed.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @param removeds The corresponding boolean values indicating whether the operators were removed or not.\\n * @return selector The selector of the function being called.\\n */\\n function onBridgeOperatorsRemoved(address[] memory bridgeOperators, bool[] memory removeds) external returns (bytes4 selector);\\n}\\n\",\"keccak256\":\"0x6c8ce7e2478e28c5ed5e6f5d8305a77d6d5f9125a47adfb77632940b9a0f3625\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManagerCallbackRegister.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeManagerCallbackRegister {\\n error ErrExistOneInternalCallFailed(address sender, bytes4 msgSig, bytes callData);\\n\\n event CallbackRegistered(address, bool);\\n /**\\n * @dev Emitted when the contract notifies multiple registers with statuses and return data.\\n */\\n event Notified(bytes callData, address[] registers, bool[] statuses, bytes[] returnDatas);\\n\\n /**\\n * @dev Retrieves the addresses of registered callbacks.\\n * @return registers An array containing the addresses of registered callbacks.\\n */\\n function getCallbackRegisters() external view returns (address[] memory registers);\\n\\n /**\\n * @dev Registers multiple callbacks with the bridge.\\n * @param registers The array of callback addresses to register.\\n */\\n function registerCallbacks(address[] calldata registers) external;\\n\\n /**\\n * @dev Unregisters multiple callbacks from the bridge.\\n * @param registers The array of callback addresses to unregister.\\n */\\n function unregisterCallbacks(address[] calldata registers) external;\\n}\\n\",\"keccak256\":\"0x493f7a40fc058eb6654a636316be99c2ddd9ee26ee215ff86c7107a7fa20ff97\",\"license\":\"MIT\"},\"src/interfaces/bridge/events/IBridgeManagerEvents.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeManagerEvents {\\n /**\\n * @dev Emitted when new bridge operators are added.\\n */\\n event BridgeOperatorsAdded(bool[] statuses, uint96[] voteWeights, address[] governors, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is failed to add.\\n */\\n event BridgeOperatorAddingFailed(address indexed operator);\\n\\n /**\\n * @dev Emitted when bridge operators are removed.\\n */\\n event BridgeOperatorsRemoved(bool[] statuses, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is failed to remove.\\n */\\n event BridgeOperatorRemovingFailed(address indexed operator);\\n\\n /**\\n * @dev Emitted when a bridge operator is updated.\\n */\\n event BridgeOperatorUpdated(address indexed governor, address indexed fromBridgeOperator, address indexed toBridgeOperator);\\n\\n /**\\n * @dev Emitted when the minimum number of required governors is updated.\\n */\\n event MinRequiredGovernorUpdated(uint min);\\n}\\n\",\"keccak256\":\"0x38bc3709c98a7c08fb9b6fa3e07a725903dcb0bd07de8a828bac6c3bcf7d997d\",\"license\":\"MIT\"},\"src/interfaces/collections/IHasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport { ContractType } from \\\"../../utils/ContractType.sol\\\";\\n\\ninterface IHasContracts {\\n /// @dev Error of invalid role.\\n error ErrContractTypeNotFound(ContractType contractType);\\n\\n /// @dev Emitted when a contract is updated.\\n event ContractUpdated(ContractType indexed contractType, address indexed addr);\\n\\n /**\\n * @dev Returns the address of a contract with a specific role.\\n * Throws an error if no contract is set for the specified role.\\n *\\n * @param contractType The role of the contract to retrieve.\\n * @return contract_ The address of the contract with the specified role.\\n */\\n function getContract(ContractType contractType) external view returns (address contract_);\\n\\n /**\\n * @dev Sets the address of a contract with a specific role.\\n * Emits the event {ContractUpdated}.\\n * @param contractType The role of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function setContract(ContractType contractType, address addr) external;\\n}\\n\",\"keccak256\":\"0x99d8213d857e30d367155abd15dc42730afdfbbac3a22dfb3b95ffea2083a92e\",\"license\":\"MIT\"},\"src/interfaces/consumers/ChainTypeConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface ChainTypeConsumer {\\n enum ChainType {\\n RoninChain,\\n Mainchain\\n }\\n}\\n\",\"keccak256\":\"0xe0d20e00c8d237f8e0fb881abf1ff1ef114173bcb428f06f689c581666a22db7\",\"license\":\"MIT\"},\"src/interfaces/consumers/SignatureConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface SignatureConsumer {\\n struct Signature {\\n uint8 v;\\n bytes32 r;\\n bytes32 s;\\n }\\n}\\n\",\"keccak256\":\"0xd370e350722067097dec1a5c31bda6e47e83417fa5c3288293bb910028cd136b\",\"license\":\"MIT\"},\"src/interfaces/consumers/VoteStatusConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface VoteStatusConsumer {\\n enum VoteStatus {\\n Pending,\\n Approved,\\n Executed,\\n Rejected,\\n Expired\\n }\\n}\\n\",\"keccak256\":\"0xa5045232c0c053fcf31fb3fe71942344444159c48d5f1b2063dbb06b6a1c9752\",\"license\":\"MIT\"},\"src/libraries/AddressArrayUtils.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\nlibrary AddressArrayUtils {\\n /**\\n * @dev Error thrown when a duplicated element is detected in an array.\\n * @param msgSig The function signature that invoke the error.\\n */\\n error ErrDuplicated(bytes4 msgSig);\\n\\n /**\\n * @dev Returns whether or not there's a duplicate. Runs in O(n^2).\\n * @param A Array to search\\n * @return Returns true if duplicate, false otherwise\\n */\\n function hasDuplicate(address[] memory A) internal pure returns (bool) {\\n if (A.length == 0) {\\n return false;\\n }\\n unchecked {\\n for (uint256 i = 0; i < A.length - 1; i++) {\\n for (uint256 j = i + 1; j < A.length; j++) {\\n if (A[i] == A[j]) {\\n return true;\\n }\\n }\\n }\\n }\\n return false;\\n }\\n\\n /**\\n * @dev Returns whether two arrays of addresses are equal or not.\\n */\\n function isEqual(address[] memory _this, address[] memory _other) internal pure returns (bool yes_) {\\n // Hashing two arrays and compare their hash\\n assembly {\\n let _thisHash := keccak256(add(_this, 32), mul(mload(_this), 32))\\n let _otherHash := keccak256(add(_other, 32), mul(mload(_other), 32))\\n yes_ := eq(_thisHash, _otherHash)\\n }\\n }\\n\\n /**\\n * @dev Return the concatenated array from a and b.\\n */\\n function extend(address[] memory a, address[] memory b) internal pure returns (address[] memory c) {\\n uint256 lengthA = a.length;\\n uint256 lengthB = b.length;\\n unchecked {\\n c = new address[](lengthA + lengthB);\\n }\\n uint256 i;\\n for (; i < lengthA;) {\\n c[i] = a[i];\\n unchecked {\\n ++i;\\n }\\n }\\n for (uint256 j; j < lengthB;) {\\n c[i] = b[j];\\n unchecked {\\n ++i;\\n ++j;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce5d578861167da47a965c8a0e1592b808aad6eb79ccb1873bf2e2280ddb85ee\",\"license\":\"UNLICENSED\"},\"src/libraries/Ballot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\n\\nlibrary Ballot {\\n using ECDSA for bytes32;\\n\\n enum VoteType {\\n For,\\n Against\\n }\\n\\n // keccak256(\\\"Ballot(bytes32 proposalHash,uint8 support)\\\");\\n bytes32 private constant BALLOT_TYPEHASH = 0xd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2;\\n\\n function hash(bytes32 _proposalHash, VoteType _support) internal pure returns (bytes32 digest) {\\n // return keccak256(abi.encode(BALLOT_TYPEHASH, _proposalHash, _support));\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, BALLOT_TYPEHASH)\\n mstore(add(ptr, 0x20), _proposalHash)\\n mstore(add(ptr, 0x40), _support)\\n digest := keccak256(ptr, 0x60)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xaa1e66bcd86baa6f18c7c5e9b67496535f229cbd2e2ecb4c66bcbfed2b1365de\",\"license\":\"MIT\"},\"src/libraries/GlobalProposal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./Proposal.sol\\\";\\n\\nlibrary GlobalProposal {\\n /**\\n * @dev Error thrown when attempting to interact with an unsupported target.\\n */\\n error ErrUnsupportedTarget(bytes32 proposalHash, uint256 targetNumber);\\n\\n enum TargetOption {\\n BridgeManager, // 0\\n GatewayContract, // 1\\n BridgeReward, // 2\\n BridgeSlash, // 3\\n BridgeTracking, // 4\\n PauseEnforcer // 5\\n\\n }\\n\\n struct GlobalProposalDetail {\\n // Nonce to make sure proposals are executed in order\\n uint256 nonce;\\n uint256 expiryTimestamp;\\n address executor;\\n TargetOption[] targetOptions;\\n uint256[] values;\\n bytes[] calldatas;\\n uint256[] gasAmounts;\\n }\\n\\n // keccak256(\\\"GlobalProposalDetail(uint256 nonce,uint256 expiryTimestamp,address executor,uint8[] targetOptions,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)\\\");\\n bytes32 internal constant TYPE_HASH = 0xde480f0c53a3651c08fbab1dffbc45fe574f31188827fe52cb9035da9fe57e4a;\\n\\n /**\\n * @dev Returns struct hash of the proposal.\\n */\\n function hash(GlobalProposalDetail memory self) internal pure returns (bytes32 digest_) {\\n uint256[] memory values = self.values;\\n TargetOption[] memory targets = self.targetOptions;\\n bytes32[] memory calldataHashList = new bytes32[](self.calldatas.length);\\n uint256[] memory gasAmounts = self.gasAmounts;\\n\\n for (uint256 i; i < calldataHashList.length;) {\\n calldataHashList[i] = keccak256(self.calldatas[i]);\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n /*\\n * return\\n * keccak256(\\n * abi.encode(\\n * TYPE_HASH,\\n * proposal.nonce,\\n * proposal.expiryTimestamp,\\n * proposal.executor,\\n * targetsHash,\\n * valuesHash,\\n * calldatasHash,\\n * gasAmountsHash\\n * )\\n * );\\n */\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, TYPE_HASH)\\n mstore(add(ptr, 0x20), mload(self)) // proposal.nonce\\n mstore(add(ptr, 0x40), mload(add(self, 0x20))) // proposal.expiryTimestamp\\n mstore(add(ptr, 0x60), mload(add(self, 0x40))) // proposal.executor\\n\\n let arrayHashed\\n arrayHashed := keccak256(add(targets, 32), mul(mload(targets), 32)) // targetsHash\\n mstore(add(ptr, 0x80), arrayHashed)\\n arrayHashed := keccak256(add(values, 32), mul(mload(values), 32)) // valuesHash\\n mstore(add(ptr, 0xa0), arrayHashed)\\n arrayHashed := keccak256(add(calldataHashList, 32), mul(mload(calldataHashList), 32)) // calldatasHash\\n mstore(add(ptr, 0xc0), arrayHashed)\\n arrayHashed := keccak256(add(gasAmounts, 32), mul(mload(gasAmounts), 32)) // gasAmountsHash\\n mstore(add(ptr, 0xe0), arrayHashed)\\n digest_ := keccak256(ptr, 0x100)\\n }\\n }\\n\\n /**\\n * @dev Converts into the normal proposal.\\n */\\n function intoProposalDetail(GlobalProposalDetail memory self, address[] memory targets) internal pure returns (Proposal.ProposalDetail memory detail_) {\\n detail_.nonce = self.nonce;\\n detail_.chainId = 0;\\n detail_.expiryTimestamp = self.expiryTimestamp;\\n detail_.executor = self.executor;\\n\\n detail_.targets = new address[](self.targetOptions.length);\\n detail_.values = self.values;\\n detail_.calldatas = self.calldatas;\\n detail_.gasAmounts = self.gasAmounts;\\n\\n for (uint256 i; i < self.targetOptions.length; ++i) {\\n detail_.targets[i] = targets[i];\\n }\\n }\\n}\\n\",\"keccak256\":\"0x76d362e1a4c8ef6d1aac45aae0f443a218cb256176ad5fbe952b2ff7c2132e6e\",\"license\":\"MIT\"},\"src/libraries/Proposal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ErrInvalidChainId, ErrLengthMismatch } from \\\"../utils/CommonErrors.sol\\\";\\n\\nlibrary Proposal {\\n /**\\n * @dev Error thrown when there is insufficient gas to execute a function.\\n */\\n error ErrInsufficientGas(bytes32 proposalHash);\\n\\n /**\\n * @dev Error thrown when an invalid expiry timestamp is provided.\\n */\\n error ErrInvalidExpiryTimestamp();\\n\\n /**\\n * @dev Error thrown when the proposal reverts when execute the internal call no. `callIndex` with revert message is `revertMsg`.\\n */\\n error ErrLooseProposalInternallyRevert(uint256 callIndex, bytes revertMsg);\\n\\n struct ProposalDetail {\\n // Nonce to make sure proposals are executed in order\\n uint256 nonce;\\n // Value 0: all chain should run this proposal\\n // Other values: only specific chain has to execute\\n uint256 chainId;\\n uint256 expiryTimestamp;\\n // The address that execute the proposal after the proposal passes.\\n // Leave this address as address(0) to auto-execute by the last valid vote.\\n address executor;\\n address[] targets;\\n uint256[] values;\\n bytes[] calldatas;\\n uint256[] gasAmounts;\\n }\\n\\n // keccak256(\\\"ProposalDetail(uint256 nonce,uint256 chainId,uint256 expiryTimestamp,address executor,address[] targets,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)\\\");\\n bytes32 internal constant TYPE_HASH = 0x1b59eeec7c321899dc1e7a5b3d876c9a445dffc6d2f96ba842d7489908fdee12;\\n\\n /**\\n * @dev Validates the proposal.\\n */\\n function validate(ProposalDetail memory proposal, uint256 maxExpiryDuration) internal view {\\n if (\\n !(\\n proposal.targets.length > 0 && proposal.targets.length == proposal.values.length && proposal.targets.length == proposal.calldatas.length\\n && proposal.targets.length == proposal.gasAmounts.length\\n )\\n ) {\\n revert ErrLengthMismatch(msg.sig);\\n }\\n\\n if (proposal.expiryTimestamp > block.timestamp + maxExpiryDuration) {\\n revert ErrInvalidExpiryTimestamp();\\n }\\n }\\n\\n /**\\n * @dev Returns struct hash of the proposal.\\n */\\n function hash(ProposalDetail memory proposal) internal pure returns (bytes32 digest_) {\\n uint256[] memory values = proposal.values;\\n address[] memory targets = proposal.targets;\\n bytes32[] memory calldataHashList = new bytes32[](proposal.calldatas.length);\\n uint256[] memory gasAmounts = proposal.gasAmounts;\\n\\n for (uint256 i; i < calldataHashList.length; ++i) {\\n calldataHashList[i] = keccak256(proposal.calldatas[i]);\\n }\\n\\n // return\\n // keccak256(\\n // abi.encode(\\n // TYPE_HASH,\\n // proposal.nonce,\\n // proposal.chainId,\\n // proposal.expiryTimestamp\\n // proposal.executor\\n // targetsHash,\\n // valuesHash,\\n // calldatasHash,\\n // gasAmountsHash\\n // )\\n // );\\n // /\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, TYPE_HASH)\\n mstore(add(ptr, 0x20), mload(proposal)) // proposal.nonce\\n mstore(add(ptr, 0x40), mload(add(proposal, 0x20))) // proposal.chainId\\n mstore(add(ptr, 0x60), mload(add(proposal, 0x40))) // proposal.expiryTimestamp\\n mstore(add(ptr, 0x80), mload(add(proposal, 0x60))) // proposal.executor\\n\\n let arrayHashed\\n arrayHashed := keccak256(add(targets, 32), mul(mload(targets), 32)) // targetsHash\\n mstore(add(ptr, 0xa0), arrayHashed)\\n arrayHashed := keccak256(add(values, 32), mul(mload(values), 32)) // valuesHash\\n mstore(add(ptr, 0xc0), arrayHashed)\\n arrayHashed := keccak256(add(calldataHashList, 32), mul(mload(calldataHashList), 32)) // calldatasHash\\n mstore(add(ptr, 0xe0), arrayHashed)\\n arrayHashed := keccak256(add(gasAmounts, 32), mul(mload(gasAmounts), 32)) // gasAmountsHash\\n mstore(add(ptr, 0x100), arrayHashed)\\n digest_ := keccak256(ptr, 0x120)\\n }\\n }\\n\\n /**\\n * @dev Returns whether the proposal is auto-executed on the last valid vote.\\n */\\n function isAutoExecute(ProposalDetail memory proposal) internal pure returns (bool) {\\n return proposal.executor == address(0);\\n }\\n\\n /**\\n * @dev Returns whether the proposal is executable for the current chain.\\n *\\n * @notice Does not check whether the call result is successful or not. Please use `execute` instead.\\n *\\n */\\n function executable(ProposalDetail memory proposal) internal view returns (bool result) {\\n return proposal.chainId == 0 || proposal.chainId == block.chainid;\\n }\\n\\n /**\\n * @dev Executes the proposal.\\n */\\n function execute(ProposalDetail memory proposal) internal returns (bool[] memory successCalls, bytes[] memory returnDatas) {\\n if (!executable(proposal)) revert ErrInvalidChainId(msg.sig, proposal.chainId, block.chainid);\\n\\n successCalls = new bool[](proposal.targets.length);\\n returnDatas = new bytes[](proposal.targets.length);\\n for (uint256 i = 0; i < proposal.targets.length; ++i) {\\n if (gasleft() <= proposal.gasAmounts[i]) revert ErrInsufficientGas(hash(proposal));\\n\\n (successCalls[i], returnDatas[i]) = proposal.targets[i].call{ value: proposal.values[i], gas: proposal.gasAmounts[i] }(proposal.calldatas[i]);\\n\\n if (!successCalls[i]) {\\n revert ErrLooseProposalInternallyRevert(i, returnDatas[i]);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0ef21852c8a90ebf3ec4d4cc11acd9b6aa1fd932fb6858b2f6cdd3722fab6cb1\",\"license\":\"MIT\"},\"src/ronin/gateway/RoninBridgeManagerConstructor.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ContractType, RoleAccess, ErrUnauthorized, BridgeManager } from \\\"../../extensions/bridge-operator-governance/BridgeManager.sol\\\";\\nimport {\\n Ballot,\\n GlobalProposal,\\n Proposal,\\n CommonGovernanceProposal,\\n GovernanceProposal\\n} from \\\"../../extensions/sequential-governance/governance-proposal/GovernanceProposal.sol\\\";\\nimport {\\n CoreGovernance,\\n GlobalCoreGovernance,\\n GlobalGovernanceProposal\\n} from \\\"../../extensions/sequential-governance/governance-proposal/GlobalGovernanceProposal.sol\\\";\\nimport { VoteStatusConsumer } from \\\"../../interfaces/consumers/VoteStatusConsumer.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\n\\ncontract RoninBridgeManagerConstructor is BridgeManager, GovernanceProposal, GlobalGovernanceProposal {\\n using Proposal for Proposal.ProposalDetail;\\n\\n function initialize(\\n uint256 num,\\n uint256 denom,\\n uint256 roninChainId,\\n uint256 expiryDuration,\\n address bridgeContract,\\n address[] memory callbackRegisters,\\n address[] memory bridgeOperators,\\n address[] memory governors,\\n uint96[] memory voteWeights,\\n GlobalProposal.TargetOption[] memory targetOptions,\\n address[] memory targets\\n ) external initializer {\\n __CoreGovernance_init(expiryDuration);\\n __GlobalCoreGovernance_init(targetOptions, targets);\\n __BridgeManager_init(num, denom, roninChainId, bridgeContract, callbackRegisters, bridgeOperators, governors, voteWeights);\\n }\\n\\n /**\\n * @dev Internal function to get the chain type of the contract.\\n * @return The chain type, indicating the type of the chain the contract operates on (e.g., RoninChain).\\n */\\n function _getChainType() internal pure override returns (ChainType) {\\n return ChainType.RoninChain;\\n }\\n\\n /**\\n * @dev Internal function to get the total weights of all governors.\\n * @return The total weights of all governors combined.\\n */\\n function _getTotalWeight() internal view virtual override returns (uint256) {\\n return getTotalWeight();\\n }\\n\\n /**\\n * @dev Internal function to get the minimum vote weight required for governance actions.\\n * @return The minimum vote weight required for governance actions.\\n */\\n function _getMinimumVoteWeight() internal view virtual override returns (uint256) {\\n return minimumVoteWeight();\\n }\\n\\n /**\\n * @dev Internal function to get the vote weight of a specific governor.\\n * @param _governor The address of the governor to get the vote weight for.\\n * @return The vote weight of the specified governor.\\n */\\n function _getWeight(address _governor) internal view virtual override returns (uint256) {\\n return _getGovernorWeight(_governor);\\n }\\n\\n function _proposalDomainSeparator() internal view override returns (bytes32) {\\n return DOMAIN_SEPARATOR;\\n }\\n}\\n\",\"keccak256\":\"0xbd91923f0b98646e3bbf22b28e854e7932d815c5cdb5e4d0d7f92291d076f97f\",\"license\":\"MIT\"},\"src/types/Types.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.17;\\n\\nimport { LibTUint256Slot } from \\\"./operations/LibTUint256Slot.sol\\\";\\n\\ntype TUint256Slot is bytes32;\\n\\nusing {\\n LibTUint256Slot.add,\\n LibTUint256Slot.sub,\\n LibTUint256Slot.mul,\\n LibTUint256Slot.div,\\n LibTUint256Slot.load,\\n LibTUint256Slot.store,\\n LibTUint256Slot.addAssign,\\n LibTUint256Slot.subAssign,\\n LibTUint256Slot.preDecrement,\\n LibTUint256Slot.postDecrement,\\n LibTUint256Slot.preIncrement,\\n LibTUint256Slot.postIncrement\\n} for TUint256Slot global;\\n\",\"keccak256\":\"0x20ab58f1c9ae4936f9dd9891d064301d78ef508c1dd2ce0c19a7b5b81d530e36\",\"license\":\"MIT\"},\"src/types/operations/LibTUint256Slot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.17;\\n\\nimport { TUint256Slot } from \\\"../Types.sol\\\";\\n\\n/**\\n * @title LibTUint256Slot\\n * @dev Library for handling unsigned 256-bit integers.\\n */\\nlibrary LibTUint256Slot {\\n /// @dev value is equal to bytes4(keccak256(\\\"Panic(uint256)\\\"))\\n /// @dev see: https://github.com/foundry-rs/forge-std/blob/master/src/StdError.sol\\n uint256 private constant PANIC_ERROR_SIGNATURE = 0x4e487b71;\\n /// @dev error code for {Arithmetic over/underflow} error\\n uint256 private constant ARITHMETIC_ERROR_CODE = 0x11;\\n /// @dev error code for {Division or modulo by 0} error\\n uint256 private constant DIVISION_ERROR_CODE = 0x12;\\n\\n /**\\n * @dev Loads the value of the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @return val The loaded value.\\n */\\n function load(TUint256Slot self) internal view returns (uint256 val) {\\n assembly {\\n val := sload(self)\\n }\\n }\\n\\n /**\\n * @dev Stores a value into the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @param other The value to be stored.\\n */\\n function store(TUint256Slot self, uint256 other) internal {\\n assembly {\\n sstore(self, other)\\n }\\n }\\n\\n /**\\n * @dev Multiplies the TUint256Slot variable by a given value.\\n * @param self The TUint256Slot variable.\\n * @param other The value to multiply by.\\n * @return res The resulting value after multiplication.\\n */\\n function mul(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n if iszero(iszero(storedVal)) {\\n res := mul(storedVal, other)\\n\\n // Overflow check\\n if iszero(eq(other, div(res, storedVal))) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, ARITHMETIC_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n }\\n }\\n }\\n\\n /**\\n * @dev Divides the TUint256Slot variable by a given value.\\n * @param self The TUint256Slot variable.\\n * @param other The value to divide by.\\n * @return res The resulting value after division.\\n */\\n function div(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n // revert if divide by zero\\n if iszero(other) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, DIVISION_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n res := div(storedVal, other)\\n }\\n }\\n\\n /**\\n * @dev Subtracts a given value from the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @param other The value to subtract.\\n * @return res The resulting value after subtraction.\\n */\\n function sub(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n\\n // Underflow check\\n if lt(storedVal, other) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, ARITHMETIC_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n\\n res := sub(storedVal, other)\\n }\\n }\\n\\n /**\\n * @dev Adds a given value to the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @param other The value to add.\\n * @return res The resulting value after addition.\\n */\\n function add(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n res := add(storedVal, other)\\n\\n // Overflow check\\n if lt(res, other) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, ARITHMETIC_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n }\\n }\\n\\n /**\\n * @dev Increments the TUint256Slot variable by 1 and returns the new value.\\n * @param self The TUint256Slot variable.\\n * @return res The resulting value after incrementing.\\n */\\n function preIncrement(TUint256Slot self) internal returns (uint256 res) {\\n res = addAssign(self, 1);\\n }\\n\\n /**\\n * @dev Increments the TUint256Slot variable by 1 and returns the original value.\\n * @param self The TUint256Slot variable.\\n * @return res The original value before incrementing.\\n */\\n function postIncrement(TUint256Slot self) internal returns (uint256 res) {\\n res = load(self);\\n store(self, res + 1);\\n }\\n\\n /**\\n * @dev Decrements the TUint256Slot variable by 1 and returns the new value.\\n * @param self The TUint256Slot variable.\\n * @return res The resulting value after decrementing.\\n */\\n function preDecrement(TUint256Slot self) internal returns (uint256 res) {\\n res = subAssign(self, 1);\\n }\\n\\n /**\\n * @dev Decrements the TUint256Slot variable by 1 and returns the new value.\\n * @param self The TUint256Slot variable.\\n * @return res The resulting value before decrementing.\\n */\\n function postDecrement(TUint256Slot self) internal returns (uint256 res) {\\n res = load(self);\\n store(self, res - 1);\\n }\\n\\n /**\\n * @dev Adds a given value to the TUint256Slot variable and stores the result.\\n * @param self The TUint256Slot variable.\\n * @param other The value to add.\\n * @return res The resulting value after addition and storage.\\n */\\n function addAssign(TUint256Slot self, uint256 other) internal returns (uint256 res) {\\n store(self, res = add(self, other));\\n }\\n\\n /**\\n * @dev Subtracts a given value from the TUint256Slot variable and stores the result.\\n * @param self The TUint256Slot variable.\\n * @param other The value to subtract.\\n * @return res The resulting value after subtraction and storage.\\n */\\n function subAssign(TUint256Slot self, uint256 other) internal returns (uint256 res) {\\n store(self, res = sub(self, other));\\n }\\n}\\n\",\"keccak256\":\"0xe10c089459baf373494d76b00e582d49f6e43c500ab0f1657d53afc2fa472cbb\",\"license\":\"MIT\"},\"src/utils/CommonErrors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ContractType } from \\\"./ContractType.sol\\\";\\nimport { RoleAccess } from \\\"./RoleAccess.sol\\\";\\n\\nerror ErrSyncTooFarPeriod(uint256 period, uint256 latestRewardedPeriod);\\n/**\\n * @dev Error thrown when an address is expected to be an already created externally owned account (EOA).\\n * This error indicates that the provided address is invalid for certain contract operations that require already created EOA.\\n */\\nerror ErrAddressIsNotCreatedEOA(address addr, bytes32 codehash);\\n/**\\n * @dev Error raised when a bridge operator update operation fails.\\n * @param bridgeOperator The address of the bridge operator that failed to update.\\n */\\nerror ErrBridgeOperatorUpdateFailed(address bridgeOperator);\\n/**\\n * @dev Error thrown when attempting to add a bridge operator that already exists in the contract.\\n * This error indicates that the provided bridge operator address is already registered as a bridge operator in the contract.\\n */\\nerror ErrBridgeOperatorAlreadyExisted(address bridgeOperator);\\n/**\\n * @dev The error indicating an unsupported interface.\\n * @param interfaceId The bytes4 interface identifier that is not supported.\\n * @param addr The address where the unsupported interface was encountered.\\n */\\nerror ErrUnsupportedInterface(bytes4 interfaceId, address addr);\\n/**\\n * @dev Error thrown when the return data from a callback function is invalid.\\n * @param callbackFnSig The signature of the callback function that returned invalid data.\\n * @param register The address of the register where the callback function was invoked.\\n * @param returnData The invalid return data received from the callback function.\\n */\\nerror ErrInvalidReturnData(bytes4 callbackFnSig, address register, bytes returnData);\\n/**\\n * @dev Error of set to non-contract.\\n */\\nerror ErrZeroCodeContract(address addr);\\n/**\\n * @dev Error indicating that arguments are invalid.\\n */\\nerror ErrInvalidArguments(bytes4 msgSig);\\n/**\\n * @dev Error indicating that given address is null when it should not.\\n */\\nerror ErrZeroAddress(bytes4 msgSig);\\n/**\\n * @dev Error indicating that the provided threshold is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that the invalid threshold applies to.\\n */\\nerror ErrInvalidThreshold(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a function can only be called by the contract itself.\\n * @param msgSig The function signature (bytes4) that can only be called by the contract itself.\\n */\\nerror ErrOnlySelfCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n * @param expectedRole The role required to perform the function.\\n */\\nerror ErrUnauthorized(bytes4 msgSig, RoleAccess expectedRole);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n */\\nerror ErrUnauthorizedCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4).\\n * @param expectedContractType The contract type required to perform the function.\\n * @param actual The actual address that called to the function.\\n */\\nerror ErrUnexpectedInternalCall(bytes4 msgSig, ContractType expectedContractType, address actual);\\n\\n/**\\n * @dev Error indicating that an array is empty when it should contain elements.\\n */\\nerror ErrEmptyArray();\\n\\n/**\\n * @dev Error indicating a mismatch in the length of input parameters or arrays for a specific function.\\n * @param msgSig The function signature (bytes4) that has a length mismatch.\\n */\\nerror ErrLengthMismatch(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a proxy call to an external contract has failed.\\n * @param msgSig The function signature (bytes4) of the proxy call that failed.\\n * @param extCallSig The function signature (bytes4) of the external contract call that failed.\\n */\\nerror ErrProxyCallFailed(bytes4 msgSig, bytes4 extCallSig);\\n\\n/**\\n * @dev Error indicating that a function tried to call a precompiled contract that is not allowed.\\n * @param msgSig The function signature (bytes4) that attempted to call a precompiled contract.\\n */\\nerror ErrCallPrecompiled(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a native token transfer has failed.\\n * @param msgSig The function signature (bytes4) of the token transfer that failed.\\n */\\nerror ErrNativeTransferFailed(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that an order is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid order.\\n */\\nerror ErrInvalidOrder(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the chain ID is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid chain ID.\\n * @param actual Current chain ID that executing function.\\n * @param expected Expected chain ID required for the tx to success.\\n */\\nerror ErrInvalidChainId(bytes4 msgSig, uint256 actual, uint256 expected);\\n\\n/**\\n * @dev Error indicating that a vote type is not supported.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an unsupported vote type.\\n */\\nerror ErrUnsupportedVoteType(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the proposal nonce is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid proposal nonce.\\n */\\nerror ErrInvalidProposalNonce(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a voter has already voted.\\n * @param voter The address of the voter who has already voted.\\n */\\nerror ErrAlreadyVoted(address voter);\\n\\n/**\\n * @dev Error indicating that a signature is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid signature.\\n */\\nerror ErrInvalidSignatures(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a relay call has failed.\\n * @param msgSig The function signature (bytes4) of the relay call that failed.\\n */\\nerror ErrRelayFailed(bytes4 msgSig);\\n/**\\n * @dev Error indicating that a vote weight is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid vote weight.\\n */\\nerror ErrInvalidVoteWeight(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a query was made for an outdated bridge operator set.\\n */\\nerror ErrQueryForOutdatedBridgeOperatorSet();\\n\\n/**\\n * @dev Error indicating that a request is invalid.\\n */\\nerror ErrInvalidRequest();\\n\\n/**\\n * @dev Error indicating that a token standard is invalid.\\n */\\nerror ErrInvalidTokenStandard();\\n\\n/**\\n * @dev Error indicating that a token is not supported.\\n */\\nerror ErrUnsupportedToken();\\n\\n/**\\n * @dev Error indicating that a receipt kind is invalid.\\n */\\nerror ErrInvalidReceiptKind();\\n\\n/**\\n * @dev Error indicating that a receipt is invalid.\\n */\\nerror ErrInvalidReceipt();\\n\\n/**\\n * @dev Error indicating that an address is not payable.\\n */\\nerror ErrNonpayableAddress(address);\\n\\n/**\\n * @dev Error indicating that the period is already processed, i.e. scattered reward.\\n */\\nerror ErrPeriodAlreadyProcessed(uint256 requestingPeriod, uint256 latestPeriod);\\n\\n/**\\n * @dev Error thrown when an invalid vote hash is provided.\\n */\\nerror ErrInvalidVoteHash();\\n\\n/**\\n * @dev Error thrown when querying for an empty vote.\\n */\\nerror ErrQueryForEmptyVote();\\n\\n/**\\n * @dev Error thrown when querying for an expired vote.\\n */\\nerror ErrQueryForExpiredVote();\\n\\n/**\\n * @dev Error thrown when querying for a non-existent vote.\\n */\\nerror ErrQueryForNonExistentVote();\\n\\n/**\\n * @dev Error indicating that the method is only called once per block.\\n */\\nerror ErrOncePerBlock();\\n\\n/**\\n * @dev Error of method caller must be coinbase\\n */\\nerror ErrCallerMustBeCoinbase();\\n\\n/**\\n * @dev Error thrown when an invalid proposal is encountered.\\n * @param actual The actual value of the proposal.\\n * @param expected The expected value of the proposal.\\n */\\nerror ErrInvalidProposal(bytes32 actual, bytes32 expected);\\n\\n/**\\n * @dev Error of proposal is not approved for executing.\\n */\\nerror ErrProposalNotApproved();\\n\\n/**\\n * @dev Error of the caller is not the specified executor.\\n */\\nerror ErrInvalidExecutor();\\n\\n/**\\n * @dev Error of the `caller` to relay is not the specified `executor`.\\n */\\nerror ErrNonExecutorCannotRelay(address executor, address caller);\\n\",\"keccak256\":\"0x0d9e2fd98f6b704273faad707ed9eadbd4c79551ee3f902bff5b29213a204679\",\"license\":\"MIT\"},\"src/utils/ContractType.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum ContractType {\\n UNKNOWN, // 0\\n PAUSE_ENFORCER, // 1\\n BRIDGE, // 2\\n BRIDGE_TRACKING, // 3\\n GOVERNANCE_ADMIN, // 4\\n MAINTENANCE, // 5\\n SLASH_INDICATOR, // 6\\n STAKING_VESTING, // 7\\n VALIDATOR, // 8\\n STAKING, // 9\\n RONIN_TRUSTED_ORGANIZATION, // 10\\n BRIDGE_MANAGER, // 11\\n BRIDGE_SLASH, // 12\\n BRIDGE_REWARD, // 13\\n FAST_FINALITY_TRACKING, // 14\\n PROFILE // 15\\n\\n}\\n\",\"keccak256\":\"0xec088aa939cd885dbe84e944942d7ea674e1fff8802c1f2ae5d8e84e4578357d\",\"license\":\"MIT\"},\"src/utils/IdentityGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { AddressArrayUtils } from \\\"../libraries/AddressArrayUtils.sol\\\";\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport { TransparentUpgradeableProxyV2 } from \\\"../extensions/TransparentUpgradeableProxyV2.sol\\\";\\nimport { ErrAddressIsNotCreatedEOA, ErrZeroAddress, ErrOnlySelfCall, ErrZeroCodeContract, ErrUnsupportedInterface } from \\\"./CommonErrors.sol\\\";\\n\\nabstract contract IdentityGuard {\\n using AddressArrayUtils for address[];\\n\\n /// @dev value is equal to keccak256(abi.encode())\\n /// @dev see: https://eips.ethereum.org/EIPS/eip-1052\\n bytes32 internal constant CREATED_ACCOUNT_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\\n\\n /**\\n * @dev Modifier to restrict functions to only be called by this contract.\\n * @dev Reverts if the caller is not this contract.\\n */\\n modifier onlySelfCall() virtual {\\n _requireSelfCall();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to ensure that the elements in the `arr` array are non-duplicates.\\n * It calls the internal `_checkDuplicate` function to perform the duplicate check.\\n *\\n * Requirements:\\n * - The elements in the `arr` array must not contain any duplicates.\\n */\\n modifier nonDuplicate(address[] memory arr) virtual {\\n _requireNonDuplicate(arr);\\n _;\\n }\\n\\n /**\\n * @dev Internal method to check the method caller.\\n * @dev Reverts if the method caller is not this contract.\\n */\\n function _requireSelfCall() internal view virtual {\\n if (msg.sender != address(this)) revert ErrOnlySelfCall(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to check if a contract address has code.\\n * @param addr The address of the contract to check.\\n * @dev Throws an error if the contract address has no code.\\n */\\n function _requireHasCode(address addr) internal view {\\n if (addr.code.length == 0) revert ErrZeroCodeContract(addr);\\n }\\n\\n /**\\n * @dev Checks if an address is zero and reverts if it is.\\n * @param addr The address to check.\\n */\\n function _requireNonZeroAddress(address addr) internal pure {\\n if (addr == address(0)) revert ErrZeroAddress(msg.sig);\\n }\\n\\n /**\\n * @dev Check if arr is empty and revert if it is.\\n * Checks if an array contains any duplicate addresses and reverts if duplicates are found.\\n * @param arr The array of addresses to check.\\n */\\n function _requireNonDuplicate(address[] memory arr) internal pure {\\n if (arr.hasDuplicate()) revert AddressArrayUtils.ErrDuplicated(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to require that the provided address is a created externally owned account (EOA).\\n * This internal function is used to ensure that the provided address is a valid externally owned account (EOA).\\n * It checks the codehash of the address against a predefined constant to confirm that the address is a created EOA.\\n * @notice This method only works with non-state EOA accounts\\n */\\n function _requireCreatedEOA(address addr) internal view {\\n _requireNonZeroAddress(addr);\\n bytes32 codehash = addr.codehash;\\n if (codehash != CREATED_ACCOUNT_HASH) revert ErrAddressIsNotCreatedEOA(addr, codehash);\\n }\\n\\n /**\\n * @dev Internal function to require that the specified contract supports the given interface. This method handle in\\n * both case that the callee is either or not the proxy admin of the caller. If the contract does not support the\\n * interface `interfaceId` or EIP165, a revert with the corresponding error message is triggered.\\n *\\n * @param contractAddr The address of the contract to check for interface support.\\n * @param interfaceId The interface ID to check for support.\\n */\\n function _requireSupportsInterface(address contractAddr, bytes4 interfaceId) internal view {\\n bytes memory supportsInterfaceParams = abi.encodeCall(IERC165.supportsInterface, (interfaceId));\\n (bool success, bytes memory returnOrRevertData) = contractAddr.staticcall(supportsInterfaceParams);\\n if (!success) {\\n (success, returnOrRevertData) = contractAddr.staticcall(abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (supportsInterfaceParams)));\\n if (!success) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n if (!abi.decode(returnOrRevertData, (bool))) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n}\\n\",\"keccak256\":\"0x546ab4c9cdb0e7f8e650f140349225305ba1d0706dcaceeb9180c96aa765da59\",\"license\":\"MIT\"},\"src/utils/RoleAccess.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum RoleAccess {\\n UNKNOWN, // 0\\n ADMIN, // 1\\n COINBASE, // 2\\n GOVERNOR, // 3\\n CANDIDATE_ADMIN, // 4\\n WITHDRAWAL_MIGRATOR, // 5\\n __DEPRECATED_BRIDGE_OPERATOR, // 6\\n BLOCK_PRODUCER, // 7\\n VALIDATOR_CANDIDATE, // 8\\n CONSENSUS, // 9\\n TREASURY // 10\\n\\n}\\n\",\"keccak256\":\"0x671ff40dd874c508c4b3879a580996c7987fc018669256f47151e420a55c0e51\",\"license\":\"MIT\"}},\"version\":1}", + "nonce": 192802, + "numDeployments": 1, + "storageLayout": { + "storage": [ + { + "astId": 58190, + "contract": "src/ronin/gateway/RoninBridgeManagerConstructor.sol:RoninBridgeManagerConstructor", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 58193, + "contract": "src/ronin/gateway/RoninBridgeManagerConstructor.sol:RoninBridgeManagerConstructor", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 105550, + "contract": "src/ronin/gateway/RoninBridgeManagerConstructor.sol:RoninBridgeManagerConstructor", + "label": "DOMAIN_SEPARATOR", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + }, + { + "astId": 107599, + "contract": "src/ronin/gateway/RoninBridgeManagerConstructor.sol:RoninBridgeManagerConstructor", + "label": "round", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 107607, + "contract": "src/ronin/gateway/RoninBridgeManagerConstructor.sol:RoninBridgeManagerConstructor", + "label": "vote", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_uint256,t_mapping(t_uint256,t_struct(ProposalVote)107537_storage))" + }, + { + "astId": 107609, + "contract": "src/ronin/gateway/RoninBridgeManagerConstructor.sol:RoninBridgeManagerConstructor", + "label": "_proposalExpiryDuration", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 108331, + "contract": "src/ronin/gateway/RoninBridgeManagerConstructor.sol:RoninBridgeManagerConstructor", + "label": "_targetOptionsMap", + "offset": 0, + "slot": "5", + "type": "t_mapping(t_enum(TargetOption)112395,t_address)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_address)dyn_storage": { + "encoding": "dynamic_array", + "label": "address[]", + "numberOfBytes": "32", + "base": "t_address" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_enum(TargetOption)112395": { + "encoding": "inplace", + "label": "enum GlobalProposal.TargetOption", + "numberOfBytes": "1" + }, + "t_enum(VoteStatus)111339": { + "encoding": "inplace", + "label": "enum VoteStatusConsumer.VoteStatus", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_address,t_struct(Signature)111330_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct SignatureConsumer.Signature)", + "numberOfBytes": "32", + "value": "t_struct(Signature)111330_storage" + }, + "t_mapping(t_enum(TargetOption)112395,t_address)": { + "encoding": "mapping", + "key": "t_enum(TargetOption)112395", + "label": "mapping(enum GlobalProposal.TargetOption => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_uint256,t_mapping(t_uint256,t_struct(ProposalVote)107537_storage))": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => mapping(uint256 => struct CoreGovernance.ProposalVote))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint256,t_struct(ProposalVote)107537_storage)" + }, + "t_mapping(t_uint256,t_struct(ProposalVote)107537_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct CoreGovernance.ProposalVote)", + "numberOfBytes": "32", + "value": "t_struct(ProposalVote)107537_storage" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(ProposalVote)107537_storage": { + "encoding": "inplace", + "label": "struct CoreGovernance.ProposalVote", + "numberOfBytes": "288", + "members": [ + { + "astId": 107513, + "contract": "src/ronin/gateway/RoninBridgeManagerConstructor.sol:RoninBridgeManagerConstructor", + "label": "status", + "offset": 0, + "slot": "0", + "type": "t_enum(VoteStatus)111339" + }, + { + "astId": 107515, + "contract": "src/ronin/gateway/RoninBridgeManagerConstructor.sol:RoninBridgeManagerConstructor", + "label": "hash", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + }, + { + "astId": 107517, + "contract": "src/ronin/gateway/RoninBridgeManagerConstructor.sol:RoninBridgeManagerConstructor", + "label": "againstVoteWeight", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 107519, + "contract": "src/ronin/gateway/RoninBridgeManagerConstructor.sol:RoninBridgeManagerConstructor", + "label": "forVoteWeight", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 107522, + "contract": "src/ronin/gateway/RoninBridgeManagerConstructor.sol:RoninBridgeManagerConstructor", + "label": "forVoteds", + "offset": 0, + "slot": "4", + "type": "t_array(t_address)dyn_storage" + }, + { + "astId": 107525, + "contract": "src/ronin/gateway/RoninBridgeManagerConstructor.sol:RoninBridgeManagerConstructor", + "label": "againstVoteds", + "offset": 0, + "slot": "5", + "type": "t_array(t_address)dyn_storage" + }, + { + "astId": 107527, + "contract": "src/ronin/gateway/RoninBridgeManagerConstructor.sol:RoninBridgeManagerConstructor", + "label": "expiryTimestamp", + "offset": 0, + "slot": "6", + "type": "t_uint256" + }, + { + "astId": 107532, + "contract": "src/ronin/gateway/RoninBridgeManagerConstructor.sol:RoninBridgeManagerConstructor", + "label": "sig", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_address,t_struct(Signature)111330_storage)" + }, + { + "astId": 107536, + "contract": "src/ronin/gateway/RoninBridgeManagerConstructor.sol:RoninBridgeManagerConstructor", + "label": "voted", + "offset": 0, + "slot": "8", + "type": "t_mapping(t_address,t_bool)" + } + ] + }, + "t_struct(Signature)111330_storage": { + "encoding": "inplace", + "label": "struct SignatureConsumer.Signature", + "numberOfBytes": "96", + "members": [ + { + "astId": 111325, + "contract": "src/ronin/gateway/RoninBridgeManagerConstructor.sol:RoninBridgeManagerConstructor", + "label": "v", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 111327, + "contract": "src/ronin/gateway/RoninBridgeManagerConstructor.sol:RoninBridgeManagerConstructor", + "label": "r", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + }, + { + "astId": 111329, + "contract": "src/ronin/gateway/RoninBridgeManagerConstructor.sol:RoninBridgeManagerConstructor", + "label": "s", + "offset": 0, + "slot": "2", + "type": "t_bytes32" + } + ] + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + }, + "timestamp": 1713240519, + "userdoc": { + "version": 1, + "kind": "user", + "methods": { + "round(uint256)": { + "notice": "chain id = 0 for global proposal" + } + }, + "errors": { + "ErrBelowMinRequiredGovernors()": [ + { + "notice": "Error indicating that the governors list will go below minimum number of required governor." + } + ], + "ErrGovernorNotFound(address)": [ + { + "notice": "Error indicating that cannot find the querying governor" + } + ], + "ErrGovernorNotMatch(address,address)": [ + { + "notice": "Error indicating that the msg.sender is not match the required governor" + } + ], + "ErrInvalidInput()": [ + { + "notice": "Common invalid input error" + } + ], + "ErrOperatorNotFound(address)": [ + { + "notice": "Error indicating that cannot find the querying operator" + } + ] + } + } +} \ No newline at end of file diff --git a/deployments/ronin-testnet/RoninBridgeManagerConstructorProxy.json b/deployments/ronin-testnet/RoninBridgeManagerConstructorProxy.json new file mode 100644 index 00000000..6e7b6d55 --- /dev/null +++ b/deployments/ronin-testnet/RoninBridgeManagerConstructorProxy.json @@ -0,0 +1,218 @@ +{ + "abi": [ + { + "type": "constructor", + "inputs": [ + { + "name": "_logic", + "type": "address", + "internalType": "address" + }, + { + "name": "admin_", + "type": "address", + "internalType": "address" + }, + { + "name": "_data", + "type": "bytes", + "internalType": "bytes" + } + ], + "stateMutability": "payable" + }, + { + "type": "fallback", + "stateMutability": "payable" + }, + { + "type": "receive", + "stateMutability": "payable" + }, + { + "type": "function", + "name": "admin", + "inputs": [], + "outputs": [ + { + "name": "admin_", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "changeAdmin", + "inputs": [ + { + "name": "newAdmin", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "functionDelegateCall", + "inputs": [ + { + "name": "_data", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [], + "stateMutability": "payable" + }, + { + "type": "function", + "name": "implementation", + "inputs": [], + "outputs": [ + { + "name": "implementation_", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "upgradeTo", + "inputs": [ + { + "name": "newImplementation", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "upgradeToAndCall", + "inputs": [ + { + "name": "newImplementation", + "type": "address", + "internalType": "address" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [], + "stateMutability": "payable" + }, + { + "type": "event", + "name": "AdminChanged", + "inputs": [ + { + "name": "previousAdmin", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "newAdmin", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "BeaconUpgraded", + "inputs": [ + { + "name": "beacon", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Upgraded", + "inputs": [ + { + "name": "implementation", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + } + ], + "address": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "args": "0x7d4c1d780000000000000000000000000000000000000000000000000000000000000007000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000007e50000000000000000000000000000000000000000000000000000000000127500000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca00000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000003600000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000002e82d2b56f858f79deef11b160bfc4631873da2b000000000000000000000000bcb61783dd2403fe8cc9b89b27b1a9bb03d040cb000000000000000000000000b266bf53cf7eac4e2065a404598dcb0e15e9462c000000000000000000000000cc5fc5b6c8595f56306da736f6cd02ed9141c84a0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000d24d87ddc1917165435b306aac68d99e0f49a3fa000000000000000000000000b033ba62ec622dc54d0abfe0254e79692147ca26000000000000000000000000087d08e3ba42e64e3948962dd1371f906d1278b900000000000000000000000052ec2e6bbce45afff8955da6410bb13812f4289f000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000005000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab95", + "ast": "", + "blockNumber": 26511796, + "bytecode": "0x608060405260405162000eed38038062000eed833981016040819052620000269162000429565b8282828281620000398282600062000053565b506200004790508262000085565b5050505050506200055c565b6200005e83620000f7565b6000825111806200006c5750805b1562000080576200007e838362000139565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f620000c760008051602062000ea6833981519152546001600160a01b031690565b604080516001600160a01b03928316815291841660208301520160405180910390a1620000f48162000168565b50565b620001028162000206565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606062000161838360405180606001604052806027815260200162000ec6602791396200029d565b9392505050565b6001600160a01b038116620001d35760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b8060008051602062000ea68339815191525b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002118162000383565b620002755760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620001ca565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc620001e5565b6060620002aa8462000383565b620003075760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401620001ca565b600080856001600160a01b03168560405162000324919062000509565b600060405180830381855af49150503d806000811462000361576040519150601f19603f3d011682016040523d82523d6000602084013e62000366565b606091505b5090925090506200037982828662000392565b9695505050505050565b6001600160a01b03163b151590565b60608315620003a357508162000161565b825115620003b45782518084602001fd5b8160405162461bcd60e51b8152600401620001ca919062000527565b80516001600160a01b0381168114620003e857600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200042057818101518382015260200162000406565b50506000910152565b6000806000606084860312156200043f57600080fd5b6200044a84620003d0565b92506200045a60208501620003d0565b60408501519092506001600160401b03808211156200047857600080fd5b818601915086601f8301126200048d57600080fd5b815181811115620004a257620004a2620003ed565b604051601f8201601f19908116603f01168101908382118183101715620004cd57620004cd620003ed565b81604052828152896020848701011115620004e757600080fd5b620004fa83602083016020880162000403565b80955050505050509250925092565b600082516200051d81846020870162000403565b9190910192915050565b60208152600082518060208401526200054881604085016020870162000403565b601f01601f19169190910160400192915050565b61093a806200056c6000396000f3fe6080604052600436106100595760003560e01c80633659cfe6146100705780634bb5274a146100905780634f1ef286146100a35780635c60da1b146100b65780638f283970146100e7578063f851a4401461010757610068565b366100685761006661011c565b005b61006661011c565b34801561007c57600080fd5b5061006661008b3660046106c7565b610136565b61006661009e3660046106f8565b610173565b6100666100b13660046107a8565b6101b8565b3480156100c257600080fd5b506100cb61021f565b6040516001600160a01b03909116815260200160405180910390f35b3480156100f357600080fd5b506100666101023660046106c7565b610250565b34801561011357600080fd5b506100cb610270565b610124610291565b61013461012f610326565b610330565b565b61013e61034f565b6001600160a01b0316330361016b5761016881604051806020016040528060008152506000610370565b50565b61016861011c565b61017b61034f565b6001600160a01b0316330361016b576000610194610326565b9050600080835160208501845af43d6000803e8080156101b3573d6000f35b3d6000fd5b6101c061034f565b6001600160a01b03163303610217576102128383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525060019250610370915050565b505050565b61021261011c565b600061022961034f565b6001600160a01b0316330361024557610240610326565b905090565b61024d61011c565b90565b61025861034f565b6001600160a01b0316330361016b576101688161039b565b600061027a61034f565b6001600160a01b031633036102455761024061034f565b61029961034f565b6001600160a01b031633036101345760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006102406103ef565b3660008037600080366000845af43d6000803e8080156101b3573d6000f35b600060008051602061089e8339815191525b546001600160a01b0316919050565b61037983610405565b6000825111806103865750805b15610212576103958383610445565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103c461034f565b604080516001600160a01b03928316815291841660208301520160405180910390a161016881610471565b60006000805160206108be833981519152610361565b61040e81610508565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061046a83836040518060600160405280602781526020016108de60279139610588565b9392505050565b6001600160a01b0381166104d65760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b606482015260840161031d565b8060008051602061089e8339815191525b80546001600160a01b0319166001600160a01b039290921691909117905550565b61051181610663565b6105735760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161031d565b806000805160206108be8339815191526104e7565b606061059384610663565b6105ee5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161031d565b600080856001600160a01b031685604051610609919061084e565b600060405180830381855af49150503d8060008114610644576040519150601f19603f3d011682016040523d82523d6000602084013e610649565b606091505b5091509150610659828286610672565b9695505050505050565b6001600160a01b03163b151590565b6060831561068157508161046a565b8251156106915782518084602001fd5b8160405162461bcd60e51b815260040161031d919061086a565b80356001600160a01b03811681146106c257600080fd5b919050565b6000602082840312156106d957600080fd5b61046a826106ab565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561070a57600080fd5b81356001600160401b038082111561072157600080fd5b818401915084601f83011261073557600080fd5b813581811115610747576107476106e2565b604051601f8201601f19908116603f0116810190838211818310171561076f5761076f6106e2565b8160405282815287602084870101111561078857600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000806000604084860312156107bd57600080fd5b6107c6846106ab565b925060208401356001600160401b03808211156107e257600080fd5b818601915086601f8301126107f657600080fd5b81358181111561080557600080fd5b87602082850101111561081757600080fd5b6020830194508093505050509250925092565b60005b8381101561084557818101518382015260200161082d565b50506000910152565b6000825161086081846020870161082a565b9190910192915050565b602081526000825180602084015261088981604085016020870161082a565b601f01601f1916919091016040019291505056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212205d5db908d6bad5bfc298cb89bc49c38963bb1499be9336506651cff965fb333264736f6c63430008170033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "chainId": 2021, + "contractAbsolutePath": "TransparentUpgradeableProxyV2.sol:TransparentUpgradeableProxyV2", + "deployedBytecode": "0x6080604052600436106100595760003560e01c80633659cfe6146100705780634bb5274a146100905780634f1ef286146100a35780635c60da1b146100b65780638f283970146100e7578063f851a4401461010757610068565b366100685761006661011c565b005b61006661011c565b34801561007c57600080fd5b5061006661008b3660046106c7565b610136565b61006661009e3660046106f8565b610173565b6100666100b13660046107a8565b6101b8565b3480156100c257600080fd5b506100cb61021f565b6040516001600160a01b03909116815260200160405180910390f35b3480156100f357600080fd5b506100666101023660046106c7565b610250565b34801561011357600080fd5b506100cb610270565b610124610291565b61013461012f610326565b610330565b565b61013e61034f565b6001600160a01b0316330361016b5761016881604051806020016040528060008152506000610370565b50565b61016861011c565b61017b61034f565b6001600160a01b0316330361016b576000610194610326565b9050600080835160208501845af43d6000803e8080156101b3573d6000f35b3d6000fd5b6101c061034f565b6001600160a01b03163303610217576102128383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525060019250610370915050565b505050565b61021261011c565b600061022961034f565b6001600160a01b0316330361024557610240610326565b905090565b61024d61011c565b90565b61025861034f565b6001600160a01b0316330361016b576101688161039b565b600061027a61034f565b6001600160a01b031633036102455761024061034f565b61029961034f565b6001600160a01b031633036101345760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006102406103ef565b3660008037600080366000845af43d6000803e8080156101b3573d6000f35b600060008051602061089e8339815191525b546001600160a01b0316919050565b61037983610405565b6000825111806103865750805b15610212576103958383610445565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103c461034f565b604080516001600160a01b03928316815291841660208301520160405180910390a161016881610471565b60006000805160206108be833981519152610361565b61040e81610508565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061046a83836040518060600160405280602781526020016108de60279139610588565b9392505050565b6001600160a01b0381166104d65760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b606482015260840161031d565b8060008051602061089e8339815191525b80546001600160a01b0319166001600160a01b039290921691909117905550565b61051181610663565b6105735760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161031d565b806000805160206108be8339815191526104e7565b606061059384610663565b6105ee5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161031d565b600080856001600160a01b031685604051610609919061084e565b600060405180830381855af49150503d8060008114610644576040519150601f19603f3d011682016040523d82523d6000602084013e610649565b606091505b5091509150610659828286610672565b9695505050505050565b6001600160a01b03163b151590565b6060831561068157508161046a565b8251156106915782518084602001fd5b8160405162461bcd60e51b815260040161031d919061086a565b80356001600160a01b03811681146106c257600080fd5b919050565b6000602082840312156106d957600080fd5b61046a826106ab565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561070a57600080fd5b81356001600160401b038082111561072157600080fd5b818401915084601f83011261073557600080fd5b813581811115610747576107476106e2565b604051601f8201601f19908116603f0116810190838211818310171561076f5761076f6106e2565b8160405282815287602084870101111561078857600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000806000604084860312156107bd57600080fd5b6107c6846106ab565b925060208401356001600160401b03808211156107e257600080fd5b818601915086601f8301126107f657600080fd5b81358181111561080557600080fd5b87602082850101111561081757600080fd5b6020830194508093505050509250925092565b60005b8381101561084557818101518382015260200161082d565b50506000910152565b6000825161086081846020870161082a565b9190910192915050565b602081526000825180602084015261088981604085016020870161082a565b601f01601f1916919091016040019291505056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212205d5db908d6bad5bfc298cb89bc49c38963bb1499be9336506651cff965fb333264736f6c63430008170033", + "deployer": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "devdoc": { + "version": 1, + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "functionDelegateCall(bytes)": { + "details": "Calls a function from the current implementation as specified by `_data`, which should be an encoded function call. Requirements: - Only the admin can call this function. Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider reviewing the encoded data `_data` and the method which is called before using this." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "events": { + "AdminChanged(address,address)": { + "details": "Emitted when the admin account has changed." + }, + "BeaconUpgraded(address)": { + "details": "Emitted when the beacon is upgraded." + }, + "Upgraded(address)": { + "details": "Emitted when the implementation is upgraded." + } + } + }, + "isFoundry": true, + "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"functionDelegateCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"events\":{\"AdminChanged(address,address)\":{\"details\":\"Emitted when the admin account has changed.\"},\"BeaconUpgraded(address)\":{\"details\":\"Emitted when the beacon is upgraded.\"},\"Upgraded(address)\":{\"details\":\"Emitted when the implementation is upgraded.\"}},\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"functionDelegateCall(bytes)\":{\"details\":\"Calls a function from the current implementation as specified by `_data`, which should be an encoded function call. Requirements: - Only the admin can call this function. Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider reviewing the encoded data `_data` and the method which is called before using this.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/extensions/TransparentUpgradeableProxyV2.sol\":\"TransparentUpgradeableProxyV2\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[\":@fdk/=lib/foundry-deployment-kit/script/\",\":@openzeppelin/=lib/openzeppelin-contracts/\",\":@prb/math/=lib/prb-math/\",\":@prb/test/=lib/prb-test/src/\",\":@ronin/contracts/=src/\",\":@ronin/script/=script/\",\":@ronin/test/=test/\",\":contract-libs/=lib/foundry-deployment-kit/lib/contract-libs/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/foundry-deployment-kit/lib/forge-std/src/\",\":foundry-deployment-kit/=lib/foundry-deployment-kit/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/contracts/\",\":prb-math/=lib/prb-math/src/\",\":prb-test/=lib/prb-test/src/\",\":solady/=lib/solady/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0xa6a787e7a901af6511e19aa53e1a00352db215a011d2c7a438d0582dd5da76f9\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"src/extensions/TransparentUpgradeableProxyV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\\\";\\n\\ncontract TransparentUpgradeableProxyV2 is TransparentUpgradeableProxy {\\n constructor(address _logic, address admin_, bytes memory _data) payable TransparentUpgradeableProxy(_logic, admin_, _data) { }\\n\\n /**\\n * @dev Calls a function from the current implementation as specified by `_data`, which should be an encoded function call.\\n *\\n * Requirements:\\n * - Only the admin can call this function.\\n *\\n * Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid\\n * triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider\\n * reviewing the encoded data `_data` and the method which is called before using this.\\n *\\n */\\n function functionDelegateCall(bytes memory _data) public payable ifAdmin {\\n address _addr = _implementation();\\n assembly {\\n let _result := delegatecall(gas(), _addr, add(_data, 32), mload(_data), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n switch _result\\n case 0 { revert(0, returndatasize()) }\\n default { return(0, returndatasize()) }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x45fc7b71d09da99414b977a56e586b3604670d865e5f36f395d5c98bc4ba64af\",\"license\":\"MIT\"}},\"version\":1}", + "nonce": 192803, + "numDeployments": 1, + "storageLayout": { + "storage": [], + "types": {} + }, + "timestamp": 1713240519, + "userdoc": { + "version": 1, + "kind": "user" + } +} \ No newline at end of file diff --git a/deployments/ronin-testnet/RoninBridgeManagerLogic.json b/deployments/ronin-testnet/RoninBridgeManagerLogic.json new file mode 100644 index 00000000..37b4ea78 --- /dev/null +++ b/deployments/ronin-testnet/RoninBridgeManagerLogic.json @@ -0,0 +1,2952 @@ +{ + "abi": [ + { + "type": "function", + "name": "DOMAIN_SEPARATOR", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "addBridgeOperators", + "inputs": [ + { + "name": "voteWeights", + "type": "uint96[]", + "internalType": "uint96[]" + }, + { + "name": "governors", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "bridgeOperators", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "castGlobalProposalBySignatures", + "inputs": [ + { + "name": "globalProposal", + "type": "tuple", + "internalType": "struct GlobalProposal.GlobalProposalDetail", + "components": [ + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiryTimestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "executor", + "type": "address", + "internalType": "address" + }, + { + "name": "targetOptions", + "type": "uint8[]", + "internalType": "enum GlobalProposal.TargetOption[]" + }, + { + "name": "values", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "calldatas", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "gasAmounts", + "type": "uint256[]", + "internalType": "uint256[]" + } + ] + }, + { + "name": "supports_", + "type": "uint8[]", + "internalType": "enum Ballot.VoteType[]" + }, + { + "name": "signatures", + "type": "tuple[]", + "internalType": "struct SignatureConsumer.Signature[]", + "components": [ + { + "name": "v", + "type": "uint8", + "internalType": "uint8" + }, + { + "name": "r", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "s", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "castProposalBySignatures", + "inputs": [ + { + "name": "proposal", + "type": "tuple", + "internalType": "struct Proposal.ProposalDetail", + "components": [ + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiryTimestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "executor", + "type": "address", + "internalType": "address" + }, + { + "name": "targets", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "values", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "calldatas", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "gasAmounts", + "type": "uint256[]", + "internalType": "uint256[]" + } + ] + }, + { + "name": "supports_", + "type": "uint8[]", + "internalType": "enum Ballot.VoteType[]" + }, + { + "name": "signatures", + "type": "tuple[]", + "internalType": "struct SignatureConsumer.Signature[]", + "components": [ + { + "name": "v", + "type": "uint8", + "internalType": "uint8" + }, + { + "name": "r", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "s", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "castProposalVoteForCurrentNetwork", + "inputs": [ + { + "name": "proposal", + "type": "tuple", + "internalType": "struct Proposal.ProposalDetail", + "components": [ + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiryTimestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "executor", + "type": "address", + "internalType": "address" + }, + { + "name": "targets", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "values", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "calldatas", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "gasAmounts", + "type": "uint256[]", + "internalType": "uint256[]" + } + ] + }, + { + "name": "support", + "type": "uint8", + "internalType": "enum Ballot.VoteType" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "checkThreshold", + "inputs": [ + { + "name": "voteWeight", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "deleteExpired", + "inputs": [ + { + "name": "_chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_round", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "execute", + "inputs": [ + { + "name": "proposal", + "type": "tuple", + "internalType": "struct Proposal.ProposalDetail", + "components": [ + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiryTimestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "executor", + "type": "address", + "internalType": "address" + }, + { + "name": "targets", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "values", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "calldatas", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "gasAmounts", + "type": "uint256[]", + "internalType": "uint256[]" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "executeGlobal", + "inputs": [ + { + "name": "globalProposal", + "type": "tuple", + "internalType": "struct GlobalProposal.GlobalProposalDetail", + "components": [ + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiryTimestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "executor", + "type": "address", + "internalType": "address" + }, + { + "name": "targetOptions", + "type": "uint8[]", + "internalType": "enum GlobalProposal.TargetOption[]" + }, + { + "name": "values", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "calldatas", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "gasAmounts", + "type": "uint256[]", + "internalType": "uint256[]" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "getBridgeOperatorWeight", + "inputs": [ + { + "name": "bridgeOperator", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "weight", + "type": "uint96", + "internalType": "uint96" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getBridgeOperators", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address[]", + "internalType": "address[]" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getCallbackRegisters", + "inputs": [], + "outputs": [ + { + "name": "registers", + "type": "address[]", + "internalType": "address[]" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getContract", + "inputs": [ + { + "name": "contractType", + "type": "uint8", + "internalType": "enum ContractType" + } + ], + "outputs": [ + { + "name": "contract_", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getFullBridgeOperatorInfos", + "inputs": [], + "outputs": [ + { + "name": "governors", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "bridgeOperators", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "weights", + "type": "uint96[]", + "internalType": "uint96[]" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getGlobalProposalSignatures", + "inputs": [ + { + "name": "round_", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "voters", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "supports_", + "type": "uint8[]", + "internalType": "enum Ballot.VoteType[]" + }, + { + "name": "signatures", + "type": "tuple[]", + "internalType": "struct SignatureConsumer.Signature[]", + "components": [ + { + "name": "v", + "type": "uint8", + "internalType": "uint8" + }, + { + "name": "r", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "s", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getGovernorOf", + "inputs": [ + { + "name": "operator", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "governor", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getGovernorWeight", + "inputs": [ + { + "name": "governor", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "weight", + "type": "uint96", + "internalType": "uint96" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getGovernorWeights", + "inputs": [ + { + "name": "governors", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [ + { + "name": "weights", + "type": "uint96[]", + "internalType": "uint96[]" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getGovernors", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address[]", + "internalType": "address[]" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getOperatorOf", + "inputs": [ + { + "name": "governor", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "operator", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getProposalExpiryDuration", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getProposalSignatures", + "inputs": [ + { + "name": "_chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_round", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "_voters", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "_supports", + "type": "uint8[]", + "internalType": "enum Ballot.VoteType[]" + }, + { + "name": "_signatures", + "type": "tuple[]", + "internalType": "struct SignatureConsumer.Signature[]", + "components": [ + { + "name": "v", + "type": "uint8", + "internalType": "uint8" + }, + { + "name": "r", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "s", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getThreshold", + "inputs": [], + "outputs": [ + { + "name": "num", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "denom", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getTotalWeight", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "globalProposalVoted", + "inputs": [ + { + "name": "round_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "voter", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "isBridgeOperator", + "inputs": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "minimumVoteWeight", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "proposalVoted", + "inputs": [ + { + "name": "_chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_round", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_voter", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "propose", + "inputs": [ + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiryTimestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "executor", + "type": "address", + "internalType": "address" + }, + { + "name": "targets", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "values", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "calldatas", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "gasAmounts", + "type": "uint256[]", + "internalType": "uint256[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "proposeGlobal", + "inputs": [ + { + "name": "expiryTimestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "executor", + "type": "address", + "internalType": "address" + }, + { + "name": "targetOptions", + "type": "uint8[]", + "internalType": "enum GlobalProposal.TargetOption[]" + }, + { + "name": "values", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "calldatas", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "gasAmounts", + "type": "uint256[]", + "internalType": "uint256[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "proposeGlobalProposalStructAndCastVotes", + "inputs": [ + { + "name": "globalProposal", + "type": "tuple", + "internalType": "struct GlobalProposal.GlobalProposalDetail", + "components": [ + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiryTimestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "executor", + "type": "address", + "internalType": "address" + }, + { + "name": "targetOptions", + "type": "uint8[]", + "internalType": "enum GlobalProposal.TargetOption[]" + }, + { + "name": "values", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "calldatas", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "gasAmounts", + "type": "uint256[]", + "internalType": "uint256[]" + } + ] + }, + { + "name": "supports_", + "type": "uint8[]", + "internalType": "enum Ballot.VoteType[]" + }, + { + "name": "signatures", + "type": "tuple[]", + "internalType": "struct SignatureConsumer.Signature[]", + "components": [ + { + "name": "v", + "type": "uint8", + "internalType": "uint8" + }, + { + "name": "r", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "s", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "proposeProposalForCurrentNetwork", + "inputs": [ + { + "name": "expiryTimestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "executor", + "type": "address", + "internalType": "address" + }, + { + "name": "targets", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "values", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "calldatas", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "gasAmounts", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "support", + "type": "uint8", + "internalType": "enum Ballot.VoteType" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "proposeProposalStructAndCastVotes", + "inputs": [ + { + "name": "_proposal", + "type": "tuple", + "internalType": "struct Proposal.ProposalDetail", + "components": [ + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiryTimestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "executor", + "type": "address", + "internalType": "address" + }, + { + "name": "targets", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "values", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "calldatas", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "gasAmounts", + "type": "uint256[]", + "internalType": "uint256[]" + } + ] + }, + { + "name": "_supports", + "type": "uint8[]", + "internalType": "enum Ballot.VoteType[]" + }, + { + "name": "_signatures", + "type": "tuple[]", + "internalType": "struct SignatureConsumer.Signature[]", + "components": [ + { + "name": "v", + "type": "uint8", + "internalType": "uint8" + }, + { + "name": "r", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "s", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "registerCallbacks", + "inputs": [ + { + "name": "registers", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "removeBridgeOperators", + "inputs": [ + { + "name": "bridgeOperators", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "resolveTargets", + "inputs": [ + { + "name": "targetOptions", + "type": "uint8[]", + "internalType": "enum GlobalProposal.TargetOption[]" + } + ], + "outputs": [ + { + "name": "targets", + "type": "address[]", + "internalType": "address[]" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "round", + "inputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "setContract", + "inputs": [ + { + "name": "contractType", + "type": "uint8", + "internalType": "enum ContractType" + }, + { + "name": "addr", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "setMinRequiredGovernor", + "inputs": [ + { + "name": "min", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "setThreshold", + "inputs": [ + { + "name": "num", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "denom", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "sumGovernorsWeight", + "inputs": [ + { + "name": "governors", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [ + { + "name": "sum", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "totalBridgeOperator", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "unregisterCallbacks", + "inputs": [ + { + "name": "registers", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "updateManyTargetOption", + "inputs": [ + { + "name": "targetOptions", + "type": "uint8[]", + "internalType": "enum GlobalProposal.TargetOption[]" + }, + { + "name": "targets", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "vote", + "inputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "status", + "type": "uint8", + "internalType": "enum VoteStatusConsumer.VoteStatus" + }, + { + "name": "hash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "againstVoteWeight", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "forVoteWeight", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiryTimestamp", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "event", + "name": "BridgeOperatorAddingFailed", + "inputs": [ + { + "name": "operator", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "BridgeOperatorRemovingFailed", + "inputs": [ + { + "name": "operator", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "BridgeOperatorUpdated", + "inputs": [ + { + "name": "governor", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "fromBridgeOperator", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "toBridgeOperator", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "BridgeOperatorsAdded", + "inputs": [ + { + "name": "statuses", + "type": "bool[]", + "indexed": false, + "internalType": "bool[]" + }, + { + "name": "voteWeights", + "type": "uint96[]", + "indexed": false, + "internalType": "uint96[]" + }, + { + "name": "governors", + "type": "address[]", + "indexed": false, + "internalType": "address[]" + }, + { + "name": "bridgeOperators", + "type": "address[]", + "indexed": false, + "internalType": "address[]" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "BridgeOperatorsRemoved", + "inputs": [ + { + "name": "statuses", + "type": "bool[]", + "indexed": false, + "internalType": "bool[]" + }, + { + "name": "bridgeOperators", + "type": "address[]", + "indexed": false, + "internalType": "address[]" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "CallbackRegistered", + "inputs": [ + { + "name": "", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "", + "type": "bool", + "indexed": false, + "internalType": "bool" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ContractUpdated", + "inputs": [ + { + "name": "contractType", + "type": "uint8", + "indexed": true, + "internalType": "enum ContractType" + }, + { + "name": "addr", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "GlobalProposalCreated", + "inputs": [ + { + "name": "round", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "proposalHash", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "proposal", + "type": "tuple", + "indexed": false, + "internalType": "struct Proposal.ProposalDetail", + "components": [ + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiryTimestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "executor", + "type": "address", + "internalType": "address" + }, + { + "name": "targets", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "values", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "calldatas", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "gasAmounts", + "type": "uint256[]", + "internalType": "uint256[]" + } + ] + }, + { + "name": "globalProposalHash", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + }, + { + "name": "globalProposal", + "type": "tuple", + "indexed": false, + "internalType": "struct GlobalProposal.GlobalProposalDetail", + "components": [ + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiryTimestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "executor", + "type": "address", + "internalType": "address" + }, + { + "name": "targetOptions", + "type": "uint8[]", + "internalType": "enum GlobalProposal.TargetOption[]" + }, + { + "name": "values", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "calldatas", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "gasAmounts", + "type": "uint256[]", + "internalType": "uint256[]" + } + ] + }, + { + "name": "creator", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Initialized", + "inputs": [ + { + "name": "version", + "type": "uint8", + "indexed": false, + "internalType": "uint8" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "MinRequiredGovernorUpdated", + "inputs": [ + { + "name": "min", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Notified", + "inputs": [ + { + "name": "callData", + "type": "bytes", + "indexed": false, + "internalType": "bytes" + }, + { + "name": "registers", + "type": "address[]", + "indexed": false, + "internalType": "address[]" + }, + { + "name": "statuses", + "type": "bool[]", + "indexed": false, + "internalType": "bool[]" + }, + { + "name": "returnDatas", + "type": "bytes[]", + "indexed": false, + "internalType": "bytes[]" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ProposalApproved", + "inputs": [ + { + "name": "proposalHash", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ProposalCreated", + "inputs": [ + { + "name": "chainId", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "round", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "proposalHash", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "proposal", + "type": "tuple", + "indexed": false, + "internalType": "struct Proposal.ProposalDetail", + "components": [ + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiryTimestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "executor", + "type": "address", + "internalType": "address" + }, + { + "name": "targets", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "values", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "calldatas", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "gasAmounts", + "type": "uint256[]", + "internalType": "uint256[]" + } + ] + }, + { + "name": "creator", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ProposalExecuted", + "inputs": [ + { + "name": "proposalHash", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "successCalls", + "type": "bool[]", + "indexed": false, + "internalType": "bool[]" + }, + { + "name": "returnDatas", + "type": "bytes[]", + "indexed": false, + "internalType": "bytes[]" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ProposalExpired", + "inputs": [ + { + "name": "proposalHash", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ProposalExpiryDurationChanged", + "inputs": [ + { + "name": "duration", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ProposalRejected", + "inputs": [ + { + "name": "proposalHash", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ProposalVoted", + "inputs": [ + { + "name": "proposalHash", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "voter", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "support", + "type": "uint8", + "indexed": false, + "internalType": "enum Ballot.VoteType" + }, + { + "name": "weight", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "TargetOptionUpdated", + "inputs": [ + { + "name": "targetOption", + "type": "uint8", + "indexed": true, + "internalType": "enum GlobalProposal.TargetOption" + }, + { + "name": "addr", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ThresholdUpdated", + "inputs": [ + { + "name": "nonce", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "numerator", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "denominator", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "previousNumerator", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "previousDenominator", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "ErrAlreadyVoted", + "inputs": [ + { + "name": "voter", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ErrBelowMinRequiredGovernors", + "inputs": [] + }, + { + "type": "error", + "name": "ErrContractTypeNotFound", + "inputs": [ + { + "name": "contractType", + "type": "uint8", + "internalType": "enum ContractType" + } + ] + }, + { + "type": "error", + "name": "ErrCurrentProposalIsNotCompleted", + "inputs": [] + }, + { + "type": "error", + "name": "ErrDuplicated", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrExistOneInternalCallFailed", + "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address" + }, + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + }, + { + "name": "callData", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "type": "error", + "name": "ErrGovernorNotFound", + "inputs": [ + { + "name": "governor", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ErrGovernorNotMatch", + "inputs": [ + { + "name": "required", + "type": "address", + "internalType": "address" + }, + { + "name": "sender", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ErrInsufficientGas", + "inputs": [ + { + "name": "proposalHash", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "type": "error", + "name": "ErrInvalidArguments", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrInvalidChainId", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + }, + { + "name": "actual", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expected", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "ErrInvalidExecutor", + "inputs": [] + }, + { + "type": "error", + "name": "ErrInvalidExpiryTimestamp", + "inputs": [] + }, + { + "type": "error", + "name": "ErrInvalidInput", + "inputs": [] + }, + { + "type": "error", + "name": "ErrInvalidOrder", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrInvalidProposal", + "inputs": [ + { + "name": "actual", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "expected", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "type": "error", + "name": "ErrInvalidProposalNonce", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrInvalidSignatures", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrInvalidThreshold", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrInvalidVoteWeight", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrLengthMismatch", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrLooseProposalInternallyRevert", + "inputs": [ + { + "name": "callIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "revertMsg", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "type": "error", + "name": "ErrOnlySelfCall", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrOperatorNotFound", + "inputs": [ + { + "name": "operator", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ErrProposalNotApproved", + "inputs": [] + }, + { + "type": "error", + "name": "ErrQueryForEmptyVote", + "inputs": [] + }, + { + "type": "error", + "name": "ErrUnauthorized", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + }, + { + "name": "expectedRole", + "type": "uint8", + "internalType": "enum RoleAccess" + } + ] + }, + { + "type": "error", + "name": "ErrUnsupportedInterface", + "inputs": [ + { + "name": "interfaceId", + "type": "bytes4", + "internalType": "bytes4" + }, + { + "name": "addr", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ErrUnsupportedVoteType", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrVoteIsFinalized", + "inputs": [] + }, + { + "type": "error", + "name": "ErrZeroAddress", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrZeroCodeContract", + "inputs": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + } + ] + } + ], + "address": "0x64D21e91c2Cb367D2972E0bC377CFEa4e55F3685", + "args": "0x", + "ast": "", + "blockNumber": 26511796, + "bytecode": "0x60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b615f2b80620000f46000396000f3fe608060405234801561001057600080fd5b506004361061020f5760003560e01c806301a5f43f1461021457806306aba0e1146102295780630a44fa43146102445780630f7c31891461025757806315702f051461026c5780631c905e391461027f5780631f425338146102a15780632c5e6520146102b45780632d6d7d73146102d757806334d5f37b146102ea57806335da81211461030a5780633644e5151461031d5780636a61b16c146103265780637de5dedd146103395780637f7fe05814610341578063800eaab314610361578063828fc1a114610374578063865e6fd31461038757806386ccbf121461039a578063901979d5146103ad57806390264e59146103d85780639570abab146103eb57806397d6ae16146103fe5780639a7d3382146104115780639b19dbfd14610424578063a54f8a091461042c578063a64a83801461043f578063aee1767f14610452578063b384abef14610465578063b405aaf2146104c0578063b5d6e110146104d3578063b9c36209146104e6578063bc4e068f146104f9578063bc96180b1461050c578063bc9e0a5514610514578063c441c4a814610527578063cc7e6b3b1461053e578063d0a50db01461055e578063d78392f814610566578063dafae40814610579578063dd1f89141461058c578063de981f1b1461059f578063e75235b8146105b2578063e9c03498146105c8578063f80b5352146105db575b600080fd5b61022761022236600461497a565b6105e3565b005b610231610692565b6040519081526020015b60405180910390f35b610231610252366004614a13565b6106a1565b61025f610726565b60405161023b9190614aa6565b61022761027a366004614ad0565b610738565b61029261028d366004614bbe565b610842565b60405161023b93929190614c0a565b6102276102af366004614a13565b61085e565b6102c76102c2366004614cbd565b6108fd565b604051901515815260200161023b565b61025f6102e5366004614a13565b61090a565b6102316102f8366004614cf2565b60026020526000908152604090205481565b610227610318366004614a13565b610951565b61023160015481565b610227610334366004614d1e565b610999565b6102316109ae565b61035461034f366004614d52565b610a04565b60405161023b9190614d6d565b61022761036f366004614f18565b610a80565b6102c7610382366004614f7b565b610ab8565b610227610395366004614fb6565b610ac6565b6102276103a8366004615024565b610ae1565b6103c06103bb366004614d52565b610aee565b6040516001600160601b03909116815260200161023b565b6102276103e63660046150ca565b610b24565b6102276103f9366004615105565b610b43565b61022761040c366004615024565b610bda565b61022761041f366004614bbe565b610bf1565b61025f610c3e565b61022761043a3660046151f4565b610ca9565b61022761044d366004614cf2565b610cc5565b610354610460366004614d52565b610cd6565b6104af610473366004614bbe565b600360208181526000938452604080852090915291835291208054600182015460028301549383015460069093015460ff909216939092909185565b60405161023b959493929190615238565b6102c76104ce366004614d52565b610ce8565b6102276104e13660046150ca565b610d20565b6102276104f4366004614bbe565b610d2d565b610292610507366004614cf2565b610d3f565b600454610231565b61022761052236600461526d565b610d5c565b61052f610dbb565b60405161023b939291906152db565b61055161054c366004614a13565b610e95565b60405161023b9190615314565b610231610ed3565b6103c0610574366004614d52565b610ee6565b6102c7610587366004614cf2565b610ef1565b61022761059a366004615327565b610f2d565b6103546105ad366004615419565b61103a565b6105ba61109c565b60405161023b929190615434565b6102276105d6366004614a13565b6110be565b61025f611107565b6105eb61116a565b61068986868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808a02828101820190935289825290935089925088918291850190849080828437600092019190915250506040805160208089028281018201909352888252909350889250879182918501908490808284376000920191909152506111c692505050565b50505050505050565b600061069c611528565b905090565b60008282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506106e2925083915061153b9050565b61071e84848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061157092505050565b949350505050565b606061069c6107336115f5565b611619565b6107413361162d565b6108346040518061010001604052806107598e61166f565b81526020018d81526020018c81526020018b6001600160a01b031681526020018a8a808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050908252506040805160208a810282810182019093528a82529283019290918b918b9182918501908490808284376000920191909152505050908252506020016107f4868861550d565b815260200184848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050509152503361171f565b505050505050505050505050565b6060806060610851858561181e565b9250925092509250925092565b61086661116a565b8181808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506108a5925083915061153b9050565b60006108af6115f5565b905060005b838110156108f6576108ed8585838181106108d1576108d161551a565b90506020020160208101906108e69190614d52565b8390611bf5565b506001016108b4565b5050505050565b600061071e848484611c0a565b606061094883838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250611c2d915050565b90505b92915050565b61095961116a565b610995828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611d8092505050565b5050565b6109ab6109a5826155af565b33611e33565b50565b6000806109b9611eff565b90506000806109c661109c565b91509150806001828560040154856109de91906156ab565b6109e891906156c2565b6109f291906156d5565b6109fc91906156e8565b935050505090565b6000806000610a1a610a14611eff565b85611f23565b9150915081610a47578360405163141e2e1f60e11b8152600401610a3e9190614d6d565b60405180910390fd5b610a4f611eff565b6001018181548110610a6357610a6361551a565b6000918252602090912001546001600160a01b0316949350505050565b333014610aae576000356001600160e01b0319166040516307337e1960e41b8152600401610a3e919061570a565b6109958282611f88565b600061094860008484611c0a565b610ace61116a565b610ad781612031565b610995828261205e565b6108f685858585856120e9565b600080610af9611eff565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b031690565b610b2d3361162d565b610b3b858585858533612182565b505050505050565b610b4c3361162d565b610bce8a89898c8a8a80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610b9392508b91508c905061550d565b8888808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152503392506121c1915050565b50505050505050505050565b610be33361162d565b6108f685858585853361231b565b600082815260036020908152604080832084845290915281206001810154909103610c2f5760405163713b099760e11b815260040160405180910390fd5b610c388161233a565b50505050565b6060610c48611eff565b600101805480602002602001604051908101604052809291908181526020018280548015610c9f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610c81575b5050505050905090565b610cb23361162d565b61099533610cbf846155af565b8361254f565b610ccd61116a565b6109ab8161264f565b6000610ce1826126bc565b5092915050565b600080610cf3611eff565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b0316151590565b6108f68585858585612733565b610d3561116a565b61099582826127e9565b6060806060610d4f60008561181e565b9250925092509193909250565b6109ab6109a5610dac610d72606085018561571f565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525060019250611c2d915050565b610db584615768565b9061289b565b60608060606000610dca611eff565b805460408051602080840282018101909252828152929350839190830182828015610e1e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610e00575b5050505050935080600101805480602002602001604051908101604052809291908181526020018280548015610e7d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610e5f575b50505050509250610e8d846129a1565b915050909192565b60606109488383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506129a192505050565b6000610edd611eff565b60010154919050565b600061094b82612a86565b600080610efc612abb565b9050610f06611528565b8160010154610f1591906156ab565b6002820154610f2490856156ab565b10159392505050565b610f363361162d565b6000604051806101000160405280610f4d4661166f565b81526020014681526020018d81526020018c6001600160a01b031681526020018b8b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050908252506040805160208b810282810182019093528b82529283019290918c918c918291850190849080828437600092019190915250505090825250602001610fe8878961550d565b81526020018585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050915250905061102e813361171f565b5061083433828461254f565b6000611044612adf565b600083600f81111561105857611058614be0565b60ff1681526020810191909152604001600020546001600160a01b0316905080611097578160405163409140df60e11b8152600401610a3e9190615843565b919050565b60008060006110a9612abb565b90508060010154816002015492509250509091565b6110c661116a565b611102828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612b0392505050565b505050565b6060611111611eff565b805460408051602080840282018101909252828152929190830182828015610c9f576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610c81575050505050905090565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031633146111c4576000356001600160e01b0319166001604051620f948f60ea1b8152600401610a3e92919061585d565b565b60606111d28383612ee9565b6111db8161153b565b60006111e5611eff565b8451875191925090811480156111fb5750855181145b611226576000356001600160e01b0319166040516306b5667560e21b8152600401610a3e919061570a565b806001600160401b0381111561123e5761123e614d81565b604051908082528060200260200182016040528015611267578160200160208202803683370190505b50935080600003611279575050611520565b60008060008060005b8581101561148c578a818151811061129c5761129c61551a565b602002602001015194508981815181106112b8576112b861551a565b602002602001015193508b81815181106112d4576112d461551a565b602002602001015192506112e785612ff3565b6112f084612ff3565b826001600160601b0316600003611328576000356001600160e01b031916604051637f11b8a360e11b8152600401610a3e919061570a565b6001600160a01b03808616600081815260038a01602090815260408083205494891683528083205460028d0190925280832054938352909120546001600160601b03938416939182169261138092908116911661588b565b61138a919061588b565b611394919061588b565b6001600160601b03166000148982815181106113b2576113b261551a565b6020026020010190151590811515815250508881815181106113d6576113d661551a565b602002602001015115611484578654600181810189556000898152602080822090930180546001600160a01b03808b166001600160a01b0319928316811790935591835260028c018552604080842080546001600160601b038b166001600160601b03199182168117909255868f018054978801815586528786209096018054948c1694909316841790925591835260038c01909452902080549091168217905561148190836156c2565b91505b600101611282565b50808660040160008282546114a191906156c2565b90915550506040516114dc906347c28ec560e11b906114c8908c908f908d906020016158de565b604051602081830303815290604052613028565b7f897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b78888c8c8c6040516115119493929190615917565b60405180910390a15050505050505b509392505050565b6000611532611eff565b60040154905090565b61154481613055565b156109ab576000356001600160e01b031916604051630d697db160e11b8152600401610a3e919061570a565b60008161157c8161153b565b6000611586611eff565b905060005b84518110156115ed578160020160008683815181106115ac576115ac61551a565b6020908102919091018101516001600160a01b03168252810191909152604001600020546115e3906001600160601b0316856156c2565b935060010161158b565b505050919050565b7f5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd97624090565b60606000611626836130f4565b9392505050565b61163681612a86565b6001600160601b03166000036109ab576000356001600160e01b0319166003604051620f948f60ea1b8152600401610a3e92919061585d565b6000818152600260205260408120549081900361169e5750600090815260026020526040902060019081905590565b60008281526003602090815260408083208484529091528120906116c18261233a565b905080611718576000825460ff1660048111156116e0576116e0614be0565b036116fe5760405163757a436360e01b815260040160405180910390fd5b600084815260026020526040902080546001019081905592505b5050919050565b602082015160009080820361175a576000356001600160e01b03191660004660405163092048d160e11b8152600401610a3e93929190615964565b600454611768908590613150565b6000611773856131f1565b905061177e8261166f565b600083815260036020908152604080832084845290915290819020908701519194506117ab91839061333b565b845183146117da576000356001600160e01b03191660405163d4cec26960e01b8152600401610a3e919061570a565b8083837fd1221ffb98610024a29755d7db3c71692310f43a7cfcce7ee488a8c7e9e0bfa4888860405161180e929190615aff565b60405180910390a4505092915050565b6000828152600360209081526040808320848452909152812060048101546005820154606093849384939092909161185682846156c2565b9050806001600160401b0381111561187057611870614d81565b604051908082528060200260200182016040528015611899578160200160208202803683370190505b509550806001600160401b038111156118b4576118b4614d81565b6040519080825280602002602001820160405280156118ed57816020015b6118da614896565b8152602001906001900390816118d25790505b509450806001600160401b0381111561190857611908614d81565b604051908082528060200260200182016040528015611931578160200160208202803683370190505b50965060005b83811015611a865760008782815181106119535761195361551a565b6020026020010190600181111561196c5761196c614be0565b9081600181111561197f5761197f614be0565b90525060008a81526003602090815260408083208c8452909152812060048701805460079092019291849081106119b8576119b861551a565b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815460ff16815260018201549381019390935260020154908201528651879083908110611a1657611a1661551a565b6020026020010181905250846004018181548110611a3657611a3661551a565b9060005260206000200160009054906101000a90046001600160a01b0316888281518110611a6657611a6661551a565b6001600160a01b0390921660209283029190910190910152600101611937565b5060005b82811015611be957600187611a9f86846156c2565b81518110611aaf57611aaf61551a565b60200260200101906001811115611ac857611ac8614be0565b90816001811115611adb57611adb614be0565b90525060008a81526003602090815260408083208c845290915281206005870180546007909201929184908110611b1457611b1461551a565b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815460ff168152600182015493810193909352600201549082015286611b6986846156c2565b81518110611b7957611b7961551a565b6020026020010181905250846005018181548110611b9957611b9961551a565b6000918252602090912001546001600160a01b031688611bb986846156c2565b81518110611bc957611bc961551a565b6001600160a01b0390921660209283029190910190910152600101611a8a565b50505050509250925092565b6000610948836001600160a01b03841661334b565b6000838152600360209081526040808320858452909152812061071e908361343e565b606082516001600160401b03811115611c4857611c48614d81565b604051908082528060200260200182016040528015611c71578160200160208202803683370190505b50905060005b8351811015610ce15760056000858381518110611c9657611c9661551a565b60200260200101516005811115611caf57611caf614be0565b6005811115611cc057611cc0614be0565b815260200190815260200160002060009054906101000a90046001600160a01b0316828281518110611cf457611cf461551a565b60200260200101906001600160a01b031690816001600160a01b031681525050828015611d4c575060006001600160a01b0316828281518110611d3957611d3961551a565b60200260200101516001600160a01b0316145b15611d78576000356001600160e01b03191660405163053265f160e01b8152600401610a3e919061570a565b600101611c77565b80611d8a8161153b565b6000611d946115f5565b905060008060005b8551811015610b3b57858181518110611db757611db761551a565b60200260200101519250611dca83612031565b611ddb836312c0151560e21b613460565b611de584846135f3565b604080516001600160a01b038616815282151560208201529193507fb85c58eeff9fe423669ae0841666f4c8499e8731b8275eb462e4fa1720ec420e910160405180910390a1600101611d9c565b6000611e3e836131f1565b602080850151600090815260038252604080822087518352909252206001810154919250908214611e89576001810154604051632bee7fdb60e21b8152610a3e918491600401615434565b6001815460ff166004811115611ea157611ea1614be0565b14611ebf57604051632c2f3bdf60e01b815260040160405180910390fd5b83606001516001600160a01b0316836001600160a01b031614611ef55760405163e61090ab60e01b815260040160405180910390fd5b610c388185613608565b7fc648703095712c0419b6431ae642c061f0a105ac2d7c3d9604061ef4ebc3830090565b60008060005b8454811015611f7657848181548110611f4457611f4461551a565b6000918252602090912001546001600160a01b0390811690851603611f6e57600192509050611f81565b600101611f29565b506000600019915091505b9250929050565b60005b825181101561110257306001600160a01b0316828281518110611fb057611fb061551a565b60200260200101516001600160a01b031603611fed576000356001600160e01b03191660405163053265f160e01b8152600401610a3e919061570a565b6120298382815181106120025761200261551a565b602002602001015183838151811061201c5761201c61551a565b6020026020010151613675565b600101611f8b565b806001600160a01b03163b6000036109ab5780604051630bfc64a360e21b8152600401610a3e9190614d6d565b80612067612adf565b600084600f81111561207b5761207b614be0565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f8111156120bc576120bc614be0565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b60006120fc6120f7876155af565b6131f1565b60208088013560009081526003825260408082208a3583529092522060010154909150811461216157602080870135600090815260038252604080822089358352909252819020600101549051632bee7fdb60e21b8152610a3e918391600401615434565b610b3b61216d876155af565b8686868661217d6120f78d6155af565b613708565b61218a6148b6565b61219c61219688615768565b836139d1565b90506121b7818787878761217d6121b28e615768565b613abe565b9695505050505050565b60006121cd600061166f565b905060006040518060e001604052808381526020018b8152602001886001600160a01b031681526020018a8a80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093855250505060208083018a905260408084018a9052606090930188905282518c820281810183019094528c8152939450909261228d92612286928e918e9182919085019084908082843760009201919091525060019250611c2d915050565b839061289b565b90506122a46004548261315090919063ffffffff16565b60006122af826131f1565b6000858152600080516020615ed6833981519152602052604090209091506122d890828e61333b565b8084600080516020615eb6833981519152846122f387613abe565b878a6040516123059493929190615b6a565b60405180910390a3505050505050505050505050565b61232d612327876155af565b8261171f565b50610b3b61216d876155af565b600080825460ff16600481111561235357612353614be0565b148015612364575042826006015411155b905080156110975760018201546040517f58f98006a7f2f253f8ae8f8b7cec9008ca05359633561cd7c22f3005682d4a5590600090a260005b6004830154811015612450578260080160008460040183815481106123c4576123c461551a565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff19169055600484018054600786019291908490811061240d5761240d61551a565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff1916815560018181018390556002909101919091550161239d565b5060005b60058301548110156125075782600801600084600501838154811061247b5761247b61551a565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff1916905560058401805460078601929190849081106124c4576124c461551a565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff19168155600181810183905560029091019190915501612454565b50815460ff191682556000600183018190556002830181905560038301819055612535906004840190614904565b612543600583016000614904565b60006006830155919050565b4682602001511461258857602082015160405163092048d160e11b8152610a3e916001600160e01b031960003516914690600401615964565b6000612593836131f1565b602080850151600090815260038252604080822087518352909252206001015490915081146125f857602080840151600090815260038252604080822086518352909252819020600101549051632bee7fdb60e21b8152610a3e918391600401615434565b6000612602613bfd565b905060008161260f613c07565b61261991906156d5565b6126249060016156c2565b905061262e614896565b612645868685858b866126408e613c11565b613c2b565b5050505050505050565b6003811015612671576040516305f4dee960e31b815260040160405180910390fd5b600061267b611eff565b600581018390556040518381529091507f22d5bb5059ffe2949a098666fc198587200c8118483074120d3ca7050c7753f19060200160405180910390a15050565b6000806000806126d66126cd611eff565b60010186611f23565b91509150816126fa57846040516326527e1760e01b8152600401610a3e9190614d6d565b612702611eff565b8054829081106127145761271461551a565b6000918252602090912001546001600160a01b03169590945092505050565b6000612751612748610d72606089018961571f565b610db588615768565b9050600061275e826131f1565b60008080526003602090815284518252600080516020615ed68339815191529052604090206001015490915081146127d55760008080526003602090815283518252600080516020615ed68339815191529052604090819020600101549051632bee7fdb60e21b8152610a3e918391600401615434565b610689828787878761217d6121b28e615768565b808211806127f8575060018111155b15612824576000356001600160e01b0319166040516387f6f09560e01b8152600401610a3e919061570a565b600061282e612abb565b600181018054600283018054928790558590558254929350918490869085600061285783615c23565b919050557f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8858560405161288c929190615434565b60405180910390a45050505050565b6128a36148b6565b8251815260006020808301919091528301516040808301919091528301516001600160a01b0316606080830191909152830151516001600160401b038111156128ee576128ee614d81565b604051908082528060200260200182016040528015612917578160200160208202803683370190505b5060808083019190915283015160a08083019190915283015160c08083019190915283015160e082015260005b836060015151811015610ce1578281815181106129635761296361551a565b6020026020010151826080015182815181106129815761298161551a565b6001600160a01b0390921660209283029190910190910152600101612944565b606060006129ad611eff565b905082516001600160401b038111156129c8576129c8614d81565b6040519080825280602002602001820160405280156129f1578160200160208202803683370190505b50915060005b835181101561171857816002016000858381518110612a1857612a1861551a565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160601b0316838281518110612a6657612a6661551a565b6001600160601b03909216602092830291909101909101526001016129f7565b6000612a90611eff565b6001600160a01b0390921660009081526002929092016020525060409020546001600160601b031690565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f0090565b7fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb90565b606081612b0f8161153b565b6000612b19611eff565b8451909150806001600160401b03811115612b3657612b36614d81565b604051908082528060200260200182016040528015612b5f578160200160208202803683370190505b50935080600003612b71575050612ee3565b60058201548254612b839083906156d5565b1015612ba25760405163b2e765cb60e01b815260040160405180910390fd5b60008060008060005b85811015612e6957898181518110612bc557612bc561551a565b60200260200101519350612bd8846126bc565b9095509150612be685612ff3565b612bef84612ff3565b6001600160a01b03851660009081526002880160205260409020546001600160601b031615801590612c4357506001600160a01b03841660009081526003880160205260409020546001600160601b031615155b898281518110612c5557612c5561551a565b602002602001019015159081151581525050888181518110612c7957612c7961551a565b602002602001015115612e61576001600160a01b038516600090815260028801602052604081205488546001600160601b039091169190612cbc906001906156d5565b9050886000018181548110612cd357612cd361551a565b60009182526020909120015489546001600160a01b03909116908a9086908110612cff57612cff61551a565b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790558854899080612d3957612d39615c3c565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038916825260028b0190526040902080546001600160601b031916905560018901805482908110612d9957612d9961551a565b60009182526020909120015460018a0180546001600160a01b039092169186908110612dc757612dc761551a565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555088600101805480612e0857612e08615c3c565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038816825260038b0190526040902080546001600160601b0319169055612e5c82866156c2565b945050505b600101612bab565b5081866004016000828254612e7e91906156d5565b9091555050604051612ea390636242a4ef60e11b906114c8908c908c90602001615c52565b7fdf3dcd7987202f64648f3acdbf12401e3a2bb23e77e19f99826b5475cbb86369888a604051612ed4929190615c77565b60405180910390a15050505050505b50919050565b81518151606091908082016001600160401b03811115612f0b57612f0b614d81565b604051908082528060200260200182016040528015612f34578160200160208202803683370190505b50925060005b82811015612f8e57858181518110612f5457612f5461551a565b6020026020010151848281518110612f6e57612f6e61551a565b6001600160a01b0390921660209283029190910190910152600101612f3a565b60005b82811015612fe957858181518110612fab57612fab61551a565b6020026020010151858381518110612fc557612fc561551a565b6001600160a01b039092166020928302919091019091015260019182019101612f91565b5050505092915050565b6001600160a01b0381166109ab576000356001600160e01b03191660405163104c66df60e31b8152600401610a3e919061570a565b6130328282613f6b565b610995573382826040516319b5fdcb60e31b8152600401610a3e93929190615c9c565b6000815160000361306857506000919050565b60005b60018351038110156130eb57600181015b83518110156130e2578381815181106130975761309761551a565b60200260200101516001600160a01b03168483815181106130ba576130ba61551a565b60200260200101516001600160a01b0316036130da575060019392505050565b60010161307c565b5060010161306b565b50600092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561314457602002820191906000526020600020905b815481526020019060010190808311613130575b50505050509050919050565b600082608001515111801561316e57508160a0015151826080015151145b801561318357508160c0015151826080015151145b801561319857508160e0015151826080015151145b6131c3576000356001600160e01b0319166040516306b5667560e21b8152600401610a3e919061570a565b6131cd81426156c2565b826040015111156109955760405163ad89be9d60e01b815260040160405180910390fd5b60a0810151608082015160c083015151600092919083906001600160401b0381111561321f5761321f614d81565b604051908082528060200260200182016040528015613248578160200160208202803683370190505b5060e086015190915060005b82518110156132a7578660c0015181815181106132735761327361551a565b6020026020010151805190602001208382815181106132945761329461551a565b6020908102919091010152600101613254565b50604080517f1b59eeec7c321899dc1e7a5b3d876c9a445dffc6d2f96ba842d7489908fdee1281528751602080830191909152808901518284015291880151606080830191909152909701516080880152835181029381019390932060a0870152835183029383019390932060c0860152805182029082012060e08501528151810291012061010083015250610120902090565b6001830191909155600690910155565b6000818152600183016020526040812054801561343457600061336f6001836156d5565b8554909150600090613383906001906156d5565b90508181146133e85760008660000182815481106133a3576133a361551a565b90600052602060002001549050808760000184815481106133c6576133c661551a565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806133f9576133f9615c3c565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061094b565b600091505061094b565b6001600160a01b03166000908152600891909101602052604090205460ff1690565b600081604051602401613473919061570a565b60408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b1790525190915060009081906001600160a01b038616906134bc908590615cd0565b600060405180830381855afa9150503d80600081146134f7576040519150601f19603f3d011682016040523d82523d6000602084013e6134fc565b606091505b5091509150816135be57846001600160a01b0316836040516024016135219190615cec565b60408051601f198184030181529181526020820180516001600160e01b03166325da93a560e11b179052516135569190615cd0565b600060405180830381855afa9150503d8060008114613591576040519150601f19603f3d011682016040523d82523d6000602084013e613596565b606091505b509092509050816135be57838560405163069d427960e11b8152600401610a3e929190615cff565b808060200190518101906135d29190615d22565b6108f657838560405163069d427960e11b8152600401610a3e929190615cff565b6000610948836001600160a01b038416614291565b613611816142e0565b1561099557815460ff1916600217825560008061362d836142fa565b9150915083600101547fe134987599ae266ec90edeff1b26125b287dbb57b10822649432d1bb26537fba8383604051613667929190615d44565b60405180910390a250505050565b806005600084600581111561368c5761368c614be0565b600581111561369d5761369d614be0565b8152602081019190915260400160002080546001600160a01b0319166001600160a01b0392831617905581168260058111156136db576136db614be0565b6040517f356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d90600090a35050565b831580159061371657508382145b613741576000356001600160e01b0319166040516306b5667560e21b8152600401610a3e919061570a565b600061379a61374f60015490565b61375a8460006145a1565b60405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b905060006137b56137aa60015490565b61375a8560016145a1565b905060006137c1613bfd565b90506000816137ce613c07565b6137d891906156d5565b6137e39060016156c2565b90506000805b87811015610834573660008a8a848181106138065761380661551a565b606002919091019250600090508d8d858181106138255761382561551a565b905060200201602081019061383a9190615d69565b600181111561384b5761384b614be0565b0361387757613870886138616020850185615d95565b846020013585604001356145da565b90506138ee565b60018d8d8581811061388b5761388b61551a565b90506020020160208101906138a09190615d69565b60018111156138b1576138b1614be0565b036138c757613870876138616020850185615d95565b6000356001600160e01b031916604051630612418f60e11b8152600401610a3e919061570a565b806001600160a01b0316846001600160a01b03161061392e576000356001600160e01b031916604051635d3dcd3160e01b8152600401610a3e919061570a565b809350600061393c82613c11565b90508060000361396d576000356001600160e01b03191660405163726b3acb60e01b8152600401610a3e919061570a565b6139b08f8f8f878181106139835761398361551a565b90506020020160208101906139989190615d69565b8989866139aa368a90038a018a615db0565b87613c2b565b156139c357505050505050505050610b3b565b8360010193505050506137e9565b6139d96148b6565b6139f26139eb84606001516001611c2d565b849061289b565b9050613a096004548261315090919063ffffffff16565b6000613a14826131f1565b90506000613a22600061166f565b6000818152600080516020615ed68339815191526020908152604090912090870151919250613a5291849061333b565b82518114613a81576000356001600160e01b03191660405163d4cec26960e01b8152600401610a3e919061570a565b8181600080516020615eb683398151915285613a9c89613abe565b8989604051613aae9493929190615b6a565b60405180910390a3505092915050565b6080810151606082015160a083015151600092919083906001600160401b03811115613aec57613aec614d81565b604051908082528060200260200182016040528015613b15578160200160208202803683370190505b5060c086015190915060005b8251811015613b74578660a001518181518110613b4057613b4061551a565b602002602001015180519060200120838281518110613b6157613b6161551a565b6020908102919091010152600101613b21565b50604080517fde480f0c53a3651c08fbab1dffbc45fe574f31188827fe52cb9035da9fe57e4a8152875160208083019190915280890151828401529790910151606082015283518702938701939093206080840152835186029386019390932060a0830152805185029085012060c082015281518402919093012060e083015250610100902090565b600061069c6109ae565b600061069c610692565b6000613c1c82612a86565b6001600160601b031692915050565b60208088015188516000828152600384526040808220838352909452928320613c538161233a565b15613c645760019350505050613f60565b6020808c01516000908152600290915260409020548214613ca6576000356001600160e01b03191660405163d4cec26960e01b8152600401610a3e919061570a565b6000815460ff166004811115613cbe57613cbe614be0565b14613cdc576040516322de95ff60e21b815260040160405180910390fd5b613ce6818861343e565b15613d06578660405163025fd59560e41b8152600401610a3e9190614d6d565b6001600160a01b03871660009081526008820160209081526040909120805460ff19166001179055860151151580613d415750604086015115155b80613d4f5750855160ff1615155b15613d96576001600160a01b03871660009081526007820160209081526040918290208851815460ff191660ff909116178155908801516001820155908701516002909101555b866001600160a01b031681600101547f1203f9e81c814a35f5f4cc24087b2a24c6fb7986a9f1406b68a9484882c93a238c88604051613dd6929190615e10565b60405180910390a3600080808c6001811115613df457613df4614be0565b03613e49576004830180546001810182556000918252602082200180546001600160a01b0319166001600160a01b038c16179055600384018054899290613e3c9084906156c2565b9250508190559150613eae565b60018c6001811115613e5d57613e5d614be0565b036138c7576005830180546001810182556000918252602082200180546001600160a01b0319166001600160a01b038c16179055600284018054899290613ea59084906156c2565b92505081905590505b8a8210613f1457825460ff19166001908117845580840154604051919750907f5c819725ea53655a3b898f3df59b66489761935454e9212ca1e5ebd759953d0b90600090a260608d01516001600160a01b0316613f0f57613f0f838e613608565b613f5a565b898110613f5a57825460ff19166003178355600180840154604051919750907f55295d4ce992922fa2e5ffbf3a3dcdb367de0a15e125ace083456017fd22060f90600090a25b50505050505b979650505050505050565b60016000613f7a6107336115f5565b80519091506000819003613f8f57505061094b565b6000816001600160401b03811115613fa957613fa9614d81565b604051908082528060200260200182016040528015613fd2578160200160208202803683370190505b5090506000826001600160401b03811115613fef57613fef614d81565b60405190808252806020026020018201604052801561402257816020015b606081526020019060019003908161400d5790505b5090506000878760405160200161403a929190615e1e565b604051602081830303815290604052905060008160405160240161405e9190615cec565b60408051601f198184030181529190526020810180516001600160e01b03166325da93a560e11b179052905060005b85811015614247578681815181106140a7576140a761551a565b60200260200101516001600160a01b0316836040516140c69190615cd0565b6000604051808303816000865af19150503d8060008114614103576040519150601f19603f3d011682016040523d82523d6000602084013e614108565b606091505b5086838151811061411b5761411b61551a565b602002602001018684815181106141345761413461551a565b602002602001018290528215151515815250505084818151811061415a5761415a61551a565b602002602001015161423f578681815181106141785761417861551a565b60200260200101516001600160a01b0316826040516141979190615cd0565b6000604051808303816000865af19150503d80600081146141d4576040519150601f19603f3d011682016040523d82523d6000602084013e6141d9565b606091505b508683815181106141ec576141ec61551a565b602002602001018684815181106142055761420561551a565b602002602001018290528215151515815250505087801561423c57508481815181106142335761423361551a565b60200260200101515b97505b60010161408d565b507fc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b638287868660405161427d9493929190615e4f565b60405180910390a150505050505092915050565b60008181526001830160205260408120546142d85750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561094b565b50600061094b565b600081602001516000148061094b57505060200151461490565b606080614306836142e0565b61433857602083015160405163092048d160e11b8152610a3e916001600160e01b031960003516914690600401615964565b8260800151516001600160401b0381111561435557614355614d81565b60405190808252806020026020018201604052801561437e578160200160208202803683370190505b5091508260800151516001600160401b0381111561439e5761439e614d81565b6040519080825280602002602001820160405280156143d157816020015b60608152602001906001900390816143bc5790505b50905060005b83608001515181101561459b578360e0015181815181106143fa576143fa61551a565b60200260200101515a1161442d57614411846131f1565b6040516307aec4ab60e21b8152600401610a3e91815260200190565b836080015181815181106144435761444361551a565b60200260200101516001600160a01b03168460a00151828151811061446a5761446a61551a565b60200260200101518560e0015183815181106144885761448861551a565b6020026020010151908660c0015184815181106144a7576144a761551a565b60200260200101516040516144bc9190615cd0565b600060405180830381858888f193505050503d80600081146144fa576040519150601f19603f3d011682016040523d82523d6000602084013e6144ff565b606091505b508483815181106145125761451261551a565b6020026020010184848151811061452b5761452b61551a565b60200260200101829052821515151581525050508281815181106145515761455161551a565b602002602001015161459357808282815181106145705761457061551a565b60200260200101516040516376df417560e11b8152600401610a3e929190615e9c565b6001016143d7565b50915091565b604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b60008060006145eb87878787614602565b915091506145f8816146e5565b5095945050505050565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b0383111561462f57506000905060036146dc565b8460ff16601b1415801561464757508460ff16601c14155b1561465857506000905060046146dc565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156146ac573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166146d5576000600192509250506146dc565b9150600090505b94509492505050565b60008160048111156146f9576146f9614be0565b036147015750565b600181600481111561471557614715614be0565b0361475d5760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b6044820152606401610a3e565b600281600481111561477157614771614be0565b036147be5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610a3e565b60038160048111156147d2576147d2614be0565b0361482a5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610a3e565b600481600481111561483e5761483e614be0565b036109ab5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610a3e565b604080516060810182526000808252602082018190529181019190915290565b60405180610100016040528060008152602001600081526020016000815260200160006001600160a01b03168152602001606081526020016060815260200160608152602001606081525090565b50805460008255906000526020600020908101906109ab91905b80821115614932576000815560010161491e565b5090565b60008083601f84011261494857600080fd5b5081356001600160401b0381111561495f57600080fd5b6020830191508360208260051b8501011115611f8157600080fd5b6000806000806000806060878903121561499357600080fd5b86356001600160401b03808211156149aa57600080fd5b6149b68a838b01614936565b909850965060208901359150808211156149cf57600080fd5b6149db8a838b01614936565b909650945060408901359150808211156149f457600080fd5b50614a0189828a01614936565b979a9699509497509295939492505050565b60008060208385031215614a2657600080fd5b82356001600160401b03811115614a3c57600080fd5b614a4885828601614936565b90969095509350505050565b6001600160a01b03169052565b60008151808452602080850194506020840160005b83811015614a9b5781516001600160a01b031687529582019590820190600101614a76565b509495945050505050565b6020815260006109486020830184614a61565b80356001600160a01b038116811461109757600080fd5b600080600080600080600080600080600060e08c8e031215614af157600080fd5b8b359a5060208c01359950614b0860408d01614ab9565b98506001600160401b0360608d0135811015614b2357600080fd5b614b338e60608f01358f01614936565b909950975060808d0135811015614b4957600080fd5b614b598e60808f01358f01614936565b909750955060a08d0135811015614b6f57600080fd5b614b7f8e60a08f01358f01614936565b909550935060c08d0135811015614b9557600080fd5b50614ba68d60c08e01358e01614936565b81935080925050509295989b509295989b9093969950565b60008060408385031215614bd157600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60028110614c0657614c06614be0565b9052565b60006060808352614c1e6060840187614a61565b83810360208581019190915286518083528782019282019060005b81811015614c5c57614c4c838651614bf6565b9383019391830191600101614c39565b50506040925085810360408701528087518083528383019150838901925060005b81811015614cad578351805160ff1684528581015186850152860151868401529284019291860191600101614c7d565b50909a9950505050505050505050565b600080600060608486031215614cd257600080fd5b8335925060208401359150614ce960408501614ab9565b90509250925092565b600060208284031215614d0457600080fd5b5035919050565b60006101008284031215612ee357600080fd5b600060208284031215614d3057600080fd5b81356001600160401b03811115614d4657600080fd5b61071e84828501614d0b565b600060208284031215614d6457600080fd5b61094882614ab9565b6001600160a01b0391909116815260200190565b634e487b7160e01b600052604160045260246000fd5b60405161010081016001600160401b0381118282101715614dba57614dba614d81565b60405290565b60405160e081016001600160401b0381118282101715614dba57614dba614d81565b604051601f8201601f191681016001600160401b0381118282101715614e0a57614e0a614d81565b604052919050565b60006001600160401b03821115614e2b57614e2b614d81565b5060051b60200190565b600082601f830112614e4657600080fd5b81356020614e5b614e5683614e12565b614de2565b8083825260208201915060208460051b870101935086841115614e7d57600080fd5b602086015b84811015614ea757803560068110614e9a5760008081fd5b8352918301918301614e82565b509695505050505050565b600082601f830112614ec357600080fd5b81356020614ed3614e5683614e12565b8083825260208201915060208460051b870101935086841115614ef557600080fd5b602086015b84811015614ea757614f0b81614ab9565b8352918301918301614efa565b60008060408385031215614f2b57600080fd5b82356001600160401b0380821115614f4257600080fd5b614f4e86838701614e35565b93506020850135915080821115614f6457600080fd5b50614f7185828601614eb2565b9150509250929050565b60008060408385031215614f8e57600080fd5b82359150614f9e60208401614ab9565b90509250929050565b80356010811061109757600080fd5b60008060408385031215614fc957600080fd5b614fd283614fa7565b9150614f9e60208401614ab9565b60008083601f840112614ff257600080fd5b5081356001600160401b0381111561500957600080fd5b602083019150836020606083028501011115611f8157600080fd5b60008060008060006060868803121561503c57600080fd5b85356001600160401b038082111561505357600080fd5b61505f89838a01614d0b565b9650602088013591508082111561507557600080fd5b61508189838a01614936565b9096509450604088013591508082111561509a57600080fd5b506150a788828901614fe0565b969995985093965092949392505050565b600060e08284031215612ee357600080fd5b6000806000806000606086880312156150e257600080fd5b85356001600160401b03808211156150f957600080fd5b61505f89838a016150b8565b60008060008060008060008060008060c08b8d03121561512457600080fd5b8a35995061513460208c01614ab9565b985060408b01356001600160401b038082111561515057600080fd5b61515c8e838f01614936565b909a50985060608d013591508082111561517557600080fd5b6151818e838f01614936565b909850965060808d013591508082111561519a57600080fd5b6151a68e838f01614936565b909650945060a08d01359150808211156151bf57600080fd5b506151cc8d828e01614936565b915080935050809150509295989b9194979a5092959850565b80356002811061109757600080fd5b6000806040838503121561520757600080fd5b82356001600160401b0381111561521d57600080fd5b61522985828601614d0b565b925050614f9e602084016151e5565b60a081016005871061524c5761524c614be0565b95815260208101949094526040840192909252606083015260809091015290565b60006020828403121561527f57600080fd5b81356001600160401b0381111561529557600080fd5b61071e848285016150b8565b60008151808452602080850194506020840160005b83811015614a9b5781516001600160601b0316875295820195908201906001016152b6565b6060815260006152ee6060830186614a61565b82810360208401526153008186614a61565b905082810360408401526121b781856152a1565b60208152600061094860208301846152a1565b600080600080600080600080600080600060e08c8e03121561534857600080fd5b8b359a5061535860208d01614ab9565b99506001600160401b0360408d013581101561537357600080fd5b6153838e60408f01358f01614936565b909a50985060608d013581101561539957600080fd5b6153a98e60608f01358f01614936565b909850965060808d01358110156153bf57600080fd5b6153cf8e60808f01358f01614936565b909650945060a08d01358110156153e557600080fd5b506153f68d60a08e01358e01614936565b909350915061540760c08d016151e5565b90509295989b509295989b9093969950565b60006020828403121561542b57600080fd5b61094882614fa7565b918252602082015260400190565b6000615450614e5684614e12565b8381529050602080820190600585901b84018681111561546f57600080fd5b845b818110156155025780356001600160401b03808211156154915760008081fd5b8188019150601f8a818401126154a75760008081fd5b8235828111156154b9576154b9614d81565b6154ca818301601f19168801614de2565b92508083528b878286010111156154e357600091508182fd5b8087850188850137600090830187015250855250928201928201615471565b505050509392505050565b6000610948368484615442565b634e487b7160e01b600052603260045260246000fd5b600082601f83011261554157600080fd5b81356020615551614e5683614e12565b8083825260208201915060208460051b87010193508684111561557357600080fd5b602086015b84811015614ea75780358352918301918301615578565b600082601f8301126155a057600080fd5b61094883833560208501615442565b600061010082360312156155c257600080fd5b6155ca614d97565b8235815260208301356020820152604083013560408201526155ee60608401614ab9565b606082015260808301356001600160401b038082111561560d57600080fd5b61561936838701614eb2565b608084015260a085013591508082111561563257600080fd5b61563e36838701615530565b60a084015260c085013591508082111561565757600080fd5b6156633683870161558f565b60c084015260e085013591508082111561567c57600080fd5b5061568936828601615530565b60e08301525092915050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761094b5761094b615695565b8082018082111561094b5761094b615695565b8181038181111561094b5761094b615695565b60008261570557634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031991909116815260200190565b6000808335601e1984360301811261573657600080fd5b8301803591506001600160401b0382111561575057600080fd5b6020019150600581901b3603821315611f8157600080fd5b600060e0823603121561577a57600080fd5b615782614dc0565b823581526020830135602082015261579c60408401614ab9565b604082015260608301356001600160401b03808211156157bb57600080fd5b6157c736838701614e35565b606084015260808501359150808211156157e057600080fd5b6157ec36838701615530565b608084015260a085013591508082111561580557600080fd5b6158113683870161558f565b60a084015260c085013591508082111561582a57600080fd5b5061583736828601615530565b60c08301525092915050565b602081016010831061585757615857614be0565b91905290565b6001600160e01b03198316815260408101600b831061587e5761587e614be0565b8260208301529392505050565b6001600160601b03818116838216019080821115610ce157610ce1615695565b60008151808452602080850194506020840160005b83811015614a9b5781511515875295820195908201906001016158c0565b6060815260006158f16060830186614a61565b828103602084015261590381866152a1565b905082810360408401526121b781856158ab565b60808152600061592a60808301876158ab565b828103602084015261593c81876152a1565b905082810360408401526159508186614a61565b90508281036060840152613f608185614a61565b6001600160e01b03199390931683526020830191909152604082015260600190565b60008151808452602080850194506020840160005b83811015614a9b5781518752958201959082019060010161599b565b60005b838110156159d25781810151838201526020016159ba565b50506000910152565b600081518084526159f38160208601602086016159b7565b601f01601f19169290920160200192915050565b60008282518085526020808601955060208260051b8401016020860160005b84811015615a5457601f19868403018952615a428383516159db565b98840198925090830190600101615a26565b5090979650505050505050565b60006101008251845260208301516020850152604083015160408501526060830151615a906060860182614a54565b506080830151816080860152615aa882860182614a61565b91505060a083015184820360a0860152615ac28282615986565b91505060c083015184820360c0860152615adc8282615a07565b91505060e083015184820360e0860152615af68282615986565b95945050505050565b604081526000615b126040830185615a61565b905060018060a01b03831660208301529392505050565b60008151808452602080850194506020840160005b83811015614a9b57815160068110615b5857615b58614be0565b87529582019590820190600101615b3e565b608081526000615b7d6080830187615a61565b8560208401528281036040840152845181526020850151602082015260018060a01b036040860151166040820152606085015160e06060830152615bc460e0830182615b29565b905060808601518282036080840152615bdd8282615986565b91505060a086015182820360a0840152615bf78282615a07565b91505060c086015182820360c0840152615c118282615986565b9350505050615af66060830184614a54565b600060018201615c3557615c35615695565b5060010190565b634e487b7160e01b600052603160045260246000fd5b604081526000615c656040830185614a61565b8281036020840152615af681856158ab565b604081526000615c8a60408301856158ab565b8281036020840152615af68185614a61565b6001600160a01b03841681526001600160e01b031983166020820152606060408201819052600090615af6908301846159db565b60008251615ce28184602087016159b7565b9190910192915050565b60208152600061094860208301846159db565b6001600160e01b03199290921682526001600160a01b0316602082015260400190565b600060208284031215615d3457600080fd5b8151801515811461162657600080fd5b604081526000615d5760408301856158ab565b8281036020840152615af68185615a07565b600060208284031215615d7b57600080fd5b610948826151e5565b803560ff8116811461109757600080fd5b600060208284031215615da757600080fd5b61094882615d84565b600060608284031215615dc257600080fd5b604051606081016001600160401b0381118282101715615de457615de4614d81565b604052615df083615d84565b815260208301356020820152604083013560408201528091505092915050565b6040810161587e8285614bf6565b6001600160e01b0319831681528151600090615e418160048501602087016159b7565b919091016004019392505050565b608081526000615e6260808301876159db565b8281036020840152615e748187614a61565b90508281036040840152615e8881866158ab565b90508281036060840152613f608185615a07565b82815260406020820152600061071e60408301846159db56fee5af2d3fb7bcab8f865476bc675bf1bbb8b5a749c827ee1cd215dc9c2b8f92d73617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92effa2646970667358221220fbc7cf0cc42a480ef3d40d76fe731fb7fad911d9e6f97db06cb768d5fde5e16d64736f6c63430008170033", + "chainId": 2021, + "contractAbsolutePath": "RoninBridgeManager.sol", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061020f5760003560e01c806301a5f43f1461021457806306aba0e1146102295780630a44fa43146102445780630f7c31891461025757806315702f051461026c5780631c905e391461027f5780631f425338146102a15780632c5e6520146102b45780632d6d7d73146102d757806334d5f37b146102ea57806335da81211461030a5780633644e5151461031d5780636a61b16c146103265780637de5dedd146103395780637f7fe05814610341578063800eaab314610361578063828fc1a114610374578063865e6fd31461038757806386ccbf121461039a578063901979d5146103ad57806390264e59146103d85780639570abab146103eb57806397d6ae16146103fe5780639a7d3382146104115780639b19dbfd14610424578063a54f8a091461042c578063a64a83801461043f578063aee1767f14610452578063b384abef14610465578063b405aaf2146104c0578063b5d6e110146104d3578063b9c36209146104e6578063bc4e068f146104f9578063bc96180b1461050c578063bc9e0a5514610514578063c441c4a814610527578063cc7e6b3b1461053e578063d0a50db01461055e578063d78392f814610566578063dafae40814610579578063dd1f89141461058c578063de981f1b1461059f578063e75235b8146105b2578063e9c03498146105c8578063f80b5352146105db575b600080fd5b61022761022236600461497a565b6105e3565b005b610231610692565b6040519081526020015b60405180910390f35b610231610252366004614a13565b6106a1565b61025f610726565b60405161023b9190614aa6565b61022761027a366004614ad0565b610738565b61029261028d366004614bbe565b610842565b60405161023b93929190614c0a565b6102276102af366004614a13565b61085e565b6102c76102c2366004614cbd565b6108fd565b604051901515815260200161023b565b61025f6102e5366004614a13565b61090a565b6102316102f8366004614cf2565b60026020526000908152604090205481565b610227610318366004614a13565b610951565b61023160015481565b610227610334366004614d1e565b610999565b6102316109ae565b61035461034f366004614d52565b610a04565b60405161023b9190614d6d565b61022761036f366004614f18565b610a80565b6102c7610382366004614f7b565b610ab8565b610227610395366004614fb6565b610ac6565b6102276103a8366004615024565b610ae1565b6103c06103bb366004614d52565b610aee565b6040516001600160601b03909116815260200161023b565b6102276103e63660046150ca565b610b24565b6102276103f9366004615105565b610b43565b61022761040c366004615024565b610bda565b61022761041f366004614bbe565b610bf1565b61025f610c3e565b61022761043a3660046151f4565b610ca9565b61022761044d366004614cf2565b610cc5565b610354610460366004614d52565b610cd6565b6104af610473366004614bbe565b600360208181526000938452604080852090915291835291208054600182015460028301549383015460069093015460ff909216939092909185565b60405161023b959493929190615238565b6102c76104ce366004614d52565b610ce8565b6102276104e13660046150ca565b610d20565b6102276104f4366004614bbe565b610d2d565b610292610507366004614cf2565b610d3f565b600454610231565b61022761052236600461526d565b610d5c565b61052f610dbb565b60405161023b939291906152db565b61055161054c366004614a13565b610e95565b60405161023b9190615314565b610231610ed3565b6103c0610574366004614d52565b610ee6565b6102c7610587366004614cf2565b610ef1565b61022761059a366004615327565b610f2d565b6103546105ad366004615419565b61103a565b6105ba61109c565b60405161023b929190615434565b6102276105d6366004614a13565b6110be565b61025f611107565b6105eb61116a565b61068986868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808a02828101820190935289825290935089925088918291850190849080828437600092019190915250506040805160208089028281018201909352888252909350889250879182918501908490808284376000920191909152506111c692505050565b50505050505050565b600061069c611528565b905090565b60008282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506106e2925083915061153b9050565b61071e84848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061157092505050565b949350505050565b606061069c6107336115f5565b611619565b6107413361162d565b6108346040518061010001604052806107598e61166f565b81526020018d81526020018c81526020018b6001600160a01b031681526020018a8a808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050908252506040805160208a810282810182019093528a82529283019290918b918b9182918501908490808284376000920191909152505050908252506020016107f4868861550d565b815260200184848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050509152503361171f565b505050505050505050505050565b6060806060610851858561181e565b9250925092509250925092565b61086661116a565b8181808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506108a5925083915061153b9050565b60006108af6115f5565b905060005b838110156108f6576108ed8585838181106108d1576108d161551a565b90506020020160208101906108e69190614d52565b8390611bf5565b506001016108b4565b5050505050565b600061071e848484611c0a565b606061094883838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250611c2d915050565b90505b92915050565b61095961116a565b610995828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611d8092505050565b5050565b6109ab6109a5826155af565b33611e33565b50565b6000806109b9611eff565b90506000806109c661109c565b91509150806001828560040154856109de91906156ab565b6109e891906156c2565b6109f291906156d5565b6109fc91906156e8565b935050505090565b6000806000610a1a610a14611eff565b85611f23565b9150915081610a47578360405163141e2e1f60e11b8152600401610a3e9190614d6d565b60405180910390fd5b610a4f611eff565b6001018181548110610a6357610a6361551a565b6000918252602090912001546001600160a01b0316949350505050565b333014610aae576000356001600160e01b0319166040516307337e1960e41b8152600401610a3e919061570a565b6109958282611f88565b600061094860008484611c0a565b610ace61116a565b610ad781612031565b610995828261205e565b6108f685858585856120e9565b600080610af9611eff565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b031690565b610b2d3361162d565b610b3b858585858533612182565b505050505050565b610b4c3361162d565b610bce8a89898c8a8a80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610b9392508b91508c905061550d565b8888808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152503392506121c1915050565b50505050505050505050565b610be33361162d565b6108f685858585853361231b565b600082815260036020908152604080832084845290915281206001810154909103610c2f5760405163713b099760e11b815260040160405180910390fd5b610c388161233a565b50505050565b6060610c48611eff565b600101805480602002602001604051908101604052809291908181526020018280548015610c9f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610c81575b5050505050905090565b610cb23361162d565b61099533610cbf846155af565b8361254f565b610ccd61116a565b6109ab8161264f565b6000610ce1826126bc565b5092915050565b600080610cf3611eff565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b0316151590565b6108f68585858585612733565b610d3561116a565b61099582826127e9565b6060806060610d4f60008561181e565b9250925092509193909250565b6109ab6109a5610dac610d72606085018561571f565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525060019250611c2d915050565b610db584615768565b9061289b565b60608060606000610dca611eff565b805460408051602080840282018101909252828152929350839190830182828015610e1e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610e00575b5050505050935080600101805480602002602001604051908101604052809291908181526020018280548015610e7d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610e5f575b50505050509250610e8d846129a1565b915050909192565b60606109488383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506129a192505050565b6000610edd611eff565b60010154919050565b600061094b82612a86565b600080610efc612abb565b9050610f06611528565b8160010154610f1591906156ab565b6002820154610f2490856156ab565b10159392505050565b610f363361162d565b6000604051806101000160405280610f4d4661166f565b81526020014681526020018d81526020018c6001600160a01b031681526020018b8b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050908252506040805160208b810282810182019093528b82529283019290918c918c918291850190849080828437600092019190915250505090825250602001610fe8878961550d565b81526020018585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050915250905061102e813361171f565b5061083433828461254f565b6000611044612adf565b600083600f81111561105857611058614be0565b60ff1681526020810191909152604001600020546001600160a01b0316905080611097578160405163409140df60e11b8152600401610a3e9190615843565b919050565b60008060006110a9612abb565b90508060010154816002015492509250509091565b6110c661116a565b611102828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612b0392505050565b505050565b6060611111611eff565b805460408051602080840282018101909252828152929190830182828015610c9f576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610c81575050505050905090565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031633146111c4576000356001600160e01b0319166001604051620f948f60ea1b8152600401610a3e92919061585d565b565b60606111d28383612ee9565b6111db8161153b565b60006111e5611eff565b8451875191925090811480156111fb5750855181145b611226576000356001600160e01b0319166040516306b5667560e21b8152600401610a3e919061570a565b806001600160401b0381111561123e5761123e614d81565b604051908082528060200260200182016040528015611267578160200160208202803683370190505b50935080600003611279575050611520565b60008060008060005b8581101561148c578a818151811061129c5761129c61551a565b602002602001015194508981815181106112b8576112b861551a565b602002602001015193508b81815181106112d4576112d461551a565b602002602001015192506112e785612ff3565b6112f084612ff3565b826001600160601b0316600003611328576000356001600160e01b031916604051637f11b8a360e11b8152600401610a3e919061570a565b6001600160a01b03808616600081815260038a01602090815260408083205494891683528083205460028d0190925280832054938352909120546001600160601b03938416939182169261138092908116911661588b565b61138a919061588b565b611394919061588b565b6001600160601b03166000148982815181106113b2576113b261551a565b6020026020010190151590811515815250508881815181106113d6576113d661551a565b602002602001015115611484578654600181810189556000898152602080822090930180546001600160a01b03808b166001600160a01b0319928316811790935591835260028c018552604080842080546001600160601b038b166001600160601b03199182168117909255868f018054978801815586528786209096018054948c1694909316841790925591835260038c01909452902080549091168217905561148190836156c2565b91505b600101611282565b50808660040160008282546114a191906156c2565b90915550506040516114dc906347c28ec560e11b906114c8908c908f908d906020016158de565b604051602081830303815290604052613028565b7f897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b78888c8c8c6040516115119493929190615917565b60405180910390a15050505050505b509392505050565b6000611532611eff565b60040154905090565b61154481613055565b156109ab576000356001600160e01b031916604051630d697db160e11b8152600401610a3e919061570a565b60008161157c8161153b565b6000611586611eff565b905060005b84518110156115ed578160020160008683815181106115ac576115ac61551a565b6020908102919091018101516001600160a01b03168252810191909152604001600020546115e3906001600160601b0316856156c2565b935060010161158b565b505050919050565b7f5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd97624090565b60606000611626836130f4565b9392505050565b61163681612a86565b6001600160601b03166000036109ab576000356001600160e01b0319166003604051620f948f60ea1b8152600401610a3e92919061585d565b6000818152600260205260408120549081900361169e5750600090815260026020526040902060019081905590565b60008281526003602090815260408083208484529091528120906116c18261233a565b905080611718576000825460ff1660048111156116e0576116e0614be0565b036116fe5760405163757a436360e01b815260040160405180910390fd5b600084815260026020526040902080546001019081905592505b5050919050565b602082015160009080820361175a576000356001600160e01b03191660004660405163092048d160e11b8152600401610a3e93929190615964565b600454611768908590613150565b6000611773856131f1565b905061177e8261166f565b600083815260036020908152604080832084845290915290819020908701519194506117ab91839061333b565b845183146117da576000356001600160e01b03191660405163d4cec26960e01b8152600401610a3e919061570a565b8083837fd1221ffb98610024a29755d7db3c71692310f43a7cfcce7ee488a8c7e9e0bfa4888860405161180e929190615aff565b60405180910390a4505092915050565b6000828152600360209081526040808320848452909152812060048101546005820154606093849384939092909161185682846156c2565b9050806001600160401b0381111561187057611870614d81565b604051908082528060200260200182016040528015611899578160200160208202803683370190505b509550806001600160401b038111156118b4576118b4614d81565b6040519080825280602002602001820160405280156118ed57816020015b6118da614896565b8152602001906001900390816118d25790505b509450806001600160401b0381111561190857611908614d81565b604051908082528060200260200182016040528015611931578160200160208202803683370190505b50965060005b83811015611a865760008782815181106119535761195361551a565b6020026020010190600181111561196c5761196c614be0565b9081600181111561197f5761197f614be0565b90525060008a81526003602090815260408083208c8452909152812060048701805460079092019291849081106119b8576119b861551a565b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815460ff16815260018201549381019390935260020154908201528651879083908110611a1657611a1661551a565b6020026020010181905250846004018181548110611a3657611a3661551a565b9060005260206000200160009054906101000a90046001600160a01b0316888281518110611a6657611a6661551a565b6001600160a01b0390921660209283029190910190910152600101611937565b5060005b82811015611be957600187611a9f86846156c2565b81518110611aaf57611aaf61551a565b60200260200101906001811115611ac857611ac8614be0565b90816001811115611adb57611adb614be0565b90525060008a81526003602090815260408083208c845290915281206005870180546007909201929184908110611b1457611b1461551a565b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815460ff168152600182015493810193909352600201549082015286611b6986846156c2565b81518110611b7957611b7961551a565b6020026020010181905250846005018181548110611b9957611b9961551a565b6000918252602090912001546001600160a01b031688611bb986846156c2565b81518110611bc957611bc961551a565b6001600160a01b0390921660209283029190910190910152600101611a8a565b50505050509250925092565b6000610948836001600160a01b03841661334b565b6000838152600360209081526040808320858452909152812061071e908361343e565b606082516001600160401b03811115611c4857611c48614d81565b604051908082528060200260200182016040528015611c71578160200160208202803683370190505b50905060005b8351811015610ce15760056000858381518110611c9657611c9661551a565b60200260200101516005811115611caf57611caf614be0565b6005811115611cc057611cc0614be0565b815260200190815260200160002060009054906101000a90046001600160a01b0316828281518110611cf457611cf461551a565b60200260200101906001600160a01b031690816001600160a01b031681525050828015611d4c575060006001600160a01b0316828281518110611d3957611d3961551a565b60200260200101516001600160a01b0316145b15611d78576000356001600160e01b03191660405163053265f160e01b8152600401610a3e919061570a565b600101611c77565b80611d8a8161153b565b6000611d946115f5565b905060008060005b8551811015610b3b57858181518110611db757611db761551a565b60200260200101519250611dca83612031565b611ddb836312c0151560e21b613460565b611de584846135f3565b604080516001600160a01b038616815282151560208201529193507fb85c58eeff9fe423669ae0841666f4c8499e8731b8275eb462e4fa1720ec420e910160405180910390a1600101611d9c565b6000611e3e836131f1565b602080850151600090815260038252604080822087518352909252206001810154919250908214611e89576001810154604051632bee7fdb60e21b8152610a3e918491600401615434565b6001815460ff166004811115611ea157611ea1614be0565b14611ebf57604051632c2f3bdf60e01b815260040160405180910390fd5b83606001516001600160a01b0316836001600160a01b031614611ef55760405163e61090ab60e01b815260040160405180910390fd5b610c388185613608565b7fc648703095712c0419b6431ae642c061f0a105ac2d7c3d9604061ef4ebc3830090565b60008060005b8454811015611f7657848181548110611f4457611f4461551a565b6000918252602090912001546001600160a01b0390811690851603611f6e57600192509050611f81565b600101611f29565b506000600019915091505b9250929050565b60005b825181101561110257306001600160a01b0316828281518110611fb057611fb061551a565b60200260200101516001600160a01b031603611fed576000356001600160e01b03191660405163053265f160e01b8152600401610a3e919061570a565b6120298382815181106120025761200261551a565b602002602001015183838151811061201c5761201c61551a565b6020026020010151613675565b600101611f8b565b806001600160a01b03163b6000036109ab5780604051630bfc64a360e21b8152600401610a3e9190614d6d565b80612067612adf565b600084600f81111561207b5761207b614be0565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f8111156120bc576120bc614be0565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b60006120fc6120f7876155af565b6131f1565b60208088013560009081526003825260408082208a3583529092522060010154909150811461216157602080870135600090815260038252604080822089358352909252819020600101549051632bee7fdb60e21b8152610a3e918391600401615434565b610b3b61216d876155af565b8686868661217d6120f78d6155af565b613708565b61218a6148b6565b61219c61219688615768565b836139d1565b90506121b7818787878761217d6121b28e615768565b613abe565b9695505050505050565b60006121cd600061166f565b905060006040518060e001604052808381526020018b8152602001886001600160a01b031681526020018a8a80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093855250505060208083018a905260408084018a9052606090930188905282518c820281810183019094528c8152939450909261228d92612286928e918e9182919085019084908082843760009201919091525060019250611c2d915050565b839061289b565b90506122a46004548261315090919063ffffffff16565b60006122af826131f1565b6000858152600080516020615ed6833981519152602052604090209091506122d890828e61333b565b8084600080516020615eb6833981519152846122f387613abe565b878a6040516123059493929190615b6a565b60405180910390a3505050505050505050505050565b61232d612327876155af565b8261171f565b50610b3b61216d876155af565b600080825460ff16600481111561235357612353614be0565b148015612364575042826006015411155b905080156110975760018201546040517f58f98006a7f2f253f8ae8f8b7cec9008ca05359633561cd7c22f3005682d4a5590600090a260005b6004830154811015612450578260080160008460040183815481106123c4576123c461551a565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff19169055600484018054600786019291908490811061240d5761240d61551a565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff1916815560018181018390556002909101919091550161239d565b5060005b60058301548110156125075782600801600084600501838154811061247b5761247b61551a565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff1916905560058401805460078601929190849081106124c4576124c461551a565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff19168155600181810183905560029091019190915501612454565b50815460ff191682556000600183018190556002830181905560038301819055612535906004840190614904565b612543600583016000614904565b60006006830155919050565b4682602001511461258857602082015160405163092048d160e11b8152610a3e916001600160e01b031960003516914690600401615964565b6000612593836131f1565b602080850151600090815260038252604080822087518352909252206001015490915081146125f857602080840151600090815260038252604080822086518352909252819020600101549051632bee7fdb60e21b8152610a3e918391600401615434565b6000612602613bfd565b905060008161260f613c07565b61261991906156d5565b6126249060016156c2565b905061262e614896565b612645868685858b866126408e613c11565b613c2b565b5050505050505050565b6003811015612671576040516305f4dee960e31b815260040160405180910390fd5b600061267b611eff565b600581018390556040518381529091507f22d5bb5059ffe2949a098666fc198587200c8118483074120d3ca7050c7753f19060200160405180910390a15050565b6000806000806126d66126cd611eff565b60010186611f23565b91509150816126fa57846040516326527e1760e01b8152600401610a3e9190614d6d565b612702611eff565b8054829081106127145761271461551a565b6000918252602090912001546001600160a01b03169590945092505050565b6000612751612748610d72606089018961571f565b610db588615768565b9050600061275e826131f1565b60008080526003602090815284518252600080516020615ed68339815191529052604090206001015490915081146127d55760008080526003602090815283518252600080516020615ed68339815191529052604090819020600101549051632bee7fdb60e21b8152610a3e918391600401615434565b610689828787878761217d6121b28e615768565b808211806127f8575060018111155b15612824576000356001600160e01b0319166040516387f6f09560e01b8152600401610a3e919061570a565b600061282e612abb565b600181018054600283018054928790558590558254929350918490869085600061285783615c23565b919050557f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8858560405161288c929190615434565b60405180910390a45050505050565b6128a36148b6565b8251815260006020808301919091528301516040808301919091528301516001600160a01b0316606080830191909152830151516001600160401b038111156128ee576128ee614d81565b604051908082528060200260200182016040528015612917578160200160208202803683370190505b5060808083019190915283015160a08083019190915283015160c08083019190915283015160e082015260005b836060015151811015610ce1578281815181106129635761296361551a565b6020026020010151826080015182815181106129815761298161551a565b6001600160a01b0390921660209283029190910190910152600101612944565b606060006129ad611eff565b905082516001600160401b038111156129c8576129c8614d81565b6040519080825280602002602001820160405280156129f1578160200160208202803683370190505b50915060005b835181101561171857816002016000858381518110612a1857612a1861551a565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160601b0316838281518110612a6657612a6661551a565b6001600160601b03909216602092830291909101909101526001016129f7565b6000612a90611eff565b6001600160a01b0390921660009081526002929092016020525060409020546001600160601b031690565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f0090565b7fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb90565b606081612b0f8161153b565b6000612b19611eff565b8451909150806001600160401b03811115612b3657612b36614d81565b604051908082528060200260200182016040528015612b5f578160200160208202803683370190505b50935080600003612b71575050612ee3565b60058201548254612b839083906156d5565b1015612ba25760405163b2e765cb60e01b815260040160405180910390fd5b60008060008060005b85811015612e6957898181518110612bc557612bc561551a565b60200260200101519350612bd8846126bc565b9095509150612be685612ff3565b612bef84612ff3565b6001600160a01b03851660009081526002880160205260409020546001600160601b031615801590612c4357506001600160a01b03841660009081526003880160205260409020546001600160601b031615155b898281518110612c5557612c5561551a565b602002602001019015159081151581525050888181518110612c7957612c7961551a565b602002602001015115612e61576001600160a01b038516600090815260028801602052604081205488546001600160601b039091169190612cbc906001906156d5565b9050886000018181548110612cd357612cd361551a565b60009182526020909120015489546001600160a01b03909116908a9086908110612cff57612cff61551a565b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790558854899080612d3957612d39615c3c565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038916825260028b0190526040902080546001600160601b031916905560018901805482908110612d9957612d9961551a565b60009182526020909120015460018a0180546001600160a01b039092169186908110612dc757612dc761551a565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555088600101805480612e0857612e08615c3c565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038816825260038b0190526040902080546001600160601b0319169055612e5c82866156c2565b945050505b600101612bab565b5081866004016000828254612e7e91906156d5565b9091555050604051612ea390636242a4ef60e11b906114c8908c908c90602001615c52565b7fdf3dcd7987202f64648f3acdbf12401e3a2bb23e77e19f99826b5475cbb86369888a604051612ed4929190615c77565b60405180910390a15050505050505b50919050565b81518151606091908082016001600160401b03811115612f0b57612f0b614d81565b604051908082528060200260200182016040528015612f34578160200160208202803683370190505b50925060005b82811015612f8e57858181518110612f5457612f5461551a565b6020026020010151848281518110612f6e57612f6e61551a565b6001600160a01b0390921660209283029190910190910152600101612f3a565b60005b82811015612fe957858181518110612fab57612fab61551a565b6020026020010151858381518110612fc557612fc561551a565b6001600160a01b039092166020928302919091019091015260019182019101612f91565b5050505092915050565b6001600160a01b0381166109ab576000356001600160e01b03191660405163104c66df60e31b8152600401610a3e919061570a565b6130328282613f6b565b610995573382826040516319b5fdcb60e31b8152600401610a3e93929190615c9c565b6000815160000361306857506000919050565b60005b60018351038110156130eb57600181015b83518110156130e2578381815181106130975761309761551a565b60200260200101516001600160a01b03168483815181106130ba576130ba61551a565b60200260200101516001600160a01b0316036130da575060019392505050565b60010161307c565b5060010161306b565b50600092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561314457602002820191906000526020600020905b815481526020019060010190808311613130575b50505050509050919050565b600082608001515111801561316e57508160a0015151826080015151145b801561318357508160c0015151826080015151145b801561319857508160e0015151826080015151145b6131c3576000356001600160e01b0319166040516306b5667560e21b8152600401610a3e919061570a565b6131cd81426156c2565b826040015111156109955760405163ad89be9d60e01b815260040160405180910390fd5b60a0810151608082015160c083015151600092919083906001600160401b0381111561321f5761321f614d81565b604051908082528060200260200182016040528015613248578160200160208202803683370190505b5060e086015190915060005b82518110156132a7578660c0015181815181106132735761327361551a565b6020026020010151805190602001208382815181106132945761329461551a565b6020908102919091010152600101613254565b50604080517f1b59eeec7c321899dc1e7a5b3d876c9a445dffc6d2f96ba842d7489908fdee1281528751602080830191909152808901518284015291880151606080830191909152909701516080880152835181029381019390932060a0870152835183029383019390932060c0860152805182029082012060e08501528151810291012061010083015250610120902090565b6001830191909155600690910155565b6000818152600183016020526040812054801561343457600061336f6001836156d5565b8554909150600090613383906001906156d5565b90508181146133e85760008660000182815481106133a3576133a361551a565b90600052602060002001549050808760000184815481106133c6576133c661551a565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806133f9576133f9615c3c565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061094b565b600091505061094b565b6001600160a01b03166000908152600891909101602052604090205460ff1690565b600081604051602401613473919061570a565b60408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b1790525190915060009081906001600160a01b038616906134bc908590615cd0565b600060405180830381855afa9150503d80600081146134f7576040519150601f19603f3d011682016040523d82523d6000602084013e6134fc565b606091505b5091509150816135be57846001600160a01b0316836040516024016135219190615cec565b60408051601f198184030181529181526020820180516001600160e01b03166325da93a560e11b179052516135569190615cd0565b600060405180830381855afa9150503d8060008114613591576040519150601f19603f3d011682016040523d82523d6000602084013e613596565b606091505b509092509050816135be57838560405163069d427960e11b8152600401610a3e929190615cff565b808060200190518101906135d29190615d22565b6108f657838560405163069d427960e11b8152600401610a3e929190615cff565b6000610948836001600160a01b038416614291565b613611816142e0565b1561099557815460ff1916600217825560008061362d836142fa565b9150915083600101547fe134987599ae266ec90edeff1b26125b287dbb57b10822649432d1bb26537fba8383604051613667929190615d44565b60405180910390a250505050565b806005600084600581111561368c5761368c614be0565b600581111561369d5761369d614be0565b8152602081019190915260400160002080546001600160a01b0319166001600160a01b0392831617905581168260058111156136db576136db614be0565b6040517f356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d90600090a35050565b831580159061371657508382145b613741576000356001600160e01b0319166040516306b5667560e21b8152600401610a3e919061570a565b600061379a61374f60015490565b61375a8460006145a1565b60405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b905060006137b56137aa60015490565b61375a8560016145a1565b905060006137c1613bfd565b90506000816137ce613c07565b6137d891906156d5565b6137e39060016156c2565b90506000805b87811015610834573660008a8a848181106138065761380661551a565b606002919091019250600090508d8d858181106138255761382561551a565b905060200201602081019061383a9190615d69565b600181111561384b5761384b614be0565b0361387757613870886138616020850185615d95565b846020013585604001356145da565b90506138ee565b60018d8d8581811061388b5761388b61551a565b90506020020160208101906138a09190615d69565b60018111156138b1576138b1614be0565b036138c757613870876138616020850185615d95565b6000356001600160e01b031916604051630612418f60e11b8152600401610a3e919061570a565b806001600160a01b0316846001600160a01b03161061392e576000356001600160e01b031916604051635d3dcd3160e01b8152600401610a3e919061570a565b809350600061393c82613c11565b90508060000361396d576000356001600160e01b03191660405163726b3acb60e01b8152600401610a3e919061570a565b6139b08f8f8f878181106139835761398361551a565b90506020020160208101906139989190615d69565b8989866139aa368a90038a018a615db0565b87613c2b565b156139c357505050505050505050610b3b565b8360010193505050506137e9565b6139d96148b6565b6139f26139eb84606001516001611c2d565b849061289b565b9050613a096004548261315090919063ffffffff16565b6000613a14826131f1565b90506000613a22600061166f565b6000818152600080516020615ed68339815191526020908152604090912090870151919250613a5291849061333b565b82518114613a81576000356001600160e01b03191660405163d4cec26960e01b8152600401610a3e919061570a565b8181600080516020615eb683398151915285613a9c89613abe565b8989604051613aae9493929190615b6a565b60405180910390a3505092915050565b6080810151606082015160a083015151600092919083906001600160401b03811115613aec57613aec614d81565b604051908082528060200260200182016040528015613b15578160200160208202803683370190505b5060c086015190915060005b8251811015613b74578660a001518181518110613b4057613b4061551a565b602002602001015180519060200120838281518110613b6157613b6161551a565b6020908102919091010152600101613b21565b50604080517fde480f0c53a3651c08fbab1dffbc45fe574f31188827fe52cb9035da9fe57e4a8152875160208083019190915280890151828401529790910151606082015283518702938701939093206080840152835186029386019390932060a0830152805185029085012060c082015281518402919093012060e083015250610100902090565b600061069c6109ae565b600061069c610692565b6000613c1c82612a86565b6001600160601b031692915050565b60208088015188516000828152600384526040808220838352909452928320613c538161233a565b15613c645760019350505050613f60565b6020808c01516000908152600290915260409020548214613ca6576000356001600160e01b03191660405163d4cec26960e01b8152600401610a3e919061570a565b6000815460ff166004811115613cbe57613cbe614be0565b14613cdc576040516322de95ff60e21b815260040160405180910390fd5b613ce6818861343e565b15613d06578660405163025fd59560e41b8152600401610a3e9190614d6d565b6001600160a01b03871660009081526008820160209081526040909120805460ff19166001179055860151151580613d415750604086015115155b80613d4f5750855160ff1615155b15613d96576001600160a01b03871660009081526007820160209081526040918290208851815460ff191660ff909116178155908801516001820155908701516002909101555b866001600160a01b031681600101547f1203f9e81c814a35f5f4cc24087b2a24c6fb7986a9f1406b68a9484882c93a238c88604051613dd6929190615e10565b60405180910390a3600080808c6001811115613df457613df4614be0565b03613e49576004830180546001810182556000918252602082200180546001600160a01b0319166001600160a01b038c16179055600384018054899290613e3c9084906156c2565b9250508190559150613eae565b60018c6001811115613e5d57613e5d614be0565b036138c7576005830180546001810182556000918252602082200180546001600160a01b0319166001600160a01b038c16179055600284018054899290613ea59084906156c2565b92505081905590505b8a8210613f1457825460ff19166001908117845580840154604051919750907f5c819725ea53655a3b898f3df59b66489761935454e9212ca1e5ebd759953d0b90600090a260608d01516001600160a01b0316613f0f57613f0f838e613608565b613f5a565b898110613f5a57825460ff19166003178355600180840154604051919750907f55295d4ce992922fa2e5ffbf3a3dcdb367de0a15e125ace083456017fd22060f90600090a25b50505050505b979650505050505050565b60016000613f7a6107336115f5565b80519091506000819003613f8f57505061094b565b6000816001600160401b03811115613fa957613fa9614d81565b604051908082528060200260200182016040528015613fd2578160200160208202803683370190505b5090506000826001600160401b03811115613fef57613fef614d81565b60405190808252806020026020018201604052801561402257816020015b606081526020019060019003908161400d5790505b5090506000878760405160200161403a929190615e1e565b604051602081830303815290604052905060008160405160240161405e9190615cec565b60408051601f198184030181529190526020810180516001600160e01b03166325da93a560e11b179052905060005b85811015614247578681815181106140a7576140a761551a565b60200260200101516001600160a01b0316836040516140c69190615cd0565b6000604051808303816000865af19150503d8060008114614103576040519150601f19603f3d011682016040523d82523d6000602084013e614108565b606091505b5086838151811061411b5761411b61551a565b602002602001018684815181106141345761413461551a565b602002602001018290528215151515815250505084818151811061415a5761415a61551a565b602002602001015161423f578681815181106141785761417861551a565b60200260200101516001600160a01b0316826040516141979190615cd0565b6000604051808303816000865af19150503d80600081146141d4576040519150601f19603f3d011682016040523d82523d6000602084013e6141d9565b606091505b508683815181106141ec576141ec61551a565b602002602001018684815181106142055761420561551a565b602002602001018290528215151515815250505087801561423c57508481815181106142335761423361551a565b60200260200101515b97505b60010161408d565b507fc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b638287868660405161427d9493929190615e4f565b60405180910390a150505050505092915050565b60008181526001830160205260408120546142d85750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561094b565b50600061094b565b600081602001516000148061094b57505060200151461490565b606080614306836142e0565b61433857602083015160405163092048d160e11b8152610a3e916001600160e01b031960003516914690600401615964565b8260800151516001600160401b0381111561435557614355614d81565b60405190808252806020026020018201604052801561437e578160200160208202803683370190505b5091508260800151516001600160401b0381111561439e5761439e614d81565b6040519080825280602002602001820160405280156143d157816020015b60608152602001906001900390816143bc5790505b50905060005b83608001515181101561459b578360e0015181815181106143fa576143fa61551a565b60200260200101515a1161442d57614411846131f1565b6040516307aec4ab60e21b8152600401610a3e91815260200190565b836080015181815181106144435761444361551a565b60200260200101516001600160a01b03168460a00151828151811061446a5761446a61551a565b60200260200101518560e0015183815181106144885761448861551a565b6020026020010151908660c0015184815181106144a7576144a761551a565b60200260200101516040516144bc9190615cd0565b600060405180830381858888f193505050503d80600081146144fa576040519150601f19603f3d011682016040523d82523d6000602084013e6144ff565b606091505b508483815181106145125761451261551a565b6020026020010184848151811061452b5761452b61551a565b60200260200101829052821515151581525050508281815181106145515761455161551a565b602002602001015161459357808282815181106145705761457061551a565b60200260200101516040516376df417560e11b8152600401610a3e929190615e9c565b6001016143d7565b50915091565b604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b60008060006145eb87878787614602565b915091506145f8816146e5565b5095945050505050565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b0383111561462f57506000905060036146dc565b8460ff16601b1415801561464757508460ff16601c14155b1561465857506000905060046146dc565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156146ac573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166146d5576000600192509250506146dc565b9150600090505b94509492505050565b60008160048111156146f9576146f9614be0565b036147015750565b600181600481111561471557614715614be0565b0361475d5760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b6044820152606401610a3e565b600281600481111561477157614771614be0565b036147be5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610a3e565b60038160048111156147d2576147d2614be0565b0361482a5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610a3e565b600481600481111561483e5761483e614be0565b036109ab5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610a3e565b604080516060810182526000808252602082018190529181019190915290565b60405180610100016040528060008152602001600081526020016000815260200160006001600160a01b03168152602001606081526020016060815260200160608152602001606081525090565b50805460008255906000526020600020908101906109ab91905b80821115614932576000815560010161491e565b5090565b60008083601f84011261494857600080fd5b5081356001600160401b0381111561495f57600080fd5b6020830191508360208260051b8501011115611f8157600080fd5b6000806000806000806060878903121561499357600080fd5b86356001600160401b03808211156149aa57600080fd5b6149b68a838b01614936565b909850965060208901359150808211156149cf57600080fd5b6149db8a838b01614936565b909650945060408901359150808211156149f457600080fd5b50614a0189828a01614936565b979a9699509497509295939492505050565b60008060208385031215614a2657600080fd5b82356001600160401b03811115614a3c57600080fd5b614a4885828601614936565b90969095509350505050565b6001600160a01b03169052565b60008151808452602080850194506020840160005b83811015614a9b5781516001600160a01b031687529582019590820190600101614a76565b509495945050505050565b6020815260006109486020830184614a61565b80356001600160a01b038116811461109757600080fd5b600080600080600080600080600080600060e08c8e031215614af157600080fd5b8b359a5060208c01359950614b0860408d01614ab9565b98506001600160401b0360608d0135811015614b2357600080fd5b614b338e60608f01358f01614936565b909950975060808d0135811015614b4957600080fd5b614b598e60808f01358f01614936565b909750955060a08d0135811015614b6f57600080fd5b614b7f8e60a08f01358f01614936565b909550935060c08d0135811015614b9557600080fd5b50614ba68d60c08e01358e01614936565b81935080925050509295989b509295989b9093969950565b60008060408385031215614bd157600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60028110614c0657614c06614be0565b9052565b60006060808352614c1e6060840187614a61565b83810360208581019190915286518083528782019282019060005b81811015614c5c57614c4c838651614bf6565b9383019391830191600101614c39565b50506040925085810360408701528087518083528383019150838901925060005b81811015614cad578351805160ff1684528581015186850152860151868401529284019291860191600101614c7d565b50909a9950505050505050505050565b600080600060608486031215614cd257600080fd5b8335925060208401359150614ce960408501614ab9565b90509250925092565b600060208284031215614d0457600080fd5b5035919050565b60006101008284031215612ee357600080fd5b600060208284031215614d3057600080fd5b81356001600160401b03811115614d4657600080fd5b61071e84828501614d0b565b600060208284031215614d6457600080fd5b61094882614ab9565b6001600160a01b0391909116815260200190565b634e487b7160e01b600052604160045260246000fd5b60405161010081016001600160401b0381118282101715614dba57614dba614d81565b60405290565b60405160e081016001600160401b0381118282101715614dba57614dba614d81565b604051601f8201601f191681016001600160401b0381118282101715614e0a57614e0a614d81565b604052919050565b60006001600160401b03821115614e2b57614e2b614d81565b5060051b60200190565b600082601f830112614e4657600080fd5b81356020614e5b614e5683614e12565b614de2565b8083825260208201915060208460051b870101935086841115614e7d57600080fd5b602086015b84811015614ea757803560068110614e9a5760008081fd5b8352918301918301614e82565b509695505050505050565b600082601f830112614ec357600080fd5b81356020614ed3614e5683614e12565b8083825260208201915060208460051b870101935086841115614ef557600080fd5b602086015b84811015614ea757614f0b81614ab9565b8352918301918301614efa565b60008060408385031215614f2b57600080fd5b82356001600160401b0380821115614f4257600080fd5b614f4e86838701614e35565b93506020850135915080821115614f6457600080fd5b50614f7185828601614eb2565b9150509250929050565b60008060408385031215614f8e57600080fd5b82359150614f9e60208401614ab9565b90509250929050565b80356010811061109757600080fd5b60008060408385031215614fc957600080fd5b614fd283614fa7565b9150614f9e60208401614ab9565b60008083601f840112614ff257600080fd5b5081356001600160401b0381111561500957600080fd5b602083019150836020606083028501011115611f8157600080fd5b60008060008060006060868803121561503c57600080fd5b85356001600160401b038082111561505357600080fd5b61505f89838a01614d0b565b9650602088013591508082111561507557600080fd5b61508189838a01614936565b9096509450604088013591508082111561509a57600080fd5b506150a788828901614fe0565b969995985093965092949392505050565b600060e08284031215612ee357600080fd5b6000806000806000606086880312156150e257600080fd5b85356001600160401b03808211156150f957600080fd5b61505f89838a016150b8565b60008060008060008060008060008060c08b8d03121561512457600080fd5b8a35995061513460208c01614ab9565b985060408b01356001600160401b038082111561515057600080fd5b61515c8e838f01614936565b909a50985060608d013591508082111561517557600080fd5b6151818e838f01614936565b909850965060808d013591508082111561519a57600080fd5b6151a68e838f01614936565b909650945060a08d01359150808211156151bf57600080fd5b506151cc8d828e01614936565b915080935050809150509295989b9194979a5092959850565b80356002811061109757600080fd5b6000806040838503121561520757600080fd5b82356001600160401b0381111561521d57600080fd5b61522985828601614d0b565b925050614f9e602084016151e5565b60a081016005871061524c5761524c614be0565b95815260208101949094526040840192909252606083015260809091015290565b60006020828403121561527f57600080fd5b81356001600160401b0381111561529557600080fd5b61071e848285016150b8565b60008151808452602080850194506020840160005b83811015614a9b5781516001600160601b0316875295820195908201906001016152b6565b6060815260006152ee6060830186614a61565b82810360208401526153008186614a61565b905082810360408401526121b781856152a1565b60208152600061094860208301846152a1565b600080600080600080600080600080600060e08c8e03121561534857600080fd5b8b359a5061535860208d01614ab9565b99506001600160401b0360408d013581101561537357600080fd5b6153838e60408f01358f01614936565b909a50985060608d013581101561539957600080fd5b6153a98e60608f01358f01614936565b909850965060808d01358110156153bf57600080fd5b6153cf8e60808f01358f01614936565b909650945060a08d01358110156153e557600080fd5b506153f68d60a08e01358e01614936565b909350915061540760c08d016151e5565b90509295989b509295989b9093969950565b60006020828403121561542b57600080fd5b61094882614fa7565b918252602082015260400190565b6000615450614e5684614e12565b8381529050602080820190600585901b84018681111561546f57600080fd5b845b818110156155025780356001600160401b03808211156154915760008081fd5b8188019150601f8a818401126154a75760008081fd5b8235828111156154b9576154b9614d81565b6154ca818301601f19168801614de2565b92508083528b878286010111156154e357600091508182fd5b8087850188850137600090830187015250855250928201928201615471565b505050509392505050565b6000610948368484615442565b634e487b7160e01b600052603260045260246000fd5b600082601f83011261554157600080fd5b81356020615551614e5683614e12565b8083825260208201915060208460051b87010193508684111561557357600080fd5b602086015b84811015614ea75780358352918301918301615578565b600082601f8301126155a057600080fd5b61094883833560208501615442565b600061010082360312156155c257600080fd5b6155ca614d97565b8235815260208301356020820152604083013560408201526155ee60608401614ab9565b606082015260808301356001600160401b038082111561560d57600080fd5b61561936838701614eb2565b608084015260a085013591508082111561563257600080fd5b61563e36838701615530565b60a084015260c085013591508082111561565757600080fd5b6156633683870161558f565b60c084015260e085013591508082111561567c57600080fd5b5061568936828601615530565b60e08301525092915050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761094b5761094b615695565b8082018082111561094b5761094b615695565b8181038181111561094b5761094b615695565b60008261570557634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031991909116815260200190565b6000808335601e1984360301811261573657600080fd5b8301803591506001600160401b0382111561575057600080fd5b6020019150600581901b3603821315611f8157600080fd5b600060e0823603121561577a57600080fd5b615782614dc0565b823581526020830135602082015261579c60408401614ab9565b604082015260608301356001600160401b03808211156157bb57600080fd5b6157c736838701614e35565b606084015260808501359150808211156157e057600080fd5b6157ec36838701615530565b608084015260a085013591508082111561580557600080fd5b6158113683870161558f565b60a084015260c085013591508082111561582a57600080fd5b5061583736828601615530565b60c08301525092915050565b602081016010831061585757615857614be0565b91905290565b6001600160e01b03198316815260408101600b831061587e5761587e614be0565b8260208301529392505050565b6001600160601b03818116838216019080821115610ce157610ce1615695565b60008151808452602080850194506020840160005b83811015614a9b5781511515875295820195908201906001016158c0565b6060815260006158f16060830186614a61565b828103602084015261590381866152a1565b905082810360408401526121b781856158ab565b60808152600061592a60808301876158ab565b828103602084015261593c81876152a1565b905082810360408401526159508186614a61565b90508281036060840152613f608185614a61565b6001600160e01b03199390931683526020830191909152604082015260600190565b60008151808452602080850194506020840160005b83811015614a9b5781518752958201959082019060010161599b565b60005b838110156159d25781810151838201526020016159ba565b50506000910152565b600081518084526159f38160208601602086016159b7565b601f01601f19169290920160200192915050565b60008282518085526020808601955060208260051b8401016020860160005b84811015615a5457601f19868403018952615a428383516159db565b98840198925090830190600101615a26565b5090979650505050505050565b60006101008251845260208301516020850152604083015160408501526060830151615a906060860182614a54565b506080830151816080860152615aa882860182614a61565b91505060a083015184820360a0860152615ac28282615986565b91505060c083015184820360c0860152615adc8282615a07565b91505060e083015184820360e0860152615af68282615986565b95945050505050565b604081526000615b126040830185615a61565b905060018060a01b03831660208301529392505050565b60008151808452602080850194506020840160005b83811015614a9b57815160068110615b5857615b58614be0565b87529582019590820190600101615b3e565b608081526000615b7d6080830187615a61565b8560208401528281036040840152845181526020850151602082015260018060a01b036040860151166040820152606085015160e06060830152615bc460e0830182615b29565b905060808601518282036080840152615bdd8282615986565b91505060a086015182820360a0840152615bf78282615a07565b91505060c086015182820360c0840152615c118282615986565b9350505050615af66060830184614a54565b600060018201615c3557615c35615695565b5060010190565b634e487b7160e01b600052603160045260246000fd5b604081526000615c656040830185614a61565b8281036020840152615af681856158ab565b604081526000615c8a60408301856158ab565b8281036020840152615af68185614a61565b6001600160a01b03841681526001600160e01b031983166020820152606060408201819052600090615af6908301846159db565b60008251615ce28184602087016159b7565b9190910192915050565b60208152600061094860208301846159db565b6001600160e01b03199290921682526001600160a01b0316602082015260400190565b600060208284031215615d3457600080fd5b8151801515811461162657600080fd5b604081526000615d5760408301856158ab565b8281036020840152615af68185615a07565b600060208284031215615d7b57600080fd5b610948826151e5565b803560ff8116811461109757600080fd5b600060208284031215615da757600080fd5b61094882615d84565b600060608284031215615dc257600080fd5b604051606081016001600160401b0381118282101715615de457615de4614d81565b604052615df083615d84565b815260208301356020820152604083013560408201528091505092915050565b6040810161587e8285614bf6565b6001600160e01b0319831681528151600090615e418160048501602087016159b7565b919091016004019392505050565b608081526000615e6260808301876159db565b8281036020840152615e748187614a61565b90508281036040840152615e8881866158ab565b90508281036060840152613f608185615a07565b82815260406020820152600061071e60408301846159db56fee5af2d3fb7bcab8f865476bc675bf1bbb8b5a749c827ee1cd215dc9c2b8f92d73617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92effa2646970667358221220fbc7cf0cc42a480ef3d40d76fe731fb7fad911d9e6f97db06cb768d5fde5e16d64736f6c63430008170033", + "deployer": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "devdoc": { + "version": 1, + "kind": "dev", + "methods": { + "addBridgeOperators(uint96[],address[],address[])": { + "details": "Adds multiple bridge operators.", + "params": { + "bridgeOperators": "An array of addresses representing the bridge operators to add.", + "governors": "An array of addresses of hot/cold wallets for bridge operator to update their node address." + } + }, + "castGlobalProposalBySignatures((uint256,uint256,address,uint8[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])": { + "details": "See `GovernanceProposal-_castGlobalProposalBySignatures`." + }, + "castProposalBySignatures((uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])": { + "details": "See `GovernanceProposal-_castProposalBySignatures`." + }, + "castProposalVoteForCurrentNetwork((uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),uint8)": { + "details": "Casts vote for a proposal on the current network. Requirements: - The method caller is governor." + }, + "checkThreshold(uint256)": { + "details": "Checks whether the `_voteWeight` passes the threshold." + }, + "deleteExpired(uint256,uint256)": { + "details": "Deletes the expired proposal by its chainId and nonce, without creating a new proposal. Requirements: - The proposal is already created." + }, + "execute((uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]))": { + "details": "See {CoreGovernance-_executeWithCaller}." + }, + "executeGlobal((uint256,uint256,address,uint8[],uint256[],bytes[],uint256[]))": { + "details": "See {GlobalCoreGovernance-_executeWithCaller}." + }, + "getBridgeOperatorWeight(address)": { + "details": "External function to retrieve the vote weight of a specific bridge operator.", + "params": { + "bridgeOperator": "The address of the bridge operator to get the vote weight for." + }, + "returns": { + "weight": "The vote weight of the specified bridge operator." + } + }, + "getBridgeOperators()": { + "details": "Returns an array of all bridge operators.", + "returns": { + "_0": "An array containing the addresses of all bridge operators." + } + }, + "getCallbackRegisters()": { + "details": "Retrieves the addresses of registered callbacks.", + "returns": { + "registers": "An array containing the addresses of registered callbacks." + } + }, + "getContract(uint8)": { + "details": "Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.", + "params": { + "contractType": "The role of the contract to retrieve." + }, + "returns": { + "contract_": "The address of the contract with the specified role." + } + }, + "getFullBridgeOperatorInfos()": { + "details": "Retrieves the full information of all registered bridge operators. This external function allows external callers to obtain the full information of all the registered bridge operators. The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.", + "returns": { + "bridgeOperators": "An array of addresses representing the registered bridge operators.", + "governors": "An array of addresses representing the governors of each bridge operator.", + "weights": "An array of uint256 values representing the vote weights of each bridge operator. Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator. Example Usage: ``` (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos(); for (uint256 i = 0; i < bridgeOperators.length; i++) { // Access individual information for each bridge operator. address governor = governors[i]; address bridgeOperator = bridgeOperators[i]; uint256 weight = weights[i]; // ... (Process or use the information as required) ... } ```" + } + }, + "getGlobalProposalSignatures(uint256)": { + "details": "See {CommonGovernanceProposal-_getProposalSignatures}" + }, + "getGovernorOf(address)": { + "details": "Returns the corresponding `governor` of a `operator`." + }, + "getGovernorWeight(address)": { + "details": "External function to retrieve the vote weight of a specific governor.", + "params": { + "governor": "The address of the governor to get the vote weight for." + }, + "returns": { + "weight": "voteWeight The vote weight of the specified governor." + } + }, + "getGovernorWeights(address[])": { + "details": "Returns the weights of a list of governor addresses." + }, + "getGovernors()": { + "details": "Returns an array of all governors.", + "returns": { + "_0": "An array containing the addresses of all governors." + } + }, + "getOperatorOf(address)": { + "details": "Returns the corresponding `operator` of a `governor`." + }, + "getProposalExpiryDuration()": { + "details": "Returns the expiry duration for a new proposal." + }, + "getProposalSignatures(uint256,uint256)": { + "details": "See {CommonGovernanceProposal-_getProposalSignatures}" + }, + "getThreshold()": { + "details": "Returns the threshold." + }, + "getTotalWeight()": { + "details": "Returns total weights." + }, + "globalProposalVoted(uint256,address)": { + "details": "See {CommonGovernanceProposal-_proposalVoted}" + }, + "isBridgeOperator(address)": { + "details": "Checks if the given address is a bridge operator.", + "params": { + "addr": "The address to check." + }, + "returns": { + "_0": "A boolean indicating whether the address is a bridge operator." + } + }, + "minimumVoteWeight()": { + "details": "Returns the minimum vote weight to pass the threshold." + }, + "proposalVoted(uint256,uint256,address)": { + "details": "See {CommonGovernanceProposal-_proposalVoted}" + }, + "propose(uint256,uint256,address,address[],uint256[],bytes[],uint256[])": { + "details": "See `CoreGovernance-_proposeProposal`. Requirements: - The method caller is governor." + }, + "proposeGlobal(uint256,address,uint8[],uint256[],bytes[],uint256[])": { + "details": "See `CoreGovernance-_proposeGlobal`. Requirements: - The method caller is governor." + }, + "proposeGlobalProposalStructAndCastVotes((uint256,uint256,address,uint8[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])": { + "details": "See `GovernanceProposal-_proposeGlobalProposalStructAndCastVotes`. Requirements: - The method caller is governor." + }, + "proposeProposalForCurrentNetwork(uint256,address,address[],uint256[],bytes[],uint256[],uint8)": { + "details": "Proposes and casts vote for a proposal on the current network. Requirements: - The method caller is governor. - The proposal is for the current network." + }, + "proposeProposalStructAndCastVotes((uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])": { + "details": "See `GovernanceProposal-_proposeProposalStructAndCastVotes`. Requirements: - The method caller is governor. - The proposal is for the current network." + }, + "registerCallbacks(address[])": { + "details": "Registers multiple callbacks with the bridge.", + "params": { + "registers": "The array of callback addresses to register." + } + }, + "removeBridgeOperators(address[])": { + "details": "Removes multiple bridge operators.", + "params": { + "bridgeOperators": "An array of addresses representing the bridge operators to remove." + } + }, + "resolveTargets(uint8[])": { + "details": "Returns corresponding address of target options. Return address(0) on non-existent target." + }, + "setContract(uint8,address)": { + "details": "Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.", + "params": { + "addr": "The address of the contract to set.", + "contractType": "The role of the contract to set." + } + }, + "setMinRequiredGovernor(uint256)": { + "details": "Self-call to update the minimum required governor.", + "params": { + "min": "The minimum number, this must not less than 3." + } + }, + "setThreshold(uint256,uint256)": { + "details": "Sets the threshold. Requirements: - The method caller is admin. Emits the `ThresholdUpdated` event." + }, + "sumGovernorsWeight(address[])": { + "details": "Returns total weights of the governor list." + }, + "totalBridgeOperator()": { + "details": "Returns the total number of bridge operators.", + "returns": { + "_0": "The total number of bridge operators." + } + }, + "unregisterCallbacks(address[])": { + "details": "Unregisters multiple callbacks from the bridge.", + "params": { + "registers": "The array of callback addresses to unregister." + } + }, + "updateManyTargetOption(uint8[],address[])": { + "details": "Updates list of `targetOptions` to `targets`. Requirement: - Only allow self-call through proposal." + } + }, + "events": { + "BridgeOperatorAddingFailed(address)": { + "details": "Emitted when a bridge operator is failed to add." + }, + "BridgeOperatorRemovingFailed(address)": { + "details": "Emitted when a bridge operator is failed to remove." + }, + "BridgeOperatorUpdated(address,address,address)": { + "details": "Emitted when a bridge operator is updated." + }, + "BridgeOperatorsAdded(bool[],uint96[],address[],address[])": { + "details": "Emitted when new bridge operators are added." + }, + "BridgeOperatorsRemoved(bool[],address[])": { + "details": "Emitted when bridge operators are removed." + }, + "ContractUpdated(uint8,address)": { + "details": "Emitted when a contract is updated." + }, + "GlobalProposalCreated(uint256,bytes32,(uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),bytes32,(uint256,uint256,address,uint8[],uint256[],bytes[],uint256[]),address)": { + "details": "Emitted when a proposal is created" + }, + "Initialized(uint8)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "MinRequiredGovernorUpdated(uint256)": { + "details": "Emitted when the minimum number of required governors is updated." + }, + "Notified(bytes,address[],bool[],bytes[])": { + "details": "Emitted when the contract notifies multiple registers with statuses and return data." + }, + "ProposalApproved(bytes32)": { + "details": "Emitted when the proposal is approved" + }, + "ProposalCreated(uint256,uint256,bytes32,(uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),address)": { + "details": "Emitted when a proposal is created" + }, + "ProposalExecuted(bytes32,bool[],bytes[])": { + "details": "Emitted when the proposal is executed" + }, + "ProposalExpired(bytes32)": { + "details": "Emitted when the vote is expired" + }, + "ProposalExpiryDurationChanged(uint256)": { + "details": "Emitted when the proposal expiry duration is changed." + }, + "ProposalRejected(bytes32)": { + "details": "Emitted when the vote is reject" + }, + "ProposalVoted(bytes32,address,uint8,uint256)": { + "details": "Emitted when the proposal is voted" + }, + "TargetOptionUpdated(uint8,address)": { + "details": "Emitted when the target options are updated" + }, + "ThresholdUpdated(uint256,uint256,uint256,uint256,uint256)": { + "details": "Emitted when the threshold is updated" + } + }, + "errors": { + "ErrAlreadyVoted(address)": [ + { + "details": "Error indicating that a voter has already voted.", + "params": { + "voter": "The address of the voter who has already voted." + } + } + ], + "ErrContractTypeNotFound(uint8)": [ + { + "details": "Error of invalid role." + } + ], + "ErrCurrentProposalIsNotCompleted()": [ + { + "details": "Error thrown when the current proposal is not completed." + } + ], + "ErrDuplicated(bytes4)": [ + { + "details": "Error thrown when a duplicated element is detected in an array.", + "params": { + "msgSig": "The function signature that invoke the error." + } + } + ], + "ErrInsufficientGas(bytes32)": [ + { + "details": "Error thrown when there is insufficient gas to execute a function." + } + ], + "ErrInvalidArguments(bytes4)": [ + { + "details": "Error indicating that arguments are invalid." + } + ], + "ErrInvalidChainId(bytes4,uint256,uint256)": [ + { + "details": "Error indicating that the chain ID is invalid.", + "params": { + "actual": "Current chain ID that executing function.", + "expected": "Expected chain ID required for the tx to success.", + "msgSig": "The function signature (bytes4) of the operation that encountered an invalid chain ID." + } + } + ], + "ErrInvalidExecutor()": [ + { + "details": "Error of the caller is not the specified executor." + } + ], + "ErrInvalidExpiryTimestamp()": [ + { + "details": "Error thrown when an invalid expiry timestamp is provided." + } + ], + "ErrInvalidOrder(bytes4)": [ + { + "details": "Error indicating that an order is invalid.", + "params": { + "msgSig": "The function signature (bytes4) of the operation that encountered an invalid order." + } + } + ], + "ErrInvalidProposal(bytes32,bytes32)": [ + { + "details": "Error thrown when an invalid proposal is encountered.", + "params": { + "actual": "The actual value of the proposal.", + "expected": "The expected value of the proposal." + } + } + ], + "ErrInvalidProposalNonce(bytes4)": [ + { + "details": "Error indicating that the proposal nonce is invalid.", + "params": { + "msgSig": "The function signature (bytes4) of the operation that encountered an invalid proposal nonce." + } + } + ], + "ErrInvalidSignatures(bytes4)": [ + { + "details": "Error indicating that a signature is invalid for a specific function signature.", + "params": { + "msgSig": "The function signature (bytes4) that encountered an invalid signature." + } + } + ], + "ErrInvalidThreshold(bytes4)": [ + { + "details": "Error indicating that the provided threshold is invalid for a specific function signature.", + "params": { + "msgSig": "The function signature (bytes4) that the invalid threshold applies to." + } + } + ], + "ErrInvalidVoteWeight(bytes4)": [ + { + "details": "Error indicating that a vote weight is invalid for a specific function signature.", + "params": { + "msgSig": "The function signature (bytes4) that encountered an invalid vote weight." + } + } + ], + "ErrLengthMismatch(bytes4)": [ + { + "details": "Error indicating a mismatch in the length of input parameters or arrays for a specific function.", + "params": { + "msgSig": "The function signature (bytes4) that has a length mismatch." + } + } + ], + "ErrLooseProposalInternallyRevert(uint256,bytes)": [ + { + "details": "Error thrown when the proposal reverts when execute the internal call no. `callIndex` with revert message is `revertMsg`." + } + ], + "ErrOnlySelfCall(bytes4)": [ + { + "details": "Error indicating that a function can only be called by the contract itself.", + "params": { + "msgSig": "The function signature (bytes4) that can only be called by the contract itself." + } + } + ], + "ErrProposalNotApproved()": [ + { + "details": "Error of proposal is not approved for executing." + } + ], + "ErrQueryForEmptyVote()": [ + { + "details": "Error thrown when querying for an empty vote." + } + ], + "ErrUnauthorized(bytes4,uint8)": [ + { + "details": "Error indicating that the caller is unauthorized to perform a specific function.", + "params": { + "expectedRole": "The role required to perform the function.", + "msgSig": "The function signature (bytes4) that the caller is unauthorized to perform." + } + } + ], + "ErrUnsupportedInterface(bytes4,address)": [ + { + "details": "The error indicating an unsupported interface.", + "params": { + "addr": "The address where the unsupported interface was encountered.", + "interfaceId": "The bytes4 interface identifier that is not supported." + } + } + ], + "ErrUnsupportedVoteType(bytes4)": [ + { + "details": "Error indicating that a vote type is not supported.", + "params": { + "msgSig": "The function signature (bytes4) of the operation that encountered an unsupported vote type." + } + } + ], + "ErrVoteIsFinalized()": [ + { + "details": "Error thrown when attempting to interact with a finalized vote." + } + ], + "ErrZeroAddress(bytes4)": [ + { + "details": "Error indicating that given address is null when it should not." + } + ], + "ErrZeroCodeContract(address)": [ + { + "details": "Error of set to non-contract." + } + ] + } + }, + "isFoundry": true, + "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"ErrAlreadyVoted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrBelowMinRequiredGovernors\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"ErrContractTypeNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrCurrentProposalIsNotCompleted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrDuplicated\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"name\":\"ErrExistOneInternalCallFailed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"}],\"name\":\"ErrGovernorNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"required\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ErrGovernorNotMatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ErrInsufficientGas\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidArguments\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"}],\"name\":\"ErrInvalidChainId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidExecutor\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidExpiryTimestamp\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidInput\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidOrder\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"}],\"name\":\"ErrInvalidProposal\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidProposalNonce\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidSignatures\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidThreshold\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidVoteWeight\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrLengthMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"callIndex\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"revertMsg\",\"type\":\"bytes\"}],\"name\":\"ErrLooseProposalInternallyRevert\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrOnlySelfCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"ErrOperatorNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrProposalNotApproved\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrQueryForEmptyVote\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum RoleAccess\",\"name\":\"expectedRole\",\"type\":\"uint8\"}],\"name\":\"ErrUnauthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrUnsupportedInterface\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrUnsupportedVoteType\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrVoteIsFinalized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrZeroAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrZeroCodeContract\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"BridgeOperatorAddingFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"BridgeOperatorRemovingFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fromBridgeOperator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"toBridgeOperator\",\"type\":\"address\"}],\"name\":\"BridgeOperatorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"statuses\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"uint96[]\",\"name\":\"voteWeights\",\"type\":\"uint96[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"BridgeOperatorsAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"statuses\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"BridgeOperatorsRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"name\":\"CallbackRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ContractUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"round\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"indexed\":false,\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"globalProposalHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"indexed\":false,\"internalType\":\"struct GlobalProposal.GlobalProposalDetail\",\"name\":\"globalProposal\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"}],\"name\":\"GlobalProposalCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"}],\"name\":\"MinRequiredGovernorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"statuses\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"returnDatas\",\"type\":\"bytes[]\"}],\"name\":\"Notified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ProposalApproved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"round\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"indexed\":false,\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"}],\"name\":\"ProposalCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"successCalls\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"returnDatas\",\"type\":\"bytes[]\"}],\"name\":\"ProposalExecuted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ProposalExpired\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"ProposalExpiryDurationChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ProposalRejected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"enum Ballot.VoteType\",\"name\":\"support\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\"}],\"name\":\"ProposalVoted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum GlobalProposal.TargetOption\",\"name\":\"targetOption\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"TargetOptionUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"numerator\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"denominator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousNumerator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousDenominator\",\"type\":\"uint256\"}],\"name\":\"ThresholdUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96[]\",\"name\":\"voteWeights\",\"type\":\"uint96[]\"},{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"addBridgeOperators\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"internalType\":\"struct GlobalProposal.GlobalProposalDetail\",\"name\":\"globalProposal\",\"type\":\"tuple\"},{\"internalType\":\"enum Ballot.VoteType[]\",\"name\":\"supports_\",\"type\":\"uint8[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"signatures\",\"type\":\"tuple[]\"}],\"name\":\"castGlobalProposalBySignatures\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"internalType\":\"enum Ballot.VoteType[]\",\"name\":\"supports_\",\"type\":\"uint8[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"signatures\",\"type\":\"tuple[]\"}],\"name\":\"castProposalBySignatures\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"internalType\":\"enum Ballot.VoteType\",\"name\":\"support\",\"type\":\"uint8\"}],\"name\":\"castProposalVoteForCurrentNetwork\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"voteWeight\",\"type\":\"uint256\"}],\"name\":\"checkThreshold\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"deleteExpired\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"proposal\",\"type\":\"tuple\"}],\"name\":\"execute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"internalType\":\"struct GlobalProposal.GlobalProposalDetail\",\"name\":\"globalProposal\",\"type\":\"tuple\"}],\"name\":\"executeGlobal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeOperator\",\"type\":\"address\"}],\"name\":\"getBridgeOperatorWeight\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"weight\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBridgeOperators\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCallbackRegisters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"getContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"contract_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFullBridgeOperatorInfos\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"},{\"internalType\":\"uint96[]\",\"name\":\"weights\",\"type\":\"uint96[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"round_\",\"type\":\"uint256\"}],\"name\":\"getGlobalProposalSignatures\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"voters\",\"type\":\"address[]\"},{\"internalType\":\"enum Ballot.VoteType[]\",\"name\":\"supports_\",\"type\":\"uint8[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"signatures\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"getGovernorOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"}],\"name\":\"getGovernorWeight\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"weight\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"}],\"name\":\"getGovernorWeights\",\"outputs\":[{\"internalType\":\"uint96[]\",\"name\":\"weights\",\"type\":\"uint96[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGovernors\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"}],\"name\":\"getOperatorOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getProposalExpiryDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"getProposalSignatures\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"_voters\",\"type\":\"address[]\"},{\"internalType\":\"enum Ballot.VoteType[]\",\"name\":\"_supports\",\"type\":\"uint8[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"_signatures\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"round_\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"globalProposalVoted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isBridgeOperator\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minimumVoteWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_voter\",\"type\":\"address\"}],\"name\":\"proposalVoted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"name\":\"propose\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"name\":\"proposeGlobal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"internalType\":\"struct GlobalProposal.GlobalProposalDetail\",\"name\":\"globalProposal\",\"type\":\"tuple\"},{\"internalType\":\"enum Ballot.VoteType[]\",\"name\":\"supports_\",\"type\":\"uint8[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"signatures\",\"type\":\"tuple[]\"}],\"name\":\"proposeGlobalProposalStructAndCastVotes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"},{\"internalType\":\"enum Ballot.VoteType\",\"name\":\"support\",\"type\":\"uint8\"}],\"name\":\"proposeProposalForCurrentNetwork\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"_proposal\",\"type\":\"tuple\"},{\"internalType\":\"enum Ballot.VoteType[]\",\"name\":\"_supports\",\"type\":\"uint8[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"_signatures\",\"type\":\"tuple[]\"}],\"name\":\"proposeProposalStructAndCastVotes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"}],\"name\":\"registerCallbacks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"removeBridgeOperators\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"}],\"name\":\"resolveTargets\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"round\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"}],\"name\":\"setMinRequiredGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom\",\"type\":\"uint256\"}],\"name\":\"setThreshold\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"}],\"name\":\"sumGovernorsWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"sum\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalBridgeOperator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"}],\"name\":\"unregisterCallbacks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"}],\"name\":\"updateManyTargetOption\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"vote\",\"outputs\":[{\"internalType\":\"enum VoteStatusConsumer.VoteStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"againstVoteWeight\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"forVoteWeight\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"ErrAlreadyVoted(address)\":[{\"details\":\"Error indicating that a voter has already voted.\",\"params\":{\"voter\":\"The address of the voter who has already voted.\"}}],\"ErrContractTypeNotFound(uint8)\":[{\"details\":\"Error of invalid role.\"}],\"ErrCurrentProposalIsNotCompleted()\":[{\"details\":\"Error thrown when the current proposal is not completed.\"}],\"ErrDuplicated(bytes4)\":[{\"details\":\"Error thrown when a duplicated element is detected in an array.\",\"params\":{\"msgSig\":\"The function signature that invoke the error.\"}}],\"ErrInsufficientGas(bytes32)\":[{\"details\":\"Error thrown when there is insufficient gas to execute a function.\"}],\"ErrInvalidArguments(bytes4)\":[{\"details\":\"Error indicating that arguments are invalid.\"}],\"ErrInvalidChainId(bytes4,uint256,uint256)\":[{\"details\":\"Error indicating that the chain ID is invalid.\",\"params\":{\"actual\":\"Current chain ID that executing function.\",\"expected\":\"Expected chain ID required for the tx to success.\",\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid chain ID.\"}}],\"ErrInvalidExecutor()\":[{\"details\":\"Error of the caller is not the specified executor.\"}],\"ErrInvalidExpiryTimestamp()\":[{\"details\":\"Error thrown when an invalid expiry timestamp is provided.\"}],\"ErrInvalidOrder(bytes4)\":[{\"details\":\"Error indicating that an order is invalid.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid order.\"}}],\"ErrInvalidProposal(bytes32,bytes32)\":[{\"details\":\"Error thrown when an invalid proposal is encountered.\",\"params\":{\"actual\":\"The actual value of the proposal.\",\"expected\":\"The expected value of the proposal.\"}}],\"ErrInvalidProposalNonce(bytes4)\":[{\"details\":\"Error indicating that the proposal nonce is invalid.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid proposal nonce.\"}}],\"ErrInvalidSignatures(bytes4)\":[{\"details\":\"Error indicating that a signature is invalid for a specific function signature.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that encountered an invalid signature.\"}}],\"ErrInvalidThreshold(bytes4)\":[{\"details\":\"Error indicating that the provided threshold is invalid for a specific function signature.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that the invalid threshold applies to.\"}}],\"ErrInvalidVoteWeight(bytes4)\":[{\"details\":\"Error indicating that a vote weight is invalid for a specific function signature.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that encountered an invalid vote weight.\"}}],\"ErrLengthMismatch(bytes4)\":[{\"details\":\"Error indicating a mismatch in the length of input parameters or arrays for a specific function.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that has a length mismatch.\"}}],\"ErrLooseProposalInternallyRevert(uint256,bytes)\":[{\"details\":\"Error thrown when the proposal reverts when execute the internal call no. `callIndex` with revert message is `revertMsg`.\"}],\"ErrOnlySelfCall(bytes4)\":[{\"details\":\"Error indicating that a function can only be called by the contract itself.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that can only be called by the contract itself.\"}}],\"ErrProposalNotApproved()\":[{\"details\":\"Error of proposal is not approved for executing.\"}],\"ErrQueryForEmptyVote()\":[{\"details\":\"Error thrown when querying for an empty vote.\"}],\"ErrUnauthorized(bytes4,uint8)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"expectedRole\":\"The role required to perform the function.\",\"msgSig\":\"The function signature (bytes4) that the caller is unauthorized to perform.\"}}],\"ErrUnsupportedInterface(bytes4,address)\":[{\"details\":\"The error indicating an unsupported interface.\",\"params\":{\"addr\":\"The address where the unsupported interface was encountered.\",\"interfaceId\":\"The bytes4 interface identifier that is not supported.\"}}],\"ErrUnsupportedVoteType(bytes4)\":[{\"details\":\"Error indicating that a vote type is not supported.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the operation that encountered an unsupported vote type.\"}}],\"ErrVoteIsFinalized()\":[{\"details\":\"Error thrown when attempting to interact with a finalized vote.\"}],\"ErrZeroAddress(bytes4)\":[{\"details\":\"Error indicating that given address is null when it should not.\"}],\"ErrZeroCodeContract(address)\":[{\"details\":\"Error of set to non-contract.\"}]},\"events\":{\"BridgeOperatorAddingFailed(address)\":{\"details\":\"Emitted when a bridge operator is failed to add.\"},\"BridgeOperatorRemovingFailed(address)\":{\"details\":\"Emitted when a bridge operator is failed to remove.\"},\"BridgeOperatorUpdated(address,address,address)\":{\"details\":\"Emitted when a bridge operator is updated.\"},\"BridgeOperatorsAdded(bool[],uint96[],address[],address[])\":{\"details\":\"Emitted when new bridge operators are added.\"},\"BridgeOperatorsRemoved(bool[],address[])\":{\"details\":\"Emitted when bridge operators are removed.\"},\"ContractUpdated(uint8,address)\":{\"details\":\"Emitted when a contract is updated.\"},\"GlobalProposalCreated(uint256,bytes32,(uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),bytes32,(uint256,uint256,address,uint8[],uint256[],bytes[],uint256[]),address)\":{\"details\":\"Emitted when a proposal is created\"},\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"MinRequiredGovernorUpdated(uint256)\":{\"details\":\"Emitted when the minimum number of required governors is updated.\"},\"Notified(bytes,address[],bool[],bytes[])\":{\"details\":\"Emitted when the contract notifies multiple registers with statuses and return data.\"},\"ProposalApproved(bytes32)\":{\"details\":\"Emitted when the proposal is approved\"},\"ProposalCreated(uint256,uint256,bytes32,(uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),address)\":{\"details\":\"Emitted when a proposal is created\"},\"ProposalExecuted(bytes32,bool[],bytes[])\":{\"details\":\"Emitted when the proposal is executed\"},\"ProposalExpired(bytes32)\":{\"details\":\"Emitted when the vote is expired\"},\"ProposalExpiryDurationChanged(uint256)\":{\"details\":\"Emitted when the proposal expiry duration is changed.\"},\"ProposalRejected(bytes32)\":{\"details\":\"Emitted when the vote is reject\"},\"ProposalVoted(bytes32,address,uint8,uint256)\":{\"details\":\"Emitted when the proposal is voted\"},\"TargetOptionUpdated(uint8,address)\":{\"details\":\"Emitted when the target options are updated\"},\"ThresholdUpdated(uint256,uint256,uint256,uint256,uint256)\":{\"details\":\"Emitted when the threshold is updated\"}},\"kind\":\"dev\",\"methods\":{\"addBridgeOperators(uint96[],address[],address[])\":{\"details\":\"Adds multiple bridge operators.\",\"params\":{\"bridgeOperators\":\"An array of addresses representing the bridge operators to add.\",\"governors\":\"An array of addresses of hot/cold wallets for bridge operator to update their node address.\"}},\"castGlobalProposalBySignatures((uint256,uint256,address,uint8[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])\":{\"details\":\"See `GovernanceProposal-_castGlobalProposalBySignatures`.\"},\"castProposalBySignatures((uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])\":{\"details\":\"See `GovernanceProposal-_castProposalBySignatures`.\"},\"castProposalVoteForCurrentNetwork((uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),uint8)\":{\"details\":\"Casts vote for a proposal on the current network. Requirements: - The method caller is governor.\"},\"checkThreshold(uint256)\":{\"details\":\"Checks whether the `_voteWeight` passes the threshold.\"},\"deleteExpired(uint256,uint256)\":{\"details\":\"Deletes the expired proposal by its chainId and nonce, without creating a new proposal. Requirements: - The proposal is already created.\"},\"execute((uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]))\":{\"details\":\"See {CoreGovernance-_executeWithCaller}.\"},\"executeGlobal((uint256,uint256,address,uint8[],uint256[],bytes[],uint256[]))\":{\"details\":\"See {GlobalCoreGovernance-_executeWithCaller}.\"},\"getBridgeOperatorWeight(address)\":{\"details\":\"External function to retrieve the vote weight of a specific bridge operator.\",\"params\":{\"bridgeOperator\":\"The address of the bridge operator to get the vote weight for.\"},\"returns\":{\"weight\":\"The vote weight of the specified bridge operator.\"}},\"getBridgeOperators()\":{\"details\":\"Returns an array of all bridge operators.\",\"returns\":{\"_0\":\"An array containing the addresses of all bridge operators.\"}},\"getCallbackRegisters()\":{\"details\":\"Retrieves the addresses of registered callbacks.\",\"returns\":{\"registers\":\"An array containing the addresses of registered callbacks.\"}},\"getContract(uint8)\":{\"details\":\"Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.\",\"params\":{\"contractType\":\"The role of the contract to retrieve.\"},\"returns\":{\"contract_\":\"The address of the contract with the specified role.\"}},\"getFullBridgeOperatorInfos()\":{\"details\":\"Retrieves the full information of all registered bridge operators. This external function allows external callers to obtain the full information of all the registered bridge operators. The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.\",\"returns\":{\"bridgeOperators\":\"An array of addresses representing the registered bridge operators.\",\"governors\":\"An array of addresses representing the governors of each bridge operator.\",\"weights\":\"An array of uint256 values representing the vote weights of each bridge operator. Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator. Example Usage: ``` (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos(); for (uint256 i = 0; i < bridgeOperators.length; i++) { // Access individual information for each bridge operator. address governor = governors[i]; address bridgeOperator = bridgeOperators[i]; uint256 weight = weights[i]; // ... (Process or use the information as required) ... } ```\"}},\"getGlobalProposalSignatures(uint256)\":{\"details\":\"See {CommonGovernanceProposal-_getProposalSignatures}\"},\"getGovernorOf(address)\":{\"details\":\"Returns the corresponding `governor` of a `operator`.\"},\"getGovernorWeight(address)\":{\"details\":\"External function to retrieve the vote weight of a specific governor.\",\"params\":{\"governor\":\"The address of the governor to get the vote weight for.\"},\"returns\":{\"weight\":\"voteWeight The vote weight of the specified governor.\"}},\"getGovernorWeights(address[])\":{\"details\":\"Returns the weights of a list of governor addresses.\"},\"getGovernors()\":{\"details\":\"Returns an array of all governors.\",\"returns\":{\"_0\":\"An array containing the addresses of all governors.\"}},\"getOperatorOf(address)\":{\"details\":\"Returns the corresponding `operator` of a `governor`.\"},\"getProposalExpiryDuration()\":{\"details\":\"Returns the expiry duration for a new proposal.\"},\"getProposalSignatures(uint256,uint256)\":{\"details\":\"See {CommonGovernanceProposal-_getProposalSignatures}\"},\"getThreshold()\":{\"details\":\"Returns the threshold.\"},\"getTotalWeight()\":{\"details\":\"Returns total weights.\"},\"globalProposalVoted(uint256,address)\":{\"details\":\"See {CommonGovernanceProposal-_proposalVoted}\"},\"isBridgeOperator(address)\":{\"details\":\"Checks if the given address is a bridge operator.\",\"params\":{\"addr\":\"The address to check.\"},\"returns\":{\"_0\":\"A boolean indicating whether the address is a bridge operator.\"}},\"minimumVoteWeight()\":{\"details\":\"Returns the minimum vote weight to pass the threshold.\"},\"proposalVoted(uint256,uint256,address)\":{\"details\":\"See {CommonGovernanceProposal-_proposalVoted}\"},\"propose(uint256,uint256,address,address[],uint256[],bytes[],uint256[])\":{\"details\":\"See `CoreGovernance-_proposeProposal`. Requirements: - The method caller is governor.\"},\"proposeGlobal(uint256,address,uint8[],uint256[],bytes[],uint256[])\":{\"details\":\"See `CoreGovernance-_proposeGlobal`. Requirements: - The method caller is governor.\"},\"proposeGlobalProposalStructAndCastVotes((uint256,uint256,address,uint8[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])\":{\"details\":\"See `GovernanceProposal-_proposeGlobalProposalStructAndCastVotes`. Requirements: - The method caller is governor.\"},\"proposeProposalForCurrentNetwork(uint256,address,address[],uint256[],bytes[],uint256[],uint8)\":{\"details\":\"Proposes and casts vote for a proposal on the current network. Requirements: - The method caller is governor. - The proposal is for the current network.\"},\"proposeProposalStructAndCastVotes((uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])\":{\"details\":\"See `GovernanceProposal-_proposeProposalStructAndCastVotes`. Requirements: - The method caller is governor. - The proposal is for the current network.\"},\"registerCallbacks(address[])\":{\"details\":\"Registers multiple callbacks with the bridge.\",\"params\":{\"registers\":\"The array of callback addresses to register.\"}},\"removeBridgeOperators(address[])\":{\"details\":\"Removes multiple bridge operators.\",\"params\":{\"bridgeOperators\":\"An array of addresses representing the bridge operators to remove.\"}},\"resolveTargets(uint8[])\":{\"details\":\"Returns corresponding address of target options. Return address(0) on non-existent target.\"},\"setContract(uint8,address)\":{\"details\":\"Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.\",\"params\":{\"addr\":\"The address of the contract to set.\",\"contractType\":\"The role of the contract to set.\"}},\"setMinRequiredGovernor(uint256)\":{\"details\":\"Self-call to update the minimum required governor.\",\"params\":{\"min\":\"The minimum number, this must not less than 3.\"}},\"setThreshold(uint256,uint256)\":{\"details\":\"Sets the threshold. Requirements: - The method caller is admin. Emits the `ThresholdUpdated` event.\"},\"sumGovernorsWeight(address[])\":{\"details\":\"Returns total weights of the governor list.\"},\"totalBridgeOperator()\":{\"details\":\"Returns the total number of bridge operators.\",\"returns\":{\"_0\":\"The total number of bridge operators.\"}},\"unregisterCallbacks(address[])\":{\"details\":\"Unregisters multiple callbacks from the bridge.\",\"params\":{\"registers\":\"The array of callback addresses to unregister.\"}},\"updateManyTargetOption(uint8[],address[])\":{\"details\":\"Updates list of `targetOptions` to `targets`. Requirement: - Only allow self-call through proposal.\"}},\"version\":1},\"userdoc\":{\"errors\":{\"ErrBelowMinRequiredGovernors()\":[{\"notice\":\"Error indicating that the governors list will go below minimum number of required governor.\"}],\"ErrGovernorNotFound(address)\":[{\"notice\":\"Error indicating that cannot find the querying governor\"}],\"ErrGovernorNotMatch(address,address)\":[{\"notice\":\"Error indicating that the msg.sender is not match the required governor\"}],\"ErrInvalidInput()\":[{\"notice\":\"Common invalid input error\"}],\"ErrOperatorNotFound(address)\":[{\"notice\":\"Error indicating that cannot find the querying operator\"}]},\"kind\":\"user\",\"methods\":{\"round(uint256)\":{\"notice\":\"chain id = 0 for global proposal\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/ronin/gateway/RoninBridgeManager.sol\":\"RoninBridgeManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[\":@fdk/=lib/foundry-deployment-kit/script/\",\":@openzeppelin/=lib/openzeppelin-contracts/\",\":@prb/math/=lib/prb-math/\",\":@prb/test/=lib/prb-test/src/\",\":@ronin/contracts/=src/\",\":@ronin/script/=script/\",\":@ronin/test/=test/\",\":contract-libs/=lib/foundry-deployment-kit/lib/contract-libs/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/foundry-deployment-kit/lib/forge-std/src/\",\":foundry-deployment-kit/=lib/foundry-deployment-kit/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/contracts/\",\":prb-math/=lib/prb-math/src/\",\":prb-test/=lib/prb-test/src/\",\":solady/=lib/solady/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0xa6a787e7a901af6511e19aa53e1a00352db215a011d2c7a438d0582dd5da76f9\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2a21b14ff90012878752f230d3ffd5c3405e5938d06c97a7d89c0a64561d0d66\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _HEX_SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n // Inspired by OraclizeAPI's implementation - MIT licence\\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\\n\\n if (value == 0) {\\n return \\\"0\\\";\\n }\\n uint256 temp = value;\\n uint256 digits;\\n while (temp != 0) {\\n digits++;\\n temp /= 10;\\n }\\n bytes memory buffer = new bytes(digits);\\n while (value != 0) {\\n digits -= 1;\\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\\n value /= 10;\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n if (value == 0) {\\n return \\\"0x00\\\";\\n }\\n uint256 temp = value;\\n uint256 length = 0;\\n while (temp != 0) {\\n length++;\\n temp >>= 8;\\n }\\n return toHexString(value, length);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xaf159a8b1923ad2a26d516089bceca9bdeaeacd04be50983ea00ba63070f08a3\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.3) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSA {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n } else if (error == RecoverError.InvalidSignatureV) {\\n revert(\\\"ECDSA: invalid signature 'v' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n if (v != 27 && v != 28) {\\n return (address(0), RecoverError.InvalidSignatureV);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", Strings.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0xdb7f5c28fc61cda0bd8ab60ce288e206b791643bcd3ba464a70cbec18895a2f5\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n *\\n * [WARNING]\\n * ====\\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.\\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\\n *\\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.\\n * ====\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n bytes32 lastValue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastValue;\\n // Update the index for the moved value\\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n return set._values[index];\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function _values(Set storage set) private view returns (bytes32[] memory) {\\n return set._values;\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\\n return _values(set._inner);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(AddressSet storage set) internal view returns (address[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n address[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(UintSet storage set) internal view returns (uint256[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n uint256[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0x5050943b32b6a8f282573d166b2e9d87ab7eb4dbba4ab6acf36ecb54fe6995e4\",\"license\":\"MIT\"},\"src/extensions/TransparentUpgradeableProxyV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\\\";\\n\\ncontract TransparentUpgradeableProxyV2 is TransparentUpgradeableProxy {\\n constructor(address _logic, address admin_, bytes memory _data) payable TransparentUpgradeableProxy(_logic, admin_, _data) { }\\n\\n /**\\n * @dev Calls a function from the current implementation as specified by `_data`, which should be an encoded function call.\\n *\\n * Requirements:\\n * - Only the admin can call this function.\\n *\\n * Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid\\n * triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider\\n * reviewing the encoded data `_data` and the method which is called before using this.\\n *\\n */\\n function functionDelegateCall(bytes memory _data) public payable ifAdmin {\\n address _addr = _implementation();\\n assembly {\\n let _result := delegatecall(gas(), _addr, add(_data, 32), mload(_data), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n switch _result\\n case 0 { revert(0, returndatasize()) }\\n default { return(0, returndatasize()) }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x45fc7b71d09da99414b977a56e586b3604670d865e5f36f395d5c98bc4ba64af\",\"license\":\"MIT\"},\"src/extensions/bridge-operator-governance/BridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.23;\\n\\nimport { Initializable } from \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport { IBridgeManagerCallback, BridgeManagerCallbackRegister } from \\\"./BridgeManagerCallbackRegister.sol\\\";\\nimport { IHasContracts, HasContracts } from \\\"../../extensions/collections/HasContracts.sol\\\";\\n\\nimport { IBridgeManager } from \\\"../../interfaces/bridge/IBridgeManager.sol\\\";\\nimport { AddressArrayUtils } from \\\"../../libraries/AddressArrayUtils.sol\\\";\\nimport { ContractType } from \\\"../../utils/ContractType.sol\\\";\\nimport { RoleAccess } from \\\"../../utils/RoleAccess.sol\\\";\\nimport { TUint256Slot } from \\\"../../types/Types.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\nimport \\\"./BridgeManagerQuorum.sol\\\";\\n\\nabstract contract BridgeManager is IBridgeManager, BridgeManagerQuorum, BridgeManagerCallbackRegister {\\n using AddressArrayUtils for address[];\\n\\n struct BridgeManagerStorage {\\n /// @notice List of the governors.\\n /// @dev We do not use EnumerableSet here to maintain identical order of `governors` and `operators`. If `.contains` is needed, use the corresponding weight mapping.\\n address[] _governors;\\n address[] _operators;\\n /// @dev Mapping from address to the governor weight\\n mapping(address governor => uint96 weight) _governorWeight;\\n /// @dev Mapping from address to the operator weight. This must always be identical `_governorWeight`.\\n mapping(address operator => uint96 weight) _operatorWeight;\\n /// @dev Total weight of all governors / operators.\\n uint256 _totalWeight;\\n /// @dev The minimum number of governors that must exist in the contract, to avoid the contract become non-accessible.\\n uint256 _minRequiredGovernor;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"ronin.storage.BridgeManagerStorageLocation\\\")) - 1)) & ~bytes32(uint256(0xff))\\n bytes32 private constant $$_BridgeManagerStorageLocation = 0xc648703095712c0419b6431ae642c061f0a105ac2d7c3d9604061ef4ebc38300;\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n bytes32 public DOMAIN_SEPARATOR;\\n\\n modifier onlyGovernor() virtual {\\n _requireGovernor(msg.sender);\\n _;\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n function __BridgeManager_init(\\n uint256 num,\\n uint256 denom,\\n uint256 roninChainId,\\n address bridgeContract,\\n address[] memory callbackRegisters,\\n address[] memory bridgeOperators,\\n address[] memory governors,\\n uint96[] memory voteWeights\\n ) internal onlyInitializing {\\n __BridgeManagerQuorum_init_unchained(num, denom);\\n __BridgeManagerCallbackRegister_init_unchained(callbackRegisters);\\n __BridgeManager_init_unchained(roninChainId, bridgeContract, bridgeOperators, governors, voteWeights);\\n }\\n\\n function __BridgeManager_init_unchained(\\n uint256 roninChainId,\\n address bridgeContract,\\n address[] memory bridgeOperators,\\n address[] memory governors,\\n uint96[] memory voteWeights\\n ) internal onlyInitializing {\\n _setContract(ContractType.BRIDGE, bridgeContract);\\n\\n DOMAIN_SEPARATOR = keccak256(\\n abi.encode(\\n keccak256(\\\"EIP712Domain(string name,string version,bytes32 salt)\\\"),\\n keccak256(\\\"BridgeManager\\\"), // name hash\\n keccak256(\\\"3\\\"), // version hash\\n keccak256(abi.encode(\\\"BRIDGE_MANAGER\\\", roninChainId)) // salt\\n )\\n );\\n\\n _addBridgeOperators(voteWeights, governors, bridgeOperators);\\n _setMinRequiredGovernor(3);\\n }\\n\\n function _getBridgeManagerStorage() private pure returns (BridgeManagerStorage storage $) {\\n assembly {\\n $.slot := $$_BridgeManagerStorageLocation\\n }\\n }\\n\\n // ===================== CONFIG ========================\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function setContract(ContractType contractType, address addr) external override onlyProxyAdmin {\\n _requireHasCode(addr);\\n _setContract(contractType, addr);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function setMinRequiredGovernor(uint min) external override onlyProxyAdmin {\\n _setMinRequiredGovernor(min);\\n }\\n\\n function _setMinRequiredGovernor(uint min) internal {\\n if (min < 3) revert ErrInvalidInput();\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n $._minRequiredGovernor = min;\\n emit MinRequiredGovernorUpdated(min);\\n }\\n\\n /**\\n * @dev Internal function to require that the caller has governor role access.\\n */\\n function _requireGovernor(address addr) internal view {\\n if (_getGovernorWeight(addr) == 0) {\\n revert ErrUnauthorized(msg.sig, RoleAccess.GOVERNOR);\\n }\\n }\\n\\n // ===================== WEIGHTS METHOD ========================\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getTotalWeight() public view returns (uint256) {\\n return _totalWeight();\\n }\\n\\n function _totalWeight() internal view override returns (uint256) {\\n return _getBridgeManagerStorage()._totalWeight;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getGovernorWeights(address[] calldata governors) external view returns (uint96[] memory weights) {\\n weights = _getGovernorWeights(governors);\\n }\\n\\n /**\\n * @dev Internal function to get the vote weights of a given array of governors.\\n */\\n function _getGovernorWeights(address[] memory governors) internal view returns (uint96[] memory weights) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n weights = new uint96[](governors.length);\\n\\n for (uint256 i; i < governors.length; i++) {\\n weights[i] = $._governorWeight[governors[i]];\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getGovernorWeight(address governor) external view returns (uint96 weight) {\\n weight = _getGovernorWeight(governor);\\n }\\n\\n /**\\n * @dev Internal function to retrieve the vote weight of a specific governor.\\n */\\n function _getGovernorWeight(address governor) internal view returns (uint96) {\\n return _getBridgeManagerStorage()._governorWeight[governor];\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function sumGovernorsWeight(address[] calldata governors) external view nonDuplicate(governors) returns (uint256 sum) {\\n sum = _sumGovernorsWeight(governors);\\n }\\n\\n /**\\n * @dev Internal function to calculate the sum of vote weights for a given array of governors.\\n * @param governors The non-duplicated input.\\n */\\n function _sumGovernorsWeight(address[] memory governors) internal view nonDuplicate(governors) returns (uint256 sum) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n for (uint256 i; i < governors.length; i++) {\\n sum += $._governorWeight[governors[i]];\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint96 weight) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n return $._operatorWeight[bridgeOperator];\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function minimumVoteWeight() public view virtual returns (uint256) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n (uint256 numerator, uint256 denominator) = getThreshold();\\n return (numerator * $._totalWeight + denominator - 1) / denominator;\\n }\\n\\n // ===================== MANAGER CRUD ========================\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function addBridgeOperators(uint96[] calldata voteWeights, address[] calldata governors, address[] calldata bridgeOperators) external onlyProxyAdmin {\\n _addBridgeOperators(voteWeights, governors, bridgeOperators);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function removeBridgeOperators(address[] calldata bridgeOperators) external onlyProxyAdmin {\\n _removeBridgeOperators(bridgeOperators);\\n }\\n\\n /**\\n * @dev Internal function to add bridge operators.\\n *\\n * This function adds the specified `bridgeOperators` to the bridge operator set and establishes the associated mappings.\\n *\\n * Requirements:\\n * - The caller must have the necessary permission to add bridge operators.\\n * - The lengths of `voteWeights`, `governors`, and `bridgeOperators` arrays must be equal.\\n *\\n * @return addeds An array of boolean values indicating whether each bridge operator was successfully added.\\n */\\n function _addBridgeOperators(\\n uint96[] memory voteWeights,\\n address[] memory newGovernors,\\n address[] memory newOperators\\n ) internal nonDuplicate(newGovernors.extend(newOperators)) returns (bool[] memory addeds) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n uint256 length = newOperators.length;\\n if (!(length == voteWeights.length && length == newGovernors.length)) revert ErrLengthMismatch(msg.sig);\\n addeds = new bool[](length);\\n\\n // simply skip add operations if inputs are empty.\\n if (length == 0) return addeds;\\n\\n address iGovernor;\\n address iOperator;\\n uint96 iVoteWeight;\\n uint256 accumulatedWeight;\\n\\n for (uint256 i; i < length; i++) {\\n iGovernor = newGovernors[i];\\n iOperator = newOperators[i];\\n iVoteWeight = voteWeights[i];\\n\\n // Check non-zero inputs\\n _requireNonZeroAddress(iGovernor);\\n _requireNonZeroAddress(iOperator);\\n if (iVoteWeight == 0) revert ErrInvalidVoteWeight(msg.sig);\\n\\n // Check not yet added operators\\n addeds[i] = ($._governorWeight[iGovernor] + $._governorWeight[iOperator] + $._operatorWeight[iOperator] + $._operatorWeight[iGovernor]) == 0;\\n\\n // Only add the valid operator\\n if (addeds[i]) {\\n // Add governor to list, update governor weight\\n $._governors.push(iGovernor);\\n $._governorWeight[iGovernor] = iVoteWeight;\\n\\n // Add operator to list, update governor weight\\n $._operators.push(iOperator);\\n $._operatorWeight[iOperator] = iVoteWeight;\\n\\n accumulatedWeight += iVoteWeight;\\n }\\n }\\n\\n $._totalWeight += accumulatedWeight;\\n\\n _notifyRegisters(IBridgeManagerCallback.onBridgeOperatorsAdded.selector, abi.encode(newOperators, voteWeights, addeds));\\n\\n emit BridgeOperatorsAdded(addeds, voteWeights, newGovernors, newOperators);\\n }\\n\\n /**\\n * @dev Internal function to remove bridge operators.\\n *\\n * This function removes the specified `bridgeOperators` from the bridge operator set and related mappings.\\n *\\n * Requirements:\\n * - The caller must have the necessary permission to remove bridge operators.\\n *\\n * @param removingOperators An array of addresses representing the bridge operators to be removed.\\n * @return removeds An array of boolean values indicating whether each bridge operator was successfully removed.\\n */\\n function _removeBridgeOperators(address[] memory removingOperators) internal nonDuplicate(removingOperators) returns (bool[] memory removeds) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n uint256 length = removingOperators.length;\\n removeds = new bool[](length);\\n\\n // simply skip remove operations if inputs are empty.\\n if (length == 0) return removeds;\\n if ($._governors.length - length < $._minRequiredGovernor) {\\n revert ErrBelowMinRequiredGovernors();\\n }\\n\\n address iGovernor;\\n address iOperator;\\n uint256 accumulatedWeight;\\n uint idx;\\n\\n for (uint256 i; i < length; i++) {\\n iOperator = removingOperators[i];\\n\\n // Check non-zero inputs\\n (iGovernor, idx) = _getGovernorOf(iOperator);\\n _requireNonZeroAddress(iGovernor);\\n _requireNonZeroAddress(iOperator);\\n\\n // Check existing operators\\n removeds[i] = $._governorWeight[iGovernor] > 0 && $._operatorWeight[iOperator] > 0;\\n\\n // Only remove the valid operator\\n if (removeds[i]) {\\n uint removingVoteWeight = $._governorWeight[iGovernor];\\n\\n // Remove governor from list, update governor weight\\n uint lastIdx = $._governors.length - 1;\\n $._governors[idx] = $._governors[lastIdx];\\n $._governors.pop();\\n delete $._governorWeight[iGovernor];\\n\\n // Remove operator from list, update operator weight\\n $._operators[idx] = $._operators[lastIdx];\\n $._operators.pop();\\n delete $._operatorWeight[iOperator];\\n\\n accumulatedWeight += removingVoteWeight;\\n }\\n }\\n\\n $._totalWeight -= accumulatedWeight;\\n\\n _notifyRegisters(IBridgeManagerCallback.onBridgeOperatorsRemoved.selector, abi.encode(removingOperators, removeds));\\n\\n emit BridgeOperatorsRemoved(removeds, removingOperators);\\n }\\n\\n function _findInArray(address[] storage $_array, address addr) internal view returns (bool found, uint idx) {\\n for (uint i; i < $_array.length; i++) {\\n if (addr == $_array[i]) {\\n return (true, i);\\n }\\n }\\n\\n return (false, type(uint256).max);\\n }\\n\\n // ================= MANAGER VIEW METHODS =============\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function totalBridgeOperator() external view returns (uint256) {\\n return _getBridgeManagerStorage()._operators.length;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function isBridgeOperator(address addr) external view returns (bool) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n return $._operatorWeight[addr] > 0;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getBridgeOperators() external view returns (address[] memory) {\\n return _getBridgeManagerStorage()._operators;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getGovernors() external view returns (address[] memory) {\\n return _getBridgeManagerStorage()._governors;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getOperatorOf(address governor) external view returns (address operator) {\\n (bool found, uint idx) = _findInArray(_getBridgeManagerStorage()._governors, governor);\\n if (!found) revert ErrGovernorNotFound(governor);\\n\\n return _getBridgeManagerStorage()._operators[idx];\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getGovernorOf(address operator) external view returns (address governor) {\\n (governor,) = _getGovernorOf(operator);\\n }\\n\\n function _getGovernorOf(address operator) internal view returns (address governor, uint idx) {\\n (bool found, uint foundId) = _findInArray(_getBridgeManagerStorage()._operators, operator);\\n if (!found) revert ErrOperatorNotFound(operator);\\n\\n return (_getBridgeManagerStorage()._governors[foundId], foundId);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getFullBridgeOperatorInfos() external view returns (address[] memory governors, address[] memory bridgeOperators, uint96[] memory weights) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n governors = $._governors;\\n bridgeOperators = $._operators;\\n weights = _getGovernorWeights(governors);\\n }\\n}\\n\",\"keccak256\":\"0xa66d73d33f953f3262714999043f99fb7b7542d1d29c481e376d9ecd2b15b28b\",\"license\":\"MIT\"},\"src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { Initializable } from \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport { EnumerableSet } from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\nimport { IBridgeManagerCallbackRegister } from \\\"../../interfaces/bridge/IBridgeManagerCallbackRegister.sol\\\";\\nimport { IBridgeManagerCallback } from \\\"../../interfaces/bridge/IBridgeManagerCallback.sol\\\";\\nimport { HasContracts } from \\\"../../extensions/collections/HasContracts.sol\\\";\\nimport { TransparentUpgradeableProxyV2, IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\n\\n/**\\n * @title BridgeManagerCallbackRegister\\n * @dev A contract that manages callback registrations and execution for a bridge.\\n */\\nabstract contract BridgeManagerCallbackRegister is IBridgeManagerCallbackRegister, IdentityGuard, Initializable, HasContracts {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n /**\\n * @dev Storage slot for the address set of callback registers.\\n * @dev Value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeAdmin.callbackRegisters.slot\\\") - 1.\\n */\\n bytes32 private constant CALLBACK_REGISTERS_SLOT = 0x5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd976240;\\n\\n function __BridgeManagerCallbackRegister_init_unchained(address[] memory callbackRegisters) internal onlyInitializing {\\n _registerCallbacks(callbackRegisters);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallbackRegister\\n */\\n function registerCallbacks(address[] calldata registers) external onlyProxyAdmin {\\n _registerCallbacks(registers);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallbackRegister\\n */\\n function unregisterCallbacks(address[] calldata registers) external onlyProxyAdmin nonDuplicate(registers) {\\n EnumerableSet.AddressSet storage _callbackRegisters = _getCallbackRegisters();\\n\\n for (uint256 i; i < registers.length; i++) {\\n _callbackRegisters.remove(registers[i]);\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallbackRegister\\n */\\n function getCallbackRegisters() external view returns (address[] memory registers) {\\n registers = _getCallbackRegisters().values();\\n }\\n\\n /**\\n * @dev Internal function to register multiple callbacks with the bridge.\\n * @param registers The array of callback addresses to register.\\n */\\n function _registerCallbacks(address[] memory registers) internal nonDuplicate(registers) {\\n EnumerableSet.AddressSet storage _callbackRegisters = _getCallbackRegisters();\\n address register;\\n bool regSuccess;\\n\\n for (uint256 i; i < registers.length; i++) {\\n register = registers[i];\\n\\n _requireHasCode(register);\\n _requireSupportsInterface(register, type(IBridgeManagerCallback).interfaceId);\\n\\n regSuccess = _callbackRegisters.add(register);\\n\\n emit CallbackRegistered(register, regSuccess);\\n }\\n }\\n\\n /**\\n * @dev Same as {_notifyRegistersUnsafe} but revert when there at least one failed internal call.\\n */\\n function _notifyRegisters(bytes4 callbackFnSig, bytes memory inputs) internal {\\n if (!_notifyRegistersUnsafe(callbackFnSig, inputs)) {\\n revert ErrExistOneInternalCallFailed(msg.sender, callbackFnSig, inputs);\\n }\\n }\\n\\n /**\\n * @dev Internal function to notify all registered callbacks with the provided function signature and data.\\n * @param callbackFnSig The function signature of the callback method.\\n * @param inputs The data to pass to the callback method.\\n * @return allSuccess Return true if all internal calls are success\\n */\\n function _notifyRegistersUnsafe(bytes4 callbackFnSig, bytes memory inputs) internal returns (bool allSuccess) {\\n allSuccess = true;\\n\\n address[] memory registers = _getCallbackRegisters().values();\\n uint256 length = registers.length;\\n if (length == 0) return allSuccess;\\n\\n bool[] memory successes = new bool[](length);\\n bytes[] memory returnDatas = new bytes[](length);\\n bytes memory callData = abi.encodePacked(callbackFnSig, inputs);\\n bytes memory proxyCallData = abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (callData));\\n\\n for (uint256 i; i < length; i++) {\\n // First, attempt to call normally\\n (successes[i], returnDatas[i]) = registers[i].call(callData);\\n\\n // If cannot call normally, attempt to call as the recipient is the proxy, and this caller is its admin.\\n if (!successes[i]) {\\n (successes[i], returnDatas[i]) = registers[i].call(proxyCallData);\\n allSuccess = allSuccess && successes[i];\\n }\\n }\\n\\n emit Notified(callData, registers, successes, returnDatas);\\n }\\n\\n /**\\n * @dev Internal function to retrieve the address set of callback registers.\\n * @return callbackRegisters The storage reference to the callback registers.\\n */\\n function _getCallbackRegisters() internal pure returns (EnumerableSet.AddressSet storage callbackRegisters) {\\n assembly (\\\"memory-safe\\\") {\\n callbackRegisters.slot := CALLBACK_REGISTERS_SLOT\\n }\\n }\\n}\\n\",\"keccak256\":\"0xee1c849d6b50cda917d6c918a23116cc288488958f58ef215707204e7c2f847f\",\"license\":\"MIT\"},\"src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.23;\\n\\nimport { Initializable } from \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport { IQuorum } from \\\"../../interfaces/IQuorum.sol\\\";\\nimport { IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\nimport { HasContracts } from \\\"../../extensions/collections/HasContracts.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\n\\nabstract contract BridgeManagerQuorum is IQuorum, IdentityGuard, Initializable, HasContracts {\\n struct BridgeManagerQuorumStorage {\\n uint256 _nonce;\\n uint256 _numerator;\\n uint256 _denominator;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"ronin.storage.BridgeManagerQuorumStorage\\\")) - 1)) & ~bytes32(uint256(0xff))\\n bytes32 private constant $$_BridgeManagerQuorumStorage = 0xf3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00;\\n\\n function __BridgeManagerQuorum_init_unchained(uint256 num, uint256 denom) internal onlyInitializing {\\n BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage();\\n $._nonce = 1;\\n\\n _setThreshold(num, denom);\\n }\\n\\n function _getBridgeManagerQuorumStorage() private pure returns (BridgeManagerQuorumStorage storage $) {\\n assembly {\\n $.slot := $$_BridgeManagerQuorumStorage\\n }\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function setThreshold(uint256 num, uint256 denom) external override onlyProxyAdmin {\\n _setThreshold(num, denom);\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function getThreshold() public view virtual returns (uint256 num, uint256 denom) {\\n BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage();\\n return ($._numerator, $._denominator);\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function checkThreshold(uint256 voteWeight) external view virtual returns (bool) {\\n BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage();\\n\\n return voteWeight * $._denominator >= $._numerator * _totalWeight();\\n }\\n\\n /**\\n * @dev Sets threshold and returns the old one.\\n *\\n * Emits the `ThresholdUpdated` event.\\n *\\n */\\n function _setThreshold(uint256 num, uint256 denom) internal virtual {\\n if (num > denom || denom <= 1) revert ErrInvalidThreshold(msg.sig);\\n\\n BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage();\\n\\n uint256 prevNum = $._numerator;\\n uint256 prevDenom = $._denominator;\\n\\n $._numerator = num;\\n $._denominator = denom;\\n\\n emit ThresholdUpdated($._nonce++, num, denom, prevNum, prevDenom);\\n }\\n\\n function _totalWeight() internal view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0xd49face0efa89eac09d2d6a5eb69598fd706ba1aac8d431b22212643a507b74e\",\"license\":\"MIT\"},\"src/extensions/collections/HasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { HasProxyAdmin } from \\\"./HasProxyAdmin.sol\\\";\\nimport \\\"../../interfaces/collections/IHasContracts.sol\\\";\\nimport { IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\nimport { ErrUnexpectedInternalCall } from \\\"../../utils/CommonErrors.sol\\\";\\n\\n/**\\n * @title HasContracts\\n * @dev A contract that provides functionality to manage multiple contracts with different roles.\\n */\\nabstract contract HasContracts is HasProxyAdmin, IHasContracts, IdentityGuard {\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.collections.HasContracts.slot\\\") - 1\\n bytes32 private constant _STORAGE_SLOT = 0xdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb;\\n\\n /**\\n * @dev Modifier to restrict access to functions only to contracts with a specific role.\\n * @param contractType The contract type that allowed to call\\n */\\n modifier onlyContract(ContractType contractType) virtual {\\n _requireContract(contractType);\\n _;\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function setContract(ContractType contractType, address addr) external virtual onlyProxyAdmin {\\n _requireHasCode(addr);\\n _setContract(contractType, addr);\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function getContract(ContractType contractType) public view returns (address contract_) {\\n contract_ = _getContractMap()[uint8(contractType)];\\n if (contract_ == address(0)) revert ErrContractTypeNotFound(contractType);\\n }\\n\\n /**\\n * @dev Internal function to set the address of a contract with a specific role.\\n * @param contractType The contract type of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function _setContract(ContractType contractType, address addr) internal virtual {\\n _getContractMap()[uint8(contractType)] = addr;\\n emit ContractUpdated(contractType, addr);\\n }\\n\\n /**\\n * @dev Internal function to access the mapping of contract addresses with roles.\\n * @return contracts_ The mapping of contract addresses with roles.\\n */\\n function _getContractMap() private pure returns (mapping(uint8 => address) storage contracts_) {\\n assembly {\\n contracts_.slot := _STORAGE_SLOT\\n }\\n }\\n\\n /**\\n * @dev Internal function to check if the calling contract has a specific role.\\n * @param contractType The contract type that the calling contract must have.\\n * @dev Throws an error if the calling contract does not have the specified role.\\n */\\n function _requireContract(ContractType contractType) private view {\\n if (msg.sender != getContract(contractType)) {\\n revert ErrUnexpectedInternalCall(msg.sig, contractType, msg.sender);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7dbefa31230e6e4bd319f02d94893cbfd07ee12a0e016f5fadc57660df01891\",\"license\":\"MIT\"},\"src/extensions/collections/HasProxyAdmin.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/StorageSlot.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\n\\nabstract contract HasProxyAdmin {\\n // bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n modifier onlyProxyAdmin() {\\n _requireProxyAdmin();\\n _;\\n }\\n\\n /**\\n * @dev Returns proxy admin.\\n */\\n function _getProxyAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n function _requireProxyAdmin() internal view {\\n if (msg.sender != _getProxyAdmin()) revert ErrUnauthorized(msg.sig, RoleAccess.ADMIN);\\n }\\n}\\n\",\"keccak256\":\"0xad3db02c99a960b60151f2ad45eed46073d14fe1ed861f496c7aeefacbbc528e\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/CoreGovernance.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport \\\"../../libraries/Proposal.sol\\\";\\nimport \\\"../../libraries/GlobalProposal.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\nimport \\\"../../libraries/Ballot.sol\\\";\\nimport \\\"../../interfaces/consumers/ChainTypeConsumer.sol\\\";\\nimport \\\"../../interfaces/consumers/SignatureConsumer.sol\\\";\\nimport \\\"../../interfaces/consumers/VoteStatusConsumer.sol\\\";\\n\\nabstract contract CoreGovernance is Initializable, SignatureConsumer, VoteStatusConsumer, ChainTypeConsumer {\\n using Proposal for Proposal.ProposalDetail;\\n\\n /**\\n * @dev Error thrown when attempting to interact with a finalized vote.\\n */\\n error ErrVoteIsFinalized();\\n\\n /**\\n * @dev Error thrown when the current proposal is not completed.\\n */\\n error ErrCurrentProposalIsNotCompleted();\\n\\n struct ProposalVote {\\n VoteStatus status;\\n bytes32 hash;\\n uint256 againstVoteWeight; // Total weight of against votes\\n uint256 forVoteWeight; // Total weight of for votes\\n address[] forVoteds; // Array of addresses voting for\\n address[] againstVoteds; // Array of addresses voting against\\n uint256 expiryTimestamp;\\n mapping(address => Signature) sig;\\n mapping(address => bool) voted;\\n }\\n\\n /// @dev Emitted when a proposal is created\\n event ProposalCreated(uint256 indexed chainId, uint256 indexed round, bytes32 indexed proposalHash, Proposal.ProposalDetail proposal, address creator);\\n /// @dev Emitted when the proposal is voted\\n event ProposalVoted(bytes32 indexed proposalHash, address indexed voter, Ballot.VoteType support, uint256 weight);\\n /// @dev Emitted when the proposal is approved\\n event ProposalApproved(bytes32 indexed proposalHash);\\n /// @dev Emitted when the vote is reject\\n event ProposalRejected(bytes32 indexed proposalHash);\\n /// @dev Emitted when the vote is expired\\n event ProposalExpired(bytes32 indexed proposalHash);\\n /// @dev Emitted when the proposal is executed\\n event ProposalExecuted(bytes32 indexed proposalHash, bool[] successCalls, bytes[] returnDatas);\\n /// @dev Emitted when the proposal expiry duration is changed.\\n event ProposalExpiryDurationChanged(uint256 indexed duration);\\n\\n /// @dev Mapping from chain id => vote round\\n /// @notice chain id = 0 for global proposal\\n mapping(uint256 => uint256) public round;\\n /// @dev Mapping from chain id => vote round => proposal vote\\n mapping(uint256 => mapping(uint256 => ProposalVote)) public vote;\\n\\n uint256 internal _proposalExpiryDuration;\\n\\n function __CoreGovernance_init(uint256 expiryDuration) internal onlyInitializing {\\n __CoreGovernance_init_unchained(expiryDuration);\\n }\\n\\n function __CoreGovernance_init_unchained(uint256 expiryDuration) internal onlyInitializing {\\n _setProposalExpiryDuration(expiryDuration);\\n }\\n\\n /**\\n * @dev Creates new voting round by calculating the `_round` number of chain `_chainId`.\\n * Increases the `_round` number if the previous one is not expired. Delete the previous proposal\\n * if it is expired and not increase the `_round`.\\n */\\n function _createVotingRound(uint256 _chainId) internal returns (uint256 _round) {\\n _round = round[_chainId];\\n // Skip checking for the first ever round\\n if (_round == 0) {\\n _round = round[_chainId] = 1;\\n } else {\\n ProposalVote storage _latestProposalVote = vote[_chainId][_round];\\n bool _isExpired = _tryDeleteExpiredVotingRound(_latestProposalVote);\\n // Skip increasing round number if the latest round is expired, allow the vote to be overridden\\n if (!_isExpired) {\\n if (_latestProposalVote.status == VoteStatus.Pending) revert ErrCurrentProposalIsNotCompleted();\\n unchecked {\\n _round = ++round[_chainId];\\n }\\n }\\n }\\n }\\n\\n /**\\n * @dev Saves new round voting for the proposal `_proposalHash` of chain `_chainId`.\\n */\\n function _saveVotingRound(ProposalVote storage _vote, bytes32 _proposalHash, uint256 _expiryTimestamp) internal {\\n _vote.hash = _proposalHash;\\n _vote.expiryTimestamp = _expiryTimestamp;\\n }\\n\\n /**\\n * @dev Proposes proposal struct.\\n *\\n * Requirements:\\n * - The chain id is not equal to 0.\\n * - The proposal nonce is equal to the new round.\\n *\\n * Emits the `ProposalCreated` event.\\n *\\n */\\n function _proposeProposalStruct(Proposal.ProposalDetail memory proposal, address creator) internal virtual returns (uint256 round_) {\\n uint256 chainId = proposal.chainId;\\n if (chainId == 0) revert ErrInvalidChainId(msg.sig, 0, block.chainid);\\n proposal.validate(_proposalExpiryDuration);\\n\\n bytes32 proposalHash = proposal.hash();\\n round_ = _createVotingRound(chainId);\\n _saveVotingRound(vote[chainId][round_], proposalHash, proposal.expiryTimestamp);\\n if (round_ != proposal.nonce) revert ErrInvalidProposalNonce(msg.sig);\\n emit ProposalCreated(chainId, round_, proposalHash, proposal, creator);\\n }\\n\\n /**\\n * @dev Casts vote for the proposal with data and returns whether the voting is done.\\n *\\n * Requirements:\\n * - The proposal nonce is equal to the round.\\n * - The vote is not finalized.\\n * - The voter has not voted for the round.\\n *\\n * Emits the `ProposalVoted` event. Emits the `ProposalApproved`, `ProposalExecuted` or `ProposalRejected` once the\\n * proposal is approved, executed or rejected.\\n *\\n */\\n function _castVote(\\n Proposal.ProposalDetail memory proposal,\\n Ballot.VoteType support,\\n uint256 minimumForVoteWeight,\\n uint256 minimumAgainstVoteWeight,\\n address voter,\\n Signature memory signature,\\n uint256 voterWeight\\n ) internal virtual returns (bool done) {\\n uint256 chainId = proposal.chainId;\\n uint256 round_ = proposal.nonce;\\n ProposalVote storage _vote = vote[chainId][round_];\\n\\n if (_tryDeleteExpiredVotingRound(_vote)) {\\n return true;\\n }\\n\\n if (round[proposal.chainId] != round_) revert ErrInvalidProposalNonce(msg.sig);\\n if (_vote.status != VoteStatus.Pending) revert ErrVoteIsFinalized();\\n if (_voted(_vote, voter)) revert ErrAlreadyVoted(voter);\\n\\n _vote.voted[voter] = true;\\n // Stores the signature if it is not empty\\n if (signature.r > 0 || signature.s > 0 || signature.v > 0) {\\n _vote.sig[voter] = signature;\\n }\\n emit ProposalVoted(_vote.hash, voter, support, voterWeight);\\n\\n uint256 _forVoteWeight;\\n uint256 _againstVoteWeight;\\n if (support == Ballot.VoteType.For) {\\n _vote.forVoteds.push(voter);\\n _forVoteWeight = _vote.forVoteWeight += voterWeight;\\n } else if (support == Ballot.VoteType.Against) {\\n _vote.againstVoteds.push(voter);\\n _againstVoteWeight = _vote.againstVoteWeight += voterWeight;\\n } else {\\n revert ErrUnsupportedVoteType(msg.sig);\\n }\\n\\n if (_forVoteWeight >= minimumForVoteWeight) {\\n done = true;\\n _vote.status = VoteStatus.Approved;\\n emit ProposalApproved(_vote.hash);\\n if (proposal.isAutoExecute()) {\\n _tryExecute(_vote, proposal);\\n }\\n } else if (_againstVoteWeight >= minimumAgainstVoteWeight) {\\n done = true;\\n _vote.status = VoteStatus.Rejected;\\n emit ProposalRejected(_vote.hash);\\n }\\n }\\n\\n /**\\n * @dev The specified executor executes the proposal on an approved proposal.\\n */\\n function _executeWithCaller(Proposal.ProposalDetail memory proposal, address caller) internal {\\n bytes32 proposalHash = proposal.hash();\\n ProposalVote storage _vote = vote[proposal.chainId][proposal.nonce];\\n\\n if (_vote.hash != proposalHash) {\\n revert ErrInvalidProposal(proposalHash, _vote.hash);\\n }\\n\\n if (_vote.status != VoteStatus.Approved) revert ErrProposalNotApproved();\\n if (caller != proposal.executor) revert ErrInvalidExecutor();\\n\\n _tryExecute(_vote, proposal);\\n }\\n\\n /**\\n * @dev When the contract is on Ronin chain, checks whether the proposal is expired and delete it if is expired.\\n *\\n * Emits the event `ProposalExpired` if the vote is expired.\\n *\\n * Note: This function assumes the vote `_proposalVote` is already created, consider verifying the vote's existence\\n * before or it will emit an unexpected event of `ProposalExpired`.\\n */\\n function _tryDeleteExpiredVotingRound(ProposalVote storage proposalVote) internal returns (bool isExpired) {\\n isExpired = _getChainType() == ChainType.RoninChain && proposalVote.status == VoteStatus.Pending && proposalVote.expiryTimestamp <= block.timestamp;\\n\\n if (isExpired) {\\n emit ProposalExpired(proposalVote.hash);\\n\\n for (uint256 _i; _i < proposalVote.forVoteds.length;) {\\n delete proposalVote.voted[proposalVote.forVoteds[_i]];\\n delete proposalVote.sig[proposalVote.forVoteds[_i]];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n for (uint256 _i; _i < proposalVote.againstVoteds.length;) {\\n delete proposalVote.voted[proposalVote.againstVoteds[_i]];\\n delete proposalVote.sig[proposalVote.againstVoteds[_i]];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n delete proposalVote.status;\\n delete proposalVote.hash;\\n delete proposalVote.againstVoteWeight;\\n delete proposalVote.forVoteWeight;\\n delete proposalVote.forVoteds;\\n delete proposalVote.againstVoteds;\\n delete proposalVote.expiryTimestamp;\\n }\\n }\\n\\n /**\\n * @dev Executes the proposal and update the vote status once the proposal is executable.\\n */\\n function _tryExecute(ProposalVote storage vote_, Proposal.ProposalDetail memory proposal) internal {\\n if (proposal.executable()) {\\n vote_.status = VoteStatus.Executed;\\n (bool[] memory _successCalls, bytes[] memory _returnDatas) = proposal.execute();\\n emit ProposalExecuted(vote_.hash, _successCalls, _returnDatas);\\n }\\n }\\n\\n /**\\n * @dev Sets the expiry duration for a new proposal.\\n */\\n function _setProposalExpiryDuration(uint256 expiryDuration) internal {\\n _proposalExpiryDuration = expiryDuration;\\n emit ProposalExpiryDurationChanged(expiryDuration);\\n }\\n\\n /**\\n * @dev Returns whether the voter casted for the proposal.\\n */\\n function _voted(ProposalVote storage vote_, address voter) internal view returns (bool) {\\n return vote_.voted[voter];\\n }\\n\\n /**\\n * @dev Returns total weight from validators.\\n */\\n function _getTotalWeight() internal view virtual returns (uint256);\\n\\n /**\\n * @dev Returns minimum vote to pass a proposal.\\n */\\n function _getMinimumVoteWeight() internal view virtual returns (uint256);\\n\\n /**\\n * @dev Returns current context is running on whether Ronin chain or on mainchain.\\n */\\n function _getChainType() internal view virtual returns (ChainType);\\n}\\n\",\"keccak256\":\"0xa8dfef02fbfbda8ec1cc681a59719d1d570fb8b652f6775b7d9af9c3e32fed26\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/GlobalCoreGovernance.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../libraries/Proposal.sol\\\";\\nimport \\\"../../libraries/GlobalProposal.sol\\\";\\nimport \\\"./CoreGovernance.sol\\\";\\n\\nabstract contract GlobalCoreGovernance is CoreGovernance {\\n using Proposal for Proposal.ProposalDetail;\\n using GlobalProposal for GlobalProposal.GlobalProposalDetail;\\n\\n mapping(GlobalProposal.TargetOption => address) internal _targetOptionsMap;\\n\\n /// @dev Emitted when a proposal is created\\n event GlobalProposalCreated(\\n uint256 indexed round,\\n bytes32 indexed proposalHash,\\n Proposal.ProposalDetail proposal,\\n bytes32 globalProposalHash,\\n GlobalProposal.GlobalProposalDetail globalProposal,\\n address creator\\n );\\n\\n /// @dev Emitted when the target options are updated\\n event TargetOptionUpdated(GlobalProposal.TargetOption indexed targetOption, address indexed addr);\\n\\n function __GlobalCoreGovernance_init(GlobalProposal.TargetOption[] memory targetOptions, address[] memory addrs) internal onlyInitializing {\\n __GlobalCoreGovernance_init_unchained(targetOptions, addrs);\\n }\\n\\n function __GlobalCoreGovernance_init_unchained(GlobalProposal.TargetOption[] memory targetOptions, address[] memory addrs) internal onlyInitializing {\\n _updateTargetOption(GlobalProposal.TargetOption.BridgeManager, address(this));\\n _updateManyTargetOption(targetOptions, addrs);\\n }\\n\\n /**\\n * @dev Proposes for a global proposal.\\n *\\n * Emits the `GlobalProposalCreated` event.\\n *\\n */\\n function _proposeGlobal(\\n uint256 expiryTimestamp,\\n GlobalProposal.TargetOption[] calldata targetOptions,\\n address executor,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n uint256[] memory gasAmounts,\\n address creator\\n ) internal virtual {\\n uint256 round_ = _createVotingRound(0);\\n GlobalProposal.GlobalProposalDetail memory globalProposal =\\n GlobalProposal.GlobalProposalDetail(round_, expiryTimestamp, executor, targetOptions, values, calldatas, gasAmounts);\\n Proposal.ProposalDetail memory proposal = globalProposal.intoProposalDetail(_resolveTargets({ targetOptions: targetOptions, strict: true }));\\n proposal.validate(_proposalExpiryDuration);\\n\\n bytes32 proposalHash = proposal.hash();\\n _saveVotingRound(vote[0][round_], proposalHash, expiryTimestamp);\\n emit GlobalProposalCreated(round_, proposalHash, proposal, globalProposal.hash(), globalProposal, creator);\\n }\\n\\n /**\\n * @dev Proposes global proposal struct.\\n *\\n * Requirements:\\n * - The proposal nonce is equal to the new round.\\n *\\n * Emits the `GlobalProposalCreated` event.\\n *\\n */\\n function _proposeGlobalStruct(\\n GlobalProposal.GlobalProposalDetail memory globalProposal,\\n address creator\\n ) internal virtual returns (Proposal.ProposalDetail memory proposal) {\\n proposal = globalProposal.intoProposalDetail(_resolveTargets({ targetOptions: globalProposal.targetOptions, strict: true }));\\n proposal.validate(_proposalExpiryDuration);\\n\\n bytes32 proposalHash = proposal.hash();\\n uint256 round_ = _createVotingRound(0);\\n _saveVotingRound(vote[0][round_], proposalHash, globalProposal.expiryTimestamp);\\n\\n if (round_ != proposal.nonce) revert ErrInvalidProposalNonce(msg.sig);\\n emit GlobalProposalCreated(round_, proposalHash, proposal, globalProposal.hash(), globalProposal, creator);\\n }\\n\\n /**\\n * @dev Returns corresponding address of target options. Return address(0) on non-existent target.\\n */\\n function resolveTargets(GlobalProposal.TargetOption[] calldata targetOptions) external view returns (address[] memory targets) {\\n return _resolveTargets({ targetOptions: targetOptions, strict: false });\\n }\\n\\n /**\\n * @dev Internal helper of {resolveTargets}.\\n *\\n * @param strict When the param is set to `true`, revert on non-existent target.\\n */\\n function _resolveTargets(GlobalProposal.TargetOption[] memory targetOptions, bool strict) internal view returns (address[] memory targets) {\\n targets = new address[](targetOptions.length);\\n\\n for (uint256 i; i < targetOptions.length; ++i) {\\n targets[i] = _targetOptionsMap[targetOptions[i]];\\n if (strict && targets[i] == address(0)) revert ErrInvalidArguments(msg.sig);\\n }\\n }\\n\\n /**\\n * @dev Updates list of `targetOptions` to `targets`.\\n *\\n * Requirement:\\n * - Only allow self-call through proposal.\\n *\\n */\\n function updateManyTargetOption(GlobalProposal.TargetOption[] memory targetOptions, address[] memory targets) external {\\n // HACK: Cannot reuse the existing library due to too deep stack\\n if (msg.sender != address(this)) revert ErrOnlySelfCall(msg.sig);\\n _updateManyTargetOption(targetOptions, targets);\\n }\\n\\n /**\\n * @dev Updates list of `targetOptions` to `targets`.\\n */\\n function _updateManyTargetOption(GlobalProposal.TargetOption[] memory targetOptions, address[] memory targets) internal {\\n for (uint256 i; i < targetOptions.length; ++i) {\\n if (targets[i] == address(this)) revert ErrInvalidArguments(msg.sig);\\n _updateTargetOption(targetOptions[i], targets[i]);\\n }\\n }\\n\\n /**\\n * @dev Updates `targetOption` to `target`.\\n *\\n * Requirement:\\n * - Emit a `TargetOptionUpdated` event.\\n */\\n function _updateTargetOption(GlobalProposal.TargetOption targetOption, address target) internal {\\n _targetOptionsMap[targetOption] = target;\\n emit TargetOptionUpdated(targetOption, target);\\n }\\n}\\n\",\"keccak256\":\"0xe5db4e1b31d9ff83e8962d17a815d39e72f5945023e6309172d875b47d5a1c3d\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/governance-proposal/CommonGovernanceProposal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../CoreGovernance.sol\\\";\\n\\nabstract contract CommonGovernanceProposal is CoreGovernance {\\n using Proposal for Proposal.ProposalDetail;\\n\\n /**\\n * @dev Casts votes by signatures.\\n *\\n * Note: This method does not verify the proposal hash with the vote hash. Please consider checking it before.\\n *\\n */\\n function _castVotesBySignatures(\\n Proposal.ProposalDetail memory _proposal,\\n Ballot.VoteType[] calldata _supports,\\n Signature[] calldata _signatures,\\n bytes32 proposalHash\\n ) internal {\\n if (!(_supports.length != 0 && _supports.length == _signatures.length)) revert ErrLengthMismatch(msg.sig);\\n\\n bytes32 _forDigest = ECDSA.toTypedDataHash(_proposalDomainSeparator(), Ballot.hash(proposalHash, Ballot.VoteType.For));\\n bytes32 _againstDigest = ECDSA.toTypedDataHash(_proposalDomainSeparator(), Ballot.hash(proposalHash, Ballot.VoteType.Against));\\n\\n uint256 _minimumForVoteWeight = _getMinimumVoteWeight();\\n uint256 _minimumAgainstVoteWeight = _getTotalWeight() - _minimumForVoteWeight + 1;\\n\\n address _lastSigner;\\n\\n for (uint256 _i; _i < _signatures.length;) {\\n Signature calldata _sig;\\n address _signer;\\n _sig = _signatures[_i];\\n\\n if (_supports[_i] == Ballot.VoteType.For) {\\n _signer = ECDSA.recover(_forDigest, _sig.v, _sig.r, _sig.s);\\n } else if (_supports[_i] == Ballot.VoteType.Against) {\\n _signer = ECDSA.recover(_againstDigest, _sig.v, _sig.r, _sig.s);\\n } else {\\n revert ErrUnsupportedVoteType(msg.sig);\\n }\\n\\n if (_lastSigner >= _signer) revert ErrInvalidOrder(msg.sig);\\n _lastSigner = _signer;\\n\\n uint256 _weight = _getWeight(_signer);\\n\\n if (_weight == 0) revert ErrInvalidSignatures(msg.sig);\\n\\n if (_castVote(_proposal, _supports[_i], _minimumForVoteWeight, _minimumAgainstVoteWeight, _signer, _sig, _weight)) {\\n return;\\n }\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n }\\n\\n /**\\n * @dev Returns the voted signatures for the proposals.\\n *\\n * Note: The signatures can be empty in case the proposal is voted on the current network.\\n *\\n */\\n function _getProposalSignatures(\\n uint256 _chainId,\\n uint256 _round\\n ) internal view returns (address[] memory _voters, Ballot.VoteType[] memory _supports, Signature[] memory _signatures) {\\n ProposalVote storage _vote = vote[_chainId][_round];\\n\\n uint256 _forLength = _vote.forVoteds.length;\\n uint256 _againstLength = _vote.againstVoteds.length;\\n uint256 _voterLength = _forLength + _againstLength;\\n\\n _supports = new Ballot.VoteType[](_voterLength);\\n _signatures = new Signature[](_voterLength);\\n _voters = new address[](_voterLength);\\n for (uint256 _i; _i < _forLength;) {\\n _supports[_i] = Ballot.VoteType.For;\\n _signatures[_i] = vote[_chainId][_round].sig[_vote.forVoteds[_i]];\\n _voters[_i] = _vote.forVoteds[_i];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n for (uint256 _i; _i < _againstLength;) {\\n _supports[_i + _forLength] = Ballot.VoteType.Against;\\n _signatures[_i + _forLength] = vote[_chainId][_round].sig[_vote.againstVoteds[_i]];\\n _voters[_i + _forLength] = _vote.againstVoteds[_i];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n }\\n\\n /**\\n * @dev Returns whether the voter `_voter` casted vote for the proposal.\\n */\\n function _proposalVoted(uint256 _chainId, uint256 _round, address _voter) internal view returns (bool) {\\n return _voted(vote[_chainId][_round], _voter);\\n }\\n\\n /**\\n * @dev Returns the weight of a governor.\\n */\\n function _getWeight(address _governor) internal view virtual returns (uint256);\\n\\n function _proposalDomainSeparator() internal view virtual returns (bytes32);\\n}\\n\",\"keccak256\":\"0xa7fbe65047096bcf4269cfe42e4529eb9a8bbbf93aff9207edd46b04e9661949\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/governance-proposal/GlobalGovernanceProposal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../../libraries/Proposal.sol\\\";\\nimport \\\"../GlobalCoreGovernance.sol\\\";\\nimport \\\"./CommonGovernanceProposal.sol\\\";\\n\\nabstract contract GlobalGovernanceProposal is GlobalCoreGovernance, CommonGovernanceProposal {\\n using Proposal for Proposal.ProposalDetail;\\n using GlobalProposal for GlobalProposal.GlobalProposalDetail;\\n\\n /**\\n * @dev Proposes and casts votes for a global proposal by signatures.\\n */\\n function _proposeGlobalProposalStructAndCastVotes(\\n GlobalProposal.GlobalProposalDetail calldata globalProposal,\\n Ballot.VoteType[] calldata supports_,\\n Signature[] calldata signatures,\\n address creator\\n ) internal returns (Proposal.ProposalDetail memory proposal) {\\n proposal = _proposeGlobalStruct(globalProposal, creator);\\n _castVotesBySignatures(proposal, supports_, signatures, globalProposal.hash());\\n }\\n\\n /**\\n * @dev Casts votes for a global proposal by signatures.\\n */\\n function _castGlobalProposalBySignatures(\\n GlobalProposal.GlobalProposalDetail calldata globalProposal,\\n Ballot.VoteType[] calldata supports_,\\n Signature[] calldata signatures\\n ) internal {\\n Proposal.ProposalDetail memory _proposal = globalProposal.intoProposalDetail(_resolveTargets({ targetOptions: globalProposal.targetOptions, strict: true }));\\n\\n bytes32 proposalHash = _proposal.hash();\\n if (vote[0][_proposal.nonce].hash != proposalHash) {\\n revert ErrInvalidProposal(proposalHash, vote[0][_proposal.nonce].hash);\\n }\\n\\n _castVotesBySignatures(_proposal, supports_, signatures, globalProposal.hash());\\n }\\n\\n /**\\n * @dev See {CommonGovernanceProposal-_getProposalSignatures}\\n */\\n function getGlobalProposalSignatures(uint256 round_)\\n external\\n view\\n returns (address[] memory voters, Ballot.VoteType[] memory supports_, Signature[] memory signatures)\\n {\\n return _getProposalSignatures(0, round_);\\n }\\n\\n /**\\n * @dev See {CommonGovernanceProposal-_proposalVoted}\\n */\\n function globalProposalVoted(uint256 round_, address voter) external view returns (bool) {\\n return _proposalVoted(0, round_, voter);\\n }\\n}\\n\",\"keccak256\":\"0x3905efdfd61681db17bcc392cf93d6571e94bf752f813eacd2504662241231c8\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/governance-proposal/GovernanceProposal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../CoreGovernance.sol\\\";\\nimport \\\"./CommonGovernanceProposal.sol\\\";\\n\\nabstract contract GovernanceProposal is CoreGovernance, CommonGovernanceProposal {\\n using Proposal for Proposal.ProposalDetail;\\n\\n /**\\n * @dev Proposes a proposal struct and casts votes by signature.\\n */\\n function _proposeProposalStructAndCastVotes(\\n Proposal.ProposalDetail calldata _proposal,\\n Ballot.VoteType[] calldata _supports,\\n Signature[] calldata _signatures,\\n address _creator\\n ) internal {\\n _proposeProposalStruct(_proposal, _creator);\\n _castVotesBySignatures(_proposal, _supports, _signatures, _proposal.hash());\\n }\\n\\n /**\\n * @dev Proposes a proposal struct and casts votes by signature.\\n */\\n function _castProposalBySignatures(\\n Proposal.ProposalDetail calldata _proposal,\\n Ballot.VoteType[] calldata _supports,\\n Signature[] calldata _signatures\\n ) internal {\\n bytes32 _proposalHash = _proposal.hash();\\n\\n if (vote[_proposal.chainId][_proposal.nonce].hash != _proposalHash) {\\n revert ErrInvalidProposal(_proposalHash, vote[_proposal.chainId][_proposal.nonce].hash);\\n }\\n\\n _castVotesBySignatures(_proposal, _supports, _signatures, _proposal.hash());\\n }\\n\\n /**\\n * @dev See `castProposalVoteForCurrentNetwork`.\\n */\\n function _castProposalVoteForCurrentNetwork(address _voter, Proposal.ProposalDetail memory _proposal, Ballot.VoteType _support) internal {\\n if (_proposal.chainId != block.chainid) revert ErrInvalidChainId(msg.sig, _proposal.chainId, block.chainid);\\n\\n bytes32 proposalHash = _proposal.hash();\\n if (vote[_proposal.chainId][_proposal.nonce].hash != proposalHash) {\\n revert ErrInvalidProposal(proposalHash, vote[_proposal.chainId][_proposal.nonce].hash);\\n }\\n\\n uint256 _minimumForVoteWeight = _getMinimumVoteWeight();\\n uint256 _minimumAgainstVoteWeight = _getTotalWeight() - _minimumForVoteWeight + 1;\\n Signature memory _emptySignature;\\n _castVote(_proposal, _support, _minimumForVoteWeight, _minimumAgainstVoteWeight, _voter, _emptySignature, _getWeight(_voter));\\n }\\n\\n /**\\n * @dev See {CommonGovernanceProposal-_getProposalSignatures}\\n */\\n function getProposalSignatures(\\n uint256 _chainId,\\n uint256 _round\\n ) external view returns (address[] memory _voters, Ballot.VoteType[] memory _supports, Signature[] memory _signatures) {\\n return _getProposalSignatures(_chainId, _round);\\n }\\n\\n /**\\n * @dev See {CommonGovernanceProposal-_proposalVoted}\\n */\\n function proposalVoted(uint256 _chainId, uint256 _round, address _voter) external view returns (bool) {\\n return _proposalVoted(_chainId, _round, _voter);\\n }\\n}\\n\",\"keccak256\":\"0x820788183e3300ede4a19be84a3d7c991ac579017f78a098b26d1bbebc411ec4\",\"license\":\"MIT\"},\"src/interfaces/IQuorum.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IQuorum {\\n /// @dev Emitted when the threshold is updated\\n event ThresholdUpdated(uint256 indexed nonce, uint256 indexed numerator, uint256 indexed denominator, uint256 previousNumerator, uint256 previousDenominator);\\n\\n /**\\n * @dev Returns the threshold.\\n */\\n function getThreshold() external view returns (uint256 _num, uint256 _denom);\\n\\n /**\\n * @dev Checks whether the `_voteWeight` passes the threshold.\\n */\\n function checkThreshold(uint256 _voteWeight) external view returns (bool);\\n\\n /**\\n * @dev Returns the minimum vote weight to pass the threshold.\\n */\\n function minimumVoteWeight() external view returns (uint256);\\n\\n /**\\n * @dev Sets the threshold.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `ThresholdUpdated` event.\\n *\\n */\\n function setThreshold(uint256 numerator, uint256 denominator) external;\\n}\\n\",\"keccak256\":\"0xc924e9480f59acc9bc8c033f05d3be9451de5cee0c224d76d4542fa5b67fa10f\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IBridgeManagerEvents } from \\\"./events/IBridgeManagerEvents.sol\\\";\\n\\n/**\\n * @title IBridgeManager\\n * @dev The interface for managing bridge operators.\\n */\\ninterface IBridgeManager is IBridgeManagerEvents {\\n /// @notice Error indicating that cannot find the querying operator\\n error ErrOperatorNotFound(address operator);\\n /// @notice Error indicating that cannot find the querying governor\\n error ErrGovernorNotFound(address governor);\\n /// @notice Error indicating that the msg.sender is not match the required governor\\n error ErrGovernorNotMatch(address required, address sender);\\n /// @notice Error indicating that the governors list will go below minimum number of required governor.\\n error ErrBelowMinRequiredGovernors();\\n /// @notice Common invalid input error\\n error ErrInvalidInput();\\n\\n /**\\n * @dev The domain separator used for computing hash digests in the contract.\\n */\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n\\n /**\\n * @dev Returns the total number of bridge operators.\\n * @return The total number of bridge operators.\\n */\\n function totalBridgeOperator() external view returns (uint256);\\n\\n /**\\n * @dev Checks if the given address is a bridge operator.\\n * @param addr The address to check.\\n * @return A boolean indicating whether the address is a bridge operator.\\n */\\n function isBridgeOperator(address addr) external view returns (bool);\\n\\n /**\\n * @dev Retrieves the full information of all registered bridge operators.\\n *\\n * This external function allows external callers to obtain the full information of all the registered bridge operators.\\n * The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.\\n *\\n * @return governors An array of addresses representing the governors of each bridge operator.\\n * @return bridgeOperators An array of addresses representing the registered bridge operators.\\n * @return weights An array of uint256 values representing the vote weights of each bridge operator.\\n *\\n * Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator.\\n *\\n * Example Usage:\\n * ```\\n * (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos();\\n * for (uint256 i = 0; i < bridgeOperators.length; i++) {\\n * // Access individual information for each bridge operator.\\n * address governor = governors[i];\\n * address bridgeOperator = bridgeOperators[i];\\n * uint256 weight = weights[i];\\n * // ... (Process or use the information as required) ...\\n * }\\n * ```\\n *\\n */\\n function getFullBridgeOperatorInfos() external view returns (address[] memory governors, address[] memory bridgeOperators, uint96[] memory weights);\\n\\n /**\\n * @dev Returns total weights of the governor list.\\n */\\n function sumGovernorsWeight(address[] calldata governors) external view returns (uint256 sum);\\n\\n /**\\n * @dev Returns total weights.\\n */\\n function getTotalWeight() external view returns (uint256);\\n\\n /**\\n * @dev Returns an array of all bridge operators.\\n * @return An array containing the addresses of all bridge operators.\\n */\\n function getBridgeOperators() external view returns (address[] memory);\\n\\n /**\\n * @dev Returns the corresponding `operator` of a `governor`.\\n */\\n function getOperatorOf(address governor) external view returns (address operator);\\n\\n /**\\n * @dev Returns the corresponding `governor` of a `operator`.\\n */\\n function getGovernorOf(address operator) external view returns (address governor);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific governor.\\n * @param governor The address of the governor to get the vote weight for.\\n * @return voteWeight The vote weight of the specified governor.\\n */\\n function getGovernorWeight(address governor) external view returns (uint96);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific bridge operator.\\n * @param bridgeOperator The address of the bridge operator to get the vote weight for.\\n * @return weight The vote weight of the specified bridge operator.\\n */\\n function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint96 weight);\\n\\n /**\\n * @dev Returns the weights of a list of governor addresses.\\n */\\n function getGovernorWeights(address[] calldata governors) external view returns (uint96[] memory weights);\\n\\n /**\\n * @dev Returns an array of all governors.\\n * @return An array containing the addresses of all governors.\\n */\\n function getGovernors() external view returns (address[] memory);\\n\\n /**\\n * @dev Adds multiple bridge operators.\\n * @param governors An array of addresses of hot/cold wallets for bridge operator to update their node address.\\n * @param bridgeOperators An array of addresses representing the bridge operators to add.\\n */\\n function addBridgeOperators(uint96[] calldata voteWeights, address[] calldata governors, address[] calldata bridgeOperators) external;\\n\\n /**\\n * @dev Removes multiple bridge operators.\\n * @param bridgeOperators An array of addresses representing the bridge operators to remove.\\n */\\n function removeBridgeOperators(address[] calldata bridgeOperators) external;\\n\\n /**\\n * @dev Self-call to update the minimum required governor.\\n * @param min The minimum number, this must not less than 3.\\n */\\n function setMinRequiredGovernor(uint min) external;\\n}\\n\",\"keccak256\":\"0xefc46318a240371031e77ef3c355e2c18432e4479145378de6782277f9b44923\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManagerCallback.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @title IBridgeManagerCallback\\n * @dev Interface for the callback functions to be implemented by the Bridge Manager contract.\\n */\\ninterface IBridgeManagerCallback is IERC165 {\\n /**\\n * @dev Handles the event when bridge operators are added.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @param addeds The corresponding boolean values indicating whether the operators were added or not.\\n * @return selector The selector of the function being called.\\n */\\n function onBridgeOperatorsAdded(address[] memory bridgeOperators, uint96[] calldata weights, bool[] memory addeds) external returns (bytes4 selector);\\n\\n /**\\n * @dev Handles the event when bridge operators are removed.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @param removeds The corresponding boolean values indicating whether the operators were removed or not.\\n * @return selector The selector of the function being called.\\n */\\n function onBridgeOperatorsRemoved(address[] memory bridgeOperators, bool[] memory removeds) external returns (bytes4 selector);\\n}\\n\",\"keccak256\":\"0x6c8ce7e2478e28c5ed5e6f5d8305a77d6d5f9125a47adfb77632940b9a0f3625\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManagerCallbackRegister.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeManagerCallbackRegister {\\n error ErrExistOneInternalCallFailed(address sender, bytes4 msgSig, bytes callData);\\n\\n event CallbackRegistered(address, bool);\\n /**\\n * @dev Emitted when the contract notifies multiple registers with statuses and return data.\\n */\\n event Notified(bytes callData, address[] registers, bool[] statuses, bytes[] returnDatas);\\n\\n /**\\n * @dev Retrieves the addresses of registered callbacks.\\n * @return registers An array containing the addresses of registered callbacks.\\n */\\n function getCallbackRegisters() external view returns (address[] memory registers);\\n\\n /**\\n * @dev Registers multiple callbacks with the bridge.\\n * @param registers The array of callback addresses to register.\\n */\\n function registerCallbacks(address[] calldata registers) external;\\n\\n /**\\n * @dev Unregisters multiple callbacks from the bridge.\\n * @param registers The array of callback addresses to unregister.\\n */\\n function unregisterCallbacks(address[] calldata registers) external;\\n}\\n\",\"keccak256\":\"0x493f7a40fc058eb6654a636316be99c2ddd9ee26ee215ff86c7107a7fa20ff97\",\"license\":\"MIT\"},\"src/interfaces/bridge/events/IBridgeManagerEvents.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeManagerEvents {\\n /**\\n * @dev Emitted when new bridge operators are added.\\n */\\n event BridgeOperatorsAdded(bool[] statuses, uint96[] voteWeights, address[] governors, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is failed to add.\\n */\\n event BridgeOperatorAddingFailed(address indexed operator);\\n\\n /**\\n * @dev Emitted when bridge operators are removed.\\n */\\n event BridgeOperatorsRemoved(bool[] statuses, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is failed to remove.\\n */\\n event BridgeOperatorRemovingFailed(address indexed operator);\\n\\n /**\\n * @dev Emitted when a bridge operator is updated.\\n */\\n event BridgeOperatorUpdated(address indexed governor, address indexed fromBridgeOperator, address indexed toBridgeOperator);\\n\\n /**\\n * @dev Emitted when the minimum number of required governors is updated.\\n */\\n event MinRequiredGovernorUpdated(uint min);\\n}\\n\",\"keccak256\":\"0x38bc3709c98a7c08fb9b6fa3e07a725903dcb0bd07de8a828bac6c3bcf7d997d\",\"license\":\"MIT\"},\"src/interfaces/collections/IHasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport { ContractType } from \\\"../../utils/ContractType.sol\\\";\\n\\ninterface IHasContracts {\\n /// @dev Error of invalid role.\\n error ErrContractTypeNotFound(ContractType contractType);\\n\\n /// @dev Emitted when a contract is updated.\\n event ContractUpdated(ContractType indexed contractType, address indexed addr);\\n\\n /**\\n * @dev Returns the address of a contract with a specific role.\\n * Throws an error if no contract is set for the specified role.\\n *\\n * @param contractType The role of the contract to retrieve.\\n * @return contract_ The address of the contract with the specified role.\\n */\\n function getContract(ContractType contractType) external view returns (address contract_);\\n\\n /**\\n * @dev Sets the address of a contract with a specific role.\\n * Emits the event {ContractUpdated}.\\n * @param contractType The role of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function setContract(ContractType contractType, address addr) external;\\n}\\n\",\"keccak256\":\"0x99d8213d857e30d367155abd15dc42730afdfbbac3a22dfb3b95ffea2083a92e\",\"license\":\"MIT\"},\"src/interfaces/consumers/ChainTypeConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface ChainTypeConsumer {\\n enum ChainType {\\n RoninChain,\\n Mainchain\\n }\\n}\\n\",\"keccak256\":\"0xe0d20e00c8d237f8e0fb881abf1ff1ef114173bcb428f06f689c581666a22db7\",\"license\":\"MIT\"},\"src/interfaces/consumers/SignatureConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface SignatureConsumer {\\n struct Signature {\\n uint8 v;\\n bytes32 r;\\n bytes32 s;\\n }\\n}\\n\",\"keccak256\":\"0xd370e350722067097dec1a5c31bda6e47e83417fa5c3288293bb910028cd136b\",\"license\":\"MIT\"},\"src/interfaces/consumers/VoteStatusConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface VoteStatusConsumer {\\n enum VoteStatus {\\n Pending,\\n Approved,\\n Executed,\\n Rejected,\\n Expired\\n }\\n}\\n\",\"keccak256\":\"0xa5045232c0c053fcf31fb3fe71942344444159c48d5f1b2063dbb06b6a1c9752\",\"license\":\"MIT\"},\"src/libraries/AddressArrayUtils.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\nlibrary AddressArrayUtils {\\n /**\\n * @dev Error thrown when a duplicated element is detected in an array.\\n * @param msgSig The function signature that invoke the error.\\n */\\n error ErrDuplicated(bytes4 msgSig);\\n\\n /**\\n * @dev Returns whether or not there's a duplicate. Runs in O(n^2).\\n * @param A Array to search\\n * @return Returns true if duplicate, false otherwise\\n */\\n function hasDuplicate(address[] memory A) internal pure returns (bool) {\\n if (A.length == 0) {\\n return false;\\n }\\n unchecked {\\n for (uint256 i = 0; i < A.length - 1; i++) {\\n for (uint256 j = i + 1; j < A.length; j++) {\\n if (A[i] == A[j]) {\\n return true;\\n }\\n }\\n }\\n }\\n return false;\\n }\\n\\n /**\\n * @dev Returns whether two arrays of addresses are equal or not.\\n */\\n function isEqual(address[] memory _this, address[] memory _other) internal pure returns (bool yes_) {\\n // Hashing two arrays and compare their hash\\n assembly {\\n let _thisHash := keccak256(add(_this, 32), mul(mload(_this), 32))\\n let _otherHash := keccak256(add(_other, 32), mul(mload(_other), 32))\\n yes_ := eq(_thisHash, _otherHash)\\n }\\n }\\n\\n /**\\n * @dev Return the concatenated array from a and b.\\n */\\n function extend(address[] memory a, address[] memory b) internal pure returns (address[] memory c) {\\n uint256 lengthA = a.length;\\n uint256 lengthB = b.length;\\n unchecked {\\n c = new address[](lengthA + lengthB);\\n }\\n uint256 i;\\n for (; i < lengthA;) {\\n c[i] = a[i];\\n unchecked {\\n ++i;\\n }\\n }\\n for (uint256 j; j < lengthB;) {\\n c[i] = b[j];\\n unchecked {\\n ++i;\\n ++j;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce5d578861167da47a965c8a0e1592b808aad6eb79ccb1873bf2e2280ddb85ee\",\"license\":\"UNLICENSED\"},\"src/libraries/Ballot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\n\\nlibrary Ballot {\\n using ECDSA for bytes32;\\n\\n enum VoteType {\\n For,\\n Against\\n }\\n\\n // keccak256(\\\"Ballot(bytes32 proposalHash,uint8 support)\\\");\\n bytes32 private constant BALLOT_TYPEHASH = 0xd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2;\\n\\n function hash(bytes32 _proposalHash, VoteType _support) internal pure returns (bytes32 digest) {\\n // return keccak256(abi.encode(BALLOT_TYPEHASH, _proposalHash, _support));\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, BALLOT_TYPEHASH)\\n mstore(add(ptr, 0x20), _proposalHash)\\n mstore(add(ptr, 0x40), _support)\\n digest := keccak256(ptr, 0x60)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xaa1e66bcd86baa6f18c7c5e9b67496535f229cbd2e2ecb4c66bcbfed2b1365de\",\"license\":\"MIT\"},\"src/libraries/GlobalProposal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./Proposal.sol\\\";\\n\\nlibrary GlobalProposal {\\n /**\\n * @dev Error thrown when attempting to interact with an unsupported target.\\n */\\n error ErrUnsupportedTarget(bytes32 proposalHash, uint256 targetNumber);\\n\\n enum TargetOption {\\n BridgeManager, // 0\\n GatewayContract, // 1\\n BridgeReward, // 2\\n BridgeSlash, // 3\\n BridgeTracking, // 4\\n PauseEnforcer // 5\\n\\n }\\n\\n struct GlobalProposalDetail {\\n // Nonce to make sure proposals are executed in order\\n uint256 nonce;\\n uint256 expiryTimestamp;\\n address executor;\\n TargetOption[] targetOptions;\\n uint256[] values;\\n bytes[] calldatas;\\n uint256[] gasAmounts;\\n }\\n\\n // keccak256(\\\"GlobalProposalDetail(uint256 nonce,uint256 expiryTimestamp,address executor,uint8[] targetOptions,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)\\\");\\n bytes32 internal constant TYPE_HASH = 0xde480f0c53a3651c08fbab1dffbc45fe574f31188827fe52cb9035da9fe57e4a;\\n\\n /**\\n * @dev Returns struct hash of the proposal.\\n */\\n function hash(GlobalProposalDetail memory self) internal pure returns (bytes32 digest_) {\\n uint256[] memory values = self.values;\\n TargetOption[] memory targets = self.targetOptions;\\n bytes32[] memory calldataHashList = new bytes32[](self.calldatas.length);\\n uint256[] memory gasAmounts = self.gasAmounts;\\n\\n for (uint256 i; i < calldataHashList.length;) {\\n calldataHashList[i] = keccak256(self.calldatas[i]);\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n /*\\n * return\\n * keccak256(\\n * abi.encode(\\n * TYPE_HASH,\\n * proposal.nonce,\\n * proposal.expiryTimestamp,\\n * proposal.executor,\\n * targetsHash,\\n * valuesHash,\\n * calldatasHash,\\n * gasAmountsHash\\n * )\\n * );\\n */\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, TYPE_HASH)\\n mstore(add(ptr, 0x20), mload(self)) // proposal.nonce\\n mstore(add(ptr, 0x40), mload(add(self, 0x20))) // proposal.expiryTimestamp\\n mstore(add(ptr, 0x60), mload(add(self, 0x40))) // proposal.executor\\n\\n let arrayHashed\\n arrayHashed := keccak256(add(targets, 32), mul(mload(targets), 32)) // targetsHash\\n mstore(add(ptr, 0x80), arrayHashed)\\n arrayHashed := keccak256(add(values, 32), mul(mload(values), 32)) // valuesHash\\n mstore(add(ptr, 0xa0), arrayHashed)\\n arrayHashed := keccak256(add(calldataHashList, 32), mul(mload(calldataHashList), 32)) // calldatasHash\\n mstore(add(ptr, 0xc0), arrayHashed)\\n arrayHashed := keccak256(add(gasAmounts, 32), mul(mload(gasAmounts), 32)) // gasAmountsHash\\n mstore(add(ptr, 0xe0), arrayHashed)\\n digest_ := keccak256(ptr, 0x100)\\n }\\n }\\n\\n /**\\n * @dev Converts into the normal proposal.\\n */\\n function intoProposalDetail(GlobalProposalDetail memory self, address[] memory targets) internal pure returns (Proposal.ProposalDetail memory detail_) {\\n detail_.nonce = self.nonce;\\n detail_.chainId = 0;\\n detail_.expiryTimestamp = self.expiryTimestamp;\\n detail_.executor = self.executor;\\n\\n detail_.targets = new address[](self.targetOptions.length);\\n detail_.values = self.values;\\n detail_.calldatas = self.calldatas;\\n detail_.gasAmounts = self.gasAmounts;\\n\\n for (uint256 i; i < self.targetOptions.length; ++i) {\\n detail_.targets[i] = targets[i];\\n }\\n }\\n}\\n\",\"keccak256\":\"0x76d362e1a4c8ef6d1aac45aae0f443a218cb256176ad5fbe952b2ff7c2132e6e\",\"license\":\"MIT\"},\"src/libraries/Proposal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ErrInvalidChainId, ErrLengthMismatch } from \\\"../utils/CommonErrors.sol\\\";\\n\\nlibrary Proposal {\\n /**\\n * @dev Error thrown when there is insufficient gas to execute a function.\\n */\\n error ErrInsufficientGas(bytes32 proposalHash);\\n\\n /**\\n * @dev Error thrown when an invalid expiry timestamp is provided.\\n */\\n error ErrInvalidExpiryTimestamp();\\n\\n /**\\n * @dev Error thrown when the proposal reverts when execute the internal call no. `callIndex` with revert message is `revertMsg`.\\n */\\n error ErrLooseProposalInternallyRevert(uint256 callIndex, bytes revertMsg);\\n\\n struct ProposalDetail {\\n // Nonce to make sure proposals are executed in order\\n uint256 nonce;\\n // Value 0: all chain should run this proposal\\n // Other values: only specific chain has to execute\\n uint256 chainId;\\n uint256 expiryTimestamp;\\n // The address that execute the proposal after the proposal passes.\\n // Leave this address as address(0) to auto-execute by the last valid vote.\\n address executor;\\n address[] targets;\\n uint256[] values;\\n bytes[] calldatas;\\n uint256[] gasAmounts;\\n }\\n\\n // keccak256(\\\"ProposalDetail(uint256 nonce,uint256 chainId,uint256 expiryTimestamp,address executor,address[] targets,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)\\\");\\n bytes32 internal constant TYPE_HASH = 0x1b59eeec7c321899dc1e7a5b3d876c9a445dffc6d2f96ba842d7489908fdee12;\\n\\n /**\\n * @dev Validates the proposal.\\n */\\n function validate(ProposalDetail memory proposal, uint256 maxExpiryDuration) internal view {\\n if (\\n !(\\n proposal.targets.length > 0 && proposal.targets.length == proposal.values.length && proposal.targets.length == proposal.calldatas.length\\n && proposal.targets.length == proposal.gasAmounts.length\\n )\\n ) {\\n revert ErrLengthMismatch(msg.sig);\\n }\\n\\n if (proposal.expiryTimestamp > block.timestamp + maxExpiryDuration) {\\n revert ErrInvalidExpiryTimestamp();\\n }\\n }\\n\\n /**\\n * @dev Returns struct hash of the proposal.\\n */\\n function hash(ProposalDetail memory proposal) internal pure returns (bytes32 digest_) {\\n uint256[] memory values = proposal.values;\\n address[] memory targets = proposal.targets;\\n bytes32[] memory calldataHashList = new bytes32[](proposal.calldatas.length);\\n uint256[] memory gasAmounts = proposal.gasAmounts;\\n\\n for (uint256 i; i < calldataHashList.length; ++i) {\\n calldataHashList[i] = keccak256(proposal.calldatas[i]);\\n }\\n\\n // return\\n // keccak256(\\n // abi.encode(\\n // TYPE_HASH,\\n // proposal.nonce,\\n // proposal.chainId,\\n // proposal.expiryTimestamp\\n // proposal.executor\\n // targetsHash,\\n // valuesHash,\\n // calldatasHash,\\n // gasAmountsHash\\n // )\\n // );\\n // /\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, TYPE_HASH)\\n mstore(add(ptr, 0x20), mload(proposal)) // proposal.nonce\\n mstore(add(ptr, 0x40), mload(add(proposal, 0x20))) // proposal.chainId\\n mstore(add(ptr, 0x60), mload(add(proposal, 0x40))) // proposal.expiryTimestamp\\n mstore(add(ptr, 0x80), mload(add(proposal, 0x60))) // proposal.executor\\n\\n let arrayHashed\\n arrayHashed := keccak256(add(targets, 32), mul(mload(targets), 32)) // targetsHash\\n mstore(add(ptr, 0xa0), arrayHashed)\\n arrayHashed := keccak256(add(values, 32), mul(mload(values), 32)) // valuesHash\\n mstore(add(ptr, 0xc0), arrayHashed)\\n arrayHashed := keccak256(add(calldataHashList, 32), mul(mload(calldataHashList), 32)) // calldatasHash\\n mstore(add(ptr, 0xe0), arrayHashed)\\n arrayHashed := keccak256(add(gasAmounts, 32), mul(mload(gasAmounts), 32)) // gasAmountsHash\\n mstore(add(ptr, 0x100), arrayHashed)\\n digest_ := keccak256(ptr, 0x120)\\n }\\n }\\n\\n /**\\n * @dev Returns whether the proposal is auto-executed on the last valid vote.\\n */\\n function isAutoExecute(ProposalDetail memory proposal) internal pure returns (bool) {\\n return proposal.executor == address(0);\\n }\\n\\n /**\\n * @dev Returns whether the proposal is executable for the current chain.\\n *\\n * @notice Does not check whether the call result is successful or not. Please use `execute` instead.\\n *\\n */\\n function executable(ProposalDetail memory proposal) internal view returns (bool result) {\\n return proposal.chainId == 0 || proposal.chainId == block.chainid;\\n }\\n\\n /**\\n * @dev Executes the proposal.\\n */\\n function execute(ProposalDetail memory proposal) internal returns (bool[] memory successCalls, bytes[] memory returnDatas) {\\n if (!executable(proposal)) revert ErrInvalidChainId(msg.sig, proposal.chainId, block.chainid);\\n\\n successCalls = new bool[](proposal.targets.length);\\n returnDatas = new bytes[](proposal.targets.length);\\n for (uint256 i = 0; i < proposal.targets.length; ++i) {\\n if (gasleft() <= proposal.gasAmounts[i]) revert ErrInsufficientGas(hash(proposal));\\n\\n (successCalls[i], returnDatas[i]) = proposal.targets[i].call{ value: proposal.values[i], gas: proposal.gasAmounts[i] }(proposal.calldatas[i]);\\n\\n if (!successCalls[i]) {\\n revert ErrLooseProposalInternallyRevert(i, returnDatas[i]);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0ef21852c8a90ebf3ec4d4cc11acd9b6aa1fd932fb6858b2f6cdd3722fab6cb1\",\"license\":\"MIT\"},\"src/ronin/gateway/RoninBridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ContractType, RoleAccess, ErrUnauthorized, BridgeManager } from \\\"../../extensions/bridge-operator-governance/BridgeManager.sol\\\";\\nimport {\\n Ballot,\\n GlobalProposal,\\n Proposal,\\n CommonGovernanceProposal,\\n GovernanceProposal\\n} from \\\"../../extensions/sequential-governance/governance-proposal/GovernanceProposal.sol\\\";\\nimport {\\n CoreGovernance,\\n GlobalCoreGovernance,\\n GlobalGovernanceProposal\\n} from \\\"../../extensions/sequential-governance/governance-proposal/GlobalGovernanceProposal.sol\\\";\\nimport { VoteStatusConsumer } from \\\"../../interfaces/consumers/VoteStatusConsumer.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\n\\ncontract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernanceProposal {\\n using Proposal for Proposal.ProposalDetail;\\n using GlobalProposal for GlobalProposal.GlobalProposalDetail;\\n\\n /**\\n * CURRENT NETWORK\\n */\\n\\n /**\\n * @dev See `CoreGovernance-_proposeProposal`.\\n *\\n * Requirements:\\n * - The method caller is governor.\\n *\\n */\\n function propose(\\n uint256 chainId,\\n uint256 expiryTimestamp,\\n address executor,\\n address[] calldata targets,\\n uint256[] calldata values,\\n bytes[] calldata calldatas,\\n uint256[] calldata gasAmounts\\n ) external onlyGovernor {\\n _proposeProposalStruct(\\n Proposal.ProposalDetail({\\n nonce: _createVotingRound(chainId),\\n chainId: chainId,\\n expiryTimestamp: expiryTimestamp,\\n executor: executor,\\n targets: targets,\\n values: values,\\n calldatas: calldatas,\\n gasAmounts: gasAmounts\\n }),\\n msg.sender\\n );\\n }\\n\\n /**\\n * @dev See `GovernanceProposal-_proposeProposalStructAndCastVotes`.\\n *\\n * Requirements:\\n * - The method caller is governor.\\n * - The proposal is for the current network.\\n *\\n */\\n function proposeProposalStructAndCastVotes(\\n Proposal.ProposalDetail calldata _proposal,\\n Ballot.VoteType[] calldata _supports,\\n Signature[] calldata _signatures\\n ) external onlyGovernor {\\n _proposeProposalStructAndCastVotes(_proposal, _supports, _signatures, msg.sender);\\n }\\n\\n /**\\n * @dev Proposes and casts vote for a proposal on the current network.\\n *\\n * Requirements:\\n * - The method caller is governor.\\n * - The proposal is for the current network.\\n *\\n */\\n function proposeProposalForCurrentNetwork(\\n uint256 expiryTimestamp,\\n address executor,\\n address[] calldata targets,\\n uint256[] calldata values,\\n bytes[] calldata calldatas,\\n uint256[] calldata gasAmounts,\\n Ballot.VoteType support\\n ) external onlyGovernor {\\n Proposal.ProposalDetail memory proposal = Proposal.ProposalDetail({\\n nonce: _createVotingRound(block.chainid),\\n chainId: block.chainid,\\n expiryTimestamp: expiryTimestamp,\\n executor: executor,\\n targets: targets,\\n values: values,\\n calldatas: calldatas,\\n gasAmounts: gasAmounts\\n });\\n _proposeProposalStruct(proposal, msg.sender);\\n _castProposalVoteForCurrentNetwork(msg.sender, proposal, support);\\n }\\n\\n /**\\n * @dev Casts vote for a proposal on the current network.\\n *\\n * Requirements:\\n * - The method caller is governor.\\n *\\n */\\n function castProposalVoteForCurrentNetwork(Proposal.ProposalDetail calldata proposal, Ballot.VoteType support) external onlyGovernor {\\n _castProposalVoteForCurrentNetwork(msg.sender, proposal, support);\\n }\\n\\n /**\\n * @dev See `GovernanceProposal-_castProposalBySignatures`.\\n */\\n function castProposalBySignatures(Proposal.ProposalDetail calldata proposal, Ballot.VoteType[] calldata supports_, Signature[] calldata signatures) external {\\n _castProposalBySignatures(proposal, supports_, signatures);\\n }\\n\\n /**\\n * GLOBAL NETWORK\\n */\\n\\n /**\\n * @dev See `CoreGovernance-_proposeGlobal`.\\n *\\n * Requirements:\\n * - The method caller is governor.\\n *\\n */\\n function proposeGlobal(\\n uint256 expiryTimestamp,\\n address executor,\\n GlobalProposal.TargetOption[] calldata targetOptions,\\n uint256[] calldata values,\\n bytes[] calldata calldatas,\\n uint256[] calldata gasAmounts\\n ) external onlyGovernor {\\n _proposeGlobal({\\n expiryTimestamp: expiryTimestamp,\\n executor: executor,\\n targetOptions: targetOptions,\\n values: values,\\n calldatas: calldatas,\\n gasAmounts: gasAmounts,\\n creator: msg.sender\\n });\\n }\\n\\n /**\\n * @dev See `GovernanceProposal-_proposeGlobalProposalStructAndCastVotes`.\\n *\\n * Requirements:\\n * - The method caller is governor.\\n *\\n */\\n function proposeGlobalProposalStructAndCastVotes(\\n GlobalProposal.GlobalProposalDetail calldata globalProposal,\\n Ballot.VoteType[] calldata supports_,\\n Signature[] calldata signatures\\n ) external onlyGovernor {\\n _proposeGlobalProposalStructAndCastVotes({ globalProposal: globalProposal, supports_: supports_, signatures: signatures, creator: msg.sender });\\n }\\n\\n /**\\n * @dev See `GovernanceProposal-_castGlobalProposalBySignatures`.\\n */\\n function castGlobalProposalBySignatures(\\n GlobalProposal.GlobalProposalDetail calldata globalProposal,\\n Ballot.VoteType[] calldata supports_,\\n Signature[] calldata signatures\\n ) external {\\n _castGlobalProposalBySignatures({ globalProposal: globalProposal, supports_: supports_, signatures: signatures });\\n }\\n\\n /**\\n * COMMON METHODS\\n */\\n\\n /**\\n * @dev See {CoreGovernance-_executeWithCaller}.\\n */\\n function execute(Proposal.ProposalDetail calldata proposal) external {\\n _executeWithCaller(proposal, msg.sender);\\n }\\n\\n /**\\n * @dev See {GlobalCoreGovernance-_executeWithCaller}.\\n */\\n function executeGlobal(GlobalProposal.GlobalProposalDetail calldata globalProposal) external {\\n _executeWithCaller({\\n proposal: globalProposal.intoProposalDetail(_resolveTargets({ targetOptions: globalProposal.targetOptions, strict: true })),\\n caller: msg.sender\\n });\\n }\\n\\n /**\\n * @dev Deletes the expired proposal by its chainId and nonce, without creating a new proposal.\\n *\\n * Requirements:\\n * - The proposal is already created.\\n *\\n */\\n function deleteExpired(uint256 _chainId, uint256 _round) external {\\n ProposalVote storage _vote = vote[_chainId][_round];\\n if (_vote.hash == 0) revert ErrQueryForEmptyVote();\\n\\n _tryDeleteExpiredVotingRound(_vote);\\n }\\n\\n /**\\n * @dev Returns the expiry duration for a new proposal.\\n */\\n function getProposalExpiryDuration() external view returns (uint256) {\\n return _proposalExpiryDuration;\\n }\\n\\n /**\\n * @dev Internal function to get the chain type of the contract.\\n * @return The chain type, indicating the type of the chain the contract operates on (e.g., RoninChain).\\n */\\n function _getChainType() internal pure override returns (ChainType) {\\n return ChainType.RoninChain;\\n }\\n\\n /**\\n * @dev Internal function to get the total weights of all governors.\\n * @return The total weights of all governors combined.\\n */\\n function _getTotalWeight() internal view virtual override returns (uint256) {\\n return getTotalWeight();\\n }\\n\\n /**\\n * @dev Internal function to get the minimum vote weight required for governance actions.\\n * @return The minimum vote weight required for governance actions.\\n */\\n function _getMinimumVoteWeight() internal view virtual override returns (uint256) {\\n return minimumVoteWeight();\\n }\\n\\n /**\\n * @dev Internal function to get the vote weight of a specific governor.\\n * @param _governor The address of the governor to get the vote weight for.\\n * @return The vote weight of the specified governor.\\n */\\n function _getWeight(address _governor) internal view virtual override returns (uint256) {\\n return _getGovernorWeight(_governor);\\n }\\n\\n function _proposalDomainSeparator() internal view override returns (bytes32) {\\n return DOMAIN_SEPARATOR;\\n }\\n}\\n\",\"keccak256\":\"0x012d5f995b9225da312c6175f03c6f25c6a70168428106bee495108f0ee8ec99\",\"license\":\"MIT\"},\"src/types/Types.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.17;\\n\\nimport { LibTUint256Slot } from \\\"./operations/LibTUint256Slot.sol\\\";\\n\\ntype TUint256Slot is bytes32;\\n\\nusing {\\n LibTUint256Slot.add,\\n LibTUint256Slot.sub,\\n LibTUint256Slot.mul,\\n LibTUint256Slot.div,\\n LibTUint256Slot.load,\\n LibTUint256Slot.store,\\n LibTUint256Slot.addAssign,\\n LibTUint256Slot.subAssign,\\n LibTUint256Slot.preDecrement,\\n LibTUint256Slot.postDecrement,\\n LibTUint256Slot.preIncrement,\\n LibTUint256Slot.postIncrement\\n} for TUint256Slot global;\\n\",\"keccak256\":\"0x20ab58f1c9ae4936f9dd9891d064301d78ef508c1dd2ce0c19a7b5b81d530e36\",\"license\":\"MIT\"},\"src/types/operations/LibTUint256Slot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.17;\\n\\nimport { TUint256Slot } from \\\"../Types.sol\\\";\\n\\n/**\\n * @title LibTUint256Slot\\n * @dev Library for handling unsigned 256-bit integers.\\n */\\nlibrary LibTUint256Slot {\\n /// @dev value is equal to bytes4(keccak256(\\\"Panic(uint256)\\\"))\\n /// @dev see: https://github.com/foundry-rs/forge-std/blob/master/src/StdError.sol\\n uint256 private constant PANIC_ERROR_SIGNATURE = 0x4e487b71;\\n /// @dev error code for {Arithmetic over/underflow} error\\n uint256 private constant ARITHMETIC_ERROR_CODE = 0x11;\\n /// @dev error code for {Division or modulo by 0} error\\n uint256 private constant DIVISION_ERROR_CODE = 0x12;\\n\\n /**\\n * @dev Loads the value of the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @return val The loaded value.\\n */\\n function load(TUint256Slot self) internal view returns (uint256 val) {\\n assembly {\\n val := sload(self)\\n }\\n }\\n\\n /**\\n * @dev Stores a value into the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @param other The value to be stored.\\n */\\n function store(TUint256Slot self, uint256 other) internal {\\n assembly {\\n sstore(self, other)\\n }\\n }\\n\\n /**\\n * @dev Multiplies the TUint256Slot variable by a given value.\\n * @param self The TUint256Slot variable.\\n * @param other The value to multiply by.\\n * @return res The resulting value after multiplication.\\n */\\n function mul(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n if iszero(iszero(storedVal)) {\\n res := mul(storedVal, other)\\n\\n // Overflow check\\n if iszero(eq(other, div(res, storedVal))) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, ARITHMETIC_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n }\\n }\\n }\\n\\n /**\\n * @dev Divides the TUint256Slot variable by a given value.\\n * @param self The TUint256Slot variable.\\n * @param other The value to divide by.\\n * @return res The resulting value after division.\\n */\\n function div(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n // revert if divide by zero\\n if iszero(other) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, DIVISION_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n res := div(storedVal, other)\\n }\\n }\\n\\n /**\\n * @dev Subtracts a given value from the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @param other The value to subtract.\\n * @return res The resulting value after subtraction.\\n */\\n function sub(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n\\n // Underflow check\\n if lt(storedVal, other) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, ARITHMETIC_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n\\n res := sub(storedVal, other)\\n }\\n }\\n\\n /**\\n * @dev Adds a given value to the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @param other The value to add.\\n * @return res The resulting value after addition.\\n */\\n function add(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n res := add(storedVal, other)\\n\\n // Overflow check\\n if lt(res, other) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, ARITHMETIC_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n }\\n }\\n\\n /**\\n * @dev Increments the TUint256Slot variable by 1 and returns the new value.\\n * @param self The TUint256Slot variable.\\n * @return res The resulting value after incrementing.\\n */\\n function preIncrement(TUint256Slot self) internal returns (uint256 res) {\\n res = addAssign(self, 1);\\n }\\n\\n /**\\n * @dev Increments the TUint256Slot variable by 1 and returns the original value.\\n * @param self The TUint256Slot variable.\\n * @return res The original value before incrementing.\\n */\\n function postIncrement(TUint256Slot self) internal returns (uint256 res) {\\n res = load(self);\\n store(self, res + 1);\\n }\\n\\n /**\\n * @dev Decrements the TUint256Slot variable by 1 and returns the new value.\\n * @param self The TUint256Slot variable.\\n * @return res The resulting value after decrementing.\\n */\\n function preDecrement(TUint256Slot self) internal returns (uint256 res) {\\n res = subAssign(self, 1);\\n }\\n\\n /**\\n * @dev Decrements the TUint256Slot variable by 1 and returns the new value.\\n * @param self The TUint256Slot variable.\\n * @return res The resulting value before decrementing.\\n */\\n function postDecrement(TUint256Slot self) internal returns (uint256 res) {\\n res = load(self);\\n store(self, res - 1);\\n }\\n\\n /**\\n * @dev Adds a given value to the TUint256Slot variable and stores the result.\\n * @param self The TUint256Slot variable.\\n * @param other The value to add.\\n * @return res The resulting value after addition and storage.\\n */\\n function addAssign(TUint256Slot self, uint256 other) internal returns (uint256 res) {\\n store(self, res = add(self, other));\\n }\\n\\n /**\\n * @dev Subtracts a given value from the TUint256Slot variable and stores the result.\\n * @param self The TUint256Slot variable.\\n * @param other The value to subtract.\\n * @return res The resulting value after subtraction and storage.\\n */\\n function subAssign(TUint256Slot self, uint256 other) internal returns (uint256 res) {\\n store(self, res = sub(self, other));\\n }\\n}\\n\",\"keccak256\":\"0xe10c089459baf373494d76b00e582d49f6e43c500ab0f1657d53afc2fa472cbb\",\"license\":\"MIT\"},\"src/utils/CommonErrors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ContractType } from \\\"./ContractType.sol\\\";\\nimport { RoleAccess } from \\\"./RoleAccess.sol\\\";\\n\\nerror ErrSyncTooFarPeriod(uint256 period, uint256 latestRewardedPeriod);\\n/**\\n * @dev Error thrown when an address is expected to be an already created externally owned account (EOA).\\n * This error indicates that the provided address is invalid for certain contract operations that require already created EOA.\\n */\\nerror ErrAddressIsNotCreatedEOA(address addr, bytes32 codehash);\\n/**\\n * @dev Error raised when a bridge operator update operation fails.\\n * @param bridgeOperator The address of the bridge operator that failed to update.\\n */\\nerror ErrBridgeOperatorUpdateFailed(address bridgeOperator);\\n/**\\n * @dev Error thrown when attempting to add a bridge operator that already exists in the contract.\\n * This error indicates that the provided bridge operator address is already registered as a bridge operator in the contract.\\n */\\nerror ErrBridgeOperatorAlreadyExisted(address bridgeOperator);\\n/**\\n * @dev The error indicating an unsupported interface.\\n * @param interfaceId The bytes4 interface identifier that is not supported.\\n * @param addr The address where the unsupported interface was encountered.\\n */\\nerror ErrUnsupportedInterface(bytes4 interfaceId, address addr);\\n/**\\n * @dev Error thrown when the return data from a callback function is invalid.\\n * @param callbackFnSig The signature of the callback function that returned invalid data.\\n * @param register The address of the register where the callback function was invoked.\\n * @param returnData The invalid return data received from the callback function.\\n */\\nerror ErrInvalidReturnData(bytes4 callbackFnSig, address register, bytes returnData);\\n/**\\n * @dev Error of set to non-contract.\\n */\\nerror ErrZeroCodeContract(address addr);\\n/**\\n * @dev Error indicating that arguments are invalid.\\n */\\nerror ErrInvalidArguments(bytes4 msgSig);\\n/**\\n * @dev Error indicating that given address is null when it should not.\\n */\\nerror ErrZeroAddress(bytes4 msgSig);\\n/**\\n * @dev Error indicating that the provided threshold is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that the invalid threshold applies to.\\n */\\nerror ErrInvalidThreshold(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a function can only be called by the contract itself.\\n * @param msgSig The function signature (bytes4) that can only be called by the contract itself.\\n */\\nerror ErrOnlySelfCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n * @param expectedRole The role required to perform the function.\\n */\\nerror ErrUnauthorized(bytes4 msgSig, RoleAccess expectedRole);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n */\\nerror ErrUnauthorizedCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4).\\n * @param expectedContractType The contract type required to perform the function.\\n * @param actual The actual address that called to the function.\\n */\\nerror ErrUnexpectedInternalCall(bytes4 msgSig, ContractType expectedContractType, address actual);\\n\\n/**\\n * @dev Error indicating that an array is empty when it should contain elements.\\n */\\nerror ErrEmptyArray();\\n\\n/**\\n * @dev Error indicating a mismatch in the length of input parameters or arrays for a specific function.\\n * @param msgSig The function signature (bytes4) that has a length mismatch.\\n */\\nerror ErrLengthMismatch(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a proxy call to an external contract has failed.\\n * @param msgSig The function signature (bytes4) of the proxy call that failed.\\n * @param extCallSig The function signature (bytes4) of the external contract call that failed.\\n */\\nerror ErrProxyCallFailed(bytes4 msgSig, bytes4 extCallSig);\\n\\n/**\\n * @dev Error indicating that a function tried to call a precompiled contract that is not allowed.\\n * @param msgSig The function signature (bytes4) that attempted to call a precompiled contract.\\n */\\nerror ErrCallPrecompiled(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a native token transfer has failed.\\n * @param msgSig The function signature (bytes4) of the token transfer that failed.\\n */\\nerror ErrNativeTransferFailed(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that an order is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid order.\\n */\\nerror ErrInvalidOrder(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the chain ID is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid chain ID.\\n * @param actual Current chain ID that executing function.\\n * @param expected Expected chain ID required for the tx to success.\\n */\\nerror ErrInvalidChainId(bytes4 msgSig, uint256 actual, uint256 expected);\\n\\n/**\\n * @dev Error indicating that a vote type is not supported.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an unsupported vote type.\\n */\\nerror ErrUnsupportedVoteType(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the proposal nonce is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid proposal nonce.\\n */\\nerror ErrInvalidProposalNonce(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a voter has already voted.\\n * @param voter The address of the voter who has already voted.\\n */\\nerror ErrAlreadyVoted(address voter);\\n\\n/**\\n * @dev Error indicating that a signature is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid signature.\\n */\\nerror ErrInvalidSignatures(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a relay call has failed.\\n * @param msgSig The function signature (bytes4) of the relay call that failed.\\n */\\nerror ErrRelayFailed(bytes4 msgSig);\\n/**\\n * @dev Error indicating that a vote weight is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid vote weight.\\n */\\nerror ErrInvalidVoteWeight(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a query was made for an outdated bridge operator set.\\n */\\nerror ErrQueryForOutdatedBridgeOperatorSet();\\n\\n/**\\n * @dev Error indicating that a request is invalid.\\n */\\nerror ErrInvalidRequest();\\n\\n/**\\n * @dev Error indicating that a token standard is invalid.\\n */\\nerror ErrInvalidTokenStandard();\\n\\n/**\\n * @dev Error indicating that a token is not supported.\\n */\\nerror ErrUnsupportedToken();\\n\\n/**\\n * @dev Error indicating that a receipt kind is invalid.\\n */\\nerror ErrInvalidReceiptKind();\\n\\n/**\\n * @dev Error indicating that a receipt is invalid.\\n */\\nerror ErrInvalidReceipt();\\n\\n/**\\n * @dev Error indicating that an address is not payable.\\n */\\nerror ErrNonpayableAddress(address);\\n\\n/**\\n * @dev Error indicating that the period is already processed, i.e. scattered reward.\\n */\\nerror ErrPeriodAlreadyProcessed(uint256 requestingPeriod, uint256 latestPeriod);\\n\\n/**\\n * @dev Error thrown when an invalid vote hash is provided.\\n */\\nerror ErrInvalidVoteHash();\\n\\n/**\\n * @dev Error thrown when querying for an empty vote.\\n */\\nerror ErrQueryForEmptyVote();\\n\\n/**\\n * @dev Error thrown when querying for an expired vote.\\n */\\nerror ErrQueryForExpiredVote();\\n\\n/**\\n * @dev Error thrown when querying for a non-existent vote.\\n */\\nerror ErrQueryForNonExistentVote();\\n\\n/**\\n * @dev Error indicating that the method is only called once per block.\\n */\\nerror ErrOncePerBlock();\\n\\n/**\\n * @dev Error of method caller must be coinbase\\n */\\nerror ErrCallerMustBeCoinbase();\\n\\n/**\\n * @dev Error thrown when an invalid proposal is encountered.\\n * @param actual The actual value of the proposal.\\n * @param expected The expected value of the proposal.\\n */\\nerror ErrInvalidProposal(bytes32 actual, bytes32 expected);\\n\\n/**\\n * @dev Error of proposal is not approved for executing.\\n */\\nerror ErrProposalNotApproved();\\n\\n/**\\n * @dev Error of the caller is not the specified executor.\\n */\\nerror ErrInvalidExecutor();\\n\\n/**\\n * @dev Error of the `caller` to relay is not the specified `executor`.\\n */\\nerror ErrNonExecutorCannotRelay(address executor, address caller);\\n\",\"keccak256\":\"0x0d9e2fd98f6b704273faad707ed9eadbd4c79551ee3f902bff5b29213a204679\",\"license\":\"MIT\"},\"src/utils/ContractType.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum ContractType {\\n UNKNOWN, // 0\\n PAUSE_ENFORCER, // 1\\n BRIDGE, // 2\\n BRIDGE_TRACKING, // 3\\n GOVERNANCE_ADMIN, // 4\\n MAINTENANCE, // 5\\n SLASH_INDICATOR, // 6\\n STAKING_VESTING, // 7\\n VALIDATOR, // 8\\n STAKING, // 9\\n RONIN_TRUSTED_ORGANIZATION, // 10\\n BRIDGE_MANAGER, // 11\\n BRIDGE_SLASH, // 12\\n BRIDGE_REWARD, // 13\\n FAST_FINALITY_TRACKING, // 14\\n PROFILE // 15\\n\\n}\\n\",\"keccak256\":\"0xec088aa939cd885dbe84e944942d7ea674e1fff8802c1f2ae5d8e84e4578357d\",\"license\":\"MIT\"},\"src/utils/IdentityGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { AddressArrayUtils } from \\\"../libraries/AddressArrayUtils.sol\\\";\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport { TransparentUpgradeableProxyV2 } from \\\"../extensions/TransparentUpgradeableProxyV2.sol\\\";\\nimport { ErrAddressIsNotCreatedEOA, ErrZeroAddress, ErrOnlySelfCall, ErrZeroCodeContract, ErrUnsupportedInterface } from \\\"./CommonErrors.sol\\\";\\n\\nabstract contract IdentityGuard {\\n using AddressArrayUtils for address[];\\n\\n /// @dev value is equal to keccak256(abi.encode())\\n /// @dev see: https://eips.ethereum.org/EIPS/eip-1052\\n bytes32 internal constant CREATED_ACCOUNT_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\\n\\n /**\\n * @dev Modifier to restrict functions to only be called by this contract.\\n * @dev Reverts if the caller is not this contract.\\n */\\n modifier onlySelfCall() virtual {\\n _requireSelfCall();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to ensure that the elements in the `arr` array are non-duplicates.\\n * It calls the internal `_checkDuplicate` function to perform the duplicate check.\\n *\\n * Requirements:\\n * - The elements in the `arr` array must not contain any duplicates.\\n */\\n modifier nonDuplicate(address[] memory arr) virtual {\\n _requireNonDuplicate(arr);\\n _;\\n }\\n\\n /**\\n * @dev Internal method to check the method caller.\\n * @dev Reverts if the method caller is not this contract.\\n */\\n function _requireSelfCall() internal view virtual {\\n if (msg.sender != address(this)) revert ErrOnlySelfCall(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to check if a contract address has code.\\n * @param addr The address of the contract to check.\\n * @dev Throws an error if the contract address has no code.\\n */\\n function _requireHasCode(address addr) internal view {\\n if (addr.code.length == 0) revert ErrZeroCodeContract(addr);\\n }\\n\\n /**\\n * @dev Checks if an address is zero and reverts if it is.\\n * @param addr The address to check.\\n */\\n function _requireNonZeroAddress(address addr) internal pure {\\n if (addr == address(0)) revert ErrZeroAddress(msg.sig);\\n }\\n\\n /**\\n * @dev Check if arr is empty and revert if it is.\\n * Checks if an array contains any duplicate addresses and reverts if duplicates are found.\\n * @param arr The array of addresses to check.\\n */\\n function _requireNonDuplicate(address[] memory arr) internal pure {\\n if (arr.hasDuplicate()) revert AddressArrayUtils.ErrDuplicated(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to require that the provided address is a created externally owned account (EOA).\\n * This internal function is used to ensure that the provided address is a valid externally owned account (EOA).\\n * It checks the codehash of the address against a predefined constant to confirm that the address is a created EOA.\\n * @notice This method only works with non-state EOA accounts\\n */\\n function _requireCreatedEOA(address addr) internal view {\\n _requireNonZeroAddress(addr);\\n bytes32 codehash = addr.codehash;\\n if (codehash != CREATED_ACCOUNT_HASH) revert ErrAddressIsNotCreatedEOA(addr, codehash);\\n }\\n\\n /**\\n * @dev Internal function to require that the specified contract supports the given interface. This method handle in\\n * both case that the callee is either or not the proxy admin of the caller. If the contract does not support the\\n * interface `interfaceId` or EIP165, a revert with the corresponding error message is triggered.\\n *\\n * @param contractAddr The address of the contract to check for interface support.\\n * @param interfaceId The interface ID to check for support.\\n */\\n function _requireSupportsInterface(address contractAddr, bytes4 interfaceId) internal view {\\n bytes memory supportsInterfaceParams = abi.encodeCall(IERC165.supportsInterface, (interfaceId));\\n (bool success, bytes memory returnOrRevertData) = contractAddr.staticcall(supportsInterfaceParams);\\n if (!success) {\\n (success, returnOrRevertData) = contractAddr.staticcall(abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (supportsInterfaceParams)));\\n if (!success) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n if (!abi.decode(returnOrRevertData, (bool))) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n}\\n\",\"keccak256\":\"0x546ab4c9cdb0e7f8e650f140349225305ba1d0706dcaceeb9180c96aa765da59\",\"license\":\"MIT\"},\"src/utils/RoleAccess.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum RoleAccess {\\n UNKNOWN, // 0\\n ADMIN, // 1\\n COINBASE, // 2\\n GOVERNOR, // 3\\n CANDIDATE_ADMIN, // 4\\n WITHDRAWAL_MIGRATOR, // 5\\n __DEPRECATED_BRIDGE_OPERATOR, // 6\\n BLOCK_PRODUCER, // 7\\n VALIDATOR_CANDIDATE, // 8\\n CONSENSUS, // 9\\n TREASURY // 10\\n\\n}\\n\",\"keccak256\":\"0x671ff40dd874c508c4b3879a580996c7987fc018669256f47151e420a55c0e51\",\"license\":\"MIT\"}},\"version\":1}", + "nonce": 192804, + "numDeployments": 1, + "storageLayout": { + "storage": [ + { + "astId": 58190, + "contract": "src/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 58193, + "contract": "src/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 105550, + "contract": "src/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", + "label": "DOMAIN_SEPARATOR", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + }, + { + "astId": 107599, + "contract": "src/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", + "label": "round", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 107607, + "contract": "src/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", + "label": "vote", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_uint256,t_mapping(t_uint256,t_struct(ProposalVote)107537_storage))" + }, + { + "astId": 107609, + "contract": "src/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", + "label": "_proposalExpiryDuration", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 108331, + "contract": "src/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", + "label": "_targetOptionsMap", + "offset": 0, + "slot": "5", + "type": "t_mapping(t_enum(TargetOption)112395,t_address)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_address)dyn_storage": { + "encoding": "dynamic_array", + "label": "address[]", + "numberOfBytes": "32", + "base": "t_address" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_enum(TargetOption)112395": { + "encoding": "inplace", + "label": "enum GlobalProposal.TargetOption", + "numberOfBytes": "1" + }, + "t_enum(VoteStatus)111339": { + "encoding": "inplace", + "label": "enum VoteStatusConsumer.VoteStatus", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_address,t_struct(Signature)111330_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct SignatureConsumer.Signature)", + "numberOfBytes": "32", + "value": "t_struct(Signature)111330_storage" + }, + "t_mapping(t_enum(TargetOption)112395,t_address)": { + "encoding": "mapping", + "key": "t_enum(TargetOption)112395", + "label": "mapping(enum GlobalProposal.TargetOption => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_uint256,t_mapping(t_uint256,t_struct(ProposalVote)107537_storage))": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => mapping(uint256 => struct CoreGovernance.ProposalVote))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint256,t_struct(ProposalVote)107537_storage)" + }, + "t_mapping(t_uint256,t_struct(ProposalVote)107537_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct CoreGovernance.ProposalVote)", + "numberOfBytes": "32", + "value": "t_struct(ProposalVote)107537_storage" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(ProposalVote)107537_storage": { + "encoding": "inplace", + "label": "struct CoreGovernance.ProposalVote", + "numberOfBytes": "288", + "members": [ + { + "astId": 107513, + "contract": "src/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", + "label": "status", + "offset": 0, + "slot": "0", + "type": "t_enum(VoteStatus)111339" + }, + { + "astId": 107515, + "contract": "src/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", + "label": "hash", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + }, + { + "astId": 107517, + "contract": "src/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", + "label": "againstVoteWeight", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 107519, + "contract": "src/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", + "label": "forVoteWeight", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 107522, + "contract": "src/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", + "label": "forVoteds", + "offset": 0, + "slot": "4", + "type": "t_array(t_address)dyn_storage" + }, + { + "astId": 107525, + "contract": "src/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", + "label": "againstVoteds", + "offset": 0, + "slot": "5", + "type": "t_array(t_address)dyn_storage" + }, + { + "astId": 107527, + "contract": "src/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", + "label": "expiryTimestamp", + "offset": 0, + "slot": "6", + "type": "t_uint256" + }, + { + "astId": 107532, + "contract": "src/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", + "label": "sig", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_address,t_struct(Signature)111330_storage)" + }, + { + "astId": 107536, + "contract": "src/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", + "label": "voted", + "offset": 0, + "slot": "8", + "type": "t_mapping(t_address,t_bool)" + } + ] + }, + "t_struct(Signature)111330_storage": { + "encoding": "inplace", + "label": "struct SignatureConsumer.Signature", + "numberOfBytes": "96", + "members": [ + { + "astId": 111325, + "contract": "src/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", + "label": "v", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 111327, + "contract": "src/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", + "label": "r", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + }, + { + "astId": 111329, + "contract": "src/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", + "label": "s", + "offset": 0, + "slot": "2", + "type": "t_bytes32" + } + ] + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + }, + "timestamp": 1713240519, + "userdoc": { + "version": 1, + "kind": "user", + "methods": { + "round(uint256)": { + "notice": "chain id = 0 for global proposal" + } + }, + "errors": { + "ErrBelowMinRequiredGovernors()": [ + { + "notice": "Error indicating that the governors list will go below minimum number of required governor." + } + ], + "ErrGovernorNotFound(address)": [ + { + "notice": "Error indicating that cannot find the querying governor" + } + ], + "ErrGovernorNotMatch(address,address)": [ + { + "notice": "Error indicating that the msg.sender is not match the required governor" + } + ], + "ErrInvalidInput()": [ + { + "notice": "Common invalid input error" + } + ], + "ErrOperatorNotFound(address)": [ + { + "notice": "Error indicating that cannot find the querying operator" + } + ] + } + } +} \ No newline at end of file From 326e1797d52e2dee26117c2a773a8c484a238cb9 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 16 Apr 2024 14:29:37 +0700 Subject: [PATCH 172/180] script: fix total gas of proposal --- .../20240411-helper.s.sol | 2 +- ...240411-p2-upgrade-bridge-ronin-chain.s.sol | 70 ++++++++++++------- ...0240411-p3-upgrade-bridge-main-chain.s.sol | 2 +- 3 files changed, 46 insertions(+), 28 deletions(-) diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol index 2775424a..4003c57e 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol @@ -38,7 +38,7 @@ contract Migration__20240409_Helper is Migration { function _helperVoteForCurrentNetwork(LegacyProposalDetail memory proposal) internal { for (uint i; i < _voters.length - 1; ++i) { vm.broadcast(_voters[i]); - address(_currRoninBridgeManager).call( + address(_currRoninBridgeManager).call{gas: (proposal.targets.length + 1) * 1_000_000 }( abi.encodeWithSignature( "castProposalVoteForCurrentNetwork((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8)", proposal, Ballot.VoteType.For ) diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol index ed4a3b8e..d9f34280 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol @@ -62,14 +62,14 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H calldatas[0] = abi.encodeWithSignature("changeAdmin(address)", address(_currRoninBridgeManager)); gasAmounts[0] = 1_000_000; - LegacyProposalDetail memory proposal; - proposal.nonce = roninGA.round(block.chainid) + 1; - proposal.chainId = block.chainid; - proposal.expiryTimestamp = expiredTime; - proposal.targets = targets; - proposal.values = values; - proposal.calldatas = calldatas; - proposal.gasAmounts = gasAmounts; + // LegacyProposalDetail memory proposal; + // proposal.nonce = roninGA.round(block.chainid) + 1; + // proposal.chainId = block.chainid; + // proposal.expiryTimestamp = expiredTime; + // proposal.targets = targets; + // proposal.values = values; + // proposal.calldatas = calldatas; + // proposal.gasAmounts = gasAmounts; address gaGovernor = 0x52ec2e6BBcE45AfFF8955Da6410bb13812F4289F; address[] memory gaVoters = new address[](3); @@ -77,28 +77,46 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H gaVoters[1] = 0x06f8Af58F656B507918d91B0B6F8B89bfCC556f9; gaVoters[2] = 0xe1100401454B5f850b09f3b92cE7f071C5F1CEF4; - vm.broadcast(gaGovernor); - address(roninGA).call( - abi.encodeWithSignature( - "proposeProposalForCurrentNetwork(uint256,address[],uint256[],bytes[],uint256[],uint8)", - // proposal.chainId, - proposal.expiryTimestamp, - proposal.targets, - proposal.values, - proposal.calldatas, - proposal.gasAmounts, - Ballot.VoteType.For - ) - ); - - for (uint i; i < gaVoters.length; ++i) { - vm.broadcast(gaVoters[i]); - address(roninGA).call( + // vm.broadcast(gaGovernor); + // address(roninGA).call( + // abi.encodeWithSignature( + // "proposeProposalForCurrentNetwork(uint256,address[],uint256[],bytes[],uint256[],uint8)", + // // proposal.chainId, + // proposal.expiryTimestamp, + // proposal.targets, + // proposal.values, + // proposal.calldatas, + // proposal.gasAmounts, + // Ballot.VoteType.For + // ) + // ); + + // for (uint i; i < gaVoters.length; ++i) { + // vm.broadcast(gaVoters[i]); + // address(roninGA).call{gas: 10_000_000}( + // abi.encodeWithSignature( + // "castProposalVoteForCurrentNetwork((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8)", proposal, Ballot.VoteType.For + // ) + // ); + // } + + // ((45, 2021, 1714451658 [1.714e9], [0x1aD54D61F47acBcBA99fb6540A1694EB2F47AB95], [0], [0x8f283970000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac5753], [1000000 [1e6]]), 0) + + LegacyProposalDetail memory proposal; + proposal.nonce = 45; + proposal.chainId = 2021; + proposal.expiryTimestamp = 1714451658; + proposal.targets = targets; + proposal.values = values; + proposal.calldatas = calldatas; + proposal.gasAmounts = gasAmounts; + + vm.broadcast(gaVoters[2]); + address(roninGA).call{gas: 10_000_000}( abi.encodeWithSignature( "castProposalVoteForCurrentNetwork((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8)", proposal, Ballot.VoteType.For ) ); - } } function _upgradeBridgeRoninchain() private { diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol index 6995e701..9af25467 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol @@ -189,7 +189,7 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is Migration, Migration__ SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(getDomain(), hashLegacyProposal(proposal), _loadGovernorPKs(), Ballot.VoteType.For); vm.broadcast(_governor); - address(_currMainchainBridgeManager).call( + address(_currMainchainBridgeManager).call{gas: (proposal.targets.length + 1) * 1_000_000}( abi.encodeWithSignature( "relayProposal((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])", proposal, supports_, signatures ) From d84a88ca25d77c5d2595ba3c9e9d78b5bce0fbc8 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 16 Apr 2024 14:29:49 +0700 Subject: [PATCH 173/180] chore: add artifacts Ronin side --- .../ronin-testnet/BridgeRewardLogic.json | 880 ++--- .../ronin-testnet/BridgeSlashLogic.json | 792 ++-- .../ronin-testnet/BridgeTrackingLogic.json | 697 ++-- .../RoninGatewayPauseEnforcerLogic.json | 709 ++-- .../ronin-testnet/RoninGatewayV3Logic.json | 3198 +++++++++++++++++ 5 files changed, 4712 insertions(+), 1564 deletions(-) create mode 100644 deployments/ronin-testnet/RoninGatewayV3Logic.json diff --git a/deployments/ronin-testnet/BridgeRewardLogic.json b/deployments/ronin-testnet/BridgeRewardLogic.json index b4444ee1..fd93c487 100644 --- a/deployments/ronin-testnet/BridgeRewardLogic.json +++ b/deployments/ronin-testnet/BridgeRewardLogic.json @@ -1,546 +1,654 @@ { - "address": "0xa316e3dDa5B0DECC0c6528EDE4595831794c089A", "abi": [ { + "type": "constructor", "inputs": [], - "stateMutability": "payable", - "type": "constructor" + "stateMutability": "payable" }, { + "type": "function", + "name": "execSyncRewardAuto", "inputs": [ { - "internalType": "enum ContractType", - "name": "contractType", - "type": "uint8" + "name": "currentPeriod", + "type": "uint256", + "internalType": "uint256" } ], - "name": "ErrContractTypeNotFound", - "type": "error" + "outputs": [], + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "getContract", "inputs": [ { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" - }, - { - "internalType": "uint256", - "name": "currentBalance", - "type": "uint256" - }, + "name": "contractType", + "type": "uint8", + "internalType": "enum ContractType" + } + ], + "outputs": [ { - "internalType": "uint256", - "name": "sendAmount", - "type": "uint256" + "name": "contract_", + "type": "address", + "internalType": "address" } ], - "name": "ErrInsufficientBalance", - "type": "error" + "stateMutability": "view" }, { - "inputs": [ + "type": "function", + "name": "getLatestRewardedPeriod", + "inputs": [], + "outputs": [ { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "ErrInvalidArguments", - "type": "error" + "stateMutability": "view" }, { + "type": "function", + "name": "getRewardInfo", "inputs": [ { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" + "name": "operator", + "type": "address", + "internalType": "address" } ], - "name": "ErrLengthMismatch", - "type": "error" + "outputs": [ + { + "name": "rewardInfo", + "type": "tuple", + "internalType": "struct IBridgeRewardEvents.BridgeRewardInfo", + "components": [ + { + "name": "claimed", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "slashed", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ], + "stateMutability": "view" }, { - "inputs": [ + "type": "function", + "name": "getRewardPerPeriod", + "inputs": [], + "outputs": [ { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "ErrRecipientRevert", - "type": "error" + "stateMutability": "view" }, { - "inputs": [ + "type": "function", + "name": "getTotalRewardScattered", + "inputs": [], + "outputs": [ { - "internalType": "uint256", - "name": "period", - "type": "uint256" - }, + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getTotalRewardToppedUp", + "inputs": [], + "outputs": [ { - "internalType": "uint256", - "name": "latestRewardedPeriod", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" } ], - "name": "ErrSyncTooFarPeriod", - "type": "error" + "stateMutability": "view" }, { + "type": "function", + "name": "initialize", "inputs": [ { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" + "name": "bridgeManagerContract", + "type": "address", + "internalType": "address" }, { - "internalType": "enum RoleAccess", - "name": "expectedRole", - "type": "uint8" + "name": "bridgeTrackingContract", + "type": "address", + "internalType": "address" + }, + { + "name": "bridgeSlashContract", + "type": "address", + "internalType": "address" + }, + { + "name": "validatorSetContract", + "type": "address", + "internalType": "address" + }, + { + "name": "dposGA", + "type": "address", + "internalType": "address" + }, + { + "name": "rewardPerPeriod", + "type": "uint256", + "internalType": "uint256" } ], - "name": "ErrUnauthorized", - "type": "error" + "outputs": [], + "stateMutability": "payable" + }, + { + "type": "function", + "name": "initializeREP2", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "initializeV2", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "receiveRON", + "inputs": [], + "outputs": [], + "stateMutability": "payable" + }, + { + "type": "function", + "name": "setContract", "inputs": [ { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" + "name": "contractType", + "type": "uint8", + "internalType": "enum ContractType" + }, + { + "name": "addr", + "type": "address", + "internalType": "address" } ], - "name": "ErrUnauthorizedCall", - "type": "error" + "outputs": [], + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "setRewardPerPeriod", "inputs": [ { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" - }, - { - "internalType": "enum ContractType", - "name": "expectedContractType", - "type": "uint8" - }, - { - "internalType": "address", - "name": "actual", - "type": "address" + "name": "rewardPerPeriod", + "type": "uint256", + "internalType": "uint256" } ], - "name": "ErrUnexpectedInternalCall", - "type": "error" + "outputs": [], + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "syncRewardManual", "inputs": [ { - "internalType": "address", - "name": "addr", - "type": "address" + "name": "periodCount", + "type": "uint256", + "internalType": "uint256" } ], - "name": "ErrZeroCodeContract", - "type": "error" + "outputs": [], + "stateMutability": "nonpayable" }, { - "anonymous": false, + "type": "event", + "name": "BridgeRewardScatterFailed", "inputs": [ { - "indexed": true, - "internalType": "uint256", "name": "period", - "type": "uint256" + "type": "uint256", + "indexed": true, + "internalType": "uint256" }, { - "indexed": false, - "internalType": "address", "name": "operator", - "type": "address" + "type": "address", + "indexed": false, + "internalType": "address" }, { - "indexed": false, - "internalType": "uint256", "name": "amount", - "type": "uint256" + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "name": "BridgeRewardScatterFailed", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "type": "event", + "name": "BridgeRewardScattered", "inputs": [ { - "indexed": true, - "internalType": "uint256", "name": "period", - "type": "uint256" + "type": "uint256", + "indexed": true, + "internalType": "uint256" }, { - "indexed": false, - "internalType": "address", "name": "operator", - "type": "address" + "type": "address", + "indexed": false, + "internalType": "address" }, { - "indexed": false, - "internalType": "uint256", "name": "amount", - "type": "uint256" + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "name": "BridgeRewardScattered", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "type": "event", + "name": "BridgeRewardSlashed", "inputs": [ { - "indexed": true, - "internalType": "uint256", "name": "period", - "type": "uint256" + "type": "uint256", + "indexed": true, + "internalType": "uint256" }, { - "indexed": false, - "internalType": "address", "name": "operator", - "type": "address" + "type": "address", + "indexed": false, + "internalType": "address" }, { - "indexed": false, - "internalType": "uint256", "name": "amount", - "type": "uint256" + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "name": "BridgeRewardSlashed", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "type": "event", + "name": "BridgeRewardSyncTooFarPeriod", "inputs": [ { - "indexed": false, - "internalType": "uint256", "name": "requestingPeriod", - "type": "uint256" + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", "name": "latestPeriod", - "type": "uint256" + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "name": "BridgeRewardSyncTooFarPeriod", - "type": "event" + "anonymous": false }, { - "anonymous": false, - "inputs": [], + "type": "event", "name": "BridgeTrackingIncorrectlyResponded", - "type": "event" + "inputs": [], + "anonymous": false }, { - "anonymous": false, + "type": "event", + "name": "ContractUpdated", "inputs": [ { - "indexed": true, - "internalType": "enum ContractType", "name": "contractType", - "type": "uint8" + "type": "uint8", + "indexed": true, + "internalType": "enum ContractType" }, { - "indexed": true, - "internalType": "address", "name": "addr", - "type": "address" + "type": "address", + "indexed": true, + "internalType": "address" } ], - "name": "ContractUpdated", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "type": "event", + "name": "Initialized", "inputs": [ { - "indexed": false, - "internalType": "uint8", "name": "version", - "type": "uint8" + "type": "uint8", + "indexed": false, + "internalType": "uint8" } ], - "name": "Initialized", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "type": "event", + "name": "SafeReceived", "inputs": [ { - "indexed": true, - "internalType": "address", "name": "from", - "type": "address" + "type": "address", + "indexed": true, + "internalType": "address" }, { - "indexed": false, - "internalType": "uint256", "name": "balanceBefore", - "type": "uint256" + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", "name": "amount", - "type": "uint256" + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "name": "SafeReceived", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "type": "event", + "name": "UpdatedRewardPerPeriod", "inputs": [ { - "indexed": false, - "internalType": "uint256", "name": "newRewardPerPeriod", - "type": "uint256" + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "name": "UpdatedRewardPerPeriod", - "type": "event" + "anonymous": false }, { + "type": "error", + "name": "ErrContractTypeNotFound", "inputs": [ { - "internalType": "address[]", - "name": "operators", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "ballots", - "type": "uint256[]" - }, + "name": "contractType", + "type": "uint8", + "internalType": "enum ContractType" + } + ] + }, + { + "type": "error", + "name": "ErrInsufficientBalance", + "inputs": [ { - "internalType": "uint256", - "name": "totalBallot", - "type": "uint256" + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" }, { - "internalType": "uint256", - "name": "totalVote", - "type": "uint256" + "name": "currentBalance", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "period", - "type": "uint256" + "name": "sendAmount", + "type": "uint256", + "internalType": "uint256" } - ], - "name": "execSyncReward", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + ] }, { + "type": "error", + "name": "ErrLengthMismatch", "inputs": [ { - "internalType": "enum ContractType", - "name": "contractType", - "type": "uint8" - } - ], - "name": "getContract", - "outputs": [ - { - "internalType": "address", - "name": "contract_", - "type": "address" + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" } - ], - "stateMutability": "view", - "type": "function" + ] }, { - "inputs": [], - "name": "getLatestRewardedPeriod", - "outputs": [ + "type": "error", + "name": "ErrPeriodAlreadyRewarded", + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "currentPeriod", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "latestRewardedPeriod", + "type": "uint256", + "internalType": "uint256" } - ], - "stateMutability": "view", - "type": "function" + ] }, { - "inputs": [], - "name": "getRewardPerPeriod", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" + "type": "error", + "name": "ErrPeriodCountIsZero", + "inputs": [] }, { - "inputs": [], - "name": "getTotalRewardScattered", - "outputs": [ + "type": "error", + "name": "ErrPeriodNotHappen", + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "currentPeriod", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "latestRewardedPeriod", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "periodCount", + "type": "uint256", + "internalType": "uint256" } - ], - "stateMutability": "view", - "type": "function" + ] }, { - "inputs": [], - "name": "getTotalRewardToppedUp", - "outputs": [ + "type": "error", + "name": "ErrRecipientRevert", + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" } - ], - "stateMutability": "view", - "type": "function" + ] }, { + "type": "error", + "name": "ErrUnauthorized", "inputs": [ { - "internalType": "address", - "name": "bridgeManagerContract", - "type": "address" - }, - { - "internalType": "address", - "name": "bridgeTrackingContract", - "type": "address" - }, - { - "internalType": "address", - "name": "bridgeSlashContract", - "type": "address" - }, - { - "internalType": "address", - "name": "validatorSetContract", - "type": "address" + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" }, { - "internalType": "uint256", - "name": "rewardPerPeriod", - "type": "uint256" + "name": "expectedRole", + "type": "uint8", + "internalType": "enum RoleAccess" } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "receiveRON", - "outputs": [], - "stateMutability": "payable", - "type": "function" + ] }, { + "type": "error", + "name": "ErrUnauthorizedCall", "inputs": [ { - "internalType": "enum ContractType", - "name": "contractType", - "type": "uint8" - }, - { - "internalType": "address", - "name": "addr", - "type": "address" + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" } - ], - "name": "setContract", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + ] }, { + "type": "error", + "name": "ErrUnexpectedInternalCall", "inputs": [ { - "internalType": "uint256", - "name": "rewardPerPeriod", - "type": "uint256" + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + }, + { + "name": "expectedContractType", + "type": "uint8", + "internalType": "enum ContractType" + }, + { + "name": "actual", + "type": "address", + "internalType": "address" } - ], - "name": "setRewardPerPeriod", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + ] }, { + "type": "error", + "name": "ErrZeroCodeContract", "inputs": [ { - "internalType": "uint256", - "name": "periodLength", - "type": "uint256" + "name": "addr", + "type": "address", + "internalType": "address" } - ], - "name": "syncReward", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + ] } ], - "transactionHash": "0xf985a1be2d3637e7f2da38c0eab96f9ebb6d6ff9304f75a8ce7117923851ce16", - "receipt": { - "to": null, - "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", - "contractAddress": "0xa316e3dDa5B0DECC0c6528EDE4595831794c089A", - "transactionIndex": 0, - "gasUsed": "1327882", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000020000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x0ff9f4cab517d5ab51842e2e2ddce73b86900c2b50e2e5a8ad869d8505de5e99", - "transactionHash": "0xf985a1be2d3637e7f2da38c0eab96f9ebb6d6ff9304f75a8ce7117923851ce16", - "logs": [ - { - "transactionIndex": 0, - "blockNumber": 19060073, - "transactionHash": "0xf985a1be2d3637e7f2da38c0eab96f9ebb6d6ff9304f75a8ce7117923851ce16", - "address": "0xa316e3dDa5B0DECC0c6528EDE4595831794c089A", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", - "logIndex": 0, - "blockHash": "0x0ff9f4cab517d5ab51842e2e2ddce73b86900c2b50e2e5a8ad869d8505de5e99" - } - ], - "blockNumber": 19060073, - "cumulativeGasUsed": "1327882", - "status": 1, - "byzantium": true - }, - "args": [], - "numDeployments": 2, - "solcInputHash": "28b4851e3868f34350c9d7d76cba2b15", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"ErrContractTypeNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"uint256\",\"name\":\"currentBalance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"sendAmount\",\"type\":\"uint256\"}],\"name\":\"ErrInsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidArguments\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrLengthMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrRecipientRevert\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"period\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"latestRewardedPeriod\",\"type\":\"uint256\"}],\"name\":\"ErrSyncTooFarPeriod\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum RoleAccess\",\"name\":\"expectedRole\",\"type\":\"uint8\"}],\"name\":\"ErrUnauthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrUnauthorizedCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum ContractType\",\"name\":\"expectedContractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"actual\",\"type\":\"address\"}],\"name\":\"ErrUnexpectedInternalCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrZeroCodeContract\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"period\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BridgeRewardScatterFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"period\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BridgeRewardScattered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"period\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BridgeRewardSlashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requestingPeriod\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"latestPeriod\",\"type\":\"uint256\"}],\"name\":\"BridgeRewardSyncTooFarPeriod\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"BridgeTrackingIncorrectlyResponded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ContractUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"balanceBefore\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"SafeReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newRewardPerPeriod\",\"type\":\"uint256\"}],\"name\":\"UpdatedRewardPerPeriod\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"operators\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ballots\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"totalBallot\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalVote\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"period\",\"type\":\"uint256\"}],\"name\":\"execSyncReward\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"getContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"contract_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestRewardedPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRewardPerPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalRewardScattered\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalRewardToppedUp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeManagerContract\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"bridgeTrackingContract\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"bridgeSlashContract\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"validatorSetContract\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"rewardPerPeriod\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"receiveRON\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"rewardPerPeriod\",\"type\":\"uint256\"}],\"name\":\"setRewardPerPeriod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"periodLength\",\"type\":\"uint256\"}],\"name\":\"syncReward\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"ErrContractTypeNotFound(uint8)\":[{\"details\":\"Error of invalid role.\"}],\"ErrInsufficientBalance(bytes4,uint256,uint256)\":[{\"details\":\"Error of sender has insufficient balance.\"}],\"ErrInvalidArguments(bytes4)\":[{\"details\":\"Error indicating that arguments are invalid.\"}],\"ErrLengthMismatch(bytes4)\":[{\"details\":\"Error indicating a mismatch in the length of input parameters or arrays for a specific function.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that has a length mismatch.\"}}],\"ErrRecipientRevert(bytes4)\":[{\"details\":\"Error of recipient not accepting RON when transfer RON.\"}],\"ErrUnauthorized(bytes4,uint8)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"expectedRole\":\"The role required to perform the function.\",\"msgSig\":\"The function signature (bytes4) that the caller is unauthorized to perform.\"}}],\"ErrUnauthorizedCall(bytes4)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that the caller is unauthorized to perform.\"}}],\"ErrUnexpectedInternalCall(bytes4,uint8,address)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"actual\":\"The actual address that called to the function.\",\"expectedContractType\":\"The contract type required to perform the function.\",\"msgSig\":\"The function signature (bytes4).\"}}],\"ErrZeroCodeContract(address)\":[{\"details\":\"Error of set to non-contract.\"}]},\"kind\":\"dev\",\"methods\":{\"execSyncReward(address[],uint256[],uint256,uint256,uint256)\":{\"details\":\"Invoke calculate and transfer reward to operators based on their performance. Requirements: - This method is only called once each period. - The caller must be the bridge tracking contract or a bridge operator.\"},\"getContract(uint8)\":{\"details\":\"Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.\",\"params\":{\"contractType\":\"The role of the contract to retrieve.\"},\"returns\":{\"contract_\":\"The address of the contract with the specified role.\"}},\"getLatestRewardedPeriod()\":{\"details\":\"External function to retrieve the latest rewarded period in the contract.\",\"returns\":{\"_0\":\"latestRewardedPeriod The latest rewarded period value.\"}},\"getRewardPerPeriod()\":{\"details\":\"Getter for all bridge operators per period.\"},\"getTotalRewardScattered()\":{\"details\":\"Retrieve the total amount of rewards that have been scattered to bridge operators in the contract.\",\"returns\":{\"_0\":\"totalRewardScattered The total rewards scattered value.\"}},\"getTotalRewardToppedUp()\":{\"details\":\"Retrieve the total amount of rewards that have been topped up in the contract.\",\"returns\":{\"_0\":\"totalRewardToppedUp The total rewards topped up value.\"}},\"receiveRON()\":{\"details\":\"Receives RON from any address.\"},\"setContract(uint8,address)\":{\"details\":\"Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.\",\"params\":{\"addr\":\"The address of the contract to set.\",\"contractType\":\"The role of the contract to set.\"}},\"setRewardPerPeriod(uint256)\":{\"details\":\"Setter for all bridge operators per period.\"},\"syncReward(uint256)\":{\"details\":\"This function allows bridge operators to manually synchronize the reward for a given period length.\",\"params\":{\"periodLength\":\"The length of the reward period for which synchronization is requested.\"}}},\"stateVariables\":{\"LATEST_REWARDED_PERIOD_SLOT\":{\"details\":\"value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeReward.latestRewardedPeriod.slot\\\") - 1\"},\"REWARD_INFO_SLOT\":{\"details\":\"value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeReward.rewardInfo.slot\\\") - 1\"},\"REWARD_PER_PERIOD_SLOT\":{\"details\":\"value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeReward.rewardPerPeriod.slot\\\") - 1\"},\"TOTAL_REWARDS_SCATTERED_SLOT\":{\"details\":\"value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeReward.totalRewardScattered.slot\\\") - 1\"},\"TOTAL_REWARDS_TOPPED_UP_SLOT\":{\"details\":\"value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeReward.totalRewardToppedUp.slot\\\") - 1\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/ronin/gateway/BridgeReward.sol\":\"BridgeReward\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"none\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0xa6a787e7a901af6511e19aa53e1a00352db215a011d2c7a438d0582dd5da76f9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2a21b14ff90012878752f230d3ffd5c3405e5938d06c97a7d89c0a64561d0d66\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"contracts/extensions/RONTransferHelper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nabstract contract RONTransferHelper {\\n /// @dev Error of sender has insufficient balance.\\n error ErrInsufficientBalance(bytes4 msgSig, uint256 currentBalance, uint256 sendAmount);\\n /// @dev Error of recipient not accepting RON when transfer RON.\\n error ErrRecipientRevert(bytes4 msgSig);\\n\\n /**\\n * @dev See `_sendRON`.\\n * Reverts if the recipient does not receive RON.\\n */\\n function _transferRON(address payable recipient, uint256 amount) internal {\\n if (!_sendRON(recipient, amount)) revert ErrRecipientRevert(msg.sig);\\n }\\n\\n /**\\n * @dev Send `amount` RON to the address `recipient`.\\n * Returns whether the recipient receives RON or not.\\n * Reverts once the contract balance is insufficient.\\n *\\n * Note: consider using `ReentrancyGuard` before calling this function.\\n *\\n */\\n function _sendRON(address payable recipient, uint256 amount) internal returns (bool success) {\\n if (address(this).balance < amount) revert ErrInsufficientBalance(msg.sig, address(this).balance, amount);\\n return _unsafeSendRON(recipient, amount);\\n }\\n\\n /**\\n * @dev Unsafe send `amount` RON to the address `recipient`. If the sender's balance is insufficient,\\n * the call does not revert.\\n *\\n * Note:\\n * - Does not assert whether the balance of sender is sufficient.\\n * - Does not assert whether the recipient accepts RON.\\n * - Consider using `ReentrancyGuard` before calling this function.\\n *\\n */\\n function _unsafeSendRON(address payable recipient, uint256 amount) internal returns (bool success) {\\n (success, ) = recipient.call{ value: amount }(\\\"\\\");\\n }\\n\\n /**\\n * @dev Same purpose with {_unsafeSendRONLimitGas(address,uin256)} but containing gas limit stipend forwarded in the call.\\n */\\n function _unsafeSendRONLimitGas(\\n address payable recipient,\\n uint256 amount,\\n uint256 gas\\n ) internal returns (bool success) {\\n (success, ) = recipient.call{ value: amount, gas: gas }(\\\"\\\");\\n }\\n}\\n\",\"keccak256\":\"0xdece837caa8da00fe031b8139ada009330b8bef149af12b535913c021ab94d0e\",\"license\":\"MIT\"},\"contracts/extensions/TransparentUpgradeableProxyV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\\\";\\n\\ncontract TransparentUpgradeableProxyV2 is TransparentUpgradeableProxy {\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable TransparentUpgradeableProxy(_logic, admin_, _data) {}\\n\\n /**\\n * @dev Calls a function from the current implementation as specified by `_data`, which should be an encoded function call.\\n *\\n * Requirements:\\n * - Only the admin can call this function.\\n *\\n * Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid\\n * triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider\\n * reviewing the encoded data `_data` and the method which is called before using this.\\n *\\n */\\n function functionDelegateCall(bytes memory _data) public payable ifAdmin {\\n address _addr = _implementation();\\n assembly {\\n let _result := delegatecall(gas(), _addr, add(_data, 32), mload(_data), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n switch _result\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x6609392ea7d3174439b5715100bee82528fe6e4aff28927d48c27db8475e88c5\",\"license\":\"MIT\"},\"contracts/extensions/bridge-operator-governance/BridgeTrackingHelper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nabstract contract BridgeTrackingHelper {\\n /// @dev Event emited when the bridge tracking contract tracks the invalid data, cause malform in sharing bridge reward.\\n event BridgeTrackingIncorrectlyResponded();\\n\\n /**\\n * @dev Internal function to validate the bridge tracking response for a given set of ballots.\\n * @param totalBallot The total number of ballots available for the tracking response.\\n * @param totalVote The total number of votes recorded in the tracking response.\\n * @param ballots An array containing the individual ballot counts in the tracking response.\\n * @return valid A boolean indicating whether the bridge tracking response is valid or not.\\n * @notice The function checks if each individual ballot count is not greater than the total votes recorded.\\n * @notice It also verifies that the sum of all individual ballot counts does not exceed the total available ballots.\\n */\\n function _isValidBridgeTrackingResponse(\\n uint256 totalBallot,\\n uint256 totalVote,\\n uint256[] memory ballots\\n ) internal pure returns (bool valid) {\\n valid = true;\\n uint256 sumBallot;\\n uint256 length = ballots.length;\\n\\n unchecked {\\n for (uint256 i; i < length; ++i) {\\n if (ballots[i] > totalVote) {\\n valid = false;\\n break;\\n }\\n\\n sumBallot += ballots[i];\\n }\\n }\\n\\n valid = valid && (sumBallot <= totalBallot);\\n }\\n}\\n\",\"keccak256\":\"0x2da3d7c4b8d48228761b48c79beb04a55065d24a3469a16043b00c45873844e5\",\"license\":\"MIT\"},\"contracts/extensions/collections/HasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { HasProxyAdmin } from \\\"./HasProxyAdmin.sol\\\";\\nimport \\\"../../interfaces/collections/IHasContracts.sol\\\";\\nimport { IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\nimport { ErrUnexpectedInternalCall } from \\\"../../utils/CommonErrors.sol\\\";\\n\\n/**\\n * @title HasContracts\\n * @dev A contract that provides functionality to manage multiple contracts with different roles.\\n */\\nabstract contract HasContracts is HasProxyAdmin, IHasContracts, IdentityGuard {\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.collections.HasContracts.slot\\\") - 1\\n bytes32 private constant _STORAGE_SLOT = 0xdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb;\\n\\n /**\\n * @dev Modifier to restrict access to functions only to contracts with a specific role.\\n * @param contractType The contract type that allowed to call\\n */\\n modifier onlyContract(ContractType contractType) virtual {\\n _requireContract(contractType);\\n _;\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function setContract(ContractType contractType, address addr) external virtual onlyAdmin {\\n _requireHasCode(addr);\\n _setContract(contractType, addr);\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function getContract(ContractType contractType) public view returns (address contract_) {\\n contract_ = _getContractMap()[uint8(contractType)];\\n if (contract_ == address(0)) revert ErrContractTypeNotFound(contractType);\\n }\\n\\n /**\\n * @dev Internal function to set the address of a contract with a specific role.\\n * @param contractType The contract type of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function _setContract(ContractType contractType, address addr) internal virtual {\\n _getContractMap()[uint8(contractType)] = addr;\\n emit ContractUpdated(contractType, addr);\\n }\\n\\n /**\\n * @dev Internal function to access the mapping of contract addresses with roles.\\n * @return contracts_ The mapping of contract addresses with roles.\\n */\\n function _getContractMap() private pure returns (mapping(uint8 => address) storage contracts_) {\\n assembly {\\n contracts_.slot := _STORAGE_SLOT\\n }\\n }\\n\\n /**\\n * @dev Internal function to check if the calling contract has a specific role.\\n * @param contractType The contract type that the calling contract must have.\\n * @dev Throws an error if the calling contract does not have the specified role.\\n */\\n function _requireContract(ContractType contractType) private view {\\n if (msg.sender != getContract(contractType)) {\\n revert ErrUnexpectedInternalCall(msg.sig, contractType, msg.sender);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9e1dceb68827adfb8c8184662f29ab5fe14e292a632878150e3b0b6c61bc1dce\",\"license\":\"MIT\"},\"contracts/extensions/collections/HasProxyAdmin.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/StorageSlot.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\n\\nabstract contract HasProxyAdmin {\\n // bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n modifier onlyAdmin() {\\n _requireAdmin();\\n _;\\n }\\n\\n /**\\n * @dev Returns proxy admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n function _requireAdmin() internal view {\\n if (msg.sender != _getAdmin()) revert ErrUnauthorized(msg.sig, RoleAccess.ADMIN);\\n }\\n}\\n\",\"keccak256\":\"0x06e5962713a77abf6d5ba646e1cc1cfb6f9c50e7d52520dd82a10bf309534187\",\"license\":\"MIT\"},\"contracts/interfaces/bridge/IBridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IBridgeManagerEvents } from \\\"./events/IBridgeManagerEvents.sol\\\";\\n\\n/**\\n * @title IBridgeManager\\n * @dev The interface for managing bridge operators.\\n */\\ninterface IBridgeManager is IBridgeManagerEvents {\\n /**\\n * @dev The domain separator used for computing hash digests in the contract.\\n */\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n\\n /**\\n * @dev Returns the total number of bridge operators.\\n * @return The total number of bridge operators.\\n */\\n function totalBridgeOperators() external view returns (uint256);\\n\\n /**\\n * @dev Checks if the given address is a bridge operator.\\n * @param addr The address to check.\\n * @return A boolean indicating whether the address is a bridge operator.\\n */\\n function isBridgeOperator(address addr) external view returns (bool);\\n\\n /**\\n * @dev Retrieves the full information of all registered bridge operators.\\n *\\n * This external function allows external callers to obtain the full information of all the registered bridge operators.\\n * The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.\\n *\\n * @return governors An array of addresses representing the governors of each bridge operator.\\n * @return bridgeOperators An array of addresses representing the registered bridge operators.\\n * @return weights An array of uint256 values representing the vote weights of each bridge operator.\\n *\\n * Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator.\\n *\\n * Example Usage:\\n * ```\\n * (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos();\\n * for (uint256 i = 0; i < bridgeOperators.length; i++) {\\n * // Access individual information for each bridge operator.\\n * address governor = governors[i];\\n * address bridgeOperator = bridgeOperators[i];\\n * uint256 weight = weights[i];\\n * // ... (Process or use the information as required) ...\\n * }\\n * ```\\n *\\n */\\n function getFullBridgeOperatorInfos()\\n external\\n view\\n returns (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights);\\n\\n /**\\n * @dev Returns total weights of the governor list.\\n */\\n function sumGovernorsWeight(address[] calldata governors) external view returns (uint256 sum);\\n\\n /**\\n * @dev Returns total weights.\\n */\\n function getTotalWeights() external view returns (uint256);\\n\\n /**\\n * @dev Returns an array of all bridge operators.\\n * @return An array containing the addresses of all bridge operators.\\n */\\n function getBridgeOperators() external view returns (address[] memory);\\n\\n /**\\n * @dev Returns an array of bridge operators correspoding to governor addresses.\\n * @return bridgeOperators_ An array containing the addresses of all bridge operators.\\n */\\n function getBridgeOperatorOf(address[] calldata gorvernors) external view returns (address[] memory bridgeOperators_);\\n\\n /**\\n * @dev Retrieves the governors corresponding to a given array of bridge operators.\\n * This external function allows external callers to obtain the governors associated with a given array of bridge operators.\\n * The function takes an input array `bridgeOperators` containing bridge operator addresses and returns an array of corresponding governors.\\n * @param bridgeOperators An array of bridge operator addresses for which governors are to be retrieved.\\n * @return governors An array of addresses representing the governors corresponding to the provided bridge operators.\\n */\\n function getGovernorsOf(address[] calldata bridgeOperators) external view returns (address[] memory governors);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific governor.\\n * @param governor The address of the governor to get the vote weight for.\\n * @return voteWeight The vote weight of the specified governor.\\n */\\n function getGovernorWeight(address governor) external view returns (uint256);\\n\\n /**\\n * @dev External function to retrieve the vote weights of multiple bridge operators.\\n * @param bridgeOperators An array containing the addresses of bridge operators to get the vote weights for.\\n * @return weights An array of vote weights corresponding to the provided bridge operators.\\n */\\n function getBridgeOperatorWeights(\\n address[] calldata bridgeOperators\\n ) external view returns (uint256[] memory weights);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific bridge operator.\\n * @param bridgeOperator The address of the bridge operator to get the vote weight for.\\n * @return weight The vote weight of the specified bridge operator.\\n */\\n function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint256 weight);\\n\\n /**\\n * @dev Returns the weights of a list of governor addresses.\\n */\\n function getGovernorWeights(address[] calldata governors) external view returns (uint256[] memory weights);\\n\\n /**\\n * @dev Returns an array of all governors.\\n * @return An array containing the addresses of all governors.\\n */\\n function getGovernors() external view returns (address[] memory);\\n\\n /**\\n * @dev Adds multiple bridge operators.\\n * @param governors An array of addresses of hot/cold wallets for bridge operator to update their node address.\\n * @param bridgeOperators An array of addresses representing the bridge operators to add.\\n * @return addeds An array of booleans indicating whether each bridge operator was added successfully.\\n *\\n * Note: return boolean array `addeds` indicates whether a group (voteWeight, governor, operator) are recorded.\\n * It is expected that FE/BE staticcall to the function first to get the return values and handle it correctly.\\n * Governors are expected to see the outcome of this function and decide if they want to vote for the proposal or not.\\n *\\n * Example Usage:\\n * Making an `eth_call` in ethers.js\\n * ```\\n * const {addeds} = await bridgeManagerContract.callStatic.addBridgeOperators(\\n * voteWeights,\\n * governors,\\n * bridgeOperators,\\n * // overriding the caller to the contract itself since we use `onlySelfCall` guard\\n * {from: bridgeManagerContract.address}\\n * )\\n * const filteredOperators = bridgeOperators.filter((_, index) => addeds[index]);\\n * const filteredWeights = weights.filter((_, index) => addeds[index]);\\n * const filteredGovernors = governors.filter((_, index) => addeds[index]);\\n * // ... (Process or use the information as required) ...\\n * ```\\n */\\n function addBridgeOperators(\\n uint96[] calldata voteWeights,\\n address[] calldata governors,\\n address[] calldata bridgeOperators\\n ) external returns (bool[] memory addeds);\\n\\n /**\\n * @dev Removes multiple bridge operators.\\n * @param bridgeOperators An array of addresses representing the bridge operators to remove.\\n * @return removeds An array of booleans indicating whether each bridge operator was removed successfully.\\n *\\n * * Note: return boolean array `removeds` indicates whether a group (voteWeight, governor, operator) are recorded.\\n * It is expected that FE/BE staticcall to the function first to get the return values and handle it correctly.\\n * Governors are expected to see the outcome of this function and decide if they want to vote for the proposal or not.\\n *\\n * Example Usage:\\n * Making an `eth_call` in ethers.js\\n * ```\\n * const {removeds} = await bridgeManagerContract.callStatic.removeBridgeOperators(\\n * bridgeOperators,\\n * // overriding the caller to the contract itself since we use `onlySelfCall` guard\\n * {from: bridgeManagerContract.address}\\n * )\\n * const filteredOperators = bridgeOperators.filter((_, index) => removeds[index]);\\n * // ... (Process or use the information as required) ...\\n * ```\\n */\\n function removeBridgeOperators(address[] calldata bridgeOperators) external returns (bool[] memory removeds);\\n\\n /**\\n * @dev Governor updates their corresponding governor and/or operator address.\\n * Requirements:\\n * - The caller must the governor of the operator that is requested changes.\\n * @param bridgeOperator The address of the bridge operator to update.\\n */\\n function updateBridgeOperator(address bridgeOperator) external;\\n}\\n\",\"keccak256\":\"0xf3d02d806105015a62ddccd43fb46ba2ebd760cdc70839fa0a9c870f6abca5c0\",\"license\":\"MIT\"},\"contracts/interfaces/bridge/IBridgeReward.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport { IBridgeRewardEvents } from \\\"./events/IBridgeRewardEvents.sol\\\";\\n\\ninterface IBridgeReward is IBridgeRewardEvents {\\n /**\\n * @dev This function allows bridge operators to manually synchronize the reward for a given period length.\\n * @param periodLength The length of the reward period for which synchronization is requested.\\n */\\n function syncReward(uint256 periodLength) external;\\n\\n /**\\n * @dev Receives RON from any address.\\n */\\n function receiveRON() external payable;\\n\\n /**\\n * @dev Invoke calculate and transfer reward to operators based on their performance.\\n *\\n * Requirements:\\n * - This method is only called once each period.\\n * - The caller must be the bridge tracking contract or a bridge operator.\\n */\\n function execSyncReward(\\n address[] calldata operators,\\n uint256[] calldata ballots,\\n uint256 totalBallot,\\n uint256 totalVote,\\n uint256 period\\n ) external;\\n\\n /**\\n * @dev Retrieve the total amount of rewards that have been topped up in the contract.\\n * @return totalRewardToppedUp The total rewards topped up value.\\n */\\n function getTotalRewardToppedUp() external view returns (uint256);\\n\\n /**\\n * @dev Retrieve the total amount of rewards that have been scattered to bridge operators in the contract.\\n * @return totalRewardScattered The total rewards scattered value.\\n */\\n function getTotalRewardScattered() external view returns (uint256);\\n\\n /**\\n * @dev Getter for all bridge operators per period.\\n */\\n function getRewardPerPeriod() external view returns (uint256);\\n\\n /**\\n * @dev External function to retrieve the latest rewarded period in the contract.\\n * @return latestRewardedPeriod The latest rewarded period value.\\n */\\n function getLatestRewardedPeriod() external view returns (uint256);\\n\\n /**\\n * @dev Setter for all bridge operators per period.\\n */\\n function setRewardPerPeriod(uint256 rewardPerPeriod) external;\\n}\\n\",\"keccak256\":\"0x781f5b4e9257231f008457d41b277058fe6a2b7366ecd3d64bce2591d0eaa216\",\"license\":\"MIT\"},\"contracts/interfaces/bridge/IBridgeSlash.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IBridgeSlashEvents } from \\\"./events/IBridgeSlashEvents.sol\\\";\\n\\n/**\\n * @title IBridgeSlash\\n * @dev Interface for the BridgeSlash contract to manage slashing functionality for bridge operators.\\n */\\ninterface IBridgeSlash is IBridgeSlashEvents {\\n /**\\n * @dev Slashes the unavailability of bridge operators during a specific period.\\n * @param period The period to slash the bridge operators for.\\n */\\n function execSlashBridgeOperators(\\n address[] calldata operators,\\n uint256[] calldata ballots,\\n uint256 totalBallot,\\n uint256 totalVote,\\n uint256 period\\n ) external returns (bool slashed);\\n\\n /**\\n * @dev Returns the penalize durations for the specified bridge operators.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @return untilPeriods The penalized periods for the bridge operators.\\n */\\n function getSlashUntilPeriodOf(address[] calldata bridgeOperators) external returns (uint256[] memory untilPeriods);\\n\\n /**\\n * @dev Retrieves the added periods of the specified bridge operators.\\n * @param bridgeOperators An array of bridge operator addresses.\\n * @return addedPeriods An array of uint256 values representing the added periods for each bridge operator.\\n */\\n function getAddedPeriodOf(address[] calldata bridgeOperators) external view returns (uint256[] memory addedPeriods);\\n\\n /**\\n * @dev Gets the slash tier based on the given ballot and total ballots.\\n * @param ballot The ballot count for a bridge operator.\\n * @param totalVote The total vote count for the period.\\n * @return tier The slash tier.\\n */\\n function getSlashTier(uint256 ballot, uint256 totalVote) external pure returns (Tier tier);\\n\\n /**\\n * @dev Retrieve the penalty durations for different slash tiers.\\n * @return penaltyDurations The array of penalty durations for each slash tier.\\n */\\n function getPenaltyDurations() external pure returns (uint256[] memory penaltyDurations);\\n\\n /**\\n * @dev Returns the penalty duration for Tier 1 slashing.\\n * @return The duration in period number for Tier 1 slashing.\\n */\\n function TIER_1_PENALTY_DURATION() external view returns (uint256);\\n\\n /**\\n * @dev Returns the penalty duration for Tier 2 slashing.\\n * @return The duration in period number for Tier 2 slashing.\\n */\\n function TIER_2_PENALTY_DURATION() external view returns (uint256);\\n\\n /**\\n * @dev Returns the threshold duration for removing bridge operators.\\n * @return The duration in period number that exceeds which a bridge operator will be removed.\\n */\\n function REMOVE_DURATION_THRESHOLD() external view returns (uint256);\\n\\n /**\\n * @dev External function to retrieve the value of the minimum vote threshold to execute slashing rule.\\n * @return minimumVoteThreshold The minimum vote threshold value.\\n */\\n function MINIMUM_VOTE_THRESHOLD() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x45f7a50e6f2e25d9d1ac8abf0eafd1b7579d625245b9269840d42a476745e735\",\"license\":\"MIT\"},\"contracts/interfaces/bridge/IBridgeTracking.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeTracking {\\n struct Request {\\n VoteKind kind;\\n uint256 id;\\n }\\n\\n enum VoteKind {\\n Deposit,\\n Withdrawal,\\n MainchainWithdrawal\\n }\\n\\n event ExternalCallFailed(address indexed to, bytes4 indexed msgSig, bytes reason);\\n\\n /**\\n * @dev Returns the block that allow incomming mutable call.\\n */\\n function startedAtBlock() external view returns (uint256);\\n\\n /**\\n * @dev Returns the total number of votes at the specific period `_period`.\\n */\\n function totalVote(uint256 _period) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total number of ballots at the specific period `_period`.\\n */\\n function totalBallot(uint256 _period) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total number of ballots of bridge operators at the specific period `_period`.\\n */\\n function getManyTotalBallots(\\n uint256 _period,\\n address[] calldata _bridgeOperators\\n ) external view returns (uint256[] memory);\\n\\n /**\\n * @dev Returns the total number of ballots of a bridge operator at the specific period `_period`.\\n */\\n function totalBallotOf(uint256 _period, address _bridgeOperator) external view returns (uint256);\\n\\n /**\\n * @dev Handles the request once it is approved.\\n *\\n * Requirements:\\n * - The method caller is the bridge contract.\\n *\\n */\\n function handleVoteApproved(VoteKind _kind, uint256 _requestId) external;\\n\\n /**\\n * @dev Records vote for a receipt and a operator.\\n *\\n * Requirements:\\n * - The method caller is the bridge contract.\\n *\\n */\\n function recordVote(VoteKind _kind, uint256 _requestId, address _operator) external;\\n}\\n\",\"keccak256\":\"0x092841025351341cf7ff9cbf0eb6ef78752ffd2b1af329cb6048996d20c789a9\",\"license\":\"MIT\"},\"contracts/interfaces/bridge/events/IBridgeManagerEvents.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeManagerEvents {\\n /**\\n * @dev The structure representing information about a bridge operator.\\n * @param addr The address of the bridge operator.\\n * @param voteWeight The vote weight assigned to the bridge operator.\\n */\\n struct BridgeOperatorInfo {\\n address addr;\\n uint96 voteWeight;\\n }\\n\\n /**\\n * @dev Emitted when new bridge operators are added.\\n * @param statuses The array of boolean values represents whether the corresponding bridge operator is added successfully.\\n * @param voteWeights The array of vote weights assigned to the added bridge operators.\\n * @param governors The array of addresses representing the governors associated with the added bridge operators.\\n * @param bridgeOperators The array of addresses representing the added bridge operators.\\n */\\n event BridgeOperatorsAdded(bool[] statuses, uint96[] voteWeights, address[] governors, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when bridge operators are removed.\\n * @param statuses The array of boolean values representing the statuses of the removed bridge operators.\\n * @param bridgeOperators The array of addresses representing the removed bridge operators.\\n */\\n event BridgeOperatorsRemoved(bool[] statuses, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is updated.\\n * @param governor The address of the governor initiating the update.\\n * @param fromBridgeOperator The address of the bridge operator being updated.\\n * @param toBridgeOperator The updated address of the bridge operator.\\n */\\n event BridgeOperatorUpdated(\\n address indexed governor,\\n address indexed fromBridgeOperator,\\n address indexed toBridgeOperator\\n );\\n}\\n\",\"keccak256\":\"0x217fff41c4a9ca72d142c5a2120bb1b5e67bf5bf5aa0f6128450116aebc07b8d\",\"license\":\"MIT\"},\"contracts/interfaces/bridge/events/IBridgeRewardEvents.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeRewardEvents {\\n /**\\n * @dev Reward-related information for a bridge operator.\\n * @param claimed The amount of rewards claimed by the bridge operator.\\n * @param slashed The amount of rewards that have been slashed from the bridge operator.\\n */\\n struct BridgeRewardInfo {\\n uint256 claimed;\\n uint256 slashed;\\n }\\n\\n /**\\n * @dev Emitted when RON are safely received as rewards in the contract.\\n * @param from The address of the sender who transferred RON tokens as rewards.\\n * @param balanceBefore The balance of the contract before receiving the RON tokens.\\n * @param amount The amount of RON received.\\n */\\n event SafeReceived(address indexed from, uint256 balanceBefore, uint256 amount);\\n /// @dev Event emitted when the reward per period config is updated.\\n event UpdatedRewardPerPeriod(uint256 newRewardPerPeriod);\\n /// @dev Event emitted when the reward of the `operator` is scattered with `amount`.\\n event BridgeRewardScattered(uint256 indexed period, address operator, uint256 amount);\\n /// @dev Event emitted when the reward of the `operator` is slashed with `amount`.\\n event BridgeRewardSlashed(uint256 indexed period, address operator, uint256 amount);\\n /// @dev Event emitted when the reward of the `operator` is scattered with `amount` but failed to transfer.\\n event BridgeRewardScatterFailed(uint256 indexed period, address operator, uint256 amount);\\n /// @dev Event emitted when the requesting period to sync is too far.\\n event BridgeRewardSyncTooFarPeriod(uint256 requestingPeriod, uint256 latestPeriod);\\n}\\n\",\"keccak256\":\"0xf0efa7130ba933552a16b7fb4040f23e276a41d8d698f27b11c3f82930916e51\",\"license\":\"MIT\"},\"contracts/interfaces/bridge/events/IBridgeSlashEvents.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeSlashEvents {\\n /**\\n * @dev Enumeration representing the slashing tiers for bridge operators.\\n */\\n enum Tier {\\n Tier0,\\n Tier1,\\n Tier2\\n }\\n\\n /**\\n * @dev Struct representing the status of a bridge operator.\\n */\\n struct BridgeSlashInfo {\\n uint128 slashUntilPeriod;\\n uint128 newlyAddedAtPeriod;\\n }\\n\\n /**\\n * @dev Event emitted when a bridge operator is slashed.\\n * @param tier The slash tier of the operator.\\n * @param bridgeOperator The address of the slashed bridge operator.\\n * @param period The period in which the operator is slashed.\\n * @param slashUntilPeriod The period until which the operator is penalized.\\n */\\n event Slashed(Tier indexed tier, address indexed bridgeOperator, uint256 indexed period, uint256 slashUntilPeriod);\\n\\n /**\\n * @dev Emitted when a removal request is made for a bridge operator.\\n * @param period The period for which the removal request is made.\\n * @param bridgeOperator The address of the bridge operator being requested for removal.\\n */\\n event RemovalRequested(uint256 indexed period, address indexed bridgeOperator);\\n}\\n\",\"keccak256\":\"0x9611e0d8b85b50bdd8ba9e8148564af526e78ccce5d202e7c84043d2d2ccb75f\",\"license\":\"MIT\"},\"contracts/interfaces/collections/IHasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport { ContractType } from \\\"../../utils/ContractType.sol\\\";\\n\\ninterface IHasContracts {\\n /// @dev Error of invalid role.\\n error ErrContractTypeNotFound(ContractType contractType);\\n\\n /// @dev Emitted when a contract is updated.\\n event ContractUpdated(ContractType indexed contractType, address indexed addr);\\n\\n /**\\n * @dev Returns the address of a contract with a specific role.\\n * Throws an error if no contract is set for the specified role.\\n *\\n * @param contractType The role of the contract to retrieve.\\n * @return contract_ The address of the contract with the specified role.\\n */\\n function getContract(ContractType contractType) external view returns (address contract_);\\n\\n /**\\n * @dev Sets the address of a contract with a specific role.\\n * Emits the event {ContractUpdated}.\\n * @param contractType The role of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function setContract(ContractType contractType, address addr) external;\\n}\\n\",\"keccak256\":\"0x99d8213d857e30d367155abd15dc42730afdfbbac3a22dfb3b95ffea2083a92e\",\"license\":\"MIT\"},\"contracts/interfaces/validator/ICandidateManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface ICandidateManager {\\n struct ValidatorCandidate {\\n // Admin of the candidate\\n address admin;\\n // Address of the validator that produces block, e.g. block.coinbase. This is so-called validator address.\\n address consensusAddr;\\n // Address that receives mining reward of the validator\\n address payable treasuryAddr;\\n // Address of the bridge operator corresponding to the candidate\\n address ______deprecatedbridgeOperatorAddr;\\n // The percentage of reward that validators can be received, the rest goes to the delegators.\\n // Values in range [0; 100_00] stands for 0-100%\\n uint256 commissionRate;\\n // The timestamp that scheduled to revoke the candidate (no schedule=0)\\n uint256 revokingTimestamp;\\n // The deadline that the candidate must top up staking amount to keep it larger than or equal to the threshold (no deadline=0)\\n uint256 topupDeadline;\\n }\\n\\n struct CommissionSchedule {\\n // The timestamp that the commission schedule gets affected (no schedule=0).\\n uint256 effectiveTimestamp;\\n // The new commission rate. Value is in range [0; 100_00], stands for 0-100%\\n uint256 commissionRate;\\n }\\n\\n /// @dev Emitted when the maximum number of validator candidates is updated.\\n event MaxValidatorCandidateUpdated(uint256 threshold);\\n /// @dev Emitted when the min offset to the effective date of commission rate change is updated.\\n event MinEffectiveDaysOnwardsUpdated(uint256 numOfDays);\\n /// @dev Emitted when the validator candidate is granted.\\n event CandidateGranted(address indexed consensusAddr, address indexed treasuryAddr, address indexed admin);\\n /// @dev Emitted when the revoking timestamp of a candidate is updated.\\n event CandidateRevokingTimestampUpdated(address indexed consensusAddr, uint256 revokingTimestamp);\\n /// @dev Emitted when the topup deadline of a candidate is updated.\\n event CandidateTopupDeadlineUpdated(address indexed consensusAddr, uint256 topupDeadline);\\n /// @dev Emitted when the validator candidate is revoked.\\n event CandidatesRevoked(address[] consensusAddrs);\\n\\n /// @dev Emitted when a schedule for updating commission rate is set.\\n event CommissionRateUpdateScheduled(address indexed consensusAddr, uint256 effectiveTimestamp, uint256 rate);\\n /// @dev Emitted when the commission rate of a validator is updated.\\n event CommissionRateUpdated(address indexed consensusAddr, uint256 rate);\\n\\n /// @dev Error of exceeding maximum number of candidates.\\n error ErrExceedsMaxNumberOfCandidate();\\n /// @dev Error of querying for already existent candidate.\\n error ErrExistentCandidate();\\n /// @dev Error of querying for non-existent candidate.\\n error ErrNonExistentCandidate();\\n /// @dev Error of candidate admin already exists.\\n error ErrExistentCandidateAdmin(address _candidateAdminAddr);\\n /// @dev Error of treasury already exists.\\n error ErrExistentTreasury(address _treasuryAddr);\\n /// @dev Error of invalid commission rate.\\n error ErrInvalidCommissionRate();\\n /// @dev Error of invalid effective days onwards.\\n error ErrInvalidEffectiveDaysOnwards();\\n /// @dev Error of invalid min effective days onwards.\\n error ErrInvalidMinEffectiveDaysOnwards();\\n /// @dev Error of already requested revoking candidate before.\\n error ErrAlreadyRequestedRevokingCandidate();\\n /// @dev Error of commission change schedule exists.\\n error ErrAlreadyRequestedUpdatingCommissionRate();\\n /// @dev Error of trusted org cannot renounce.\\n error ErrTrustedOrgCannotRenounce();\\n\\n /**\\n * @dev Returns the maximum number of validator candidate.\\n */\\n function maxValidatorCandidate() external view returns (uint256);\\n\\n /**\\n * @dev Returns the minimum number of days to the effective date of commission rate change.\\n */\\n function minEffectiveDaysOnwards() external view returns (uint256);\\n\\n /**\\n * @dev Sets the maximum number of validator candidate.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `MaxValidatorCandidateUpdated` event.\\n *\\n */\\n function setMaxValidatorCandidate(uint256) external;\\n\\n /**\\n * @dev Sets the minimum number of days to the effective date of commision rate change.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `MinEffectiveDaysOnwardsUpdated` event.\\n *\\n */\\n function setMinEffectiveDaysOnwards(uint256 _numOfDays) external;\\n\\n /**\\n * @dev Grants a validator candidate.\\n *\\n * Requirements:\\n * - The method caller is staking contract.\\n *\\n * Emits the event `CandidateGranted`.\\n *\\n */\\n function execApplyValidatorCandidate(\\n address _admin,\\n address _consensusAddr,\\n address payable _treasuryAddr,\\n uint256 _commissionRate\\n ) external;\\n\\n /**\\n * @dev Requests to revoke a validator candidate in next `_secsLeft` seconds.\\n *\\n * Requirements:\\n * - The method caller is staking contract.\\n *\\n * Emits the event `CandidateRevokingTimestampUpdated`.\\n *\\n */\\n function execRequestRenounceCandidate(address, uint256 _secsLeft) external;\\n\\n /**\\n * @dev Fallback function of `CandidateStaking-requestUpdateCommissionRate`.\\n *\\n * Requirements:\\n * - The method caller is the staking contract.\\n * - The `_effectiveTimestamp` must be the beginning of a UTC day, and at least from 7 days onwards\\n * - The `_rate` must be in range of [0_00; 100_00].\\n *\\n * Emits the event `CommissionRateUpdateScheduled`.\\n *\\n */\\n function execRequestUpdateCommissionRate(address _consensusAddr, uint256 _effectiveTimestamp, uint256 _rate) external;\\n\\n /**\\n * @dev Returns whether the address is a validator (candidate).\\n */\\n function isValidatorCandidate(address _addr) external view returns (bool);\\n\\n /**\\n * @dev Returns the validator candidate.\\n */\\n function getValidatorCandidates() external view returns (address[] memory);\\n\\n /**\\n * @dev Returns all candidate info.\\n */\\n function getCandidateInfos() external view returns (ValidatorCandidate[] memory);\\n\\n /**\\n * @dev Returns the info of a candidate.\\n */\\n function getCandidateInfo(address _candidate) external view returns (ValidatorCandidate memory);\\n\\n /**\\n * @dev Returns whether the address is the candidate admin.\\n */\\n function isCandidateAdmin(address _candidate, address _admin) external view returns (bool);\\n\\n /**\\n * @dev Returns the schedule of changing commission rate of a candidate address.\\n */\\n function getCommissionChangeSchedule(address _candidate) external view returns (CommissionSchedule memory);\\n}\\n\",\"keccak256\":\"0x9ab205c736f1bcc9a3debe06e08d829f4857141d940e6f608236f136193a7f49\",\"license\":\"MIT\"},\"contracts/interfaces/validator/ICoinbaseExecution.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"./ISlashingExecution.sol\\\";\\n\\ninterface ICoinbaseExecution is ISlashingExecution {\\n enum BlockRewardDeprecatedType {\\n UNKNOWN,\\n UNAVAILABILITY,\\n AFTER_BAILOUT\\n }\\n\\n /// @dev Emitted when the validator set is updated\\n event ValidatorSetUpdated(uint256 indexed period, address[] consensusAddrs);\\n /// @dev Emitted when the bridge operator set is updated, to mirror the in-jail and maintaining status of the validator.\\n event BlockProducerSetUpdated(uint256 indexed period, uint256 indexed epoch, address[] consensusAddrs);\\n /// @dev Emitted when the bridge operator set is updated.\\n event BridgeOperatorSetUpdated(uint256 indexed period, uint256 indexed epoch, address[] bridgeOperators);\\n\\n /// @dev Emitted when the reward of the block producer is deprecated.\\n event BlockRewardDeprecated(\\n address indexed coinbaseAddr,\\n uint256 rewardAmount,\\n BlockRewardDeprecatedType deprecatedType\\n );\\n /// @dev Emitted when the block reward is submitted.\\n event BlockRewardSubmitted(address indexed coinbaseAddr, uint256 submittedAmount, uint256 bonusAmount);\\n\\n /// @dev Emitted when the block producer reward is distributed.\\n event MiningRewardDistributed(address indexed consensusAddr, address indexed recipient, uint256 amount);\\n /// @dev Emitted when the contract fails when distributing the block producer reward.\\n event MiningRewardDistributionFailed(\\n address indexed consensusAddr,\\n address indexed recipient,\\n uint256 amount,\\n uint256 contractBalance\\n );\\n\\n /// @dev Emitted when the bridge operator reward is distributed.\\n event BridgeOperatorRewardDistributed(\\n address indexed consensusAddr,\\n address indexed bridgeOperator,\\n address indexed recipientAddr,\\n uint256 amount\\n );\\n /// @dev Emitted when the contract fails when distributing the bridge operator reward.\\n event BridgeOperatorRewardDistributionFailed(\\n address indexed consensusAddr,\\n address indexed bridgeOperator,\\n address indexed recipient,\\n uint256 amount,\\n uint256 contractBalance\\n );\\n\\n /// @dev Emitted when the amount of RON reward is distributed to staking contract.\\n event StakingRewardDistributed(uint256 totalAmount, address[] consensusAddrs, uint256[] amounts);\\n /// @dev Emitted when the contracts fails when distributing the amount of RON to the staking contract.\\n event StakingRewardDistributionFailed(\\n uint256 totalAmount,\\n address[] consensusAddrs,\\n uint256[] amounts,\\n uint256 contractBalance\\n );\\n\\n /// @dev Emitted when the epoch is wrapped up.\\n event WrappedUpEpoch(uint256 indexed periodNumber, uint256 indexed epochNumber, bool periodEnding);\\n\\n /// @dev Error of method caller must be coinbase\\n error ErrCallerMustBeCoinbase();\\n /// @dev Error of only allowed at the end of epoch\\n error ErrAtEndOfEpochOnly();\\n /// @dev Error of query for already wrapped up epoch\\n error ErrAlreadyWrappedEpoch();\\n\\n /**\\n * @dev Submits reward of the current block.\\n *\\n * Requirements:\\n * - The method caller is coinbase.\\n *\\n * Emits the event `MiningRewardDeprecated` if the coinbase is slashed or no longer be a block producer.\\n * Emits the event `BlockRewardSubmitted` for the valid call.\\n *\\n */\\n function submitBlockReward() external payable;\\n\\n /**\\n * @dev Wraps up the current epoch.\\n *\\n * Requirements:\\n * - The method must be called when the current epoch is ending.\\n * - The epoch is not wrapped yet.\\n * - The method caller is coinbase.\\n *\\n * Emits the event `MiningRewardDistributed` when some validator has reward distributed.\\n * Emits the event `StakingRewardDistributed` when some staking pool has reward distributed.\\n * Emits the event `BlockProducerSetUpdated` when the epoch is wrapped up.\\n * Emits the event `BridgeOperatorSetUpdated` when the epoch is wrapped up at period ending.\\n * Emits the event `ValidatorSetUpdated` when the epoch is wrapped up at period ending, and the validator set gets updated.\\n * Emits the event `WrappedUpEpoch`.\\n *\\n */\\n function wrapUpEpoch() external payable;\\n}\\n\",\"keccak256\":\"0xe4060b7e3b04a0043bd334011fe4ba67c990b0484dad52d7f14b35040989b6ab\",\"license\":\"MIT\"},\"contracts/interfaces/validator/IEmergencyExit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface IEmergencyExit {\\n /// @dev Emitted when the fund is locked from an emergency exit request\\n event EmergencyExitRequested(address indexed consensusAddr, uint256 lockedAmount);\\n /// @dev Emitted when the fund that locked from an emergency exit request is transferred to the recipient.\\n event EmergencyExitLockedFundReleased(\\n address indexed consensusAddr,\\n address indexed recipient,\\n uint256 unlockedAmount\\n );\\n /// @dev Emitted when the fund that locked from an emergency exit request is failed to transferred back.\\n event EmergencyExitLockedFundReleasingFailed(\\n address indexed consensusAddr,\\n address indexed recipient,\\n uint256 unlockedAmount,\\n uint256 contractBalance\\n );\\n\\n /// @dev Emitted when the emergency exit locked amount is updated.\\n event EmergencyExitLockedAmountUpdated(uint256 amount);\\n /// @dev Emitted when the emergency expiry duration is updated.\\n event EmergencyExpiryDurationUpdated(uint256 amount);\\n\\n /// @dev Error of already requested emergency exit before.\\n error ErrAlreadyRequestedEmergencyExit();\\n\\n /**\\n * @dev Returns the amount of RON to lock from a consensus address.\\n */\\n function emergencyExitLockedAmount() external returns (uint256);\\n\\n /**\\n * @dev Returns the duration that an emergency request is expired and the fund will be recycled.\\n */\\n function emergencyExpiryDuration() external returns (uint256);\\n\\n /**\\n * @dev Sets the amount of RON to lock from a consensus address.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the event `EmergencyExitLockedAmountUpdated`.\\n *\\n */\\n function setEmergencyExitLockedAmount(uint256 _emergencyExitLockedAmount) external;\\n\\n /**\\n * @dev Sets the duration that an emergency request is expired and the fund will be recycled.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the event `EmergencyExpiryDurationUpdated`.\\n *\\n */\\n function setEmergencyExpiryDuration(uint256 _emergencyExpiryDuration) external;\\n\\n /**\\n * @dev Unlocks fund for emergency exit request.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the event `EmergencyExitLockedFundReleased` if the fund is successfully unlocked.\\n * Emits the event `EmergencyExitLockedFundReleasingFailed` if the fund is failed to unlock.\\n *\\n */\\n function execReleaseLockedFundForEmergencyExitRequest(address _consensusAddr, address payable _recipient) external;\\n\\n /**\\n * @dev Fallback function of `IStaking-requestEmergencyExit`.\\n *\\n * Requirements:\\n * - The method caller is staking contract.\\n *\\n */\\n function execEmergencyExit(address _consensusAddr, uint256 _secLeftToRevoke) external;\\n}\\n\",\"keccak256\":\"0x45161abd1e3db83052a06889a0e3a7a5e7ee3306478601d58ac4ed32ccaa75ad\",\"license\":\"MIT\"},\"contracts/interfaces/validator/IRoninValidatorSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"./ICandidateManager.sol\\\";\\nimport \\\"./info-fragments/ICommonInfo.sol\\\";\\nimport \\\"./ICoinbaseExecution.sol\\\";\\nimport \\\"./ISlashingExecution.sol\\\";\\nimport \\\"./IEmergencyExit.sol\\\";\\n\\ninterface IRoninValidatorSet is\\n ICandidateManager,\\n ICommonInfo,\\n ISlashingExecution,\\n ICoinbaseExecution,\\n IEmergencyExit\\n{}\\n\",\"keccak256\":\"0x813f34747aea4dfb53bbc147abf8dbe5999ce73111c2db99bcb3efb4cf75bb3d\",\"license\":\"MIT\"},\"contracts/interfaces/validator/ISlashingExecution.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface ISlashingExecution {\\n /// @dev Emitted when the validator is punished.\\n event ValidatorPunished(\\n address indexed consensusAddr,\\n uint256 indexed period,\\n uint256 jailedUntil,\\n uint256 deductedStakingAmount,\\n bool blockProducerRewardDeprecated,\\n bool bridgeOperatorRewardDeprecated\\n );\\n /// @dev Emitted when the validator get out of jail by bailout.\\n event ValidatorUnjailed(address indexed validator, uint256 period);\\n\\n /// @dev Error of cannot bailout due to high tier slash.\\n error ErrCannotBailout(address validator);\\n\\n /**\\n * @dev Finalize the slash request from slash indicator contract.\\n *\\n * Requirements:\\n * - The method caller is slash indicator contract.\\n *\\n * Emits the event `ValidatorPunished`.\\n *\\n */\\n function execSlash(\\n address _validatorAddr,\\n uint256 _newJailedUntil,\\n uint256 _slashAmount,\\n bool _cannotBailout\\n ) external;\\n\\n /**\\n * @dev Finalize the bailout request from slash indicator contract.\\n *\\n * Requirements:\\n * - The method caller is slash indicator contract.\\n *\\n * Emits the event `ValidatorUnjailed`.\\n *\\n */\\n function execBailOut(address _validatorAddr, uint256 _period) external;\\n}\\n\",\"keccak256\":\"0x80362c42fdc0ee06543a2abbffee961fe51c15a7c5e18933a9c34897e50d07fe\",\"license\":\"MIT\"},\"contracts/interfaces/validator/info-fragments/ICommonInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"./IJailingInfo.sol\\\";\\nimport \\\"./ITimingInfo.sol\\\";\\nimport \\\"./IValidatorInfoV2.sol\\\";\\n\\ninterface ICommonInfo is ITimingInfo, IJailingInfo, IValidatorInfoV2 {\\n struct EmergencyExitInfo {\\n uint256 lockedAmount;\\n // The timestamp that this locked amount will be recycled to staking vesting contract\\n uint256 recyclingAt;\\n }\\n\\n /// @dev Emitted when the deprecated reward is withdrawn.\\n event DeprecatedRewardRecycled(address indexed recipientAddr, uint256 amount);\\n /// @dev Emitted when the deprecated reward withdrawal is failed\\n event DeprecatedRewardRecycleFailed(address indexed recipientAddr, uint256 amount, uint256 balance);\\n\\n /// @dev Error thrown when receives RON from neither staking vesting contract nor staking contract\\n error ErrUnauthorizedReceiveRON();\\n /// @dev Error thrown when queries for a non existent info.\\n error NonExistentRecyclingInfo();\\n\\n /**\\n * @dev Returns the total deprecated reward, which includes reward that is not sent for slashed validators and unsastified bridge operators\\n */\\n function totalDeprecatedReward() external view returns (uint256);\\n\\n /**\\n * @dev Returns the emergency exit request.\\n */\\n function getEmergencyExitInfo(address _consensusAddr) external view returns (EmergencyExitInfo memory);\\n}\\n\",\"keccak256\":\"0x3fdfa86da33b889e5153075ffc028d6b0c607480a96b532fbbbc48ac7bbf27c9\",\"license\":\"MIT\"},\"contracts/interfaces/validator/info-fragments/IJailingInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface IJailingInfo {\\n /**\\n * @dev Returns whether the validator are put in jail (cannot join the set of validators) during the current period.\\n */\\n function checkJailed(address) external view returns (bool);\\n\\n /**\\n * @dev Returns whether the validator are put in jail and the number of block and epoch that he still is in the jail.\\n */\\n function getJailedTimeLeft(\\n address _addr\\n ) external view returns (bool isJailed_, uint256 blockLeft_, uint256 epochLeft_);\\n\\n /**\\n * @dev Returns whether the validator are put in jail (cannot join the set of validators) at a specific block.\\n */\\n function checkJailedAtBlock(address _addr, uint256 _blockNum) external view returns (bool);\\n\\n /**\\n * @dev Returns whether the validator are put in jail at a specific block and the number of block and epoch that he still is in the jail.\\n */\\n function getJailedTimeLeftAtBlock(\\n address _addr,\\n uint256 _blockNum\\n ) external view returns (bool isJailed_, uint256 blockLeft_, uint256 epochLeft_);\\n\\n /**\\n * @dev Returns whether the validators are put in jail (cannot join the set of validators) during the current period.\\n */\\n function checkManyJailed(address[] calldata) external view returns (bool[] memory);\\n\\n /**\\n * @dev Returns whether the incoming reward of the block producer is deprecated during the current period.\\n */\\n function checkMiningRewardDeprecated(address _blockProducer) external view returns (bool);\\n\\n /**\\n * @dev Returns whether the incoming reward of the block producer is deprecated during a specific period.\\n */\\n function checkMiningRewardDeprecatedAtPeriod(address _blockProducer, uint256 _period) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2b1846b05ca1d636299fb929c1bd7b392b236f5e3f7aa3e7eea2c6d57b8836fb\",\"license\":\"MIT\"},\"contracts/interfaces/validator/info-fragments/ITimingInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface ITimingInfo {\\n /**\\n * @dev Returns the block that validator set was updated.\\n */\\n function getLastUpdatedBlock() external view returns (uint256);\\n\\n /**\\n * @dev Returns the number of blocks in a epoch.\\n */\\n function numberOfBlocksInEpoch() external view returns (uint256 _numberOfBlocks);\\n\\n /**\\n * @dev Returns the epoch index from the block number.\\n */\\n function epochOf(uint256 _block) external view returns (uint256);\\n\\n /**\\n * @dev Returns whether the epoch ending is at the block number `_block`.\\n */\\n function epochEndingAt(uint256 _block) external view returns (bool);\\n\\n /**\\n * @dev Tries to get the period index from the epoch number.\\n */\\n function tryGetPeriodOfEpoch(uint256 _epoch) external view returns (bool _filled, uint256 _periodNumber);\\n\\n /**\\n * @dev Returns whether the period ending at the current block number.\\n */\\n function isPeriodEnding() external view returns (bool);\\n\\n /**\\n * @dev Returns the period index from the current block.\\n */\\n function currentPeriod() external view returns (uint256);\\n\\n /**\\n * @dev Returns the block number that the current period starts at.\\n */\\n function currentPeriodStartAtBlock() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x77b86a68149389fed0eb0c5b8d56f278d3bd103ba64f504697d709b24c3212d5\",\"license\":\"MIT\"},\"contracts/interfaces/validator/info-fragments/IValidatorInfoV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../../../libraries/EnumFlags.sol\\\";\\n\\ninterface IValidatorInfoV2 {\\n /**\\n * @dev Error thrown when an invalid maximum prioritized validator number is provided.\\n */\\n error ErrInvalidMaxPrioritizedValidatorNumber();\\n\\n /// @dev Emitted when the number of max validator is updated.\\n event MaxValidatorNumberUpdated(uint256);\\n /// @dev Emitted when the number of reserved slots for prioritized validators is updated.\\n event MaxPrioritizedValidatorNumberUpdated(uint256);\\n\\n /**\\n * @dev Returns the maximum number of validators in the epoch.\\n */\\n function maxValidatorNumber() external view returns (uint256 _maximumValidatorNumber);\\n\\n /**\\n * @dev Returns the number of reserved slots for prioritized validators.\\n */\\n function maxPrioritizedValidatorNumber() external view returns (uint256 _maximumPrioritizedValidatorNumber);\\n\\n /**\\n * @dev Returns the current validator list.\\n */\\n function getValidators() external view returns (address[] memory _validatorList);\\n\\n /**\\n * @dev Returns the current block producer list.\\n */\\n function getBlockProducers() external view returns (address[] memory);\\n\\n /**\\n * @dev Returns whether the address is block producer or not.\\n */\\n function isBlockProducer(address _addr) external view returns (bool);\\n\\n /**\\n * @dev Returns total numbers of the block producers.\\n */\\n function totalBlockProducers() external view returns (uint256);\\n\\n /**\\n * @dev Updates the max validator number\\n *\\n * Requirements:\\n * - The method caller is admin\\n *\\n * Emits the event `MaxValidatorNumberUpdated`\\n *\\n */\\n function setMaxValidatorNumber(uint256 _maxValidatorNumber) external;\\n\\n /**\\n * @dev Updates the number of reserved slots for prioritized validators\\n *\\n * Requirements:\\n * - The method caller is admin\\n *\\n * Emits the event `MaxPrioritizedValidatorNumberUpdated`\\n *\\n */\\n function setMaxPrioritizedValidatorNumber(uint256 _maxPrioritizedValidatorNumber) external;\\n}\\n\",\"keccak256\":\"0x6213c188a1323b242a098394b91caf9481e257bd57a0804cb2aa890377a993ed\",\"license\":\"MIT\"},\"contracts/libraries/AddressArrayUtils.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\nlibrary AddressArrayUtils {\\n /**\\n * @dev Error thrown when a duplicated element is detected in an array.\\n * @param msgSig The function signature that invoke the error.\\n */\\n error ErrDuplicated(bytes4 msgSig);\\n\\n /**\\n * @dev Returns whether or not there's a duplicate. Runs in O(n^2).\\n * @param A Array to search\\n * @return Returns true if duplicate, false otherwise\\n */\\n function hasDuplicate(address[] memory A) internal pure returns (bool) {\\n if (A.length == 0) {\\n return false;\\n }\\n unchecked {\\n for (uint256 i = 0; i < A.length - 1; i++) {\\n for (uint256 j = i + 1; j < A.length; j++) {\\n if (A[i] == A[j]) {\\n return true;\\n }\\n }\\n }\\n }\\n return false;\\n }\\n\\n /**\\n * @dev Returns whether two arrays of addresses are equal or not.\\n */\\n function isEqual(address[] memory _this, address[] memory _other) internal pure returns (bool yes_) {\\n // Hashing two arrays and compare their hash\\n assembly {\\n let _thisHash := keccak256(add(_this, 32), mul(mload(_this), 32))\\n let _otherHash := keccak256(add(_other, 32), mul(mload(_other), 32))\\n yes_ := eq(_thisHash, _otherHash)\\n }\\n }\\n\\n /**\\n * @dev Return the concatenated array from a and b.\\n */\\n function extend(address[] memory a, address[] memory b) internal pure returns (address[] memory c) {\\n uint256 lengthA = a.length;\\n uint256 lengthB = b.length;\\n unchecked {\\n c = new address[](lengthA + lengthB);\\n }\\n uint256 i;\\n for (; i < lengthA; ) {\\n c[i] = a[i];\\n unchecked {\\n ++i;\\n }\\n }\\n for (uint256 j; j < lengthB; ) {\\n c[i] = b[j];\\n unchecked {\\n ++i;\\n ++j;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xaf760162653a85d6e1b24df4d33c74076f778470112f421a02050fb981242001\",\"license\":\"UNLICENSED\"},\"contracts/libraries/EnumFlags.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This library implements checking flag of an enumerated value.\\n * The originated idea is inherited from [Enum.HashFlag(Enum)](https://learn.microsoft.com/en-us/dotnet/api/system.enum.hasflag?view=net-6.0) method of C#.\\n */\\nlibrary EnumFlags {\\n enum ValidatorFlag {\\n None, // bit(00)\\n BlockProducer, // bit(01)\\n DeprecatedBridgeOperator, // bit(10)\\n Both // bit(11)\\n }\\n\\n function isNone(ValidatorFlag _value) internal pure returns (bool) {\\n return uint8(_value) == 0;\\n }\\n\\n /**\\n * @dev Checks if `_value` has `_flag`.\\n */\\n function hasFlag(ValidatorFlag _value, ValidatorFlag _flag) internal pure returns (bool) {\\n return (uint8(_value) & uint8(_flag)) != 0;\\n }\\n\\n /**\\n * @dev Calculate new value of `_value` after adding `_flag`.\\n */\\n function addFlag(ValidatorFlag _value, ValidatorFlag _flag) internal pure returns (ValidatorFlag) {\\n return ValidatorFlag(uint8(_value) | uint8(_flag));\\n }\\n\\n /**\\n * @dev Calculate new value of `_value` after remove `_flag`.\\n */\\n function removeFlag(ValidatorFlag _value, ValidatorFlag _flag) internal pure returns (ValidatorFlag) {\\n return ValidatorFlag(uint8(_value) & ~uint8(_flag));\\n }\\n}\\n\",\"keccak256\":\"0xa712f0d1a323ee39f23eb3ee3278b4ec25fe2e536b1ccc629578c66f277c088d\",\"license\":\"UNLICENSED\"},\"contracts/libraries/Math.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\nlibrary Math {\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a >= b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns whether the number `c` is in range of [a; b].\\n */\\n function inRange(uint256 c, uint256 a, uint256 b) internal pure returns (bool) {\\n return a <= c && c <= b;\\n }\\n\\n /**\\n * @dev Returns whether two inclusive ranges [x1;x2] and [y1;y2] overlap.\\n */\\n function twoRangeOverlap(uint256 x1, uint256 x2, uint256 y1, uint256 y2) internal pure returns (bool) {\\n return x1 <= y2 && y1 <= x2;\\n }\\n\\n /**\\n * @dev Returns value of a + b; in case result is larger than upperbound, upperbound is returned.\\n */\\n function addWithUpperbound(uint256 a, uint256 b, uint256 upperbound) internal pure returns (uint256) {\\n return min(a + b, upperbound);\\n }\\n\\n /**\\n * @dev Returns value of a - b; in case of negative result, 0 is returned.\\n */\\n function subNonNegative(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a - b : 0;\\n }\\n\\n /**\\n * @dev Returns value of `a + zeroable` if zerobale is not 0; otherwise, return 0.\\n */\\n function addIfNonZero(uint256 a, uint256 zeroable) internal pure returns (uint256) {\\n return zeroable != 0 ? a + zeroable : 0;\\n }\\n}\\n\",\"keccak256\":\"0xd73170f448c644a47024c7dbcf4afc3cc7ad27f61737c6ea4c3b543ec5cdb7e9\",\"license\":\"UNLICENSED\"},\"contracts/ronin/gateway/BridgeReward.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport { Initializable } from \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport { BridgeTrackingHelper } from \\\"../../extensions/bridge-operator-governance/BridgeTrackingHelper.sol\\\";\\nimport { ContractType, HasContracts } from \\\"../../extensions/collections/HasContracts.sol\\\";\\nimport { RONTransferHelper } from \\\"../../extensions/RONTransferHelper.sol\\\";\\nimport { IRoninValidatorSet } from \\\"../../interfaces/validator/IRoninValidatorSet.sol\\\";\\nimport { IBridgeManager } from \\\"../../interfaces/bridge/IBridgeManager.sol\\\";\\nimport { IBridgeTracking } from \\\"../../interfaces/bridge/IBridgeTracking.sol\\\";\\nimport { IBridgeReward } from \\\"../../interfaces/bridge/IBridgeReward.sol\\\";\\nimport { IBridgeSlash } from \\\"../../interfaces/bridge/IBridgeSlash.sol\\\";\\nimport { Math } from \\\"../../libraries/Math.sol\\\";\\nimport { TUint256Slot } from \\\"../../types/Types.sol\\\";\\nimport { ErrSyncTooFarPeriod, ErrInvalidArguments, ErrLengthMismatch, ErrUnauthorizedCall } from \\\"../../utils/CommonErrors.sol\\\";\\n\\ncontract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONTransferHelper, Initializable {\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeReward.rewardInfo.slot\\\") - 1\\n bytes32 private constant REWARD_INFO_SLOT = 0x518cfd198acbffe95e740cfce1af28a3f7de51f0d784893d3d72c5cc59d7062a;\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeReward.rewardPerPeriod.slot\\\") - 1\\n TUint256Slot private constant REWARD_PER_PERIOD_SLOT =\\n TUint256Slot.wrap(0x90f7d557245e5dd9485f463e58974fa7cdc93c0abbd0a1afebb8f9640ec73910);\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeReward.latestRewardedPeriod.slot\\\") - 1\\n TUint256Slot private constant LATEST_REWARDED_PERIOD_SLOT =\\n TUint256Slot.wrap(0x2417f25874c1cdc139a787dd21df976d40d767090442b3a2496917ecfc93b619);\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeReward.totalRewardToppedUp.slot\\\") - 1\\n TUint256Slot private constant TOTAL_REWARDS_TOPPED_UP_SLOT =\\n TUint256Slot.wrap(0x9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c64);\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeReward.totalRewardScattered.slot\\\") - 1\\n TUint256Slot private constant TOTAL_REWARDS_SCATTERED_SLOT =\\n TUint256Slot.wrap(0x3663384f6436b31a97d9c9a02f64ab8b73ead575c5b6224fa0800a6bd57f62f4);\\n\\n address private immutable _self;\\n\\n constructor() payable {\\n _self = address(this);\\n _disableInitializers();\\n }\\n\\n function initialize(\\n address bridgeManagerContract,\\n address bridgeTrackingContract,\\n address bridgeSlashContract,\\n address validatorSetContract,\\n uint256 rewardPerPeriod\\n ) external payable initializer {\\n _setContract(ContractType.BRIDGE_MANAGER, bridgeManagerContract);\\n _setContract(ContractType.BRIDGE_TRACKING, bridgeTrackingContract);\\n _setContract(ContractType.BRIDGE_SLASH, bridgeSlashContract);\\n _setContract(ContractType.VALIDATOR, validatorSetContract);\\n _setRewardPerPeriod(rewardPerPeriod);\\n _syncLatestRewardedPeriod();\\n _receiveRON();\\n }\\n\\n /**\\n * @inheritdoc IBridgeReward\\n */\\n function receiveRON() external payable {\\n _receiveRON();\\n }\\n\\n /**\\n * @inheritdoc IBridgeReward\\n */\\n function syncReward(uint256 periodLength) external {\\n if (!_isBridgeOperator(msg.sender)) revert ErrUnauthorizedCall(msg.sig);\\n\\n uint256 latestRewardedPeriod = getLatestRewardedPeriod();\\n uint256 currentPeriod = IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod();\\n\\n if (currentPeriod <= latestRewardedPeriod) revert ErrInvalidArguments(msg.sig);\\n if (latestRewardedPeriod + periodLength > currentPeriod) revert ErrInvalidArguments(msg.sig);\\n\\n LATEST_REWARDED_PERIOD_SLOT.addAssign(periodLength);\\n\\n address[] memory operators = IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)).getBridgeOperators();\\n IBridgeTracking bridgeTrackingContract = IBridgeTracking(getContract(ContractType.BRIDGE_TRACKING));\\n\\n for (uint256 i = 1; i <= periodLength; ) {\\n unchecked {\\n _syncReward({\\n operators: operators,\\n ballots: bridgeTrackingContract.getManyTotalBallots(latestRewardedPeriod, operators),\\n totalBallot: bridgeTrackingContract.totalBallot(latestRewardedPeriod),\\n totalVote: bridgeTrackingContract.totalVote(latestRewardedPeriod),\\n period: latestRewardedPeriod += i\\n });\\n\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeReward\\n */\\n function execSyncReward(\\n address[] calldata operators,\\n uint256[] calldata ballots,\\n uint256 totalBallot,\\n uint256 totalVote,\\n uint256 period\\n ) external onlyContract(ContractType.BRIDGE_TRACKING) {\\n if (operators.length != ballots.length) revert ErrLengthMismatch(msg.sig);\\n if (operators.length == 0) return;\\n\\n // Only sync the period that is after the latest rewarded period.\\n unchecked {\\n uint256 latestRewardedPeriod = getLatestRewardedPeriod();\\n if (period < latestRewardedPeriod + 1) revert ErrInvalidArguments(msg.sig);\\n else if (period > latestRewardedPeriod + 1) revert ErrSyncTooFarPeriod(period, latestRewardedPeriod);\\n }\\n LATEST_REWARDED_PERIOD_SLOT.store(period);\\n\\n _syncReward({\\n operators: operators,\\n ballots: ballots,\\n totalBallot: totalBallot,\\n totalVote: totalVote,\\n period: period\\n });\\n }\\n\\n /**\\n * @inheritdoc IBridgeReward\\n */\\n function getTotalRewardToppedUp() external view returns (uint256) {\\n return TOTAL_REWARDS_TOPPED_UP_SLOT.load();\\n }\\n\\n /**\\n * @inheritdoc IBridgeReward\\n */\\n function getTotalRewardScattered() external view returns (uint256) {\\n return TOTAL_REWARDS_SCATTERED_SLOT.load();\\n }\\n\\n /**\\n * @dev Internal function to receive RON tokens as rewards and update the total topped-up rewards amount.\\n */\\n function _receiveRON() internal {\\n // prevent transfer RON directly to logic contract\\n if (address(this) == _self) revert ErrUnauthorizedCall(msg.sig);\\n\\n emit SafeReceived(msg.sender, TOTAL_REWARDS_TOPPED_UP_SLOT.load(), msg.value);\\n TOTAL_REWARDS_TOPPED_UP_SLOT.addAssign(msg.value);\\n }\\n\\n /**\\n * @dev Internal function to synchronize and distribute rewards to bridge operators for a given period.\\n * @param operators An array containing the addresses of bridge operators to receive rewards.\\n * @param ballots An array containing the individual ballot counts for each bridge operator.\\n * @param totalBallot The total number of available ballots for the period.\\n * @param totalVote The total number of votes recorded for the period.\\n * @param period The period for which the rewards are being synchronized.\\n */\\n function _syncReward(\\n address[] memory operators,\\n uint256[] memory ballots,\\n uint256 totalBallot,\\n uint256 totalVote,\\n uint256 period\\n ) internal {\\n uint256 numBridgeOperators = operators.length;\\n uint256 rewardPerPeriod = getRewardPerPeriod();\\n uint256[] memory slashedDurationList = _getSlashInfo(operators);\\n // Validate should share the reward equally\\n bool shouldShareEqually = _shouldShareEqually(totalBallot, totalVote, ballots);\\n\\n uint256 reward;\\n bool shouldSlash;\\n uint256 sumRewards;\\n\\n for (uint256 i; i < numBridgeOperators; ) {\\n (reward, shouldSlash) = _calcRewardAndCheckSlashedStatus({\\n shouldShareEqually: shouldShareEqually,\\n numBridgeOperators: numBridgeOperators,\\n rewardPerPeriod: rewardPerPeriod,\\n ballot: ballots[i],\\n totalBallot: totalBallot,\\n period: period,\\n slashUntilPeriod: slashedDurationList[i]\\n });\\n\\n sumRewards += shouldSlash ? 0 : reward;\\n _updateRewardAndTransfer({ period: period, operator: operators[i], reward: reward, shouldSlash: shouldSlash });\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n TOTAL_REWARDS_SCATTERED_SLOT.addAssign(sumRewards);\\n }\\n\\n /**\\n * @dev Internal function to synchronize the latest rewarded period based on the current period of the validator set contract.\\n * @notice This function is used internally to synchronize the latest rewarded period with the current period of the validator set contract.\\n * @notice The `currentPeriod` of the validator set contract is retrieved and stored in the `LATEST_REWARDED_PERIOD_SLOT`.\\n * @notice This function ensures that the latest rewarded period is updated to reflect the current period in the validator set contract.\\n */\\n function _syncLatestRewardedPeriod() internal {\\n LATEST_REWARDED_PERIOD_SLOT.store(IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod());\\n }\\n\\n /**\\n * @dev Returns whether should share the reward equally, in case of bridge tracking returns\\n * informed data or there is no ballot in a day.\\n *\\n * Emit a {BridgeTrackingIncorrectlyResponded} event when in case of incorrect data.\\n */\\n function _shouldShareEqually(\\n uint256 totalBallot,\\n uint256 totalVote,\\n uint256[] memory ballots\\n ) internal returns (bool shareEqually) {\\n bool valid = _isValidBridgeTrackingResponse(totalBallot, totalVote, ballots);\\n if (!valid) {\\n emit BridgeTrackingIncorrectlyResponded();\\n }\\n\\n return !valid || totalBallot == 0;\\n }\\n\\n /**\\n * @dev Internal function to calculate the reward for a bridge operator and check its slashing status.\\n * @param shouldShareEqually A boolean indicating whether the reward should be shared equally among bridge operators.\\n * @param numBridgeOperators The total number of bridge operators for proportional reward calculation.\\n * @param rewardPerPeriod The total reward available for the period.\\n * @param ballot The individual ballot count of the bridge operator for the period.\\n * @param totalBallot The total number of available ballots for the period.\\n * @param period The period for which the reward is being calculated.\\n * @param slashUntilPeriod The period until which slashing is effective for the bridge operator.\\n * @return reward The calculated reward for the bridge operator.\\n * @return shouldSlash A boolean indicating whether the bridge operator should be slashed for the current period.\\n */\\n function _calcRewardAndCheckSlashedStatus(\\n bool shouldShareEqually,\\n uint256 numBridgeOperators,\\n uint256 rewardPerPeriod,\\n uint256 ballot,\\n uint256 totalBallot,\\n uint256 period,\\n uint256 slashUntilPeriod\\n ) internal pure returns (uint256 reward, bool shouldSlash) {\\n shouldSlash = _shouldSlashedThisPeriod(period, slashUntilPeriod);\\n reward = _calcReward(shouldShareEqually, numBridgeOperators, rewardPerPeriod, ballot, totalBallot);\\n }\\n\\n /**\\n * @dev Internal function to check if a specific period should be considered as slashed based on the slash duration.\\n * @param period The period to check if it should be slashed.\\n * @param slashDuration The duration until which periods should be considered as slashed.\\n * @return shouldSlashed A boolean indicating whether the specified period should be slashed.\\n * @notice This function is used internally to determine if a particular period should be marked as slashed based on the slash duration.\\n */\\n function _shouldSlashedThisPeriod(uint256 period, uint256 slashDuration) internal pure returns (bool) {\\n return period <= slashDuration;\\n }\\n\\n /**\\n * @dev Internal function to calculate the reward for a bridge operator based on the provided parameters.\\n * @param shouldShareEqually A boolean indicating whether the reward should be shared equally among bridge operators.\\n * @param numBridgeOperators The total number of bridge operators for proportional reward calculation.\\n * @param rewardPerPeriod The total reward available for the period.\\n * @param ballot The individual ballot count of the bridge operator for the period.\\n * @param totalBallot The total number of available ballots for the period.\\n * @return reward The calculated reward for the bridge operator.\\n */\\n function _calcReward(\\n bool shouldShareEqually,\\n uint256 numBridgeOperators,\\n uint256 rewardPerPeriod,\\n uint256 ballot,\\n uint256 totalBallot\\n ) internal pure returns (uint256 reward) {\\n // Shares equally in case the bridge has nothing to vote or bridge tracking response is incorrect\\n // Else shares the bridge operators reward proportionally\\n reward = shouldShareEqually ? rewardPerPeriod / numBridgeOperators : (rewardPerPeriod * ballot) / totalBallot;\\n }\\n\\n /**\\n * @dev Transfer `reward` to a `operator` or only emit event based on the operator `slashed` status.\\n */\\n function _updateRewardAndTransfer(uint256 period, address operator, uint256 reward, bool shouldSlash) private {\\n BridgeRewardInfo storage _iRewardInfo = _getRewardInfo()[operator];\\n\\n if (shouldSlash) {\\n _iRewardInfo.slashed += reward;\\n emit BridgeRewardSlashed(period, operator, reward);\\n } else {\\n _iRewardInfo.claimed += reward;\\n if (_unsafeSendRONLimitGas({ recipient: payable(operator), amount: reward, gas: 0 })) {\\n emit BridgeRewardScattered(period, operator, reward);\\n } else {\\n emit BridgeRewardScatterFailed(period, operator, reward);\\n }\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeReward\\n */\\n function getRewardPerPeriod() public view returns (uint256) {\\n return REWARD_PER_PERIOD_SLOT.load();\\n }\\n\\n /**\\n * @inheritdoc IBridgeReward\\n */\\n function getLatestRewardedPeriod() public view returns (uint256) {\\n return LATEST_REWARDED_PERIOD_SLOT.load();\\n }\\n\\n /**\\n * @inheritdoc IBridgeReward\\n */\\n function setRewardPerPeriod(uint256 rewardPerPeriod) external onlyContract(ContractType.BRIDGE_MANAGER) {\\n _setRewardPerPeriod(rewardPerPeriod);\\n }\\n\\n /**\\n * @dev Internal function for setting the total reward per period.\\n * Emit an {UpdatedRewardPerPeriod} event after set.\\n */\\n function _setRewardPerPeriod(uint256 rewardPerPeriod) internal {\\n REWARD_PER_PERIOD_SLOT.store(rewardPerPeriod);\\n emit UpdatedRewardPerPeriod(rewardPerPeriod);\\n }\\n\\n /**\\n * @dev Internal helper for querying slash info of a list of operators.\\n */\\n function _getSlashInfo(address[] memory operatorList) internal returns (uint256[] memory _slashedDuration) {\\n return IBridgeSlash(getContract(ContractType.BRIDGE_SLASH)).getSlashUntilPeriodOf(operatorList);\\n }\\n\\n /**\\n * @dev Internal helper for querying whether an address is an operator.\\n */\\n function _isBridgeOperator(address operator) internal view returns (bool) {\\n return IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)).isBridgeOperator(operator);\\n }\\n\\n /**\\n * @dev Internal function to access the mapping from bridge operator => BridgeRewardInfo.\\n * @return rewardInfo the mapping from bridge operator => BridgeRewardInfo.\\n */\\n function _getRewardInfo() internal pure returns (mapping(address => BridgeRewardInfo) storage rewardInfo) {\\n assembly (\\\"memory-safe\\\") {\\n rewardInfo.slot := REWARD_INFO_SLOT\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17c3330680c3f6c5c6f94b21105ebebb5d2871f6d7e5aabc7b455e90b8206f8a\",\"license\":\"MIT\"},\"contracts/types/Types.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.17;\\n\\nimport { LibTUint256Slot } from \\\"./operations/LibTUint256Slot.sol\\\";\\n\\ntype TUint256Slot is bytes32;\\n\\nusing {\\n LibTUint256Slot.add,\\n LibTUint256Slot.sub,\\n LibTUint256Slot.mul,\\n LibTUint256Slot.div,\\n LibTUint256Slot.load,\\n LibTUint256Slot.store,\\n LibTUint256Slot.addAssign,\\n LibTUint256Slot.subAssign,\\n LibTUint256Slot.preDecrement,\\n LibTUint256Slot.postDecrement,\\n LibTUint256Slot.preIncrement,\\n LibTUint256Slot.postIncrement\\n} for TUint256Slot global;\\n\",\"keccak256\":\"0x20ab58f1c9ae4936f9dd9891d064301d78ef508c1dd2ce0c19a7b5b81d530e36\",\"license\":\"MIT\"},\"contracts/types/operations/LibTUint256Slot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.17;\\n\\nimport { TUint256Slot } from \\\"../Types.sol\\\";\\n\\n/**\\n * @title LibTUint256Slot\\n * @dev Library for handling unsigned 256-bit integers.\\n */\\nlibrary LibTUint256Slot {\\n /// @dev value is equal to bytes4(keccak256(\\\"Panic(uint256)\\\"))\\n /// @dev see: https://github.com/foundry-rs/forge-std/blob/master/src/StdError.sol\\n uint256 private constant PANIC_ERROR_SIGNATURE = 0x4e487b71;\\n /// @dev error code for {Arithmetic over/underflow} error\\n uint256 private constant ARITHMETIC_ERROR_CODE = 0x11;\\n /// @dev error code for {Division or modulo by 0} error\\n uint256 private constant DIVISION_ERROR_CODE = 0x12;\\n\\n /**\\n * @dev Loads the value of the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @return val The loaded value.\\n */\\n function load(TUint256Slot self) internal view returns (uint256 val) {\\n assembly {\\n val := sload(self)\\n }\\n }\\n\\n /**\\n * @dev Stores a value into the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @param other The value to be stored.\\n */\\n function store(TUint256Slot self, uint256 other) internal {\\n assembly {\\n sstore(self, other)\\n }\\n }\\n\\n /**\\n * @dev Multiplies the TUint256Slot variable by a given value.\\n * @param self The TUint256Slot variable.\\n * @param other The value to multiply by.\\n * @return res The resulting value after multiplication.\\n */\\n function mul(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n if iszero(iszero(storedVal)) {\\n res := mul(storedVal, other)\\n\\n // Overflow check\\n if iszero(eq(other, div(res, storedVal))) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, ARITHMETIC_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n }\\n }\\n }\\n\\n /**\\n * @dev Divides the TUint256Slot variable by a given value.\\n * @param self The TUint256Slot variable.\\n * @param other The value to divide by.\\n * @return res The resulting value after division.\\n */\\n function div(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n // revert if divide by zero\\n if iszero(other) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, DIVISION_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n res := div(storedVal, other)\\n }\\n }\\n\\n /**\\n * @dev Subtracts a given value from the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @param other The value to subtract.\\n * @return res The resulting value after subtraction.\\n */\\n function sub(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n\\n // Underflow check\\n if lt(storedVal, other) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, ARITHMETIC_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n\\n res := sub(storedVal, other)\\n }\\n }\\n\\n /**\\n * @dev Adds a given value to the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @param other The value to add.\\n * @return res The resulting value after addition.\\n */\\n function add(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n res := add(storedVal, other)\\n\\n // Overflow check\\n if lt(res, other) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, ARITHMETIC_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n }\\n }\\n\\n /**\\n * @dev Increments the TUint256Slot variable by 1 and returns the new value.\\n * @param self The TUint256Slot variable.\\n * @return res The resulting value after incrementing.\\n */\\n function preIncrement(TUint256Slot self) internal returns (uint256 res) {\\n res = addAssign(self, 1);\\n }\\n\\n /**\\n * @dev Increments the TUint256Slot variable by 1 and returns the original value.\\n * @param self The TUint256Slot variable.\\n * @return res The original value before incrementing.\\n */\\n function postIncrement(TUint256Slot self) internal returns (uint256 res) {\\n res = load(self);\\n store(self, res + 1);\\n }\\n\\n /**\\n * @dev Decrements the TUint256Slot variable by 1 and returns the new value.\\n * @param self The TUint256Slot variable.\\n * @return res The resulting value after decrementing.\\n */\\n function preDecrement(TUint256Slot self) internal returns (uint256 res) {\\n res = subAssign(self, 1);\\n }\\n\\n /**\\n * @dev Decrements the TUint256Slot variable by 1 and returns the new value.\\n * @param self The TUint256Slot variable.\\n * @return res The resulting value before decrementing.\\n */\\n function postDecrement(TUint256Slot self) internal returns (uint256 res) {\\n res = load(self);\\n store(self, res - 1);\\n }\\n\\n /**\\n * @dev Adds a given value to the TUint256Slot variable and stores the result.\\n * @param self The TUint256Slot variable.\\n * @param other The value to add.\\n * @return res The resulting value after addition and storage.\\n */\\n function addAssign(TUint256Slot self, uint256 other) internal returns (uint256 res) {\\n store(self, res = add(self, other));\\n }\\n\\n /**\\n * @dev Subtracts a given value from the TUint256Slot variable and stores the result.\\n * @param self The TUint256Slot variable.\\n * @param other The value to subtract.\\n * @return res The resulting value after subtraction and storage.\\n */\\n function subAssign(TUint256Slot self, uint256 other) internal returns (uint256 res) {\\n store(self, res = sub(self, other));\\n }\\n}\\n\",\"keccak256\":\"0xe10c089459baf373494d76b00e582d49f6e43c500ab0f1657d53afc2fa472cbb\",\"license\":\"MIT\"},\"contracts/utils/CommonErrors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ContractType } from \\\"./ContractType.sol\\\";\\nimport { RoleAccess } from \\\"./RoleAccess.sol\\\";\\n\\nerror ErrSyncTooFarPeriod(uint256 period, uint256 latestRewardedPeriod);\\n/**\\n * @dev Error thrown when an address is expected to be an already created externally owned account (EOA).\\n * This error indicates that the provided address is invalid for certain contract operations that require already created EOA.\\n */\\nerror ErrAddressIsNotCreatedEOA(address addr, bytes32 codehash);\\n/**\\n * @dev Error raised when a bridge operator update operation fails.\\n * @param bridgeOperator The address of the bridge operator that failed to update.\\n */\\nerror ErrBridgeOperatorUpdateFailed(address bridgeOperator);\\n/**\\n * @dev Error thrown when attempting to add a bridge operator that already exists in the contract.\\n * This error indicates that the provided bridge operator address is already registered as a bridge operator in the contract.\\n */\\nerror ErrBridgeOperatorAlreadyExisted(address bridgeOperator);\\n/**\\n * @dev The error indicating an unsupported interface.\\n * @param interfaceId The bytes4 interface identifier that is not supported.\\n * @param addr The address where the unsupported interface was encountered.\\n */\\nerror ErrUnsupportedInterface(bytes4 interfaceId, address addr);\\n/**\\n * @dev Error thrown when the return data from a callback function is invalid.\\n * @param callbackFnSig The signature of the callback function that returned invalid data.\\n * @param register The address of the register where the callback function was invoked.\\n * @param returnData The invalid return data received from the callback function.\\n */\\nerror ErrInvalidReturnData(bytes4 callbackFnSig, address register, bytes returnData);\\n/**\\n * @dev Error of set to non-contract.\\n */\\nerror ErrZeroCodeContract(address addr);\\n/**\\n * @dev Error indicating that arguments are invalid.\\n */\\nerror ErrInvalidArguments(bytes4 msgSig);\\n/**\\n * @dev Error indicating that given address is null when it should not.\\n */\\nerror ErrZeroAddress(bytes4 msgSig);\\n/**\\n * @dev Error indicating that the provided threshold is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that the invalid threshold applies to.\\n */\\nerror ErrInvalidThreshold(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a function can only be called by the contract itself.\\n * @param msgSig The function signature (bytes4) that can only be called by the contract itself.\\n */\\nerror ErrOnlySelfCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n * @param expectedRole The role required to perform the function.\\n */\\nerror ErrUnauthorized(bytes4 msgSig, RoleAccess expectedRole);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n */\\nerror ErrUnauthorizedCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4).\\n * @param expectedContractType The contract type required to perform the function.\\n * @param actual The actual address that called to the function.\\n */\\nerror ErrUnexpectedInternalCall(bytes4 msgSig, ContractType expectedContractType, address actual);\\n\\n/**\\n * @dev Error indicating that an array is empty when it should contain elements.\\n */\\nerror ErrEmptyArray();\\n\\n/**\\n * @dev Error indicating a mismatch in the length of input parameters or arrays for a specific function.\\n * @param msgSig The function signature (bytes4) that has a length mismatch.\\n */\\nerror ErrLengthMismatch(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a proxy call to an external contract has failed.\\n * @param msgSig The function signature (bytes4) of the proxy call that failed.\\n * @param extCallSig The function signature (bytes4) of the external contract call that failed.\\n */\\nerror ErrProxyCallFailed(bytes4 msgSig, bytes4 extCallSig);\\n\\n/**\\n * @dev Error indicating that a function tried to call a precompiled contract that is not allowed.\\n * @param msgSig The function signature (bytes4) that attempted to call a precompiled contract.\\n */\\nerror ErrCallPrecompiled(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a native token transfer has failed.\\n * @param msgSig The function signature (bytes4) of the token transfer that failed.\\n */\\nerror ErrNativeTransferFailed(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that an order is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid order.\\n */\\nerror ErrInvalidOrder(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the chain ID is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid chain ID.\\n * @param actual Current chain ID that executing function.\\n * @param expected Expected chain ID required for the tx to success.\\n */\\nerror ErrInvalidChainId(bytes4 msgSig, uint256 actual, uint256 expected);\\n\\n/**\\n * @dev Error indicating that a vote type is not supported.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an unsupported vote type.\\n */\\nerror ErrUnsupportedVoteType(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the proposal nonce is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid proposal nonce.\\n */\\nerror ErrInvalidProposalNonce(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a voter has already voted.\\n * @param voter The address of the voter who has already voted.\\n */\\nerror ErrAlreadyVoted(address voter);\\n\\n/**\\n * @dev Error indicating that a signature is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid signature.\\n */\\nerror ErrInvalidSignatures(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a relay call has failed.\\n * @param msgSig The function signature (bytes4) of the relay call that failed.\\n */\\nerror ErrRelayFailed(bytes4 msgSig);\\n/**\\n * @dev Error indicating that a vote weight is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid vote weight.\\n */\\nerror ErrInvalidVoteWeight(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a query was made for an outdated bridge operator set.\\n */\\nerror ErrQueryForOutdatedBridgeOperatorSet();\\n\\n/**\\n * @dev Error indicating that a request is invalid.\\n */\\nerror ErrInvalidRequest();\\n\\n/**\\n * @dev Error indicating that a token standard is invalid.\\n */\\nerror ErrInvalidTokenStandard();\\n\\n/**\\n * @dev Error indicating that a token is not supported.\\n */\\nerror ErrUnsupportedToken();\\n\\n/**\\n * @dev Error indicating that a receipt kind is invalid.\\n */\\nerror ErrInvalidReceiptKind();\\n\\n/**\\n * @dev Error indicating that a receipt is invalid.\\n */\\nerror ErrInvalidReceipt();\\n\\n/**\\n * @dev Error indicating that an address is not payable.\\n */\\nerror ErrNonpayableAddress(address);\\n\\n/**\\n * @dev Error indicating that the period is already processed, i.e. scattered reward.\\n */\\nerror ErrPeriodAlreadyProcessed(uint256 requestingPeriod, uint256 latestPeriod);\\n\\n/**\\n * @dev Error thrown when an invalid vote hash is provided.\\n */\\nerror ErrInvalidVoteHash();\\n\\n/**\\n * @dev Error thrown when querying for an empty vote.\\n */\\nerror ErrQueryForEmptyVote();\\n\\n/**\\n * @dev Error thrown when querying for an expired vote.\\n */\\nerror ErrQueryForExpiredVote();\\n\\n/**\\n * @dev Error thrown when querying for a non-existent vote.\\n */\\nerror ErrQueryForNonExistentVote();\\n\",\"keccak256\":\"0x3914292a405307cba9e93085edcaf5f1203ca2d55abf998bf1d2af1e86f5a4c6\",\"license\":\"MIT\"},\"contracts/utils/ContractType.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum ContractType {\\n /* 0 */ UNKNOWN,\\n /* 1 */ PAUSE_ENFORCER,\\n /* 2 */ BRIDGE,\\n /* 3 */ BRIDGE_TRACKING,\\n /* 4 */ GOVERNANCE_ADMIN,\\n /* 5 */ MAINTENANCE,\\n /* 6 */ SLASH_INDICATOR,\\n /* 7 */ STAKING_VESTING,\\n /* 8 */ VALIDATOR,\\n /* 9 */ STAKING,\\n /* 10 */ RONIN_TRUSTED_ORGANIZATION,\\n /* 11 */ BRIDGE_MANAGER,\\n /* 12 */ BRIDGE_SLASH,\\n /* 13 */ BRIDGE_REWARD\\n}\\n\",\"keccak256\":\"0xf72feff9afafcb5cadc1b05c6e0b998ea5d66c7ece57c3e482e560d0a1bb4079\",\"license\":\"MIT\"},\"contracts/utils/IdentityGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { AddressArrayUtils } from \\\"../libraries/AddressArrayUtils.sol\\\";\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport { TransparentUpgradeableProxyV2 } from \\\"../extensions/TransparentUpgradeableProxyV2.sol\\\";\\nimport { ErrAddressIsNotCreatedEOA, ErrZeroAddress, ErrOnlySelfCall, ErrZeroCodeContract, ErrUnsupportedInterface } from \\\"./CommonErrors.sol\\\";\\n\\nabstract contract IdentityGuard {\\n using AddressArrayUtils for address[];\\n\\n /// @dev value is equal to keccak256(abi.encode())\\n /// @dev see: https://eips.ethereum.org/EIPS/eip-1052\\n bytes32 internal constant CREATED_ACCOUNT_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\\n\\n /**\\n * @dev Modifier to restrict functions to only be called by this contract.\\n * @dev Reverts if the caller is not this contract.\\n */\\n modifier onlySelfCall() virtual {\\n _requireSelfCall();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to ensure that the elements in the `arr` array are non-duplicates.\\n * It calls the internal `_checkDuplicate` function to perform the duplicate check.\\n *\\n * Requirements:\\n * - The elements in the `arr` array must not contain any duplicates.\\n */\\n modifier nonDuplicate(address[] memory arr) virtual {\\n _requireNonDuplicate(arr);\\n _;\\n }\\n\\n /**\\n * @dev Internal method to check the method caller.\\n * @dev Reverts if the method caller is not this contract.\\n */\\n function _requireSelfCall() internal view virtual {\\n if (msg.sender != address(this)) revert ErrOnlySelfCall(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to check if a contract address has code.\\n * @param addr The address of the contract to check.\\n * @dev Throws an error if the contract address has no code.\\n */\\n function _requireHasCode(address addr) internal view {\\n if (addr.code.length == 0) revert ErrZeroCodeContract(addr);\\n }\\n\\n /**\\n * @dev Checks if an address is zero and reverts if it is.\\n * @param addr The address to check.\\n */\\n function _requireNonZeroAddress(address addr) internal pure {\\n if (addr == address(0)) revert ErrZeroAddress(msg.sig);\\n }\\n\\n /**\\n * @dev Check if arr is empty and revert if it is.\\n * Checks if an array contains any duplicate addresses and reverts if duplicates are found.\\n * @param arr The array of addresses to check.\\n */\\n function _requireNonDuplicate(address[] memory arr) internal pure {\\n if (arr.hasDuplicate()) revert AddressArrayUtils.ErrDuplicated(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to require that the provided address is a created externally owned account (EOA).\\n * This internal function is used to ensure that the provided address is a valid externally owned account (EOA).\\n * It checks the codehash of the address against a predefined constant to confirm that the address is a created EOA.\\n * @notice This method only works with non-state EOA accounts\\n */\\n function _requireCreatedEOA(address addr) internal view {\\n _requireNonZeroAddress(addr);\\n bytes32 codehash = addr.codehash;\\n if (codehash != CREATED_ACCOUNT_HASH) revert ErrAddressIsNotCreatedEOA(addr, codehash);\\n }\\n\\n /**\\n * @dev Internal function to require that the specified contract supports the given interface. This method handle in\\n * both case that the callee is either or not the proxy admin of the caller. If the contract does not support the\\n * interface `interfaceId` or EIP165, a revert with the corresponding error message is triggered.\\n *\\n * @param contractAddr The address of the contract to check for interface support.\\n * @param interfaceId The interface ID to check for support.\\n */\\n function _requireSupportsInterface(address contractAddr, bytes4 interfaceId) internal view {\\n bytes memory supportsInterfaceParams = abi.encodeCall(IERC165.supportsInterface, (interfaceId));\\n (bool success, bytes memory returnOrRevertData) = contractAddr.staticcall(supportsInterfaceParams);\\n if (!success) {\\n (success, returnOrRevertData) = contractAddr.staticcall(\\n abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (supportsInterfaceParams))\\n );\\n if (!success) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n if (!abi.decode(returnOrRevertData, (bool))) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n}\\n\",\"keccak256\":\"0x2d0dfcef3636945bc1785c1fa5a05f5203c79cbb81b2eee92a3ac6a2378c2ce5\",\"license\":\"MIT\"},\"contracts/utils/RoleAccess.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum RoleAccess {\\n /* 0 */ UNKNOWN,\\n /* 1 */ ADMIN,\\n /* 2 */ COINBASE,\\n /* 3 */ GOVERNOR,\\n /* 4 */ CANDIDATE_ADMIN,\\n /* 5 */ WITHDRAWAL_MIGRATOR,\\n /* 6 */ __DEPRECATED_BRIDGE_OPERATOR,\\n /* 7 */ BLOCK_PRODUCER,\\n /* 8 */ VALIDATOR_CANDIDATE\\n}\\n\",\"keccak256\":\"0xa98cec38c640c4e37f475debbcd366226f1188c3f5ea6e29de768bd33e021873\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60a060405230608052610010610015565b6100d5565b600054610100900460ff16156100815760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156100d3576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6080516116966100f06000396000610a8501526116966000f3fe60806040526004361061009c5760003560e01c80638f7c34a2116100645780638f7c34a214610133578063a6bd678814610148578063ad43663e14610168578063de981f1b1461017d578063f5dbc4ee146101b5578063f7013ef6146101ca57600080fd5b806324a2f579146100a157806334087952146100c357806359f778df146100eb5780636bcb6fd6146100f3578063865e6fd314610113575b600080fd5b3480156100ad57600080fd5b506100c16100bc36600461112f565b6101dd565b005b3480156100cf57600080fd5b506100d8610502565b6040519081526020015b60405180910390f35b6100c1610531565b3480156100ff57600080fd5b506100c161010e366004611194565b61053b565b34801561011f57600080fd5b506100c161012e36600461123f565b61067a565b34801561013f57600080fd5b506100d8610699565b34801561015457600080fd5b506100c161016336600461112f565b6106b1565b34801561017457600080fd5b506100d86106c5565b34801561018957600080fd5b5061019d610198366004611276565b6106ef565b6040516001600160a01b0390911681526020016100e2565b3480156101c157600080fd5b506100d861076a565b6100c16101d8366004611298565b610794565b6101e6336108e6565b61021a576000356001600160e01b031916604051638f47e7e360e01b815260040161021191906112fc565b60405180910390fd5b6000610224610699565b9050600061023260086106ef565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa15801561026f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102939190611311565b90508181116102c3576000356001600160e01b03191660405163053265f160e01b815260040161021191906112fc565b806102ce8484611340565b11156102fb576000356001600160e01b03191660405163053265f160e01b815260040161021191906112fc565b61031360008051602061166a83398151915284610964565b506000610320600b6106ef565b6001600160a01b0316639b19dbfd6040518163ffffffff1660e01b8152600401600060405180830381865afa15801561035d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261038591908101906113be565b9050600061039360036106ef565b905060015b8581116104fa576104f283836001600160a01b031663f67e815288876040518363ffffffff1660e01b81526004016103d19291906114a1565b600060405180830381865afa1580156103ee573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261041691908101906114c2565b60405163692f6a6360e11b8152600481018990526001600160a01b0386169063d25ed4c690602401602060405180830381865afa15801561045b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047f9190611311565b604051637153af9b60e11b8152600481018a90526001600160a01b0387169063e2a75f3690602401602060405180830381865afa1580156104c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e89190611311565b988501988961097b565b600101610398565b505050505050565b600061052c7f3663384f6436b31a97d9c9a02f64ab8b73ead575c5b6224fa0800a6bd57f62f45490565b905090565b610539610a7b565b565b600361054681610b5f565b868514610574576000356001600160e01b0319166040516306b5667560e21b815260040161021191906112fc565b8615610670576000610584610699565b9050806001018310156105b8576000356001600160e01b03191660405163053265f160e01b815260040161021191906112fc565b806001018311156105e657604051634e4e051560e01b81526004810184905260248101829052604401610211565b506105fe60008051602061166a833981519152839055565b61067088888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808c0282810182019093528b82529093508b92508a91829185019084908082843760009201919091525089925088915087905061097b565b5050505050505050565b610682610bab565b61068b81610c05565b6106958282610c3b565b5050565b600061052c60008051602061166a8339815191525490565b600b6106bc81610b5f565b61069582610cdf565b600061052c7f90f7d557245e5dd9485f463e58974fa7cdc93c0abbd0a1afebb8f9640ec739105490565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600d81111561072657610726611548565b60ff1681526020810191909152604001600020546001600160a01b0316905080610765578160405163409140df60e11b81526004016102119190611572565b919050565b600061052c7f9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c645490565b600054610100900460ff16158080156107b45750600054600160ff909116105b806107ce5750303b1580156107ce575060005460ff166001145b6108315760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610211565b6000805460ff191660011790558015610854576000805461ff0019166101001790555b61085f600b87610c3b565b61086a600386610c3b565b610875600c85610c3b565b610880600884610c3b565b61088982610cdf565b610891610d3e565b610899610a7b565b80156104fa576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050505050565b60006108f2600b6106ef565b604051635a02d57960e11b81526001600160a01b038481166004830152919091169063b405aaf290602401602060405180830381865afa15801561093a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095e9190611580565b92915050565b600061095e836109748585610dbe565b9250829055565b845160006109876106c5565b9050600061099488610ddd565b905060006109a387878a610e5b565b90506000806000805b87811015610a41576109f58589898f85815181106109cc576109cc6115a2565b60200260200101518f8e8c88815181106109e8576109e86115a2565b6020026020010151610eae565b909450925082610a055783610a08565b60005b610a129083611340565b9150610a39898e8381518110610a2a57610a2a6115a2565b60200260200101518686610ecf565b6001016109ac565b50610a6c7f3663384f6436b31a97d9c9a02f64ab8b73ead575c5b6224fa0800a6bd57f62f482610964565b50505050505050505050505050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610ad2576000356001600160e01b031916604051638f47e7e360e01b815260040161021191906112fc565b337f7ae161a1f0ef2537f5ff1957021a50412e72abdc6a941a77d99361e91e7f3c3d610b1c7f9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c645490565b604080519182523460208301520160405180910390a2610b5c7f9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c6434610964565b50565b610b68816106ef565b6001600160a01b0316336001600160a01b031614610b5c576000356001600160e01b03191681336040516320e0f98d60e21b8152600401610211939291906115b8565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610539576000356001600160e01b0319166001604051620f948f60ea1b81526004016102119291906115ef565b806001600160a01b03163b600003610b5c57604051630bfc64a360e21b81526001600160a01b0382166004820152602401610211565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600d811115610c7157610c71611548565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600d811115610cb257610cb2611548565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b610d087f90f7d557245e5dd9485f463e58974fa7cdc93c0abbd0a1afebb8f9640ec73910829055565b6040518181527f9b40b647582311cc8f5f7d27e7ce206d126605d1625b8299b7edaeefd869ef259060200160405180910390a150565b610539610d4b60086106ef565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dac9190611311565b60008051602061166a83398151915255565b815481018181101561095e57634e487b7160005260116020526024601cfd5b6060610de9600c6106ef565b6001600160a01b0316635311153b836040518263ffffffff1660e01b8152600401610e14919061161d565b6000604051808303816000875af1158015610e33573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261095e91908101906114c2565b600080610e69858585611027565b905080610e9a576040517f64ba7143ea5a17abea37667aa9ae137e3afba5033c5f504770c02829c128189c90600090a15b801580610ea5575084155b95945050505050565b600082821015610ec189898989896110a4565b915097509795505050505050565b6001600160a01b03831660009081527f518cfd198acbffe95e740cfce1af28a3f7de51f0d784893d3d72c5cc59d7062a602052604090208115610f6f5782816001016000828254610f209190611340565b9091555050604080516001600160a01b03861681526020810185905286917fb3d061c3ef3991b0d4b09f4c8b551d137c3d1e014cf5326462d3d1f6a8dfb9c291015b60405180910390a2611020565b82816000016000828254610f839190611340565b90915550610f959050848460006110cf565b15610fdb57604080516001600160a01b03861681526020810185905286917fbab0baccb39371d4d5206b519fe58d21cae9cdd63a1d1b5146ecdf405fd931529101610f62565b604080516001600160a01b03861681526020810185905286917f74b217634c5a7790ce69770c5e35019970453d4da3973769e7d6cdb7ce6816a1910160405180910390a25b5050505050565b8051600190600090815b8181101561108c578585828151811061104c5761104c6115a2565b60200260200101511115611063576000935061108c565b848181518110611075576110756115a2565b602002602001015183019250806001019050611031565b5082801561109a5750858211155b9695505050505050565b6000856110c557816110b68486611630565b6110c09190611647565b61109a565b61109a8585611647565b6000836001600160a01b0316838390604051600060405180830381858888f193505050503d806000811461111f576040519150601f19603f3d011682016040523d82523d6000602084013e611124565b606091505b509095945050505050565b60006020828403121561114157600080fd5b5035919050565b60008083601f84011261115a57600080fd5b50813567ffffffffffffffff81111561117257600080fd5b6020830191508360208260051b850101111561118d57600080fd5b9250929050565b600080600080600080600060a0888a0312156111af57600080fd5b873567ffffffffffffffff808211156111c757600080fd5b6111d38b838c01611148565b909950975060208a01359150808211156111ec57600080fd5b506111f98a828b01611148565b989b979a50986040810135976060820135975060809091013595509350505050565b8035600e811061076557600080fd5b6001600160a01b0381168114610b5c57600080fd5b6000806040838503121561125257600080fd5b61125b8361121b565b9150602083013561126b8161122a565b809150509250929050565b60006020828403121561128857600080fd5b6112918261121b565b9392505050565b600080600080600060a086880312156112b057600080fd5b85356112bb8161122a565b945060208601356112cb8161122a565b935060408601356112db8161122a565b925060608601356112eb8161122a565b949793965091946080013592915050565b6001600160e01b031991909116815260200190565b60006020828403121561132357600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561095e5761095e61132a565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561139257611392611353565b604052919050565b600067ffffffffffffffff8211156113b4576113b4611353565b5060051b60200190565b600060208083850312156113d157600080fd5b825167ffffffffffffffff8111156113e857600080fd5b8301601f810185136113f957600080fd5b805161140c6114078261139a565b611369565b81815260059190911b8201830190838101908783111561142b57600080fd5b928401925b828410156114525783516114438161122a565b82529284019290840190611430565b979650505050505050565b600081518084526020808501945080840160005b838110156114965781516001600160a01b031687529582019590820190600101611471565b509495945050505050565b8281526040602082015260006114ba604083018461145d565b949350505050565b600060208083850312156114d557600080fd5b825167ffffffffffffffff8111156114ec57600080fd5b8301601f810185136114fd57600080fd5b805161150b6114078261139a565b81815260059190911b8201830190838101908783111561152a57600080fd5b928401925b828410156114525783518252928401929084019061152f565b634e487b7160e01b600052602160045260246000fd5b600e811061156e5761156e611548565b9052565b6020810161095e828461155e565b60006020828403121561159257600080fd5b8151801515811461129157600080fd5b634e487b7160e01b600052603260045260246000fd5b6001600160e01b031984168152606081016115d6602083018561155e565b6001600160a01b03929092166040919091015292915050565b6001600160e01b031983168152604081016009831061161057611610611548565b8260208301529392505050565b602081526000611291602083018461145d565b808202811582820484141761095e5761095e61132a565b60008261166457634e487b7160e01b600052601260045260246000fd5b50049056fe2417f25874c1cdc139a787dd21df976d40d767090442b3a2496917ecfc93b619a164736f6c6343000811000a", - "deployedBytecode": "0x60806040526004361061009c5760003560e01c80638f7c34a2116100645780638f7c34a214610133578063a6bd678814610148578063ad43663e14610168578063de981f1b1461017d578063f5dbc4ee146101b5578063f7013ef6146101ca57600080fd5b806324a2f579146100a157806334087952146100c357806359f778df146100eb5780636bcb6fd6146100f3578063865e6fd314610113575b600080fd5b3480156100ad57600080fd5b506100c16100bc36600461112f565b6101dd565b005b3480156100cf57600080fd5b506100d8610502565b6040519081526020015b60405180910390f35b6100c1610531565b3480156100ff57600080fd5b506100c161010e366004611194565b61053b565b34801561011f57600080fd5b506100c161012e36600461123f565b61067a565b34801561013f57600080fd5b506100d8610699565b34801561015457600080fd5b506100c161016336600461112f565b6106b1565b34801561017457600080fd5b506100d86106c5565b34801561018957600080fd5b5061019d610198366004611276565b6106ef565b6040516001600160a01b0390911681526020016100e2565b3480156101c157600080fd5b506100d861076a565b6100c16101d8366004611298565b610794565b6101e6336108e6565b61021a576000356001600160e01b031916604051638f47e7e360e01b815260040161021191906112fc565b60405180910390fd5b6000610224610699565b9050600061023260086106ef565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa15801561026f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102939190611311565b90508181116102c3576000356001600160e01b03191660405163053265f160e01b815260040161021191906112fc565b806102ce8484611340565b11156102fb576000356001600160e01b03191660405163053265f160e01b815260040161021191906112fc565b61031360008051602061166a83398151915284610964565b506000610320600b6106ef565b6001600160a01b0316639b19dbfd6040518163ffffffff1660e01b8152600401600060405180830381865afa15801561035d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261038591908101906113be565b9050600061039360036106ef565b905060015b8581116104fa576104f283836001600160a01b031663f67e815288876040518363ffffffff1660e01b81526004016103d19291906114a1565b600060405180830381865afa1580156103ee573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261041691908101906114c2565b60405163692f6a6360e11b8152600481018990526001600160a01b0386169063d25ed4c690602401602060405180830381865afa15801561045b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047f9190611311565b604051637153af9b60e11b8152600481018a90526001600160a01b0387169063e2a75f3690602401602060405180830381865afa1580156104c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e89190611311565b988501988961097b565b600101610398565b505050505050565b600061052c7f3663384f6436b31a97d9c9a02f64ab8b73ead575c5b6224fa0800a6bd57f62f45490565b905090565b610539610a7b565b565b600361054681610b5f565b868514610574576000356001600160e01b0319166040516306b5667560e21b815260040161021191906112fc565b8615610670576000610584610699565b9050806001018310156105b8576000356001600160e01b03191660405163053265f160e01b815260040161021191906112fc565b806001018311156105e657604051634e4e051560e01b81526004810184905260248101829052604401610211565b506105fe60008051602061166a833981519152839055565b61067088888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808c0282810182019093528b82529093508b92508a91829185019084908082843760009201919091525089925088915087905061097b565b5050505050505050565b610682610bab565b61068b81610c05565b6106958282610c3b565b5050565b600061052c60008051602061166a8339815191525490565b600b6106bc81610b5f565b61069582610cdf565b600061052c7f90f7d557245e5dd9485f463e58974fa7cdc93c0abbd0a1afebb8f9640ec739105490565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600d81111561072657610726611548565b60ff1681526020810191909152604001600020546001600160a01b0316905080610765578160405163409140df60e11b81526004016102119190611572565b919050565b600061052c7f9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c645490565b600054610100900460ff16158080156107b45750600054600160ff909116105b806107ce5750303b1580156107ce575060005460ff166001145b6108315760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610211565b6000805460ff191660011790558015610854576000805461ff0019166101001790555b61085f600b87610c3b565b61086a600386610c3b565b610875600c85610c3b565b610880600884610c3b565b61088982610cdf565b610891610d3e565b610899610a7b565b80156104fa576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050505050565b60006108f2600b6106ef565b604051635a02d57960e11b81526001600160a01b038481166004830152919091169063b405aaf290602401602060405180830381865afa15801561093a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095e9190611580565b92915050565b600061095e836109748585610dbe565b9250829055565b845160006109876106c5565b9050600061099488610ddd565b905060006109a387878a610e5b565b90506000806000805b87811015610a41576109f58589898f85815181106109cc576109cc6115a2565b60200260200101518f8e8c88815181106109e8576109e86115a2565b6020026020010151610eae565b909450925082610a055783610a08565b60005b610a129083611340565b9150610a39898e8381518110610a2a57610a2a6115a2565b60200260200101518686610ecf565b6001016109ac565b50610a6c7f3663384f6436b31a97d9c9a02f64ab8b73ead575c5b6224fa0800a6bd57f62f482610964565b50505050505050505050505050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610ad2576000356001600160e01b031916604051638f47e7e360e01b815260040161021191906112fc565b337f7ae161a1f0ef2537f5ff1957021a50412e72abdc6a941a77d99361e91e7f3c3d610b1c7f9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c645490565b604080519182523460208301520160405180910390a2610b5c7f9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c6434610964565b50565b610b68816106ef565b6001600160a01b0316336001600160a01b031614610b5c576000356001600160e01b03191681336040516320e0f98d60e21b8152600401610211939291906115b8565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610539576000356001600160e01b0319166001604051620f948f60ea1b81526004016102119291906115ef565b806001600160a01b03163b600003610b5c57604051630bfc64a360e21b81526001600160a01b0382166004820152602401610211565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600d811115610c7157610c71611548565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600d811115610cb257610cb2611548565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b610d087f90f7d557245e5dd9485f463e58974fa7cdc93c0abbd0a1afebb8f9640ec73910829055565b6040518181527f9b40b647582311cc8f5f7d27e7ce206d126605d1625b8299b7edaeefd869ef259060200160405180910390a150565b610539610d4b60086106ef565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dac9190611311565b60008051602061166a83398151915255565b815481018181101561095e57634e487b7160005260116020526024601cfd5b6060610de9600c6106ef565b6001600160a01b0316635311153b836040518263ffffffff1660e01b8152600401610e14919061161d565b6000604051808303816000875af1158015610e33573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261095e91908101906114c2565b600080610e69858585611027565b905080610e9a576040517f64ba7143ea5a17abea37667aa9ae137e3afba5033c5f504770c02829c128189c90600090a15b801580610ea5575084155b95945050505050565b600082821015610ec189898989896110a4565b915097509795505050505050565b6001600160a01b03831660009081527f518cfd198acbffe95e740cfce1af28a3f7de51f0d784893d3d72c5cc59d7062a602052604090208115610f6f5782816001016000828254610f209190611340565b9091555050604080516001600160a01b03861681526020810185905286917fb3d061c3ef3991b0d4b09f4c8b551d137c3d1e014cf5326462d3d1f6a8dfb9c291015b60405180910390a2611020565b82816000016000828254610f839190611340565b90915550610f959050848460006110cf565b15610fdb57604080516001600160a01b03861681526020810185905286917fbab0baccb39371d4d5206b519fe58d21cae9cdd63a1d1b5146ecdf405fd931529101610f62565b604080516001600160a01b03861681526020810185905286917f74b217634c5a7790ce69770c5e35019970453d4da3973769e7d6cdb7ce6816a1910160405180910390a25b5050505050565b8051600190600090815b8181101561108c578585828151811061104c5761104c6115a2565b60200260200101511115611063576000935061108c565b848181518110611075576110756115a2565b602002602001015183019250806001019050611031565b5082801561109a5750858211155b9695505050505050565b6000856110c557816110b68486611630565b6110c09190611647565b61109a565b61109a8585611647565b6000836001600160a01b0316838390604051600060405180830381858888f193505050503d806000811461111f576040519150601f19603f3d011682016040523d82523d6000602084013e611124565b606091505b509095945050505050565b60006020828403121561114157600080fd5b5035919050565b60008083601f84011261115a57600080fd5b50813567ffffffffffffffff81111561117257600080fd5b6020830191508360208260051b850101111561118d57600080fd5b9250929050565b600080600080600080600060a0888a0312156111af57600080fd5b873567ffffffffffffffff808211156111c757600080fd5b6111d38b838c01611148565b909950975060208a01359150808211156111ec57600080fd5b506111f98a828b01611148565b989b979a50986040810135976060820135975060809091013595509350505050565b8035600e811061076557600080fd5b6001600160a01b0381168114610b5c57600080fd5b6000806040838503121561125257600080fd5b61125b8361121b565b9150602083013561126b8161122a565b809150509250929050565b60006020828403121561128857600080fd5b6112918261121b565b9392505050565b600080600080600060a086880312156112b057600080fd5b85356112bb8161122a565b945060208601356112cb8161122a565b935060408601356112db8161122a565b925060608601356112eb8161122a565b949793965091946080013592915050565b6001600160e01b031991909116815260200190565b60006020828403121561132357600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561095e5761095e61132a565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561139257611392611353565b604052919050565b600067ffffffffffffffff8211156113b4576113b4611353565b5060051b60200190565b600060208083850312156113d157600080fd5b825167ffffffffffffffff8111156113e857600080fd5b8301601f810185136113f957600080fd5b805161140c6114078261139a565b611369565b81815260059190911b8201830190838101908783111561142b57600080fd5b928401925b828410156114525783516114438161122a565b82529284019290840190611430565b979650505050505050565b600081518084526020808501945080840160005b838110156114965781516001600160a01b031687529582019590820190600101611471565b509495945050505050565b8281526040602082015260006114ba604083018461145d565b949350505050565b600060208083850312156114d557600080fd5b825167ffffffffffffffff8111156114ec57600080fd5b8301601f810185136114fd57600080fd5b805161150b6114078261139a565b81815260059190911b8201830190838101908783111561152a57600080fd5b928401925b828410156114525783518252928401929084019061152f565b634e487b7160e01b600052602160045260246000fd5b600e811061156e5761156e611548565b9052565b6020810161095e828461155e565b60006020828403121561159257600080fd5b8151801515811461129157600080fd5b634e487b7160e01b600052603260045260246000fd5b6001600160e01b031984168152606081016115d6602083018561155e565b6001600160a01b03929092166040919091015292915050565b6001600160e01b031983168152604081016009831061161057611610611548565b8260208301529392505050565b602081526000611291602083018461145d565b808202811582820484141761095e5761095e61132a565b60008261166457634e487b7160e01b600052601260045260246000fd5b50049056fe2417f25874c1cdc139a787dd21df976d40d767090442b3a2496917ecfc93b619a164736f6c6343000811000a", + "address": "0x7bEB0f3fC4002C4542015cFa9023dEE1A9EC9400", + "args": "0x", + "ast": "", + "blockNumber": 26515571, + "bytecode": "0x60a060405230608052610010610015565b6100d5565b600054610100900460ff16156100815760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156100d3576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6080516118666100f06000396000610bc701526118666000f3fe6080604052600436106100dd5760003560e01c80638f7c34a21161007f578063ad43663e11610059578063ad43663e14610261578063b77f2a4014610276578063de981f1b14610296578063f5dbc4ee146102ce57600080fd5b80638f7c34a21461021957806395b6ef0c1461022e578063a6bd67881461024157600080fd5b80633b154455116100bb5780633b154455146101c757806359f778df146101dc5780635cd8a76b146101e4578063865e6fd3146101f957600080fd5b806306032d74146100e257806333b3ea6c1461018257806334087952146101a4575b600080fd5b3480156100ee57600080fd5b506101626100fd366004611335565b604080518082018252600080825260209182018190526001600160a01b039390931683527f518cfd198acbffe95e740cfce1af28a3f7de51f0d784893d3d72c5cc59d7062a815291819020815180830190925280548252600101549181019190915290565b604080518251815260209283015192810192909252015b60405180910390f35b34801561018e57600080fd5b506101a261019d366004611352565b6102e3565b005b3480156101b057600080fd5b506101b9610399565b604051908152602001610179565b3480156101d357600080fd5b506101a26103c8565b6101a26104bb565b3480156101f057600080fd5b506101a26104c5565b34801561020557600080fd5b506101a261021436600461137a565b610593565b34801561022557600080fd5b506101b96105ae565b6101a261023c3660046113b1565b6105c6565b34801561024d57600080fd5b506101a261025c366004611352565b6106e9565b34801561026d57600080fd5b506101b96106fd565b34801561028257600080fd5b506101a2610291366004611352565b610727565b3480156102a257600080fd5b506102b66102b136600461142a565b61073d565b6040516001600160a01b039091168152602001610179565b3480156102da57600080fd5b506101b96107b8565b6102ec336107e2565b61031c57604051638f47e7e360e01b81526001600160e01b03196000351660048201526024015b60405180910390fd5b6000610328600861073d565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610365573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103899190611445565b90506103958183610860565b5050565b60006103c37f3663384f6436b31a97d9c9a02f64ab8b73ead575c5b6224fa0800a6bd57f62f45490565b905090565b60046103d381610acd565b6000196103de6105ae565b146104205760405162461bcd60e51b815260206004820152601260248201527130b63932b0b23c9034b734ba103932b8101960711b6044820152606401610313565b6104ac600161042f600861073d565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa15801561046c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104909190611445565b61049a9190611474565b60008051602061181183398151915255565b6104b860046000610b19565b50565b6104c3610bbd565b565b600054600290610100900460ff161580156104e7575060005460ff8083169116105b6105035760405162461bcd60e51b815260040161031390611487565b6000805461ffff191660ff8316176101001790556105417faf260ffaff563b9407c1c5fe4aec2be8632142d158c44bb0ce4d471cb4883b8c60059055565b61054e60016104906105ae565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150565b61059b610c9e565b6105a481610cf8565b6103958282610b19565b60006103c36000805160206118118339815191525490565b600054610100900460ff16158080156105e65750600054600160ff909116105b806106005750303b158015610600575060005460ff166001145b61061c5760405162461bcd60e51b815260040161031390611487565b6000805460ff19166001179055801561063f576000805461ff0019166101001790555b61064a600b88610b19565b610655600387610b19565b610660600c86610b19565b61066b600885610b19565b610676600484610b19565b6000196000805160206118118339815191525561069282610d2e565b61069a610bbd565b80156106e0576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b600b6106f481610acd565b61039582610d2e565b60006103c37f90f7d557245e5dd9485f463e58974fa7cdc93c0abbd0a1afebb8f9640ec739105490565b600361073281610acd565b610395826000610860565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115610774576107746114d5565b60ff1681526020810191909152604001600020546001600160a01b03169050806107b3578160405163409140df60e11b815260040161031391906114ff565b919050565b60006103c37f9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c645490565b60006107ee600b61073d565b604051635a02d57960e11b81526001600160a01b038481166004830152919091169063b405aaf290602401602060405180830381865afa158015610836573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085a919061150d565b92915050565b600061086a6105ae565b9050816000036108cc5760008184111561089757600161088a8386611474565b6108949190611474565b90505b6108c8816108c37faf260ffaff563b9407c1c5fe4aec2be8632142d158c44bb0ce4d471cb4883b8c5490565b610d87565b9250505b6108d7838383610d9f565b60006108e3600b61073d565b6001600160a01b0316639b19dbfd6040518163ffffffff1660e01b8152600401600060405180830381865afa158015610920573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610948919081019061159a565b90506000610956600361073d565b905060005b84811015610ac55761096c84611639565b9350610abd83836001600160a01b031663f67e815287876040518363ffffffff1660e01b81526004016109a0929190611697565b600060405180830381865afa1580156109bd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109e591908101906116b0565b60405163692f6a6360e11b8152600481018890526001600160a01b0386169063d25ed4c690602401602060405180830381865afa158015610a2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4e9190611445565b604051637153af9b60e11b8152600481018990526001600160a01b0387169063e2a75f3690602401602060405180830381865afa158015610a93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab79190611445565b88610e33565b60010161095b565b505050505050565b610ad68161073d565b6001600160a01b0316336001600160a01b0316146104b8576000356001600160e01b03191681336040516320e0f98d60e21b815260040161031393929190611736565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f811115610b4f57610b4f6114d5565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115610b9057610b906114d5565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610c1457604051638f47e7e360e01b81526001600160e01b0319600035166004820152602401610313565b337f7ae161a1f0ef2537f5ff1957021a50412e72abdc6a941a77d99361e91e7f3c3d610c5e7f9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c645490565b604080519182523460208301520160405180910390a26104b87f9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c6434610f8a565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031633146104c3576000356001600160e01b0319166001604051620f948f60ea1b815260040161031392919061176d565b806001600160a01b03163b6000036104b857604051630bfc64a360e21b81526001600160a01b0382166004820152602401610313565b610d577f90f7d557245e5dd9485f463e58974fa7cdc93c0abbd0a1afebb8f9640ec73910829055565b6040518181527f9b40b647582311cc8f5f7d27e7ce206d126605d1625b8299b7edaeefd869ef2590602001610588565b6000818310610d965781610d98565b825b9392505050565b81600003610dc05760405163799ffe0d60e01b815260040160405180910390fd5b610dcb81600161179b565b8311610df45760405163425a5b1f60e01b81526004810184905260248101829052604401610313565b610dfe828261179b565b8311610e2e57604051630931302b60e31b8152600481018490526024810182905260448101839052606401610313565b505050565b845184518114610e64576040516306b5667560e21b81526001600160e01b0319600035166004820152602401610313565b6000610e6e6106fd565b90506000610e7b88610fa1565b90506000610e8a87878a61101f565b90506000806000805b87811015610f3957610edc8589898f8581518110610eb357610eb36117ae565b60200260200101518f8e8c8881518110610ecf57610ecf6117ae565b6020026020010151611072565b80945081955050506000610f0b8a8f8481518110610efc57610efc6117ae565b60200260200101518787611093565b90508380610f17575080155b610f215784610f24565b60005b610f2e908461179b565b925050600101610e93565b50610f647f3663384f6436b31a97d9c9a02f64ab8b73ead575c5b6224fa0800a6bd57f62f482610f8a565b50610f7c600080516020611811833981519152899055565b505050505050505050505050565b600061085a83610f9a85856111f9565b9250829055565b6060610fad600c61073d565b6001600160a01b0316635311153b836040518263ffffffff1660e01b8152600401610fd891906117c4565b6000604051808303816000875af1158015610ff7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261085a91908101906116b0565b60008061102d858585611218565b90508061105e576040517f64ba7143ea5a17abea37667aa9ae137e3afba5033c5f504770c02829c128189c90600090a15b801580611069575084155b95945050505050565b6000828210156110858989898989611295565b915097509795505050505050565b6001600160a01b03831660009081527f518cfd198acbffe95e740cfce1af28a3f7de51f0d784893d3d72c5cc59d7062a60205260408120821561113857838160010160008282546110e4919061179b565b9091555050604080516001600160a01b03871681526020810186905287917fb3d061c3ef3991b0d4b09f4c8b551d137c3d1e014cf5326462d3d1f6a8dfb9c291015b60405180910390a260009150506111f1565b611144858560006112c0565b156111b0578381600001600082825461115d919061179b565b9091555050604080516001600160a01b03871681526020810186905287917fbab0baccb39371d4d5206b519fe58d21cae9cdd63a1d1b5146ecdf405fd93152910160405180910390a260019150506111f1565b604080516001600160a01b03871681526020810186905287917f74b217634c5a7790ce69770c5e35019970453d4da3973769e7d6cdb7ce6816a19101611126565b949350505050565b815481018181101561085a57634e487b7160005260116020526024601cfd5b8051600190600090815b8181101561127d578585828151811061123d5761123d6117ae565b60200260200101511115611254576000935061127d565b848181518110611266576112666117ae565b602002602001015183019250806001019050611222565b5082801561128b5750858211155b9695505050505050565b6000856112b657816112a784866117d7565b6112b191906117ee565b61128b565b61128b85856117ee565b6000836001600160a01b0316838390604051600060405180830381858888f193505050503d8060008114611310576040519150601f19603f3d011682016040523d82523d6000602084013e611315565b606091505b509095945050505050565b6001600160a01b03811681146104b857600080fd5b60006020828403121561134757600080fd5b8135610d9881611320565b60006020828403121561136457600080fd5b5035919050565b8035601081106107b357600080fd5b6000806040838503121561138d57600080fd5b6113968361136b565b915060208301356113a681611320565b809150509250929050565b60008060008060008060c087890312156113ca57600080fd5b86356113d581611320565b955060208701356113e581611320565b945060408701356113f581611320565b9350606087013561140581611320565b9250608087013561141581611320565b8092505060a087013590509295509295509295565b60006020828403121561143c57600080fd5b610d988261136b565b60006020828403121561145757600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561085a5761085a61145e565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b601081106114fb576114fb6114d5565b9052565b6020810161085a82846114eb565b60006020828403121561151f57600080fd5b81518015158114610d9857600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561156e5761156e61152f565b604052919050565b600067ffffffffffffffff8211156115905761159061152f565b5060051b60200190565b600060208083850312156115ad57600080fd5b825167ffffffffffffffff8111156115c457600080fd5b8301601f810185136115d557600080fd5b80516115e86115e382611576565b611545565b81815260059190911b8201830190838101908783111561160757600080fd5b928401925b8284101561162e57835161161f81611320565b8252928401929084019061160c565b979650505050505050565b60006001820161164b5761164b61145e565b5060010190565b60008151808452602080850194506020840160005b8381101561168c5781516001600160a01b031687529582019590820190600101611667565b509495945050505050565b8281526040602082015260006111f16040830184611652565b600060208083850312156116c357600080fd5b825167ffffffffffffffff8111156116da57600080fd5b8301601f810185136116eb57600080fd5b80516116f96115e382611576565b81815260059190911b8201830190838101908783111561171857600080fd5b928401925b8284101561162e5783518252928401929084019061171d565b6001600160e01b0319841681526060810161175460208301856114eb565b6001600160a01b03929092166040919091015292915050565b6001600160e01b03198316815260408101600b831061178e5761178e6114d5565b8260208301529392505050565b8082018082111561085a5761085a61145e565b634e487b7160e01b600052603260045260246000fd5b602081526000610d986020830184611652565b808202811582820484141761085a5761085a61145e565b60008261180b57634e487b7160e01b600052601260045260246000fd5b50049056fe2417f25874c1cdc139a787dd21df976d40d767090442b3a2496917ecfc93b619a2646970667358221220cd237faf10660b4bf88f4dcc843cf0b3d4cce585ad7f99199ed3924ea16b8dfd64736f6c63430008170033", + "chainId": 2021, + "contractAbsolutePath": "BridgeReward.sol", + "deployedBytecode": "0x6080604052600436106100dd5760003560e01c80638f7c34a21161007f578063ad43663e11610059578063ad43663e14610261578063b77f2a4014610276578063de981f1b14610296578063f5dbc4ee146102ce57600080fd5b80638f7c34a21461021957806395b6ef0c1461022e578063a6bd67881461024157600080fd5b80633b154455116100bb5780633b154455146101c757806359f778df146101dc5780635cd8a76b146101e4578063865e6fd3146101f957600080fd5b806306032d74146100e257806333b3ea6c1461018257806334087952146101a4575b600080fd5b3480156100ee57600080fd5b506101626100fd366004611335565b604080518082018252600080825260209182018190526001600160a01b039390931683527f518cfd198acbffe95e740cfce1af28a3f7de51f0d784893d3d72c5cc59d7062a815291819020815180830190925280548252600101549181019190915290565b604080518251815260209283015192810192909252015b60405180910390f35b34801561018e57600080fd5b506101a261019d366004611352565b6102e3565b005b3480156101b057600080fd5b506101b9610399565b604051908152602001610179565b3480156101d357600080fd5b506101a26103c8565b6101a26104bb565b3480156101f057600080fd5b506101a26104c5565b34801561020557600080fd5b506101a261021436600461137a565b610593565b34801561022557600080fd5b506101b96105ae565b6101a261023c3660046113b1565b6105c6565b34801561024d57600080fd5b506101a261025c366004611352565b6106e9565b34801561026d57600080fd5b506101b96106fd565b34801561028257600080fd5b506101a2610291366004611352565b610727565b3480156102a257600080fd5b506102b66102b136600461142a565b61073d565b6040516001600160a01b039091168152602001610179565b3480156102da57600080fd5b506101b96107b8565b6102ec336107e2565b61031c57604051638f47e7e360e01b81526001600160e01b03196000351660048201526024015b60405180910390fd5b6000610328600861073d565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610365573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103899190611445565b90506103958183610860565b5050565b60006103c37f3663384f6436b31a97d9c9a02f64ab8b73ead575c5b6224fa0800a6bd57f62f45490565b905090565b60046103d381610acd565b6000196103de6105ae565b146104205760405162461bcd60e51b815260206004820152601260248201527130b63932b0b23c9034b734ba103932b8101960711b6044820152606401610313565b6104ac600161042f600861073d565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa15801561046c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104909190611445565b61049a9190611474565b60008051602061181183398151915255565b6104b860046000610b19565b50565b6104c3610bbd565b565b600054600290610100900460ff161580156104e7575060005460ff8083169116105b6105035760405162461bcd60e51b815260040161031390611487565b6000805461ffff191660ff8316176101001790556105417faf260ffaff563b9407c1c5fe4aec2be8632142d158c44bb0ce4d471cb4883b8c60059055565b61054e60016104906105ae565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150565b61059b610c9e565b6105a481610cf8565b6103958282610b19565b60006103c36000805160206118118339815191525490565b600054610100900460ff16158080156105e65750600054600160ff909116105b806106005750303b158015610600575060005460ff166001145b61061c5760405162461bcd60e51b815260040161031390611487565b6000805460ff19166001179055801561063f576000805461ff0019166101001790555b61064a600b88610b19565b610655600387610b19565b610660600c86610b19565b61066b600885610b19565b610676600484610b19565b6000196000805160206118118339815191525561069282610d2e565b61069a610bbd565b80156106e0576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b600b6106f481610acd565b61039582610d2e565b60006103c37f90f7d557245e5dd9485f463e58974fa7cdc93c0abbd0a1afebb8f9640ec739105490565b600361073281610acd565b610395826000610860565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115610774576107746114d5565b60ff1681526020810191909152604001600020546001600160a01b03169050806107b3578160405163409140df60e11b815260040161031391906114ff565b919050565b60006103c37f9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c645490565b60006107ee600b61073d565b604051635a02d57960e11b81526001600160a01b038481166004830152919091169063b405aaf290602401602060405180830381865afa158015610836573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085a919061150d565b92915050565b600061086a6105ae565b9050816000036108cc5760008184111561089757600161088a8386611474565b6108949190611474565b90505b6108c8816108c37faf260ffaff563b9407c1c5fe4aec2be8632142d158c44bb0ce4d471cb4883b8c5490565b610d87565b9250505b6108d7838383610d9f565b60006108e3600b61073d565b6001600160a01b0316639b19dbfd6040518163ffffffff1660e01b8152600401600060405180830381865afa158015610920573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610948919081019061159a565b90506000610956600361073d565b905060005b84811015610ac55761096c84611639565b9350610abd83836001600160a01b031663f67e815287876040518363ffffffff1660e01b81526004016109a0929190611697565b600060405180830381865afa1580156109bd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109e591908101906116b0565b60405163692f6a6360e11b8152600481018890526001600160a01b0386169063d25ed4c690602401602060405180830381865afa158015610a2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4e9190611445565b604051637153af9b60e11b8152600481018990526001600160a01b0387169063e2a75f3690602401602060405180830381865afa158015610a93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab79190611445565b88610e33565b60010161095b565b505050505050565b610ad68161073d565b6001600160a01b0316336001600160a01b0316146104b8576000356001600160e01b03191681336040516320e0f98d60e21b815260040161031393929190611736565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f811115610b4f57610b4f6114d5565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115610b9057610b906114d5565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610c1457604051638f47e7e360e01b81526001600160e01b0319600035166004820152602401610313565b337f7ae161a1f0ef2537f5ff1957021a50412e72abdc6a941a77d99361e91e7f3c3d610c5e7f9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c645490565b604080519182523460208301520160405180910390a26104b87f9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c6434610f8a565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031633146104c3576000356001600160e01b0319166001604051620f948f60ea1b815260040161031392919061176d565b806001600160a01b03163b6000036104b857604051630bfc64a360e21b81526001600160a01b0382166004820152602401610313565b610d577f90f7d557245e5dd9485f463e58974fa7cdc93c0abbd0a1afebb8f9640ec73910829055565b6040518181527f9b40b647582311cc8f5f7d27e7ce206d126605d1625b8299b7edaeefd869ef2590602001610588565b6000818310610d965781610d98565b825b9392505050565b81600003610dc05760405163799ffe0d60e01b815260040160405180910390fd5b610dcb81600161179b565b8311610df45760405163425a5b1f60e01b81526004810184905260248101829052604401610313565b610dfe828261179b565b8311610e2e57604051630931302b60e31b8152600481018490526024810182905260448101839052606401610313565b505050565b845184518114610e64576040516306b5667560e21b81526001600160e01b0319600035166004820152602401610313565b6000610e6e6106fd565b90506000610e7b88610fa1565b90506000610e8a87878a61101f565b90506000806000805b87811015610f3957610edc8589898f8581518110610eb357610eb36117ae565b60200260200101518f8e8c8881518110610ecf57610ecf6117ae565b6020026020010151611072565b80945081955050506000610f0b8a8f8481518110610efc57610efc6117ae565b60200260200101518787611093565b90508380610f17575080155b610f215784610f24565b60005b610f2e908461179b565b925050600101610e93565b50610f647f3663384f6436b31a97d9c9a02f64ab8b73ead575c5b6224fa0800a6bd57f62f482610f8a565b50610f7c600080516020611811833981519152899055565b505050505050505050505050565b600061085a83610f9a85856111f9565b9250829055565b6060610fad600c61073d565b6001600160a01b0316635311153b836040518263ffffffff1660e01b8152600401610fd891906117c4565b6000604051808303816000875af1158015610ff7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261085a91908101906116b0565b60008061102d858585611218565b90508061105e576040517f64ba7143ea5a17abea37667aa9ae137e3afba5033c5f504770c02829c128189c90600090a15b801580611069575084155b95945050505050565b6000828210156110858989898989611295565b915097509795505050505050565b6001600160a01b03831660009081527f518cfd198acbffe95e740cfce1af28a3f7de51f0d784893d3d72c5cc59d7062a60205260408120821561113857838160010160008282546110e4919061179b565b9091555050604080516001600160a01b03871681526020810186905287917fb3d061c3ef3991b0d4b09f4c8b551d137c3d1e014cf5326462d3d1f6a8dfb9c291015b60405180910390a260009150506111f1565b611144858560006112c0565b156111b0578381600001600082825461115d919061179b565b9091555050604080516001600160a01b03871681526020810186905287917fbab0baccb39371d4d5206b519fe58d21cae9cdd63a1d1b5146ecdf405fd93152910160405180910390a260019150506111f1565b604080516001600160a01b03871681526020810186905287917f74b217634c5a7790ce69770c5e35019970453d4da3973769e7d6cdb7ce6816a19101611126565b949350505050565b815481018181101561085a57634e487b7160005260116020526024601cfd5b8051600190600090815b8181101561127d578585828151811061123d5761123d6117ae565b60200260200101511115611254576000935061127d565b848181518110611266576112666117ae565b602002602001015183019250806001019050611222565b5082801561128b5750858211155b9695505050505050565b6000856112b657816112a784866117d7565b6112b191906117ee565b61128b565b61128b85856117ee565b6000836001600160a01b0316838390604051600060405180830381858888f193505050503d8060008114611310576040519150601f19603f3d011682016040523d82523d6000602084013e611315565b606091505b509095945050505050565b6001600160a01b03811681146104b857600080fd5b60006020828403121561134757600080fd5b8135610d9881611320565b60006020828403121561136457600080fd5b5035919050565b8035601081106107b357600080fd5b6000806040838503121561138d57600080fd5b6113968361136b565b915060208301356113a681611320565b809150509250929050565b60008060008060008060c087890312156113ca57600080fd5b86356113d581611320565b955060208701356113e581611320565b945060408701356113f581611320565b9350606087013561140581611320565b9250608087013561141581611320565b8092505060a087013590509295509295509295565b60006020828403121561143c57600080fd5b610d988261136b565b60006020828403121561145757600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561085a5761085a61145e565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b601081106114fb576114fb6114d5565b9052565b6020810161085a82846114eb565b60006020828403121561151f57600080fd5b81518015158114610d9857600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561156e5761156e61152f565b604052919050565b600067ffffffffffffffff8211156115905761159061152f565b5060051b60200190565b600060208083850312156115ad57600080fd5b825167ffffffffffffffff8111156115c457600080fd5b8301601f810185136115d557600080fd5b80516115e86115e382611576565b611545565b81815260059190911b8201830190838101908783111561160757600080fd5b928401925b8284101561162e57835161161f81611320565b8252928401929084019061160c565b979650505050505050565b60006001820161164b5761164b61145e565b5060010190565b60008151808452602080850194506020840160005b8381101561168c5781516001600160a01b031687529582019590820190600101611667565b509495945050505050565b8281526040602082015260006111f16040830184611652565b600060208083850312156116c357600080fd5b825167ffffffffffffffff8111156116da57600080fd5b8301601f810185136116eb57600080fd5b80516116f96115e382611576565b81815260059190911b8201830190838101908783111561171857600080fd5b928401925b8284101561162e5783518252928401929084019061171d565b6001600160e01b0319841681526060810161175460208301856114eb565b6001600160a01b03929092166040919091015292915050565b6001600160e01b03198316815260408101600b831061178e5761178e6114d5565b8260208301529392505050565b8082018082111561085a5761085a61145e565b634e487b7160e01b600052603260045260246000fd5b602081526000610d986020830184611652565b808202811582820484141761085a5761085a61145e565b60008261180b57634e487b7160e01b600052601260045260246000fd5b50049056fe2417f25874c1cdc139a787dd21df976d40d767090442b3a2496917ecfc93b619a2646970667358221220cd237faf10660b4bf88f4dcc843cf0b3d4cce585ad7f99199ed3924ea16b8dfd64736f6c63430008170033", + "deployer": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", "devdoc": { + "version": 1, + "kind": "dev", + "methods": { + "execSyncRewardAuto(uint256)": { + "details": "Invoke calculate and transfer reward to operators based on their performance. Requirements: - This method is only called once each period. - The caller must be the bridge tracking contract" + }, + "getContract(uint8)": { + "details": "Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.", + "params": { + "contractType": "The role of the contract to retrieve." + }, + "returns": { + "contract_": "The address of the contract with the specified role." + } + }, + "getLatestRewardedPeriod()": { + "details": "External function to retrieve the latest rewarded period in the contract." + }, + "getRewardInfo(address)": { + "details": "Returns the claimed and slashed reward amount of the `operator`." + }, + "getRewardPerPeriod()": { + "details": "Getter for all bridge operators per period." + }, + "getTotalRewardScattered()": { + "details": "Returns the total reward amount scattered to the operators, excluding the slashed reward and failed-to-transfer reward." + }, + "getTotalRewardToppedUp()": { + "details": "Returns the total amount of rewards that have been topped up in the contract." + }, + "initializeREP2()": { + "details": "Helper for running upgrade script, required to only revoked once by the DPoS's governance admin. The following must be assured after initializing REP2: ``` {BridgeTracking}._lastSyncPeriod == {BridgeReward}.latestRewardedPeriod == {RoninValidatorSet}.currentPeriod() ```" + }, + "initializeV2()": { + "details": "The following must be assured after initializing V2: ``` {BridgeTracking}._lastSyncPeriod == {RoninValidatorSet}.currentPeriod() == {BridgeReward}.latestRewardedPeriod + 1 ```" + }, + "receiveRON()": { + "details": "Receives RON from any address." + }, + "setContract(uint8,address)": { + "details": "Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.", + "params": { + "addr": "The address of the contract to set.", + "contractType": "The role of the contract to set." + } + }, + "setRewardPerPeriod(uint256)": { + "details": "Setter for all bridge operators per period." + }, + "syncRewardManual(uint256)": { + "details": "This function allows bridge operators to manually synchronize the reward for a given period length.", + "params": { + "periodCount": "The length of the reward period for which synchronization is requested." + } + } + }, + "events": { + "BridgeRewardScatterFailed(uint256,address,uint256)": { + "details": "Event emitted when the reward of the `operator` is scattered with `amount` but failed to transfer." + }, + "BridgeRewardScattered(uint256,address,uint256)": { + "details": "Event emitted when the reward of the `operator` is scattered with `amount`." + }, + "BridgeRewardSlashed(uint256,address,uint256)": { + "details": "Event emitted when the reward of the `operator` is slashed with `amount`." + }, + "BridgeRewardSyncTooFarPeriod(uint256,uint256)": { + "details": "Event emitted when the requesting period to sync is too far." + }, + "BridgeTrackingIncorrectlyResponded()": { + "details": "Event emited when the bridge tracking contract tracks the invalid data, cause malform in sharing bridge reward." + }, + "ContractUpdated(uint8,address)": { + "details": "Emitted when a contract is updated." + }, + "Initialized(uint8)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "SafeReceived(address,uint256,uint256)": { + "details": "Emitted when RON are safely received as rewards in the contract.", + "params": { + "amount": "The amount of RON received.", + "balanceBefore": "The balance of the contract before receiving the RON tokens.", + "from": "The address of the sender who transferred RON tokens as rewards." + } + }, + "UpdatedRewardPerPeriod(uint256)": { + "details": "Event emitted when the reward per period config is updated." + } + }, "errors": { "ErrContractTypeNotFound(uint8)": [ { @@ -552,11 +660,6 @@ "details": "Error of sender has insufficient balance." } ], - "ErrInvalidArguments(bytes4)": [ - { - "details": "Error indicating that arguments are invalid." - } - ], "ErrLengthMismatch(bytes4)": [ { "details": "Error indicating a mismatch in the length of input parameters or arrays for a specific function.", @@ -602,99 +705,25 @@ "details": "Error of set to non-contract." } ] - }, - "kind": "dev", - "methods": { - "execSyncReward(address[],uint256[],uint256,uint256,uint256)": { - "details": "Invoke calculate and transfer reward to operators based on their performance. Requirements: - This method is only called once each period. - The caller must be the bridge tracking contract or a bridge operator." - }, - "getContract(uint8)": { - "details": "Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.", - "params": { - "contractType": "The role of the contract to retrieve." - }, - "returns": { - "contract_": "The address of the contract with the specified role." - } - }, - "getLatestRewardedPeriod()": { - "details": "External function to retrieve the latest rewarded period in the contract.", - "returns": { - "_0": "latestRewardedPeriod The latest rewarded period value." - } - }, - "getRewardPerPeriod()": { - "details": "Getter for all bridge operators per period." - }, - "getTotalRewardScattered()": { - "details": "Retrieve the total amount of rewards that have been scattered to bridge operators in the contract.", - "returns": { - "_0": "totalRewardScattered The total rewards scattered value." - } - }, - "getTotalRewardToppedUp()": { - "details": "Retrieve the total amount of rewards that have been topped up in the contract.", - "returns": { - "_0": "totalRewardToppedUp The total rewards topped up value." - } - }, - "receiveRON()": { - "details": "Receives RON from any address." - }, - "setContract(uint8,address)": { - "details": "Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.", - "params": { - "addr": "The address of the contract to set.", - "contractType": "The role of the contract to set." - } - }, - "setRewardPerPeriod(uint256)": { - "details": "Setter for all bridge operators per period." - }, - "syncReward(uint256)": { - "details": "This function allows bridge operators to manually synchronize the reward for a given period length.", - "params": { - "periodLength": "The length of the reward period for which synchronization is requested." - } - } - }, - "stateVariables": { - "LATEST_REWARDED_PERIOD_SLOT": { - "details": "value is equal to keccak256(\"@ronin.dpos.gateway.BridgeReward.latestRewardedPeriod.slot\") - 1" - }, - "REWARD_INFO_SLOT": { - "details": "value is equal to keccak256(\"@ronin.dpos.gateway.BridgeReward.rewardInfo.slot\") - 1" - }, - "REWARD_PER_PERIOD_SLOT": { - "details": "value is equal to keccak256(\"@ronin.dpos.gateway.BridgeReward.rewardPerPeriod.slot\") - 1" - }, - "TOTAL_REWARDS_SCATTERED_SLOT": { - "details": "value is equal to keccak256(\"@ronin.dpos.gateway.BridgeReward.totalRewardScattered.slot\") - 1" - }, - "TOTAL_REWARDS_TOPPED_UP_SLOT": { - "details": "value is equal to keccak256(\"@ronin.dpos.gateway.BridgeReward.totalRewardToppedUp.slot\") - 1" - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 + } }, + "isFoundry": true, + "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"ErrContractTypeNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"uint256\",\"name\":\"currentBalance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"sendAmount\",\"type\":\"uint256\"}],\"name\":\"ErrInsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrLengthMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"currentPeriod\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"latestRewardedPeriod\",\"type\":\"uint256\"}],\"name\":\"ErrPeriodAlreadyRewarded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrPeriodCountIsZero\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"currentPeriod\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"latestRewardedPeriod\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"periodCount\",\"type\":\"uint256\"}],\"name\":\"ErrPeriodNotHappen\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrRecipientRevert\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum RoleAccess\",\"name\":\"expectedRole\",\"type\":\"uint8\"}],\"name\":\"ErrUnauthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrUnauthorizedCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum ContractType\",\"name\":\"expectedContractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"actual\",\"type\":\"address\"}],\"name\":\"ErrUnexpectedInternalCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrZeroCodeContract\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"period\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BridgeRewardScatterFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"period\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BridgeRewardScattered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"period\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BridgeRewardSlashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requestingPeriod\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"latestPeriod\",\"type\":\"uint256\"}],\"name\":\"BridgeRewardSyncTooFarPeriod\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"BridgeTrackingIncorrectlyResponded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ContractUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"balanceBefore\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"SafeReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newRewardPerPeriod\",\"type\":\"uint256\"}],\"name\":\"UpdatedRewardPerPeriod\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"currentPeriod\",\"type\":\"uint256\"}],\"name\":\"execSyncRewardAuto\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"getContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"contract_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestRewardedPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"getRewardInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"claimed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"slashed\",\"type\":\"uint256\"}],\"internalType\":\"struct IBridgeRewardEvents.BridgeRewardInfo\",\"name\":\"rewardInfo\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRewardPerPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalRewardScattered\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalRewardToppedUp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeManagerContract\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"bridgeTrackingContract\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"bridgeSlashContract\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"validatorSetContract\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"dposGA\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"rewardPerPeriod\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initializeREP2\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initializeV2\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"receiveRON\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"rewardPerPeriod\",\"type\":\"uint256\"}],\"name\":\"setRewardPerPeriod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"periodCount\",\"type\":\"uint256\"}],\"name\":\"syncRewardManual\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"ErrContractTypeNotFound(uint8)\":[{\"details\":\"Error of invalid role.\"}],\"ErrInsufficientBalance(bytes4,uint256,uint256)\":[{\"details\":\"Error of sender has insufficient balance.\"}],\"ErrLengthMismatch(bytes4)\":[{\"details\":\"Error indicating a mismatch in the length of input parameters or arrays for a specific function.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that has a length mismatch.\"}}],\"ErrRecipientRevert(bytes4)\":[{\"details\":\"Error of recipient not accepting RON when transfer RON.\"}],\"ErrUnauthorized(bytes4,uint8)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"expectedRole\":\"The role required to perform the function.\",\"msgSig\":\"The function signature (bytes4) that the caller is unauthorized to perform.\"}}],\"ErrUnauthorizedCall(bytes4)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that the caller is unauthorized to perform.\"}}],\"ErrUnexpectedInternalCall(bytes4,uint8,address)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"actual\":\"The actual address that called to the function.\",\"expectedContractType\":\"The contract type required to perform the function.\",\"msgSig\":\"The function signature (bytes4).\"}}],\"ErrZeroCodeContract(address)\":[{\"details\":\"Error of set to non-contract.\"}]},\"events\":{\"BridgeRewardScatterFailed(uint256,address,uint256)\":{\"details\":\"Event emitted when the reward of the `operator` is scattered with `amount` but failed to transfer.\"},\"BridgeRewardScattered(uint256,address,uint256)\":{\"details\":\"Event emitted when the reward of the `operator` is scattered with `amount`.\"},\"BridgeRewardSlashed(uint256,address,uint256)\":{\"details\":\"Event emitted when the reward of the `operator` is slashed with `amount`.\"},\"BridgeRewardSyncTooFarPeriod(uint256,uint256)\":{\"details\":\"Event emitted when the requesting period to sync is too far.\"},\"BridgeTrackingIncorrectlyResponded()\":{\"details\":\"Event emited when the bridge tracking contract tracks the invalid data, cause malform in sharing bridge reward.\"},\"ContractUpdated(uint8,address)\":{\"details\":\"Emitted when a contract is updated.\"},\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"SafeReceived(address,uint256,uint256)\":{\"details\":\"Emitted when RON are safely received as rewards in the contract.\",\"params\":{\"amount\":\"The amount of RON received.\",\"balanceBefore\":\"The balance of the contract before receiving the RON tokens.\",\"from\":\"The address of the sender who transferred RON tokens as rewards.\"}},\"UpdatedRewardPerPeriod(uint256)\":{\"details\":\"Event emitted when the reward per period config is updated.\"}},\"kind\":\"dev\",\"methods\":{\"execSyncRewardAuto(uint256)\":{\"details\":\"Invoke calculate and transfer reward to operators based on their performance. Requirements: - This method is only called once each period. - The caller must be the bridge tracking contract\"},\"getContract(uint8)\":{\"details\":\"Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.\",\"params\":{\"contractType\":\"The role of the contract to retrieve.\"},\"returns\":{\"contract_\":\"The address of the contract with the specified role.\"}},\"getLatestRewardedPeriod()\":{\"details\":\"External function to retrieve the latest rewarded period in the contract.\"},\"getRewardInfo(address)\":{\"details\":\"Returns the claimed and slashed reward amount of the `operator`.\"},\"getRewardPerPeriod()\":{\"details\":\"Getter for all bridge operators per period.\"},\"getTotalRewardScattered()\":{\"details\":\"Returns the total reward amount scattered to the operators, excluding the slashed reward and failed-to-transfer reward.\"},\"getTotalRewardToppedUp()\":{\"details\":\"Returns the total amount of rewards that have been topped up in the contract.\"},\"initializeREP2()\":{\"details\":\"Helper for running upgrade script, required to only revoked once by the DPoS's governance admin. The following must be assured after initializing REP2: ``` {BridgeTracking}._lastSyncPeriod == {BridgeReward}.latestRewardedPeriod == {RoninValidatorSet}.currentPeriod() ```\"},\"initializeV2()\":{\"details\":\"The following must be assured after initializing V2: ``` {BridgeTracking}._lastSyncPeriod == {RoninValidatorSet}.currentPeriod() == {BridgeReward}.latestRewardedPeriod + 1 ```\"},\"receiveRON()\":{\"details\":\"Receives RON from any address.\"},\"setContract(uint8,address)\":{\"details\":\"Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.\",\"params\":{\"addr\":\"The address of the contract to set.\",\"contractType\":\"The role of the contract to set.\"}},\"setRewardPerPeriod(uint256)\":{\"details\":\"Setter for all bridge operators per period.\"},\"syncRewardManual(uint256)\":{\"details\":\"This function allows bridge operators to manually synchronize the reward for a given period length.\",\"params\":{\"periodCount\":\"The length of the reward period for which synchronization is requested.\"}}},\"stateVariables\":{\"$_LATEST_REWARDED_PERIOD\":{\"details\":\"value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeReward.latestRewardedPeriod.slot\\\") - 1\"},\"$_MAX_REWARDING_PERIOD_COUNT\":{\"details\":\"value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeReward.maxRewardingPeriodCount.slot\\\") - 1\"},\"$_REWARD_INFO\":{\"details\":\"value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeReward.rewardInfo.slot\\\") - 1\"},\"$_REWARD_PER_PERIOD\":{\"details\":\"value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeReward.rewardPerPeriod.slot\\\") - 1\"},\"$_TOTAL_REWARDS_SCATTERED\":{\"details\":\"value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeReward.totalRewardScattered.slot\\\") - 1\"},\"$_TOTAL_REWARDS_TOPPED_UP\":{\"details\":\"value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeReward.totalRewardToppedUp.slot\\\") - 1\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/ronin/gateway/BridgeReward.sol\":\"BridgeReward\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@fdk/=lib/foundry-deployment-kit/script/\",\":@openzeppelin/=lib/openzeppelin-contracts/\",\":@prb/math/=lib/prb-math/\",\":@prb/test/=lib/prb-test/src/\",\":@ronin/contracts/=src/\",\":@ronin/script/=script/\",\":@ronin/test/=test/\",\":contract-libs/=lib/foundry-deployment-kit/lib/contract-libs/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/foundry-deployment-kit/lib/forge-std/src/\",\":foundry-deployment-kit/=lib/foundry-deployment-kit/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/contracts/\",\":prb-math/=lib/prb-math/src/\",\":prb-test/=lib/prb-test/src/\",\":solady/=lib/solady/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0xa6a787e7a901af6511e19aa53e1a00352db215a011d2c7a438d0582dd5da76f9\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2a21b14ff90012878752f230d3ffd5c3405e5938d06c97a7d89c0a64561d0d66\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"src/extensions/RONTransferHelper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nabstract contract RONTransferHelper {\\n /// @dev Error of sender has insufficient balance.\\n error ErrInsufficientBalance(bytes4 msgSig, uint256 currentBalance, uint256 sendAmount);\\n /// @dev Error of recipient not accepting RON when transfer RON.\\n error ErrRecipientRevert(bytes4 msgSig);\\n\\n /**\\n * @dev See `_sendRON`.\\n * Reverts if the recipient does not receive RON.\\n */\\n function _transferRON(address payable recipient, uint256 amount) internal {\\n if (!_sendRON(recipient, amount)) revert ErrRecipientRevert(msg.sig);\\n }\\n\\n /**\\n * @dev Send `amount` RON to the address `recipient`.\\n * Returns whether the recipient receives RON or not.\\n * Reverts once the contract balance is insufficient.\\n *\\n * Note: consider using `ReentrancyGuard` before calling this function.\\n *\\n */\\n function _sendRON(address payable recipient, uint256 amount) internal returns (bool success) {\\n if (address(this).balance < amount) revert ErrInsufficientBalance(msg.sig, address(this).balance, amount);\\n return _unsafeSendRON(recipient, amount);\\n }\\n\\n /**\\n * @dev Unsafe send `amount` RON to the address `recipient`. If the sender's balance is insufficient,\\n * the call does not revert.\\n *\\n * Note:\\n * - Does not assert whether the balance of sender is sufficient.\\n * - Does not assert whether the recipient accepts RON.\\n * - Consider using `ReentrancyGuard` before calling this function.\\n *\\n */\\n function _unsafeSendRON(address payable recipient, uint256 amount) internal returns (bool success) {\\n (success,) = recipient.call{ value: amount }(\\\"\\\");\\n }\\n\\n /**\\n * @dev Same purpose with {_unsafeSendRONLimitGas(address,uin256)} but containing gas limit stipend forwarded in the call.\\n */\\n function _unsafeSendRONLimitGas(address payable recipient, uint256 amount, uint256 gas) internal returns (bool success) {\\n (success,) = recipient.call{ value: amount, gas: gas }(\\\"\\\");\\n }\\n}\\n\",\"keccak256\":\"0x8723823a5f2fed8cddeffe432a282bad7f6d7b3f498460044ae3a12b6ae8e428\",\"license\":\"MIT\"},\"src/extensions/TransparentUpgradeableProxyV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\\\";\\n\\ncontract TransparentUpgradeableProxyV2 is TransparentUpgradeableProxy {\\n constructor(address _logic, address admin_, bytes memory _data) payable TransparentUpgradeableProxy(_logic, admin_, _data) { }\\n\\n /**\\n * @dev Calls a function from the current implementation as specified by `_data`, which should be an encoded function call.\\n *\\n * Requirements:\\n * - Only the admin can call this function.\\n *\\n * Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid\\n * triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider\\n * reviewing the encoded data `_data` and the method which is called before using this.\\n *\\n */\\n function functionDelegateCall(bytes memory _data) public payable ifAdmin {\\n address _addr = _implementation();\\n assembly {\\n let _result := delegatecall(gas(), _addr, add(_data, 32), mload(_data), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n switch _result\\n case 0 { revert(0, returndatasize()) }\\n default { return(0, returndatasize()) }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x45fc7b71d09da99414b977a56e586b3604670d865e5f36f395d5c98bc4ba64af\",\"license\":\"MIT\"},\"src/extensions/bridge-operator-governance/BridgeTrackingHelper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nabstract contract BridgeTrackingHelper {\\n /// @dev Event emited when the bridge tracking contract tracks the invalid data, cause malform in sharing bridge reward.\\n event BridgeTrackingIncorrectlyResponded();\\n\\n /**\\n * @dev Internal function to validate the bridge tracking response for a given set of ballots.\\n * @param totalBallot The total number of ballots available for the tracking response.\\n * @param totalVote The total number of votes recorded in the tracking response.\\n * @param ballots An array containing the individual ballot counts in the tracking response.\\n * @return valid A boolean indicating whether the bridge tracking response is valid or not.\\n * @notice The function checks if each individual ballot count is not greater than the total votes recorded.\\n * @notice It also verifies that the sum of all individual ballot counts does not exceed the total available ballots.\\n */\\n function _isValidBridgeTrackingResponse(uint256 totalBallot, uint256 totalVote, uint256[] memory ballots) internal pure returns (bool valid) {\\n valid = true;\\n uint256 sumBallot;\\n uint256 length = ballots.length;\\n\\n unchecked {\\n for (uint256 i; i < length; ++i) {\\n if (ballots[i] > totalVote) {\\n valid = false;\\n break;\\n }\\n\\n sumBallot += ballots[i];\\n }\\n }\\n\\n valid = valid && (sumBallot <= totalBallot);\\n }\\n}\\n\",\"keccak256\":\"0x6c4ace6aed6a3861ad64b30dc2db7a2d8b87585085e049f9f85b8f2efbbc41a0\",\"license\":\"MIT\"},\"src/extensions/collections/HasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { HasProxyAdmin } from \\\"./HasProxyAdmin.sol\\\";\\nimport \\\"../../interfaces/collections/IHasContracts.sol\\\";\\nimport { IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\nimport { ErrUnexpectedInternalCall } from \\\"../../utils/CommonErrors.sol\\\";\\n\\n/**\\n * @title HasContracts\\n * @dev A contract that provides functionality to manage multiple contracts with different roles.\\n */\\nabstract contract HasContracts is HasProxyAdmin, IHasContracts, IdentityGuard {\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.collections.HasContracts.slot\\\") - 1\\n bytes32 private constant _STORAGE_SLOT = 0xdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb;\\n\\n /**\\n * @dev Modifier to restrict access to functions only to contracts with a specific role.\\n * @param contractType The contract type that allowed to call\\n */\\n modifier onlyContract(ContractType contractType) virtual {\\n _requireContract(contractType);\\n _;\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function setContract(ContractType contractType, address addr) external virtual onlyProxyAdmin {\\n _requireHasCode(addr);\\n _setContract(contractType, addr);\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function getContract(ContractType contractType) public view returns (address contract_) {\\n contract_ = _getContractMap()[uint8(contractType)];\\n if (contract_ == address(0)) revert ErrContractTypeNotFound(contractType);\\n }\\n\\n /**\\n * @dev Internal function to set the address of a contract with a specific role.\\n * @param contractType The contract type of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function _setContract(ContractType contractType, address addr) internal virtual {\\n _getContractMap()[uint8(contractType)] = addr;\\n emit ContractUpdated(contractType, addr);\\n }\\n\\n /**\\n * @dev Internal function to access the mapping of contract addresses with roles.\\n * @return contracts_ The mapping of contract addresses with roles.\\n */\\n function _getContractMap() private pure returns (mapping(uint8 => address) storage contracts_) {\\n assembly {\\n contracts_.slot := _STORAGE_SLOT\\n }\\n }\\n\\n /**\\n * @dev Internal function to check if the calling contract has a specific role.\\n * @param contractType The contract type that the calling contract must have.\\n * @dev Throws an error if the calling contract does not have the specified role.\\n */\\n function _requireContract(ContractType contractType) private view {\\n if (msg.sender != getContract(contractType)) {\\n revert ErrUnexpectedInternalCall(msg.sig, contractType, msg.sender);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7dbefa31230e6e4bd319f02d94893cbfd07ee12a0e016f5fadc57660df01891\",\"license\":\"MIT\"},\"src/extensions/collections/HasProxyAdmin.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/StorageSlot.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\n\\nabstract contract HasProxyAdmin {\\n // bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n modifier onlyProxyAdmin() {\\n _requireProxyAdmin();\\n _;\\n }\\n\\n /**\\n * @dev Returns proxy admin.\\n */\\n function _getProxyAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n function _requireProxyAdmin() internal view {\\n if (msg.sender != _getProxyAdmin()) revert ErrUnauthorized(msg.sig, RoleAccess.ADMIN);\\n }\\n}\\n\",\"keccak256\":\"0xad3db02c99a960b60151f2ad45eed46073d14fe1ed861f496c7aeefacbbc528e\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IBridgeManagerEvents } from \\\"./events/IBridgeManagerEvents.sol\\\";\\n\\n/**\\n * @title IBridgeManager\\n * @dev The interface for managing bridge operators.\\n */\\ninterface IBridgeManager is IBridgeManagerEvents {\\n /// @notice Error indicating that cannot find the querying operator\\n error ErrOperatorNotFound(address operator);\\n /// @notice Error indicating that cannot find the querying governor\\n error ErrGovernorNotFound(address governor);\\n /// @notice Error indicating that the msg.sender is not match the required governor\\n error ErrGovernorNotMatch(address required, address sender);\\n /// @notice Error indicating that the governors list will go below minimum number of required governor.\\n error ErrBelowMinRequiredGovernors();\\n /// @notice Common invalid input error\\n error ErrInvalidInput();\\n\\n /**\\n * @dev The domain separator used for computing hash digests in the contract.\\n */\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n\\n /**\\n * @dev Returns the total number of bridge operators.\\n * @return The total number of bridge operators.\\n */\\n function totalBridgeOperator() external view returns (uint256);\\n\\n /**\\n * @dev Checks if the given address is a bridge operator.\\n * @param addr The address to check.\\n * @return A boolean indicating whether the address is a bridge operator.\\n */\\n function isBridgeOperator(address addr) external view returns (bool);\\n\\n /**\\n * @dev Retrieves the full information of all registered bridge operators.\\n *\\n * This external function allows external callers to obtain the full information of all the registered bridge operators.\\n * The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.\\n *\\n * @return governors An array of addresses representing the governors of each bridge operator.\\n * @return bridgeOperators An array of addresses representing the registered bridge operators.\\n * @return weights An array of uint256 values representing the vote weights of each bridge operator.\\n *\\n * Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator.\\n *\\n * Example Usage:\\n * ```\\n * (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos();\\n * for (uint256 i = 0; i < bridgeOperators.length; i++) {\\n * // Access individual information for each bridge operator.\\n * address governor = governors[i];\\n * address bridgeOperator = bridgeOperators[i];\\n * uint256 weight = weights[i];\\n * // ... (Process or use the information as required) ...\\n * }\\n * ```\\n *\\n */\\n function getFullBridgeOperatorInfos() external view returns (address[] memory governors, address[] memory bridgeOperators, uint96[] memory weights);\\n\\n /**\\n * @dev Returns total weights of the governor list.\\n */\\n function sumGovernorsWeight(address[] calldata governors) external view returns (uint256 sum);\\n\\n /**\\n * @dev Returns total weights.\\n */\\n function getTotalWeight() external view returns (uint256);\\n\\n /**\\n * @dev Returns an array of all bridge operators.\\n * @return An array containing the addresses of all bridge operators.\\n */\\n function getBridgeOperators() external view returns (address[] memory);\\n\\n /**\\n * @dev Returns the corresponding `operator` of a `governor`.\\n */\\n function getOperatorOf(address governor) external view returns (address operator);\\n\\n /**\\n * @dev Returns the corresponding `governor` of a `operator`.\\n */\\n function getGovernorOf(address operator) external view returns (address governor);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific governor.\\n * @param governor The address of the governor to get the vote weight for.\\n * @return voteWeight The vote weight of the specified governor.\\n */\\n function getGovernorWeight(address governor) external view returns (uint96);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific bridge operator.\\n * @param bridgeOperator The address of the bridge operator to get the vote weight for.\\n * @return weight The vote weight of the specified bridge operator.\\n */\\n function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint96 weight);\\n\\n /**\\n * @dev Returns the weights of a list of governor addresses.\\n */\\n function getGovernorWeights(address[] calldata governors) external view returns (uint96[] memory weights);\\n\\n /**\\n * @dev Returns an array of all governors.\\n * @return An array containing the addresses of all governors.\\n */\\n function getGovernors() external view returns (address[] memory);\\n\\n /**\\n * @dev Adds multiple bridge operators.\\n * @param governors An array of addresses of hot/cold wallets for bridge operator to update their node address.\\n * @param bridgeOperators An array of addresses representing the bridge operators to add.\\n */\\n function addBridgeOperators(uint96[] calldata voteWeights, address[] calldata governors, address[] calldata bridgeOperators) external;\\n\\n /**\\n * @dev Removes multiple bridge operators.\\n * @param bridgeOperators An array of addresses representing the bridge operators to remove.\\n */\\n function removeBridgeOperators(address[] calldata bridgeOperators) external;\\n\\n /**\\n * @dev Self-call to update the minimum required governor.\\n * @param min The minimum number, this must not less than 3.\\n */\\n function setMinRequiredGovernor(uint min) external;\\n}\\n\",\"keccak256\":\"0xefc46318a240371031e77ef3c355e2c18432e4479145378de6782277f9b44923\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeReward.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport { IBridgeRewardEvents } from \\\"./events/IBridgeRewardEvents.sol\\\";\\n\\ninterface IBridgeReward is IBridgeRewardEvents {\\n /**\\n * @dev This function allows bridge operators to manually synchronize the reward for a given period length.\\n * @param periodCount The length of the reward period for which synchronization is requested.\\n */\\n function syncRewardManual(uint256 periodCount) external;\\n\\n /**\\n * @dev Receives RON from any address.\\n */\\n function receiveRON() external payable;\\n\\n /**\\n * @dev Invoke calculate and transfer reward to operators based on their performance.\\n *\\n * Requirements:\\n * - This method is only called once each period.\\n * - The caller must be the bridge tracking contract\\n */\\n function execSyncRewardAuto(uint256 currentPeriod) external;\\n\\n /**\\n * @dev Returns the total amount of rewards that have been topped up in the contract.\\n */\\n function getTotalRewardToppedUp() external view returns (uint256);\\n\\n /**\\n * @dev Returns the total reward amount scattered to the operators, excluding the slashed reward and failed-to-transfer reward.\\n */\\n function getTotalRewardScattered() external view returns (uint256);\\n\\n /**\\n * @dev Getter for all bridge operators per period.\\n */\\n function getRewardPerPeriod() external view returns (uint256);\\n\\n /**\\n * @dev External function to retrieve the latest rewarded period in the contract.\\n */\\n function getLatestRewardedPeriod() external view returns (uint256);\\n\\n /**\\n * @dev Returns the claimed and slashed reward amount of the `operator`.\\n */\\n function getRewardInfo(address operator) external view returns (BridgeRewardInfo memory rewardInfo);\\n\\n /**\\n * @dev Setter for all bridge operators per period.\\n */\\n function setRewardPerPeriod(uint256 rewardPerPeriod) external;\\n}\\n\",\"keccak256\":\"0x5707468c0c1f1f9bb104d8a5b3c2ae2ec8ffe09bb91229463b1f7dade3dcdfe7\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeSlash.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IBridgeSlashEvents } from \\\"./events/IBridgeSlashEvents.sol\\\";\\n\\n/**\\n * @title IBridgeSlash\\n * @dev Interface for the BridgeSlash contract to manage slashing functionality for bridge operators.\\n */\\ninterface IBridgeSlash is IBridgeSlashEvents {\\n /**\\n * @dev Slashes the unavailability of bridge operators during a specific period.\\n * @param period The period to slash the bridge operators for.\\n */\\n function execSlashBridgeOperators(address[] calldata operators, uint256[] calldata ballots, uint256 totalBallot, uint256 totalVote, uint256 period) external;\\n\\n /**\\n * @dev Returns the penalize durations for the specified bridge operators.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @return untilPeriods The penalized periods for the bridge operators.\\n */\\n function getSlashUntilPeriodOf(address[] calldata bridgeOperators) external returns (uint256[] memory untilPeriods);\\n\\n /**\\n * @dev Retrieves the added periods of the specified bridge operators.\\n * @param bridgeOperators An array of bridge operator addresses.\\n * @return addedPeriods An array of uint256 values representing the added periods for each bridge operator.\\n */\\n function getAddedPeriodOf(address[] calldata bridgeOperators) external view returns (uint256[] memory addedPeriods);\\n\\n /**\\n * @dev Gets the slash tier based on the given ballot and total ballots.\\n * @param ballot The ballot count for a bridge operator.\\n * @param totalVote The total vote count for the period.\\n * @return tier The slash tier.\\n */\\n function getSlashTier(uint256 ballot, uint256 totalVote) external pure returns (Tier tier);\\n\\n /**\\n * @dev Retrieve the penalty durations for different slash tiers.\\n * @return penaltyDurations The array of penalty durations for each slash tier.\\n */\\n function getPenaltyDurations() external pure returns (uint256[] memory penaltyDurations);\\n\\n /**\\n * @dev Returns the penalty duration for Tier 1 slashing.\\n * @return The duration in period number for Tier 1 slashing.\\n */\\n function TIER_1_PENALTY_DURATION() external view returns (uint256);\\n\\n /**\\n * @dev Returns the penalty duration for Tier 2 slashing.\\n * @return The duration in period number for Tier 2 slashing.\\n */\\n function TIER_2_PENALTY_DURATION() external view returns (uint256);\\n\\n /**\\n * @dev Returns the threshold duration for removing bridge operators.\\n * @return The duration in period number that exceeds which a bridge operator will be removed.\\n */\\n function REMOVE_DURATION_THRESHOLD() external view returns (uint256);\\n\\n /**\\n * @dev External function to retrieve the value of the minimum vote threshold to execute slashing rule.\\n * @return minimumVoteThreshold The minimum vote threshold value.\\n */\\n function MINIMUM_VOTE_THRESHOLD() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xb22e3ead9060f2c139d143b8db4dcda7cdf4e4e3960fa98a481ad8b3a2460134\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeTracking.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeTracking {\\n struct Request {\\n VoteKind kind;\\n uint256 id;\\n }\\n\\n enum VoteKind {\\n Deposit,\\n Withdrawal,\\n MainchainWithdrawal\\n }\\n\\n event ExternalCallFailed(address indexed to, bytes4 indexed msgSig, bytes reason);\\n\\n /**\\n * @dev Returns the block that allow incomming mutable call.\\n */\\n function startedAtBlock() external view returns (uint256);\\n\\n /**\\n * @dev Returns the total number of votes at the specific period `_period`.\\n */\\n function totalVote(uint256 _period) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total number of ballots at the specific period `_period`.\\n */\\n function totalBallot(uint256 _period) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total number of ballots of bridge operators at the specific period `_period`.\\n */\\n function getManyTotalBallots(uint256 _period, address[] calldata _bridgeOperators) external view returns (uint256[] memory);\\n\\n /**\\n * @dev Returns the total number of ballots of a bridge operator at the specific period `_period`.\\n */\\n function totalBallotOf(uint256 _period, address _bridgeOperator) external view returns (uint256);\\n\\n /**\\n * @dev Handles the request once it is approved.\\n *\\n * Requirements:\\n * - The method caller is the bridge contract.\\n *\\n */\\n function handleVoteApproved(VoteKind _kind, uint256 _requestId) external;\\n\\n /**\\n * @dev Records vote for a receipt and a operator.\\n *\\n * Requirements:\\n * - The method caller is the bridge contract.\\n *\\n */\\n function recordVote(VoteKind _kind, uint256 _requestId, address _operator) external;\\n}\\n\",\"keccak256\":\"0x53ac425ff6efebc200030ceef302c2871a4b2edfcc5e512ce326aa704989ff7a\",\"license\":\"MIT\"},\"src/interfaces/bridge/events/IBridgeManagerEvents.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeManagerEvents {\\n /**\\n * @dev Emitted when new bridge operators are added.\\n */\\n event BridgeOperatorsAdded(bool[] statuses, uint96[] voteWeights, address[] governors, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is failed to add.\\n */\\n event BridgeOperatorAddingFailed(address indexed operator);\\n\\n /**\\n * @dev Emitted when bridge operators are removed.\\n */\\n event BridgeOperatorsRemoved(bool[] statuses, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is failed to remove.\\n */\\n event BridgeOperatorRemovingFailed(address indexed operator);\\n\\n /**\\n * @dev Emitted when a bridge operator is updated.\\n */\\n event BridgeOperatorUpdated(address indexed governor, address indexed fromBridgeOperator, address indexed toBridgeOperator);\\n\\n /**\\n * @dev Emitted when the minimum number of required governors is updated.\\n */\\n event MinRequiredGovernorUpdated(uint min);\\n}\\n\",\"keccak256\":\"0x38bc3709c98a7c08fb9b6fa3e07a725903dcb0bd07de8a828bac6c3bcf7d997d\",\"license\":\"MIT\"},\"src/interfaces/bridge/events/IBridgeRewardEvents.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeRewardEvents {\\n /**\\n * @dev Reward-related information for a bridge operator.\\n * @param claimed The amount of rewards claimed by the bridge operator.\\n * @param slashed The amount of rewards that have been slashed from the bridge operator.\\n */\\n struct BridgeRewardInfo {\\n uint256 claimed;\\n uint256 slashed;\\n }\\n\\n /**\\n * @dev Emitted when RON are safely received as rewards in the contract.\\n * @param from The address of the sender who transferred RON tokens as rewards.\\n * @param balanceBefore The balance of the contract before receiving the RON tokens.\\n * @param amount The amount of RON received.\\n */\\n event SafeReceived(address indexed from, uint256 balanceBefore, uint256 amount);\\n /// @dev Event emitted when the reward per period config is updated.\\n event UpdatedRewardPerPeriod(uint256 newRewardPerPeriod);\\n /// @dev Event emitted when the reward of the `operator` is scattered with `amount`.\\n event BridgeRewardScattered(uint256 indexed period, address operator, uint256 amount);\\n /// @dev Event emitted when the reward of the `operator` is slashed with `amount`.\\n event BridgeRewardSlashed(uint256 indexed period, address operator, uint256 amount);\\n /// @dev Event emitted when the reward of the `operator` is scattered with `amount` but failed to transfer.\\n event BridgeRewardScatterFailed(uint256 indexed period, address operator, uint256 amount);\\n /// @dev Event emitted when the requesting period to sync is too far.\\n event BridgeRewardSyncTooFarPeriod(uint256 requestingPeriod, uint256 latestPeriod);\\n\\n error ErrPeriodNotHappen(uint256 currentPeriod, uint256 latestRewardedPeriod, uint256 periodCount);\\n error ErrPeriodAlreadyRewarded(uint256 currentPeriod, uint256 latestRewardedPeriod);\\n error ErrPeriodCountIsZero();\\n}\\n\",\"keccak256\":\"0x715180c3b50edfc2e7b8c4dd6cde55cf383c471a48a96ebc4ca33103a3791356\",\"license\":\"MIT\"},\"src/interfaces/bridge/events/IBridgeSlashEvents.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeSlashEvents {\\n /**\\n * @dev Enumeration representing the slashing tiers for bridge operators.\\n */\\n enum Tier {\\n Tier0,\\n Tier1,\\n Tier2\\n }\\n\\n /**\\n * @dev Struct representing the status of a bridge operator.\\n */\\n struct BridgeSlashInfo {\\n uint128 slashUntilPeriod;\\n uint128 newlyAddedAtPeriod;\\n }\\n\\n /**\\n * @dev Event emitted when a bridge operator is slashed.\\n * @param tier The slash tier of the operator.\\n * @param bridgeOperator The address of the slashed bridge operator.\\n * @param period The period in which the operator is slashed.\\n * @param slashUntilPeriod The period until which the operator is penalized.\\n */\\n event BridgeSlashed(Tier indexed tier, address indexed bridgeOperator, uint256 indexed period, uint256 slashUntilPeriod);\\n\\n /**\\n * @dev Emitted when a removal request is made for a bridge operator.\\n * @param period The period for which the removal request is made.\\n * @param bridgeOperator The address of the bridge operator being requested for removal.\\n */\\n event RemovalRequested(uint256 indexed period, address indexed bridgeOperator);\\n}\\n\",\"keccak256\":\"0x43850ce839ef382c6e6d176e1de4de776fb54b7baa697f52d79858fba13c1b90\",\"license\":\"MIT\"},\"src/interfaces/collections/IHasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport { ContractType } from \\\"../../utils/ContractType.sol\\\";\\n\\ninterface IHasContracts {\\n /// @dev Error of invalid role.\\n error ErrContractTypeNotFound(ContractType contractType);\\n\\n /// @dev Emitted when a contract is updated.\\n event ContractUpdated(ContractType indexed contractType, address indexed addr);\\n\\n /**\\n * @dev Returns the address of a contract with a specific role.\\n * Throws an error if no contract is set for the specified role.\\n *\\n * @param contractType The role of the contract to retrieve.\\n * @return contract_ The address of the contract with the specified role.\\n */\\n function getContract(ContractType contractType) external view returns (address contract_);\\n\\n /**\\n * @dev Sets the address of a contract with a specific role.\\n * Emits the event {ContractUpdated}.\\n * @param contractType The role of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function setContract(ContractType contractType, address addr) external;\\n}\\n\",\"keccak256\":\"0x99d8213d857e30d367155abd15dc42730afdfbbac3a22dfb3b95ffea2083a92e\",\"license\":\"MIT\"},\"src/interfaces/validator/ICandidateManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface ICandidateManager {\\n struct ValidatorCandidate {\\n // Admin of the candidate\\n address admin;\\n // Address of the validator that produces block, e.g. block.coinbase. This is so-called validator address.\\n address consensusAddr;\\n // Address that receives mining reward of the validator\\n address payable treasuryAddr;\\n // Address of the bridge operator corresponding to the candidate\\n address ______deprecatedbridgeOperatorAddr;\\n // The percentage of reward that validators can be received, the rest goes to the delegators.\\n // Values in range [0; 100_00] stands for 0-100%\\n uint256 commissionRate;\\n // The timestamp that scheduled to revoke the candidate (no schedule=0)\\n uint256 revokingTimestamp;\\n // The deadline that the candidate must top up staking amount to keep it larger than or equal to the threshold (no deadline=0)\\n uint256 topupDeadline;\\n }\\n\\n struct CommissionSchedule {\\n // The timestamp that the commission schedule gets affected (no schedule=0).\\n uint256 effectiveTimestamp;\\n // The new commission rate. Value is in range [0; 100_00], stands for 0-100%\\n uint256 commissionRate;\\n }\\n\\n /// @dev Emitted when the maximum number of validator candidates is updated.\\n event MaxValidatorCandidateUpdated(uint256 threshold);\\n /// @dev Emitted when the min offset to the effective date of commission rate change is updated.\\n event MinEffectiveDaysOnwardsUpdated(uint256 numOfDays);\\n /// @dev Emitted when the validator candidate is granted.\\n event CandidateGranted(address indexed consensusAddr, address indexed treasuryAddr, address indexed admin);\\n /// @dev Emitted when the revoking timestamp of a candidate is updated.\\n event CandidateRevokingTimestampUpdated(address indexed consensusAddr, uint256 revokingTimestamp);\\n /// @dev Emitted when the topup deadline of a candidate is updated.\\n event CandidateTopupDeadlineUpdated(address indexed consensusAddr, uint256 topupDeadline);\\n /// @dev Emitted when the validator candidate is revoked.\\n event CandidatesRevoked(address[] consensusAddrs);\\n\\n /// @dev Emitted when a schedule for updating commission rate is set.\\n event CommissionRateUpdateScheduled(address indexed consensusAddr, uint256 effectiveTimestamp, uint256 rate);\\n /// @dev Emitted when the commission rate of a validator is updated.\\n event CommissionRateUpdated(address indexed consensusAddr, uint256 rate);\\n\\n /// @dev Error of exceeding maximum number of candidates.\\n error ErrExceedsMaxNumberOfCandidate();\\n /// @dev Error of querying for already existent candidate.\\n error ErrExistentCandidate();\\n /// @dev Error of querying for non-existent candidate.\\n error ErrNonExistentCandidate();\\n /// @dev Error of candidate admin already exists.\\n error ErrExistentCandidateAdmin(address _candidateAdminAddr);\\n /// @dev Error of treasury already exists.\\n error ErrExistentTreasury(address _treasuryAddr);\\n /// @dev Error of invalid commission rate.\\n error ErrInvalidCommissionRate();\\n /// @dev Error of invalid effective days onwards.\\n error ErrInvalidEffectiveDaysOnwards();\\n /// @dev Error of invalid min effective days onwards.\\n error ErrInvalidMinEffectiveDaysOnwards();\\n /// @dev Error of already requested revoking candidate before.\\n error ErrAlreadyRequestedRevokingCandidate();\\n /// @dev Error of commission change schedule exists.\\n error ErrAlreadyRequestedUpdatingCommissionRate();\\n /// @dev Error of trusted org cannot renounce.\\n error ErrTrustedOrgCannotRenounce();\\n\\n /**\\n * @dev Returns the maximum number of validator candidate.\\n */\\n function maxValidatorCandidate() external view returns (uint256);\\n\\n /**\\n * @dev Returns the minimum number of days to the effective date of commission rate change.\\n */\\n function minEffectiveDaysOnward() external view returns (uint256);\\n\\n /**\\n * @dev Sets the maximum number of validator candidate.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `MaxValidatorCandidateUpdated` event.\\n *\\n */\\n function setMaxValidatorCandidate(uint256) external;\\n\\n /**\\n * @dev Sets the minimum number of days to the effective date of commision rate change.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `MinEffectiveDaysOnwardsUpdated` event.\\n *\\n */\\n function setMinEffectiveDaysOnwards(uint256 _numOfDays) external;\\n\\n /**\\n * @dev Grants a validator candidate.\\n *\\n * Requirements:\\n * - The method caller is staking contract.\\n *\\n * Emits the event `CandidateGranted`.\\n *\\n */\\n function execApplyValidatorCandidate(address _admin, address _consensusAddr, address payable _treasuryAddr, uint256 _commissionRate) external;\\n\\n /**\\n * @dev Requests to revoke a validator candidate in next `_secsLeft` seconds.\\n *\\n * Requirements:\\n * - The method caller is staking contract.\\n *\\n * Emits the event `CandidateRevokingTimestampUpdated`.\\n *\\n */\\n function execRequestRenounceCandidate(address, uint256 _secsLeft) external;\\n\\n /**\\n * @dev Fallback function of `CandidateStaking-requestUpdateCommissionRate`.\\n *\\n * Requirements:\\n * - The method caller is the staking contract.\\n * - The `_effectiveTimestamp` must be the beginning of a UTC day, and at least from 7 days onwards\\n * - The `_rate` must be in range of [0_00; 100_00].\\n *\\n * Emits the event `CommissionRateUpdateScheduled`.\\n *\\n */\\n function execRequestUpdateCommissionRate(address _consensusAddr, uint256 _effectiveTimestamp, uint256 _rate) external;\\n\\n /**\\n * @dev Returns whether the address is a validator (candidate).\\n */\\n function isValidatorCandidate(address _addr) external view returns (bool);\\n\\n /**\\n * @dev Returns the validator candidate.\\n */\\n function getValidatorCandidates() external view returns (address[] memory);\\n\\n /**\\n * @dev Returns all candidate info.\\n */\\n function getCandidateInfos() external view returns (ValidatorCandidate[] memory);\\n\\n /**\\n * @dev Returns the info of a candidate.\\n */\\n function getCandidateInfo(address _candidate) external view returns (ValidatorCandidate memory);\\n\\n /**\\n * @dev Returns whether the address is the candidate admin.\\n */\\n function isCandidateAdmin(address _candidate, address _admin) external view returns (bool);\\n\\n /**\\n * @dev Returns the schedule of changing commission rate of a candidate address.\\n */\\n function getCommissionChangeSchedule(address _candidate) external view returns (CommissionSchedule memory);\\n}\\n\",\"keccak256\":\"0x37b15d36774a3f18291e85efa9df6caaf52b8fa751a8222a3ac8f467656950c1\",\"license\":\"MIT\"},\"src/interfaces/validator/ICoinbaseExecution.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"./ISlashingExecution.sol\\\";\\n\\ninterface ICoinbaseExecution is ISlashingExecution {\\n enum BlockRewardDeprecatedType {\\n UNKNOWN,\\n UNAVAILABILITY,\\n AFTER_BAILOUT\\n }\\n\\n /// @dev Emitted when the validator set is updated\\n event ValidatorSetUpdated(uint256 indexed period, address[] consensusAddrs);\\n /// @dev Emitted when the bridge operator set is updated, to mirror the in-jail and maintaining status of the validator.\\n event BlockProducerSetUpdated(uint256 indexed period, uint256 indexed epoch, address[] consensusAddrs);\\n /// @dev Emitted when the bridge operator set is updated.\\n event BridgeOperatorSetUpdated(uint256 indexed period, uint256 indexed epoch, address[] bridgeOperators);\\n\\n /// @dev Emitted when the reward of the block producer is deprecated.\\n event BlockRewardDeprecated(address indexed coinbaseAddr, uint256 rewardAmount, BlockRewardDeprecatedType deprecatedType);\\n /// @dev Emitted when the block reward is submitted.\\n event BlockRewardSubmitted(address indexed coinbaseAddr, uint256 submittedAmount, uint256 bonusAmount);\\n\\n /// @dev Emitted when the block producer reward is distributed.\\n event MiningRewardDistributed(address indexed consensusAddr, address indexed recipient, uint256 amount);\\n /// @dev Emitted when the contract fails when distributing the block producer reward.\\n event MiningRewardDistributionFailed(address indexed consensusAddr, address indexed recipient, uint256 amount, uint256 contractBalance);\\n\\n /// @dev Emitted when the bridge operator reward is distributed.\\n event BridgeOperatorRewardDistributed(address indexed consensusAddr, address indexed bridgeOperator, address indexed recipientAddr, uint256 amount);\\n /// @dev Emitted when the contract fails when distributing the bridge operator reward.\\n event BridgeOperatorRewardDistributionFailed(\\n address indexed consensusAddr, address indexed bridgeOperator, address indexed recipient, uint256 amount, uint256 contractBalance\\n );\\n\\n /// @dev Emitted when the fast finality reward is distributed.\\n event FastFinalityRewardDistributed(address indexed consensusAddr, address indexed recipient, uint256 amount);\\n /// @dev Emitted when the contract fails when distributing the fast finality reward.\\n event FastFinalityRewardDistributionFailed(address indexed consensusAddr, address indexed recipient, uint256 amount, uint256 contractBalance);\\n\\n /// @dev Emitted when the amount of RON reward is distributed to staking contract.\\n event StakingRewardDistributed(uint256 totalAmount, address[] consensusAddrs, uint256[] amounts);\\n /// @dev Emitted when the contracts fails when distributing the amount of RON to the staking contract.\\n event StakingRewardDistributionFailed(uint256 totalAmount, address[] consensusAddrs, uint256[] amounts, uint256 contractBalance);\\n\\n /// @dev Emitted when the epoch is wrapped up.\\n event WrappedUpEpoch(uint256 indexed periodNumber, uint256 indexed epochNumber, bool periodEnding);\\n\\n /// @dev Error of only allowed at the end of epoch\\n error ErrAtEndOfEpochOnly();\\n /// @dev Error of query for already wrapped up epoch\\n error ErrAlreadyWrappedEpoch();\\n\\n /**\\n * @dev Submits reward of the current block.\\n *\\n * Requirements:\\n * - The method caller is coinbase.\\n *\\n * Emits the event `MiningRewardDeprecated` if the coinbase is slashed or no longer be a block producer.\\n * Emits the event `BlockRewardSubmitted` for the valid call.\\n *\\n */\\n function submitBlockReward() external payable;\\n\\n /**\\n * @dev Wraps up the current epoch.\\n *\\n * Requirements:\\n * - The method must be called when the current epoch is ending.\\n * - The epoch is not wrapped yet.\\n * - The method caller is coinbase.\\n *\\n * Emits the event `MiningRewardDistributed` when some validator has reward distributed.\\n * Emits the event `StakingRewardDistributed` when some staking pool has reward distributed.\\n * Emits the event `BlockProducerSetUpdated` when the epoch is wrapped up.\\n * Emits the event `BridgeOperatorSetUpdated` when the epoch is wrapped up at period ending.\\n * Emits the event `ValidatorSetUpdated` when the epoch is wrapped up at period ending, and the validator set gets updated.\\n * Emits the event `WrappedUpEpoch`.\\n *\\n */\\n function wrapUpEpoch() external payable;\\n}\\n\",\"keccak256\":\"0x3030ef01bb0277f8607fb3b6358a4cd1d75f6a756e5c884153fbf94f0a16b4d4\",\"license\":\"MIT\"},\"src/interfaces/validator/IEmergencyExit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface IEmergencyExit {\\n /// @dev Emitted when the fund is locked from an emergency exit request\\n event EmergencyExitRequested(address indexed consensusAddr, uint256 lockedAmount);\\n /// @dev Emitted when the fund that locked from an emergency exit request is transferred to the recipient.\\n event EmergencyExitLockedFundReleased(address indexed consensusAddr, address indexed recipient, uint256 unlockedAmount);\\n /// @dev Emitted when the fund that locked from an emergency exit request is failed to transferred back.\\n event EmergencyExitLockedFundReleasingFailed(address indexed consensusAddr, address indexed recipient, uint256 unlockedAmount, uint256 contractBalance);\\n\\n /// @dev Emitted when the emergency exit locked amount is updated.\\n event EmergencyExitLockedAmountUpdated(uint256 amount);\\n /// @dev Emitted when the emergency expiry duration is updated.\\n event EmergencyExpiryDurationUpdated(uint256 amount);\\n\\n /// @dev Error of already requested emergency exit before.\\n error ErrAlreadyRequestedEmergencyExit();\\n\\n /**\\n * @dev Returns the amount of RON to lock from a consensus address.\\n */\\n function emergencyExitLockedAmount() external returns (uint256);\\n\\n /**\\n * @dev Returns the duration that an emergency request is expired and the fund will be recycled.\\n */\\n function emergencyExpiryDuration() external returns (uint256);\\n\\n /**\\n * @dev Sets the amount of RON to lock from a consensus address.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the event `EmergencyExitLockedAmountUpdated`.\\n *\\n */\\n function setEmergencyExitLockedAmount(uint256 _emergencyExitLockedAmount) external;\\n\\n /**\\n * @dev Sets the duration that an emergency request is expired and the fund will be recycled.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the event `EmergencyExpiryDurationUpdated`.\\n *\\n */\\n function setEmergencyExpiryDuration(uint256 _emergencyExpiryDuration) external;\\n\\n /**\\n * @dev Unlocks fund for emergency exit request.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the event `EmergencyExitLockedFundReleased` if the fund is successfully unlocked.\\n * Emits the event `EmergencyExitLockedFundReleasingFailed` if the fund is failed to unlock.\\n *\\n */\\n function execReleaseLockedFundForEmergencyExitRequest(address _consensusAddr, address payable _recipient) external;\\n\\n /**\\n * @dev Fallback function of `IStaking-requestEmergencyExit`.\\n *\\n * Requirements:\\n * - The method caller is staking contract.\\n *\\n */\\n function execEmergencyExit(address _consensusAddr, uint256 _secLeftToRevoke) external;\\n}\\n\",\"keccak256\":\"0x2df640817e7fb957f923dd583e82be9610a8441735b69519db5bd9457683bec2\",\"license\":\"MIT\"},\"src/interfaces/validator/IRoninValidatorSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"./ICandidateManager.sol\\\";\\nimport \\\"./info-fragments/ICommonInfo.sol\\\";\\nimport \\\"./ICoinbaseExecution.sol\\\";\\nimport \\\"./ISlashingExecution.sol\\\";\\nimport \\\"./IEmergencyExit.sol\\\";\\n\\ninterface IRoninValidatorSet is ICandidateManager, ICommonInfo, ISlashingExecution, ICoinbaseExecution, IEmergencyExit { }\\n\",\"keccak256\":\"0x5ae53ab78a38d9c59d74b4723ead82146bc402874ebbdc90b70ce084516e010f\",\"license\":\"MIT\"},\"src/interfaces/validator/ISlashingExecution.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface ISlashingExecution {\\n /// @dev Emitted when the validator is punished.\\n event ValidatorPunished(\\n address indexed consensusAddr,\\n uint256 indexed period,\\n uint256 jailedUntil,\\n uint256 deductedStakingAmount,\\n bool blockProducerRewardDeprecated,\\n bool bridgeOperatorRewardDeprecated\\n );\\n /// @dev Emitted when the validator get out of jail by bailout.\\n event ValidatorUnjailed(address indexed validator, uint256 period);\\n\\n /// @dev Error of cannot bailout due to high tier slash.\\n error ErrCannotBailout(address validator);\\n\\n /**\\n * @dev Finalize the slash request from slash indicator contract.\\n *\\n * Requirements:\\n * - The method caller is slash indicator contract.\\n *\\n * Emits the event `ValidatorPunished`.\\n *\\n */\\n function execSlash(address validatorAddr, uint256 newJailedUntil, uint256 slashAmount, bool cannotBailout) external;\\n\\n /**\\n * @dev Finalize the bailout request from slash indicator contract.\\n *\\n * Requirements:\\n * - The method caller is slash indicator contract.\\n *\\n * Emits the event `ValidatorUnjailed`.\\n *\\n */\\n function execBailOut(address _validatorAddr, uint256 _period) external;\\n}\\n\",\"keccak256\":\"0xac0b772f2fca9dafd7cc6742f91b442f9f545bf9472185b8d817fe045b680193\",\"license\":\"MIT\"},\"src/interfaces/validator/info-fragments/ICommonInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"./IJailingInfo.sol\\\";\\nimport \\\"./ITimingInfo.sol\\\";\\n\\ninterface ICommonInfo is ITimingInfo, IJailingInfo {\\n struct EmergencyExitInfo {\\n uint256 lockedAmount;\\n // The timestamp that this locked amount will be recycled to staking vesting contract\\n uint256 recyclingAt;\\n }\\n\\n /// @dev Emitted when the deprecated reward is withdrawn.\\n event DeprecatedRewardRecycled(address indexed recipientAddr, uint256 amount);\\n /// @dev Emitted when the deprecated reward withdrawal is failed\\n event DeprecatedRewardRecycleFailed(address indexed recipientAddr, uint256 amount, uint256 balance);\\n\\n /// @dev Error thrown when receives RON from neither staking vesting contract nor staking contract\\n error ErrUnauthorizedReceiveRON();\\n /// @dev Error thrown when queries for a non existent info.\\n error NonExistentRecyclingInfo();\\n\\n /**\\n * @dev Returns the total deprecated reward, which includes reward that is not sent for slashed validators and unsastified bridge operators\\n */\\n function totalDeprecatedReward() external view returns (uint256);\\n\\n /**\\n * @dev Returns the emergency exit request.\\n */\\n function getEmergencyExitInfo(address _consensusAddr) external view returns (EmergencyExitInfo memory);\\n}\\n\",\"keccak256\":\"0x4a215273f535697ecf54a97c8fd9de9c666ca64b88dafe7ab60b2903f71ffb41\",\"license\":\"MIT\"},\"src/interfaces/validator/info-fragments/IJailingInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface IJailingInfo {\\n /**\\n * @dev Returns whether the validator are put in jail (cannot join the set of validators) during the current period.\\n */\\n function checkJailed(address) external view returns (bool);\\n\\n /**\\n * @dev Returns whether the validator are put in jail and the number of block and epoch that he still is in the jail.\\n */\\n function getJailedTimeLeft(address _addr) external view returns (bool isJailed_, uint256 blockLeft_, uint256 epochLeft_);\\n\\n /**\\n * @dev Returns whether the validator are put in jail (cannot join the set of validators) at a specific block.\\n */\\n function checkJailedAtBlock(address _addr, uint256 _blockNum) external view returns (bool);\\n\\n /**\\n * @dev Returns whether the validator are put in jail at a specific block and the number of block and epoch that he still is in the jail.\\n */\\n function getJailedTimeLeftAtBlock(address _addr, uint256 _blockNum) external view returns (bool isJailed_, uint256 blockLeft_, uint256 epochLeft_);\\n\\n /**\\n * @dev Returns whether the validators are put in jail (cannot join the set of validators) during the current period.\\n */\\n function checkManyJailed(address[] calldata) external view returns (bool[] memory);\\n\\n /**\\n * @dev Returns whether the incoming reward of the block producer is deprecated during the current period.\\n */\\n function checkMiningRewardDeprecated(address _blockProducer) external view returns (bool);\\n\\n /**\\n * @dev Returns whether the incoming reward of the block producer is deprecated during a specific period.\\n */\\n function checkMiningRewardDeprecatedAtPeriod(address _blockProducer, uint256 _period) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xd83e85bea11509406213b8d06956b33238d27fa1b5e555c1f064bdfd41d6d216\",\"license\":\"MIT\"},\"src/interfaces/validator/info-fragments/ITimingInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface ITimingInfo {\\n /**\\n * @dev Returns the block that validator set was updated.\\n */\\n function getLastUpdatedBlock() external view returns (uint256);\\n\\n /**\\n * @dev Returns the number of blocks in a epoch.\\n */\\n function numberOfBlocksInEpoch() external view returns (uint256 _numberOfBlocks);\\n\\n /**\\n * @dev Returns the epoch index from the block number.\\n */\\n function epochOf(uint256 _block) external view returns (uint256);\\n\\n /**\\n * @dev Returns whether the epoch ending is at the block number `_block`.\\n */\\n function epochEndingAt(uint256 _block) external view returns (bool);\\n\\n /**\\n * @dev Tries to get the period index from the epoch number.\\n */\\n function tryGetPeriodOfEpoch(uint256 _epoch) external view returns (bool _filled, uint256 _periodNumber);\\n\\n /**\\n * @dev Returns whether the period ending at the current block number.\\n */\\n function isPeriodEnding() external view returns (bool);\\n\\n /**\\n * @dev Returns the period index from the current block.\\n */\\n function currentPeriod() external view returns (uint256);\\n\\n /**\\n * @dev Returns the block number that the current period starts at.\\n */\\n function currentPeriodStartAtBlock() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x77b86a68149389fed0eb0c5b8d56f278d3bd103ba64f504697d709b24c3212d5\",\"license\":\"MIT\"},\"src/libraries/AddressArrayUtils.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\nlibrary AddressArrayUtils {\\n /**\\n * @dev Error thrown when a duplicated element is detected in an array.\\n * @param msgSig The function signature that invoke the error.\\n */\\n error ErrDuplicated(bytes4 msgSig);\\n\\n /**\\n * @dev Returns whether or not there's a duplicate. Runs in O(n^2).\\n * @param A Array to search\\n * @return Returns true if duplicate, false otherwise\\n */\\n function hasDuplicate(address[] memory A) internal pure returns (bool) {\\n if (A.length == 0) {\\n return false;\\n }\\n unchecked {\\n for (uint256 i = 0; i < A.length - 1; i++) {\\n for (uint256 j = i + 1; j < A.length; j++) {\\n if (A[i] == A[j]) {\\n return true;\\n }\\n }\\n }\\n }\\n return false;\\n }\\n\\n /**\\n * @dev Returns whether two arrays of addresses are equal or not.\\n */\\n function isEqual(address[] memory _this, address[] memory _other) internal pure returns (bool yes_) {\\n // Hashing two arrays and compare their hash\\n assembly {\\n let _thisHash := keccak256(add(_this, 32), mul(mload(_this), 32))\\n let _otherHash := keccak256(add(_other, 32), mul(mload(_other), 32))\\n yes_ := eq(_thisHash, _otherHash)\\n }\\n }\\n\\n /**\\n * @dev Return the concatenated array from a and b.\\n */\\n function extend(address[] memory a, address[] memory b) internal pure returns (address[] memory c) {\\n uint256 lengthA = a.length;\\n uint256 lengthB = b.length;\\n unchecked {\\n c = new address[](lengthA + lengthB);\\n }\\n uint256 i;\\n for (; i < lengthA;) {\\n c[i] = a[i];\\n unchecked {\\n ++i;\\n }\\n }\\n for (uint256 j; j < lengthB;) {\\n c[i] = b[j];\\n unchecked {\\n ++i;\\n ++j;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce5d578861167da47a965c8a0e1592b808aad6eb79ccb1873bf2e2280ddb85ee\",\"license\":\"UNLICENSED\"},\"src/libraries/Math.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\nlibrary Math {\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a >= b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns whether the number `c` is in range of [a; b].\\n */\\n function inRange(uint256 c, uint256 a, uint256 b) internal pure returns (bool) {\\n return a <= c && c <= b;\\n }\\n\\n /**\\n * @dev Returns whether two inclusive ranges [x1;x2] and [y1;y2] overlap.\\n */\\n function twoRangeOverlap(uint256 x1, uint256 x2, uint256 y1, uint256 y2) internal pure returns (bool) {\\n return x1 <= y2 && y1 <= x2;\\n }\\n\\n /**\\n * @dev Returns value of a + b; in case result is larger than upperbound, upperbound is returned.\\n */\\n function addWithUpperbound(uint256 a, uint256 b, uint256 upperbound) internal pure returns (uint256) {\\n return min(a + b, upperbound);\\n }\\n\\n /**\\n * @dev Returns value of a - b; in case of negative result, 0 is returned.\\n */\\n function subNonNegative(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a - b : 0;\\n }\\n\\n /**\\n * @dev Returns value of `a + zeroable` if zerobale is not 0; otherwise, return 0.\\n */\\n function addIfNonZero(uint256 a, uint256 zeroable) internal pure returns (uint256) {\\n return zeroable != 0 ? a + zeroable : 0;\\n }\\n}\\n\",\"keccak256\":\"0xd73170f448c644a47024c7dbcf4afc3cc7ad27f61737c6ea4c3b543ec5cdb7e9\",\"license\":\"UNLICENSED\"},\"src/ronin/gateway/BridgeReward.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.23;\\n\\nimport { Initializable } from \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport { BridgeTrackingHelper } from \\\"../../extensions/bridge-operator-governance/BridgeTrackingHelper.sol\\\";\\nimport { ContractType, HasContracts } from \\\"../../extensions/collections/HasContracts.sol\\\";\\nimport { RONTransferHelper } from \\\"../../extensions/RONTransferHelper.sol\\\";\\nimport { IRoninValidatorSet } from \\\"../../interfaces/validator/IRoninValidatorSet.sol\\\";\\nimport { IBridgeManager } from \\\"../../interfaces/bridge/IBridgeManager.sol\\\";\\nimport { IBridgeTracking } from \\\"../../interfaces/bridge/IBridgeTracking.sol\\\";\\nimport { IBridgeReward } from \\\"../../interfaces/bridge/IBridgeReward.sol\\\";\\nimport { IBridgeSlash } from \\\"../../interfaces/bridge/IBridgeSlash.sol\\\";\\nimport { Math } from \\\"../../libraries/Math.sol\\\";\\nimport { TUint256Slot } from \\\"../../types/Types.sol\\\";\\nimport { ErrSyncTooFarPeriod, ErrInvalidArguments, ErrLengthMismatch, ErrUnauthorizedCall } from \\\"../../utils/CommonErrors.sol\\\";\\n\\ncontract BridgeReward is IBridgeReward, BridgeTrackingHelper, HasContracts, RONTransferHelper, Initializable {\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeReward.rewardInfo.slot\\\") - 1\\n bytes32 private constant $_REWARD_INFO = 0x518cfd198acbffe95e740cfce1af28a3f7de51f0d784893d3d72c5cc59d7062a;\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeReward.rewardPerPeriod.slot\\\") - 1\\n TUint256Slot private constant $_REWARD_PER_PERIOD = TUint256Slot.wrap(0x90f7d557245e5dd9485f463e58974fa7cdc93c0abbd0a1afebb8f9640ec73910);\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeReward.latestRewardedPeriod.slot\\\") - 1\\n TUint256Slot private constant $_LATEST_REWARDED_PERIOD = TUint256Slot.wrap(0x2417f25874c1cdc139a787dd21df976d40d767090442b3a2496917ecfc93b619);\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeReward.totalRewardToppedUp.slot\\\") - 1\\n TUint256Slot private constant $_TOTAL_REWARDS_TOPPED_UP = TUint256Slot.wrap(0x9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c64);\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeReward.totalRewardScattered.slot\\\") - 1\\n TUint256Slot private constant $_TOTAL_REWARDS_SCATTERED = TUint256Slot.wrap(0x3663384f6436b31a97d9c9a02f64ab8b73ead575c5b6224fa0800a6bd57f62f4);\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeReward.maxRewardingPeriodCount.slot\\\") - 1\\n TUint256Slot private constant $_MAX_REWARDING_PERIOD_COUNT = TUint256Slot.wrap(0xaf260ffaff563b9407c1c5fe4aec2be8632142d158c44bb0ce4d471cb4883b8c);\\n\\n address private immutable _self;\\n\\n constructor() payable {\\n _self = address(this);\\n _disableInitializers();\\n }\\n\\n function initialize(\\n address bridgeManagerContract,\\n address bridgeTrackingContract,\\n address bridgeSlashContract,\\n address validatorSetContract,\\n address dposGA,\\n uint256 rewardPerPeriod\\n ) external payable initializer {\\n _setContract(ContractType.BRIDGE_MANAGER, bridgeManagerContract);\\n _setContract(ContractType.BRIDGE_TRACKING, bridgeTrackingContract);\\n _setContract(ContractType.BRIDGE_SLASH, bridgeSlashContract);\\n _setContract(ContractType.VALIDATOR, validatorSetContract);\\n _setContract(ContractType.GOVERNANCE_ADMIN, dposGA);\\n $_LATEST_REWARDED_PERIOD.store(type(uint256).max);\\n _setRewardPerPeriod(rewardPerPeriod);\\n _receiveRON();\\n }\\n\\n /**\\n * @dev Helper for running upgrade script, required to only revoked once by the DPoS's governance admin.\\n * The following must be assured after initializing REP2:\\n * ```\\n * {BridgeTracking}._lastSyncPeriod\\n * == {BridgeReward}.latestRewardedPeriod\\n * == {RoninValidatorSet}.currentPeriod()\\n * ```\\n */\\n function initializeREP2() external onlyContract(ContractType.GOVERNANCE_ADMIN) {\\n require(getLatestRewardedPeriod() == type(uint256).max, \\\"already init rep 2\\\");\\n $_LATEST_REWARDED_PERIOD.store(IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod() - 1);\\n _setContract(ContractType.GOVERNANCE_ADMIN, address(0));\\n }\\n\\n /**\\n * @dev The following must be assured after initializing V2:\\n * ```\\n * {BridgeTracking}._lastSyncPeriod\\n * == {RoninValidatorSet}.currentPeriod()\\n * == {BridgeReward}.latestRewardedPeriod + 1\\n * ```\\n */\\n function initializeV2() external reinitializer(2) {\\n $_MAX_REWARDING_PERIOD_COUNT.store(5);\\n $_LATEST_REWARDED_PERIOD.store(getLatestRewardedPeriod() - 1);\\n }\\n\\n /**\\n * @inheritdoc IBridgeReward\\n */\\n function receiveRON() external payable {\\n _receiveRON();\\n }\\n\\n /**\\n * @inheritdoc IBridgeReward\\n */\\n function syncRewardManual(uint256 periodCount) external {\\n if (!_isBridgeOperator(msg.sender)) revert ErrUnauthorizedCall(msg.sig);\\n uint256 currPd = IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod();\\n\\n _syncRewardBatch({ currPd: currPd, pdCount: periodCount });\\n }\\n\\n /**\\n * @inheritdoc IBridgeReward\\n */\\n function execSyncRewardAuto(uint256 currentPeriod) external onlyContract(ContractType.BRIDGE_TRACKING) {\\n _syncRewardBatch({ currPd: currentPeriod, pdCount: 0 });\\n }\\n\\n /**\\n * @dev Sync bridge reward for multiple periods, always assert `latestRewardedPeriod + periodCount < currentPeriod`.\\n * @param pdCount Number of periods to settle reward. Leave this as 0 to auto calculate.\\n */\\n function _syncRewardBatch(uint256 currPd, uint256 pdCount) internal {\\n uint256 lastRewardPd = getLatestRewardedPeriod();\\n if (pdCount == 0) {\\n uint toSettlePdCount;\\n if (currPd > lastRewardPd) {\\n toSettlePdCount = currPd - lastRewardPd - 1;\\n }\\n\\n // Restrict number of period to reward in a transaction, to avoid consume too much gas\\n pdCount = Math.min(toSettlePdCount, $_MAX_REWARDING_PERIOD_COUNT.load());\\n }\\n\\n _assertPeriod({ currPd: currPd, pdCount: pdCount, lastRewardPd: lastRewardPd });\\n\\n address[] memory operators = IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)).getBridgeOperators();\\n IBridgeTracking bridgeTrackingContract = IBridgeTracking(getContract(ContractType.BRIDGE_TRACKING));\\n\\n for (uint256 i = 0; i < pdCount; i++) {\\n ++lastRewardPd;\\n _settleReward({\\n operators: operators,\\n ballots: bridgeTrackingContract.getManyTotalBallots(lastRewardPd, operators),\\n totalBallot: bridgeTrackingContract.totalBallot(lastRewardPd),\\n totalVote: bridgeTrackingContract.totalVote(lastRewardPd),\\n period: lastRewardPd\\n });\\n }\\n }\\n\\n /**\\n * @dev\\n * Before the last valid rewarding:\\n * |----------|------------------|------------------------------|-----------------|\\n * ^ ^ ^\\n * Validator.current\\n * Reward.lastReward\\n * Tracking.lastSync\\n * Tracking.ballotInfo\\n * Slash.slashInfo\\n *\\n *\\n * After the last valid rewarding, the lastRewardedPeriod always slower than currentPeriod:\\n * |----------|------------------|------------------------------|-----------------|\\n * ^ ^\\n * Validator.current\\n * Reward.lastReward\\n * Tracking.lastSync\\n * Tracking.ballotInfo\\n * Slash.slashInfo\\n */\\n function _assertPeriod(uint256 currPd, uint256 pdCount, uint256 lastRewardPd) internal pure {\\n if (pdCount == 0) revert ErrPeriodCountIsZero();\\n\\n // Not settle the period that already rewarded. This check may redundant as in the following assertion.\\n // However, not increase much in gas, this is kept for obvious in error handling.\\n if (currPd <= lastRewardPd + 1) revert ErrPeriodAlreadyRewarded(currPd, lastRewardPd);\\n\\n // Not settle the periods that not happen yet.\\n if (currPd <= lastRewardPd + pdCount) revert ErrPeriodNotHappen(currPd, lastRewardPd, pdCount);\\n }\\n\\n /**\\n * @inheritdoc IBridgeReward\\n */\\n function getTotalRewardToppedUp() external view returns (uint256) {\\n return $_TOTAL_REWARDS_TOPPED_UP.load();\\n }\\n\\n /**\\n * @inheritdoc IBridgeReward\\n */\\n function getTotalRewardScattered() external view returns (uint256) {\\n return $_TOTAL_REWARDS_SCATTERED.load();\\n }\\n\\n /**\\n * @dev Internal function to receive RON tokens as rewards and update the total topped-up rewards amount.\\n */\\n function _receiveRON() internal {\\n // prevent transfer RON directly to logic contract\\n if (address(this) == _self) revert ErrUnauthorizedCall(msg.sig);\\n\\n emit SafeReceived(msg.sender, $_TOTAL_REWARDS_TOPPED_UP.load(), msg.value);\\n $_TOTAL_REWARDS_TOPPED_UP.addAssign(msg.value);\\n }\\n\\n /**\\n * @dev Internal function to synchronize and distribute rewards to bridge operators for a given period.\\n * @param operators An array containing the addresses of bridge operators to receive rewards.\\n * @param ballots An array containing the individual ballot counts for each bridge operator.\\n * @param totalBallot The total number of available ballots for the period.\\n * @param totalVote The total number of votes recorded for the period.\\n * @param period The period for which the rewards are being synchronized.\\n */\\n function _settleReward(address[] memory operators, uint256[] memory ballots, uint256 totalBallot, uint256 totalVote, uint256 period) internal {\\n uint256 numBridgeOperators = operators.length;\\n if (numBridgeOperators != ballots.length) revert ErrLengthMismatch(msg.sig);\\n\\n uint256 rewardPerPeriod = getRewardPerPeriod();\\n uint256[] memory slashedDurationList = _getSlashInfo(operators);\\n // Validate should share the reward equally\\n bool shouldShareEqually = _shouldShareEqually(totalBallot, totalVote, ballots);\\n\\n uint256 reward;\\n bool shouldSlash;\\n uint256 sumRewards;\\n\\n for (uint256 i; i < numBridgeOperators; i++) {\\n (reward, shouldSlash) = _calcRewardAndCheckSlashedStatus({\\n shouldShareEqually: shouldShareEqually,\\n numBridgeOperators: numBridgeOperators,\\n rewardPerPeriod: rewardPerPeriod,\\n ballot: ballots[i],\\n totalBallot: totalBallot,\\n period: period,\\n slashUntilPeriod: slashedDurationList[i]\\n });\\n\\n bool scattered = _updateRewardAndTransfer({ period: period, operator: operators[i], reward: reward, shouldSlash: shouldSlash });\\n sumRewards += (shouldSlash || !scattered) ? 0 : reward;\\n }\\n\\n $_TOTAL_REWARDS_SCATTERED.addAssign(sumRewards);\\n $_LATEST_REWARDED_PERIOD.store(period);\\n }\\n\\n /**\\n * @dev Returns whether should share the reward equally, in case of bridge tracking returns\\n * informed data or there is no ballot in a day.\\n *\\n * Emit a {BridgeTrackingIncorrectlyResponded} event when in case of incorrect data.\\n */\\n function _shouldShareEqually(uint256 totalBallot, uint256 totalVote, uint256[] memory ballots) internal returns (bool shareEqually) {\\n bool valid = _isValidBridgeTrackingResponse(totalBallot, totalVote, ballots);\\n if (!valid) {\\n emit BridgeTrackingIncorrectlyResponded();\\n }\\n\\n return !valid || totalBallot == 0;\\n }\\n\\n /**\\n * @dev Internal function to calculate the reward for a bridge operator and check its slashing status.\\n * @param shouldShareEqually A boolean indicating whether the reward should be shared equally among bridge operators.\\n * @param numBridgeOperators The total number of bridge operators for proportional reward calculation.\\n * @param rewardPerPeriod The total reward available for the period.\\n * @param ballot The individual ballot count of the bridge operator for the period.\\n * @param totalBallot The total number of available ballots for the period.\\n * @param period The period for which the reward is being calculated.\\n * @param slashUntilPeriod The period until which slashing is effective for the bridge operator.\\n * @return reward The calculated reward for the bridge operator.\\n * @return shouldSlash A boolean indicating whether the bridge operator should be slashed for the current period.\\n */\\n function _calcRewardAndCheckSlashedStatus(\\n bool shouldShareEqually,\\n uint256 numBridgeOperators,\\n uint256 rewardPerPeriod,\\n uint256 ballot,\\n uint256 totalBallot,\\n uint256 period,\\n uint256 slashUntilPeriod\\n ) internal pure returns (uint256 reward, bool shouldSlash) {\\n shouldSlash = _shouldSlashedThisPeriod(period, slashUntilPeriod);\\n reward = _calcReward(shouldShareEqually, numBridgeOperators, rewardPerPeriod, ballot, totalBallot);\\n }\\n\\n /**\\n * @dev Internal function to check if a specific period should be considered as slashed based on the slash duration.\\n */\\n function _shouldSlashedThisPeriod(uint256 period, uint256 slashUntil) internal pure returns (bool) {\\n return period <= slashUntil;\\n }\\n\\n /**\\n * @dev Internal function to calculate the reward for a bridge operator based on the provided parameters.\\n * @param shouldShareEqually A boolean indicating whether the reward should be shared equally among bridge operators.\\n * @param numBridgeOperators The total number of bridge operators for proportional reward calculation.\\n * @param rewardPerPeriod The total reward available for the period.\\n * @param ballot The individual ballot count of the bridge operator for the period.\\n * @param totalBallot The total number of available ballots for the period.\\n * @return reward The calculated reward for the bridge operator.\\n */\\n function _calcReward(\\n bool shouldShareEqually,\\n uint256 numBridgeOperators,\\n uint256 rewardPerPeriod,\\n uint256 ballot,\\n uint256 totalBallot\\n ) internal pure returns (uint256 reward) {\\n // Shares equally in case the bridge has nothing to vote or bridge tracking response is incorrect\\n // Else shares the bridge operators reward proportionally\\n reward = shouldShareEqually ? rewardPerPeriod / numBridgeOperators : (rewardPerPeriod * ballot) / totalBallot;\\n }\\n\\n /**\\n * @dev Transfer `reward` to a `operator` or only emit event based on the operator `slashed` status.\\n */\\n function _updateRewardAndTransfer(uint256 period, address operator, uint256 reward, bool shouldSlash) private returns (bool scattered) {\\n BridgeRewardInfo storage _iRewardInfo = _getRewardInfo()[operator];\\n\\n if (shouldSlash) {\\n _iRewardInfo.slashed += reward;\\n emit BridgeRewardSlashed(period, operator, reward);\\n return false;\\n }\\n\\n if (_unsafeSendRONLimitGas({ recipient: payable(operator), amount: reward, gas: 0 })) {\\n _iRewardInfo.claimed += reward;\\n emit BridgeRewardScattered(period, operator, reward);\\n return true;\\n } else {\\n emit BridgeRewardScatterFailed(period, operator, reward);\\n return false;\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeReward\\n */\\n function getRewardPerPeriod() public view returns (uint256) {\\n return $_REWARD_PER_PERIOD.load();\\n }\\n\\n /**\\n * @inheritdoc IBridgeReward\\n */\\n function getLatestRewardedPeriod() public view returns (uint256) {\\n return $_LATEST_REWARDED_PERIOD.load();\\n }\\n\\n /**\\n * @inheritdoc IBridgeReward\\n */\\n function getRewardInfo(address operator) external view returns (BridgeRewardInfo memory rewardInfo) {\\n return _getRewardInfo()[operator];\\n }\\n\\n /**\\n * @inheritdoc IBridgeReward\\n */\\n function setRewardPerPeriod(uint256 rewardPerPeriod) external onlyContract(ContractType.BRIDGE_MANAGER) {\\n _setRewardPerPeriod(rewardPerPeriod);\\n }\\n\\n /**\\n * @dev Internal function for setting the total reward per period.\\n * Emit an {UpdatedRewardPerPeriod} event after set.\\n */\\n function _setRewardPerPeriod(uint256 rewardPerPeriod) internal {\\n $_REWARD_PER_PERIOD.store(rewardPerPeriod);\\n emit UpdatedRewardPerPeriod(rewardPerPeriod);\\n }\\n\\n /**\\n * @dev Internal helper for querying slash info of a list of operators.\\n */\\n function _getSlashInfo(address[] memory operatorList) internal returns (uint256[] memory _slashedDuration) {\\n return IBridgeSlash(getContract(ContractType.BRIDGE_SLASH)).getSlashUntilPeriodOf(operatorList);\\n }\\n\\n /**\\n * @dev Internal helper for querying whether an address is an operator.\\n */\\n function _isBridgeOperator(address operator) internal view returns (bool) {\\n return IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)).isBridgeOperator(operator);\\n }\\n\\n /**\\n * @dev Internal function to access the mapping from bridge operator => BridgeRewardInfo.\\n * @return rewardInfo the mapping from bridge operator => BridgeRewardInfo.\\n */\\n function _getRewardInfo() internal pure returns (mapping(address => BridgeRewardInfo) storage rewardInfo) {\\n assembly (\\\"memory-safe\\\") {\\n rewardInfo.slot := $_REWARD_INFO\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7a6f4f58225927f41f4200d3ab018b441dd9c8630d2ca31644cf7f0e6af2a009\",\"license\":\"MIT\"},\"src/types/Types.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.17;\\n\\nimport { LibTUint256Slot } from \\\"./operations/LibTUint256Slot.sol\\\";\\n\\ntype TUint256Slot is bytes32;\\n\\nusing {\\n LibTUint256Slot.add,\\n LibTUint256Slot.sub,\\n LibTUint256Slot.mul,\\n LibTUint256Slot.div,\\n LibTUint256Slot.load,\\n LibTUint256Slot.store,\\n LibTUint256Slot.addAssign,\\n LibTUint256Slot.subAssign,\\n LibTUint256Slot.preDecrement,\\n LibTUint256Slot.postDecrement,\\n LibTUint256Slot.preIncrement,\\n LibTUint256Slot.postIncrement\\n} for TUint256Slot global;\\n\",\"keccak256\":\"0x20ab58f1c9ae4936f9dd9891d064301d78ef508c1dd2ce0c19a7b5b81d530e36\",\"license\":\"MIT\"},\"src/types/operations/LibTUint256Slot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.17;\\n\\nimport { TUint256Slot } from \\\"../Types.sol\\\";\\n\\n/**\\n * @title LibTUint256Slot\\n * @dev Library for handling unsigned 256-bit integers.\\n */\\nlibrary LibTUint256Slot {\\n /// @dev value is equal to bytes4(keccak256(\\\"Panic(uint256)\\\"))\\n /// @dev see: https://github.com/foundry-rs/forge-std/blob/master/src/StdError.sol\\n uint256 private constant PANIC_ERROR_SIGNATURE = 0x4e487b71;\\n /// @dev error code for {Arithmetic over/underflow} error\\n uint256 private constant ARITHMETIC_ERROR_CODE = 0x11;\\n /// @dev error code for {Division or modulo by 0} error\\n uint256 private constant DIVISION_ERROR_CODE = 0x12;\\n\\n /**\\n * @dev Loads the value of the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @return val The loaded value.\\n */\\n function load(TUint256Slot self) internal view returns (uint256 val) {\\n assembly {\\n val := sload(self)\\n }\\n }\\n\\n /**\\n * @dev Stores a value into the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @param other The value to be stored.\\n */\\n function store(TUint256Slot self, uint256 other) internal {\\n assembly {\\n sstore(self, other)\\n }\\n }\\n\\n /**\\n * @dev Multiplies the TUint256Slot variable by a given value.\\n * @param self The TUint256Slot variable.\\n * @param other The value to multiply by.\\n * @return res The resulting value after multiplication.\\n */\\n function mul(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n if iszero(iszero(storedVal)) {\\n res := mul(storedVal, other)\\n\\n // Overflow check\\n if iszero(eq(other, div(res, storedVal))) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, ARITHMETIC_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n }\\n }\\n }\\n\\n /**\\n * @dev Divides the TUint256Slot variable by a given value.\\n * @param self The TUint256Slot variable.\\n * @param other The value to divide by.\\n * @return res The resulting value after division.\\n */\\n function div(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n // revert if divide by zero\\n if iszero(other) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, DIVISION_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n res := div(storedVal, other)\\n }\\n }\\n\\n /**\\n * @dev Subtracts a given value from the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @param other The value to subtract.\\n * @return res The resulting value after subtraction.\\n */\\n function sub(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n\\n // Underflow check\\n if lt(storedVal, other) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, ARITHMETIC_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n\\n res := sub(storedVal, other)\\n }\\n }\\n\\n /**\\n * @dev Adds a given value to the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @param other The value to add.\\n * @return res The resulting value after addition.\\n */\\n function add(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n res := add(storedVal, other)\\n\\n // Overflow check\\n if lt(res, other) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, ARITHMETIC_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n }\\n }\\n\\n /**\\n * @dev Increments the TUint256Slot variable by 1 and returns the new value.\\n * @param self The TUint256Slot variable.\\n * @return res The resulting value after incrementing.\\n */\\n function preIncrement(TUint256Slot self) internal returns (uint256 res) {\\n res = addAssign(self, 1);\\n }\\n\\n /**\\n * @dev Increments the TUint256Slot variable by 1 and returns the original value.\\n * @param self The TUint256Slot variable.\\n * @return res The original value before incrementing.\\n */\\n function postIncrement(TUint256Slot self) internal returns (uint256 res) {\\n res = load(self);\\n store(self, res + 1);\\n }\\n\\n /**\\n * @dev Decrements the TUint256Slot variable by 1 and returns the new value.\\n * @param self The TUint256Slot variable.\\n * @return res The resulting value after decrementing.\\n */\\n function preDecrement(TUint256Slot self) internal returns (uint256 res) {\\n res = subAssign(self, 1);\\n }\\n\\n /**\\n * @dev Decrements the TUint256Slot variable by 1 and returns the new value.\\n * @param self The TUint256Slot variable.\\n * @return res The resulting value before decrementing.\\n */\\n function postDecrement(TUint256Slot self) internal returns (uint256 res) {\\n res = load(self);\\n store(self, res - 1);\\n }\\n\\n /**\\n * @dev Adds a given value to the TUint256Slot variable and stores the result.\\n * @param self The TUint256Slot variable.\\n * @param other The value to add.\\n * @return res The resulting value after addition and storage.\\n */\\n function addAssign(TUint256Slot self, uint256 other) internal returns (uint256 res) {\\n store(self, res = add(self, other));\\n }\\n\\n /**\\n * @dev Subtracts a given value from the TUint256Slot variable and stores the result.\\n * @param self The TUint256Slot variable.\\n * @param other The value to subtract.\\n * @return res The resulting value after subtraction and storage.\\n */\\n function subAssign(TUint256Slot self, uint256 other) internal returns (uint256 res) {\\n store(self, res = sub(self, other));\\n }\\n}\\n\",\"keccak256\":\"0xe10c089459baf373494d76b00e582d49f6e43c500ab0f1657d53afc2fa472cbb\",\"license\":\"MIT\"},\"src/utils/CommonErrors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ContractType } from \\\"./ContractType.sol\\\";\\nimport { RoleAccess } from \\\"./RoleAccess.sol\\\";\\n\\nerror ErrSyncTooFarPeriod(uint256 period, uint256 latestRewardedPeriod);\\n/**\\n * @dev Error thrown when an address is expected to be an already created externally owned account (EOA).\\n * This error indicates that the provided address is invalid for certain contract operations that require already created EOA.\\n */\\nerror ErrAddressIsNotCreatedEOA(address addr, bytes32 codehash);\\n/**\\n * @dev Error raised when a bridge operator update operation fails.\\n * @param bridgeOperator The address of the bridge operator that failed to update.\\n */\\nerror ErrBridgeOperatorUpdateFailed(address bridgeOperator);\\n/**\\n * @dev Error thrown when attempting to add a bridge operator that already exists in the contract.\\n * This error indicates that the provided bridge operator address is already registered as a bridge operator in the contract.\\n */\\nerror ErrBridgeOperatorAlreadyExisted(address bridgeOperator);\\n/**\\n * @dev The error indicating an unsupported interface.\\n * @param interfaceId The bytes4 interface identifier that is not supported.\\n * @param addr The address where the unsupported interface was encountered.\\n */\\nerror ErrUnsupportedInterface(bytes4 interfaceId, address addr);\\n/**\\n * @dev Error thrown when the return data from a callback function is invalid.\\n * @param callbackFnSig The signature of the callback function that returned invalid data.\\n * @param register The address of the register where the callback function was invoked.\\n * @param returnData The invalid return data received from the callback function.\\n */\\nerror ErrInvalidReturnData(bytes4 callbackFnSig, address register, bytes returnData);\\n/**\\n * @dev Error of set to non-contract.\\n */\\nerror ErrZeroCodeContract(address addr);\\n/**\\n * @dev Error indicating that arguments are invalid.\\n */\\nerror ErrInvalidArguments(bytes4 msgSig);\\n/**\\n * @dev Error indicating that given address is null when it should not.\\n */\\nerror ErrZeroAddress(bytes4 msgSig);\\n/**\\n * @dev Error indicating that the provided threshold is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that the invalid threshold applies to.\\n */\\nerror ErrInvalidThreshold(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a function can only be called by the contract itself.\\n * @param msgSig The function signature (bytes4) that can only be called by the contract itself.\\n */\\nerror ErrOnlySelfCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n * @param expectedRole The role required to perform the function.\\n */\\nerror ErrUnauthorized(bytes4 msgSig, RoleAccess expectedRole);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n */\\nerror ErrUnauthorizedCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4).\\n * @param expectedContractType The contract type required to perform the function.\\n * @param actual The actual address that called to the function.\\n */\\nerror ErrUnexpectedInternalCall(bytes4 msgSig, ContractType expectedContractType, address actual);\\n\\n/**\\n * @dev Error indicating that an array is empty when it should contain elements.\\n */\\nerror ErrEmptyArray();\\n\\n/**\\n * @dev Error indicating a mismatch in the length of input parameters or arrays for a specific function.\\n * @param msgSig The function signature (bytes4) that has a length mismatch.\\n */\\nerror ErrLengthMismatch(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a proxy call to an external contract has failed.\\n * @param msgSig The function signature (bytes4) of the proxy call that failed.\\n * @param extCallSig The function signature (bytes4) of the external contract call that failed.\\n */\\nerror ErrProxyCallFailed(bytes4 msgSig, bytes4 extCallSig);\\n\\n/**\\n * @dev Error indicating that a function tried to call a precompiled contract that is not allowed.\\n * @param msgSig The function signature (bytes4) that attempted to call a precompiled contract.\\n */\\nerror ErrCallPrecompiled(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a native token transfer has failed.\\n * @param msgSig The function signature (bytes4) of the token transfer that failed.\\n */\\nerror ErrNativeTransferFailed(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that an order is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid order.\\n */\\nerror ErrInvalidOrder(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the chain ID is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid chain ID.\\n * @param actual Current chain ID that executing function.\\n * @param expected Expected chain ID required for the tx to success.\\n */\\nerror ErrInvalidChainId(bytes4 msgSig, uint256 actual, uint256 expected);\\n\\n/**\\n * @dev Error indicating that a vote type is not supported.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an unsupported vote type.\\n */\\nerror ErrUnsupportedVoteType(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the proposal nonce is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid proposal nonce.\\n */\\nerror ErrInvalidProposalNonce(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a voter has already voted.\\n * @param voter The address of the voter who has already voted.\\n */\\nerror ErrAlreadyVoted(address voter);\\n\\n/**\\n * @dev Error indicating that a signature is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid signature.\\n */\\nerror ErrInvalidSignatures(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a relay call has failed.\\n * @param msgSig The function signature (bytes4) of the relay call that failed.\\n */\\nerror ErrRelayFailed(bytes4 msgSig);\\n/**\\n * @dev Error indicating that a vote weight is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid vote weight.\\n */\\nerror ErrInvalidVoteWeight(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a query was made for an outdated bridge operator set.\\n */\\nerror ErrQueryForOutdatedBridgeOperatorSet();\\n\\n/**\\n * @dev Error indicating that a request is invalid.\\n */\\nerror ErrInvalidRequest();\\n\\n/**\\n * @dev Error indicating that a token standard is invalid.\\n */\\nerror ErrInvalidTokenStandard();\\n\\n/**\\n * @dev Error indicating that a token is not supported.\\n */\\nerror ErrUnsupportedToken();\\n\\n/**\\n * @dev Error indicating that a receipt kind is invalid.\\n */\\nerror ErrInvalidReceiptKind();\\n\\n/**\\n * @dev Error indicating that a receipt is invalid.\\n */\\nerror ErrInvalidReceipt();\\n\\n/**\\n * @dev Error indicating that an address is not payable.\\n */\\nerror ErrNonpayableAddress(address);\\n\\n/**\\n * @dev Error indicating that the period is already processed, i.e. scattered reward.\\n */\\nerror ErrPeriodAlreadyProcessed(uint256 requestingPeriod, uint256 latestPeriod);\\n\\n/**\\n * @dev Error thrown when an invalid vote hash is provided.\\n */\\nerror ErrInvalidVoteHash();\\n\\n/**\\n * @dev Error thrown when querying for an empty vote.\\n */\\nerror ErrQueryForEmptyVote();\\n\\n/**\\n * @dev Error thrown when querying for an expired vote.\\n */\\nerror ErrQueryForExpiredVote();\\n\\n/**\\n * @dev Error thrown when querying for a non-existent vote.\\n */\\nerror ErrQueryForNonExistentVote();\\n\\n/**\\n * @dev Error indicating that the method is only called once per block.\\n */\\nerror ErrOncePerBlock();\\n\\n/**\\n * @dev Error of method caller must be coinbase\\n */\\nerror ErrCallerMustBeCoinbase();\\n\\n/**\\n * @dev Error thrown when an invalid proposal is encountered.\\n * @param actual The actual value of the proposal.\\n * @param expected The expected value of the proposal.\\n */\\nerror ErrInvalidProposal(bytes32 actual, bytes32 expected);\\n\\n/**\\n * @dev Error of proposal is not approved for executing.\\n */\\nerror ErrProposalNotApproved();\\n\\n/**\\n * @dev Error of the caller is not the specified executor.\\n */\\nerror ErrInvalidExecutor();\\n\\n/**\\n * @dev Error of the `caller` to relay is not the specified `executor`.\\n */\\nerror ErrNonExecutorCannotRelay(address executor, address caller);\\n\",\"keccak256\":\"0x0d9e2fd98f6b704273faad707ed9eadbd4c79551ee3f902bff5b29213a204679\",\"license\":\"MIT\"},\"src/utils/ContractType.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum ContractType {\\n UNKNOWN, // 0\\n PAUSE_ENFORCER, // 1\\n BRIDGE, // 2\\n BRIDGE_TRACKING, // 3\\n GOVERNANCE_ADMIN, // 4\\n MAINTENANCE, // 5\\n SLASH_INDICATOR, // 6\\n STAKING_VESTING, // 7\\n VALIDATOR, // 8\\n STAKING, // 9\\n RONIN_TRUSTED_ORGANIZATION, // 10\\n BRIDGE_MANAGER, // 11\\n BRIDGE_SLASH, // 12\\n BRIDGE_REWARD, // 13\\n FAST_FINALITY_TRACKING, // 14\\n PROFILE // 15\\n\\n}\\n\",\"keccak256\":\"0xec088aa939cd885dbe84e944942d7ea674e1fff8802c1f2ae5d8e84e4578357d\",\"license\":\"MIT\"},\"src/utils/IdentityGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { AddressArrayUtils } from \\\"../libraries/AddressArrayUtils.sol\\\";\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport { TransparentUpgradeableProxyV2 } from \\\"../extensions/TransparentUpgradeableProxyV2.sol\\\";\\nimport { ErrAddressIsNotCreatedEOA, ErrZeroAddress, ErrOnlySelfCall, ErrZeroCodeContract, ErrUnsupportedInterface } from \\\"./CommonErrors.sol\\\";\\n\\nabstract contract IdentityGuard {\\n using AddressArrayUtils for address[];\\n\\n /// @dev value is equal to keccak256(abi.encode())\\n /// @dev see: https://eips.ethereum.org/EIPS/eip-1052\\n bytes32 internal constant CREATED_ACCOUNT_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\\n\\n /**\\n * @dev Modifier to restrict functions to only be called by this contract.\\n * @dev Reverts if the caller is not this contract.\\n */\\n modifier onlySelfCall() virtual {\\n _requireSelfCall();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to ensure that the elements in the `arr` array are non-duplicates.\\n * It calls the internal `_checkDuplicate` function to perform the duplicate check.\\n *\\n * Requirements:\\n * - The elements in the `arr` array must not contain any duplicates.\\n */\\n modifier nonDuplicate(address[] memory arr) virtual {\\n _requireNonDuplicate(arr);\\n _;\\n }\\n\\n /**\\n * @dev Internal method to check the method caller.\\n * @dev Reverts if the method caller is not this contract.\\n */\\n function _requireSelfCall() internal view virtual {\\n if (msg.sender != address(this)) revert ErrOnlySelfCall(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to check if a contract address has code.\\n * @param addr The address of the contract to check.\\n * @dev Throws an error if the contract address has no code.\\n */\\n function _requireHasCode(address addr) internal view {\\n if (addr.code.length == 0) revert ErrZeroCodeContract(addr);\\n }\\n\\n /**\\n * @dev Checks if an address is zero and reverts if it is.\\n * @param addr The address to check.\\n */\\n function _requireNonZeroAddress(address addr) internal pure {\\n if (addr == address(0)) revert ErrZeroAddress(msg.sig);\\n }\\n\\n /**\\n * @dev Check if arr is empty and revert if it is.\\n * Checks if an array contains any duplicate addresses and reverts if duplicates are found.\\n * @param arr The array of addresses to check.\\n */\\n function _requireNonDuplicate(address[] memory arr) internal pure {\\n if (arr.hasDuplicate()) revert AddressArrayUtils.ErrDuplicated(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to require that the provided address is a created externally owned account (EOA).\\n * This internal function is used to ensure that the provided address is a valid externally owned account (EOA).\\n * It checks the codehash of the address against a predefined constant to confirm that the address is a created EOA.\\n * @notice This method only works with non-state EOA accounts\\n */\\n function _requireCreatedEOA(address addr) internal view {\\n _requireNonZeroAddress(addr);\\n bytes32 codehash = addr.codehash;\\n if (codehash != CREATED_ACCOUNT_HASH) revert ErrAddressIsNotCreatedEOA(addr, codehash);\\n }\\n\\n /**\\n * @dev Internal function to require that the specified contract supports the given interface. This method handle in\\n * both case that the callee is either or not the proxy admin of the caller. If the contract does not support the\\n * interface `interfaceId` or EIP165, a revert with the corresponding error message is triggered.\\n *\\n * @param contractAddr The address of the contract to check for interface support.\\n * @param interfaceId The interface ID to check for support.\\n */\\n function _requireSupportsInterface(address contractAddr, bytes4 interfaceId) internal view {\\n bytes memory supportsInterfaceParams = abi.encodeCall(IERC165.supportsInterface, (interfaceId));\\n (bool success, bytes memory returnOrRevertData) = contractAddr.staticcall(supportsInterfaceParams);\\n if (!success) {\\n (success, returnOrRevertData) = contractAddr.staticcall(abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (supportsInterfaceParams)));\\n if (!success) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n if (!abi.decode(returnOrRevertData, (bool))) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n}\\n\",\"keccak256\":\"0x546ab4c9cdb0e7f8e650f140349225305ba1d0706dcaceeb9180c96aa765da59\",\"license\":\"MIT\"},\"src/utils/RoleAccess.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum RoleAccess {\\n UNKNOWN, // 0\\n ADMIN, // 1\\n COINBASE, // 2\\n GOVERNOR, // 3\\n CANDIDATE_ADMIN, // 4\\n WITHDRAWAL_MIGRATOR, // 5\\n __DEPRECATED_BRIDGE_OPERATOR, // 6\\n BLOCK_PRODUCER, // 7\\n VALIDATOR_CANDIDATE, // 8\\n CONSENSUS, // 9\\n TREASURY // 10\\n\\n}\\n\",\"keccak256\":\"0x671ff40dd874c508c4b3879a580996c7987fc018669256f47151e420a55c0e51\",\"license\":\"MIT\"}},\"version\":1}", + "nonce": 192808, + "numDeployments": 3, "storageLayout": { "storage": [ { - "astId": 1373, - "contract": "contracts/ronin/gateway/BridgeReward.sol:BridgeReward", + "astId": 58190, + "contract": "src/ronin/gateway/BridgeReward.sol:BridgeReward", "label": "_initialized", "offset": 0, "slot": "0", "type": "t_uint8" }, { - "astId": 1376, - "contract": "contracts/ronin/gateway/BridgeReward.sol:BridgeReward", + "astId": 58193, + "contract": "src/ronin/gateway/BridgeReward.sol:BridgeReward", "label": "_initializing", "offset": 1, "slot": "0", @@ -713,5 +742,10 @@ "numberOfBytes": "1" } } + }, + "timestamp": 1713251844, + "userdoc": { + "version": 1, + "kind": "user" } } \ No newline at end of file diff --git a/deployments/ronin-testnet/BridgeSlashLogic.json b/deployments/ronin-testnet/BridgeSlashLogic.json index b85139bc..cf105777 100644 --- a/deployments/ronin-testnet/BridgeSlashLogic.json +++ b/deployments/ronin-testnet/BridgeSlashLogic.json @@ -1,564 +1,486 @@ { - "address": "0x7CA05B9246CC6e3053D37219C87653041F72565e", "abi": [ { + "type": "constructor", "inputs": [], - "stateMutability": "payable", - "type": "constructor" + "stateMutability": "payable" }, { - "inputs": [ - { - "internalType": "enum ContractType", - "name": "contractType", - "type": "uint8" - } - ], - "name": "ErrContractTypeNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" - } - ], - "name": "ErrLengthMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" - }, - { - "internalType": "enum RoleAccess", - "name": "expectedRole", - "type": "uint8" - } - ], - "name": "ErrUnauthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" - }, - { - "internalType": "enum ContractType", - "name": "expectedContractType", - "type": "uint8" - }, - { - "internalType": "address", - "name": "actual", - "type": "address" - } - ], - "name": "ErrUnexpectedInternalCall", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "ErrZeroCodeContract", - "type": "error" - }, - { - "anonymous": false, - "inputs": [], - "name": "BridgeTrackingIncorrectlyResponded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "enum ContractType", - "name": "contractType", - "type": "uint8" - }, - { - "indexed": true, - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "ContractUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "period", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "bridgeOperator", - "type": "address" - } - ], - "name": "RemovalRequested", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "enum IBridgeSlashEvents.Tier", - "name": "tier", - "type": "uint8" - }, - { - "indexed": true, - "internalType": "address", - "name": "bridgeOperator", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "period", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "slashUntilPeriod", - "type": "uint256" - } - ], - "name": "Slashed", - "type": "event" - }, - { - "inputs": [], + "type": "function", "name": "MINIMUM_VOTE_THRESHOLD", + "inputs": [], "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "REMOVE_DURATION_THRESHOLD", + "inputs": [], "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "TIER_1_PENALTY_DURATION", + "inputs": [], "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "TIER_2_PENALTY_DURATION", + "inputs": [], "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "execSlashBridgeOperators", "inputs": [ { - "internalType": "address[]", - "name": "allBridgeOperators", - "type": "address[]" + "name": "operators", + "type": "address[]", + "internalType": "address[]" }, { - "internalType": "uint256[]", "name": "ballots", - "type": "uint256[]" + "type": "uint256[]", + "internalType": "uint256[]" }, { - "internalType": "uint256", "name": "totalBallot", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "totalVote", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "period", - "type": "uint256" - } - ], - "name": "execSlashBridgeOperators", - "outputs": [ - { - "internalType": "bool", - "name": "slashed", - "type": "bool" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "nonpayable", - "type": "function" + "outputs": [], + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "getAddedPeriodOf", "inputs": [ { - "internalType": "address[]", "name": "bridgeOperators", - "type": "address[]" + "type": "address[]", + "internalType": "address[]" } ], - "name": "getAddedPeriodOf", "outputs": [ { - "internalType": "uint256[]", "name": "addedPeriods", - "type": "uint256[]" + "type": "uint256[]", + "internalType": "uint256[]" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getContract", "inputs": [ { - "internalType": "enum ContractType", "name": "contractType", - "type": "uint8" + "type": "uint8", + "internalType": "enum ContractType" } ], - "name": "getContract", "outputs": [ { - "internalType": "address", "name": "contract_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "getPenaltyDurations", + "inputs": [], "outputs": [ { - "internalType": "uint256[]", "name": "penaltyDurations", - "type": "uint256[]" + "type": "uint256[]", + "internalType": "uint256[]" } ], - "stateMutability": "pure", - "type": "function" + "stateMutability": "pure" }, { + "type": "function", + "name": "getSlashTier", "inputs": [ { - "internalType": "uint256", "name": "ballot", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "totalVote", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "getSlashTier", "outputs": [ { - "internalType": "enum IBridgeSlashEvents.Tier", "name": "tier", - "type": "uint8" + "type": "uint8", + "internalType": "enum IBridgeSlashEvents.Tier" } ], - "stateMutability": "pure", - "type": "function" + "stateMutability": "pure" }, { + "type": "function", + "name": "getSlashUntilPeriodOf", "inputs": [ { - "internalType": "address[]", "name": "bridgeOperators", - "type": "address[]" + "type": "address[]", + "internalType": "address[]" } ], - "name": "getSlashUntilPeriodOf", "outputs": [ { - "internalType": "uint256[]", "name": "untilPeriods", - "type": "uint256[]" + "type": "uint256[]", + "internalType": "uint256[]" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "initialize", "inputs": [ { - "internalType": "address", "name": "validatorContract", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "bridgeManagerContract", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "bridgeTrackingContract", - "type": "address" + "type": "address", + "internalType": "address" + }, + { + "name": "dposGA", + "type": "address", + "internalType": "address" } ], - "name": "initialize", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { - "inputs": [ - { - "internalType": "address", - "name": "currentBridgeOperator", - "type": "address" - }, - { - "internalType": "address", - "name": "newBridgeOperator", - "type": "address" - } - ], - "name": "onBridgeOperatorUpdated", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "nonpayable", - "type": "function" + "type": "function", + "name": "initializeREP2", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "onBridgeOperatorsAdded", "inputs": [ { - "internalType": "address[]", "name": "bridgeOperators", - "type": "address[]" + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "", + "type": "uint96[]", + "internalType": "uint96[]" }, { - "internalType": "bool[]", "name": "addeds", - "type": "bool[]" + "type": "bool[]", + "internalType": "bool[]" } ], - "name": "onBridgeOperatorsAdded", "outputs": [ { - "internalType": "bytes4", "name": "", - "type": "bytes4" + "type": "bytes4", + "internalType": "bytes4" } ], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "onBridgeOperatorsRemoved", "inputs": [ { - "internalType": "address[]", "name": "", - "type": "address[]" + "type": "address[]", + "internalType": "address[]" }, { - "internalType": "bool[]", "name": "", - "type": "bool[]" + "type": "bool[]", + "internalType": "bool[]" } ], - "name": "onBridgeOperatorsRemoved", "outputs": [ { - "internalType": "bytes4", "name": "", - "type": "bytes4" + "type": "bytes4", + "internalType": "bytes4" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "setContract", "inputs": [ { - "internalType": "enum ContractType", "name": "contractType", - "type": "uint8" + "type": "uint8", + "internalType": "enum ContractType" }, { - "internalType": "address", "name": "addr", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "setContract", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "supportsInterface", "inputs": [ { - "internalType": "bytes4", "name": "interfaceId", - "type": "bytes4" + "type": "bytes4", + "internalType": "bytes4" } ], - "name": "supportsInterface", "outputs": [ { - "internalType": "bool", "name": "", - "type": "bool" + "type": "bool", + "internalType": "bool" } ], - "stateMutability": "pure", - "type": "function" - } - ], - "transactionHash": "0xf2b67dcef68fefa08a8d696089607fc96689bc9d7d7581b0b87ee22332bb6cec", - "receipt": { - "to": null, - "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", - "contractAddress": "0x7CA05B9246CC6e3053D37219C87653041F72565e", - "transactionIndex": 0, - "gasUsed": "1232191", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040080000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000", - "blockHash": "0x13f79dc6339d216cbfcaf0737bb016f1941f9a6759d1c0e4928e0f725e301737", - "transactionHash": "0xf2b67dcef68fefa08a8d696089607fc96689bc9d7d7581b0b87ee22332bb6cec", - "logs": [ - { - "transactionIndex": 0, - "blockNumber": 19042846, - "transactionHash": "0xf2b67dcef68fefa08a8d696089607fc96689bc9d7d7581b0b87ee22332bb6cec", - "address": "0x7CA05B9246CC6e3053D37219C87653041F72565e", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", - "logIndex": 0, - "blockHash": "0x13f79dc6339d216cbfcaf0737bb016f1941f9a6759d1c0e4928e0f725e301737" - } - ], - "blockNumber": 19042846, - "cumulativeGasUsed": "1232191", - "status": 1, - "byzantium": true - }, - "args": [], - "numDeployments": 1, - "solcInputHash": "04a9bbd243a024f931581fbb384106a3", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"ErrContractTypeNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrLengthMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum RoleAccess\",\"name\":\"expectedRole\",\"type\":\"uint8\"}],\"name\":\"ErrUnauthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum ContractType\",\"name\":\"expectedContractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"actual\",\"type\":\"address\"}],\"name\":\"ErrUnexpectedInternalCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrZeroCodeContract\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"BridgeTrackingIncorrectlyResponded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ContractUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"period\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"bridgeOperator\",\"type\":\"address\"}],\"name\":\"RemovalRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum IBridgeSlashEvents.Tier\",\"name\":\"tier\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"bridgeOperator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"period\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"slashUntilPeriod\",\"type\":\"uint256\"}],\"name\":\"Slashed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MINIMUM_VOTE_THRESHOLD\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REMOVE_DURATION_THRESHOLD\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"TIER_1_PENALTY_DURATION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"TIER_2_PENALTY_DURATION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"allBridgeOperators\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ballots\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"totalBallot\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalVote\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"period\",\"type\":\"uint256\"}],\"name\":\"execSlashBridgeOperators\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"slashed\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"getAddedPeriodOf\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"addedPeriods\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"getContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"contract_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPenaltyDurations\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"penaltyDurations\",\"type\":\"uint256[]\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"ballot\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalVote\",\"type\":\"uint256\"}],\"name\":\"getSlashTier\",\"outputs\":[{\"internalType\":\"enum IBridgeSlashEvents.Tier\",\"name\":\"tier\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"getSlashUntilPeriodOf\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"untilPeriods\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"validatorContract\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"bridgeManagerContract\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"bridgeTrackingContract\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"currentBridgeOperator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"newBridgeOperator\",\"type\":\"address\"}],\"name\":\"onBridgeOperatorUpdated\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"},{\"internalType\":\"bool[]\",\"name\":\"addeds\",\"type\":\"bool[]\"}],\"name\":\"onBridgeOperatorsAdded\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"},{\"internalType\":\"bool[]\",\"name\":\"\",\"type\":\"bool[]\"}],\"name\":\"onBridgeOperatorsRemoved\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"A contract that implements slashing functionality for bridge operators based on their availability.\",\"errors\":{\"ErrContractTypeNotFound(uint8)\":[{\"details\":\"Error of invalid role.\"}],\"ErrLengthMismatch(bytes4)\":[{\"details\":\"Error indicating a mismatch in the length of input parameters or arrays for a specific function.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that has a length mismatch.\"}}],\"ErrUnauthorized(bytes4,uint8)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"expectedRole\":\"The role required to perform the function.\",\"msgSig\":\"The function signature (bytes4) that the caller is unauthorized to perform.\"}}],\"ErrUnexpectedInternalCall(bytes4,uint8,address)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"actual\":\"The actual address that called to the function.\",\"expectedContractType\":\"The contract type required to perform the function.\",\"msgSig\":\"The function signature (bytes4).\"}}],\"ErrZeroCodeContract(address)\":[{\"details\":\"Error of set to non-contract.\"}]},\"kind\":\"dev\",\"methods\":{\"execSlashBridgeOperators(address[],uint256[],uint256,uint256,uint256)\":{\"details\":\"Slashes the unavailability of bridge operators during a specific period.\",\"params\":{\"period\":\"The period to slash the bridge operators for.\"}},\"getAddedPeriodOf(address[])\":{\"details\":\"Retrieves the added periods of the specified bridge operators.\",\"params\":{\"bridgeOperators\":\"An array of bridge operator addresses.\"},\"returns\":{\"addedPeriods\":\"An array of uint256 values representing the added periods for each bridge operator.\"}},\"getContract(uint8)\":{\"details\":\"Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.\",\"params\":{\"contractType\":\"The role of the contract to retrieve.\"},\"returns\":{\"contract_\":\"The address of the contract with the specified role.\"}},\"getPenaltyDurations()\":{\"details\":\"Retrieve the penalty durations for different slash tiers.\",\"returns\":{\"penaltyDurations\":\"The array of penalty durations for each slash tier.\"}},\"getSlashTier(uint256,uint256)\":{\"details\":\"Gets the slash tier based on the given ballot and total ballots.\",\"params\":{\"ballot\":\"The ballot count for a bridge operator.\",\"totalVote\":\"The total vote count for the period.\"},\"returns\":{\"tier\":\"The slash tier.\"}},\"getSlashUntilPeriodOf(address[])\":{\"details\":\"Returns the penalize durations for the specified bridge operators.\",\"params\":{\"bridgeOperators\":\"The addresses of the bridge operators.\"},\"returns\":{\"untilPeriods\":\"The penalized periods for the bridge operators.\"}},\"onBridgeOperatorUpdated(address,address)\":{\"details\":\"Handles the event when a bridge operator is updated.\",\"params\":{\"currentBridgeOperator\":\"The address of the current bridge operator.\",\"newbridgeOperator\":\"The new address of the bridge operator.\"},\"returns\":{\"_0\":\"The selector of the function being called.\"}},\"onBridgeOperatorsAdded(address[],bool[])\":{\"details\":\"Handles the event when bridge operators are added.\",\"params\":{\"addeds\":\"The corresponding boolean values indicating whether the operators were added or not.\",\"bridgeOperators\":\"The addresses of the bridge operators.\"},\"returns\":{\"_0\":\"The selector of the function being called.\"}},\"onBridgeOperatorsRemoved(address[],bool[])\":{\"details\":\"Handles the event when bridge operators are removed.\",\"params\":{\"bridgeOperators\":\"The addresses of the bridge operators.\",\"removeds\":\"The corresponding boolean values indicating whether the operators were removed or not.\"},\"returns\":{\"_0\":\"The selector of the function being called.\"}},\"setContract(uint8,address)\":{\"details\":\"Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.\",\"params\":{\"addr\":\"The address of the contract to set.\",\"contractType\":\"The role of the contract to set.\"}},\"supportsInterface(bytes4)\":{\"details\":\"Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.\"}},\"stateVariables\":{\"BRIDGE_SLASH_INFOS_SLOT\":{\"details\":\"value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeSlash.bridgeSlashInfos.slot\\\") - 1\"},\"MINIMUM_VOTE_THRESHOLD\":{\"details\":\"External function to retrieve the value of the minimum vote threshold to execute slashing rule.\",\"return\":\"minimumVoteThreshold The minimum vote threshold value.\",\"returns\":{\"_0\":\"minimumVoteThreshold The minimum vote threshold value.\"}},\"PERCENTAGE_FRACTION\":{\"details\":\"Max percentage 100%. Values [0; 100_00] reflexes [0; 100%]\"},\"REMOVE_DURATION_THRESHOLD\":{\"details\":\"Returns the threshold duration for removing bridge operators.\",\"return\":\"The duration in period number that exceeds which a bridge operator will be removed.\",\"returns\":{\"_0\":\"The duration in period number that exceeds which a bridge operator will be removed.\"}},\"SLASH_PERMANENT_DURATION\":{\"details\":\"This value is set to the maximum value of uint128 to indicate a permanent slash duration.\"},\"TIER_1_PENALTY_DURATION\":{\"details\":\"Returns the penalty duration for Tier 1 slashing.\",\"return\":\"The duration in period number for Tier 1 slashing.\",\"returns\":{\"_0\":\"The duration in period number for Tier 1 slashing.\"}},\"TIER_1_THRESHOLD\":{\"details\":\"Tier 1 slashing threshold ratio is 10%\"},\"TIER_2_PENALTY_DURATION\":{\"details\":\"Returns the penalty duration for Tier 2 slashing.\",\"return\":\"The duration in period number for Tier 2 slashing.\",\"returns\":{\"_0\":\"The duration in period number for Tier 2 slashing.\"}},\"TIER_2_THRESHOLD\":{\"details\":\"Tier 2 slashing threshold ratio is 30%\"}},\"title\":\"BridgeSlash\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/ronin/gateway/BridgeSlash.sol\":\"BridgeSlash\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"none\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2a21b14ff90012878752f230d3ffd5c3405e5938d06c97a7d89c0a64561d0d66\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"contracts/extensions/bridge-operator-governance/BridgeTrackingHelper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nabstract contract BridgeTrackingHelper {\\n /// @dev Event emited when the bridge tracking contract tracks the invalid data, cause malform in sharing bridge reward.\\n event BridgeTrackingIncorrectlyResponded();\\n\\n /**\\n * @dev Internal function to validate the bridge tracking response for a given set of ballots.\\n * @param totalBallot The total number of ballots available for the tracking response.\\n * @param totalVote The total number of votes recorded in the tracking response.\\n * @param ballots An array containing the individual ballot counts in the tracking response.\\n * @return valid A boolean indicating whether the bridge tracking response is valid or not.\\n * @notice The function checks if each individual ballot count is not greater than the total votes recorded.\\n * @notice It also verifies that the sum of all individual ballot counts does not exceed the total available ballots.\\n */\\n function _isValidBridgeTrackingResponse(\\n uint256 totalBallot,\\n uint256 totalVote,\\n uint256[] memory ballots\\n ) internal pure returns (bool valid) {\\n valid = true;\\n uint256 sumBallot;\\n uint256 length = ballots.length;\\n\\n unchecked {\\n for (uint256 i; i < length; ++i) {\\n if (ballots[i] > totalVote) {\\n valid = false;\\n break;\\n }\\n\\n sumBallot += ballots[i];\\n }\\n }\\n\\n valid = valid && (sumBallot <= totalBallot);\\n }\\n}\\n\",\"keccak256\":\"0x2da3d7c4b8d48228761b48c79beb04a55065d24a3469a16043b00c45873844e5\",\"license\":\"MIT\"},\"contracts/extensions/collections/HasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { HasProxyAdmin } from \\\"./HasProxyAdmin.sol\\\";\\nimport \\\"../../interfaces/collections/IHasContracts.sol\\\";\\nimport { IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\nimport { ErrUnexpectedInternalCall } from \\\"../../utils/CommonErrors.sol\\\";\\n\\n/**\\n * @title HasContracts\\n * @dev A contract that provides functionality to manage multiple contracts with different roles.\\n */\\nabstract contract HasContracts is HasProxyAdmin, IHasContracts, IdentityGuard {\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.collections.HasContracts.slot\\\") - 1\\n bytes32 private constant _STORAGE_SLOT = 0xdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb;\\n\\n /**\\n * @dev Modifier to restrict access to functions only to contracts with a specific role.\\n * @param contractType The contract type that allowed to call\\n */\\n modifier onlyContract(ContractType contractType) virtual {\\n _requireContract(contractType);\\n _;\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function setContract(ContractType contractType, address addr) external virtual onlyAdmin {\\n _requireHasCode(addr);\\n _setContract(contractType, addr);\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function getContract(ContractType contractType) public view returns (address contract_) {\\n contract_ = _getContractMap()[uint8(contractType)];\\n if (contract_ == address(0)) revert ErrContractTypeNotFound(contractType);\\n }\\n\\n /**\\n * @dev Internal function to set the address of a contract with a specific role.\\n * @param contractType The contract type of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function _setContract(ContractType contractType, address addr) internal virtual {\\n _getContractMap()[uint8(contractType)] = addr;\\n emit ContractUpdated(contractType, addr);\\n }\\n\\n /**\\n * @dev Internal function to access the mapping of contract addresses with roles.\\n * @return contracts_ The mapping of contract addresses with roles.\\n */\\n function _getContractMap() private pure returns (mapping(uint8 => address) storage contracts_) {\\n assembly {\\n contracts_.slot := _STORAGE_SLOT\\n }\\n }\\n\\n /**\\n * @dev Internal function to check if the calling contract has a specific role.\\n * @param contractType The contract type that the calling contract must have.\\n * @dev Throws an error if the calling contract does not have the specified role.\\n */\\n function _requireContract(ContractType contractType) private view {\\n if (msg.sender != getContract(contractType)) {\\n revert ErrUnexpectedInternalCall(msg.sig, contractType, msg.sender);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9e1dceb68827adfb8c8184662f29ab5fe14e292a632878150e3b0b6c61bc1dce\",\"license\":\"MIT\"},\"contracts/extensions/collections/HasProxyAdmin.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/StorageSlot.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\n\\nabstract contract HasProxyAdmin {\\n // bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n modifier onlyAdmin() {\\n _requireAdmin();\\n _;\\n }\\n\\n /**\\n * @dev Returns proxy admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n function _requireAdmin() internal view {\\n if (msg.sender != _getAdmin()) revert ErrUnauthorized(msg.sig, RoleAccess.ADMIN);\\n }\\n}\\n\",\"keccak256\":\"0x06e5962713a77abf6d5ba646e1cc1cfb6f9c50e7d52520dd82a10bf309534187\",\"license\":\"MIT\"},\"contracts/interfaces/bridge/IBridgeManagerCallback.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @title IBridgeManagerCallback\\n * @dev Interface for the callback functions to be implemented by the Bridge Manager contract.\\n */\\ninterface IBridgeManagerCallback is IERC165 {\\n /**\\n * @dev Handles the event when bridge operators are added.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @param addeds The corresponding boolean values indicating whether the operators were added or not.\\n * @return selector The selector of the function being called.\\n */\\n function onBridgeOperatorsAdded(\\n address[] memory bridgeOperators,\\n bool[] memory addeds\\n ) external returns (bytes4 selector);\\n\\n /**\\n * @dev Handles the event when bridge operators are removed.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @param removeds The corresponding boolean values indicating whether the operators were removed or not.\\n * @return selector The selector of the function being called.\\n */\\n function onBridgeOperatorsRemoved(\\n address[] memory bridgeOperators,\\n bool[] memory removeds\\n ) external returns (bytes4 selector);\\n\\n /**\\n * @dev Handles the event when a bridge operator is updated.\\n * @param currentBridgeOperator The address of the current bridge operator.\\n * @param newbridgeOperator The new address of the bridge operator.\\n * @return selector The selector of the function being called.\\n */\\n function onBridgeOperatorUpdated(\\n address currentBridgeOperator,\\n address newbridgeOperator\\n ) external returns (bytes4 selector);\\n}\\n\",\"keccak256\":\"0xfd6868a1041577a463b6c96713edcb18063dc817154d09710abfd5783e4629ee\",\"license\":\"MIT\"},\"contracts/interfaces/bridge/IBridgeSlash.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IBridgeSlashEvents } from \\\"./events/IBridgeSlashEvents.sol\\\";\\n\\n/**\\n * @title IBridgeSlash\\n * @dev Interface for the BridgeSlash contract to manage slashing functionality for bridge operators.\\n */\\ninterface IBridgeSlash is IBridgeSlashEvents {\\n /**\\n * @dev Slashes the unavailability of bridge operators during a specific period.\\n * @param period The period to slash the bridge operators for.\\n */\\n function execSlashBridgeOperators(\\n address[] calldata operators,\\n uint256[] calldata ballots,\\n uint256 totalBallot,\\n uint256 totalVote,\\n uint256 period\\n ) external returns (bool slashed);\\n\\n /**\\n * @dev Returns the penalize durations for the specified bridge operators.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @return untilPeriods The penalized periods for the bridge operators.\\n */\\n function getSlashUntilPeriodOf(address[] calldata bridgeOperators) external returns (uint256[] memory untilPeriods);\\n\\n /**\\n * @dev Retrieves the added periods of the specified bridge operators.\\n * @param bridgeOperators An array of bridge operator addresses.\\n * @return addedPeriods An array of uint256 values representing the added periods for each bridge operator.\\n */\\n function getAddedPeriodOf(address[] calldata bridgeOperators) external view returns (uint256[] memory addedPeriods);\\n\\n /**\\n * @dev Gets the slash tier based on the given ballot and total ballots.\\n * @param ballot The ballot count for a bridge operator.\\n * @param totalVote The total vote count for the period.\\n * @return tier The slash tier.\\n */\\n function getSlashTier(uint256 ballot, uint256 totalVote) external pure returns (Tier tier);\\n\\n /**\\n * @dev Retrieve the penalty durations for different slash tiers.\\n * @return penaltyDurations The array of penalty durations for each slash tier.\\n */\\n function getPenaltyDurations() external pure returns (uint256[] memory penaltyDurations);\\n\\n /**\\n * @dev Returns the penalty duration for Tier 1 slashing.\\n * @return The duration in period number for Tier 1 slashing.\\n */\\n function TIER_1_PENALTY_DURATION() external view returns (uint256);\\n\\n /**\\n * @dev Returns the penalty duration for Tier 2 slashing.\\n * @return The duration in period number for Tier 2 slashing.\\n */\\n function TIER_2_PENALTY_DURATION() external view returns (uint256);\\n\\n /**\\n * @dev Returns the threshold duration for removing bridge operators.\\n * @return The duration in period number that exceeds which a bridge operator will be removed.\\n */\\n function REMOVE_DURATION_THRESHOLD() external view returns (uint256);\\n\\n /**\\n * @dev External function to retrieve the value of the minimum vote threshold to execute slashing rule.\\n * @return minimumVoteThreshold The minimum vote threshold value.\\n */\\n function MINIMUM_VOTE_THRESHOLD() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x45f7a50e6f2e25d9d1ac8abf0eafd1b7579d625245b9269840d42a476745e735\",\"license\":\"MIT\"},\"contracts/interfaces/bridge/IBridgeTracking.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeTracking {\\n struct Request {\\n VoteKind kind;\\n uint256 id;\\n }\\n\\n enum VoteKind {\\n Deposit,\\n Withdrawal,\\n MainchainWithdrawal\\n }\\n\\n event ExternalCallFailed(address indexed to, bytes4 indexed msgSig, bytes reason);\\n\\n /**\\n * @dev Returns the block that allow incomming mutable call.\\n */\\n function startedAtBlock() external view returns (uint256);\\n\\n /**\\n * @dev Returns the total number of votes at the specific period `_period`.\\n */\\n function totalVote(uint256 _period) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total number of ballots at the specific period `_period`.\\n */\\n function totalBallot(uint256 _period) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total number of ballots of bridge operators at the specific period `_period`.\\n */\\n function getManyTotalBallots(\\n uint256 _period,\\n address[] calldata _bridgeOperators\\n ) external view returns (uint256[] memory);\\n\\n /**\\n * @dev Returns the total number of ballots of a bridge operator at the specific period `_period`.\\n */\\n function totalBallotOf(uint256 _period, address _bridgeOperator) external view returns (uint256);\\n\\n /**\\n * @dev Handles the request once it is approved.\\n *\\n * Requirements:\\n * - The method caller is the bridge contract.\\n *\\n */\\n function handleVoteApproved(VoteKind _kind, uint256 _requestId) external;\\n\\n /**\\n * @dev Records vote for a receipt and a operator.\\n *\\n * Requirements:\\n * - The method caller is the bridge contract.\\n *\\n */\\n function recordVote(VoteKind _kind, uint256 _requestId, address _operator) external;\\n}\\n\",\"keccak256\":\"0x092841025351341cf7ff9cbf0eb6ef78752ffd2b1af329cb6048996d20c789a9\",\"license\":\"MIT\"},\"contracts/interfaces/bridge/events/IBridgeSlashEvents.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeSlashEvents {\\n /**\\n * @dev Enumeration representing the slashing tiers for bridge operators.\\n */\\n enum Tier {\\n Tier0,\\n Tier1,\\n Tier2\\n }\\n\\n /**\\n * @dev Struct representing the status of a bridge operator.\\n */\\n struct BridgeSlashInfo {\\n uint128 slashUntilPeriod;\\n uint128 newlyAddedAtPeriod;\\n }\\n\\n /**\\n * @dev Event emitted when a bridge operator is slashed.\\n * @param tier The slash tier of the operator.\\n * @param bridgeOperator The address of the slashed bridge operator.\\n * @param period The period in which the operator is slashed.\\n * @param slashUntilPeriod The period until which the operator is penalized.\\n */\\n event Slashed(Tier indexed tier, address indexed bridgeOperator, uint256 indexed period, uint256 slashUntilPeriod);\\n\\n /**\\n * @dev Emitted when a removal request is made for a bridge operator.\\n * @param period The period for which the removal request is made.\\n * @param bridgeOperator The address of the bridge operator being requested for removal.\\n */\\n event RemovalRequested(uint256 indexed period, address indexed bridgeOperator);\\n}\\n\",\"keccak256\":\"0x9611e0d8b85b50bdd8ba9e8148564af526e78ccce5d202e7c84043d2d2ccb75f\",\"license\":\"MIT\"},\"contracts/interfaces/collections/IHasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport { ContractType } from \\\"../../utils/ContractType.sol\\\";\\n\\ninterface IHasContracts {\\n /// @dev Error of invalid role.\\n error ErrContractTypeNotFound(ContractType contractType);\\n\\n /// @dev Emitted when a contract is updated.\\n event ContractUpdated(ContractType indexed contractType, address indexed addr);\\n\\n /**\\n * @dev Returns the address of a contract with a specific role.\\n * Throws an error if no contract is set for the specified role.\\n *\\n * @param contractType The role of the contract to retrieve.\\n * @return contract_ The address of the contract with the specified role.\\n */\\n function getContract(ContractType contractType) external view returns (address contract_);\\n\\n /**\\n * @dev Sets the address of a contract with a specific role.\\n * Emits the event {ContractUpdated}.\\n * @param contractType The role of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function setContract(ContractType contractType, address addr) external;\\n}\\n\",\"keccak256\":\"0x99d8213d857e30d367155abd15dc42730afdfbbac3a22dfb3b95ffea2083a92e\",\"license\":\"MIT\"},\"contracts/interfaces/validator/ICandidateManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface ICandidateManager {\\n struct ValidatorCandidate {\\n // Admin of the candidate\\n address admin;\\n // Address of the validator that produces block, e.g. block.coinbase. This is so-called validator address.\\n address consensusAddr;\\n // Address that receives mining reward of the validator\\n address payable treasuryAddr;\\n // Address of the bridge operator corresponding to the candidate\\n address ______deprecatedbridgeOperatorAddr;\\n // The percentage of reward that validators can be received, the rest goes to the delegators.\\n // Values in range [0; 100_00] stands for 0-100%\\n uint256 commissionRate;\\n // The timestamp that scheduled to revoke the candidate (no schedule=0)\\n uint256 revokingTimestamp;\\n // The deadline that the candidate must top up staking amount to keep it larger than or equal to the threshold (no deadline=0)\\n uint256 topupDeadline;\\n }\\n\\n struct CommissionSchedule {\\n // The timestamp that the commission schedule gets affected (no schedule=0).\\n uint256 effectiveTimestamp;\\n // The new commission rate. Value is in range [0; 100_00], stands for 0-100%\\n uint256 commissionRate;\\n }\\n\\n /// @dev Emitted when the maximum number of validator candidates is updated.\\n event MaxValidatorCandidateUpdated(uint256 threshold);\\n /// @dev Emitted when the min offset to the effective date of commission rate change is updated.\\n event MinEffectiveDaysOnwardsUpdated(uint256 numOfDays);\\n /// @dev Emitted when the validator candidate is granted.\\n event CandidateGranted(address indexed consensusAddr, address indexed treasuryAddr, address indexed admin);\\n /// @dev Emitted when the revoking timestamp of a candidate is updated.\\n event CandidateRevokingTimestampUpdated(address indexed consensusAddr, uint256 revokingTimestamp);\\n /// @dev Emitted when the topup deadline of a candidate is updated.\\n event CandidateTopupDeadlineUpdated(address indexed consensusAddr, uint256 topupDeadline);\\n /// @dev Emitted when the validator candidate is revoked.\\n event CandidatesRevoked(address[] consensusAddrs);\\n\\n /// @dev Emitted when a schedule for updating commission rate is set.\\n event CommissionRateUpdateScheduled(address indexed consensusAddr, uint256 effectiveTimestamp, uint256 rate);\\n /// @dev Emitted when the commission rate of a validator is updated.\\n event CommissionRateUpdated(address indexed consensusAddr, uint256 rate);\\n\\n /// @dev Error of exceeding maximum number of candidates.\\n error ErrExceedsMaxNumberOfCandidate();\\n /// @dev Error of querying for already existent candidate.\\n error ErrExistentCandidate();\\n /// @dev Error of querying for non-existent candidate.\\n error ErrNonExistentCandidate();\\n /// @dev Error of candidate admin already exists.\\n error ErrExistentCandidateAdmin(address _candidateAdminAddr);\\n /// @dev Error of treasury already exists.\\n error ErrExistentTreasury(address _treasuryAddr);\\n /// @dev Error of invalid commission rate.\\n error ErrInvalidCommissionRate();\\n /// @dev Error of invalid effective days onwards.\\n error ErrInvalidEffectiveDaysOnwards();\\n /// @dev Error of invalid min effective days onwards.\\n error ErrInvalidMinEffectiveDaysOnwards();\\n /// @dev Error of already requested revoking candidate before.\\n error ErrAlreadyRequestedRevokingCandidate();\\n /// @dev Error of commission change schedule exists.\\n error ErrAlreadyRequestedUpdatingCommissionRate();\\n /// @dev Error of trusted org cannot renounce.\\n error ErrTrustedOrgCannotRenounce();\\n\\n /**\\n * @dev Returns the maximum number of validator candidate.\\n */\\n function maxValidatorCandidate() external view returns (uint256);\\n\\n /**\\n * @dev Returns the minimum number of days to the effective date of commission rate change.\\n */\\n function minEffectiveDaysOnwards() external view returns (uint256);\\n\\n /**\\n * @dev Sets the maximum number of validator candidate.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `MaxValidatorCandidateUpdated` event.\\n *\\n */\\n function setMaxValidatorCandidate(uint256) external;\\n\\n /**\\n * @dev Sets the minimum number of days to the effective date of commision rate change.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `MinEffectiveDaysOnwardsUpdated` event.\\n *\\n */\\n function setMinEffectiveDaysOnwards(uint256 _numOfDays) external;\\n\\n /**\\n * @dev Grants a validator candidate.\\n *\\n * Requirements:\\n * - The method caller is staking contract.\\n *\\n * Emits the event `CandidateGranted`.\\n *\\n */\\n function execApplyValidatorCandidate(\\n address _admin,\\n address _consensusAddr,\\n address payable _treasuryAddr,\\n uint256 _commissionRate\\n ) external;\\n\\n /**\\n * @dev Requests to revoke a validator candidate in next `_secsLeft` seconds.\\n *\\n * Requirements:\\n * - The method caller is staking contract.\\n *\\n * Emits the event `CandidateRevokingTimestampUpdated`.\\n *\\n */\\n function execRequestRenounceCandidate(address, uint256 _secsLeft) external;\\n\\n /**\\n * @dev Fallback function of `CandidateStaking-requestUpdateCommissionRate`.\\n *\\n * Requirements:\\n * - The method caller is the staking contract.\\n * - The `_effectiveTimestamp` must be the beginning of a UTC day, and at least from 7 days onwards\\n * - The `_rate` must be in range of [0_00; 100_00].\\n *\\n * Emits the event `CommissionRateUpdateScheduled`.\\n *\\n */\\n function execRequestUpdateCommissionRate(address _consensusAddr, uint256 _effectiveTimestamp, uint256 _rate) external;\\n\\n /**\\n * @dev Returns whether the address is a validator (candidate).\\n */\\n function isValidatorCandidate(address _addr) external view returns (bool);\\n\\n /**\\n * @dev Returns the validator candidate.\\n */\\n function getValidatorCandidates() external view returns (address[] memory);\\n\\n /**\\n * @dev Returns all candidate info.\\n */\\n function getCandidateInfos() external view returns (ValidatorCandidate[] memory);\\n\\n /**\\n * @dev Returns the info of a candidate.\\n */\\n function getCandidateInfo(address _candidate) external view returns (ValidatorCandidate memory);\\n\\n /**\\n * @dev Returns whether the address is the candidate admin.\\n */\\n function isCandidateAdmin(address _candidate, address _admin) external view returns (bool);\\n\\n /**\\n * @dev Returns the schedule of changing commission rate of a candidate address.\\n */\\n function getCommissionChangeSchedule(address _candidate) external view returns (CommissionSchedule memory);\\n}\\n\",\"keccak256\":\"0x9ab205c736f1bcc9a3debe06e08d829f4857141d940e6f608236f136193a7f49\",\"license\":\"MIT\"},\"contracts/interfaces/validator/ICoinbaseExecution.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"./ISlashingExecution.sol\\\";\\n\\ninterface ICoinbaseExecution is ISlashingExecution {\\n enum BlockRewardDeprecatedType {\\n UNKNOWN,\\n UNAVAILABILITY,\\n AFTER_BAILOUT\\n }\\n\\n /// @dev Emitted when the validator set is updated\\n event ValidatorSetUpdated(uint256 indexed period, address[] consensusAddrs);\\n /// @dev Emitted when the bridge operator set is updated, to mirror the in-jail and maintaining status of the validator.\\n event BlockProducerSetUpdated(uint256 indexed period, uint256 indexed epoch, address[] consensusAddrs);\\n /// @dev Emitted when the bridge operator set is updated.\\n event BridgeOperatorSetUpdated(uint256 indexed period, uint256 indexed epoch, address[] bridgeOperators);\\n\\n /// @dev Emitted when the reward of the block producer is deprecated.\\n event BlockRewardDeprecated(\\n address indexed coinbaseAddr,\\n uint256 rewardAmount,\\n BlockRewardDeprecatedType deprecatedType\\n );\\n /// @dev Emitted when the block reward is submitted.\\n event BlockRewardSubmitted(address indexed coinbaseAddr, uint256 submittedAmount, uint256 bonusAmount);\\n\\n /// @dev Emitted when the block producer reward is distributed.\\n event MiningRewardDistributed(address indexed consensusAddr, address indexed recipient, uint256 amount);\\n /// @dev Emitted when the contract fails when distributing the block producer reward.\\n event MiningRewardDistributionFailed(\\n address indexed consensusAddr,\\n address indexed recipient,\\n uint256 amount,\\n uint256 contractBalance\\n );\\n\\n /// @dev Emitted when the bridge operator reward is distributed.\\n event BridgeOperatorRewardDistributed(\\n address indexed consensusAddr,\\n address indexed bridgeOperator,\\n address indexed recipientAddr,\\n uint256 amount\\n );\\n /// @dev Emitted when the contract fails when distributing the bridge operator reward.\\n event BridgeOperatorRewardDistributionFailed(\\n address indexed consensusAddr,\\n address indexed bridgeOperator,\\n address indexed recipient,\\n uint256 amount,\\n uint256 contractBalance\\n );\\n\\n /// @dev Emitted when the amount of RON reward is distributed to staking contract.\\n event StakingRewardDistributed(uint256 totalAmount, address[] consensusAddrs, uint256[] amounts);\\n /// @dev Emitted when the contracts fails when distributing the amount of RON to the staking contract.\\n event StakingRewardDistributionFailed(\\n uint256 totalAmount,\\n address[] consensusAddrs,\\n uint256[] amounts,\\n uint256 contractBalance\\n );\\n\\n /// @dev Emitted when the epoch is wrapped up.\\n event WrappedUpEpoch(uint256 indexed periodNumber, uint256 indexed epochNumber, bool periodEnding);\\n\\n /// @dev Error of method caller must be coinbase\\n error ErrCallerMustBeCoinbase();\\n /// @dev Error of only allowed at the end of epoch\\n error ErrAtEndOfEpochOnly();\\n /// @dev Error of query for already wrapped up epoch\\n error ErrAlreadyWrappedEpoch();\\n\\n /**\\n * @dev Submits reward of the current block.\\n *\\n * Requirements:\\n * - The method caller is coinbase.\\n *\\n * Emits the event `MiningRewardDeprecated` if the coinbase is slashed or no longer be a block producer.\\n * Emits the event `BlockRewardSubmitted` for the valid call.\\n *\\n */\\n function submitBlockReward() external payable;\\n\\n /**\\n * @dev Wraps up the current epoch.\\n *\\n * Requirements:\\n * - The method must be called when the current epoch is ending.\\n * - The epoch is not wrapped yet.\\n * - The method caller is coinbase.\\n *\\n * Emits the event `MiningRewardDistributed` when some validator has reward distributed.\\n * Emits the event `StakingRewardDistributed` when some staking pool has reward distributed.\\n * Emits the event `BlockProducerSetUpdated` when the epoch is wrapped up.\\n * Emits the event `BridgeOperatorSetUpdated` when the epoch is wrapped up at period ending.\\n * Emits the event `ValidatorSetUpdated` when the epoch is wrapped up at period ending, and the validator set gets updated.\\n * Emits the event `WrappedUpEpoch`.\\n *\\n */\\n function wrapUpEpoch() external payable;\\n}\\n\",\"keccak256\":\"0xe4060b7e3b04a0043bd334011fe4ba67c990b0484dad52d7f14b35040989b6ab\",\"license\":\"MIT\"},\"contracts/interfaces/validator/IEmergencyExit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface IEmergencyExit {\\n /// @dev Emitted when the fund is locked from an emergency exit request\\n event EmergencyExitRequested(address indexed consensusAddr, uint256 lockedAmount);\\n /// @dev Emitted when the fund that locked from an emergency exit request is transferred to the recipient.\\n event EmergencyExitLockedFundReleased(\\n address indexed consensusAddr,\\n address indexed recipient,\\n uint256 unlockedAmount\\n );\\n /// @dev Emitted when the fund that locked from an emergency exit request is failed to transferred back.\\n event EmergencyExitLockedFundReleasingFailed(\\n address indexed consensusAddr,\\n address indexed recipient,\\n uint256 unlockedAmount,\\n uint256 contractBalance\\n );\\n\\n /// @dev Emitted when the emergency exit locked amount is updated.\\n event EmergencyExitLockedAmountUpdated(uint256 amount);\\n /// @dev Emitted when the emergency expiry duration is updated.\\n event EmergencyExpiryDurationUpdated(uint256 amount);\\n\\n /// @dev Error of already requested emergency exit before.\\n error ErrAlreadyRequestedEmergencyExit();\\n\\n /**\\n * @dev Returns the amount of RON to lock from a consensus address.\\n */\\n function emergencyExitLockedAmount() external returns (uint256);\\n\\n /**\\n * @dev Returns the duration that an emergency request is expired and the fund will be recycled.\\n */\\n function emergencyExpiryDuration() external returns (uint256);\\n\\n /**\\n * @dev Sets the amount of RON to lock from a consensus address.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the event `EmergencyExitLockedAmountUpdated`.\\n *\\n */\\n function setEmergencyExitLockedAmount(uint256 _emergencyExitLockedAmount) external;\\n\\n /**\\n * @dev Sets the duration that an emergency request is expired and the fund will be recycled.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the event `EmergencyExpiryDurationUpdated`.\\n *\\n */\\n function setEmergencyExpiryDuration(uint256 _emergencyExpiryDuration) external;\\n\\n /**\\n * @dev Unlocks fund for emergency exit request.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the event `EmergencyExitLockedFundReleased` if the fund is successfully unlocked.\\n * Emits the event `EmergencyExitLockedFundReleasingFailed` if the fund is failed to unlock.\\n *\\n */\\n function execReleaseLockedFundForEmergencyExitRequest(address _consensusAddr, address payable _recipient) external;\\n\\n /**\\n * @dev Fallback function of `IStaking-requestEmergencyExit`.\\n *\\n * Requirements:\\n * - The method caller is staking contract.\\n *\\n */\\n function execEmergencyExit(address _consensusAddr, uint256 _secLeftToRevoke) external;\\n}\\n\",\"keccak256\":\"0x45161abd1e3db83052a06889a0e3a7a5e7ee3306478601d58ac4ed32ccaa75ad\",\"license\":\"MIT\"},\"contracts/interfaces/validator/IRoninValidatorSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"./ICandidateManager.sol\\\";\\nimport \\\"./info-fragments/ICommonInfo.sol\\\";\\nimport \\\"./ICoinbaseExecution.sol\\\";\\nimport \\\"./ISlashingExecution.sol\\\";\\nimport \\\"./IEmergencyExit.sol\\\";\\n\\ninterface IRoninValidatorSet is\\n ICandidateManager,\\n ICommonInfo,\\n ISlashingExecution,\\n ICoinbaseExecution,\\n IEmergencyExit\\n{}\\n\",\"keccak256\":\"0x813f34747aea4dfb53bbc147abf8dbe5999ce73111c2db99bcb3efb4cf75bb3d\",\"license\":\"MIT\"},\"contracts/interfaces/validator/ISlashingExecution.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface ISlashingExecution {\\n /// @dev Emitted when the validator is punished.\\n event ValidatorPunished(\\n address indexed consensusAddr,\\n uint256 indexed period,\\n uint256 jailedUntil,\\n uint256 deductedStakingAmount,\\n bool blockProducerRewardDeprecated,\\n bool bridgeOperatorRewardDeprecated\\n );\\n /// @dev Emitted when the validator get out of jail by bailout.\\n event ValidatorUnjailed(address indexed validator, uint256 period);\\n\\n /// @dev Error of cannot bailout due to high tier slash.\\n error ErrCannotBailout(address validator);\\n\\n /**\\n * @dev Finalize the slash request from slash indicator contract.\\n *\\n * Requirements:\\n * - The method caller is slash indicator contract.\\n *\\n * Emits the event `ValidatorPunished`.\\n *\\n */\\n function execSlash(\\n address _validatorAddr,\\n uint256 _newJailedUntil,\\n uint256 _slashAmount,\\n bool _cannotBailout\\n ) external;\\n\\n /**\\n * @dev Finalize the bailout request from slash indicator contract.\\n *\\n * Requirements:\\n * - The method caller is slash indicator contract.\\n *\\n * Emits the event `ValidatorUnjailed`.\\n *\\n */\\n function execBailOut(address _validatorAddr, uint256 _period) external;\\n}\\n\",\"keccak256\":\"0x80362c42fdc0ee06543a2abbffee961fe51c15a7c5e18933a9c34897e50d07fe\",\"license\":\"MIT\"},\"contracts/interfaces/validator/info-fragments/ICommonInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"./IJailingInfo.sol\\\";\\nimport \\\"./ITimingInfo.sol\\\";\\nimport \\\"./IValidatorInfoV2.sol\\\";\\n\\ninterface ICommonInfo is ITimingInfo, IJailingInfo, IValidatorInfoV2 {\\n struct EmergencyExitInfo {\\n uint256 lockedAmount;\\n // The timestamp that this locked amount will be recycled to staking vesting contract\\n uint256 recyclingAt;\\n }\\n\\n /// @dev Emitted when the deprecated reward is withdrawn.\\n event DeprecatedRewardRecycled(address indexed recipientAddr, uint256 amount);\\n /// @dev Emitted when the deprecated reward withdrawal is failed\\n event DeprecatedRewardRecycleFailed(address indexed recipientAddr, uint256 amount, uint256 balance);\\n\\n /// @dev Error thrown when receives RON from neither staking vesting contract nor staking contract\\n error ErrUnauthorizedReceiveRON();\\n /// @dev Error thrown when queries for a non existent info.\\n error NonExistentRecyclingInfo();\\n\\n /**\\n * @dev Returns the total deprecated reward, which includes reward that is not sent for slashed validators and unsastified bridge operators\\n */\\n function totalDeprecatedReward() external view returns (uint256);\\n\\n /**\\n * @dev Returns the emergency exit request.\\n */\\n function getEmergencyExitInfo(address _consensusAddr) external view returns (EmergencyExitInfo memory);\\n}\\n\",\"keccak256\":\"0x3fdfa86da33b889e5153075ffc028d6b0c607480a96b532fbbbc48ac7bbf27c9\",\"license\":\"MIT\"},\"contracts/interfaces/validator/info-fragments/IJailingInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface IJailingInfo {\\n /**\\n * @dev Returns whether the validator are put in jail (cannot join the set of validators) during the current period.\\n */\\n function checkJailed(address) external view returns (bool);\\n\\n /**\\n * @dev Returns whether the validator are put in jail and the number of block and epoch that he still is in the jail.\\n */\\n function getJailedTimeLeft(\\n address _addr\\n ) external view returns (bool isJailed_, uint256 blockLeft_, uint256 epochLeft_);\\n\\n /**\\n * @dev Returns whether the validator are put in jail (cannot join the set of validators) at a specific block.\\n */\\n function checkJailedAtBlock(address _addr, uint256 _blockNum) external view returns (bool);\\n\\n /**\\n * @dev Returns whether the validator are put in jail at a specific block and the number of block and epoch that he still is in the jail.\\n */\\n function getJailedTimeLeftAtBlock(\\n address _addr,\\n uint256 _blockNum\\n ) external view returns (bool isJailed_, uint256 blockLeft_, uint256 epochLeft_);\\n\\n /**\\n * @dev Returns whether the validators are put in jail (cannot join the set of validators) during the current period.\\n */\\n function checkManyJailed(address[] calldata) external view returns (bool[] memory);\\n\\n /**\\n * @dev Returns whether the incoming reward of the block producer is deprecated during the current period.\\n */\\n function checkMiningRewardDeprecated(address _blockProducer) external view returns (bool);\\n\\n /**\\n * @dev Returns whether the incoming reward of the block producer is deprecated during a specific period.\\n */\\n function checkMiningRewardDeprecatedAtPeriod(address _blockProducer, uint256 _period) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2b1846b05ca1d636299fb929c1bd7b392b236f5e3f7aa3e7eea2c6d57b8836fb\",\"license\":\"MIT\"},\"contracts/interfaces/validator/info-fragments/ITimingInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface ITimingInfo {\\n /**\\n * @dev Returns the block that validator set was updated.\\n */\\n function getLastUpdatedBlock() external view returns (uint256);\\n\\n /**\\n * @dev Returns the number of blocks in a epoch.\\n */\\n function numberOfBlocksInEpoch() external view returns (uint256 _numberOfBlocks);\\n\\n /**\\n * @dev Returns the epoch index from the block number.\\n */\\n function epochOf(uint256 _block) external view returns (uint256);\\n\\n /**\\n * @dev Returns whether the epoch ending is at the block number `_block`.\\n */\\n function epochEndingAt(uint256 _block) external view returns (bool);\\n\\n /**\\n * @dev Tries to get the period index from the epoch number.\\n */\\n function tryGetPeriodOfEpoch(uint256 _epoch) external view returns (bool _filled, uint256 _periodNumber);\\n\\n /**\\n * @dev Returns whether the period ending at the current block number.\\n */\\n function isPeriodEnding() external view returns (bool);\\n\\n /**\\n * @dev Returns the period index from the current block.\\n */\\n function currentPeriod() external view returns (uint256);\\n\\n /**\\n * @dev Returns the block number that the current period starts at.\\n */\\n function currentPeriodStartAtBlock() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x77b86a68149389fed0eb0c5b8d56f278d3bd103ba64f504697d709b24c3212d5\",\"license\":\"MIT\"},\"contracts/interfaces/validator/info-fragments/IValidatorInfoV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../../../libraries/EnumFlags.sol\\\";\\n\\ninterface IValidatorInfoV2 {\\n /**\\n * @dev Error thrown when an invalid maximum prioritized validator number is provided.\\n */\\n error ErrInvalidMaxPrioritizedValidatorNumber();\\n\\n /// @dev Emitted when the number of max validator is updated.\\n event MaxValidatorNumberUpdated(uint256);\\n /// @dev Emitted when the number of reserved slots for prioritized validators is updated.\\n event MaxPrioritizedValidatorNumberUpdated(uint256);\\n\\n /**\\n * @dev Returns the maximum number of validators in the epoch.\\n */\\n function maxValidatorNumber() external view returns (uint256 _maximumValidatorNumber);\\n\\n /**\\n * @dev Returns the number of reserved slots for prioritized validators.\\n */\\n function maxPrioritizedValidatorNumber() external view returns (uint256 _maximumPrioritizedValidatorNumber);\\n\\n /**\\n * @dev Returns the current validator list.\\n */\\n function getValidators() external view returns (address[] memory _validatorList);\\n\\n /**\\n * @dev Returns the current block producer list.\\n */\\n function getBlockProducers() external view returns (address[] memory);\\n\\n /**\\n * @dev Returns whether the address is block producer or not.\\n */\\n function isBlockProducer(address _addr) external view returns (bool);\\n\\n /**\\n * @dev Returns total numbers of the block producers.\\n */\\n function totalBlockProducers() external view returns (uint256);\\n\\n /**\\n * @dev Updates the max validator number\\n *\\n * Requirements:\\n * - The method caller is admin\\n *\\n * Emits the event `MaxValidatorNumberUpdated`\\n *\\n */\\n function setMaxValidatorNumber(uint256 _maxValidatorNumber) external;\\n\\n /**\\n * @dev Updates the number of reserved slots for prioritized validators\\n *\\n * Requirements:\\n * - The method caller is admin\\n *\\n * Emits the event `MaxPrioritizedValidatorNumberUpdated`\\n *\\n */\\n function setMaxPrioritizedValidatorNumber(uint256 _maxPrioritizedValidatorNumber) external;\\n}\\n\",\"keccak256\":\"0x6213c188a1323b242a098394b91caf9481e257bd57a0804cb2aa890377a993ed\",\"license\":\"MIT\"},\"contracts/libraries/AddressArrayUtils.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\nlibrary AddressArrayUtils {\\n /**\\n * @dev Error thrown when a duplicated element is detected in an array.\\n * @param msgSig The function signature that invoke the error.\\n */\\n error ErrDuplicated(bytes4 msgSig);\\n\\n /**\\n * @dev Returns whether or not there's a duplicate. Runs in O(n^2).\\n * @param A Array to search\\n * @return Returns true if duplicate, false otherwise\\n */\\n function hasDuplicate(address[] memory A) internal pure returns (bool) {\\n if (A.length == 0) {\\n return false;\\n }\\n unchecked {\\n for (uint256 i = 0; i < A.length - 1; i++) {\\n for (uint256 j = i + 1; j < A.length; j++) {\\n if (A[i] == A[j]) {\\n return true;\\n }\\n }\\n }\\n }\\n return false;\\n }\\n\\n /**\\n * @dev Returns whether two arrays of addresses are equal or not.\\n */\\n function isEqual(address[] memory _this, address[] memory _other) internal pure returns (bool yes_) {\\n // Hashing two arrays and compare their hash\\n assembly {\\n let _thisHash := keccak256(add(_this, 32), mul(mload(_this), 32))\\n let _otherHash := keccak256(add(_other, 32), mul(mload(_other), 32))\\n yes_ := eq(_thisHash, _otherHash)\\n }\\n }\\n\\n /**\\n * @dev Return the concatenated array from a and b.\\n */\\n function extend(address[] memory a, address[] memory b) internal pure returns (address[] memory c) {\\n uint256 lengthA = a.length;\\n uint256 lengthB = b.length;\\n unchecked {\\n c = new address[](lengthA + lengthB);\\n }\\n uint256 i;\\n for (; i < lengthA; ) {\\n c[i] = a[i];\\n unchecked {\\n ++i;\\n }\\n }\\n for (uint256 j; j < lengthB; ) {\\n c[i] = b[j];\\n unchecked {\\n ++i;\\n ++j;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xaf760162653a85d6e1b24df4d33c74076f778470112f421a02050fb981242001\",\"license\":\"UNLICENSED\"},\"contracts/libraries/EnumFlags.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This library implements checking flag of an enumerated value.\\n * The originated idea is inherited from [Enum.HashFlag(Enum)](https://learn.microsoft.com/en-us/dotnet/api/system.enum.hasflag?view=net-6.0) method of C#.\\n */\\nlibrary EnumFlags {\\n enum ValidatorFlag {\\n None, // bit(00)\\n BlockProducer, // bit(01)\\n DeprecatedBridgeOperator, // bit(10)\\n Both // bit(11)\\n }\\n\\n function isNone(ValidatorFlag _value) internal pure returns (bool) {\\n return uint8(_value) == 0;\\n }\\n\\n /**\\n * @dev Checks if `_value` has `_flag`.\\n */\\n function hasFlag(ValidatorFlag _value, ValidatorFlag _flag) internal pure returns (bool) {\\n return (uint8(_value) & uint8(_flag)) != 0;\\n }\\n\\n /**\\n * @dev Calculate new value of `_value` after adding `_flag`.\\n */\\n function addFlag(ValidatorFlag _value, ValidatorFlag _flag) internal pure returns (ValidatorFlag) {\\n return ValidatorFlag(uint8(_value) | uint8(_flag));\\n }\\n\\n /**\\n * @dev Calculate new value of `_value` after remove `_flag`.\\n */\\n function removeFlag(ValidatorFlag _value, ValidatorFlag _flag) internal pure returns (ValidatorFlag) {\\n return ValidatorFlag(uint8(_value) & ~uint8(_flag));\\n }\\n}\\n\",\"keccak256\":\"0xa712f0d1a323ee39f23eb3ee3278b4ec25fe2e536b1ccc629578c66f277c088d\",\"license\":\"UNLICENSED\"},\"contracts/libraries/Math.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\nlibrary Math {\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a >= b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns whether the number `c` is in range of [a; b].\\n */\\n function inRange(uint256 c, uint256 a, uint256 b) internal pure returns (bool) {\\n return a <= c && c <= b;\\n }\\n\\n /**\\n * @dev Returns whether two inclusive ranges [x1;x2] and [y1;y2] overlap.\\n */\\n function twoRangeOverlap(uint256 x1, uint256 x2, uint256 y1, uint256 y2) internal pure returns (bool) {\\n return x1 <= y2 && y1 <= x2;\\n }\\n\\n /**\\n * @dev Returns value of a + b; in case result is larger than upperbound, upperbound is returned.\\n */\\n function addWithUpperbound(uint256 a, uint256 b, uint256 upperbound) internal pure returns (uint256) {\\n return min(a + b, upperbound);\\n }\\n\\n /**\\n * @dev Returns value of a - b; in case of negative result, 0 is returned.\\n */\\n function subNonNegative(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a - b : 0;\\n }\\n\\n /**\\n * @dev Returns value of `a + zeroable` if zerobale is not 0; otherwise, return 0.\\n */\\n function addIfNonZero(uint256 a, uint256 zeroable) internal pure returns (uint256) {\\n return zeroable != 0 ? a + zeroable : 0;\\n }\\n}\\n\",\"keccak256\":\"0xd73170f448c644a47024c7dbcf4afc3cc7ad27f61737c6ea4c3b543ec5cdb7e9\",\"license\":\"UNLICENSED\"},\"contracts/ronin/gateway/BridgeSlash.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.17;\\n\\nimport { Initializable } from \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport { BridgeTrackingHelper } from \\\"../../extensions/bridge-operator-governance/BridgeTrackingHelper.sol\\\";\\nimport { IHasContracts, HasContracts } from \\\"../../extensions/collections/HasContracts.sol\\\";\\nimport { IBridgeSlash } from \\\"../../interfaces/bridge/IBridgeSlash.sol\\\";\\nimport { IERC165, IBridgeManagerCallback } from \\\"../../interfaces/bridge/IBridgeManagerCallback.sol\\\";\\nimport { IBridgeTracking } from \\\"../../interfaces/bridge/IBridgeTracking.sol\\\";\\nimport { IRoninValidatorSet } from \\\"../../interfaces/validator/IRoninValidatorSet.sol\\\";\\nimport { Math } from \\\"../../libraries/Math.sol\\\";\\nimport { ContractType } from \\\"../../utils/ContractType.sol\\\";\\nimport { IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\nimport { ErrLengthMismatch } from \\\"../../utils/CommonErrors.sol\\\";\\n\\n/**\\n * @title BridgeSlash\\n * @dev A contract that implements slashing functionality for bridge operators based on their availability.\\n */\\ncontract BridgeSlash is\\n IBridgeSlash,\\n IBridgeManagerCallback,\\n BridgeTrackingHelper,\\n IdentityGuard,\\n Initializable,\\n HasContracts\\n{\\n /// @inheritdoc IBridgeSlash\\n uint256 public constant TIER_1_PENALTY_DURATION = 1;\\n /// @inheritdoc IBridgeSlash\\n uint256 public constant TIER_2_PENALTY_DURATION = 5;\\n /// @inheritdoc IBridgeSlash\\n uint256 public constant MINIMUM_VOTE_THRESHOLD = 50;\\n /// @inheritdoc IBridgeSlash\\n uint256 public constant REMOVE_DURATION_THRESHOLD = 30;\\n\\n /// @dev Tier 1 slashing threshold ratio is 10%\\n uint256 private constant TIER_1_THRESHOLD = 10_00;\\n /// @dev Tier 2 slashing threshold ratio is 30%\\n uint256 private constant TIER_2_THRESHOLD = 30_00;\\n /// @dev Max percentage 100%. Values [0; 100_00] reflexes [0; 100%]\\n uint256 private constant PERCENTAGE_FRACTION = 100_00;\\n /// @dev This value is set to the maximum value of uint128 to indicate a permanent slash duration.\\n uint256 private constant SLASH_PERMANENT_DURATION = type(uint128).max;\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeSlash.bridgeSlashInfos.slot\\\") - 1\\n bytes32 private constant BRIDGE_SLASH_INFOS_SLOT = 0xd08d185790a07c7b9b721e2713c8580010a57f31c72c16f6e80b831d0ee45bfe;\\n\\n /**\\n * @dev The modifier verifies if the `totalVote` is non-zero, indicating the presence of ballots for the period.\\n * @param totalVote The total number of ballots for the period.\\n */\\n modifier onlyPeriodHasEnoughVotes(uint256 totalVote) {\\n if (totalVote <= MINIMUM_VOTE_THRESHOLD) return;\\n _;\\n }\\n\\n constructor() payable {\\n _disableInitializers();\\n }\\n\\n function initialize(\\n address validatorContract,\\n address bridgeManagerContract,\\n address bridgeTrackingContract\\n ) external initializer {\\n _setContract(ContractType.VALIDATOR, validatorContract);\\n _setContract(ContractType.BRIDGE_MANAGER, bridgeManagerContract);\\n _setContract(ContractType.BRIDGE_TRACKING, bridgeTrackingContract);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallback\\n */\\n function onBridgeOperatorsAdded(\\n address[] calldata bridgeOperators,\\n bool[] memory addeds\\n ) external onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) {\\n uint256 length = bridgeOperators.length;\\n if (length != addeds.length) revert ErrLengthMismatch(msg.sig);\\n if (length == 0) {\\n return IBridgeManagerCallback.onBridgeOperatorsAdded.selector;\\n }\\n\\n mapping(address => BridgeSlashInfo) storage _bridgeSlashInfos = _getBridgeSlashInfos();\\n uint256 currentPeriod = IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod();\\n\\n for (uint256 i; i < length; ) {\\n unchecked {\\n if (addeds[i]) {\\n _bridgeSlashInfos[bridgeOperators[i]].newlyAddedAtPeriod = uint128(currentPeriod);\\n }\\n\\n ++i;\\n }\\n }\\n\\n return IBridgeManagerCallback.onBridgeOperatorsAdded.selector;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallback\\n */\\n function onBridgeOperatorUpdated(\\n address currentBridgeOperator,\\n address newBridgeOperator\\n ) external onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) {\\n mapping(address => BridgeSlashInfo) storage _bridgeSlashInfos = _getBridgeSlashInfos();\\n\\n _bridgeSlashInfos[newBridgeOperator] = _bridgeSlashInfos[currentBridgeOperator];\\n delete _bridgeSlashInfos[currentBridgeOperator];\\n\\n return IBridgeManagerCallback.onBridgeOperatorUpdated.selector;\\n }\\n\\n /**\\n * @inheritdoc IBridgeSlash\\n */\\n function execSlashBridgeOperators(\\n address[] memory allBridgeOperators,\\n uint256[] memory ballots,\\n uint256 totalBallot,\\n uint256 totalVote,\\n uint256 period\\n ) external onlyContract(ContractType.BRIDGE_TRACKING) onlyPeriodHasEnoughVotes(totalVote) returns (bool slashed) {\\n uint256 length = allBridgeOperators.length;\\n if (length != ballots.length) revert ErrLengthMismatch(msg.sig);\\n if (length == 0) return false;\\n if (!_isValidBridgeTrackingResponse(totalBallot, totalVote, ballots)) {\\n emit BridgeTrackingIncorrectlyResponded();\\n return false;\\n }\\n\\n // Get penalty durations for each slash tier.\\n uint256[] memory penaltyDurations = _getPenaltyDurations();\\n // Get the storage mapping for bridge slash information.\\n mapping(address => BridgeSlashInfo) storage _bridgeSlashInfos = _getBridgeSlashInfos();\\n\\n // Declare variables for iteration.\\n BridgeSlashInfo memory status;\\n uint256 slashUntilPeriod;\\n address bridgeOperator;\\n Tier tier;\\n\\n for (uint256 i; i < length; ) {\\n bridgeOperator = allBridgeOperators[i];\\n status = _bridgeSlashInfos[bridgeOperator];\\n\\n // Check if the bridge operator was added before the current period.\\n // Bridge operators added in current period will not be slashed.\\n if (status.newlyAddedAtPeriod < period) {\\n // Determine the slash tier for the bridge operator based on their ballots.\\n tier = _getSlashTier(ballots[i], totalVote);\\n\\n slashUntilPeriod = _calcSlashUntilPeriod(tier, period, status.slashUntilPeriod, penaltyDurations);\\n\\n // Check if the slash duration exceeds the threshold for removal.\\n if (_isSlashDurationMetRemovalThreshold(slashUntilPeriod, period)) {\\n slashUntilPeriod = SLASH_PERMANENT_DURATION;\\n emit RemovalRequested(period, bridgeOperator);\\n }\\n\\n // Emit the Slashed event if the tier is not Tier 0 and bridge operator will not be removed.\\n // Update the slash until period number for the bridge operator if the tier is not Tier 0.\\n if (tier != Tier.Tier0) {\\n slashed = true;\\n\\n if (slashUntilPeriod != SLASH_PERMANENT_DURATION) {\\n emit Slashed(tier, bridgeOperator, period, slashUntilPeriod);\\n }\\n\\n // Store updated slash until period\\n _bridgeSlashInfos[bridgeOperator].slashUntilPeriod = uint128(slashUntilPeriod);\\n }\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallback\\n */\\n function onBridgeOperatorsRemoved(\\n address[] calldata,\\n bool[] calldata\\n ) external view onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) {\\n return IBridgeManagerCallback.onBridgeOperatorsAdded.selector;\\n }\\n\\n /**\\n * @inheritdoc IERC165\\n */\\n function supportsInterface(bytes4 interfaceId) external pure returns (bool) {\\n return interfaceId == type(IBridgeManagerCallback).interfaceId || interfaceId == type(IERC165).interfaceId;\\n }\\n\\n /**\\n * @inheritdoc IBridgeSlash\\n */\\n function getSlashUntilPeriodOf(\\n address[] calldata bridgeOperators\\n ) external view returns (uint256[] memory untilPeriods) {\\n uint256 length = bridgeOperators.length;\\n untilPeriods = new uint256[](length);\\n mapping(address => BridgeSlashInfo) storage _bridgeSlashInfos = _getBridgeSlashInfos();\\n\\n for (uint256 i; i < length; ) {\\n untilPeriods[i] = _bridgeSlashInfos[bridgeOperators[i]].slashUntilPeriod;\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeSlash\\n */\\n function getAddedPeriodOf(address[] calldata bridgeOperators) external view returns (uint256[] memory addedPeriods) {\\n uint256 length = bridgeOperators.length;\\n addedPeriods = new uint256[](length);\\n mapping(address => BridgeSlashInfo) storage _bridgeSlashInfos = _getBridgeSlashInfos();\\n\\n for (uint256 i; i < length; ) {\\n addedPeriods[i] = _bridgeSlashInfos[bridgeOperators[i]].newlyAddedAtPeriod;\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeSlash\\n */\\n function getPenaltyDurations() external pure returns (uint256[] memory penaltyDurations) {\\n penaltyDurations = _getPenaltyDurations();\\n }\\n\\n /**\\n * @inheritdoc IBridgeSlash\\n */\\n function getSlashTier(uint256 ballot, uint256 totalVote) external pure returns (Tier tier) {\\n tier = _getSlashTier(ballot, totalVote);\\n }\\n\\n /**\\n * @dev Checks if the slash duration exceeds the threshold for removal and handles it accordingly.\\n * @param slashUntilPeriod The slash until period number.\\n * @param period The current period.\\n * @return met A boolean indicates that the threshold for removal is met.\\n */\\n function _isSlashDurationMetRemovalThreshold(\\n uint256 slashUntilPeriod,\\n uint256 period\\n ) internal pure returns (bool met) {\\n met = slashUntilPeriod - (period - 1) >= REMOVE_DURATION_THRESHOLD;\\n }\\n\\n /**\\n * @dev Calculates the slash until period based on the specified tier, current period, and slash until period.\\n * @param tier The slash tier representing the severity of the slash.\\n * @param period The current period in which the calculation is performed.\\n * @param slashUntilPeriod The existing slash until period.\\n * @param penaltyDurations An array of penalty durations for each slash tier.\\n * @return newSlashUntilPeriod The newly calculated slash until period.\\n */\\n function _calcSlashUntilPeriod(\\n Tier tier,\\n uint256 period,\\n uint256 slashUntilPeriod,\\n uint256[] memory penaltyDurations\\n ) internal pure returns (uint256 newSlashUntilPeriod) {\\n // Calculate the slash until period number.\\n newSlashUntilPeriod = penaltyDurations[uint8(tier)] + Math.max(period - 1, slashUntilPeriod);\\n }\\n\\n /**\\n * @dev Internal function to determine the slashing tier based on the given ballot count and total votes.\\n * @param ballot The individual ballot count of a bridge operator.\\n * @param totalVote The total number of votes recorded for the bridge operator.\\n * @return tier The calculated slashing tier for the bridge operator.\\n * @notice The `ratio` is calculated as the percentage of uncast votes (totalVote - ballot) relative to the total votes.\\n */\\n function _getSlashTier(uint256 ballot, uint256 totalVote) internal pure virtual returns (Tier tier) {\\n uint256 ratio = ((totalVote - ballot) * PERCENTAGE_FRACTION) / totalVote;\\n tier = ratio > TIER_2_THRESHOLD ? Tier.Tier2 : ratio > TIER_1_THRESHOLD ? Tier.Tier1 : Tier.Tier0;\\n }\\n\\n /**\\n * @dev Internal function to access the mapping from bridge operator => BridgeSlashInfo.\\n * @return bridgeSlashInfos the mapping from bridge operator => BridgeSlashInfo.\\n */\\n function _getBridgeSlashInfos() internal pure returns (mapping(address => BridgeSlashInfo) storage bridgeSlashInfos) {\\n assembly (\\\"memory-safe\\\") {\\n bridgeSlashInfos.slot := BRIDGE_SLASH_INFOS_SLOT\\n }\\n }\\n\\n /**\\n * @dev Internal function to retrieve the penalty durations for each slashing tier.\\n * @return penaltyDurations An array containing the penalty durations for Tier0, Tier1, and Tier2 in that order.\\n */\\n function _getPenaltyDurations() internal pure virtual returns (uint256[] memory penaltyDurations) {\\n // reserve index 0\\n penaltyDurations = new uint256[](3);\\n penaltyDurations[uint8(Tier.Tier1)] = TIER_1_PENALTY_DURATION;\\n penaltyDurations[uint8(Tier.Tier2)] = TIER_2_PENALTY_DURATION;\\n }\\n}\\n\",\"keccak256\":\"0x27b4863ec0d3398afa83dd8228acd5579f04061234e1a2e869950cb0ae2e9820\",\"license\":\"MIT\"},\"contracts/utils/CommonErrors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ContractType } from \\\"./ContractType.sol\\\";\\nimport { RoleAccess } from \\\"./RoleAccess.sol\\\";\\n\\n/**\\n * @dev Error thrown when an address is expected to be an already created externally owned account (EOA).\\n * This error indicates that the provided address is invalid for certain contract operations that require already created EOA.\\n */\\nerror ErrAddressIsNotCreatedEOA(address addr, bytes32 codehash);\\n/**\\n * @dev Error raised when a bridge operator update operation fails.\\n * @param bridgeOperator The address of the bridge operator that failed to update.\\n */\\nerror ErrBridgeOperatorUpdateFailed(address bridgeOperator);\\n/**\\n * @dev Error thrown when attempting to add a bridge operator that already exists in the contract.\\n * This error indicates that the provided bridge operator address is already registered as a bridge operator in the contract.\\n */\\nerror ErrBridgeOperatorAlreadyExisted(address bridgeOperator);\\n/**\\n * @dev The error indicating an unsupported interface.\\n * @param interfaceId The bytes4 interface identifier that is not supported.\\n * @param addr The address where the unsupported interface was encountered.\\n */\\nerror ErrUnsupportedInterface(bytes4 interfaceId, address addr);\\n/**\\n * @dev Error thrown when the return data from a callback function is invalid.\\n * @param callbackFnSig The signature of the callback function that returned invalid data.\\n * @param register The address of the register where the callback function was invoked.\\n * @param returnData The invalid return data received from the callback function.\\n */\\nerror ErrInvalidReturnData(bytes4 callbackFnSig, address register, bytes returnData);\\n/**\\n * @dev Error of set to non-contract.\\n */\\nerror ErrZeroCodeContract(address addr);\\n/**\\n * @dev Error indicating that arguments are invalid.\\n */\\nerror ErrInvalidArguments(bytes4 msgSig);\\n/**\\n * @dev Error indicating that given address is null when it should not.\\n */\\nerror ErrZeroAddress(bytes4 msgSig);\\n/**\\n * @dev Error indicating that the provided threshold is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that the invalid threshold applies to.\\n */\\nerror ErrInvalidThreshold(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a function can only be called by the contract itself.\\n * @param msgSig The function signature (bytes4) that can only be called by the contract itself.\\n */\\nerror ErrOnlySelfCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n * @param expectedRole The role required to perform the function.\\n */\\nerror ErrUnauthorized(bytes4 msgSig, RoleAccess expectedRole);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n */\\nerror ErrUnauthorizedCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4).\\n * @param expectedContractType The contract type required to perform the function.\\n * @param actual The actual address that called to the function.\\n */\\nerror ErrUnexpectedInternalCall(bytes4 msgSig, ContractType expectedContractType, address actual);\\n\\n/**\\n * @dev Error indicating that an array is empty when it should contain elements.\\n */\\nerror ErrEmptyArray();\\n\\n/**\\n * @dev Error indicating a mismatch in the length of input parameters or arrays for a specific function.\\n * @param msgSig The function signature (bytes4) that has a length mismatch.\\n */\\nerror ErrLengthMismatch(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a proxy call to an external contract has failed.\\n * @param msgSig The function signature (bytes4) of the proxy call that failed.\\n * @param extCallSig The function signature (bytes4) of the external contract call that failed.\\n */\\nerror ErrProxyCallFailed(bytes4 msgSig, bytes4 extCallSig);\\n\\n/**\\n * @dev Error indicating that a function tried to call a precompiled contract that is not allowed.\\n * @param msgSig The function signature (bytes4) that attempted to call a precompiled contract.\\n */\\nerror ErrCallPrecompiled(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a native token transfer has failed.\\n * @param msgSig The function signature (bytes4) of the token transfer that failed.\\n */\\nerror ErrNativeTransferFailed(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that an order is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid order.\\n */\\nerror ErrInvalidOrder(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the chain ID is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid chain ID.\\n * @param actual Current chain ID that executing function.\\n * @param expected Expected chain ID required for the tx to success.\\n */\\nerror ErrInvalidChainId(bytes4 msgSig, uint256 actual, uint256 expected);\\n\\n/**\\n * @dev Error indicating that a vote type is not supported.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an unsupported vote type.\\n */\\nerror ErrUnsupportedVoteType(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the proposal nonce is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid proposal nonce.\\n */\\nerror ErrInvalidProposalNonce(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a voter has already voted.\\n * @param voter The address of the voter who has already voted.\\n */\\nerror ErrAlreadyVoted(address voter);\\n\\n/**\\n * @dev Error indicating that a signature is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid signature.\\n */\\nerror ErrInvalidSignatures(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a relay call has failed.\\n * @param msgSig The function signature (bytes4) of the relay call that failed.\\n */\\nerror ErrRelayFailed(bytes4 msgSig);\\n/**\\n * @dev Error indicating that a vote weight is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid vote weight.\\n */\\nerror ErrInvalidVoteWeight(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a query was made for an outdated bridge operator set.\\n */\\nerror ErrQueryForOutdatedBridgeOperatorSet();\\n\\n/**\\n * @dev Error indicating that a request is invalid.\\n */\\nerror ErrInvalidRequest();\\n\\n/**\\n * @dev Error indicating that a token standard is invalid.\\n */\\nerror ErrInvalidTokenStandard();\\n\\n/**\\n * @dev Error indicating that a token is not supported.\\n */\\nerror ErrUnsupportedToken();\\n\\n/**\\n * @dev Error indicating that a receipt kind is invalid.\\n */\\nerror ErrInvalidReceiptKind();\\n\\n/**\\n * @dev Error indicating that a receipt is invalid.\\n */\\nerror ErrInvalidReceipt();\\n\\n/**\\n * @dev Error indicating that an address is not payable.\\n */\\nerror ErrNonpayableAddress(address);\\n\\n/**\\n * @dev Error indicating that the period is already processed, i.e. scattered reward.\\n */\\nerror ErrPeriodAlreadyProcessed(uint256 requestingPeriod, uint256 latestPeriod);\\n\\n/**\\n * @dev Error thrown when an invalid vote hash is provided.\\n */\\nerror ErrInvalidVoteHash();\\n\\n/**\\n * @dev Error thrown when querying for an empty vote.\\n */\\nerror ErrQueryForEmptyVote();\\n\\n/**\\n * @dev Error thrown when querying for an expired vote.\\n */\\nerror ErrQueryForExpiredVote();\\n\\n/**\\n * @dev Error thrown when querying for a non-existent vote.\\n */\\nerror ErrQueryForNonExistentVote();\\n\",\"keccak256\":\"0x951a466bb76f385554960531e63e64a5bd314df341bb6c95e6e81448d6984ac0\",\"license\":\"MIT\"},\"contracts/utils/ContractType.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum ContractType {\\n /* 0 */ UNKNOWN,\\n /* 1 */ PAUSE_ENFORCER,\\n /* 2 */ BRIDGE,\\n /* 3 */ BRIDGE_TRACKING,\\n /* 4 */ GOVERNANCE_ADMIN,\\n /* 5 */ MAINTENANCE,\\n /* 6 */ SLASH_INDICATOR,\\n /* 7 */ STAKING_VESTING,\\n /* 8 */ VALIDATOR,\\n /* 9 */ STAKING,\\n /* 10 */ RONIN_TRUSTED_ORGANIZATION,\\n /* 11 */ BRIDGE_MANAGER,\\n /* 12 */ BRIDGE_SLASH,\\n /* 13 */ BRIDGE_REWARD\\n}\\n\",\"keccak256\":\"0xf72feff9afafcb5cadc1b05c6e0b998ea5d66c7ece57c3e482e560d0a1bb4079\",\"license\":\"MIT\"},\"contracts/utils/IdentityGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { AddressArrayUtils } from \\\"../libraries/AddressArrayUtils.sol\\\";\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport { ErrAddressIsNotCreatedEOA, ErrZeroAddress, ErrOnlySelfCall, ErrZeroCodeContract, ErrUnsupportedInterface } from \\\"./CommonErrors.sol\\\";\\n\\nabstract contract IdentityGuard {\\n using AddressArrayUtils for address[];\\n\\n /// @dev value is equal to keccak256(abi.encode())\\n /// @dev see: https://eips.ethereum.org/EIPS/eip-1052\\n bytes32 internal constant CREATED_ACCOUNT_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\\n\\n /**\\n * @dev Modifier to restrict functions to only be called by this contract.\\n * @dev Reverts if the caller is not this contract.\\n */\\n modifier onlySelfCall() virtual {\\n _requireSelfCall();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to ensure that the elements in the `arr` array are non-duplicates.\\n * It calls the internal `_checkDuplicate` function to perform the duplicate check.\\n *\\n * Requirements:\\n * - The elements in the `arr` array must not contain any duplicates.\\n */\\n modifier nonDuplicate(address[] memory arr) virtual {\\n _requireNonDuplicate(arr);\\n _;\\n }\\n\\n /**\\n * @dev Internal method to check the method caller.\\n * @dev Reverts if the method caller is not this contract.\\n */\\n function _requireSelfCall() internal view virtual {\\n if (msg.sender != address(this)) revert ErrOnlySelfCall(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to check if a contract address has code.\\n * @param addr The address of the contract to check.\\n * @dev Throws an error if the contract address has no code.\\n */\\n function _requireHasCode(address addr) internal view {\\n if (addr.code.length == 0) revert ErrZeroCodeContract(addr);\\n }\\n\\n /**\\n * @dev Checks if an address is zero and reverts if it is.\\n * @param addr The address to check.\\n */\\n function _requireNonZeroAddress(address addr) internal pure {\\n if (addr == address(0)) revert ErrZeroAddress(msg.sig);\\n }\\n\\n /**\\n * @dev Check if arr is empty and revert if it is.\\n * Checks if an array contains any duplicate addresses and reverts if duplicates are found.\\n * @param arr The array of addresses to check.\\n */\\n function _requireNonDuplicate(address[] memory arr) internal pure {\\n if (arr.hasDuplicate()) revert AddressArrayUtils.ErrDuplicated(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to require that the provided address is a created externally owned account (EOA).\\n * This internal function is used to ensure that the provided address is a valid externally owned account (EOA).\\n * It checks the codehash of the address against a predefined constant to confirm that the address is a created EOA.\\n * @notice This method only works with non-state EOA accounts\\n */\\n function _requireCreatedEOA(address addr) internal view {\\n _requireNonZeroAddress(addr);\\n bytes32 codehash = addr.codehash;\\n if (codehash != CREATED_ACCOUNT_HASH) revert ErrAddressIsNotCreatedEOA(addr, codehash);\\n }\\n\\n /**\\n * @dev Internal function to require that the specified contract supports the given interface.\\n * @param contractAddr The address of the contract to check for interface support.\\n * @param interfaceId The interface ID to check for support.\\n * @notice If the contract does not support the interface `interfaceId` or EIP165, a revert with the corresponding error message is triggered.\\n */\\n function _requireSupportsInterface(address contractAddr, bytes4 interfaceId) internal view {\\n if (!IERC165(contractAddr).supportsInterface(interfaceId)) {\\n revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2e1aef91018590d52fa9ca9e63708c8ef3e9ee7061e8947d4bb30b07d721a229\",\"license\":\"MIT\"},\"contracts/utils/RoleAccess.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum RoleAccess {\\n /* 0 */ UNKNOWN,\\n /* 1 */ ADMIN,\\n /* 2 */ COINBASE,\\n /* 3 */ GOVERNOR,\\n /* 4 */ CANDIDATE_ADMIN,\\n /* 5 */ WITHDRAWAL_MIGRATOR,\\n /* 6 */ __DEPRECATED_BRIDGE_OPERATOR,\\n /* 7 */ BLOCK_PRODUCER,\\n /* 8 */ VALIDATOR_CANDIDATE\\n}\\n\",\"keccak256\":\"0xa98cec38c640c4e37f475debbcd366226f1188c3f5ea6e29de768bd33e021873\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405261000c610011565b6100d1565b600054610100900460ff161561007d5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156100cf576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6114d9806100e06000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c8063c0c53b8b11610097578063ddc3f7f611610066578063ddc3f7f614610213578063de981f1b1461021b578063f9f6087314610246578063fbb2f1941461024e57600080fd5b8063c0c53b8b146101d2578063c48549de146101e5578063c9631a12146101f8578063d1e1f2f81461020b57600080fd5b80635ebae8a0116100d35780635ebae8a0146101735780636dda44081461019f578063865e6fd3146101b55780639c2f4459146101ca57600080fd5b806301ffc9a7146101055780631288810a1461012d5780634dca59251461014d5780635311153b14610160575b600080fd5b610118610113366004610e59565b61026e565b60405190151581526020015b60405180910390f35b61014061013b366004610ecf565b6102a5565b6040516101249190610f11565b61011861015b366004611042565b61038d565b61014061016e366004610ecf565b61062d565b61018661018136600461111d565b610706565b6040516001600160e01b03199091168152602001610124565b6101a7600181565b604051908152602001610124565b6101c86101c33660046111fb565b610883565b005b6101a7603281565b6101c86101e036600461122e565b6108a2565b6101866101f3366004611271565b6109cf565b6101866102063660046112dd565b6109ee565b6101a7600581565b6101a7601e81565b61022e6102293660046112f9565b610a6d565b6040516001600160a01b039091168152602001610124565b610140610ae8565b61026161025c366004611314565b610af7565b604051610124919061134c565b60006001600160e01b031982166314d72edb60e21b148061029f57506001600160e01b031982166301ffc9a760e01b145b92915050565b6060818067ffffffffffffffff8111156102c1576102c1610f55565b6040519080825280602002602001820160405280156102ea578160200160208202803683370190505b5091506000805160206114ad83398151915260005b828110156103845781600087878481811061031c5761031c611366565b9050602002016020810190610331919061137c565b6001600160a01b031681526020810191909152604001600020548451600160801b9091046001600160801b03169085908390811061037157610371611366565b60209081029190910101526001016102ff565b50505092915050565b6000600361039a81610b0a565b836032811115610622578751875181146103da576040516306b5667560e21b81526001600160e01b03196000351660048201526024015b60405180910390fd5b806000036103ec576000935050610622565b6103f787878a610b59565b61042e576040517f64ba7143ea5a17abea37667aa9ae137e3afba5033c5f504770c02829c128189c90600090a16000935050610622565b6000610438610bd6565b604080518082019091526000808252602082018190529192506000805160206114ad833981519152918080805b87811015610619578f818151811061047f5761047f611366565b6020908102919091018101516001600160a01b03811660009081528883526040908190208151808301909252546001600160801b038082168352600160801b90910416928101839052965093508c1115610611576104f68f82815181106104e8576104e8611366565b60200260200101518e610c41565b9150610511828d87600001516001600160801b03168a610c93565b935061051d848d610cea565b15610563576040516001600160801b0394506001600160a01b038416908d907fb32a150b9737190a456d8b2b81dd7d592a799ab2933ea494e44351acd41f835d90600090a35b600082600281111561057757610577611336565b146106115760019a506001600160801b0384146105df578b836001600160a01b03168360028111156105ab576105ab611336565b6040518781527f14441e950b7f9ed959e16b2405dd1a9d163efd5d85027b222dcf78b902a00d759060200160405180910390a45b6001600160a01b038316600090815260208790526040902080546001600160801b0319166001600160801b0386161790555b600101610465565b50505050505050505b505095945050505050565b6060818067ffffffffffffffff81111561064957610649610f55565b604051908082528060200260200182016040528015610672578160200160208202803683370190505b5091506000805160206114ad83398151915260005b82811015610384578160008787848181106106a4576106a4611366565b90506020020160208101906106b9919061137c565b6001600160a01b0316815260208101919091526040016000205484516001600160801b03909116908590839081106106f3576106f3611366565b6020908102919091010152600101610687565b6000600b61071381610b0a565b825184908114610744576040516306b5667560e21b81526001600160e01b03196000351660048201526024016103d1565b8060000361075c57506302f5d74560e51b915061087b565b6000805160206114ad83398151915260006107776008610a6d565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d89190611397565b905060005b8381101561086c578681815181106107f7576107f7611366565b60200260200101511561086457818360008b8b8581811061081a5761081a611366565b905060200201602081019061082f919061137c565b6001600160a01b03168152602081019190915260400160002080546001600160801b03928316600160801b0292169190911790555b6001016107dd565b506302f5d74560e51b94505050505b509392505050565b61088b610d0c565b61089481610d68565b61089e8282610d9e565b5050565b600054610100900460ff16158080156108c25750600054600160ff909116105b806108dc5750303b1580156108dc575060005460ff166001145b61093f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103d1565b6000805460ff191660011790558015610962576000805461ff0019166101001790555b61096d600885610d9e565b610978600b84610d9e565b610983600383610d9e565b80156109c9576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b6000600b6109dc81610b0a565b506302f5d74560e51b95945050505050565b6000600b6109fb81610b0a565b50506001600160a01b0391821660008181526000805160206114ad8339815191526020526040808220939094168152928320825481546001600160801b0319166001600160801b0391821690811783558454600160801b908190049092169091021790558252556364b18d0960e11b90565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600d811115610aa457610aa4611336565b60ff1681526020810191909152604001600020546001600160a01b0316905080610ae3578160405163409140df60e11b81526004016103d191906113c4565b919050565b6060610af2610bd6565b905090565b6000610b038383610c41565b9392505050565b610b1381610a6d565b6001600160a01b0316336001600160a01b031614610b56576000356001600160e01b03191681336040516320e0f98d60e21b81526004016103d1939291906113d2565b50565b8051600190600090815b81811015610bbe5785858281518110610b7e57610b7e611366565b60200260200101511115610b955760009350610bbe565b848181518110610ba757610ba7611366565b602002602001015183019250806001019050610b63565b50828015610bcc5750858211155b9695505050505050565b604080516003808252608082019092526060916020820183803683370190505090506001818160ff1681518110610c0f57610c0f611366565b6020908102919091010152600581600260ff1681518110610c3257610c32611366565b60200260200101818152505090565b60008082612710610c52868361141f565b610c5c9190611432565b610c669190611449565b9050610bb88111610c88576103e88111610c81576000610c8b565b6001610c8b565b60025b949350505050565b6000610ca9610ca360018661141f565b84610e42565b82866002811115610cbc57610cbc611336565b60ff1681518110610ccf57610ccf611366565b6020026020010151610ce1919061146b565b95945050505050565b6000601e610cf960018461141f565b610d03908561141f565b10159392505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610d66576000356001600160e01b0319166001604051620f948f60ea1b81526004016103d192919061147e565b565b806001600160a01b03163b600003610b5657604051630bfc64a360e21b81526001600160a01b03821660048201526024016103d1565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600d811115610dd457610dd4611336565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600d811115610e1557610e15611336565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b600081831015610e525781610b03565b5090919050565b600060208284031215610e6b57600080fd5b81356001600160e01b031981168114610b0357600080fd5b60008083601f840112610e9557600080fd5b50813567ffffffffffffffff811115610ead57600080fd5b6020830191508360208260051b8501011115610ec857600080fd5b9250929050565b60008060208385031215610ee257600080fd5b823567ffffffffffffffff811115610ef957600080fd5b610f0585828601610e83565b90969095509350505050565b6020808252825182820181905260009190848201906040850190845b81811015610f4957835183529284019291840191600101610f2d565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610f9457610f94610f55565b604052919050565b600067ffffffffffffffff821115610fb657610fb6610f55565b5060051b60200190565b80356001600160a01b0381168114610ae357600080fd5b600082601f830112610fe857600080fd5b81356020610ffd610ff883610f9c565b610f6b565b82815260059290921b8401810191818101908684111561101c57600080fd5b8286015b848110156110375780358352918301918301611020565b509695505050505050565b600080600080600060a0868803121561105a57600080fd5b853567ffffffffffffffff8082111561107257600080fd5b818801915088601f83011261108657600080fd5b81356020611096610ff883610f9c565b82815260059290921b8401810191818101908c8411156110b557600080fd5b948201945b838610156110da576110cb86610fc0565b825294820194908201906110ba565b995050890135925050808211156110f057600080fd5b506110fd88828901610fd7565b959895975050505060408401359360608101359360809091013592509050565b60008060006040848603121561113257600080fd5b833567ffffffffffffffff8082111561114a57600080fd5b61115687838801610e83565b909550935060209150858201358181111561117057600080fd5b86019050601f8101871361118357600080fd5b8035611191610ff882610f9c565b81815260059190911b820183019083810190898311156111b057600080fd5b928401925b828410156111dd57833580151581146111ce5760008081fd5b825292840192908401906111b5565b80955050505050509250925092565b8035600e8110610ae357600080fd5b6000806040838503121561120e57600080fd5b611217836111ec565b915061122560208401610fc0565b90509250929050565b60008060006060848603121561124357600080fd5b61124c84610fc0565b925061125a60208501610fc0565b915061126860408501610fc0565b90509250925092565b6000806000806040858703121561128757600080fd5b843567ffffffffffffffff8082111561129f57600080fd5b6112ab88838901610e83565b909650945060208701359150808211156112c457600080fd5b506112d187828801610e83565b95989497509550505050565b600080604083850312156112f057600080fd5b61121783610fc0565b60006020828403121561130b57600080fd5b610b03826111ec565b6000806040838503121561132757600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b602081016003831061136057611360611336565b91905290565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561138e57600080fd5b610b0382610fc0565b6000602082840312156113a957600080fd5b5051919050565b600e81106113c0576113c0611336565b9052565b6020810161029f82846113b0565b6001600160e01b031984168152606081016113f060208301856113b0565b6001600160a01b03929092166040919091015292915050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561029f5761029f611409565b808202811582820484141761029f5761029f611409565b60008261146657634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561029f5761029f611409565b6001600160e01b031983168152604081016009831061149f5761149f611336565b826020830152939250505056fed08d185790a07c7b9b721e2713c8580010a57f31c72c16f6e80b831d0ee45bfea164736f6c6343000811000a", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063c0c53b8b11610097578063ddc3f7f611610066578063ddc3f7f614610213578063de981f1b1461021b578063f9f6087314610246578063fbb2f1941461024e57600080fd5b8063c0c53b8b146101d2578063c48549de146101e5578063c9631a12146101f8578063d1e1f2f81461020b57600080fd5b80635ebae8a0116100d35780635ebae8a0146101735780636dda44081461019f578063865e6fd3146101b55780639c2f4459146101ca57600080fd5b806301ffc9a7146101055780631288810a1461012d5780634dca59251461014d5780635311153b14610160575b600080fd5b610118610113366004610e59565b61026e565b60405190151581526020015b60405180910390f35b61014061013b366004610ecf565b6102a5565b6040516101249190610f11565b61011861015b366004611042565b61038d565b61014061016e366004610ecf565b61062d565b61018661018136600461111d565b610706565b6040516001600160e01b03199091168152602001610124565b6101a7600181565b604051908152602001610124565b6101c86101c33660046111fb565b610883565b005b6101a7603281565b6101c86101e036600461122e565b6108a2565b6101866101f3366004611271565b6109cf565b6101866102063660046112dd565b6109ee565b6101a7600581565b6101a7601e81565b61022e6102293660046112f9565b610a6d565b6040516001600160a01b039091168152602001610124565b610140610ae8565b61026161025c366004611314565b610af7565b604051610124919061134c565b60006001600160e01b031982166314d72edb60e21b148061029f57506001600160e01b031982166301ffc9a760e01b145b92915050565b6060818067ffffffffffffffff8111156102c1576102c1610f55565b6040519080825280602002602001820160405280156102ea578160200160208202803683370190505b5091506000805160206114ad83398151915260005b828110156103845781600087878481811061031c5761031c611366565b9050602002016020810190610331919061137c565b6001600160a01b031681526020810191909152604001600020548451600160801b9091046001600160801b03169085908390811061037157610371611366565b60209081029190910101526001016102ff565b50505092915050565b6000600361039a81610b0a565b836032811115610622578751875181146103da576040516306b5667560e21b81526001600160e01b03196000351660048201526024015b60405180910390fd5b806000036103ec576000935050610622565b6103f787878a610b59565b61042e576040517f64ba7143ea5a17abea37667aa9ae137e3afba5033c5f504770c02829c128189c90600090a16000935050610622565b6000610438610bd6565b604080518082019091526000808252602082018190529192506000805160206114ad833981519152918080805b87811015610619578f818151811061047f5761047f611366565b6020908102919091018101516001600160a01b03811660009081528883526040908190208151808301909252546001600160801b038082168352600160801b90910416928101839052965093508c1115610611576104f68f82815181106104e8576104e8611366565b60200260200101518e610c41565b9150610511828d87600001516001600160801b03168a610c93565b935061051d848d610cea565b15610563576040516001600160801b0394506001600160a01b038416908d907fb32a150b9737190a456d8b2b81dd7d592a799ab2933ea494e44351acd41f835d90600090a35b600082600281111561057757610577611336565b146106115760019a506001600160801b0384146105df578b836001600160a01b03168360028111156105ab576105ab611336565b6040518781527f14441e950b7f9ed959e16b2405dd1a9d163efd5d85027b222dcf78b902a00d759060200160405180910390a45b6001600160a01b038316600090815260208790526040902080546001600160801b0319166001600160801b0386161790555b600101610465565b50505050505050505b505095945050505050565b6060818067ffffffffffffffff81111561064957610649610f55565b604051908082528060200260200182016040528015610672578160200160208202803683370190505b5091506000805160206114ad83398151915260005b82811015610384578160008787848181106106a4576106a4611366565b90506020020160208101906106b9919061137c565b6001600160a01b0316815260208101919091526040016000205484516001600160801b03909116908590839081106106f3576106f3611366565b6020908102919091010152600101610687565b6000600b61071381610b0a565b825184908114610744576040516306b5667560e21b81526001600160e01b03196000351660048201526024016103d1565b8060000361075c57506302f5d74560e51b915061087b565b6000805160206114ad83398151915260006107776008610a6d565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d89190611397565b905060005b8381101561086c578681815181106107f7576107f7611366565b60200260200101511561086457818360008b8b8581811061081a5761081a611366565b905060200201602081019061082f919061137c565b6001600160a01b03168152602081019190915260400160002080546001600160801b03928316600160801b0292169190911790555b6001016107dd565b506302f5d74560e51b94505050505b509392505050565b61088b610d0c565b61089481610d68565b61089e8282610d9e565b5050565b600054610100900460ff16158080156108c25750600054600160ff909116105b806108dc5750303b1580156108dc575060005460ff166001145b61093f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103d1565b6000805460ff191660011790558015610962576000805461ff0019166101001790555b61096d600885610d9e565b610978600b84610d9e565b610983600383610d9e565b80156109c9576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b6000600b6109dc81610b0a565b506302f5d74560e51b95945050505050565b6000600b6109fb81610b0a565b50506001600160a01b0391821660008181526000805160206114ad8339815191526020526040808220939094168152928320825481546001600160801b0319166001600160801b0391821690811783558454600160801b908190049092169091021790558252556364b18d0960e11b90565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600d811115610aa457610aa4611336565b60ff1681526020810191909152604001600020546001600160a01b0316905080610ae3578160405163409140df60e11b81526004016103d191906113c4565b919050565b6060610af2610bd6565b905090565b6000610b038383610c41565b9392505050565b610b1381610a6d565b6001600160a01b0316336001600160a01b031614610b56576000356001600160e01b03191681336040516320e0f98d60e21b81526004016103d1939291906113d2565b50565b8051600190600090815b81811015610bbe5785858281518110610b7e57610b7e611366565b60200260200101511115610b955760009350610bbe565b848181518110610ba757610ba7611366565b602002602001015183019250806001019050610b63565b50828015610bcc5750858211155b9695505050505050565b604080516003808252608082019092526060916020820183803683370190505090506001818160ff1681518110610c0f57610c0f611366565b6020908102919091010152600581600260ff1681518110610c3257610c32611366565b60200260200101818152505090565b60008082612710610c52868361141f565b610c5c9190611432565b610c669190611449565b9050610bb88111610c88576103e88111610c81576000610c8b565b6001610c8b565b60025b949350505050565b6000610ca9610ca360018661141f565b84610e42565b82866002811115610cbc57610cbc611336565b60ff1681518110610ccf57610ccf611366565b6020026020010151610ce1919061146b565b95945050505050565b6000601e610cf960018461141f565b610d03908561141f565b10159392505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610d66576000356001600160e01b0319166001604051620f948f60ea1b81526004016103d192919061147e565b565b806001600160a01b03163b600003610b5657604051630bfc64a360e21b81526001600160a01b03821660048201526024016103d1565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600d811115610dd457610dd4611336565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600d811115610e1557610e15611336565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b600081831015610e525781610b03565b5090919050565b600060208284031215610e6b57600080fd5b81356001600160e01b031981168114610b0357600080fd5b60008083601f840112610e9557600080fd5b50813567ffffffffffffffff811115610ead57600080fd5b6020830191508360208260051b8501011115610ec857600080fd5b9250929050565b60008060208385031215610ee257600080fd5b823567ffffffffffffffff811115610ef957600080fd5b610f0585828601610e83565b90969095509350505050565b6020808252825182820181905260009190848201906040850190845b81811015610f4957835183529284019291840191600101610f2d565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610f9457610f94610f55565b604052919050565b600067ffffffffffffffff821115610fb657610fb6610f55565b5060051b60200190565b80356001600160a01b0381168114610ae357600080fd5b600082601f830112610fe857600080fd5b81356020610ffd610ff883610f9c565b610f6b565b82815260059290921b8401810191818101908684111561101c57600080fd5b8286015b848110156110375780358352918301918301611020565b509695505050505050565b600080600080600060a0868803121561105a57600080fd5b853567ffffffffffffffff8082111561107257600080fd5b818801915088601f83011261108657600080fd5b81356020611096610ff883610f9c565b82815260059290921b8401810191818101908c8411156110b557600080fd5b948201945b838610156110da576110cb86610fc0565b825294820194908201906110ba565b995050890135925050808211156110f057600080fd5b506110fd88828901610fd7565b959895975050505060408401359360608101359360809091013592509050565b60008060006040848603121561113257600080fd5b833567ffffffffffffffff8082111561114a57600080fd5b61115687838801610e83565b909550935060209150858201358181111561117057600080fd5b86019050601f8101871361118357600080fd5b8035611191610ff882610f9c565b81815260059190911b820183019083810190898311156111b057600080fd5b928401925b828410156111dd57833580151581146111ce5760008081fd5b825292840192908401906111b5565b80955050505050509250925092565b8035600e8110610ae357600080fd5b6000806040838503121561120e57600080fd5b611217836111ec565b915061122560208401610fc0565b90509250929050565b60008060006060848603121561124357600080fd5b61124c84610fc0565b925061125a60208501610fc0565b915061126860408501610fc0565b90509250925092565b6000806000806040858703121561128757600080fd5b843567ffffffffffffffff8082111561129f57600080fd5b6112ab88838901610e83565b909650945060208701359150808211156112c457600080fd5b506112d187828801610e83565b95989497509550505050565b600080604083850312156112f057600080fd5b61121783610fc0565b60006020828403121561130b57600080fd5b610b03826111ec565b6000806040838503121561132757600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b602081016003831061136057611360611336565b91905290565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561138e57600080fd5b610b0382610fc0565b6000602082840312156113a957600080fd5b5051919050565b600e81106113c0576113c0611336565b9052565b6020810161029f82846113b0565b6001600160e01b031984168152606081016113f060208301856113b0565b6001600160a01b03929092166040919091015292915050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561029f5761029f611409565b808202811582820484141761029f5761029f611409565b60008261146657634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561029f5761029f611409565b6001600160e01b031983168152604081016009831061149f5761149f611336565b826020830152939250505056fed08d185790a07c7b9b721e2713c8580010a57f31c72c16f6e80b831d0ee45bfea164736f6c6343000811000a", - "devdoc": { - "details": "A contract that implements slashing functionality for bridge operators based on their availability.", - "errors": { - "ErrContractTypeNotFound(uint8)": [ + "stateMutability": "pure" + }, + { + "type": "event", + "name": "BridgeSlashed", + "inputs": [ { - "details": "Error of invalid role." + "name": "tier", + "type": "uint8", + "indexed": true, + "internalType": "enum IBridgeSlashEvents.Tier" + }, + { + "name": "bridgeOperator", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "period", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "slashUntilPeriod", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "ErrLengthMismatch(bytes4)": [ + "anonymous": false + }, + { + "type": "event", + "name": "BridgeTrackingIncorrectlyResponded", + "inputs": [], + "anonymous": false + }, + { + "type": "event", + "name": "ContractUpdated", + "inputs": [ { - "details": "Error indicating a mismatch in the length of input parameters or arrays for a specific function.", - "params": { - "msgSig": "The function signature (bytes4) that has a length mismatch." - } + "name": "contractType", + "type": "uint8", + "indexed": true, + "internalType": "enum ContractType" + }, + { + "name": "addr", + "type": "address", + "indexed": true, + "internalType": "address" } ], - "ErrUnauthorized(bytes4,uint8)": [ + "anonymous": false + }, + { + "type": "event", + "name": "Initialized", + "inputs": [ { - "details": "Error indicating that the caller is unauthorized to perform a specific function.", - "params": { - "expectedRole": "The role required to perform the function.", - "msgSig": "The function signature (bytes4) that the caller is unauthorized to perform." - } + "name": "version", + "type": "uint8", + "indexed": false, + "internalType": "uint8" } ], - "ErrUnexpectedInternalCall(bytes4,uint8,address)": [ + "anonymous": false + }, + { + "type": "event", + "name": "RemovalRequested", + "inputs": [ { - "details": "Error indicating that the caller is unauthorized to perform a specific function.", - "params": { - "actual": "The actual address that called to the function.", - "expectedContractType": "The contract type required to perform the function.", - "msgSig": "The function signature (bytes4)." - } + "name": "period", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "bridgeOperator", + "type": "address", + "indexed": true, + "internalType": "address" } ], - "ErrZeroCodeContract(address)": [ + "anonymous": false + }, + { + "type": "error", + "name": "ErrContractTypeNotFound", + "inputs": [ { - "details": "Error of set to non-contract." + "name": "contractType", + "type": "uint8", + "internalType": "enum ContractType" + } + ] + }, + { + "type": "error", + "name": "ErrLengthMismatch", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrUnauthorized", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + }, + { + "name": "expectedRole", + "type": "uint8", + "internalType": "enum RoleAccess" + } + ] + }, + { + "type": "error", + "name": "ErrUnexpectedInternalCall", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + }, + { + "name": "expectedContractType", + "type": "uint8", + "internalType": "enum ContractType" + }, + { + "name": "actual", + "type": "address", + "internalType": "address" } ] }, + { + "type": "error", + "name": "ErrZeroCodeContract", + "inputs": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + } + ] + } + ], + "address": "0xB03E29Be08E57b2d95Fe9F94966CB86a0DD98481", + "args": "0x", + "ast": "", + "blockNumber": 26515571, + "bytecode": "0x608060405261000c610011565b6100d1565b600054610100900460ff161561007d5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156100cf576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b611583806100e06000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80639c2f445911610097578063de981f1b11610066578063de981f1b146101fd578063f8c8765e14610228578063f9f608731461023b578063fbb2f1941461024357600080fd5b80639c2f4459146101d2578063c48549de146101da578063d1e1f2f8146101ed578063ddc3f7f6146101f557600080fd5b80635311153b116100d35780635311153b1461016a5780636dda44081461017d578063865e6fd3146101935780638f851d8a146101a657600080fd5b806301ffc9a7146101055780631288810a1461012d5780633b1544551461014d5780634dca592514610157575b600080fd5b610118610113366004610eb7565b610263565b60405190151581526020015b60405180910390f35b61014061013b366004610f2d565b61029a565b6040516101249190610f6f565b610155610382565b005b6101556101653660046110a4565b610462565b610140610178366004610f2d565b6106f9565b610185600181565b604051908152602001610124565b6101556101a136600461118e565b6107d2565b6101b96101b43660046111c1565b6107f1565b6040516001600160e01b03199091168152602001610124565b610185603281565b6101b96101e83660046112ba565b610970565b610185600581565b610185601e81565b61021061020b366004611326565b61098f565b6040516001600160a01b039091168152602001610124565b610155610236366004611341565b610a0a565b610140610b49565b610256610251366004611395565b610b58565b60405161012491906113cd565b60006001600160e01b031982166312c0151560e21b148061029457506001600160e01b031982166301ffc9a760e01b145b92915050565b6060818067ffffffffffffffff8111156102b6576102b6610fb3565b6040519080825280602002602001820160405280156102df578160200160208202803683370190505b50915060008051602061152e83398151915260005b8281101561037957816000878784818110610311576103116113e7565b905060200201602081019061032691906113fd565b6001600160a01b031681526020810191909152604001600020548451600160801b9091046001600160801b031690859083908110610366576103666113e7565b60209081029190910101526001016102f4565b50505092915050565b600461038d81610b6b565b600019600154146103da5760405162461bcd60e51b815260206004820152601260248201527130b63932b0b23c9034b734ba103932b8101960711b60448201526064015b60405180910390fd5b6103e4600861098f565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610421573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104459190611418565b610450906001611447565b60015561045f60046000610bb7565b50565b600361046d81610b6b565b8160015481106106f0578360328111156106ee5786518851146104b1576040516306b5667560e21b81526001600160e01b03196000351660048201526024016103d1565b8751156106ee576104c3868689610c5b565b6104f5576040517f64ba7143ea5a17abea37667aa9ae137e3afba5033c5f504770c02829c128189c90600090a16106ee565b60006104ff610cd8565b6040805180820190915260008082526020820181905291925060008051602061152e833981519152918080805b8e518110156106e6578e8181518110610547576105476113e7565b6020908102919091018101516001600160a01b03811660009081528883526040908190208151808301909252546001600160801b038082168352600160801b90910416928101839052965093508b11156106de576105be8e82815181106105b0576105b06113e7565b60200260200101518d610d43565b91506105d9828c87600001516001600160801b03168a610d95565b93506105e5848c610dec565b1561062b576040516001600160801b0394506001600160a01b038416908c907fb32a150b9737190a456d8b2b81dd7d592a799ab2933ea494e44351acd41f835d90600090a35b600082600281111561063f5761063f6113b7565b146106de576001600160801b0384146106a3578a836001600160a01b031683600281111561066f5761066f6113b7565b6040518781527fa0957b65e189f06dfe2b38ff07e89a0df128ba3fcba66c68f8d2615daebc30a99060200160405180910390a45b6001600160a01b038316600090815260208790526040902080546fffffffffffffffffffffffffffffffff19166001600160801b0386161790555b60010161052c565b505050505050505b505b50505050505050565b6060818067ffffffffffffffff81111561071557610715610fb3565b60405190808252806020026020018201604052801561073e578160200160208202803683370190505b50915060008051602061152e83398151915260005b8281101561037957816000878784818110610770576107706113e7565b905060200201602081019061078591906113fd565b6001600160a01b0316815260208101919091526040016000205484516001600160801b03909116908590839081106107bf576107bf6113e7565b6020908102919091010152600101610753565b6107da610e0e565b6107e381610e6a565b6107ed8282610bb7565b5050565b6000600b6107fe81610b6b565b82518690811461082f576040516306b5667560e21b81526001600160e01b03196000351660048201526024016103d1565b8060000361084757506347c28ec560e11b9150610966565b60008051602061152e8339815191526000610862600861098f565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa15801561089f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c39190611418565b905060005b83811015610957578681815181106108e2576108e26113e7565b60200260200101511561094f57818360008d8d85818110610905576109056113e7565b905060200201602081019061091a91906113fd565b6001600160a01b03168152602081019190915260400160002080546001600160801b03928316600160801b0292169190911790555b6001016108c8565b506347c28ec560e11b94505050505b5095945050505050565b6000600b61097d81610b6b565b50636242a4ef60e11b95945050505050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f8111156109c6576109c66113b7565b60ff1681526020810191909152604001600020546001600160a01b0316905080610a05578160405163409140df60e11b81526004016103d1919061146e565b919050565b600054610100900460ff1615808015610a2a5750600054600160ff909116105b80610a445750303b158015610a44575060005460ff166001145b610aa75760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103d1565b6000805460ff191660011790558015610aca576000805461ff0019166101001790555b610ad5600886610bb7565b610ae0600b85610bb7565b610aeb600384610bb7565b610af6600483610bb7565b6000196001558015610b42576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6060610b53610cd8565b905090565b6000610b648383610d43565b9392505050565b610b748161098f565b6001600160a01b0316336001600160a01b03161461045f576000356001600160e01b03191681336040516320e0f98d60e21b81526004016103d19392919061147c565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f811115610bed57610bed6113b7565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115610c2e57610c2e6113b7565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b8051600190600090815b81811015610cc05785858281518110610c8057610c806113e7565b60200260200101511115610c975760009350610cc0565b848181518110610ca957610ca96113e7565b602002602001015183019250806001019050610c65565b50828015610cce5750858211155b9695505050505050565b604080516003808252608082019092526060916020820183803683370190505090506001818160ff1681518110610d1157610d116113e7565b6020908102919091010152600581600260ff1681518110610d3457610d346113e7565b60200260200101818152505090565b60008082612710610d5486836114b3565b610d5e91906114c6565b610d6891906114dd565b9050610bb88111610d8a576103e88111610d83576000610d8d565b6001610d8d565b60025b949350505050565b6000610dab610da56001866114b3565b84610ea0565b82866002811115610dbe57610dbe6113b7565b60ff1681518110610dd157610dd16113e7565b6020026020010151610de39190611447565b95945050505050565b6000601e610dfb6001846114b3565b610e0590856114b3565b10159392505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610e68576000356001600160e01b0319166001604051620f948f60ea1b81526004016103d19291906114ff565b565b806001600160a01b03163b60000361045f57604051630bfc64a360e21b81526001600160a01b03821660048201526024016103d1565b600081831015610eb05781610b64565b5090919050565b600060208284031215610ec957600080fd5b81356001600160e01b031981168114610b6457600080fd5b60008083601f840112610ef357600080fd5b50813567ffffffffffffffff811115610f0b57600080fd5b6020830191508360208260051b8501011115610f2657600080fd5b9250929050565b60008060208385031215610f4057600080fd5b823567ffffffffffffffff811115610f5757600080fd5b610f6385828601610ee1565b90969095509350505050565b6020808252825182820181905260009190848201906040850190845b81811015610fa757835183529284019291840191600101610f8b565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610ff257610ff2610fb3565b604052919050565b600067ffffffffffffffff82111561101457611014610fb3565b5060051b60200190565b80356001600160a01b0381168114610a0557600080fd5b600082601f83011261104657600080fd5b8135602061105b61105683610ffa565b610fc9565b8083825260208201915060208460051b87010193508684111561107d57600080fd5b602086015b848110156110995780358352918301918301611082565b509695505050505050565b600080600080600060a086880312156110bc57600080fd5b853567ffffffffffffffff808211156110d457600080fd5b818801915088601f8301126110e857600080fd5b813560206110f861105683610ffa565b82815260059290921b8401810191818101908c84111561111757600080fd5b948201945b8386101561113c5761112d8661101e565b8252948201949082019061111c565b9950508901359250508082111561115257600080fd5b5061115f88828901611035565b959895975050505060408401359360608101359360809091013592509050565b803560108110610a0557600080fd5b600080604083850312156111a157600080fd5b6111aa8361117f565b91506111b86020840161101e565b90509250929050565b6000806000806000606086880312156111d957600080fd5b853567ffffffffffffffff808211156111f157600080fd5b6111fd89838a01610ee1565b909750955060209150878201358181111561121757600080fd5b6112238a828b01610ee1565b90965094505060408801358181111561123b57600080fd5b88019050601f8101891361124e57600080fd5b803561125c61105682610ffa565b81815260059190911b8201830190838101908b83111561127b57600080fd5b928401925b828410156112a857833580151581146112995760008081fd5b82529284019290840190611280565b80955050505050509295509295909350565b600080600080604085870312156112d057600080fd5b843567ffffffffffffffff808211156112e857600080fd5b6112f488838901610ee1565b9096509450602087013591508082111561130d57600080fd5b5061131a87828801610ee1565b95989497509550505050565b60006020828403121561133857600080fd5b610b648261117f565b6000806000806080858703121561135757600080fd5b6113608561101e565b935061136e6020860161101e565b925061137c6040860161101e565b915061138a6060860161101e565b905092959194509250565b600080604083850312156113a857600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60208101600383106113e1576113e16113b7565b91905290565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561140f57600080fd5b610b648261101e565b60006020828403121561142a57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561029457610294611431565b6010811061146a5761146a6113b7565b9052565b60208101610294828461145a565b6001600160e01b0319841681526060810161149a602083018561145a565b6001600160a01b03929092166040919091015292915050565b8181038181111561029457610294611431565b808202811582820484141761029457610294611431565b6000826114fa57634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b03198316815260408101600b8310611520576115206113b7565b826020830152939250505056fed08d185790a07c7b9b721e2713c8580010a57f31c72c16f6e80b831d0ee45bfea2646970667358221220a88731885a136f6ffe2ef43beabc7b3a128ab2f3ee20d79c6777fe10326663bf64736f6c63430008170033", + "chainId": 2021, + "contractAbsolutePath": "BridgeSlash.sol", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101005760003560e01c80639c2f445911610097578063de981f1b11610066578063de981f1b146101fd578063f8c8765e14610228578063f9f608731461023b578063fbb2f1941461024357600080fd5b80639c2f4459146101d2578063c48549de146101da578063d1e1f2f8146101ed578063ddc3f7f6146101f557600080fd5b80635311153b116100d35780635311153b1461016a5780636dda44081461017d578063865e6fd3146101935780638f851d8a146101a657600080fd5b806301ffc9a7146101055780631288810a1461012d5780633b1544551461014d5780634dca592514610157575b600080fd5b610118610113366004610eb7565b610263565b60405190151581526020015b60405180910390f35b61014061013b366004610f2d565b61029a565b6040516101249190610f6f565b610155610382565b005b6101556101653660046110a4565b610462565b610140610178366004610f2d565b6106f9565b610185600181565b604051908152602001610124565b6101556101a136600461118e565b6107d2565b6101b96101b43660046111c1565b6107f1565b6040516001600160e01b03199091168152602001610124565b610185603281565b6101b96101e83660046112ba565b610970565b610185600581565b610185601e81565b61021061020b366004611326565b61098f565b6040516001600160a01b039091168152602001610124565b610155610236366004611341565b610a0a565b610140610b49565b610256610251366004611395565b610b58565b60405161012491906113cd565b60006001600160e01b031982166312c0151560e21b148061029457506001600160e01b031982166301ffc9a760e01b145b92915050565b6060818067ffffffffffffffff8111156102b6576102b6610fb3565b6040519080825280602002602001820160405280156102df578160200160208202803683370190505b50915060008051602061152e83398151915260005b8281101561037957816000878784818110610311576103116113e7565b905060200201602081019061032691906113fd565b6001600160a01b031681526020810191909152604001600020548451600160801b9091046001600160801b031690859083908110610366576103666113e7565b60209081029190910101526001016102f4565b50505092915050565b600461038d81610b6b565b600019600154146103da5760405162461bcd60e51b815260206004820152601260248201527130b63932b0b23c9034b734ba103932b8101960711b60448201526064015b60405180910390fd5b6103e4600861098f565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610421573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104459190611418565b610450906001611447565b60015561045f60046000610bb7565b50565b600361046d81610b6b565b8160015481106106f0578360328111156106ee5786518851146104b1576040516306b5667560e21b81526001600160e01b03196000351660048201526024016103d1565b8751156106ee576104c3868689610c5b565b6104f5576040517f64ba7143ea5a17abea37667aa9ae137e3afba5033c5f504770c02829c128189c90600090a16106ee565b60006104ff610cd8565b6040805180820190915260008082526020820181905291925060008051602061152e833981519152918080805b8e518110156106e6578e8181518110610547576105476113e7565b6020908102919091018101516001600160a01b03811660009081528883526040908190208151808301909252546001600160801b038082168352600160801b90910416928101839052965093508b11156106de576105be8e82815181106105b0576105b06113e7565b60200260200101518d610d43565b91506105d9828c87600001516001600160801b03168a610d95565b93506105e5848c610dec565b1561062b576040516001600160801b0394506001600160a01b038416908c907fb32a150b9737190a456d8b2b81dd7d592a799ab2933ea494e44351acd41f835d90600090a35b600082600281111561063f5761063f6113b7565b146106de576001600160801b0384146106a3578a836001600160a01b031683600281111561066f5761066f6113b7565b6040518781527fa0957b65e189f06dfe2b38ff07e89a0df128ba3fcba66c68f8d2615daebc30a99060200160405180910390a45b6001600160a01b038316600090815260208790526040902080546fffffffffffffffffffffffffffffffff19166001600160801b0386161790555b60010161052c565b505050505050505b505b50505050505050565b6060818067ffffffffffffffff81111561071557610715610fb3565b60405190808252806020026020018201604052801561073e578160200160208202803683370190505b50915060008051602061152e83398151915260005b8281101561037957816000878784818110610770576107706113e7565b905060200201602081019061078591906113fd565b6001600160a01b0316815260208101919091526040016000205484516001600160801b03909116908590839081106107bf576107bf6113e7565b6020908102919091010152600101610753565b6107da610e0e565b6107e381610e6a565b6107ed8282610bb7565b5050565b6000600b6107fe81610b6b565b82518690811461082f576040516306b5667560e21b81526001600160e01b03196000351660048201526024016103d1565b8060000361084757506347c28ec560e11b9150610966565b60008051602061152e8339815191526000610862600861098f565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa15801561089f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c39190611418565b905060005b83811015610957578681815181106108e2576108e26113e7565b60200260200101511561094f57818360008d8d85818110610905576109056113e7565b905060200201602081019061091a91906113fd565b6001600160a01b03168152602081019190915260400160002080546001600160801b03928316600160801b0292169190911790555b6001016108c8565b506347c28ec560e11b94505050505b5095945050505050565b6000600b61097d81610b6b565b50636242a4ef60e11b95945050505050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f8111156109c6576109c66113b7565b60ff1681526020810191909152604001600020546001600160a01b0316905080610a05578160405163409140df60e11b81526004016103d1919061146e565b919050565b600054610100900460ff1615808015610a2a5750600054600160ff909116105b80610a445750303b158015610a44575060005460ff166001145b610aa75760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103d1565b6000805460ff191660011790558015610aca576000805461ff0019166101001790555b610ad5600886610bb7565b610ae0600b85610bb7565b610aeb600384610bb7565b610af6600483610bb7565b6000196001558015610b42576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6060610b53610cd8565b905090565b6000610b648383610d43565b9392505050565b610b748161098f565b6001600160a01b0316336001600160a01b03161461045f576000356001600160e01b03191681336040516320e0f98d60e21b81526004016103d19392919061147c565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f811115610bed57610bed6113b7565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115610c2e57610c2e6113b7565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b8051600190600090815b81811015610cc05785858281518110610c8057610c806113e7565b60200260200101511115610c975760009350610cc0565b848181518110610ca957610ca96113e7565b602002602001015183019250806001019050610c65565b50828015610cce5750858211155b9695505050505050565b604080516003808252608082019092526060916020820183803683370190505090506001818160ff1681518110610d1157610d116113e7565b6020908102919091010152600581600260ff1681518110610d3457610d346113e7565b60200260200101818152505090565b60008082612710610d5486836114b3565b610d5e91906114c6565b610d6891906114dd565b9050610bb88111610d8a576103e88111610d83576000610d8d565b6001610d8d565b60025b949350505050565b6000610dab610da56001866114b3565b84610ea0565b82866002811115610dbe57610dbe6113b7565b60ff1681518110610dd157610dd16113e7565b6020026020010151610de39190611447565b95945050505050565b6000601e610dfb6001846114b3565b610e0590856114b3565b10159392505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610e68576000356001600160e01b0319166001604051620f948f60ea1b81526004016103d19291906114ff565b565b806001600160a01b03163b60000361045f57604051630bfc64a360e21b81526001600160a01b03821660048201526024016103d1565b600081831015610eb05781610b64565b5090919050565b600060208284031215610ec957600080fd5b81356001600160e01b031981168114610b6457600080fd5b60008083601f840112610ef357600080fd5b50813567ffffffffffffffff811115610f0b57600080fd5b6020830191508360208260051b8501011115610f2657600080fd5b9250929050565b60008060208385031215610f4057600080fd5b823567ffffffffffffffff811115610f5757600080fd5b610f6385828601610ee1565b90969095509350505050565b6020808252825182820181905260009190848201906040850190845b81811015610fa757835183529284019291840191600101610f8b565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610ff257610ff2610fb3565b604052919050565b600067ffffffffffffffff82111561101457611014610fb3565b5060051b60200190565b80356001600160a01b0381168114610a0557600080fd5b600082601f83011261104657600080fd5b8135602061105b61105683610ffa565b610fc9565b8083825260208201915060208460051b87010193508684111561107d57600080fd5b602086015b848110156110995780358352918301918301611082565b509695505050505050565b600080600080600060a086880312156110bc57600080fd5b853567ffffffffffffffff808211156110d457600080fd5b818801915088601f8301126110e857600080fd5b813560206110f861105683610ffa565b82815260059290921b8401810191818101908c84111561111757600080fd5b948201945b8386101561113c5761112d8661101e565b8252948201949082019061111c565b9950508901359250508082111561115257600080fd5b5061115f88828901611035565b959895975050505060408401359360608101359360809091013592509050565b803560108110610a0557600080fd5b600080604083850312156111a157600080fd5b6111aa8361117f565b91506111b86020840161101e565b90509250929050565b6000806000806000606086880312156111d957600080fd5b853567ffffffffffffffff808211156111f157600080fd5b6111fd89838a01610ee1565b909750955060209150878201358181111561121757600080fd5b6112238a828b01610ee1565b90965094505060408801358181111561123b57600080fd5b88019050601f8101891361124e57600080fd5b803561125c61105682610ffa565b81815260059190911b8201830190838101908b83111561127b57600080fd5b928401925b828410156112a857833580151581146112995760008081fd5b82529284019290840190611280565b80955050505050509295509295909350565b600080600080604085870312156112d057600080fd5b843567ffffffffffffffff808211156112e857600080fd5b6112f488838901610ee1565b9096509450602087013591508082111561130d57600080fd5b5061131a87828801610ee1565b95989497509550505050565b60006020828403121561133857600080fd5b610b648261117f565b6000806000806080858703121561135757600080fd5b6113608561101e565b935061136e6020860161101e565b925061137c6040860161101e565b915061138a6060860161101e565b905092959194509250565b600080604083850312156113a857600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60208101600383106113e1576113e16113b7565b91905290565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561140f57600080fd5b610b648261101e565b60006020828403121561142a57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561029457610294611431565b6010811061146a5761146a6113b7565b9052565b60208101610294828461145a565b6001600160e01b0319841681526060810161149a602083018561145a565b6001600160a01b03929092166040919091015292915050565b8181038181111561029457610294611431565b808202811582820484141761029457610294611431565b6000826114fa57634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b03198316815260408101600b8310611520576115206113b7565b826020830152939250505056fed08d185790a07c7b9b721e2713c8580010a57f31c72c16f6e80b831d0ee45bfea2646970667358221220a88731885a136f6ffe2ef43beabc7b3a128ab2f3ee20d79c6777fe10326663bf64736f6c63430008170033", + "deployer": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "devdoc": { + "version": 1, "kind": "dev", + "details": "A contract that implements slashing functionality for bridge operators based on their availability.", "methods": { "execSlashBridgeOperators(address[],uint256[],uint256,uint256,uint256)": { "details": "Slashes the unavailability of bridge operators during a specific period.", @@ -609,17 +531,10 @@ "untilPeriods": "The penalized periods for the bridge operators." } }, - "onBridgeOperatorUpdated(address,address)": { - "details": "Handles the event when a bridge operator is updated.", - "params": { - "currentBridgeOperator": "The address of the current bridge operator.", - "newbridgeOperator": "The new address of the bridge operator." - }, - "returns": { - "_0": "The selector of the function being called." - } + "initializeREP2()": { + "details": "Helper for running upgrade script, required to only revoked once by the DPoS's governance admin." }, - "onBridgeOperatorsAdded(address[],bool[])": { + "onBridgeOperatorsAdded(address[],uint96[],bool[])": { "details": "Handles the event when bridge operators are added.", "params": { "addeds": "The corresponding boolean values indicating whether the operators were added or not.", @@ -650,76 +565,103 @@ "details": "Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas." } }, - "stateVariables": { - "BRIDGE_SLASH_INFOS_SLOT": { - "details": "value is equal to keccak256(\"@ronin.dpos.gateway.BridgeSlash.bridgeSlashInfos.slot\") - 1" - }, - "MINIMUM_VOTE_THRESHOLD": { - "details": "External function to retrieve the value of the minimum vote threshold to execute slashing rule.", - "return": "minimumVoteThreshold The minimum vote threshold value.", - "returns": { - "_0": "minimumVoteThreshold The minimum vote threshold value." - } - }, - "PERCENTAGE_FRACTION": { - "details": "Max percentage 100%. Values [0; 100_00] reflexes [0; 100%]" - }, - "REMOVE_DURATION_THRESHOLD": { - "details": "Returns the threshold duration for removing bridge operators.", - "return": "The duration in period number that exceeds which a bridge operator will be removed.", - "returns": { - "_0": "The duration in period number that exceeds which a bridge operator will be removed." + "events": { + "BridgeSlashed(uint8,address,uint256,uint256)": { + "details": "Event emitted when a bridge operator is slashed.", + "params": { + "bridgeOperator": "The address of the slashed bridge operator.", + "period": "The period in which the operator is slashed.", + "slashUntilPeriod": "The period until which the operator is penalized.", + "tier": "The slash tier of the operator." } }, - "SLASH_PERMANENT_DURATION": { - "details": "This value is set to the maximum value of uint128 to indicate a permanent slash duration." + "BridgeTrackingIncorrectlyResponded()": { + "details": "Event emited when the bridge tracking contract tracks the invalid data, cause malform in sharing bridge reward." }, - "TIER_1_PENALTY_DURATION": { - "details": "Returns the penalty duration for Tier 1 slashing.", - "return": "The duration in period number for Tier 1 slashing.", - "returns": { - "_0": "The duration in period number for Tier 1 slashing." - } + "ContractUpdated(uint8,address)": { + "details": "Emitted when a contract is updated." }, - "TIER_1_THRESHOLD": { - "details": "Tier 1 slashing threshold ratio is 10%" + "Initialized(uint8)": { + "details": "Triggered when the contract has been initialized or reinitialized." }, - "TIER_2_PENALTY_DURATION": { - "details": "Returns the penalty duration for Tier 2 slashing.", - "return": "The duration in period number for Tier 2 slashing.", - "returns": { - "_0": "The duration in period number for Tier 2 slashing." + "RemovalRequested(uint256,address)": { + "details": "Emitted when a removal request is made for a bridge operator.", + "params": { + "bridgeOperator": "The address of the bridge operator being requested for removal.", + "period": "The period for which the removal request is made." } - }, - "TIER_2_THRESHOLD": { - "details": "Tier 2 slashing threshold ratio is 30%" } }, - "title": "BridgeSlash", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 + "errors": { + "ErrContractTypeNotFound(uint8)": [ + { + "details": "Error of invalid role." + } + ], + "ErrLengthMismatch(bytes4)": [ + { + "details": "Error indicating a mismatch in the length of input parameters or arrays for a specific function.", + "params": { + "msgSig": "The function signature (bytes4) that has a length mismatch." + } + } + ], + "ErrUnauthorized(bytes4,uint8)": [ + { + "details": "Error indicating that the caller is unauthorized to perform a specific function.", + "params": { + "expectedRole": "The role required to perform the function.", + "msgSig": "The function signature (bytes4) that the caller is unauthorized to perform." + } + } + ], + "ErrUnexpectedInternalCall(bytes4,uint8,address)": [ + { + "details": "Error indicating that the caller is unauthorized to perform a specific function.", + "params": { + "actual": "The actual address that called to the function.", + "expectedContractType": "The contract type required to perform the function.", + "msgSig": "The function signature (bytes4)." + } + } + ], + "ErrZeroCodeContract(address)": [ + { + "details": "Error of set to non-contract." + } + ] + }, + "title": "BridgeSlash" }, + "isFoundry": true, + "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"ErrContractTypeNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrLengthMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum RoleAccess\",\"name\":\"expectedRole\",\"type\":\"uint8\"}],\"name\":\"ErrUnauthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum ContractType\",\"name\":\"expectedContractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"actual\",\"type\":\"address\"}],\"name\":\"ErrUnexpectedInternalCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrZeroCodeContract\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum IBridgeSlashEvents.Tier\",\"name\":\"tier\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"bridgeOperator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"period\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"slashUntilPeriod\",\"type\":\"uint256\"}],\"name\":\"BridgeSlashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"BridgeTrackingIncorrectlyResponded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ContractUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"period\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"bridgeOperator\",\"type\":\"address\"}],\"name\":\"RemovalRequested\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MINIMUM_VOTE_THRESHOLD\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REMOVE_DURATION_THRESHOLD\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"TIER_1_PENALTY_DURATION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"TIER_2_PENALTY_DURATION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"operators\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ballots\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"totalBallot\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalVote\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"period\",\"type\":\"uint256\"}],\"name\":\"execSlashBridgeOperators\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"getAddedPeriodOf\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"addedPeriods\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"getContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"contract_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPenaltyDurations\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"penaltyDurations\",\"type\":\"uint256[]\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"ballot\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalVote\",\"type\":\"uint256\"}],\"name\":\"getSlashTier\",\"outputs\":[{\"internalType\":\"enum IBridgeSlashEvents.Tier\",\"name\":\"tier\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"getSlashUntilPeriodOf\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"untilPeriods\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"validatorContract\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"bridgeManagerContract\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"bridgeTrackingContract\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"dposGA\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initializeREP2\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"},{\"internalType\":\"uint96[]\",\"name\":\"\",\"type\":\"uint96[]\"},{\"internalType\":\"bool[]\",\"name\":\"addeds\",\"type\":\"bool[]\"}],\"name\":\"onBridgeOperatorsAdded\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"},{\"internalType\":\"bool[]\",\"name\":\"\",\"type\":\"bool[]\"}],\"name\":\"onBridgeOperatorsRemoved\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"A contract that implements slashing functionality for bridge operators based on their availability.\",\"errors\":{\"ErrContractTypeNotFound(uint8)\":[{\"details\":\"Error of invalid role.\"}],\"ErrLengthMismatch(bytes4)\":[{\"details\":\"Error indicating a mismatch in the length of input parameters or arrays for a specific function.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that has a length mismatch.\"}}],\"ErrUnauthorized(bytes4,uint8)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"expectedRole\":\"The role required to perform the function.\",\"msgSig\":\"The function signature (bytes4) that the caller is unauthorized to perform.\"}}],\"ErrUnexpectedInternalCall(bytes4,uint8,address)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"actual\":\"The actual address that called to the function.\",\"expectedContractType\":\"The contract type required to perform the function.\",\"msgSig\":\"The function signature (bytes4).\"}}],\"ErrZeroCodeContract(address)\":[{\"details\":\"Error of set to non-contract.\"}]},\"events\":{\"BridgeSlashed(uint8,address,uint256,uint256)\":{\"details\":\"Event emitted when a bridge operator is slashed.\",\"params\":{\"bridgeOperator\":\"The address of the slashed bridge operator.\",\"period\":\"The period in which the operator is slashed.\",\"slashUntilPeriod\":\"The period until which the operator is penalized.\",\"tier\":\"The slash tier of the operator.\"}},\"BridgeTrackingIncorrectlyResponded()\":{\"details\":\"Event emited when the bridge tracking contract tracks the invalid data, cause malform in sharing bridge reward.\"},\"ContractUpdated(uint8,address)\":{\"details\":\"Emitted when a contract is updated.\"},\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"RemovalRequested(uint256,address)\":{\"details\":\"Emitted when a removal request is made for a bridge operator.\",\"params\":{\"bridgeOperator\":\"The address of the bridge operator being requested for removal.\",\"period\":\"The period for which the removal request is made.\"}}},\"kind\":\"dev\",\"methods\":{\"execSlashBridgeOperators(address[],uint256[],uint256,uint256,uint256)\":{\"details\":\"Slashes the unavailability of bridge operators during a specific period.\",\"params\":{\"period\":\"The period to slash the bridge operators for.\"}},\"getAddedPeriodOf(address[])\":{\"details\":\"Retrieves the added periods of the specified bridge operators.\",\"params\":{\"bridgeOperators\":\"An array of bridge operator addresses.\"},\"returns\":{\"addedPeriods\":\"An array of uint256 values representing the added periods for each bridge operator.\"}},\"getContract(uint8)\":{\"details\":\"Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.\",\"params\":{\"contractType\":\"The role of the contract to retrieve.\"},\"returns\":{\"contract_\":\"The address of the contract with the specified role.\"}},\"getPenaltyDurations()\":{\"details\":\"Retrieve the penalty durations for different slash tiers.\",\"returns\":{\"penaltyDurations\":\"The array of penalty durations for each slash tier.\"}},\"getSlashTier(uint256,uint256)\":{\"details\":\"Gets the slash tier based on the given ballot and total ballots.\",\"params\":{\"ballot\":\"The ballot count for a bridge operator.\",\"totalVote\":\"The total vote count for the period.\"},\"returns\":{\"tier\":\"The slash tier.\"}},\"getSlashUntilPeriodOf(address[])\":{\"details\":\"Returns the penalize durations for the specified bridge operators.\",\"params\":{\"bridgeOperators\":\"The addresses of the bridge operators.\"},\"returns\":{\"untilPeriods\":\"The penalized periods for the bridge operators.\"}},\"initializeREP2()\":{\"details\":\"Helper for running upgrade script, required to only revoked once by the DPoS's governance admin.\"},\"onBridgeOperatorsAdded(address[],uint96[],bool[])\":{\"details\":\"Handles the event when bridge operators are added.\",\"params\":{\"addeds\":\"The corresponding boolean values indicating whether the operators were added or not.\",\"bridgeOperators\":\"The addresses of the bridge operators.\"},\"returns\":{\"_0\":\"The selector of the function being called.\"}},\"onBridgeOperatorsRemoved(address[],bool[])\":{\"details\":\"Handles the event when bridge operators are removed.\",\"params\":{\"bridgeOperators\":\"The addresses of the bridge operators.\",\"removeds\":\"The corresponding boolean values indicating whether the operators were removed or not.\"},\"returns\":{\"_0\":\"The selector of the function being called.\"}},\"setContract(uint8,address)\":{\"details\":\"Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.\",\"params\":{\"addr\":\"The address of the contract to set.\",\"contractType\":\"The role of the contract to set.\"}},\"supportsInterface(bytes4)\":{\"details\":\"Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.\"}},\"stateVariables\":{\"BRIDGE_SLASH_INFOS_SLOT\":{\"details\":\"value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeSlash.bridgeSlashInfos.slot\\\") - 1\"},\"MINIMUM_VOTE_THRESHOLD\":{\"details\":\"External function to retrieve the value of the minimum vote threshold to execute slashing rule.\",\"return\":\"minimumVoteThreshold The minimum vote threshold value.\",\"returns\":{\"_0\":\"minimumVoteThreshold The minimum vote threshold value.\"}},\"PERCENTAGE_FRACTION\":{\"details\":\"Max percentage 100%. Values [0; 100_00] reflexes [0; 100%]\"},\"REMOVE_DURATION_THRESHOLD\":{\"details\":\"Returns the threshold duration for removing bridge operators.\",\"return\":\"The duration in period number that exceeds which a bridge operator will be removed.\",\"returns\":{\"_0\":\"The duration in period number that exceeds which a bridge operator will be removed.\"}},\"SLASH_PERMANENT_DURATION\":{\"details\":\"This value is set to the maximum value of uint128 to indicate a permanent slash duration.\"},\"TIER_1_PENALTY_DURATION\":{\"details\":\"Returns the penalty duration for Tier 1 slashing.\",\"return\":\"The duration in period number for Tier 1 slashing.\",\"returns\":{\"_0\":\"The duration in period number for Tier 1 slashing.\"}},\"TIER_1_THRESHOLD\":{\"details\":\"Tier 1 slashing threshold ratio is 10%\"},\"TIER_2_PENALTY_DURATION\":{\"details\":\"Returns the penalty duration for Tier 2 slashing.\",\"return\":\"The duration in period number for Tier 2 slashing.\",\"returns\":{\"_0\":\"The duration in period number for Tier 2 slashing.\"}},\"TIER_2_THRESHOLD\":{\"details\":\"Tier 2 slashing threshold ratio is 30%\"},\"_startedAtPeriod\":{\"details\":\"The period that the contract allows slashing.\"}},\"title\":\"BridgeSlash\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/ronin/gateway/BridgeSlash.sol\":\"BridgeSlash\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@fdk/=lib/foundry-deployment-kit/script/\",\":@openzeppelin/=lib/openzeppelin-contracts/\",\":@prb/math/=lib/prb-math/\",\":@prb/test/=lib/prb-test/src/\",\":@ronin/contracts/=src/\",\":@ronin/script/=script/\",\":@ronin/test/=test/\",\":contract-libs/=lib/foundry-deployment-kit/lib/contract-libs/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/foundry-deployment-kit/lib/forge-std/src/\",\":foundry-deployment-kit/=lib/foundry-deployment-kit/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/contracts/\",\":prb-math/=lib/prb-math/src/\",\":prb-test/=lib/prb-test/src/\",\":solady/=lib/solady/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0xa6a787e7a901af6511e19aa53e1a00352db215a011d2c7a438d0582dd5da76f9\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2a21b14ff90012878752f230d3ffd5c3405e5938d06c97a7d89c0a64561d0d66\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"src/extensions/TransparentUpgradeableProxyV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\\\";\\n\\ncontract TransparentUpgradeableProxyV2 is TransparentUpgradeableProxy {\\n constructor(address _logic, address admin_, bytes memory _data) payable TransparentUpgradeableProxy(_logic, admin_, _data) { }\\n\\n /**\\n * @dev Calls a function from the current implementation as specified by `_data`, which should be an encoded function call.\\n *\\n * Requirements:\\n * - Only the admin can call this function.\\n *\\n * Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid\\n * triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider\\n * reviewing the encoded data `_data` and the method which is called before using this.\\n *\\n */\\n function functionDelegateCall(bytes memory _data) public payable ifAdmin {\\n address _addr = _implementation();\\n assembly {\\n let _result := delegatecall(gas(), _addr, add(_data, 32), mload(_data), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n switch _result\\n case 0 { revert(0, returndatasize()) }\\n default { return(0, returndatasize()) }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x45fc7b71d09da99414b977a56e586b3604670d865e5f36f395d5c98bc4ba64af\",\"license\":\"MIT\"},\"src/extensions/bridge-operator-governance/BridgeTrackingHelper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nabstract contract BridgeTrackingHelper {\\n /// @dev Event emited when the bridge tracking contract tracks the invalid data, cause malform in sharing bridge reward.\\n event BridgeTrackingIncorrectlyResponded();\\n\\n /**\\n * @dev Internal function to validate the bridge tracking response for a given set of ballots.\\n * @param totalBallot The total number of ballots available for the tracking response.\\n * @param totalVote The total number of votes recorded in the tracking response.\\n * @param ballots An array containing the individual ballot counts in the tracking response.\\n * @return valid A boolean indicating whether the bridge tracking response is valid or not.\\n * @notice The function checks if each individual ballot count is not greater than the total votes recorded.\\n * @notice It also verifies that the sum of all individual ballot counts does not exceed the total available ballots.\\n */\\n function _isValidBridgeTrackingResponse(uint256 totalBallot, uint256 totalVote, uint256[] memory ballots) internal pure returns (bool valid) {\\n valid = true;\\n uint256 sumBallot;\\n uint256 length = ballots.length;\\n\\n unchecked {\\n for (uint256 i; i < length; ++i) {\\n if (ballots[i] > totalVote) {\\n valid = false;\\n break;\\n }\\n\\n sumBallot += ballots[i];\\n }\\n }\\n\\n valid = valid && (sumBallot <= totalBallot);\\n }\\n}\\n\",\"keccak256\":\"0x6c4ace6aed6a3861ad64b30dc2db7a2d8b87585085e049f9f85b8f2efbbc41a0\",\"license\":\"MIT\"},\"src/extensions/collections/HasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { HasProxyAdmin } from \\\"./HasProxyAdmin.sol\\\";\\nimport \\\"../../interfaces/collections/IHasContracts.sol\\\";\\nimport { IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\nimport { ErrUnexpectedInternalCall } from \\\"../../utils/CommonErrors.sol\\\";\\n\\n/**\\n * @title HasContracts\\n * @dev A contract that provides functionality to manage multiple contracts with different roles.\\n */\\nabstract contract HasContracts is HasProxyAdmin, IHasContracts, IdentityGuard {\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.collections.HasContracts.slot\\\") - 1\\n bytes32 private constant _STORAGE_SLOT = 0xdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb;\\n\\n /**\\n * @dev Modifier to restrict access to functions only to contracts with a specific role.\\n * @param contractType The contract type that allowed to call\\n */\\n modifier onlyContract(ContractType contractType) virtual {\\n _requireContract(contractType);\\n _;\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function setContract(ContractType contractType, address addr) external virtual onlyProxyAdmin {\\n _requireHasCode(addr);\\n _setContract(contractType, addr);\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function getContract(ContractType contractType) public view returns (address contract_) {\\n contract_ = _getContractMap()[uint8(contractType)];\\n if (contract_ == address(0)) revert ErrContractTypeNotFound(contractType);\\n }\\n\\n /**\\n * @dev Internal function to set the address of a contract with a specific role.\\n * @param contractType The contract type of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function _setContract(ContractType contractType, address addr) internal virtual {\\n _getContractMap()[uint8(contractType)] = addr;\\n emit ContractUpdated(contractType, addr);\\n }\\n\\n /**\\n * @dev Internal function to access the mapping of contract addresses with roles.\\n * @return contracts_ The mapping of contract addresses with roles.\\n */\\n function _getContractMap() private pure returns (mapping(uint8 => address) storage contracts_) {\\n assembly {\\n contracts_.slot := _STORAGE_SLOT\\n }\\n }\\n\\n /**\\n * @dev Internal function to check if the calling contract has a specific role.\\n * @param contractType The contract type that the calling contract must have.\\n * @dev Throws an error if the calling contract does not have the specified role.\\n */\\n function _requireContract(ContractType contractType) private view {\\n if (msg.sender != getContract(contractType)) {\\n revert ErrUnexpectedInternalCall(msg.sig, contractType, msg.sender);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7dbefa31230e6e4bd319f02d94893cbfd07ee12a0e016f5fadc57660df01891\",\"license\":\"MIT\"},\"src/extensions/collections/HasProxyAdmin.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/StorageSlot.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\n\\nabstract contract HasProxyAdmin {\\n // bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n modifier onlyProxyAdmin() {\\n _requireProxyAdmin();\\n _;\\n }\\n\\n /**\\n * @dev Returns proxy admin.\\n */\\n function _getProxyAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n function _requireProxyAdmin() internal view {\\n if (msg.sender != _getProxyAdmin()) revert ErrUnauthorized(msg.sig, RoleAccess.ADMIN);\\n }\\n}\\n\",\"keccak256\":\"0xad3db02c99a960b60151f2ad45eed46073d14fe1ed861f496c7aeefacbbc528e\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManagerCallback.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @title IBridgeManagerCallback\\n * @dev Interface for the callback functions to be implemented by the Bridge Manager contract.\\n */\\ninterface IBridgeManagerCallback is IERC165 {\\n /**\\n * @dev Handles the event when bridge operators are added.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @param addeds The corresponding boolean values indicating whether the operators were added or not.\\n * @return selector The selector of the function being called.\\n */\\n function onBridgeOperatorsAdded(address[] memory bridgeOperators, uint96[] calldata weights, bool[] memory addeds) external returns (bytes4 selector);\\n\\n /**\\n * @dev Handles the event when bridge operators are removed.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @param removeds The corresponding boolean values indicating whether the operators were removed or not.\\n * @return selector The selector of the function being called.\\n */\\n function onBridgeOperatorsRemoved(address[] memory bridgeOperators, bool[] memory removeds) external returns (bytes4 selector);\\n}\\n\",\"keccak256\":\"0x6c8ce7e2478e28c5ed5e6f5d8305a77d6d5f9125a47adfb77632940b9a0f3625\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeSlash.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IBridgeSlashEvents } from \\\"./events/IBridgeSlashEvents.sol\\\";\\n\\n/**\\n * @title IBridgeSlash\\n * @dev Interface for the BridgeSlash contract to manage slashing functionality for bridge operators.\\n */\\ninterface IBridgeSlash is IBridgeSlashEvents {\\n /**\\n * @dev Slashes the unavailability of bridge operators during a specific period.\\n * @param period The period to slash the bridge operators for.\\n */\\n function execSlashBridgeOperators(address[] calldata operators, uint256[] calldata ballots, uint256 totalBallot, uint256 totalVote, uint256 period) external;\\n\\n /**\\n * @dev Returns the penalize durations for the specified bridge operators.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @return untilPeriods The penalized periods for the bridge operators.\\n */\\n function getSlashUntilPeriodOf(address[] calldata bridgeOperators) external returns (uint256[] memory untilPeriods);\\n\\n /**\\n * @dev Retrieves the added periods of the specified bridge operators.\\n * @param bridgeOperators An array of bridge operator addresses.\\n * @return addedPeriods An array of uint256 values representing the added periods for each bridge operator.\\n */\\n function getAddedPeriodOf(address[] calldata bridgeOperators) external view returns (uint256[] memory addedPeriods);\\n\\n /**\\n * @dev Gets the slash tier based on the given ballot and total ballots.\\n * @param ballot The ballot count for a bridge operator.\\n * @param totalVote The total vote count for the period.\\n * @return tier The slash tier.\\n */\\n function getSlashTier(uint256 ballot, uint256 totalVote) external pure returns (Tier tier);\\n\\n /**\\n * @dev Retrieve the penalty durations for different slash tiers.\\n * @return penaltyDurations The array of penalty durations for each slash tier.\\n */\\n function getPenaltyDurations() external pure returns (uint256[] memory penaltyDurations);\\n\\n /**\\n * @dev Returns the penalty duration for Tier 1 slashing.\\n * @return The duration in period number for Tier 1 slashing.\\n */\\n function TIER_1_PENALTY_DURATION() external view returns (uint256);\\n\\n /**\\n * @dev Returns the penalty duration for Tier 2 slashing.\\n * @return The duration in period number for Tier 2 slashing.\\n */\\n function TIER_2_PENALTY_DURATION() external view returns (uint256);\\n\\n /**\\n * @dev Returns the threshold duration for removing bridge operators.\\n * @return The duration in period number that exceeds which a bridge operator will be removed.\\n */\\n function REMOVE_DURATION_THRESHOLD() external view returns (uint256);\\n\\n /**\\n * @dev External function to retrieve the value of the minimum vote threshold to execute slashing rule.\\n * @return minimumVoteThreshold The minimum vote threshold value.\\n */\\n function MINIMUM_VOTE_THRESHOLD() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xb22e3ead9060f2c139d143b8db4dcda7cdf4e4e3960fa98a481ad8b3a2460134\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeTracking.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeTracking {\\n struct Request {\\n VoteKind kind;\\n uint256 id;\\n }\\n\\n enum VoteKind {\\n Deposit,\\n Withdrawal,\\n MainchainWithdrawal\\n }\\n\\n event ExternalCallFailed(address indexed to, bytes4 indexed msgSig, bytes reason);\\n\\n /**\\n * @dev Returns the block that allow incomming mutable call.\\n */\\n function startedAtBlock() external view returns (uint256);\\n\\n /**\\n * @dev Returns the total number of votes at the specific period `_period`.\\n */\\n function totalVote(uint256 _period) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total number of ballots at the specific period `_period`.\\n */\\n function totalBallot(uint256 _period) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total number of ballots of bridge operators at the specific period `_period`.\\n */\\n function getManyTotalBallots(uint256 _period, address[] calldata _bridgeOperators) external view returns (uint256[] memory);\\n\\n /**\\n * @dev Returns the total number of ballots of a bridge operator at the specific period `_period`.\\n */\\n function totalBallotOf(uint256 _period, address _bridgeOperator) external view returns (uint256);\\n\\n /**\\n * @dev Handles the request once it is approved.\\n *\\n * Requirements:\\n * - The method caller is the bridge contract.\\n *\\n */\\n function handleVoteApproved(VoteKind _kind, uint256 _requestId) external;\\n\\n /**\\n * @dev Records vote for a receipt and a operator.\\n *\\n * Requirements:\\n * - The method caller is the bridge contract.\\n *\\n */\\n function recordVote(VoteKind _kind, uint256 _requestId, address _operator) external;\\n}\\n\",\"keccak256\":\"0x53ac425ff6efebc200030ceef302c2871a4b2edfcc5e512ce326aa704989ff7a\",\"license\":\"MIT\"},\"src/interfaces/bridge/events/IBridgeSlashEvents.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeSlashEvents {\\n /**\\n * @dev Enumeration representing the slashing tiers for bridge operators.\\n */\\n enum Tier {\\n Tier0,\\n Tier1,\\n Tier2\\n }\\n\\n /**\\n * @dev Struct representing the status of a bridge operator.\\n */\\n struct BridgeSlashInfo {\\n uint128 slashUntilPeriod;\\n uint128 newlyAddedAtPeriod;\\n }\\n\\n /**\\n * @dev Event emitted when a bridge operator is slashed.\\n * @param tier The slash tier of the operator.\\n * @param bridgeOperator The address of the slashed bridge operator.\\n * @param period The period in which the operator is slashed.\\n * @param slashUntilPeriod The period until which the operator is penalized.\\n */\\n event BridgeSlashed(Tier indexed tier, address indexed bridgeOperator, uint256 indexed period, uint256 slashUntilPeriod);\\n\\n /**\\n * @dev Emitted when a removal request is made for a bridge operator.\\n * @param period The period for which the removal request is made.\\n * @param bridgeOperator The address of the bridge operator being requested for removal.\\n */\\n event RemovalRequested(uint256 indexed period, address indexed bridgeOperator);\\n}\\n\",\"keccak256\":\"0x43850ce839ef382c6e6d176e1de4de776fb54b7baa697f52d79858fba13c1b90\",\"license\":\"MIT\"},\"src/interfaces/collections/IHasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport { ContractType } from \\\"../../utils/ContractType.sol\\\";\\n\\ninterface IHasContracts {\\n /// @dev Error of invalid role.\\n error ErrContractTypeNotFound(ContractType contractType);\\n\\n /// @dev Emitted when a contract is updated.\\n event ContractUpdated(ContractType indexed contractType, address indexed addr);\\n\\n /**\\n * @dev Returns the address of a contract with a specific role.\\n * Throws an error if no contract is set for the specified role.\\n *\\n * @param contractType The role of the contract to retrieve.\\n * @return contract_ The address of the contract with the specified role.\\n */\\n function getContract(ContractType contractType) external view returns (address contract_);\\n\\n /**\\n * @dev Sets the address of a contract with a specific role.\\n * Emits the event {ContractUpdated}.\\n * @param contractType The role of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function setContract(ContractType contractType, address addr) external;\\n}\\n\",\"keccak256\":\"0x99d8213d857e30d367155abd15dc42730afdfbbac3a22dfb3b95ffea2083a92e\",\"license\":\"MIT\"},\"src/interfaces/validator/ICandidateManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface ICandidateManager {\\n struct ValidatorCandidate {\\n // Admin of the candidate\\n address admin;\\n // Address of the validator that produces block, e.g. block.coinbase. This is so-called validator address.\\n address consensusAddr;\\n // Address that receives mining reward of the validator\\n address payable treasuryAddr;\\n // Address of the bridge operator corresponding to the candidate\\n address ______deprecatedbridgeOperatorAddr;\\n // The percentage of reward that validators can be received, the rest goes to the delegators.\\n // Values in range [0; 100_00] stands for 0-100%\\n uint256 commissionRate;\\n // The timestamp that scheduled to revoke the candidate (no schedule=0)\\n uint256 revokingTimestamp;\\n // The deadline that the candidate must top up staking amount to keep it larger than or equal to the threshold (no deadline=0)\\n uint256 topupDeadline;\\n }\\n\\n struct CommissionSchedule {\\n // The timestamp that the commission schedule gets affected (no schedule=0).\\n uint256 effectiveTimestamp;\\n // The new commission rate. Value is in range [0; 100_00], stands for 0-100%\\n uint256 commissionRate;\\n }\\n\\n /// @dev Emitted when the maximum number of validator candidates is updated.\\n event MaxValidatorCandidateUpdated(uint256 threshold);\\n /// @dev Emitted when the min offset to the effective date of commission rate change is updated.\\n event MinEffectiveDaysOnwardsUpdated(uint256 numOfDays);\\n /// @dev Emitted when the validator candidate is granted.\\n event CandidateGranted(address indexed consensusAddr, address indexed treasuryAddr, address indexed admin);\\n /// @dev Emitted when the revoking timestamp of a candidate is updated.\\n event CandidateRevokingTimestampUpdated(address indexed consensusAddr, uint256 revokingTimestamp);\\n /// @dev Emitted when the topup deadline of a candidate is updated.\\n event CandidateTopupDeadlineUpdated(address indexed consensusAddr, uint256 topupDeadline);\\n /// @dev Emitted when the validator candidate is revoked.\\n event CandidatesRevoked(address[] consensusAddrs);\\n\\n /// @dev Emitted when a schedule for updating commission rate is set.\\n event CommissionRateUpdateScheduled(address indexed consensusAddr, uint256 effectiveTimestamp, uint256 rate);\\n /// @dev Emitted when the commission rate of a validator is updated.\\n event CommissionRateUpdated(address indexed consensusAddr, uint256 rate);\\n\\n /// @dev Error of exceeding maximum number of candidates.\\n error ErrExceedsMaxNumberOfCandidate();\\n /// @dev Error of querying for already existent candidate.\\n error ErrExistentCandidate();\\n /// @dev Error of querying for non-existent candidate.\\n error ErrNonExistentCandidate();\\n /// @dev Error of candidate admin already exists.\\n error ErrExistentCandidateAdmin(address _candidateAdminAddr);\\n /// @dev Error of treasury already exists.\\n error ErrExistentTreasury(address _treasuryAddr);\\n /// @dev Error of invalid commission rate.\\n error ErrInvalidCommissionRate();\\n /// @dev Error of invalid effective days onwards.\\n error ErrInvalidEffectiveDaysOnwards();\\n /// @dev Error of invalid min effective days onwards.\\n error ErrInvalidMinEffectiveDaysOnwards();\\n /// @dev Error of already requested revoking candidate before.\\n error ErrAlreadyRequestedRevokingCandidate();\\n /// @dev Error of commission change schedule exists.\\n error ErrAlreadyRequestedUpdatingCommissionRate();\\n /// @dev Error of trusted org cannot renounce.\\n error ErrTrustedOrgCannotRenounce();\\n\\n /**\\n * @dev Returns the maximum number of validator candidate.\\n */\\n function maxValidatorCandidate() external view returns (uint256);\\n\\n /**\\n * @dev Returns the minimum number of days to the effective date of commission rate change.\\n */\\n function minEffectiveDaysOnward() external view returns (uint256);\\n\\n /**\\n * @dev Sets the maximum number of validator candidate.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `MaxValidatorCandidateUpdated` event.\\n *\\n */\\n function setMaxValidatorCandidate(uint256) external;\\n\\n /**\\n * @dev Sets the minimum number of days to the effective date of commision rate change.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `MinEffectiveDaysOnwardsUpdated` event.\\n *\\n */\\n function setMinEffectiveDaysOnwards(uint256 _numOfDays) external;\\n\\n /**\\n * @dev Grants a validator candidate.\\n *\\n * Requirements:\\n * - The method caller is staking contract.\\n *\\n * Emits the event `CandidateGranted`.\\n *\\n */\\n function execApplyValidatorCandidate(address _admin, address _consensusAddr, address payable _treasuryAddr, uint256 _commissionRate) external;\\n\\n /**\\n * @dev Requests to revoke a validator candidate in next `_secsLeft` seconds.\\n *\\n * Requirements:\\n * - The method caller is staking contract.\\n *\\n * Emits the event `CandidateRevokingTimestampUpdated`.\\n *\\n */\\n function execRequestRenounceCandidate(address, uint256 _secsLeft) external;\\n\\n /**\\n * @dev Fallback function of `CandidateStaking-requestUpdateCommissionRate`.\\n *\\n * Requirements:\\n * - The method caller is the staking contract.\\n * - The `_effectiveTimestamp` must be the beginning of a UTC day, and at least from 7 days onwards\\n * - The `_rate` must be in range of [0_00; 100_00].\\n *\\n * Emits the event `CommissionRateUpdateScheduled`.\\n *\\n */\\n function execRequestUpdateCommissionRate(address _consensusAddr, uint256 _effectiveTimestamp, uint256 _rate) external;\\n\\n /**\\n * @dev Returns whether the address is a validator (candidate).\\n */\\n function isValidatorCandidate(address _addr) external view returns (bool);\\n\\n /**\\n * @dev Returns the validator candidate.\\n */\\n function getValidatorCandidates() external view returns (address[] memory);\\n\\n /**\\n * @dev Returns all candidate info.\\n */\\n function getCandidateInfos() external view returns (ValidatorCandidate[] memory);\\n\\n /**\\n * @dev Returns the info of a candidate.\\n */\\n function getCandidateInfo(address _candidate) external view returns (ValidatorCandidate memory);\\n\\n /**\\n * @dev Returns whether the address is the candidate admin.\\n */\\n function isCandidateAdmin(address _candidate, address _admin) external view returns (bool);\\n\\n /**\\n * @dev Returns the schedule of changing commission rate of a candidate address.\\n */\\n function getCommissionChangeSchedule(address _candidate) external view returns (CommissionSchedule memory);\\n}\\n\",\"keccak256\":\"0x37b15d36774a3f18291e85efa9df6caaf52b8fa751a8222a3ac8f467656950c1\",\"license\":\"MIT\"},\"src/interfaces/validator/ICoinbaseExecution.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"./ISlashingExecution.sol\\\";\\n\\ninterface ICoinbaseExecution is ISlashingExecution {\\n enum BlockRewardDeprecatedType {\\n UNKNOWN,\\n UNAVAILABILITY,\\n AFTER_BAILOUT\\n }\\n\\n /// @dev Emitted when the validator set is updated\\n event ValidatorSetUpdated(uint256 indexed period, address[] consensusAddrs);\\n /// @dev Emitted when the bridge operator set is updated, to mirror the in-jail and maintaining status of the validator.\\n event BlockProducerSetUpdated(uint256 indexed period, uint256 indexed epoch, address[] consensusAddrs);\\n /// @dev Emitted when the bridge operator set is updated.\\n event BridgeOperatorSetUpdated(uint256 indexed period, uint256 indexed epoch, address[] bridgeOperators);\\n\\n /// @dev Emitted when the reward of the block producer is deprecated.\\n event BlockRewardDeprecated(address indexed coinbaseAddr, uint256 rewardAmount, BlockRewardDeprecatedType deprecatedType);\\n /// @dev Emitted when the block reward is submitted.\\n event BlockRewardSubmitted(address indexed coinbaseAddr, uint256 submittedAmount, uint256 bonusAmount);\\n\\n /// @dev Emitted when the block producer reward is distributed.\\n event MiningRewardDistributed(address indexed consensusAddr, address indexed recipient, uint256 amount);\\n /// @dev Emitted when the contract fails when distributing the block producer reward.\\n event MiningRewardDistributionFailed(address indexed consensusAddr, address indexed recipient, uint256 amount, uint256 contractBalance);\\n\\n /// @dev Emitted when the bridge operator reward is distributed.\\n event BridgeOperatorRewardDistributed(address indexed consensusAddr, address indexed bridgeOperator, address indexed recipientAddr, uint256 amount);\\n /// @dev Emitted when the contract fails when distributing the bridge operator reward.\\n event BridgeOperatorRewardDistributionFailed(\\n address indexed consensusAddr, address indexed bridgeOperator, address indexed recipient, uint256 amount, uint256 contractBalance\\n );\\n\\n /// @dev Emitted when the fast finality reward is distributed.\\n event FastFinalityRewardDistributed(address indexed consensusAddr, address indexed recipient, uint256 amount);\\n /// @dev Emitted when the contract fails when distributing the fast finality reward.\\n event FastFinalityRewardDistributionFailed(address indexed consensusAddr, address indexed recipient, uint256 amount, uint256 contractBalance);\\n\\n /// @dev Emitted when the amount of RON reward is distributed to staking contract.\\n event StakingRewardDistributed(uint256 totalAmount, address[] consensusAddrs, uint256[] amounts);\\n /// @dev Emitted when the contracts fails when distributing the amount of RON to the staking contract.\\n event StakingRewardDistributionFailed(uint256 totalAmount, address[] consensusAddrs, uint256[] amounts, uint256 contractBalance);\\n\\n /// @dev Emitted when the epoch is wrapped up.\\n event WrappedUpEpoch(uint256 indexed periodNumber, uint256 indexed epochNumber, bool periodEnding);\\n\\n /// @dev Error of only allowed at the end of epoch\\n error ErrAtEndOfEpochOnly();\\n /// @dev Error of query for already wrapped up epoch\\n error ErrAlreadyWrappedEpoch();\\n\\n /**\\n * @dev Submits reward of the current block.\\n *\\n * Requirements:\\n * - The method caller is coinbase.\\n *\\n * Emits the event `MiningRewardDeprecated` if the coinbase is slashed or no longer be a block producer.\\n * Emits the event `BlockRewardSubmitted` for the valid call.\\n *\\n */\\n function submitBlockReward() external payable;\\n\\n /**\\n * @dev Wraps up the current epoch.\\n *\\n * Requirements:\\n * - The method must be called when the current epoch is ending.\\n * - The epoch is not wrapped yet.\\n * - The method caller is coinbase.\\n *\\n * Emits the event `MiningRewardDistributed` when some validator has reward distributed.\\n * Emits the event `StakingRewardDistributed` when some staking pool has reward distributed.\\n * Emits the event `BlockProducerSetUpdated` when the epoch is wrapped up.\\n * Emits the event `BridgeOperatorSetUpdated` when the epoch is wrapped up at period ending.\\n * Emits the event `ValidatorSetUpdated` when the epoch is wrapped up at period ending, and the validator set gets updated.\\n * Emits the event `WrappedUpEpoch`.\\n *\\n */\\n function wrapUpEpoch() external payable;\\n}\\n\",\"keccak256\":\"0x3030ef01bb0277f8607fb3b6358a4cd1d75f6a756e5c884153fbf94f0a16b4d4\",\"license\":\"MIT\"},\"src/interfaces/validator/IEmergencyExit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface IEmergencyExit {\\n /// @dev Emitted when the fund is locked from an emergency exit request\\n event EmergencyExitRequested(address indexed consensusAddr, uint256 lockedAmount);\\n /// @dev Emitted when the fund that locked from an emergency exit request is transferred to the recipient.\\n event EmergencyExitLockedFundReleased(address indexed consensusAddr, address indexed recipient, uint256 unlockedAmount);\\n /// @dev Emitted when the fund that locked from an emergency exit request is failed to transferred back.\\n event EmergencyExitLockedFundReleasingFailed(address indexed consensusAddr, address indexed recipient, uint256 unlockedAmount, uint256 contractBalance);\\n\\n /// @dev Emitted when the emergency exit locked amount is updated.\\n event EmergencyExitLockedAmountUpdated(uint256 amount);\\n /// @dev Emitted when the emergency expiry duration is updated.\\n event EmergencyExpiryDurationUpdated(uint256 amount);\\n\\n /// @dev Error of already requested emergency exit before.\\n error ErrAlreadyRequestedEmergencyExit();\\n\\n /**\\n * @dev Returns the amount of RON to lock from a consensus address.\\n */\\n function emergencyExitLockedAmount() external returns (uint256);\\n\\n /**\\n * @dev Returns the duration that an emergency request is expired and the fund will be recycled.\\n */\\n function emergencyExpiryDuration() external returns (uint256);\\n\\n /**\\n * @dev Sets the amount of RON to lock from a consensus address.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the event `EmergencyExitLockedAmountUpdated`.\\n *\\n */\\n function setEmergencyExitLockedAmount(uint256 _emergencyExitLockedAmount) external;\\n\\n /**\\n * @dev Sets the duration that an emergency request is expired and the fund will be recycled.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the event `EmergencyExpiryDurationUpdated`.\\n *\\n */\\n function setEmergencyExpiryDuration(uint256 _emergencyExpiryDuration) external;\\n\\n /**\\n * @dev Unlocks fund for emergency exit request.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the event `EmergencyExitLockedFundReleased` if the fund is successfully unlocked.\\n * Emits the event `EmergencyExitLockedFundReleasingFailed` if the fund is failed to unlock.\\n *\\n */\\n function execReleaseLockedFundForEmergencyExitRequest(address _consensusAddr, address payable _recipient) external;\\n\\n /**\\n * @dev Fallback function of `IStaking-requestEmergencyExit`.\\n *\\n * Requirements:\\n * - The method caller is staking contract.\\n *\\n */\\n function execEmergencyExit(address _consensusAddr, uint256 _secLeftToRevoke) external;\\n}\\n\",\"keccak256\":\"0x2df640817e7fb957f923dd583e82be9610a8441735b69519db5bd9457683bec2\",\"license\":\"MIT\"},\"src/interfaces/validator/IRoninValidatorSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"./ICandidateManager.sol\\\";\\nimport \\\"./info-fragments/ICommonInfo.sol\\\";\\nimport \\\"./ICoinbaseExecution.sol\\\";\\nimport \\\"./ISlashingExecution.sol\\\";\\nimport \\\"./IEmergencyExit.sol\\\";\\n\\ninterface IRoninValidatorSet is ICandidateManager, ICommonInfo, ISlashingExecution, ICoinbaseExecution, IEmergencyExit { }\\n\",\"keccak256\":\"0x5ae53ab78a38d9c59d74b4723ead82146bc402874ebbdc90b70ce084516e010f\",\"license\":\"MIT\"},\"src/interfaces/validator/ISlashingExecution.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface ISlashingExecution {\\n /// @dev Emitted when the validator is punished.\\n event ValidatorPunished(\\n address indexed consensusAddr,\\n uint256 indexed period,\\n uint256 jailedUntil,\\n uint256 deductedStakingAmount,\\n bool blockProducerRewardDeprecated,\\n bool bridgeOperatorRewardDeprecated\\n );\\n /// @dev Emitted when the validator get out of jail by bailout.\\n event ValidatorUnjailed(address indexed validator, uint256 period);\\n\\n /// @dev Error of cannot bailout due to high tier slash.\\n error ErrCannotBailout(address validator);\\n\\n /**\\n * @dev Finalize the slash request from slash indicator contract.\\n *\\n * Requirements:\\n * - The method caller is slash indicator contract.\\n *\\n * Emits the event `ValidatorPunished`.\\n *\\n */\\n function execSlash(address validatorAddr, uint256 newJailedUntil, uint256 slashAmount, bool cannotBailout) external;\\n\\n /**\\n * @dev Finalize the bailout request from slash indicator contract.\\n *\\n * Requirements:\\n * - The method caller is slash indicator contract.\\n *\\n * Emits the event `ValidatorUnjailed`.\\n *\\n */\\n function execBailOut(address _validatorAddr, uint256 _period) external;\\n}\\n\",\"keccak256\":\"0xac0b772f2fca9dafd7cc6742f91b442f9f545bf9472185b8d817fe045b680193\",\"license\":\"MIT\"},\"src/interfaces/validator/info-fragments/ICommonInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"./IJailingInfo.sol\\\";\\nimport \\\"./ITimingInfo.sol\\\";\\n\\ninterface ICommonInfo is ITimingInfo, IJailingInfo {\\n struct EmergencyExitInfo {\\n uint256 lockedAmount;\\n // The timestamp that this locked amount will be recycled to staking vesting contract\\n uint256 recyclingAt;\\n }\\n\\n /// @dev Emitted when the deprecated reward is withdrawn.\\n event DeprecatedRewardRecycled(address indexed recipientAddr, uint256 amount);\\n /// @dev Emitted when the deprecated reward withdrawal is failed\\n event DeprecatedRewardRecycleFailed(address indexed recipientAddr, uint256 amount, uint256 balance);\\n\\n /// @dev Error thrown when receives RON from neither staking vesting contract nor staking contract\\n error ErrUnauthorizedReceiveRON();\\n /// @dev Error thrown when queries for a non existent info.\\n error NonExistentRecyclingInfo();\\n\\n /**\\n * @dev Returns the total deprecated reward, which includes reward that is not sent for slashed validators and unsastified bridge operators\\n */\\n function totalDeprecatedReward() external view returns (uint256);\\n\\n /**\\n * @dev Returns the emergency exit request.\\n */\\n function getEmergencyExitInfo(address _consensusAddr) external view returns (EmergencyExitInfo memory);\\n}\\n\",\"keccak256\":\"0x4a215273f535697ecf54a97c8fd9de9c666ca64b88dafe7ab60b2903f71ffb41\",\"license\":\"MIT\"},\"src/interfaces/validator/info-fragments/IJailingInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface IJailingInfo {\\n /**\\n * @dev Returns whether the validator are put in jail (cannot join the set of validators) during the current period.\\n */\\n function checkJailed(address) external view returns (bool);\\n\\n /**\\n * @dev Returns whether the validator are put in jail and the number of block and epoch that he still is in the jail.\\n */\\n function getJailedTimeLeft(address _addr) external view returns (bool isJailed_, uint256 blockLeft_, uint256 epochLeft_);\\n\\n /**\\n * @dev Returns whether the validator are put in jail (cannot join the set of validators) at a specific block.\\n */\\n function checkJailedAtBlock(address _addr, uint256 _blockNum) external view returns (bool);\\n\\n /**\\n * @dev Returns whether the validator are put in jail at a specific block and the number of block and epoch that he still is in the jail.\\n */\\n function getJailedTimeLeftAtBlock(address _addr, uint256 _blockNum) external view returns (bool isJailed_, uint256 blockLeft_, uint256 epochLeft_);\\n\\n /**\\n * @dev Returns whether the validators are put in jail (cannot join the set of validators) during the current period.\\n */\\n function checkManyJailed(address[] calldata) external view returns (bool[] memory);\\n\\n /**\\n * @dev Returns whether the incoming reward of the block producer is deprecated during the current period.\\n */\\n function checkMiningRewardDeprecated(address _blockProducer) external view returns (bool);\\n\\n /**\\n * @dev Returns whether the incoming reward of the block producer is deprecated during a specific period.\\n */\\n function checkMiningRewardDeprecatedAtPeriod(address _blockProducer, uint256 _period) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xd83e85bea11509406213b8d06956b33238d27fa1b5e555c1f064bdfd41d6d216\",\"license\":\"MIT\"},\"src/interfaces/validator/info-fragments/ITimingInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface ITimingInfo {\\n /**\\n * @dev Returns the block that validator set was updated.\\n */\\n function getLastUpdatedBlock() external view returns (uint256);\\n\\n /**\\n * @dev Returns the number of blocks in a epoch.\\n */\\n function numberOfBlocksInEpoch() external view returns (uint256 _numberOfBlocks);\\n\\n /**\\n * @dev Returns the epoch index from the block number.\\n */\\n function epochOf(uint256 _block) external view returns (uint256);\\n\\n /**\\n * @dev Returns whether the epoch ending is at the block number `_block`.\\n */\\n function epochEndingAt(uint256 _block) external view returns (bool);\\n\\n /**\\n * @dev Tries to get the period index from the epoch number.\\n */\\n function tryGetPeriodOfEpoch(uint256 _epoch) external view returns (bool _filled, uint256 _periodNumber);\\n\\n /**\\n * @dev Returns whether the period ending at the current block number.\\n */\\n function isPeriodEnding() external view returns (bool);\\n\\n /**\\n * @dev Returns the period index from the current block.\\n */\\n function currentPeriod() external view returns (uint256);\\n\\n /**\\n * @dev Returns the block number that the current period starts at.\\n */\\n function currentPeriodStartAtBlock() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x77b86a68149389fed0eb0c5b8d56f278d3bd103ba64f504697d709b24c3212d5\",\"license\":\"MIT\"},\"src/libraries/AddressArrayUtils.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\nlibrary AddressArrayUtils {\\n /**\\n * @dev Error thrown when a duplicated element is detected in an array.\\n * @param msgSig The function signature that invoke the error.\\n */\\n error ErrDuplicated(bytes4 msgSig);\\n\\n /**\\n * @dev Returns whether or not there's a duplicate. Runs in O(n^2).\\n * @param A Array to search\\n * @return Returns true if duplicate, false otherwise\\n */\\n function hasDuplicate(address[] memory A) internal pure returns (bool) {\\n if (A.length == 0) {\\n return false;\\n }\\n unchecked {\\n for (uint256 i = 0; i < A.length - 1; i++) {\\n for (uint256 j = i + 1; j < A.length; j++) {\\n if (A[i] == A[j]) {\\n return true;\\n }\\n }\\n }\\n }\\n return false;\\n }\\n\\n /**\\n * @dev Returns whether two arrays of addresses are equal or not.\\n */\\n function isEqual(address[] memory _this, address[] memory _other) internal pure returns (bool yes_) {\\n // Hashing two arrays and compare their hash\\n assembly {\\n let _thisHash := keccak256(add(_this, 32), mul(mload(_this), 32))\\n let _otherHash := keccak256(add(_other, 32), mul(mload(_other), 32))\\n yes_ := eq(_thisHash, _otherHash)\\n }\\n }\\n\\n /**\\n * @dev Return the concatenated array from a and b.\\n */\\n function extend(address[] memory a, address[] memory b) internal pure returns (address[] memory c) {\\n uint256 lengthA = a.length;\\n uint256 lengthB = b.length;\\n unchecked {\\n c = new address[](lengthA + lengthB);\\n }\\n uint256 i;\\n for (; i < lengthA;) {\\n c[i] = a[i];\\n unchecked {\\n ++i;\\n }\\n }\\n for (uint256 j; j < lengthB;) {\\n c[i] = b[j];\\n unchecked {\\n ++i;\\n ++j;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce5d578861167da47a965c8a0e1592b808aad6eb79ccb1873bf2e2280ddb85ee\",\"license\":\"UNLICENSED\"},\"src/libraries/Math.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\nlibrary Math {\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a >= b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns whether the number `c` is in range of [a; b].\\n */\\n function inRange(uint256 c, uint256 a, uint256 b) internal pure returns (bool) {\\n return a <= c && c <= b;\\n }\\n\\n /**\\n * @dev Returns whether two inclusive ranges [x1;x2] and [y1;y2] overlap.\\n */\\n function twoRangeOverlap(uint256 x1, uint256 x2, uint256 y1, uint256 y2) internal pure returns (bool) {\\n return x1 <= y2 && y1 <= x2;\\n }\\n\\n /**\\n * @dev Returns value of a + b; in case result is larger than upperbound, upperbound is returned.\\n */\\n function addWithUpperbound(uint256 a, uint256 b, uint256 upperbound) internal pure returns (uint256) {\\n return min(a + b, upperbound);\\n }\\n\\n /**\\n * @dev Returns value of a - b; in case of negative result, 0 is returned.\\n */\\n function subNonNegative(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a - b : 0;\\n }\\n\\n /**\\n * @dev Returns value of `a + zeroable` if zerobale is not 0; otherwise, return 0.\\n */\\n function addIfNonZero(uint256 a, uint256 zeroable) internal pure returns (uint256) {\\n return zeroable != 0 ? a + zeroable : 0;\\n }\\n}\\n\",\"keccak256\":\"0xd73170f448c644a47024c7dbcf4afc3cc7ad27f61737c6ea4c3b543ec5cdb7e9\",\"license\":\"UNLICENSED\"},\"src/ronin/gateway/BridgeSlash.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.17;\\n\\nimport { Initializable } from \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport { BridgeTrackingHelper } from \\\"../../extensions/bridge-operator-governance/BridgeTrackingHelper.sol\\\";\\nimport { IHasContracts, HasContracts } from \\\"../../extensions/collections/HasContracts.sol\\\";\\nimport { IBridgeSlash } from \\\"../../interfaces/bridge/IBridgeSlash.sol\\\";\\nimport { IERC165, IBridgeManagerCallback } from \\\"../../interfaces/bridge/IBridgeManagerCallback.sol\\\";\\nimport { IBridgeTracking } from \\\"../../interfaces/bridge/IBridgeTracking.sol\\\";\\nimport { IRoninValidatorSet } from \\\"../../interfaces/validator/IRoninValidatorSet.sol\\\";\\nimport { Math } from \\\"../../libraries/Math.sol\\\";\\nimport { ContractType } from \\\"../../utils/ContractType.sol\\\";\\nimport { IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\nimport { ErrLengthMismatch } from \\\"../../utils/CommonErrors.sol\\\";\\n\\n/**\\n * @title BridgeSlash\\n * @dev A contract that implements slashing functionality for bridge operators based on their availability.\\n */\\ncontract BridgeSlash is IBridgeSlash, IBridgeManagerCallback, BridgeTrackingHelper, IdentityGuard, Initializable, HasContracts {\\n /// @inheritdoc IBridgeSlash\\n uint256 public constant TIER_1_PENALTY_DURATION = 1;\\n /// @inheritdoc IBridgeSlash\\n uint256 public constant TIER_2_PENALTY_DURATION = 5;\\n /// @inheritdoc IBridgeSlash\\n uint256 public constant MINIMUM_VOTE_THRESHOLD = 50;\\n /// @inheritdoc IBridgeSlash\\n uint256 public constant REMOVE_DURATION_THRESHOLD = 30;\\n\\n /// @dev Tier 1 slashing threshold ratio is 10%\\n uint256 private constant TIER_1_THRESHOLD = 10_00;\\n /// @dev Tier 2 slashing threshold ratio is 30%\\n uint256 private constant TIER_2_THRESHOLD = 30_00;\\n /// @dev Max percentage 100%. Values [0; 100_00] reflexes [0; 100%]\\n uint256 private constant PERCENTAGE_FRACTION = 100_00;\\n /// @dev This value is set to the maximum value of uint128 to indicate a permanent slash duration.\\n uint256 private constant SLASH_PERMANENT_DURATION = type(uint128).max;\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeSlash.bridgeSlashInfos.slot\\\") - 1\\n bytes32 private constant BRIDGE_SLASH_INFOS_SLOT = 0xd08d185790a07c7b9b721e2713c8580010a57f31c72c16f6e80b831d0ee45bfe;\\n\\n /// @dev The period that the contract allows slashing.\\n uint256 internal _startedAtPeriod;\\n\\n /**\\n * @dev The modifier verifies if the `totalVote` is non-zero, indicating the presence of ballots for the period.\\n * @param totalVote The total number of ballots for the period.\\n */\\n modifier onlyPeriodHasEnoughVotes(uint256 totalVote) {\\n if (totalVote <= MINIMUM_VOTE_THRESHOLD) return;\\n _;\\n }\\n\\n modifier skipOnNotStarted(uint256 period) {\\n if (period < _startedAtPeriod) return;\\n _;\\n }\\n\\n constructor() payable {\\n _disableInitializers();\\n }\\n\\n function initialize(address validatorContract, address bridgeManagerContract, address bridgeTrackingContract, address dposGA) external initializer {\\n _setContract(ContractType.VALIDATOR, validatorContract);\\n _setContract(ContractType.BRIDGE_MANAGER, bridgeManagerContract);\\n _setContract(ContractType.BRIDGE_TRACKING, bridgeTrackingContract);\\n _setContract(ContractType.GOVERNANCE_ADMIN, dposGA);\\n _startedAtPeriod = type(uint256).max;\\n }\\n\\n /**\\n * @dev Helper for running upgrade script, required to only revoked once by the DPoS's governance admin.\\n */\\n function initializeREP2() external onlyContract(ContractType.GOVERNANCE_ADMIN) {\\n require(_startedAtPeriod == type(uint256).max, \\\"already init rep 2\\\");\\n _startedAtPeriod = IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod() + 1;\\n _setContract(ContractType.GOVERNANCE_ADMIN, address(0));\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallback\\n */\\n function onBridgeOperatorsAdded(\\n address[] calldata bridgeOperators,\\n uint96[] calldata, /* weights */\\n bool[] memory addeds\\n ) external onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) {\\n uint256 length = bridgeOperators.length;\\n if (length != addeds.length) revert ErrLengthMismatch(msg.sig);\\n if (length == 0) {\\n return IBridgeManagerCallback.onBridgeOperatorsAdded.selector;\\n }\\n\\n mapping(address => BridgeSlashInfo) storage _bridgeSlashInfos = _getBridgeSlashInfos();\\n uint256 currentPeriod = IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod();\\n\\n for (uint256 i; i < length;) {\\n unchecked {\\n if (addeds[i]) {\\n _bridgeSlashInfos[bridgeOperators[i]].newlyAddedAtPeriod = uint128(currentPeriod);\\n }\\n\\n ++i;\\n }\\n }\\n\\n return IBridgeManagerCallback.onBridgeOperatorsAdded.selector;\\n }\\n\\n /**\\n * @inheritdoc IBridgeSlash\\n */\\n function execSlashBridgeOperators(\\n address[] memory operators,\\n uint256[] memory ballots,\\n uint256 totalBallot,\\n uint256 totalVote,\\n uint256 period\\n ) external onlyContract(ContractType.BRIDGE_TRACKING) skipOnNotStarted(period) onlyPeriodHasEnoughVotes(totalVote) {\\n if (operators.length != ballots.length) revert ErrLengthMismatch(msg.sig);\\n if (operators.length == 0) return;\\n if (!_isValidBridgeTrackingResponse(totalBallot, totalVote, ballots)) {\\n emit BridgeTrackingIncorrectlyResponded();\\n return;\\n }\\n\\n // Get penalty durations for each slash tier.\\n uint256[] memory penaltyDurations = _getPenaltyDurations();\\n // Get the storage mapping for bridge slash information.\\n mapping(address => BridgeSlashInfo) storage _bridgeSlashInfos = _getBridgeSlashInfos();\\n\\n // Declare variables for iteration.\\n BridgeSlashInfo memory status;\\n uint256 slashUntilPeriod;\\n address bridgeOperator;\\n Tier tier;\\n\\n for (uint256 i; i < operators.length;) {\\n bridgeOperator = operators[i];\\n status = _bridgeSlashInfos[bridgeOperator];\\n\\n // Check if the bridge operator was added before the current period.\\n // Bridge operators added in current period will not be slashed.\\n if (status.newlyAddedAtPeriod < period) {\\n // Determine the slash tier for the bridge operator based on their ballots.\\n tier = _getSlashTier(ballots[i], totalVote);\\n\\n slashUntilPeriod = _calcSlashUntilPeriod(tier, period, status.slashUntilPeriod, penaltyDurations);\\n\\n // Check if the slash duration exceeds the threshold for removal.\\n if (_isSlashDurationMetRemovalThreshold(slashUntilPeriod, period)) {\\n slashUntilPeriod = SLASH_PERMANENT_DURATION;\\n emit RemovalRequested(period, bridgeOperator);\\n }\\n\\n // Emit the {BridgeSlashed} event if the tier is not Tier 0 and bridge operator will not be removed.\\n // Update the slash until period number for the bridge operator if the tier is not Tier 0.\\n if (tier != Tier.Tier0) {\\n if (slashUntilPeriod != SLASH_PERMANENT_DURATION) {\\n emit BridgeSlashed(tier, bridgeOperator, period, slashUntilPeriod);\\n }\\n\\n // Store updated slash until period\\n _bridgeSlashInfos[bridgeOperator].slashUntilPeriod = uint128(slashUntilPeriod);\\n }\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallback\\n */\\n function onBridgeOperatorsRemoved(address[] calldata, bool[] calldata) external view onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) {\\n return IBridgeManagerCallback.onBridgeOperatorsRemoved.selector;\\n }\\n\\n /**\\n * @inheritdoc IERC165\\n */\\n function supportsInterface(bytes4 interfaceId) external pure returns (bool) {\\n return interfaceId == type(IBridgeManagerCallback).interfaceId || interfaceId == type(IERC165).interfaceId;\\n }\\n\\n /**\\n * @inheritdoc IBridgeSlash\\n */\\n function getSlashUntilPeriodOf(address[] calldata bridgeOperators) external view returns (uint256[] memory untilPeriods) {\\n uint256 length = bridgeOperators.length;\\n untilPeriods = new uint256[](length);\\n mapping(address => BridgeSlashInfo) storage _bridgeSlashInfos = _getBridgeSlashInfos();\\n\\n for (uint256 i; i < length;) {\\n untilPeriods[i] = _bridgeSlashInfos[bridgeOperators[i]].slashUntilPeriod;\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeSlash\\n */\\n function getAddedPeriodOf(address[] calldata bridgeOperators) external view returns (uint256[] memory addedPeriods) {\\n uint256 length = bridgeOperators.length;\\n addedPeriods = new uint256[](length);\\n mapping(address => BridgeSlashInfo) storage _bridgeSlashInfos = _getBridgeSlashInfos();\\n\\n for (uint256 i; i < length;) {\\n addedPeriods[i] = _bridgeSlashInfos[bridgeOperators[i]].newlyAddedAtPeriod;\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeSlash\\n */\\n function getPenaltyDurations() external pure returns (uint256[] memory penaltyDurations) {\\n penaltyDurations = _getPenaltyDurations();\\n }\\n\\n /**\\n * @inheritdoc IBridgeSlash\\n */\\n function getSlashTier(uint256 ballot, uint256 totalVote) external pure returns (Tier tier) {\\n tier = _getSlashTier(ballot, totalVote);\\n }\\n\\n /**\\n * @dev Checks if the slash duration exceeds the threshold for removal and handles it accordingly.\\n * @param slashUntilPeriod The slash until period number.\\n * @param period The current period.\\n * @return met A boolean indicates that the threshold for removal is met.\\n */\\n function _isSlashDurationMetRemovalThreshold(uint256 slashUntilPeriod, uint256 period) internal pure returns (bool met) {\\n met = slashUntilPeriod - (period - 1) >= REMOVE_DURATION_THRESHOLD;\\n }\\n\\n /**\\n * @dev Calculates the slash until period based on the specified tier, current period, and slash until period.\\n * @param tier The slash tier representing the severity of the slash.\\n * @param period The current period in which the calculation is performed.\\n * @param slashUntilPeriod The existing slash until period.\\n * @param penaltyDurations An array of penalty durations for each slash tier.\\n * @return newSlashUntilPeriod The newly calculated slash until period.\\n */\\n function _calcSlashUntilPeriod(\\n Tier tier,\\n uint256 period,\\n uint256 slashUntilPeriod,\\n uint256[] memory penaltyDurations\\n ) internal pure returns (uint256 newSlashUntilPeriod) {\\n // Calculate the slash until period number.\\n newSlashUntilPeriod = penaltyDurations[uint8(tier)] + Math.max(period - 1, slashUntilPeriod);\\n }\\n\\n /**\\n * @dev Internal function to determine the slashing tier based on the given ballot count and total votes.\\n * @param ballot The individual ballot count of a bridge operator.\\n * @param totalVote The total number of votes recorded for the bridge operator.\\n * @return tier The calculated slashing tier for the bridge operator.\\n * @notice The `ratio` is calculated as the percentage of uncast votes (totalVote - ballot) relative to the total votes.\\n */\\n function _getSlashTier(uint256 ballot, uint256 totalVote) internal pure virtual returns (Tier tier) {\\n uint256 ratio = ((totalVote - ballot) * PERCENTAGE_FRACTION) / totalVote;\\n tier = ratio > TIER_2_THRESHOLD ? Tier.Tier2 : ratio > TIER_1_THRESHOLD ? Tier.Tier1 : Tier.Tier0;\\n }\\n\\n /**\\n * @dev Internal function to access the mapping from bridge operator => BridgeSlashInfo.\\n * @return bridgeSlashInfos the mapping from bridge operator => BridgeSlashInfo.\\n */\\n function _getBridgeSlashInfos() internal pure returns (mapping(address => BridgeSlashInfo) storage bridgeSlashInfos) {\\n assembly (\\\"memory-safe\\\") {\\n bridgeSlashInfos.slot := BRIDGE_SLASH_INFOS_SLOT\\n }\\n }\\n\\n /**\\n * @dev Internal function to retrieve the penalty durations for each slashing tier.\\n * @return penaltyDurations An array containing the penalty durations for Tier0, Tier1, and Tier2 in that order.\\n */\\n function _getPenaltyDurations() internal pure virtual returns (uint256[] memory penaltyDurations) {\\n // reserve index 0\\n penaltyDurations = new uint256[](3);\\n penaltyDurations[uint8(Tier.Tier1)] = TIER_1_PENALTY_DURATION;\\n penaltyDurations[uint8(Tier.Tier2)] = TIER_2_PENALTY_DURATION;\\n }\\n}\\n\",\"keccak256\":\"0x6734513b44a11197c1719065b77afaae24d504009fc7faafba76a162cc0efdff\",\"license\":\"MIT\"},\"src/utils/CommonErrors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ContractType } from \\\"./ContractType.sol\\\";\\nimport { RoleAccess } from \\\"./RoleAccess.sol\\\";\\n\\nerror ErrSyncTooFarPeriod(uint256 period, uint256 latestRewardedPeriod);\\n/**\\n * @dev Error thrown when an address is expected to be an already created externally owned account (EOA).\\n * This error indicates that the provided address is invalid for certain contract operations that require already created EOA.\\n */\\nerror ErrAddressIsNotCreatedEOA(address addr, bytes32 codehash);\\n/**\\n * @dev Error raised when a bridge operator update operation fails.\\n * @param bridgeOperator The address of the bridge operator that failed to update.\\n */\\nerror ErrBridgeOperatorUpdateFailed(address bridgeOperator);\\n/**\\n * @dev Error thrown when attempting to add a bridge operator that already exists in the contract.\\n * This error indicates that the provided bridge operator address is already registered as a bridge operator in the contract.\\n */\\nerror ErrBridgeOperatorAlreadyExisted(address bridgeOperator);\\n/**\\n * @dev The error indicating an unsupported interface.\\n * @param interfaceId The bytes4 interface identifier that is not supported.\\n * @param addr The address where the unsupported interface was encountered.\\n */\\nerror ErrUnsupportedInterface(bytes4 interfaceId, address addr);\\n/**\\n * @dev Error thrown when the return data from a callback function is invalid.\\n * @param callbackFnSig The signature of the callback function that returned invalid data.\\n * @param register The address of the register where the callback function was invoked.\\n * @param returnData The invalid return data received from the callback function.\\n */\\nerror ErrInvalidReturnData(bytes4 callbackFnSig, address register, bytes returnData);\\n/**\\n * @dev Error of set to non-contract.\\n */\\nerror ErrZeroCodeContract(address addr);\\n/**\\n * @dev Error indicating that arguments are invalid.\\n */\\nerror ErrInvalidArguments(bytes4 msgSig);\\n/**\\n * @dev Error indicating that given address is null when it should not.\\n */\\nerror ErrZeroAddress(bytes4 msgSig);\\n/**\\n * @dev Error indicating that the provided threshold is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that the invalid threshold applies to.\\n */\\nerror ErrInvalidThreshold(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a function can only be called by the contract itself.\\n * @param msgSig The function signature (bytes4) that can only be called by the contract itself.\\n */\\nerror ErrOnlySelfCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n * @param expectedRole The role required to perform the function.\\n */\\nerror ErrUnauthorized(bytes4 msgSig, RoleAccess expectedRole);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n */\\nerror ErrUnauthorizedCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4).\\n * @param expectedContractType The contract type required to perform the function.\\n * @param actual The actual address that called to the function.\\n */\\nerror ErrUnexpectedInternalCall(bytes4 msgSig, ContractType expectedContractType, address actual);\\n\\n/**\\n * @dev Error indicating that an array is empty when it should contain elements.\\n */\\nerror ErrEmptyArray();\\n\\n/**\\n * @dev Error indicating a mismatch in the length of input parameters or arrays for a specific function.\\n * @param msgSig The function signature (bytes4) that has a length mismatch.\\n */\\nerror ErrLengthMismatch(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a proxy call to an external contract has failed.\\n * @param msgSig The function signature (bytes4) of the proxy call that failed.\\n * @param extCallSig The function signature (bytes4) of the external contract call that failed.\\n */\\nerror ErrProxyCallFailed(bytes4 msgSig, bytes4 extCallSig);\\n\\n/**\\n * @dev Error indicating that a function tried to call a precompiled contract that is not allowed.\\n * @param msgSig The function signature (bytes4) that attempted to call a precompiled contract.\\n */\\nerror ErrCallPrecompiled(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a native token transfer has failed.\\n * @param msgSig The function signature (bytes4) of the token transfer that failed.\\n */\\nerror ErrNativeTransferFailed(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that an order is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid order.\\n */\\nerror ErrInvalidOrder(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the chain ID is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid chain ID.\\n * @param actual Current chain ID that executing function.\\n * @param expected Expected chain ID required for the tx to success.\\n */\\nerror ErrInvalidChainId(bytes4 msgSig, uint256 actual, uint256 expected);\\n\\n/**\\n * @dev Error indicating that a vote type is not supported.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an unsupported vote type.\\n */\\nerror ErrUnsupportedVoteType(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the proposal nonce is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid proposal nonce.\\n */\\nerror ErrInvalidProposalNonce(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a voter has already voted.\\n * @param voter The address of the voter who has already voted.\\n */\\nerror ErrAlreadyVoted(address voter);\\n\\n/**\\n * @dev Error indicating that a signature is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid signature.\\n */\\nerror ErrInvalidSignatures(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a relay call has failed.\\n * @param msgSig The function signature (bytes4) of the relay call that failed.\\n */\\nerror ErrRelayFailed(bytes4 msgSig);\\n/**\\n * @dev Error indicating that a vote weight is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid vote weight.\\n */\\nerror ErrInvalidVoteWeight(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a query was made for an outdated bridge operator set.\\n */\\nerror ErrQueryForOutdatedBridgeOperatorSet();\\n\\n/**\\n * @dev Error indicating that a request is invalid.\\n */\\nerror ErrInvalidRequest();\\n\\n/**\\n * @dev Error indicating that a token standard is invalid.\\n */\\nerror ErrInvalidTokenStandard();\\n\\n/**\\n * @dev Error indicating that a token is not supported.\\n */\\nerror ErrUnsupportedToken();\\n\\n/**\\n * @dev Error indicating that a receipt kind is invalid.\\n */\\nerror ErrInvalidReceiptKind();\\n\\n/**\\n * @dev Error indicating that a receipt is invalid.\\n */\\nerror ErrInvalidReceipt();\\n\\n/**\\n * @dev Error indicating that an address is not payable.\\n */\\nerror ErrNonpayableAddress(address);\\n\\n/**\\n * @dev Error indicating that the period is already processed, i.e. scattered reward.\\n */\\nerror ErrPeriodAlreadyProcessed(uint256 requestingPeriod, uint256 latestPeriod);\\n\\n/**\\n * @dev Error thrown when an invalid vote hash is provided.\\n */\\nerror ErrInvalidVoteHash();\\n\\n/**\\n * @dev Error thrown when querying for an empty vote.\\n */\\nerror ErrQueryForEmptyVote();\\n\\n/**\\n * @dev Error thrown when querying for an expired vote.\\n */\\nerror ErrQueryForExpiredVote();\\n\\n/**\\n * @dev Error thrown when querying for a non-existent vote.\\n */\\nerror ErrQueryForNonExistentVote();\\n\\n/**\\n * @dev Error indicating that the method is only called once per block.\\n */\\nerror ErrOncePerBlock();\\n\\n/**\\n * @dev Error of method caller must be coinbase\\n */\\nerror ErrCallerMustBeCoinbase();\\n\\n/**\\n * @dev Error thrown when an invalid proposal is encountered.\\n * @param actual The actual value of the proposal.\\n * @param expected The expected value of the proposal.\\n */\\nerror ErrInvalidProposal(bytes32 actual, bytes32 expected);\\n\\n/**\\n * @dev Error of proposal is not approved for executing.\\n */\\nerror ErrProposalNotApproved();\\n\\n/**\\n * @dev Error of the caller is not the specified executor.\\n */\\nerror ErrInvalidExecutor();\\n\\n/**\\n * @dev Error of the `caller` to relay is not the specified `executor`.\\n */\\nerror ErrNonExecutorCannotRelay(address executor, address caller);\\n\",\"keccak256\":\"0x0d9e2fd98f6b704273faad707ed9eadbd4c79551ee3f902bff5b29213a204679\",\"license\":\"MIT\"},\"src/utils/ContractType.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum ContractType {\\n UNKNOWN, // 0\\n PAUSE_ENFORCER, // 1\\n BRIDGE, // 2\\n BRIDGE_TRACKING, // 3\\n GOVERNANCE_ADMIN, // 4\\n MAINTENANCE, // 5\\n SLASH_INDICATOR, // 6\\n STAKING_VESTING, // 7\\n VALIDATOR, // 8\\n STAKING, // 9\\n RONIN_TRUSTED_ORGANIZATION, // 10\\n BRIDGE_MANAGER, // 11\\n BRIDGE_SLASH, // 12\\n BRIDGE_REWARD, // 13\\n FAST_FINALITY_TRACKING, // 14\\n PROFILE // 15\\n\\n}\\n\",\"keccak256\":\"0xec088aa939cd885dbe84e944942d7ea674e1fff8802c1f2ae5d8e84e4578357d\",\"license\":\"MIT\"},\"src/utils/IdentityGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { AddressArrayUtils } from \\\"../libraries/AddressArrayUtils.sol\\\";\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport { TransparentUpgradeableProxyV2 } from \\\"../extensions/TransparentUpgradeableProxyV2.sol\\\";\\nimport { ErrAddressIsNotCreatedEOA, ErrZeroAddress, ErrOnlySelfCall, ErrZeroCodeContract, ErrUnsupportedInterface } from \\\"./CommonErrors.sol\\\";\\n\\nabstract contract IdentityGuard {\\n using AddressArrayUtils for address[];\\n\\n /// @dev value is equal to keccak256(abi.encode())\\n /// @dev see: https://eips.ethereum.org/EIPS/eip-1052\\n bytes32 internal constant CREATED_ACCOUNT_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\\n\\n /**\\n * @dev Modifier to restrict functions to only be called by this contract.\\n * @dev Reverts if the caller is not this contract.\\n */\\n modifier onlySelfCall() virtual {\\n _requireSelfCall();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to ensure that the elements in the `arr` array are non-duplicates.\\n * It calls the internal `_checkDuplicate` function to perform the duplicate check.\\n *\\n * Requirements:\\n * - The elements in the `arr` array must not contain any duplicates.\\n */\\n modifier nonDuplicate(address[] memory arr) virtual {\\n _requireNonDuplicate(arr);\\n _;\\n }\\n\\n /**\\n * @dev Internal method to check the method caller.\\n * @dev Reverts if the method caller is not this contract.\\n */\\n function _requireSelfCall() internal view virtual {\\n if (msg.sender != address(this)) revert ErrOnlySelfCall(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to check if a contract address has code.\\n * @param addr The address of the contract to check.\\n * @dev Throws an error if the contract address has no code.\\n */\\n function _requireHasCode(address addr) internal view {\\n if (addr.code.length == 0) revert ErrZeroCodeContract(addr);\\n }\\n\\n /**\\n * @dev Checks if an address is zero and reverts if it is.\\n * @param addr The address to check.\\n */\\n function _requireNonZeroAddress(address addr) internal pure {\\n if (addr == address(0)) revert ErrZeroAddress(msg.sig);\\n }\\n\\n /**\\n * @dev Check if arr is empty and revert if it is.\\n * Checks if an array contains any duplicate addresses and reverts if duplicates are found.\\n * @param arr The array of addresses to check.\\n */\\n function _requireNonDuplicate(address[] memory arr) internal pure {\\n if (arr.hasDuplicate()) revert AddressArrayUtils.ErrDuplicated(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to require that the provided address is a created externally owned account (EOA).\\n * This internal function is used to ensure that the provided address is a valid externally owned account (EOA).\\n * It checks the codehash of the address against a predefined constant to confirm that the address is a created EOA.\\n * @notice This method only works with non-state EOA accounts\\n */\\n function _requireCreatedEOA(address addr) internal view {\\n _requireNonZeroAddress(addr);\\n bytes32 codehash = addr.codehash;\\n if (codehash != CREATED_ACCOUNT_HASH) revert ErrAddressIsNotCreatedEOA(addr, codehash);\\n }\\n\\n /**\\n * @dev Internal function to require that the specified contract supports the given interface. This method handle in\\n * both case that the callee is either or not the proxy admin of the caller. If the contract does not support the\\n * interface `interfaceId` or EIP165, a revert with the corresponding error message is triggered.\\n *\\n * @param contractAddr The address of the contract to check for interface support.\\n * @param interfaceId The interface ID to check for support.\\n */\\n function _requireSupportsInterface(address contractAddr, bytes4 interfaceId) internal view {\\n bytes memory supportsInterfaceParams = abi.encodeCall(IERC165.supportsInterface, (interfaceId));\\n (bool success, bytes memory returnOrRevertData) = contractAddr.staticcall(supportsInterfaceParams);\\n if (!success) {\\n (success, returnOrRevertData) = contractAddr.staticcall(abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (supportsInterfaceParams)));\\n if (!success) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n if (!abi.decode(returnOrRevertData, (bool))) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n}\\n\",\"keccak256\":\"0x546ab4c9cdb0e7f8e650f140349225305ba1d0706dcaceeb9180c96aa765da59\",\"license\":\"MIT\"},\"src/utils/RoleAccess.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum RoleAccess {\\n UNKNOWN, // 0\\n ADMIN, // 1\\n COINBASE, // 2\\n GOVERNOR, // 3\\n CANDIDATE_ADMIN, // 4\\n WITHDRAWAL_MIGRATOR, // 5\\n __DEPRECATED_BRIDGE_OPERATOR, // 6\\n BLOCK_PRODUCER, // 7\\n VALIDATOR_CANDIDATE, // 8\\n CONSENSUS, // 9\\n TREASURY // 10\\n\\n}\\n\",\"keccak256\":\"0x671ff40dd874c508c4b3879a580996c7987fc018669256f47151e420a55c0e51\",\"license\":\"MIT\"}},\"version\":1}", + "nonce": 192809, + "numDeployments": 2, "storageLayout": { "storage": [ { - "astId": 1373, - "contract": "contracts/ronin/gateway/BridgeSlash.sol:BridgeSlash", + "astId": 58190, + "contract": "src/ronin/gateway/BridgeSlash.sol:BridgeSlash", "label": "_initialized", "offset": 0, "slot": "0", "type": "t_uint8" }, { - "astId": 1376, - "contract": "contracts/ronin/gateway/BridgeSlash.sol:BridgeSlash", + "astId": 58193, + "contract": "src/ronin/gateway/BridgeSlash.sol:BridgeSlash", "label": "_initializing", "offset": 1, "slot": "0", "type": "t_bool" + }, + { + "astId": 118766, + "contract": "src/ronin/gateway/BridgeSlash.sol:BridgeSlash", + "label": "_startedAtPeriod", + "offset": 0, + "slot": "1", + "type": "t_uint256" } ], "types": { @@ -728,11 +670,21 @@ "label": "bool", "numberOfBytes": "1" }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, "t_uint8": { "encoding": "inplace", "label": "uint8", "numberOfBytes": "1" } } + }, + "timestamp": 1713251844, + "userdoc": { + "version": 1, + "kind": "user" } } \ No newline at end of file diff --git a/deployments/ronin-testnet/BridgeTrackingLogic.json b/deployments/ronin-testnet/BridgeTrackingLogic.json index 8696fc26..c4b1a225 100644 --- a/deployments/ronin-testnet/BridgeTrackingLogic.json +++ b/deployments/ronin-testnet/BridgeTrackingLogic.json @@ -1,425 +1,380 @@ { - "address": "0xE9C6e1691Db4c75d48744F32CB80B9Bf0829A4f6", "abi": [ { + "type": "constructor", "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "enum ContractType", - "name": "contractType", - "type": "uint8" - } - ], - "name": "ErrContractTypeNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" - }, - { - "internalType": "enum RoleAccess", - "name": "expectedRole", - "type": "uint8" - } - ], - "name": "ErrUnauthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" - }, - { - "internalType": "enum ContractType", - "name": "expectedContractType", - "type": "uint8" - }, - { - "internalType": "address", - "name": "actual", - "type": "address" - } - ], - "name": "ErrUnexpectedInternalCall", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "ErrZeroCodeContract", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "enum ContractType", - "name": "contractType", - "type": "uint8" - }, - { - "indexed": true, - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "ContractUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": true, - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "reason", - "type": "bytes" - } - ], - "name": "ExternalCallFailed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "getContract", "inputs": [ { - "internalType": "enum ContractType", "name": "contractType", - "type": "uint8" + "type": "uint8", + "internalType": "enum ContractType" } ], - "name": "getContract", "outputs": [ { - "internalType": "address", "name": "contract_", - "type": "address" + "type": "address", + "internalType": "address" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getManyTotalBallots", "inputs": [ { - "internalType": "uint256", "name": "period", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "address[]", "name": "operators", - "type": "address[]" + "type": "address[]", + "internalType": "address[]" } ], - "name": "getManyTotalBallots", "outputs": [ { - "internalType": "uint256[]", "name": "_res", - "type": "uint256[]" + "type": "uint256[]", + "internalType": "uint256[]" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "handleVoteApproved", "inputs": [ { - "internalType": "enum IBridgeTracking.VoteKind", "name": "kind", - "type": "uint8" + "type": "uint8", + "internalType": "enum IBridgeTracking.VoteKind" }, { - "internalType": "uint256", "name": "requestId", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "handleVoteApproved", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "initialize", "inputs": [ { - "internalType": "address", "name": "bridgeContract", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "validatorContract", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "startedAtBlock_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "initialize", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "initializeREP2", "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", "name": "initializeV2", + "inputs": [], "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "initializeV3", "inputs": [ { - "internalType": "address", "name": "bridgeManager", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "bridgeSlash", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "bridgeReward", - "type": "address" + "type": "address", + "internalType": "address" + }, + { + "name": "dposGA", + "type": "address", + "internalType": "address" } ], - "name": "initializeV3", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "recordVote", "inputs": [ { - "internalType": "enum IBridgeTracking.VoteKind", "name": "kind", - "type": "uint8" + "type": "uint8", + "internalType": "enum IBridgeTracking.VoteKind" }, { - "internalType": "uint256", "name": "requestId", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "address", "name": "operator", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "recordVote", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "setContract", "inputs": [ { - "internalType": "enum ContractType", "name": "contractType", - "type": "uint8" + "type": "uint8", + "internalType": "enum ContractType" }, { - "internalType": "address", "name": "addr", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "setContract", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { - "inputs": [], + "type": "function", "name": "startedAtBlock", + "inputs": [], "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "totalBallot", "inputs": [ { - "internalType": "uint256", "name": "period", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "totalBallot", "outputs": [ { - "internalType": "uint256", "name": "totalBallot_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "totalBallotOf", "inputs": [ { - "internalType": "uint256", "name": "period", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "address", "name": "bridgeOperator", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "totalBallotOf", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "totalVote", "inputs": [ { - "internalType": "uint256", "name": "period", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "totalVote", "outputs": [ { - "internalType": "uint256", "name": "totalVote_", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0xe2cdb0009dc7ae5ddf05c63e5102501b8454a1f193fdef41fa3fcd8f1b2a659b", - "receipt": { - "to": null, - "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", - "contractAddress": "0xE9C6e1691Db4c75d48744F32CB80B9Bf0829A4f6", - "transactionIndex": 0, - "gasUsed": "1523940", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000100000000000000000000040000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000", - "blockHash": "0xe55096fbb487370165a68aebc612e3261ce483f206b6817c8b13088fe3a3bf7d", - "transactionHash": "0xe2cdb0009dc7ae5ddf05c63e5102501b8454a1f193fdef41fa3fcd8f1b2a659b", - "logs": [ - { - "transactionIndex": 0, - "blockNumber": 19042842, - "transactionHash": "0xe2cdb0009dc7ae5ddf05c63e5102501b8454a1f193fdef41fa3fcd8f1b2a659b", - "address": "0xE9C6e1691Db4c75d48744F32CB80B9Bf0829A4f6", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", - "logIndex": 0, - "blockHash": "0xe55096fbb487370165a68aebc612e3261ce483f206b6817c8b13088fe3a3bf7d" - } - ], - "blockNumber": 19042842, - "cumulativeGasUsed": "1523940", - "status": 1, - "byzantium": true - }, - "args": [], - "numDeployments": 8, - "solcInputHash": "04a9bbd243a024f931581fbb384106a3", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"ErrContractTypeNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum RoleAccess\",\"name\":\"expectedRole\",\"type\":\"uint8\"}],\"name\":\"ErrUnauthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum ContractType\",\"name\":\"expectedContractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"actual\",\"type\":\"address\"}],\"name\":\"ErrUnexpectedInternalCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrZeroCodeContract\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ContractUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"reason\",\"type\":\"bytes\"}],\"name\":\"ExternalCallFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"getContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"contract_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"period\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"operators\",\"type\":\"address[]\"}],\"name\":\"getManyTotalBallots\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"_res\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum IBridgeTracking.VoteKind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"name\":\"handleVoteApproved\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeContract\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"validatorContract\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"startedAtBlock_\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initializeV2\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeManager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"bridgeSlash\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"bridgeReward\",\"type\":\"address\"}],\"name\":\"initializeV3\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum IBridgeTracking.VoteKind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"recordVote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startedAtBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"period\",\"type\":\"uint256\"}],\"name\":\"totalBallot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"totalBallot_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"period\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"bridgeOperator\",\"type\":\"address\"}],\"name\":\"totalBallotOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"period\",\"type\":\"uint256\"}],\"name\":\"totalVote\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"totalVote_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"ErrContractTypeNotFound(uint8)\":[{\"details\":\"Error of invalid role.\"}],\"ErrUnauthorized(bytes4,uint8)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"expectedRole\":\"The role required to perform the function.\",\"msgSig\":\"The function signature (bytes4) that the caller is unauthorized to perform.\"}}],\"ErrUnexpectedInternalCall(bytes4,uint8,address)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"actual\":\"The actual address that called to the function.\",\"expectedContractType\":\"The contract type required to perform the function.\",\"msgSig\":\"The function signature (bytes4).\"}}],\"ErrZeroCodeContract(address)\":[{\"details\":\"Error of set to non-contract.\"}]},\"kind\":\"dev\",\"methods\":{\"getContract(uint8)\":{\"details\":\"Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.\",\"params\":{\"contractType\":\"The role of the contract to retrieve.\"},\"returns\":{\"contract_\":\"The address of the contract with the specified role.\"}},\"getManyTotalBallots(uint256,address[])\":{\"details\":\"Returns the total number of ballots of bridge operators at the specific period `_period`.\"},\"handleVoteApproved(uint8,uint256)\":{\"details\":\"Handles the request once it is approved. Requirements: - The method caller is the bridge contract.\"},\"initialize(address,address,uint256)\":{\"details\":\"Initializes the contract storage.\"},\"recordVote(uint8,uint256,address)\":{\"details\":\"Records vote for a receipt and a operator. Requirements: - The method caller is the bridge contract.\"},\"setContract(uint8,address)\":{\"details\":\"Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.\",\"params\":{\"addr\":\"The address of the contract to set.\",\"contractType\":\"The role of the contract to set.\"}},\"startedAtBlock()\":{\"details\":\"Returns the block that allow incomming mutable call.\"},\"totalBallot(uint256)\":{\"details\":\"Returns the total number of ballots at the specific period `_period`.\"},\"totalBallotOf(uint256,address)\":{\"details\":\"Returns the total number of ballots of a bridge operator at the specific period `_period`.\"},\"totalVote(uint256)\":{\"details\":\"Returns the total number of votes at the specific period `_period`.\"}},\"stateVariables\":{\"_bufferMetric\":{\"details\":\"The temporary info of votes and ballots\"},\"_lastSyncPeriod\":{\"details\":\"The latest period that get synced with bridge's slashing and rewarding contract\"},\"_periodMetric\":{\"details\":\"Mapping from period number => vote stats based on period\"},\"_receiptTrackingInfo\":{\"details\":\"Mapping from vote kind => receipt id => receipt stats\"},\"_startedAtBlock\":{\"details\":\"The block that the contract allows incoming mutable calls.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/ronin/gateway/BridgeTracking.sol\":\"BridgeTracking\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"none\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2a21b14ff90012878752f230d3ffd5c3405e5938d06c97a7d89c0a64561d0d66\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"contracts/extensions/collections/HasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { HasProxyAdmin } from \\\"./HasProxyAdmin.sol\\\";\\nimport \\\"../../interfaces/collections/IHasContracts.sol\\\";\\nimport { IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\nimport { ErrUnexpectedInternalCall } from \\\"../../utils/CommonErrors.sol\\\";\\n\\n/**\\n * @title HasContracts\\n * @dev A contract that provides functionality to manage multiple contracts with different roles.\\n */\\nabstract contract HasContracts is HasProxyAdmin, IHasContracts, IdentityGuard {\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.collections.HasContracts.slot\\\") - 1\\n bytes32 private constant _STORAGE_SLOT = 0xdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb;\\n\\n /**\\n * @dev Modifier to restrict access to functions only to contracts with a specific role.\\n * @param contractType The contract type that allowed to call\\n */\\n modifier onlyContract(ContractType contractType) virtual {\\n _requireContract(contractType);\\n _;\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function setContract(ContractType contractType, address addr) external virtual onlyAdmin {\\n _requireHasCode(addr);\\n _setContract(contractType, addr);\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function getContract(ContractType contractType) public view returns (address contract_) {\\n contract_ = _getContractMap()[uint8(contractType)];\\n if (contract_ == address(0)) revert ErrContractTypeNotFound(contractType);\\n }\\n\\n /**\\n * @dev Internal function to set the address of a contract with a specific role.\\n * @param contractType The contract type of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function _setContract(ContractType contractType, address addr) internal virtual {\\n _getContractMap()[uint8(contractType)] = addr;\\n emit ContractUpdated(contractType, addr);\\n }\\n\\n /**\\n * @dev Internal function to access the mapping of contract addresses with roles.\\n * @return contracts_ The mapping of contract addresses with roles.\\n */\\n function _getContractMap() private pure returns (mapping(uint8 => address) storage contracts_) {\\n assembly {\\n contracts_.slot := _STORAGE_SLOT\\n }\\n }\\n\\n /**\\n * @dev Internal function to check if the calling contract has a specific role.\\n * @param contractType The contract type that the calling contract must have.\\n * @dev Throws an error if the calling contract does not have the specified role.\\n */\\n function _requireContract(ContractType contractType) private view {\\n if (msg.sender != getContract(contractType)) {\\n revert ErrUnexpectedInternalCall(msg.sig, contractType, msg.sender);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9e1dceb68827adfb8c8184662f29ab5fe14e292a632878150e3b0b6c61bc1dce\",\"license\":\"MIT\"},\"contracts/extensions/collections/HasProxyAdmin.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/StorageSlot.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\n\\nabstract contract HasProxyAdmin {\\n // bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n modifier onlyAdmin() {\\n _requireAdmin();\\n _;\\n }\\n\\n /**\\n * @dev Returns proxy admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n function _requireAdmin() internal view {\\n if (msg.sender != _getAdmin()) revert ErrUnauthorized(msg.sig, RoleAccess.ADMIN);\\n }\\n}\\n\",\"keccak256\":\"0x06e5962713a77abf6d5ba646e1cc1cfb6f9c50e7d52520dd82a10bf309534187\",\"license\":\"MIT\"},\"contracts/interfaces/bridge/IBridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IBridgeManagerEvents } from \\\"./events/IBridgeManagerEvents.sol\\\";\\n\\n/**\\n * @title IBridgeManager\\n * @dev The interface for managing bridge operators.\\n */\\ninterface IBridgeManager is IBridgeManagerEvents {\\n /**\\n * @dev The domain separator used for computing hash digests in the contract.\\n */\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n\\n /**\\n * @dev Returns the total number of bridge operators.\\n * @return The total number of bridge operators.\\n */\\n function totalBridgeOperators() external view returns (uint256);\\n\\n /**\\n * @dev Checks if the given address is a bridge operator.\\n * @param addr The address to check.\\n * @return A boolean indicating whether the address is a bridge operator.\\n */\\n function isBridgeOperator(address addr) external view returns (bool);\\n\\n /**\\n * @dev Retrieves the full information of all registered bridge operators.\\n *\\n * This external function allows external callers to obtain the full information of all the registered bridge operators.\\n * The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.\\n *\\n * @return governors An array of addresses representing the governors of each bridge operator.\\n * @return bridgeOperators An array of addresses representing the registered bridge operators.\\n * @return weights An array of uint256 values representing the vote weights of each bridge operator.\\n *\\n * Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator.\\n *\\n * Example Usage:\\n * ```\\n * (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos();\\n * for (uint256 i = 0; i < bridgeOperators.length; i++) {\\n * // Access individual information for each bridge operator.\\n * address governor = governors[i];\\n * address bridgeOperator = bridgeOperators[i];\\n * uint256 weight = weights[i];\\n * // ... (Process or use the information as required) ...\\n * }\\n * ```\\n *\\n */\\n function getFullBridgeOperatorInfos()\\n external\\n view\\n returns (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights);\\n\\n /**\\n * @dev Returns total weights of the governor list.\\n */\\n function sumGovernorsWeight(address[] calldata governors) external view returns (uint256 sum);\\n\\n /**\\n * @dev Returns total weights.\\n */\\n function getTotalWeights() external view returns (uint256);\\n\\n /**\\n * @dev Returns an array of all bridge operators.\\n * @return An array containing the addresses of all bridge operators.\\n */\\n function getBridgeOperators() external view returns (address[] memory);\\n\\n /**\\n * @dev Returns an array of bridge operators correspoding to governor addresses.\\n * @return bridgeOperators_ An array containing the addresses of all bridge operators.\\n */\\n function getBridgeOperatorOf(address[] calldata gorvernors) external view returns (address[] memory bridgeOperators_);\\n\\n /**\\n * @dev Retrieves the governors corresponding to a given array of bridge operators.\\n * This external function allows external callers to obtain the governors associated with a given array of bridge operators.\\n * The function takes an input array `bridgeOperators` containing bridge operator addresses and returns an array of corresponding governors.\\n * @param bridgeOperators An array of bridge operator addresses for which governors are to be retrieved.\\n * @return governors An array of addresses representing the governors corresponding to the provided bridge operators.\\n */\\n function getGovernorsOf(address[] calldata bridgeOperators) external view returns (address[] memory governors);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific governor.\\n * @param governor The address of the governor to get the vote weight for.\\n * @return voteWeight The vote weight of the specified governor.\\n */\\n function getGovernorWeight(address governor) external view returns (uint256);\\n\\n /**\\n * @dev External function to retrieve the vote weights of multiple bridge operators.\\n * @param bridgeOperators An array containing the addresses of bridge operators to get the vote weights for.\\n * @return weights An array of vote weights corresponding to the provided bridge operators.\\n */\\n function getBridgeOperatorWeights(\\n address[] calldata bridgeOperators\\n ) external view returns (uint256[] memory weights);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific bridge operator.\\n * @param bridgeOperator The address of the bridge operator to get the vote weight for.\\n * @return weight The vote weight of the specified bridge operator.\\n */\\n function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint256 weight);\\n\\n /**\\n * @dev Returns the weights of a list of governor addresses.\\n */\\n function getGovernorWeights(address[] calldata governors) external view returns (uint256[] memory weights);\\n\\n /**\\n * @dev Returns an array of all governors.\\n * @return An array containing the addresses of all governors.\\n */\\n function getGovernors() external view returns (address[] memory);\\n\\n /**\\n * @dev Adds multiple bridge operators.\\n * @param governors An array of addresses of hot/cold wallets for bridge operator to update their node address.\\n * @param bridgeOperators An array of addresses representing the bridge operators to add.\\n * @return addeds An array of booleans indicating whether each bridge operator was added successfully.\\n *\\n * Note: return boolean array `addeds` indicates whether a group (voteWeight, governor, operator) are recorded.\\n * It is expected that FE/BE staticcall to the function first to get the return values and handle it correctly.\\n * Governors are expected to see the outcome of this function and decide if they want to vote for the proposal or not.\\n *\\n * Example Usage:\\n * Making an `eth_call` in ethers.js\\n * ```\\n * const {addeds} = await bridgeManagerContract.callStatic.addBridgeOperators(\\n * voteWeights,\\n * governors,\\n * bridgeOperators,\\n * // overriding the caller to the contract itself since we use `onlySelfCall` guard\\n * {from: bridgeManagerContract.address}\\n * )\\n * const filteredOperators = bridgeOperators.filter((_, index) => addeds[index]);\\n * const filteredWeights = weights.filter((_, index) => addeds[index]);\\n * const filteredGovernors = governors.filter((_, index) => addeds[index]);\\n * // ... (Process or use the information as required) ...\\n * ```\\n */\\n function addBridgeOperators(\\n uint96[] calldata voteWeights,\\n address[] calldata governors,\\n address[] calldata bridgeOperators\\n ) external returns (bool[] memory addeds);\\n\\n /**\\n * @dev Removes multiple bridge operators.\\n * @param bridgeOperators An array of addresses representing the bridge operators to remove.\\n * @return removeds An array of booleans indicating whether each bridge operator was removed successfully.\\n *\\n * * Note: return boolean array `removeds` indicates whether a group (voteWeight, governor, operator) are recorded.\\n * It is expected that FE/BE staticcall to the function first to get the return values and handle it correctly.\\n * Governors are expected to see the outcome of this function and decide if they want to vote for the proposal or not.\\n *\\n * Example Usage:\\n * Making an `eth_call` in ethers.js\\n * ```\\n * const {removeds} = await bridgeManagerContract.callStatic.removeBridgeOperators(\\n * bridgeOperators,\\n * // overriding the caller to the contract itself since we use `onlySelfCall` guard\\n * {from: bridgeManagerContract.address}\\n * )\\n * const filteredOperators = bridgeOperators.filter((_, index) => removeds[index]);\\n * // ... (Process or use the information as required) ...\\n * ```\\n */\\n function removeBridgeOperators(address[] calldata bridgeOperators) external returns (bool[] memory removeds);\\n\\n /**\\n * @dev Governor updates their corresponding governor and/or operator address.\\n * Requirements:\\n * - The caller must the governor of the operator that is requested changes.\\n * @param bridgeOperator The address of the bridge operator to update.\\n */\\n function updateBridgeOperator(address bridgeOperator) external;\\n}\\n\",\"keccak256\":\"0xf3d02d806105015a62ddccd43fb46ba2ebd760cdc70839fa0a9c870f6abca5c0\",\"license\":\"MIT\"},\"contracts/interfaces/bridge/IBridgeReward.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport { IBridgeRewardEvents } from \\\"./events/IBridgeRewardEvents.sol\\\";\\n\\ninterface IBridgeReward is IBridgeRewardEvents {\\n /**\\n * @dev This function allows bridge operators to manually synchronize the reward for a given period length.\\n * @param periodLength The length of the reward period for which synchronization is requested.\\n */\\n function syncReward(uint256 periodLength) external;\\n\\n /**\\n * @dev Receives RON from any address.\\n */\\n function receiveRON() external payable;\\n\\n /**\\n * @dev Invoke calculate and transfer reward to operators based on their performance.\\n *\\n * Requirements:\\n * - This method is only called once each period.\\n * - The caller must be the bridge tracking contract or a bridge operator.\\n */\\n function execSyncReward(\\n address[] calldata operators,\\n uint256[] calldata ballots,\\n uint256 totalBallot,\\n uint256 totalVote,\\n uint256 period\\n ) external;\\n\\n /**\\n * @dev Retrieve the total amount of rewards that have been topped up in the contract.\\n * @return totalRewardToppedUp The total rewards topped up value.\\n */\\n function getTotalRewardToppedUp() external view returns (uint256);\\n\\n /**\\n * @dev Retrieve the total amount of rewards that have been scattered to bridge operators in the contract.\\n * @return totalRewardScattered The total rewards scattered value.\\n */\\n function getTotalRewardScattered() external view returns (uint256);\\n\\n /**\\n * @dev Getter for all bridge operators per period.\\n */\\n function getRewardPerPeriod() external view returns (uint256);\\n\\n /**\\n * @dev External function to retrieve the latest rewarded period in the contract.\\n * @return latestRewardedPeriod The latest rewarded period value.\\n */\\n function getLatestRewardedPeriod() external view returns (uint256);\\n\\n /**\\n * @dev Setter for all bridge operators per period.\\n */\\n function setRewardPerPeriod(uint256 rewardPerPeriod) external;\\n}\\n\",\"keccak256\":\"0x781f5b4e9257231f008457d41b277058fe6a2b7366ecd3d64bce2591d0eaa216\",\"license\":\"MIT\"},\"contracts/interfaces/bridge/IBridgeSlash.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IBridgeSlashEvents } from \\\"./events/IBridgeSlashEvents.sol\\\";\\n\\n/**\\n * @title IBridgeSlash\\n * @dev Interface for the BridgeSlash contract to manage slashing functionality for bridge operators.\\n */\\ninterface IBridgeSlash is IBridgeSlashEvents {\\n /**\\n * @dev Slashes the unavailability of bridge operators during a specific period.\\n * @param period The period to slash the bridge operators for.\\n */\\n function execSlashBridgeOperators(\\n address[] calldata operators,\\n uint256[] calldata ballots,\\n uint256 totalBallot,\\n uint256 totalVote,\\n uint256 period\\n ) external returns (bool slashed);\\n\\n /**\\n * @dev Returns the penalize durations for the specified bridge operators.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @return untilPeriods The penalized periods for the bridge operators.\\n */\\n function getSlashUntilPeriodOf(address[] calldata bridgeOperators) external returns (uint256[] memory untilPeriods);\\n\\n /**\\n * @dev Retrieves the added periods of the specified bridge operators.\\n * @param bridgeOperators An array of bridge operator addresses.\\n * @return addedPeriods An array of uint256 values representing the added periods for each bridge operator.\\n */\\n function getAddedPeriodOf(address[] calldata bridgeOperators) external view returns (uint256[] memory addedPeriods);\\n\\n /**\\n * @dev Gets the slash tier based on the given ballot and total ballots.\\n * @param ballot The ballot count for a bridge operator.\\n * @param totalVote The total vote count for the period.\\n * @return tier The slash tier.\\n */\\n function getSlashTier(uint256 ballot, uint256 totalVote) external pure returns (Tier tier);\\n\\n /**\\n * @dev Retrieve the penalty durations for different slash tiers.\\n * @return penaltyDurations The array of penalty durations for each slash tier.\\n */\\n function getPenaltyDurations() external pure returns (uint256[] memory penaltyDurations);\\n\\n /**\\n * @dev Returns the penalty duration for Tier 1 slashing.\\n * @return The duration in period number for Tier 1 slashing.\\n */\\n function TIER_1_PENALTY_DURATION() external view returns (uint256);\\n\\n /**\\n * @dev Returns the penalty duration for Tier 2 slashing.\\n * @return The duration in period number for Tier 2 slashing.\\n */\\n function TIER_2_PENALTY_DURATION() external view returns (uint256);\\n\\n /**\\n * @dev Returns the threshold duration for removing bridge operators.\\n * @return The duration in period number that exceeds which a bridge operator will be removed.\\n */\\n function REMOVE_DURATION_THRESHOLD() external view returns (uint256);\\n\\n /**\\n * @dev External function to retrieve the value of the minimum vote threshold to execute slashing rule.\\n * @return minimumVoteThreshold The minimum vote threshold value.\\n */\\n function MINIMUM_VOTE_THRESHOLD() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x45f7a50e6f2e25d9d1ac8abf0eafd1b7579d625245b9269840d42a476745e735\",\"license\":\"MIT\"},\"contracts/interfaces/bridge/IBridgeTracking.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeTracking {\\n struct Request {\\n VoteKind kind;\\n uint256 id;\\n }\\n\\n enum VoteKind {\\n Deposit,\\n Withdrawal,\\n MainchainWithdrawal\\n }\\n\\n event ExternalCallFailed(address indexed to, bytes4 indexed msgSig, bytes reason);\\n\\n /**\\n * @dev Returns the block that allow incomming mutable call.\\n */\\n function startedAtBlock() external view returns (uint256);\\n\\n /**\\n * @dev Returns the total number of votes at the specific period `_period`.\\n */\\n function totalVote(uint256 _period) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total number of ballots at the specific period `_period`.\\n */\\n function totalBallot(uint256 _period) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total number of ballots of bridge operators at the specific period `_period`.\\n */\\n function getManyTotalBallots(\\n uint256 _period,\\n address[] calldata _bridgeOperators\\n ) external view returns (uint256[] memory);\\n\\n /**\\n * @dev Returns the total number of ballots of a bridge operator at the specific period `_period`.\\n */\\n function totalBallotOf(uint256 _period, address _bridgeOperator) external view returns (uint256);\\n\\n /**\\n * @dev Handles the request once it is approved.\\n *\\n * Requirements:\\n * - The method caller is the bridge contract.\\n *\\n */\\n function handleVoteApproved(VoteKind _kind, uint256 _requestId) external;\\n\\n /**\\n * @dev Records vote for a receipt and a operator.\\n *\\n * Requirements:\\n * - The method caller is the bridge contract.\\n *\\n */\\n function recordVote(VoteKind _kind, uint256 _requestId, address _operator) external;\\n}\\n\",\"keccak256\":\"0x092841025351341cf7ff9cbf0eb6ef78752ffd2b1af329cb6048996d20c789a9\",\"license\":\"MIT\"},\"contracts/interfaces/bridge/events/IBridgeManagerEvents.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeManagerEvents {\\n /**\\n * @dev The structure representing information about a bridge operator.\\n * @param addr The address of the bridge operator.\\n * @param voteWeight The vote weight assigned to the bridge operator.\\n */\\n struct BridgeOperatorInfo {\\n address addr;\\n uint96 voteWeight;\\n }\\n\\n /**\\n * @dev Emitted when new bridge operators are added.\\n * @param statuses The array of boolean values represents whether the corresponding bridge operator is added successfully.\\n * @param voteWeights The array of vote weights assigned to the added bridge operators.\\n * @param governors The array of addresses representing the governors associated with the added bridge operators.\\n * @param bridgeOperators The array of addresses representing the added bridge operators.\\n */\\n event BridgeOperatorsAdded(bool[] statuses, uint96[] voteWeights, address[] governors, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when bridge operators are removed.\\n * @param statuses The array of boolean values representing the statuses of the removed bridge operators.\\n * @param bridgeOperators The array of addresses representing the removed bridge operators.\\n */\\n event BridgeOperatorsRemoved(bool[] statuses, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is updated.\\n * @param governor The address of the governor initiating the update.\\n * @param fromBridgeOperator The address of the bridge operator being updated.\\n * @param toBridgeOperator The updated address of the bridge operator.\\n */\\n event BridgeOperatorUpdated(\\n address indexed governor,\\n address indexed fromBridgeOperator,\\n address indexed toBridgeOperator\\n );\\n}\\n\",\"keccak256\":\"0x217fff41c4a9ca72d142c5a2120bb1b5e67bf5bf5aa0f6128450116aebc07b8d\",\"license\":\"MIT\"},\"contracts/interfaces/bridge/events/IBridgeRewardEvents.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeRewardEvents {\\n /**\\n * @dev Reward-related information for a bridge operator.\\n * @param claimed The amount of rewards claimed by the bridge operator.\\n * @param slashed The amount of rewards that have been slashed from the bridge operator.\\n */\\n struct BridgeRewardInfo {\\n uint256 claimed;\\n uint256 slashed;\\n }\\n\\n /**\\n * @dev Emitted when RON are safely received as rewards in the contract.\\n * @param from The address of the sender who transferred RON tokens as rewards.\\n * @param balanceBefore The balance of the contract before receiving the RON tokens.\\n * @param amount The amount of RON received.\\n */\\n event SafeReceived(address indexed from, uint256 balanceBefore, uint256 amount);\\n /// @dev Event emitted when the reward per period config is updated.\\n event UpdatedRewardPerPeriod(uint256 newRewardPerPeriod);\\n /// @dev Event emitted when the reward of the `operator` is scattered with `amount`.\\n event BridgeRewardScattered(uint256 indexed period, address operator, uint256 amount);\\n /// @dev Event emitted when the reward of the `operator` is slashed with `amount`.\\n event BridgeRewardSlashed(uint256 indexed period, address operator, uint256 amount);\\n /// @dev Event emitted when the reward of the `operator` is scattered with `amount` but failed to transfer.\\n event BridgeRewardScatterFailed(uint256 indexed period, address operator, uint256 amount);\\n /// @dev Event emitted when the requesting period to sync is too far.\\n event BridgeRewardSyncTooFarPeriod(uint256 requestingPeriod, uint256 latestPeriod);\\n}\\n\",\"keccak256\":\"0xf0efa7130ba933552a16b7fb4040f23e276a41d8d698f27b11c3f82930916e51\",\"license\":\"MIT\"},\"contracts/interfaces/bridge/events/IBridgeSlashEvents.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeSlashEvents {\\n /**\\n * @dev Enumeration representing the slashing tiers for bridge operators.\\n */\\n enum Tier {\\n Tier0,\\n Tier1,\\n Tier2\\n }\\n\\n /**\\n * @dev Struct representing the status of a bridge operator.\\n */\\n struct BridgeSlashInfo {\\n uint128 slashUntilPeriod;\\n uint128 newlyAddedAtPeriod;\\n }\\n\\n /**\\n * @dev Event emitted when a bridge operator is slashed.\\n * @param tier The slash tier of the operator.\\n * @param bridgeOperator The address of the slashed bridge operator.\\n * @param period The period in which the operator is slashed.\\n * @param slashUntilPeriod The period until which the operator is penalized.\\n */\\n event Slashed(Tier indexed tier, address indexed bridgeOperator, uint256 indexed period, uint256 slashUntilPeriod);\\n\\n /**\\n * @dev Emitted when a removal request is made for a bridge operator.\\n * @param period The period for which the removal request is made.\\n * @param bridgeOperator The address of the bridge operator being requested for removal.\\n */\\n event RemovalRequested(uint256 indexed period, address indexed bridgeOperator);\\n}\\n\",\"keccak256\":\"0x9611e0d8b85b50bdd8ba9e8148564af526e78ccce5d202e7c84043d2d2ccb75f\",\"license\":\"MIT\"},\"contracts/interfaces/collections/IHasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport { ContractType } from \\\"../../utils/ContractType.sol\\\";\\n\\ninterface IHasContracts {\\n /// @dev Error of invalid role.\\n error ErrContractTypeNotFound(ContractType contractType);\\n\\n /// @dev Emitted when a contract is updated.\\n event ContractUpdated(ContractType indexed contractType, address indexed addr);\\n\\n /**\\n * @dev Returns the address of a contract with a specific role.\\n * Throws an error if no contract is set for the specified role.\\n *\\n * @param contractType The role of the contract to retrieve.\\n * @return contract_ The address of the contract with the specified role.\\n */\\n function getContract(ContractType contractType) external view returns (address contract_);\\n\\n /**\\n * @dev Sets the address of a contract with a specific role.\\n * Emits the event {ContractUpdated}.\\n * @param contractType The role of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function setContract(ContractType contractType, address addr) external;\\n}\\n\",\"keccak256\":\"0x99d8213d857e30d367155abd15dc42730afdfbbac3a22dfb3b95ffea2083a92e\",\"license\":\"MIT\"},\"contracts/interfaces/validator/ICandidateManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface ICandidateManager {\\n struct ValidatorCandidate {\\n // Admin of the candidate\\n address admin;\\n // Address of the validator that produces block, e.g. block.coinbase. This is so-called validator address.\\n address consensusAddr;\\n // Address that receives mining reward of the validator\\n address payable treasuryAddr;\\n // Address of the bridge operator corresponding to the candidate\\n address ______deprecatedbridgeOperatorAddr;\\n // The percentage of reward that validators can be received, the rest goes to the delegators.\\n // Values in range [0; 100_00] stands for 0-100%\\n uint256 commissionRate;\\n // The timestamp that scheduled to revoke the candidate (no schedule=0)\\n uint256 revokingTimestamp;\\n // The deadline that the candidate must top up staking amount to keep it larger than or equal to the threshold (no deadline=0)\\n uint256 topupDeadline;\\n }\\n\\n struct CommissionSchedule {\\n // The timestamp that the commission schedule gets affected (no schedule=0).\\n uint256 effectiveTimestamp;\\n // The new commission rate. Value is in range [0; 100_00], stands for 0-100%\\n uint256 commissionRate;\\n }\\n\\n /// @dev Emitted when the maximum number of validator candidates is updated.\\n event MaxValidatorCandidateUpdated(uint256 threshold);\\n /// @dev Emitted when the min offset to the effective date of commission rate change is updated.\\n event MinEffectiveDaysOnwardsUpdated(uint256 numOfDays);\\n /// @dev Emitted when the validator candidate is granted.\\n event CandidateGranted(address indexed consensusAddr, address indexed treasuryAddr, address indexed admin);\\n /// @dev Emitted when the revoking timestamp of a candidate is updated.\\n event CandidateRevokingTimestampUpdated(address indexed consensusAddr, uint256 revokingTimestamp);\\n /// @dev Emitted when the topup deadline of a candidate is updated.\\n event CandidateTopupDeadlineUpdated(address indexed consensusAddr, uint256 topupDeadline);\\n /// @dev Emitted when the validator candidate is revoked.\\n event CandidatesRevoked(address[] consensusAddrs);\\n\\n /// @dev Emitted when a schedule for updating commission rate is set.\\n event CommissionRateUpdateScheduled(address indexed consensusAddr, uint256 effectiveTimestamp, uint256 rate);\\n /// @dev Emitted when the commission rate of a validator is updated.\\n event CommissionRateUpdated(address indexed consensusAddr, uint256 rate);\\n\\n /// @dev Error of exceeding maximum number of candidates.\\n error ErrExceedsMaxNumberOfCandidate();\\n /// @dev Error of querying for already existent candidate.\\n error ErrExistentCandidate();\\n /// @dev Error of querying for non-existent candidate.\\n error ErrNonExistentCandidate();\\n /// @dev Error of candidate admin already exists.\\n error ErrExistentCandidateAdmin(address _candidateAdminAddr);\\n /// @dev Error of treasury already exists.\\n error ErrExistentTreasury(address _treasuryAddr);\\n /// @dev Error of invalid commission rate.\\n error ErrInvalidCommissionRate();\\n /// @dev Error of invalid effective days onwards.\\n error ErrInvalidEffectiveDaysOnwards();\\n /// @dev Error of invalid min effective days onwards.\\n error ErrInvalidMinEffectiveDaysOnwards();\\n /// @dev Error of already requested revoking candidate before.\\n error ErrAlreadyRequestedRevokingCandidate();\\n /// @dev Error of commission change schedule exists.\\n error ErrAlreadyRequestedUpdatingCommissionRate();\\n /// @dev Error of trusted org cannot renounce.\\n error ErrTrustedOrgCannotRenounce();\\n\\n /**\\n * @dev Returns the maximum number of validator candidate.\\n */\\n function maxValidatorCandidate() external view returns (uint256);\\n\\n /**\\n * @dev Returns the minimum number of days to the effective date of commission rate change.\\n */\\n function minEffectiveDaysOnwards() external view returns (uint256);\\n\\n /**\\n * @dev Sets the maximum number of validator candidate.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `MaxValidatorCandidateUpdated` event.\\n *\\n */\\n function setMaxValidatorCandidate(uint256) external;\\n\\n /**\\n * @dev Sets the minimum number of days to the effective date of commision rate change.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `MinEffectiveDaysOnwardsUpdated` event.\\n *\\n */\\n function setMinEffectiveDaysOnwards(uint256 _numOfDays) external;\\n\\n /**\\n * @dev Grants a validator candidate.\\n *\\n * Requirements:\\n * - The method caller is staking contract.\\n *\\n * Emits the event `CandidateGranted`.\\n *\\n */\\n function execApplyValidatorCandidate(\\n address _admin,\\n address _consensusAddr,\\n address payable _treasuryAddr,\\n uint256 _commissionRate\\n ) external;\\n\\n /**\\n * @dev Requests to revoke a validator candidate in next `_secsLeft` seconds.\\n *\\n * Requirements:\\n * - The method caller is staking contract.\\n *\\n * Emits the event `CandidateRevokingTimestampUpdated`.\\n *\\n */\\n function execRequestRenounceCandidate(address, uint256 _secsLeft) external;\\n\\n /**\\n * @dev Fallback function of `CandidateStaking-requestUpdateCommissionRate`.\\n *\\n * Requirements:\\n * - The method caller is the staking contract.\\n * - The `_effectiveTimestamp` must be the beginning of a UTC day, and at least from 7 days onwards\\n * - The `_rate` must be in range of [0_00; 100_00].\\n *\\n * Emits the event `CommissionRateUpdateScheduled`.\\n *\\n */\\n function execRequestUpdateCommissionRate(address _consensusAddr, uint256 _effectiveTimestamp, uint256 _rate) external;\\n\\n /**\\n * @dev Returns whether the address is a validator (candidate).\\n */\\n function isValidatorCandidate(address _addr) external view returns (bool);\\n\\n /**\\n * @dev Returns the validator candidate.\\n */\\n function getValidatorCandidates() external view returns (address[] memory);\\n\\n /**\\n * @dev Returns all candidate info.\\n */\\n function getCandidateInfos() external view returns (ValidatorCandidate[] memory);\\n\\n /**\\n * @dev Returns the info of a candidate.\\n */\\n function getCandidateInfo(address _candidate) external view returns (ValidatorCandidate memory);\\n\\n /**\\n * @dev Returns whether the address is the candidate admin.\\n */\\n function isCandidateAdmin(address _candidate, address _admin) external view returns (bool);\\n\\n /**\\n * @dev Returns the schedule of changing commission rate of a candidate address.\\n */\\n function getCommissionChangeSchedule(address _candidate) external view returns (CommissionSchedule memory);\\n}\\n\",\"keccak256\":\"0x9ab205c736f1bcc9a3debe06e08d829f4857141d940e6f608236f136193a7f49\",\"license\":\"MIT\"},\"contracts/interfaces/validator/ICoinbaseExecution.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"./ISlashingExecution.sol\\\";\\n\\ninterface ICoinbaseExecution is ISlashingExecution {\\n enum BlockRewardDeprecatedType {\\n UNKNOWN,\\n UNAVAILABILITY,\\n AFTER_BAILOUT\\n }\\n\\n /// @dev Emitted when the validator set is updated\\n event ValidatorSetUpdated(uint256 indexed period, address[] consensusAddrs);\\n /// @dev Emitted when the bridge operator set is updated, to mirror the in-jail and maintaining status of the validator.\\n event BlockProducerSetUpdated(uint256 indexed period, uint256 indexed epoch, address[] consensusAddrs);\\n /// @dev Emitted when the bridge operator set is updated.\\n event BridgeOperatorSetUpdated(uint256 indexed period, uint256 indexed epoch, address[] bridgeOperators);\\n\\n /// @dev Emitted when the reward of the block producer is deprecated.\\n event BlockRewardDeprecated(\\n address indexed coinbaseAddr,\\n uint256 rewardAmount,\\n BlockRewardDeprecatedType deprecatedType\\n );\\n /// @dev Emitted when the block reward is submitted.\\n event BlockRewardSubmitted(address indexed coinbaseAddr, uint256 submittedAmount, uint256 bonusAmount);\\n\\n /// @dev Emitted when the block producer reward is distributed.\\n event MiningRewardDistributed(address indexed consensusAddr, address indexed recipient, uint256 amount);\\n /// @dev Emitted when the contract fails when distributing the block producer reward.\\n event MiningRewardDistributionFailed(\\n address indexed consensusAddr,\\n address indexed recipient,\\n uint256 amount,\\n uint256 contractBalance\\n );\\n\\n /// @dev Emitted when the bridge operator reward is distributed.\\n event BridgeOperatorRewardDistributed(\\n address indexed consensusAddr,\\n address indexed bridgeOperator,\\n address indexed recipientAddr,\\n uint256 amount\\n );\\n /// @dev Emitted when the contract fails when distributing the bridge operator reward.\\n event BridgeOperatorRewardDistributionFailed(\\n address indexed consensusAddr,\\n address indexed bridgeOperator,\\n address indexed recipient,\\n uint256 amount,\\n uint256 contractBalance\\n );\\n\\n /// @dev Emitted when the amount of RON reward is distributed to staking contract.\\n event StakingRewardDistributed(uint256 totalAmount, address[] consensusAddrs, uint256[] amounts);\\n /// @dev Emitted when the contracts fails when distributing the amount of RON to the staking contract.\\n event StakingRewardDistributionFailed(\\n uint256 totalAmount,\\n address[] consensusAddrs,\\n uint256[] amounts,\\n uint256 contractBalance\\n );\\n\\n /// @dev Emitted when the epoch is wrapped up.\\n event WrappedUpEpoch(uint256 indexed periodNumber, uint256 indexed epochNumber, bool periodEnding);\\n\\n /// @dev Error of method caller must be coinbase\\n error ErrCallerMustBeCoinbase();\\n /// @dev Error of only allowed at the end of epoch\\n error ErrAtEndOfEpochOnly();\\n /// @dev Error of query for already wrapped up epoch\\n error ErrAlreadyWrappedEpoch();\\n\\n /**\\n * @dev Submits reward of the current block.\\n *\\n * Requirements:\\n * - The method caller is coinbase.\\n *\\n * Emits the event `MiningRewardDeprecated` if the coinbase is slashed or no longer be a block producer.\\n * Emits the event `BlockRewardSubmitted` for the valid call.\\n *\\n */\\n function submitBlockReward() external payable;\\n\\n /**\\n * @dev Wraps up the current epoch.\\n *\\n * Requirements:\\n * - The method must be called when the current epoch is ending.\\n * - The epoch is not wrapped yet.\\n * - The method caller is coinbase.\\n *\\n * Emits the event `MiningRewardDistributed` when some validator has reward distributed.\\n * Emits the event `StakingRewardDistributed` when some staking pool has reward distributed.\\n * Emits the event `BlockProducerSetUpdated` when the epoch is wrapped up.\\n * Emits the event `BridgeOperatorSetUpdated` when the epoch is wrapped up at period ending.\\n * Emits the event `ValidatorSetUpdated` when the epoch is wrapped up at period ending, and the validator set gets updated.\\n * Emits the event `WrappedUpEpoch`.\\n *\\n */\\n function wrapUpEpoch() external payable;\\n}\\n\",\"keccak256\":\"0xe4060b7e3b04a0043bd334011fe4ba67c990b0484dad52d7f14b35040989b6ab\",\"license\":\"MIT\"},\"contracts/interfaces/validator/IEmergencyExit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface IEmergencyExit {\\n /// @dev Emitted when the fund is locked from an emergency exit request\\n event EmergencyExitRequested(address indexed consensusAddr, uint256 lockedAmount);\\n /// @dev Emitted when the fund that locked from an emergency exit request is transferred to the recipient.\\n event EmergencyExitLockedFundReleased(\\n address indexed consensusAddr,\\n address indexed recipient,\\n uint256 unlockedAmount\\n );\\n /// @dev Emitted when the fund that locked from an emergency exit request is failed to transferred back.\\n event EmergencyExitLockedFundReleasingFailed(\\n address indexed consensusAddr,\\n address indexed recipient,\\n uint256 unlockedAmount,\\n uint256 contractBalance\\n );\\n\\n /// @dev Emitted when the emergency exit locked amount is updated.\\n event EmergencyExitLockedAmountUpdated(uint256 amount);\\n /// @dev Emitted when the emergency expiry duration is updated.\\n event EmergencyExpiryDurationUpdated(uint256 amount);\\n\\n /// @dev Error of already requested emergency exit before.\\n error ErrAlreadyRequestedEmergencyExit();\\n\\n /**\\n * @dev Returns the amount of RON to lock from a consensus address.\\n */\\n function emergencyExitLockedAmount() external returns (uint256);\\n\\n /**\\n * @dev Returns the duration that an emergency request is expired and the fund will be recycled.\\n */\\n function emergencyExpiryDuration() external returns (uint256);\\n\\n /**\\n * @dev Sets the amount of RON to lock from a consensus address.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the event `EmergencyExitLockedAmountUpdated`.\\n *\\n */\\n function setEmergencyExitLockedAmount(uint256 _emergencyExitLockedAmount) external;\\n\\n /**\\n * @dev Sets the duration that an emergency request is expired and the fund will be recycled.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the event `EmergencyExpiryDurationUpdated`.\\n *\\n */\\n function setEmergencyExpiryDuration(uint256 _emergencyExpiryDuration) external;\\n\\n /**\\n * @dev Unlocks fund for emergency exit request.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the event `EmergencyExitLockedFundReleased` if the fund is successfully unlocked.\\n * Emits the event `EmergencyExitLockedFundReleasingFailed` if the fund is failed to unlock.\\n *\\n */\\n function execReleaseLockedFundForEmergencyExitRequest(address _consensusAddr, address payable _recipient) external;\\n\\n /**\\n * @dev Fallback function of `IStaking-requestEmergencyExit`.\\n *\\n * Requirements:\\n * - The method caller is staking contract.\\n *\\n */\\n function execEmergencyExit(address _consensusAddr, uint256 _secLeftToRevoke) external;\\n}\\n\",\"keccak256\":\"0x45161abd1e3db83052a06889a0e3a7a5e7ee3306478601d58ac4ed32ccaa75ad\",\"license\":\"MIT\"},\"contracts/interfaces/validator/IRoninValidatorSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"./ICandidateManager.sol\\\";\\nimport \\\"./info-fragments/ICommonInfo.sol\\\";\\nimport \\\"./ICoinbaseExecution.sol\\\";\\nimport \\\"./ISlashingExecution.sol\\\";\\nimport \\\"./IEmergencyExit.sol\\\";\\n\\ninterface IRoninValidatorSet is\\n ICandidateManager,\\n ICommonInfo,\\n ISlashingExecution,\\n ICoinbaseExecution,\\n IEmergencyExit\\n{}\\n\",\"keccak256\":\"0x813f34747aea4dfb53bbc147abf8dbe5999ce73111c2db99bcb3efb4cf75bb3d\",\"license\":\"MIT\"},\"contracts/interfaces/validator/ISlashingExecution.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface ISlashingExecution {\\n /// @dev Emitted when the validator is punished.\\n event ValidatorPunished(\\n address indexed consensusAddr,\\n uint256 indexed period,\\n uint256 jailedUntil,\\n uint256 deductedStakingAmount,\\n bool blockProducerRewardDeprecated,\\n bool bridgeOperatorRewardDeprecated\\n );\\n /// @dev Emitted when the validator get out of jail by bailout.\\n event ValidatorUnjailed(address indexed validator, uint256 period);\\n\\n /// @dev Error of cannot bailout due to high tier slash.\\n error ErrCannotBailout(address validator);\\n\\n /**\\n * @dev Finalize the slash request from slash indicator contract.\\n *\\n * Requirements:\\n * - The method caller is slash indicator contract.\\n *\\n * Emits the event `ValidatorPunished`.\\n *\\n */\\n function execSlash(\\n address _validatorAddr,\\n uint256 _newJailedUntil,\\n uint256 _slashAmount,\\n bool _cannotBailout\\n ) external;\\n\\n /**\\n * @dev Finalize the bailout request from slash indicator contract.\\n *\\n * Requirements:\\n * - The method caller is slash indicator contract.\\n *\\n * Emits the event `ValidatorUnjailed`.\\n *\\n */\\n function execBailOut(address _validatorAddr, uint256 _period) external;\\n}\\n\",\"keccak256\":\"0x80362c42fdc0ee06543a2abbffee961fe51c15a7c5e18933a9c34897e50d07fe\",\"license\":\"MIT\"},\"contracts/interfaces/validator/info-fragments/ICommonInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"./IJailingInfo.sol\\\";\\nimport \\\"./ITimingInfo.sol\\\";\\nimport \\\"./IValidatorInfoV2.sol\\\";\\n\\ninterface ICommonInfo is ITimingInfo, IJailingInfo, IValidatorInfoV2 {\\n struct EmergencyExitInfo {\\n uint256 lockedAmount;\\n // The timestamp that this locked amount will be recycled to staking vesting contract\\n uint256 recyclingAt;\\n }\\n\\n /// @dev Emitted when the deprecated reward is withdrawn.\\n event DeprecatedRewardRecycled(address indexed recipientAddr, uint256 amount);\\n /// @dev Emitted when the deprecated reward withdrawal is failed\\n event DeprecatedRewardRecycleFailed(address indexed recipientAddr, uint256 amount, uint256 balance);\\n\\n /// @dev Error thrown when receives RON from neither staking vesting contract nor staking contract\\n error ErrUnauthorizedReceiveRON();\\n /// @dev Error thrown when queries for a non existent info.\\n error NonExistentRecyclingInfo();\\n\\n /**\\n * @dev Returns the total deprecated reward, which includes reward that is not sent for slashed validators and unsastified bridge operators\\n */\\n function totalDeprecatedReward() external view returns (uint256);\\n\\n /**\\n * @dev Returns the emergency exit request.\\n */\\n function getEmergencyExitInfo(address _consensusAddr) external view returns (EmergencyExitInfo memory);\\n}\\n\",\"keccak256\":\"0x3fdfa86da33b889e5153075ffc028d6b0c607480a96b532fbbbc48ac7bbf27c9\",\"license\":\"MIT\"},\"contracts/interfaces/validator/info-fragments/IJailingInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface IJailingInfo {\\n /**\\n * @dev Returns whether the validator are put in jail (cannot join the set of validators) during the current period.\\n */\\n function checkJailed(address) external view returns (bool);\\n\\n /**\\n * @dev Returns whether the validator are put in jail and the number of block and epoch that he still is in the jail.\\n */\\n function getJailedTimeLeft(\\n address _addr\\n ) external view returns (bool isJailed_, uint256 blockLeft_, uint256 epochLeft_);\\n\\n /**\\n * @dev Returns whether the validator are put in jail (cannot join the set of validators) at a specific block.\\n */\\n function checkJailedAtBlock(address _addr, uint256 _blockNum) external view returns (bool);\\n\\n /**\\n * @dev Returns whether the validator are put in jail at a specific block and the number of block and epoch that he still is in the jail.\\n */\\n function getJailedTimeLeftAtBlock(\\n address _addr,\\n uint256 _blockNum\\n ) external view returns (bool isJailed_, uint256 blockLeft_, uint256 epochLeft_);\\n\\n /**\\n * @dev Returns whether the validators are put in jail (cannot join the set of validators) during the current period.\\n */\\n function checkManyJailed(address[] calldata) external view returns (bool[] memory);\\n\\n /**\\n * @dev Returns whether the incoming reward of the block producer is deprecated during the current period.\\n */\\n function checkMiningRewardDeprecated(address _blockProducer) external view returns (bool);\\n\\n /**\\n * @dev Returns whether the incoming reward of the block producer is deprecated during a specific period.\\n */\\n function checkMiningRewardDeprecatedAtPeriod(address _blockProducer, uint256 _period) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2b1846b05ca1d636299fb929c1bd7b392b236f5e3f7aa3e7eea2c6d57b8836fb\",\"license\":\"MIT\"},\"contracts/interfaces/validator/info-fragments/ITimingInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface ITimingInfo {\\n /**\\n * @dev Returns the block that validator set was updated.\\n */\\n function getLastUpdatedBlock() external view returns (uint256);\\n\\n /**\\n * @dev Returns the number of blocks in a epoch.\\n */\\n function numberOfBlocksInEpoch() external view returns (uint256 _numberOfBlocks);\\n\\n /**\\n * @dev Returns the epoch index from the block number.\\n */\\n function epochOf(uint256 _block) external view returns (uint256);\\n\\n /**\\n * @dev Returns whether the epoch ending is at the block number `_block`.\\n */\\n function epochEndingAt(uint256 _block) external view returns (bool);\\n\\n /**\\n * @dev Tries to get the period index from the epoch number.\\n */\\n function tryGetPeriodOfEpoch(uint256 _epoch) external view returns (bool _filled, uint256 _periodNumber);\\n\\n /**\\n * @dev Returns whether the period ending at the current block number.\\n */\\n function isPeriodEnding() external view returns (bool);\\n\\n /**\\n * @dev Returns the period index from the current block.\\n */\\n function currentPeriod() external view returns (uint256);\\n\\n /**\\n * @dev Returns the block number that the current period starts at.\\n */\\n function currentPeriodStartAtBlock() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x77b86a68149389fed0eb0c5b8d56f278d3bd103ba64f504697d709b24c3212d5\",\"license\":\"MIT\"},\"contracts/interfaces/validator/info-fragments/IValidatorInfoV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../../../libraries/EnumFlags.sol\\\";\\n\\ninterface IValidatorInfoV2 {\\n /**\\n * @dev Error thrown when an invalid maximum prioritized validator number is provided.\\n */\\n error ErrInvalidMaxPrioritizedValidatorNumber();\\n\\n /// @dev Emitted when the number of max validator is updated.\\n event MaxValidatorNumberUpdated(uint256);\\n /// @dev Emitted when the number of reserved slots for prioritized validators is updated.\\n event MaxPrioritizedValidatorNumberUpdated(uint256);\\n\\n /**\\n * @dev Returns the maximum number of validators in the epoch.\\n */\\n function maxValidatorNumber() external view returns (uint256 _maximumValidatorNumber);\\n\\n /**\\n * @dev Returns the number of reserved slots for prioritized validators.\\n */\\n function maxPrioritizedValidatorNumber() external view returns (uint256 _maximumPrioritizedValidatorNumber);\\n\\n /**\\n * @dev Returns the current validator list.\\n */\\n function getValidators() external view returns (address[] memory _validatorList);\\n\\n /**\\n * @dev Returns the current block producer list.\\n */\\n function getBlockProducers() external view returns (address[] memory);\\n\\n /**\\n * @dev Returns whether the address is block producer or not.\\n */\\n function isBlockProducer(address _addr) external view returns (bool);\\n\\n /**\\n * @dev Returns total numbers of the block producers.\\n */\\n function totalBlockProducers() external view returns (uint256);\\n\\n /**\\n * @dev Updates the max validator number\\n *\\n * Requirements:\\n * - The method caller is admin\\n *\\n * Emits the event `MaxValidatorNumberUpdated`\\n *\\n */\\n function setMaxValidatorNumber(uint256 _maxValidatorNumber) external;\\n\\n /**\\n * @dev Updates the number of reserved slots for prioritized validators\\n *\\n * Requirements:\\n * - The method caller is admin\\n *\\n * Emits the event `MaxPrioritizedValidatorNumberUpdated`\\n *\\n */\\n function setMaxPrioritizedValidatorNumber(uint256 _maxPrioritizedValidatorNumber) external;\\n}\\n\",\"keccak256\":\"0x6213c188a1323b242a098394b91caf9481e257bd57a0804cb2aa890377a993ed\",\"license\":\"MIT\"},\"contracts/libraries/AddressArrayUtils.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\nlibrary AddressArrayUtils {\\n /**\\n * @dev Error thrown when a duplicated element is detected in an array.\\n * @param msgSig The function signature that invoke the error.\\n */\\n error ErrDuplicated(bytes4 msgSig);\\n\\n /**\\n * @dev Returns whether or not there's a duplicate. Runs in O(n^2).\\n * @param A Array to search\\n * @return Returns true if duplicate, false otherwise\\n */\\n function hasDuplicate(address[] memory A) internal pure returns (bool) {\\n if (A.length == 0) {\\n return false;\\n }\\n unchecked {\\n for (uint256 i = 0; i < A.length - 1; i++) {\\n for (uint256 j = i + 1; j < A.length; j++) {\\n if (A[i] == A[j]) {\\n return true;\\n }\\n }\\n }\\n }\\n return false;\\n }\\n\\n /**\\n * @dev Returns whether two arrays of addresses are equal or not.\\n */\\n function isEqual(address[] memory _this, address[] memory _other) internal pure returns (bool yes_) {\\n // Hashing two arrays and compare their hash\\n assembly {\\n let _thisHash := keccak256(add(_this, 32), mul(mload(_this), 32))\\n let _otherHash := keccak256(add(_other, 32), mul(mload(_other), 32))\\n yes_ := eq(_thisHash, _otherHash)\\n }\\n }\\n\\n /**\\n * @dev Return the concatenated array from a and b.\\n */\\n function extend(address[] memory a, address[] memory b) internal pure returns (address[] memory c) {\\n uint256 lengthA = a.length;\\n uint256 lengthB = b.length;\\n unchecked {\\n c = new address[](lengthA + lengthB);\\n }\\n uint256 i;\\n for (; i < lengthA; ) {\\n c[i] = a[i];\\n unchecked {\\n ++i;\\n }\\n }\\n for (uint256 j; j < lengthB; ) {\\n c[i] = b[j];\\n unchecked {\\n ++i;\\n ++j;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xaf760162653a85d6e1b24df4d33c74076f778470112f421a02050fb981242001\",\"license\":\"UNLICENSED\"},\"contracts/libraries/EnumFlags.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This library implements checking flag of an enumerated value.\\n * The originated idea is inherited from [Enum.HashFlag(Enum)](https://learn.microsoft.com/en-us/dotnet/api/system.enum.hasflag?view=net-6.0) method of C#.\\n */\\nlibrary EnumFlags {\\n enum ValidatorFlag {\\n None, // bit(00)\\n BlockProducer, // bit(01)\\n DeprecatedBridgeOperator, // bit(10)\\n Both // bit(11)\\n }\\n\\n function isNone(ValidatorFlag _value) internal pure returns (bool) {\\n return uint8(_value) == 0;\\n }\\n\\n /**\\n * @dev Checks if `_value` has `_flag`.\\n */\\n function hasFlag(ValidatorFlag _value, ValidatorFlag _flag) internal pure returns (bool) {\\n return (uint8(_value) & uint8(_flag)) != 0;\\n }\\n\\n /**\\n * @dev Calculate new value of `_value` after adding `_flag`.\\n */\\n function addFlag(ValidatorFlag _value, ValidatorFlag _flag) internal pure returns (ValidatorFlag) {\\n return ValidatorFlag(uint8(_value) | uint8(_flag));\\n }\\n\\n /**\\n * @dev Calculate new value of `_value` after remove `_flag`.\\n */\\n function removeFlag(ValidatorFlag _value, ValidatorFlag _flag) internal pure returns (ValidatorFlag) {\\n return ValidatorFlag(uint8(_value) & ~uint8(_flag));\\n }\\n}\\n\",\"keccak256\":\"0xa712f0d1a323ee39f23eb3ee3278b4ec25fe2e536b1ccc629578c66f277c088d\",\"license\":\"UNLICENSED\"},\"contracts/ronin/gateway/BridgeTracking.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport \\\"../../extensions/collections/HasContracts.sol\\\";\\nimport \\\"../../interfaces/bridge/IBridgeTracking.sol\\\";\\nimport { IBridgeManager } from \\\"../../interfaces/bridge/IBridgeManager.sol\\\";\\nimport { IBridgeSlash } from \\\"../../interfaces/bridge/IBridgeSlash.sol\\\";\\nimport { IBridgeReward } from \\\"../../interfaces/bridge/IBridgeReward.sol\\\";\\nimport { IRoninValidatorSet } from \\\"../../interfaces/validator/IRoninValidatorSet.sol\\\";\\nimport { HasBridgeDeprecated, HasValidatorDeprecated } from \\\"../../utils/DeprecatedSlots.sol\\\";\\n\\ncontract BridgeTracking is HasBridgeDeprecated, HasValidatorDeprecated, HasContracts, Initializable, IBridgeTracking {\\n struct PeriodVotingMetric {\\n /// @dev Total requests that are tracked in the period. This value is 0 until the {_bufferMetric.requests[]} gets added into a period metric.\\n uint256 totalRequest;\\n uint256 totalBallot;\\n mapping(address => uint256) totalBallotOf;\\n address[] voters;\\n }\\n\\n struct PeriodVotingMetricTimeWrapper {\\n uint256 lastEpoch;\\n Request[] requests;\\n PeriodVotingMetric data;\\n }\\n\\n struct ReceiptTrackingInfo {\\n /// @dev The period that the receipt is approved. Value 0 means the receipt is not approved yet.\\n uint256 approvedPeriod;\\n /// @dev The address list of voters\\n address[] voters;\\n /// @dev Mapping from voter => flag indicating the voter casts vote for this receipt\\n mapping(address => bool) voted;\\n /// @dev The period that the receipt is tracked, i.e. the metric is transferred from buffer to the period. Value 0 means the receipt is currently in buffer or not tracked yet.\\n uint256 trackedPeriod;\\n }\\n\\n /// @dev The block that the contract allows incoming mutable calls.\\n uint256 internal _startedAtBlock;\\n\\n /// @dev The temporary info of votes and ballots\\n PeriodVotingMetricTimeWrapper internal _bufferMetric;\\n /// @dev Mapping from period number => vote stats based on period\\n mapping(uint256 => PeriodVotingMetric) internal _periodMetric;\\n /// @dev Mapping from vote kind => receipt id => receipt stats\\n mapping(VoteKind => mapping(uint256 => ReceiptTrackingInfo)) internal _receiptTrackingInfo;\\n /// @dev The latest period that get synced with bridge's slashing and rewarding contract\\n uint256 internal _lastSyncPeriod;\\n\\n modifier skipOnUnstarted() {\\n _skipOnUnstarted();\\n _;\\n }\\n\\n /**\\n * @dev Returns the whole transaction in case the current block is less than start block.\\n */\\n function _skipOnUnstarted() private view {\\n if (block.number < _startedAtBlock) {\\n assembly {\\n return(0, 0)\\n }\\n }\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /**\\n * @dev Initializes the contract storage.\\n */\\n function initialize(address bridgeContract, address validatorContract, uint256 startedAtBlock_) external initializer {\\n _setContract(ContractType.BRIDGE, bridgeContract);\\n _setContract(ContractType.VALIDATOR, validatorContract);\\n _startedAtBlock = startedAtBlock_;\\n }\\n\\n function initializeV2() external reinitializer(2) {\\n _setContract(ContractType.BRIDGE, ______deprecatedBridge);\\n _setContract(ContractType.VALIDATOR, ______deprecatedValidator);\\n\\n delete ______deprecatedBridge;\\n delete ______deprecatedValidator;\\n }\\n\\n function initializeV3(address bridgeManager, address bridgeSlash, address bridgeReward) external reinitializer(3) {\\n _setContract(ContractType.BRIDGE_MANAGER, bridgeManager);\\n _setContract(ContractType.BRIDGE_SLASH, bridgeSlash);\\n _setContract(ContractType.BRIDGE_REWARD, bridgeReward);\\n _lastSyncPeriod = IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod() - 1;\\n }\\n\\n /**\\n * @inheritdoc IBridgeTracking\\n */\\n function startedAtBlock() external view override returns (uint256) {\\n return _startedAtBlock;\\n }\\n\\n /**\\n * @inheritdoc IBridgeTracking\\n */\\n function totalVote(uint256 period) public view override returns (uint256 totalVote_) {\\n totalVote_ = _periodMetric[period].totalRequest;\\n if (_isBufferCountedForPeriod(period)) {\\n totalVote_ += _bufferMetric.requests.length;\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeTracking\\n */\\n function totalBallot(uint256 period) public view override returns (uint256 totalBallot_) {\\n totalBallot_ = _periodMetric[period].totalBallot;\\n if (_isBufferCountedForPeriod(period)) {\\n totalBallot_ += _bufferMetric.data.totalBallot;\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeTracking\\n */\\n function getManyTotalBallots(\\n uint256 period,\\n address[] calldata operators\\n ) external view override returns (uint256[] memory _res) {\\n _res = _getManyTotalBallots(period, operators);\\n }\\n\\n function _getManyTotalBallots(\\n uint256 period,\\n address[] memory operators\\n ) internal view returns (uint256[] memory res) {\\n uint256 length = operators.length;\\n res = new uint256[](length);\\n bool isBufferCounted = _isBufferCountedForPeriod(period);\\n for (uint i = 0; i < length; ) {\\n res[i] = _totalBallotOf(period, operators[i], isBufferCounted);\\n\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeTracking\\n */\\n function totalBallotOf(uint256 period, address bridgeOperator) public view override returns (uint256) {\\n return _totalBallotOf(period, bridgeOperator, _isBufferCountedForPeriod(period));\\n }\\n\\n /**\\n * @inheritdoc IBridgeTracking\\n */\\n function handleVoteApproved(\\n VoteKind kind,\\n uint256 requestId\\n ) external override onlyContract(ContractType.BRIDGE) skipOnUnstarted {\\n ReceiptTrackingInfo storage _receiptInfo = _receiptTrackingInfo[kind][requestId];\\n\\n // Only records for the receipt which not approved\\n if (_receiptInfo.approvedPeriod == 0) {\\n _trySyncBuffer();\\n uint256 currentPeriod = IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod();\\n _receiptInfo.approvedPeriod = currentPeriod;\\n\\n Request storage _bufferRequest = _bufferMetric.requests.push();\\n _bufferRequest.kind = kind;\\n _bufferRequest.id = requestId;\\n\\n address[] storage _voters = _receiptInfo.voters;\\n for (uint i = 0; i < _voters.length; ) {\\n _increaseBallot(kind, requestId, _voters[i], currentPeriod);\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n delete _receiptInfo.voters;\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeTracking\\n */\\n function recordVote(\\n VoteKind kind,\\n uint256 requestId,\\n address operator\\n ) external override onlyContract(ContractType.BRIDGE) skipOnUnstarted {\\n uint256 period = IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod();\\n _trySyncBuffer();\\n ReceiptTrackingInfo storage _receiptInfo = _receiptTrackingInfo[kind][requestId];\\n\\n // When the vote is not approved yet, the voters are saved in the receipt info, and not increase ballot metric.\\n // The ballot metric will be increased later in the {handleVoteApproved} method.\\n if (_receiptInfo.approvedPeriod == 0) {\\n _receiptInfo.voters.push(operator);\\n return;\\n }\\n\\n _increaseBallot(kind, requestId, operator, period);\\n\\n uint256 lastSyncPeriod = _lastSyncPeriod;\\n // When switching to new period, wrap up vote info, then slash and distribute reward accordingly.\\n if (lastSyncPeriod < period) {\\n _lastSyncPeriod = period;\\n\\n address[] memory allOperators = IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)).getBridgeOperators();\\n uint256[] memory ballots = _getManyTotalBallots(lastSyncPeriod, allOperators);\\n\\n uint256 totalVote_ = totalVote(lastSyncPeriod);\\n uint256 totalBallot_ = totalBallot(lastSyncPeriod);\\n\\n address bridgeSlashContract = getContract(ContractType.BRIDGE_SLASH);\\n (bool success, bytes memory returnOrRevertData) = bridgeSlashContract.call(\\n abi.encodeCall(\\n IBridgeSlash.execSlashBridgeOperators,\\n (allOperators, ballots, totalBallot_, totalVote_, lastSyncPeriod)\\n )\\n );\\n if (!success) {\\n emit ExternalCallFailed(\\n bridgeSlashContract,\\n IBridgeSlash.execSlashBridgeOperators.selector,\\n returnOrRevertData\\n );\\n }\\n\\n address bridgeRewardContract = getContract(ContractType.BRIDGE_REWARD);\\n (success, returnOrRevertData) = bridgeRewardContract.call(\\n abi.encodeCall(IBridgeReward.execSyncReward, (allOperators, ballots, totalBallot_, totalVote_, lastSyncPeriod))\\n );\\n if (!success) {\\n emit ExternalCallFailed(bridgeRewardContract, IBridgeReward.execSyncReward.selector, returnOrRevertData);\\n }\\n }\\n }\\n\\n /**\\n * @dev Increases the ballot for the operator at a period.\\n */\\n function _increaseBallot(VoteKind kind, uint256 requestId, address operator, uint256 currentPeriod) internal {\\n ReceiptTrackingInfo storage _receiptInfo = _receiptTrackingInfo[kind][requestId];\\n if (_receiptInfo.voted[operator]) {\\n return;\\n }\\n\\n _receiptInfo.voted[operator] = true;\\n\\n uint256 trackedPeriod = _receiptInfo.trackedPeriod;\\n\\n // Do not increase ballot for receipt that is neither in the buffer, nor in the most current tracked period.\\n // If the receipt is not tracked in a period, increase metric in buffer.\\n unchecked {\\n if (trackedPeriod == 0) {\\n if (_bufferMetric.data.totalBallotOf[operator] == 0) {\\n _bufferMetric.data.voters.push(operator);\\n }\\n _bufferMetric.data.totalBallot++;\\n _bufferMetric.data.totalBallotOf[operator]++;\\n }\\n // If the receipt is tracked in the most current tracked period, increase metric in the period.\\n else if (trackedPeriod == currentPeriod) {\\n PeriodVotingMetric storage _metric = _periodMetric[trackedPeriod];\\n _metric.totalBallot++;\\n _metric.totalBallotOf[operator]++;\\n }\\n }\\n }\\n\\n /**\\n * @dev See `totalBallotOf`.\\n */\\n function _totalBallotOf(\\n uint256 period,\\n address operator,\\n bool mustCountLastStats\\n ) internal view returns (uint256 _totalBallot) {\\n _totalBallot = _periodMetric[period].totalBallotOf[operator];\\n if (mustCountLastStats) {\\n _totalBallot += _bufferMetric.data.totalBallotOf[operator];\\n }\\n }\\n\\n /**\\n * @dev Syncs period stats. Move all data from the buffer metric to the period metric.\\n *\\n * Requirements:\\n * - The epoch after the buffer epoch is wrapped up.\\n */\\n function _trySyncBuffer() internal {\\n IRoninValidatorSet validatorContract = IRoninValidatorSet(getContract(ContractType.VALIDATOR));\\n uint256 currentEpoch = validatorContract.epochOf(block.number);\\n if (_bufferMetric.lastEpoch < currentEpoch) {\\n (, uint256 trackedPeriod) = validatorContract.tryGetPeriodOfEpoch(_bufferMetric.lastEpoch + 1);\\n _bufferMetric.lastEpoch = currentEpoch;\\n\\n // Copy numbers of totals\\n PeriodVotingMetric storage _metric = _periodMetric[trackedPeriod];\\n _metric.totalRequest += _bufferMetric.requests.length;\\n _metric.totalBallot += _bufferMetric.data.totalBallot;\\n\\n // Copy voters info and voters' ballot\\n for (uint i = 0; i < _bufferMetric.data.voters.length; ) {\\n address voter = _bufferMetric.data.voters[i];\\n _metric.totalBallotOf[voter] += _bufferMetric.data.totalBallotOf[voter];\\n delete _bufferMetric.data.totalBallotOf[voter]; // need to manually delete each element, due to mapping\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n // Mark all receipts in the buffer as tracked. Keep total number of receipts and delete receipt details.\\n for (uint i = 0; i < _bufferMetric.requests.length; ) {\\n Request storage _bufferRequest = _bufferMetric.requests[i];\\n ReceiptTrackingInfo storage _receiptInfo = _receiptTrackingInfo[_bufferRequest.kind][_bufferRequest.id];\\n _receiptInfo.trackedPeriod = trackedPeriod;\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n delete _bufferMetric.requests;\\n delete _bufferMetric.data;\\n }\\n }\\n\\n /**\\n * @dev Returns whether the buffer stats must be counted or not.\\n */\\n function _isBufferCountedForPeriod(uint256 queriedPeriod) internal view returns (bool) {\\n IRoninValidatorSet validatorContract = IRoninValidatorSet(getContract(ContractType.VALIDATOR));\\n uint256 currentEpoch = validatorContract.epochOf(block.number);\\n (bool filled, uint256 periodOfNextTemporaryEpoch) = validatorContract.tryGetPeriodOfEpoch(\\n _bufferMetric.lastEpoch + 1\\n );\\n return filled && queriedPeriod == periodOfNextTemporaryEpoch && _bufferMetric.lastEpoch < currentEpoch;\\n }\\n}\\n\",\"keccak256\":\"0xd26f94308b302f32fe8fa241643053fef7b3651c51486026ca93a45d9c499697\",\"license\":\"MIT\"},\"contracts/utils/CommonErrors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ContractType } from \\\"./ContractType.sol\\\";\\nimport { RoleAccess } from \\\"./RoleAccess.sol\\\";\\n\\n/**\\n * @dev Error thrown when an address is expected to be an already created externally owned account (EOA).\\n * This error indicates that the provided address is invalid for certain contract operations that require already created EOA.\\n */\\nerror ErrAddressIsNotCreatedEOA(address addr, bytes32 codehash);\\n/**\\n * @dev Error raised when a bridge operator update operation fails.\\n * @param bridgeOperator The address of the bridge operator that failed to update.\\n */\\nerror ErrBridgeOperatorUpdateFailed(address bridgeOperator);\\n/**\\n * @dev Error thrown when attempting to add a bridge operator that already exists in the contract.\\n * This error indicates that the provided bridge operator address is already registered as a bridge operator in the contract.\\n */\\nerror ErrBridgeOperatorAlreadyExisted(address bridgeOperator);\\n/**\\n * @dev The error indicating an unsupported interface.\\n * @param interfaceId The bytes4 interface identifier that is not supported.\\n * @param addr The address where the unsupported interface was encountered.\\n */\\nerror ErrUnsupportedInterface(bytes4 interfaceId, address addr);\\n/**\\n * @dev Error thrown when the return data from a callback function is invalid.\\n * @param callbackFnSig The signature of the callback function that returned invalid data.\\n * @param register The address of the register where the callback function was invoked.\\n * @param returnData The invalid return data received from the callback function.\\n */\\nerror ErrInvalidReturnData(bytes4 callbackFnSig, address register, bytes returnData);\\n/**\\n * @dev Error of set to non-contract.\\n */\\nerror ErrZeroCodeContract(address addr);\\n/**\\n * @dev Error indicating that arguments are invalid.\\n */\\nerror ErrInvalidArguments(bytes4 msgSig);\\n/**\\n * @dev Error indicating that given address is null when it should not.\\n */\\nerror ErrZeroAddress(bytes4 msgSig);\\n/**\\n * @dev Error indicating that the provided threshold is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that the invalid threshold applies to.\\n */\\nerror ErrInvalidThreshold(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a function can only be called by the contract itself.\\n * @param msgSig The function signature (bytes4) that can only be called by the contract itself.\\n */\\nerror ErrOnlySelfCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n * @param expectedRole The role required to perform the function.\\n */\\nerror ErrUnauthorized(bytes4 msgSig, RoleAccess expectedRole);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n */\\nerror ErrUnauthorizedCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4).\\n * @param expectedContractType The contract type required to perform the function.\\n * @param actual The actual address that called to the function.\\n */\\nerror ErrUnexpectedInternalCall(bytes4 msgSig, ContractType expectedContractType, address actual);\\n\\n/**\\n * @dev Error indicating that an array is empty when it should contain elements.\\n */\\nerror ErrEmptyArray();\\n\\n/**\\n * @dev Error indicating a mismatch in the length of input parameters or arrays for a specific function.\\n * @param msgSig The function signature (bytes4) that has a length mismatch.\\n */\\nerror ErrLengthMismatch(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a proxy call to an external contract has failed.\\n * @param msgSig The function signature (bytes4) of the proxy call that failed.\\n * @param extCallSig The function signature (bytes4) of the external contract call that failed.\\n */\\nerror ErrProxyCallFailed(bytes4 msgSig, bytes4 extCallSig);\\n\\n/**\\n * @dev Error indicating that a function tried to call a precompiled contract that is not allowed.\\n * @param msgSig The function signature (bytes4) that attempted to call a precompiled contract.\\n */\\nerror ErrCallPrecompiled(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a native token transfer has failed.\\n * @param msgSig The function signature (bytes4) of the token transfer that failed.\\n */\\nerror ErrNativeTransferFailed(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that an order is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid order.\\n */\\nerror ErrInvalidOrder(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the chain ID is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid chain ID.\\n * @param actual Current chain ID that executing function.\\n * @param expected Expected chain ID required for the tx to success.\\n */\\nerror ErrInvalidChainId(bytes4 msgSig, uint256 actual, uint256 expected);\\n\\n/**\\n * @dev Error indicating that a vote type is not supported.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an unsupported vote type.\\n */\\nerror ErrUnsupportedVoteType(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the proposal nonce is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid proposal nonce.\\n */\\nerror ErrInvalidProposalNonce(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a voter has already voted.\\n * @param voter The address of the voter who has already voted.\\n */\\nerror ErrAlreadyVoted(address voter);\\n\\n/**\\n * @dev Error indicating that a signature is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid signature.\\n */\\nerror ErrInvalidSignatures(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a relay call has failed.\\n * @param msgSig The function signature (bytes4) of the relay call that failed.\\n */\\nerror ErrRelayFailed(bytes4 msgSig);\\n/**\\n * @dev Error indicating that a vote weight is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid vote weight.\\n */\\nerror ErrInvalidVoteWeight(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a query was made for an outdated bridge operator set.\\n */\\nerror ErrQueryForOutdatedBridgeOperatorSet();\\n\\n/**\\n * @dev Error indicating that a request is invalid.\\n */\\nerror ErrInvalidRequest();\\n\\n/**\\n * @dev Error indicating that a token standard is invalid.\\n */\\nerror ErrInvalidTokenStandard();\\n\\n/**\\n * @dev Error indicating that a token is not supported.\\n */\\nerror ErrUnsupportedToken();\\n\\n/**\\n * @dev Error indicating that a receipt kind is invalid.\\n */\\nerror ErrInvalidReceiptKind();\\n\\n/**\\n * @dev Error indicating that a receipt is invalid.\\n */\\nerror ErrInvalidReceipt();\\n\\n/**\\n * @dev Error indicating that an address is not payable.\\n */\\nerror ErrNonpayableAddress(address);\\n\\n/**\\n * @dev Error indicating that the period is already processed, i.e. scattered reward.\\n */\\nerror ErrPeriodAlreadyProcessed(uint256 requestingPeriod, uint256 latestPeriod);\\n\\n/**\\n * @dev Error thrown when an invalid vote hash is provided.\\n */\\nerror ErrInvalidVoteHash();\\n\\n/**\\n * @dev Error thrown when querying for an empty vote.\\n */\\nerror ErrQueryForEmptyVote();\\n\\n/**\\n * @dev Error thrown when querying for an expired vote.\\n */\\nerror ErrQueryForExpiredVote();\\n\\n/**\\n * @dev Error thrown when querying for a non-existent vote.\\n */\\nerror ErrQueryForNonExistentVote();\\n\",\"keccak256\":\"0x951a466bb76f385554960531e63e64a5bd314df341bb6c95e6e81448d6984ac0\",\"license\":\"MIT\"},\"contracts/utils/ContractType.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum ContractType {\\n /* 0 */ UNKNOWN,\\n /* 1 */ PAUSE_ENFORCER,\\n /* 2 */ BRIDGE,\\n /* 3 */ BRIDGE_TRACKING,\\n /* 4 */ GOVERNANCE_ADMIN,\\n /* 5 */ MAINTENANCE,\\n /* 6 */ SLASH_INDICATOR,\\n /* 7 */ STAKING_VESTING,\\n /* 8 */ VALIDATOR,\\n /* 9 */ STAKING,\\n /* 10 */ RONIN_TRUSTED_ORGANIZATION,\\n /* 11 */ BRIDGE_MANAGER,\\n /* 12 */ BRIDGE_SLASH,\\n /* 13 */ BRIDGE_REWARD\\n}\\n\",\"keccak256\":\"0xf72feff9afafcb5cadc1b05c6e0b998ea5d66c7ece57c3e482e560d0a1bb4079\",\"license\":\"MIT\"},\"contracts/utils/DeprecatedSlots.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title Deprecated Contracts\\n * @dev These abstract contracts are deprecated and should not be used in new implementations.\\n * They provide functionality related to various aspects of a smart contract but have been marked\\n * as deprecated to indicate that they are no longer actively maintained or recommended for use.\\n * The purpose of these contracts is to preserve the slots for already deployed contracts.\\n */\\ncontract HasSlashIndicatorDeprecated {\\n /// @custom:deprecated Previously `_slashIndicatorContract` (non-zero value)\\n address internal ______deprecatedSlashIndicator;\\n}\\n\\ncontract HasStakingVestingDeprecated {\\n /// @custom:deprecated Previously `_stakingVestingContract` (non-zero value)\\n address internal ______deprecatedStakingVesting;\\n}\\n\\ncontract HasBridgeDeprecated {\\n /// @custom:deprecated Previously `_bridgeContract` (non-zero value)\\n address internal ______deprecatedBridge;\\n}\\n\\ncontract HasValidatorDeprecated {\\n /// @custom:deprecated Previously `_validatorContract` (non-zero value)\\n address internal ______deprecatedValidator;\\n}\\n\\ncontract HasStakingDeprecated {\\n /// @custom:deprecated Previously `_stakingContract` (non-zero value)\\n address internal ______deprecatedStakingContract;\\n}\\n\\ncontract HasMaintenanceDeprecated {\\n /// @custom:deprecated Previously `_maintenanceContract` (non-zero value)\\n address internal ______deprecatedMaintenance;\\n}\\n\\ncontract HasTrustedOrgDeprecated {\\n /// @custom:deprecated Previously `_trustedOrgContract` (non-zero value)\\n address internal ______deprecatedTrustedOrg;\\n}\\n\\ncontract HasGovernanceAdminDeprecated {\\n /// @custom:deprecated Previously `_governanceAdminContract` (non-zero value)\\n address internal ______deprecatedGovernanceAdmin;\\n}\\n\\ncontract HasBridgeTrackingDeprecated {\\n /// @custom:deprecated Previously `_bridgeTrackingContract` (non-zero value)\\n address internal ______deprecatedBridgeTracking;\\n}\\n\",\"keccak256\":\"0xe93504aed9f67a6d399475c7162560f2ac4f793fab5b67fe504fc694ac9a2892\",\"license\":\"MIT\"},\"contracts/utils/IdentityGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { AddressArrayUtils } from \\\"../libraries/AddressArrayUtils.sol\\\";\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport { ErrAddressIsNotCreatedEOA, ErrZeroAddress, ErrOnlySelfCall, ErrZeroCodeContract, ErrUnsupportedInterface } from \\\"./CommonErrors.sol\\\";\\n\\nabstract contract IdentityGuard {\\n using AddressArrayUtils for address[];\\n\\n /// @dev value is equal to keccak256(abi.encode())\\n /// @dev see: https://eips.ethereum.org/EIPS/eip-1052\\n bytes32 internal constant CREATED_ACCOUNT_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\\n\\n /**\\n * @dev Modifier to restrict functions to only be called by this contract.\\n * @dev Reverts if the caller is not this contract.\\n */\\n modifier onlySelfCall() virtual {\\n _requireSelfCall();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to ensure that the elements in the `arr` array are non-duplicates.\\n * It calls the internal `_checkDuplicate` function to perform the duplicate check.\\n *\\n * Requirements:\\n * - The elements in the `arr` array must not contain any duplicates.\\n */\\n modifier nonDuplicate(address[] memory arr) virtual {\\n _requireNonDuplicate(arr);\\n _;\\n }\\n\\n /**\\n * @dev Internal method to check the method caller.\\n * @dev Reverts if the method caller is not this contract.\\n */\\n function _requireSelfCall() internal view virtual {\\n if (msg.sender != address(this)) revert ErrOnlySelfCall(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to check if a contract address has code.\\n * @param addr The address of the contract to check.\\n * @dev Throws an error if the contract address has no code.\\n */\\n function _requireHasCode(address addr) internal view {\\n if (addr.code.length == 0) revert ErrZeroCodeContract(addr);\\n }\\n\\n /**\\n * @dev Checks if an address is zero and reverts if it is.\\n * @param addr The address to check.\\n */\\n function _requireNonZeroAddress(address addr) internal pure {\\n if (addr == address(0)) revert ErrZeroAddress(msg.sig);\\n }\\n\\n /**\\n * @dev Check if arr is empty and revert if it is.\\n * Checks if an array contains any duplicate addresses and reverts if duplicates are found.\\n * @param arr The array of addresses to check.\\n */\\n function _requireNonDuplicate(address[] memory arr) internal pure {\\n if (arr.hasDuplicate()) revert AddressArrayUtils.ErrDuplicated(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to require that the provided address is a created externally owned account (EOA).\\n * This internal function is used to ensure that the provided address is a valid externally owned account (EOA).\\n * It checks the codehash of the address against a predefined constant to confirm that the address is a created EOA.\\n * @notice This method only works with non-state EOA accounts\\n */\\n function _requireCreatedEOA(address addr) internal view {\\n _requireNonZeroAddress(addr);\\n bytes32 codehash = addr.codehash;\\n if (codehash != CREATED_ACCOUNT_HASH) revert ErrAddressIsNotCreatedEOA(addr, codehash);\\n }\\n\\n /**\\n * @dev Internal function to require that the specified contract supports the given interface.\\n * @param contractAddr The address of the contract to check for interface support.\\n * @param interfaceId The interface ID to check for support.\\n * @notice If the contract does not support the interface `interfaceId` or EIP165, a revert with the corresponding error message is triggered.\\n */\\n function _requireSupportsInterface(address contractAddr, bytes4 interfaceId) internal view {\\n if (!IERC165(contractAddr).supportsInterface(interfaceId)) {\\n revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2e1aef91018590d52fa9ca9e63708c8ef3e9ee7061e8947d4bb30b07d721a229\",\"license\":\"MIT\"},\"contracts/utils/RoleAccess.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum RoleAccess {\\n /* 0 */ UNKNOWN,\\n /* 1 */ ADMIN,\\n /* 2 */ COINBASE,\\n /* 3 */ GOVERNOR,\\n /* 4 */ CANDIDATE_ADMIN,\\n /* 5 */ WITHDRAWAL_MIGRATOR,\\n /* 6 */ __DEPRECATED_BRIDGE_OPERATOR,\\n /* 7 */ BLOCK_PRODUCER,\\n /* 8 */ VALIDATOR_CANDIDATE\\n}\\n\",\"keccak256\":\"0xa98cec38c640c4e37f475debbcd366226f1188c3f5ea6e29de768bd33e021873\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b5061001961001e565b6100eb565b600154600160a81b900460ff161561008c5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60015460ff600160a01b909104811610156100e9576001805460ff60a01b191660ff60a01b17905560405160ff81527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b611a1f806100fa6000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063d25ed4c611610071578063d25ed4c614610135578063de981f1b14610148578063e2a75f3614610173578063e7ec7b3914610186578063f67e815214610199578063f84bd121146101b957600080fd5b80631794bb3c146100b9578063229f88ea146100ce5780634ac0bcda146100e15780635cd8a76b14610107578063865e6fd31461010f578063c7c4fea914610122575b600080fd5b6100cc6100c7366004611455565b6101c1565b005b6100cc6100dc3660046114a5565b6102c2565b6100f46100ef3660046114cf565b61046a565b6040519081526020015b60405180910390f35b6100cc610488565b6100cc61011d36600461150e565b610581565b6100cc61013036600461153a565b6105a0565b6100f461014336600461157a565b61097f565b61015b610156366004611593565b6109b4565b6040516001600160a01b0390911681526020016100fe565b6100f461018136600461157a565b610a2a565b6100cc6101943660046115ae565b610a54565b6101ac6101a73660046115ee565b610b9e565b6040516100fe91906116a8565b6002546100f4565b600154600160a81b900460ff16158080156101e7575060018054600160a01b900460ff16105b806102075750303b158015610207575060018054600160a01b900460ff16145b61022c5760405162461bcd60e51b8152600401610223906116bb565b60405180910390fd5b6001805460ff60a01b1916600160a01b1790558015610259576001805460ff60a81b1916600160a81b1790555b610264600285610be5565b61026f600884610be5565b600282905580156102bc576001805460ff60a81b191681556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15b50505050565b60026102cd81610c89565b6102d5610cd8565b6000600a60008560028111156102ed576102ed611709565b60028111156102fe576102fe611709565b81526020019081526020016000206000848152602001908152602001600020905080600001546000036102bc57610333610ce6565b600061033f60086109b4565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa15801561037c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a0919061171f565b808355600480546001818101835560009290925260029081027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018054939450928892849260ff199092169184908111156103fd576103fd611709565b02179055506001808201869055830160005b81548110156104525761044a888884848154811061042f5761042f611738565b6000918252602090912001546001600160a01b031687610f88565b60010161040f565b506104616001850160006113c8565b50505050505050565b600061047f838361047a86611108565b61122e565b90505b92915050565b600154600290600160a81b900460ff161580156104b3575060015460ff808316600160a01b90920416105b6104cf5760405162461bcd60e51b8152600401610223906116bb565b6001805460ff60a81b1960ff8416600160a01b021661ffff60a01b1990911617600160a81b17905560005461050f906002906001600160a01b0316610be5565b600154610527906008906001600160a01b0316610be5565b600080546001600160a01b031916905560018054600161ff0160a01b031916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b610589611284565b610592816112de565b61059c8282610be5565b5050565b60026105ab81610c89565b6105b3610cd8565b60006105bf60086109b4565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105fc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610620919061171f565b905061062a610ce6565b6000600a600087600281111561064257610642611709565b600281111561065357610653611709565b81526020019081526020016000206000868152602001908152602001600020905080600001546000036106b5576001908101805491820181556000908152602090200180546001600160a01b0319166001600160a01b038516179055506102bc565b6106c186868685610f88565b600b548281101561046157600b8381556000906106dd906109b4565b6001600160a01b0316639b19dbfd6040518163ffffffff1660e01b8152600401600060405180830381865afa15801561071a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610742919081019061176f565b905060006107508383611314565b9050600061075d84610a2a565b9050600061076a8561097f565b90506000610778600c6109b4565b9050600080826001600160a01b0316878786888c6040516024016107a0959493929190611834565b60408051601f198184030181529181526020820180516001600160e01b0316634dca592560e01b179052516107d591906118cd565b6000604051808303816000865af19150503d8060008114610812576040519150601f19603f3d011682016040523d82523d6000602084013e610817565b606091505b50915091508161086e57604051634dca592560e01b906001600160a01b038516907feaa424ccc38ebcf22402729592dedf8315790e0128cb577cdeff1a3ee627f827906108659085906118e9565b60405180910390a35b600061087a600d6109b4565b9050806001600160a01b0316888887898d60405160240161089f959493929190611834565b60408051601f198184030181529181526020820180516001600160e01b03166335e5b7eb60e11b179052516108d491906118cd565b6000604051808303816000865af19150503d8060008114610911576040519150601f19603f3d011682016040523d82523d6000602084013e610916565b606091505b5090935091508261096e576040516335e5b7eb60e11b906001600160a01b038316907feaa424ccc38ebcf22402729592dedf8315790e0128cb577cdeff1a3ee627f827906109659086906118e9565b60405180910390a35b505050505050505050505050505050565b60008181526009602052604090206001015461099a82611108565b156109af576006546109ac9082611932565b90505b919050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600d8111156109eb576109eb611709565b60ff1681526020810191909152604001600020546001600160a01b03169050806109af578160405163409140df60e11b81526004016102239190611959565b600081815260096020526040902054610a4282611108565b156109af576004546109ac9082611932565b600154600390600160a81b900460ff16158015610a7f575060015460ff808316600160a01b90920416105b610a9b5760405162461bcd60e51b8152600401610223906116bb565b6001805460ff60a81b1960ff8416600160a01b021661ffff60a01b1990911617600160a81b179055610ace600b85610be5565b610ad9600c84610be5565b610ae4600d83610be5565b6001610af060086109b4565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b51919061171f565b610b5b9190611967565b600b556001805460ff60a81b1916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020016102b3565b6060610bdd8484848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061131492505050565b949350505050565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600d811115610c1b57610c1b611709565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600d811115610c5c57610c5c611709565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b610c92816109b4565b6001600160a01b0316336001600160a01b031614610cd5576000356001600160e01b03191681336040516320e0f98d60e21b81526004016102239392919061197a565b50565b600254431015610ce457005b565b6000610cf260086109b4565b60405163a3d545f560e01b81524360048201529091506000906001600160a01b0383169063a3d545f590602401602060405180830381865afa158015610d3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d60919061171f565b905080600360000154101561059c576000826001600160a01b031663468c96ae6003600001546001610d929190611932565b6040518263ffffffff1660e01b8152600401610db091815260200190565b6040805180830381865afa158015610dcc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df091906119b1565b60038490556000818152600960205260408120600454815493955090935091839190610e1d908490611932565b9091555050600654600182018054600090610e39908490611932565b90915550600090505b600854811015610ec957600880546000919083908110610e6457610e64611738565b60009182526020808320909101546001600160a01b0316808352600782526040808420546002880190935283208054919450919290610ea4908490611932565b90915550506001600160a01b0316600090815260076020526040812055600101610e42565b5060005b600454811015610f5b57600060036001018281548110610eef57610eef611738565b6000918252602082206002918202018054909350600a91839160ff1690811115610f1b57610f1b611709565b6002811115610f2c57610f2c611709565b815260208082019290925260409081016000908120600195860154825290925290206003018590555001610ecd565b50610f68600460006113e6565b60006005818155600682905590610f806008826113c8565b505050505050565b6000600a6000866002811115610fa057610fa0611709565b6002811115610fb157610fb1611709565b81526020808201929092526040908101600090812087825283528181206001600160a01b038716825260028101909352205490915060ff1615610ff457506102bc565b6001600160a01b03831660009081526002820160205260408120805460ff191660011790556003820154908190036110c1576001600160a01b038416600090815260076020526040812054900361109157600880546001810182556000919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180546001600160a01b0319166001600160a01b0386161790555b6006805460019081019091556001600160a01b038516600090815260076020526040902080549091019055610f80565b828103610f8057600090815260096020908152604080832060018082018054820190556001600160a01b039790971684526002019091529020805490930190925550505050565b60008061111560086109b4565b60405163a3d545f560e01b81524360048201529091506000906001600160a01b0383169063a3d545f590602401602060405180830381865afa15801561115f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611183919061171f565b9050600080836001600160a01b031663468c96ae60036000015460016111a99190611932565b6040518263ffffffff1660e01b81526004016111c791815260200190565b6040805180830381865afa1580156111e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120791906119b1565b9150915081801561121757508086145b8015611224575060035483115b9695505050505050565b60008381526009602090815260408083206001600160a01b0386168452600201909152902054811561127d576001600160a01b038316600090815260076020526040902054610bdd9082611932565b9392505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610ce4576000356001600160e01b0319166001604051620f948f60ea1b81526004016102239291906119e4565b806001600160a01b03163b600003610cd557604051630bfc64a360e21b81526001600160a01b0382166004820152602401610223565b80516060908067ffffffffffffffff8111156113325761133261174e565b60405190808252806020026020018201604052801561135b578160200160208202803683370190505b509150600061136985611108565b905060005b828110156113bf5761139a8686838151811061138c5761138c611738565b60200260200101518461122e565b8482815181106113ac576113ac611738565b602090810291909101015260010161136e565b50505092915050565b5080546000825590600052602060002090810190610cd59190611407565b5080546000825560020290600052602060002090810190610cd59190611420565b5b8082111561141c5760008155600101611408565b5090565b5b8082111561141c57805460ff1916815560006001820155600201611421565b6001600160a01b0381168114610cd557600080fd5b60008060006060848603121561146a57600080fd5b833561147581611440565b9250602084013561148581611440565b929592945050506040919091013590565b8035600381106109af57600080fd5b600080604083850312156114b857600080fd5b6114c183611496565b946020939093013593505050565b600080604083850312156114e257600080fd5b8235915060208301356114f481611440565b809150509250929050565b8035600e81106109af57600080fd5b6000806040838503121561152157600080fd5b61152a836114ff565b915060208301356114f481611440565b60008060006060848603121561154f57600080fd5b61155884611496565b925060208401359150604084013561156f81611440565b809150509250925092565b60006020828403121561158c57600080fd5b5035919050565b6000602082840312156115a557600080fd5b61047f826114ff565b6000806000606084860312156115c357600080fd5b83356115ce81611440565b925060208401356115de81611440565b9150604084013561156f81611440565b60008060006040848603121561160357600080fd5b83359250602084013567ffffffffffffffff8082111561162257600080fd5b818601915086601f83011261163657600080fd5b81358181111561164557600080fd5b8760208260051b850101111561165a57600080fd5b6020830194508093505050509250925092565b600081518084526020808501945080840160005b8381101561169d57815187529582019590820190600101611681565b509495945050505050565b60208152600061047f602083018461166d565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561173157600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b80516109af81611440565b6000602080838503121561178257600080fd5b825167ffffffffffffffff8082111561179a57600080fd5b818501915085601f8301126117ae57600080fd5b8151818111156117c0576117c061174e565b8060051b604051601f19603f830116810181811085821117156117e5576117e561174e565b60405291825284820192508381018501918883111561180357600080fd5b938501935b828510156118285761181985611764565b84529385019392850192611808565b98975050505050505050565b60a0808252865190820181905260009060209060c0840190828a01845b828110156118765781516001600160a01b031684529284019290840190600101611851565b5050508381038285015261188a818961166d565b6040850197909752505050606081019290925260809091015292915050565b60005b838110156118c45781810151838201526020016118ac565b50506000910152565b600082516118df8184602087016118a9565b9190910192915050565b60208152600082518060208401526119088160408501602087016118a9565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b808201808211156104825761048261191c565b600e811061195557611955611709565b9052565b602081016104828284611945565b818103818111156104825761048261191c565b6001600160e01b031984168152606081016119986020830185611945565b6001600160a01b03929092166040919091015292915050565b600080604083850312156119c457600080fd5b825180151581146119d457600080fd5b6020939093015192949293505050565b6001600160e01b0319831681526040810160098310611a0557611a05611709565b826020830152939250505056fea164736f6c6343000811000a", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063d25ed4c611610071578063d25ed4c614610135578063de981f1b14610148578063e2a75f3614610173578063e7ec7b3914610186578063f67e815214610199578063f84bd121146101b957600080fd5b80631794bb3c146100b9578063229f88ea146100ce5780634ac0bcda146100e15780635cd8a76b14610107578063865e6fd31461010f578063c7c4fea914610122575b600080fd5b6100cc6100c7366004611455565b6101c1565b005b6100cc6100dc3660046114a5565b6102c2565b6100f46100ef3660046114cf565b61046a565b6040519081526020015b60405180910390f35b6100cc610488565b6100cc61011d36600461150e565b610581565b6100cc61013036600461153a565b6105a0565b6100f461014336600461157a565b61097f565b61015b610156366004611593565b6109b4565b6040516001600160a01b0390911681526020016100fe565b6100f461018136600461157a565b610a2a565b6100cc6101943660046115ae565b610a54565b6101ac6101a73660046115ee565b610b9e565b6040516100fe91906116a8565b6002546100f4565b600154600160a81b900460ff16158080156101e7575060018054600160a01b900460ff16105b806102075750303b158015610207575060018054600160a01b900460ff16145b61022c5760405162461bcd60e51b8152600401610223906116bb565b60405180910390fd5b6001805460ff60a01b1916600160a01b1790558015610259576001805460ff60a81b1916600160a81b1790555b610264600285610be5565b61026f600884610be5565b600282905580156102bc576001805460ff60a81b191681556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15b50505050565b60026102cd81610c89565b6102d5610cd8565b6000600a60008560028111156102ed576102ed611709565b60028111156102fe576102fe611709565b81526020019081526020016000206000848152602001908152602001600020905080600001546000036102bc57610333610ce6565b600061033f60086109b4565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa15801561037c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a0919061171f565b808355600480546001818101835560009290925260029081027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018054939450928892849260ff199092169184908111156103fd576103fd611709565b02179055506001808201869055830160005b81548110156104525761044a888884848154811061042f5761042f611738565b6000918252602090912001546001600160a01b031687610f88565b60010161040f565b506104616001850160006113c8565b50505050505050565b600061047f838361047a86611108565b61122e565b90505b92915050565b600154600290600160a81b900460ff161580156104b3575060015460ff808316600160a01b90920416105b6104cf5760405162461bcd60e51b8152600401610223906116bb565b6001805460ff60a81b1960ff8416600160a01b021661ffff60a01b1990911617600160a81b17905560005461050f906002906001600160a01b0316610be5565b600154610527906008906001600160a01b0316610be5565b600080546001600160a01b031916905560018054600161ff0160a01b031916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b610589611284565b610592816112de565b61059c8282610be5565b5050565b60026105ab81610c89565b6105b3610cd8565b60006105bf60086109b4565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105fc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610620919061171f565b905061062a610ce6565b6000600a600087600281111561064257610642611709565b600281111561065357610653611709565b81526020019081526020016000206000868152602001908152602001600020905080600001546000036106b5576001908101805491820181556000908152602090200180546001600160a01b0319166001600160a01b038516179055506102bc565b6106c186868685610f88565b600b548281101561046157600b8381556000906106dd906109b4565b6001600160a01b0316639b19dbfd6040518163ffffffff1660e01b8152600401600060405180830381865afa15801561071a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610742919081019061176f565b905060006107508383611314565b9050600061075d84610a2a565b9050600061076a8561097f565b90506000610778600c6109b4565b9050600080826001600160a01b0316878786888c6040516024016107a0959493929190611834565b60408051601f198184030181529181526020820180516001600160e01b0316634dca592560e01b179052516107d591906118cd565b6000604051808303816000865af19150503d8060008114610812576040519150601f19603f3d011682016040523d82523d6000602084013e610817565b606091505b50915091508161086e57604051634dca592560e01b906001600160a01b038516907feaa424ccc38ebcf22402729592dedf8315790e0128cb577cdeff1a3ee627f827906108659085906118e9565b60405180910390a35b600061087a600d6109b4565b9050806001600160a01b0316888887898d60405160240161089f959493929190611834565b60408051601f198184030181529181526020820180516001600160e01b03166335e5b7eb60e11b179052516108d491906118cd565b6000604051808303816000865af19150503d8060008114610911576040519150601f19603f3d011682016040523d82523d6000602084013e610916565b606091505b5090935091508261096e576040516335e5b7eb60e11b906001600160a01b038316907feaa424ccc38ebcf22402729592dedf8315790e0128cb577cdeff1a3ee627f827906109659086906118e9565b60405180910390a35b505050505050505050505050505050565b60008181526009602052604090206001015461099a82611108565b156109af576006546109ac9082611932565b90505b919050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600d8111156109eb576109eb611709565b60ff1681526020810191909152604001600020546001600160a01b03169050806109af578160405163409140df60e11b81526004016102239190611959565b600081815260096020526040902054610a4282611108565b156109af576004546109ac9082611932565b600154600390600160a81b900460ff16158015610a7f575060015460ff808316600160a01b90920416105b610a9b5760405162461bcd60e51b8152600401610223906116bb565b6001805460ff60a81b1960ff8416600160a01b021661ffff60a01b1990911617600160a81b179055610ace600b85610be5565b610ad9600c84610be5565b610ae4600d83610be5565b6001610af060086109b4565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b51919061171f565b610b5b9190611967565b600b556001805460ff60a81b1916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020016102b3565b6060610bdd8484848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061131492505050565b949350505050565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600d811115610c1b57610c1b611709565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600d811115610c5c57610c5c611709565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b610c92816109b4565b6001600160a01b0316336001600160a01b031614610cd5576000356001600160e01b03191681336040516320e0f98d60e21b81526004016102239392919061197a565b50565b600254431015610ce457005b565b6000610cf260086109b4565b60405163a3d545f560e01b81524360048201529091506000906001600160a01b0383169063a3d545f590602401602060405180830381865afa158015610d3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d60919061171f565b905080600360000154101561059c576000826001600160a01b031663468c96ae6003600001546001610d929190611932565b6040518263ffffffff1660e01b8152600401610db091815260200190565b6040805180830381865afa158015610dcc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df091906119b1565b60038490556000818152600960205260408120600454815493955090935091839190610e1d908490611932565b9091555050600654600182018054600090610e39908490611932565b90915550600090505b600854811015610ec957600880546000919083908110610e6457610e64611738565b60009182526020808320909101546001600160a01b0316808352600782526040808420546002880190935283208054919450919290610ea4908490611932565b90915550506001600160a01b0316600090815260076020526040812055600101610e42565b5060005b600454811015610f5b57600060036001018281548110610eef57610eef611738565b6000918252602082206002918202018054909350600a91839160ff1690811115610f1b57610f1b611709565b6002811115610f2c57610f2c611709565b815260208082019290925260409081016000908120600195860154825290925290206003018590555001610ecd565b50610f68600460006113e6565b60006005818155600682905590610f806008826113c8565b505050505050565b6000600a6000866002811115610fa057610fa0611709565b6002811115610fb157610fb1611709565b81526020808201929092526040908101600090812087825283528181206001600160a01b038716825260028101909352205490915060ff1615610ff457506102bc565b6001600160a01b03831660009081526002820160205260408120805460ff191660011790556003820154908190036110c1576001600160a01b038416600090815260076020526040812054900361109157600880546001810182556000919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180546001600160a01b0319166001600160a01b0386161790555b6006805460019081019091556001600160a01b038516600090815260076020526040902080549091019055610f80565b828103610f8057600090815260096020908152604080832060018082018054820190556001600160a01b039790971684526002019091529020805490930190925550505050565b60008061111560086109b4565b60405163a3d545f560e01b81524360048201529091506000906001600160a01b0383169063a3d545f590602401602060405180830381865afa15801561115f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611183919061171f565b9050600080836001600160a01b031663468c96ae60036000015460016111a99190611932565b6040518263ffffffff1660e01b81526004016111c791815260200190565b6040805180830381865afa1580156111e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120791906119b1565b9150915081801561121757508086145b8015611224575060035483115b9695505050505050565b60008381526009602090815260408083206001600160a01b0386168452600201909152902054811561127d576001600160a01b038316600090815260076020526040902054610bdd9082611932565b9392505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610ce4576000356001600160e01b0319166001604051620f948f60ea1b81526004016102239291906119e4565b806001600160a01b03163b600003610cd557604051630bfc64a360e21b81526001600160a01b0382166004820152602401610223565b80516060908067ffffffffffffffff8111156113325761133261174e565b60405190808252806020026020018201604052801561135b578160200160208202803683370190505b509150600061136985611108565b905060005b828110156113bf5761139a8686838151811061138c5761138c611738565b60200260200101518461122e565b8482815181106113ac576113ac611738565b602090810291909101015260010161136e565b50505092915050565b5080546000825590600052602060002090810190610cd59190611407565b5080546000825560020290600052602060002090810190610cd59190611420565b5b8082111561141c5760008155600101611408565b5090565b5b8082111561141c57805460ff1916815560006001820155600201611421565b6001600160a01b0381168114610cd557600080fd5b60008060006060848603121561146a57600080fd5b833561147581611440565b9250602084013561148581611440565b929592945050506040919091013590565b8035600381106109af57600080fd5b600080604083850312156114b857600080fd5b6114c183611496565b946020939093013593505050565b600080604083850312156114e257600080fd5b8235915060208301356114f481611440565b809150509250929050565b8035600e81106109af57600080fd5b6000806040838503121561152157600080fd5b61152a836114ff565b915060208301356114f481611440565b60008060006060848603121561154f57600080fd5b61155884611496565b925060208401359150604084013561156f81611440565b809150509250925092565b60006020828403121561158c57600080fd5b5035919050565b6000602082840312156115a557600080fd5b61047f826114ff565b6000806000606084860312156115c357600080fd5b83356115ce81611440565b925060208401356115de81611440565b9150604084013561156f81611440565b60008060006040848603121561160357600080fd5b83359250602084013567ffffffffffffffff8082111561162257600080fd5b818601915086601f83011261163657600080fd5b81358181111561164557600080fd5b8760208260051b850101111561165a57600080fd5b6020830194508093505050509250925092565b600081518084526020808501945080840160005b8381101561169d57815187529582019590820190600101611681565b509495945050505050565b60208152600061047f602083018461166d565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561173157600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b80516109af81611440565b6000602080838503121561178257600080fd5b825167ffffffffffffffff8082111561179a57600080fd5b818501915085601f8301126117ae57600080fd5b8151818111156117c0576117c061174e565b8060051b604051601f19603f830116810181811085821117156117e5576117e561174e565b60405291825284820192508381018501918883111561180357600080fd5b938501935b828510156118285761181985611764565b84529385019392850192611808565b98975050505050505050565b60a0808252865190820181905260009060209060c0840190828a01845b828110156118765781516001600160a01b031684529284019290840190600101611851565b5050508381038285015261188a818961166d565b6040850197909752505050606081019290925260809091015292915050565b60005b838110156118c45781810151838201526020016118ac565b50506000910152565b600082516118df8184602087016118a9565b9190910192915050565b60208152600082518060208401526119088160408501602087016118a9565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b808201808211156104825761048261191c565b600e811061195557611955611709565b9052565b602081016104828284611945565b818103818111156104825761048261191c565b6001600160e01b031984168152606081016119986020830185611945565b6001600160a01b03929092166040919091015292915050565b600080604083850312156119c457600080fd5b825180151581146119d457600080fd5b6020939093015192949293505050565b6001600160e01b0319831681526040810160098310611a0557611a05611709565b826020830152939250505056fea164736f6c6343000811000a", - "devdoc": { - "errors": { - "ErrContractTypeNotFound(uint8)": [ + "stateMutability": "view" + }, + { + "type": "event", + "name": "ContractUpdated", + "inputs": [ { - "details": "Error of invalid role." + "name": "contractType", + "type": "uint8", + "indexed": true, + "internalType": "enum ContractType" + }, + { + "name": "addr", + "type": "address", + "indexed": true, + "internalType": "address" } ], - "ErrUnauthorized(bytes4,uint8)": [ + "anonymous": false + }, + { + "type": "event", + "name": "ExternalCallFailed", + "inputs": [ { - "details": "Error indicating that the caller is unauthorized to perform a specific function.", - "params": { - "expectedRole": "The role required to perform the function.", - "msgSig": "The function signature (bytes4) that the caller is unauthorized to perform." - } + "name": "to", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "msgSig", + "type": "bytes4", + "indexed": true, + "internalType": "bytes4" + }, + { + "name": "reason", + "type": "bytes", + "indexed": false, + "internalType": "bytes" } ], - "ErrUnexpectedInternalCall(bytes4,uint8,address)": [ + "anonymous": false + }, + { + "type": "event", + "name": "Initialized", + "inputs": [ { - "details": "Error indicating that the caller is unauthorized to perform a specific function.", - "params": { - "actual": "The actual address that called to the function.", - "expectedContractType": "The contract type required to perform the function.", - "msgSig": "The function signature (bytes4)." - } + "name": "version", + "type": "uint8", + "indexed": false, + "internalType": "uint8" } ], - "ErrZeroCodeContract(address)": [ + "anonymous": false + }, + { + "type": "error", + "name": "ErrContractTypeNotFound", + "inputs": [ { - "details": "Error of set to non-contract." + "name": "contractType", + "type": "uint8", + "internalType": "enum ContractType" } ] }, + { + "type": "error", + "name": "ErrUnauthorized", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + }, + { + "name": "expectedRole", + "type": "uint8", + "internalType": "enum RoleAccess" + } + ] + }, + { + "type": "error", + "name": "ErrUnexpectedInternalCall", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + }, + { + "name": "expectedContractType", + "type": "uint8", + "internalType": "enum ContractType" + }, + { + "name": "actual", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ErrZeroCodeContract", + "inputs": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + } + ] + } + ], + "address": "0x3a3A92ba9d4D49aae06861136D547667c742F1aF", + "args": "0x", + "ast": "", + "blockNumber": 26515571, + "bytecode": "0x608060405234801561001057600080fd5b5061001961001e565b6100eb565b600154600160a81b900460ff161561008c5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60015460ff600160a01b909104811610156100e9576001805460ff60a01b191660ff60a01b17905560405160ff81527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b611ad5806100fa6000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063c7c4fea91161008c578063de981f1b11610066578063de981f1b1461017e578063e2a75f36146101a9578063f67e8152146101bc578063f84bd121146101dc57600080fd5b8063c7c4fea914610145578063ca21287e14610158578063d25ed4c61461016b57600080fd5b80631794bb3c146100d4578063229f88ea146100e95780633b154455146100fc5780634ac0bcda146101045780635cd8a76b1461012a578063865e6fd314610132575b600080fd5b6100e76100e23660046114df565b6101e4565b005b6100e76100f736600461152f565b6102e4565b6100e761048c565b610117610112366004611559565b61055c565b6040519081526020015b60405180910390f35b6100e761057a565b6100e7610140366004611598565b610673565b6100e76101533660046115c4565b610692565b6100e7610166366004611604565b610a6b565b610117610179366004611660565b610b56565b61019161018c366004611679565b610b8b565b6040516001600160a01b039091168152602001610121565b6101176101b7366004611660565b610c01565b6101cf6101ca366004611694565b610c2b565b604051610121919061174f565b600254610117565b600154600160a81b900460ff161580801561020a575060018054600160a01b900460ff16105b8061022a5750303b15801561022a575060018054600160a01b900460ff16145b61024f5760405162461bcd60e51b815260040161024690611762565b60405180910390fd5b6001805460ff60a01b1916600160a01b179055801561027c576001805460ff60a81b1916600160a81b1790555b610287600285610c72565b610292600884610c72565b600282905580156102de576001805460ff60a81b191681556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b60026102ef81610d16565b6102f7610d62565b6000600a600085600281111561030f5761030f6117b0565b6002811115610320576103206117b0565b81526020019081526020016000206000848152602001908152602001600020905080600001546000036102de57610355610d70565b60006103616008610b8b565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa15801561039e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c291906117c6565b808355600480546001818101835560009290925260029081027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018054939450928892849260ff1990921691849081111561041f5761041f6117b0565b02179055506001808201869055830160005b81548110156104745761046c8888848481548110610451576104516117df565b6000918252602090912001546001600160a01b031687611012565b600101610431565b50610483600185016000611452565b50505050505050565b600461049781610d16565b600019600b54146104df5760405162461bcd60e51b815260206004820152601260248201527130b63932b0b23c9034b734ba103932b8101960711b6044820152606401610246565b6104e96008610b8b565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610526573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054a91906117c6565b600b5561055960046000610c72565b50565b6000610571838361056c86611192565b6112b8565b90505b92915050565b600154600290600160a81b900460ff161580156105a5575060015460ff808316600160a01b90920416105b6105c15760405162461bcd60e51b815260040161024690611762565b6001805460ff60a81b1960ff8416600160a01b021661ffff60a01b1990911617600160a81b179055600054610601906002906001600160a01b0316610c72565b600154610619906008906001600160a01b0316610c72565b600080546001600160a01b031916905560018054600161ff0160a01b031916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b61067b61130e565b61068481611368565b61068e8282610c72565b5050565b600261069d81610d16565b6106a5610d62565b60006106b16008610b8b565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106ee573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071291906117c6565b905061071c610d70565b6000600a6000876002811115610734576107346117b0565b6002811115610745576107456117b0565b81526020019081526020016000206000868152602001908152602001600020905080600001546000036107a7576001908101805491820181556000908152602090200180546001600160a01b0319166001600160a01b038516179055506102de565b6107b386868685611012565b600b548281101561048357600b8381556000906107cf90610b8b565b6001600160a01b0316639b19dbfd6040518163ffffffff1660e01b8152600401600060405180830381865afa15801561080c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108349190810190611816565b90506000610842838361139e565b9050600061084f84610c01565b9050600061085c85610b56565b9050600061086a600c610b8b565b9050600080826001600160a01b0316878786888c6040516024016108929594939291906118db565b60408051601f198184030181529181526020820180516001600160e01b0316634dca592560e01b179052516108c79190611975565b6000604051808303816000865af19150503d8060008114610904576040519150601f19603f3d011682016040523d82523d6000602084013e610909565b606091505b50915091508161096057604051634dca592560e01b906001600160a01b038516907feaa424ccc38ebcf22402729592dedf8315790e0128cb577cdeff1a3ee627f82790610957908590611991565b60405180910390a35b600061096c600d610b8b565b9050806001600160a01b03168b60405160240161098b91815260200190565b60408051601f198184030181529181526020820180516001600160e01b03166302ddfca960e61b179052516109c09190611975565b6000604051808303816000865af19150503d80600081146109fd576040519150601f19603f3d011682016040523d82523d6000602084013e610a02565b606091505b50909350915082610a5a576040516302ddfca960e61b906001600160a01b038316907feaa424ccc38ebcf22402729592dedf8315790e0128cb577cdeff1a3ee627f82790610a51908690611991565b60405180910390a35b505050505050505050505050505050565b600154600390600160a81b900460ff16158015610a96575060015460ff808316600160a01b90920416105b610ab25760405162461bcd60e51b815260040161024690611762565b6001805460ff60a81b1960ff8416600160a01b021661ffff60a01b1990911617600160a81b179055610ae5600b86610c72565b610af0600c85610c72565b610afb600d84610c72565b610b06600483610c72565b600019600b556001805460ff60a81b1916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050565b600081815260096020526040902060010154610b7182611192565b15610b8657600654610b8390826119c4565b90505b919050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115610bc257610bc26117b0565b60ff1681526020810191909152604001600020546001600160a01b0316905080610b86578160405163409140df60e11b815260040161024691906119f9565b600081815260096020526040902054610c1982611192565b15610b8657600454610b8390826119c4565b6060610c6a8484848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061139e92505050565b949350505050565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f811115610ca857610ca86117b0565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115610ce957610ce96117b0565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b610d1f81610b8b565b6001600160a01b0316336001600160a01b031614610559576000356001600160e01b03191681336040516320e0f98d60e21b815260040161024693929190611a07565b600254431015610d6e57005b565b6000610d7c6008610b8b565b60405163a3d545f560e01b81524360048201529091506000906001600160a01b0383169063a3d545f590602401602060405180830381865afa158015610dc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dea91906117c6565b905080600360000154101561068e576000826001600160a01b031663468c96ae6003600001546001610e1c91906119c4565b6040518263ffffffff1660e01b8152600401610e3a91815260200190565b6040805180830381865afa158015610e56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7a9190611a3e565b60038490556000818152600960205260408120600454815493955090935091839190610ea79084906119c4565b9091555050600654600182018054600090610ec39084906119c4565b90915550600090505b600854811015610f5357600880546000919083908110610eee57610eee6117df565b60009182526020808320909101546001600160a01b0316808352600782526040808420546002880190935283208054919450919290610f2e9084906119c4565b90915550506001600160a01b0316600090815260076020526040812055600101610ecc565b5060005b600454811015610fe557600060036001018281548110610f7957610f796117df565b6000918252602082206002918202018054909350600a91839160ff1690811115610fa557610fa56117b0565b6002811115610fb657610fb66117b0565b815260208082019290925260409081016000908120600195860154825290925290206003018590555001610f57565b50610ff260046000611470565b6000600581815560068290559061100a600882611452565b505050505050565b6000600a600086600281111561102a5761102a6117b0565b600281111561103b5761103b6117b0565b81526020808201929092526040908101600090812087825283528181206001600160a01b038716825260028101909352205490915060ff161561107e57506102de565b6001600160a01b03831660009081526002820160205260408120805460ff1916600117905560038201549081900361114b576001600160a01b038416600090815260076020526040812054900361111b57600880546001810182556000919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180546001600160a01b0319166001600160a01b0386161790555b6006805460019081019091556001600160a01b03851660009081526007602052604090208054909101905561100a565b82810361100a57600090815260096020908152604080832060018082018054820190556001600160a01b039790971684526002019091529020805490930190925550505050565b60008061119f6008610b8b565b60405163a3d545f560e01b81524360048201529091506000906001600160a01b0383169063a3d545f590602401602060405180830381865afa1580156111e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120d91906117c6565b9050600080836001600160a01b031663468c96ae600360000154600161123391906119c4565b6040518263ffffffff1660e01b815260040161125191815260200190565b6040805180830381865afa15801561126d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112919190611a3e565b915091508180156112a157508086145b80156112ae575060035483115b9695505050505050565b60008381526009602090815260408083206001600160a01b03861684526002019091529020548115611307576001600160a01b038316600090815260076020526040902054610c6a90826119c4565b9392505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610d6e576000356001600160e01b0319166001604051620f948f60ea1b8152600401610246929190611a71565b806001600160a01b03163b60000361055957604051630bfc64a360e21b81526001600160a01b0382166004820152602401610246565b80516060908067ffffffffffffffff8111156113bc576113bc6117f5565b6040519080825280602002602001820160405280156113e5578160200160208202803683370190505b50915060006113f385611192565b905060005b828110156114495761142486868381518110611416576114166117df565b6020026020010151846112b8565b848281518110611436576114366117df565b60209081029190910101526001016113f8565b50505092915050565b50805460008255906000526020600020908101906105599190611491565b508054600082556002029060005260206000209081019061055991906114aa565b5b808211156114a65760008155600101611492565b5090565b5b808211156114a657805460ff19168155600060018201556002016114ab565b6001600160a01b038116811461055957600080fd5b6000806000606084860312156114f457600080fd5b83356114ff816114ca565b9250602084013561150f816114ca565b929592945050506040919091013590565b803560038110610b8657600080fd5b6000806040838503121561154257600080fd5b61154b83611520565b946020939093013593505050565b6000806040838503121561156c57600080fd5b82359150602083013561157e816114ca565b809150509250929050565b803560108110610b8657600080fd5b600080604083850312156115ab57600080fd5b6115b483611589565b9150602083013561157e816114ca565b6000806000606084860312156115d957600080fd5b6115e284611520565b92506020840135915060408401356115f9816114ca565b809150509250925092565b6000806000806080858703121561161a57600080fd5b8435611625816114ca565b93506020850135611635816114ca565b92506040850135611645816114ca565b91506060850135611655816114ca565b939692955090935050565b60006020828403121561167257600080fd5b5035919050565b60006020828403121561168b57600080fd5b61057182611589565b6000806000604084860312156116a957600080fd5b83359250602084013567ffffffffffffffff808211156116c857600080fd5b818601915086601f8301126116dc57600080fd5b8135818111156116eb57600080fd5b8760208260051b850101111561170057600080fd5b6020830194508093505050509250925092565b60008151808452602080850194506020840160005b8381101561174457815187529582019590820190600101611728565b509495945050505050565b6020815260006105716020830184611713565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b6000602082840312156117d857600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8051610b86816114ca565b6000602080838503121561182957600080fd5b825167ffffffffffffffff8082111561184157600080fd5b818501915085601f83011261185557600080fd5b815181811115611867576118676117f5565b8060051b604051601f19603f8301168101818110858211171561188c5761188c6117f5565b6040529182528482019250838101850191888311156118aa57600080fd5b938501935b828510156118cf576118c08561180b565b845293850193928501926118af565b98975050505050505050565b60a0808252865190820181905260009060209060c0840190828a01845b8281101561191d5781516001600160a01b0316845292840192908401906001016118f8565b50505083810360208501526119328189611713565b6040850197909752505050606081019290925260809091015292915050565b60005b8381101561196c578181015183820152602001611954565b50506000910152565b60008251611987818460208701611951565b9190910192915050565b60208152600082518060208401526119b0816040850160208701611951565b601f01601f19169190910160400192915050565b8082018082111561057457634e487b7160e01b600052601160045260246000fd5b601081106119f5576119f56117b0565b9052565b6020810161057482846119e5565b6001600160e01b03198416815260608101611a2560208301856119e5565b6001600160a01b03929092166040919091015292915050565b60008060408385031215611a5157600080fd5b82518015158114611a6157600080fd5b6020939093015192949293505050565b6001600160e01b03198316815260408101600b8310611a9257611a926117b0565b826020830152939250505056fea2646970667358221220262d80d2feb74067f3cddee2705a4fff0aac4921a9a54ee2314b0f244bccac3e64736f6c63430008170033", + "chainId": 2021, + "contractAbsolutePath": "BridgeTracking.sol", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063c7c4fea91161008c578063de981f1b11610066578063de981f1b1461017e578063e2a75f36146101a9578063f67e8152146101bc578063f84bd121146101dc57600080fd5b8063c7c4fea914610145578063ca21287e14610158578063d25ed4c61461016b57600080fd5b80631794bb3c146100d4578063229f88ea146100e95780633b154455146100fc5780634ac0bcda146101045780635cd8a76b1461012a578063865e6fd314610132575b600080fd5b6100e76100e23660046114df565b6101e4565b005b6100e76100f736600461152f565b6102e4565b6100e761048c565b610117610112366004611559565b61055c565b6040519081526020015b60405180910390f35b6100e761057a565b6100e7610140366004611598565b610673565b6100e76101533660046115c4565b610692565b6100e7610166366004611604565b610a6b565b610117610179366004611660565b610b56565b61019161018c366004611679565b610b8b565b6040516001600160a01b039091168152602001610121565b6101176101b7366004611660565b610c01565b6101cf6101ca366004611694565b610c2b565b604051610121919061174f565b600254610117565b600154600160a81b900460ff161580801561020a575060018054600160a01b900460ff16105b8061022a5750303b15801561022a575060018054600160a01b900460ff16145b61024f5760405162461bcd60e51b815260040161024690611762565b60405180910390fd5b6001805460ff60a01b1916600160a01b179055801561027c576001805460ff60a81b1916600160a81b1790555b610287600285610c72565b610292600884610c72565b600282905580156102de576001805460ff60a81b191681556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b60026102ef81610d16565b6102f7610d62565b6000600a600085600281111561030f5761030f6117b0565b6002811115610320576103206117b0565b81526020019081526020016000206000848152602001908152602001600020905080600001546000036102de57610355610d70565b60006103616008610b8b565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa15801561039e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c291906117c6565b808355600480546001818101835560009290925260029081027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018054939450928892849260ff1990921691849081111561041f5761041f6117b0565b02179055506001808201869055830160005b81548110156104745761046c8888848481548110610451576104516117df565b6000918252602090912001546001600160a01b031687611012565b600101610431565b50610483600185016000611452565b50505050505050565b600461049781610d16565b600019600b54146104df5760405162461bcd60e51b815260206004820152601260248201527130b63932b0b23c9034b734ba103932b8101960711b6044820152606401610246565b6104e96008610b8b565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610526573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054a91906117c6565b600b5561055960046000610c72565b50565b6000610571838361056c86611192565b6112b8565b90505b92915050565b600154600290600160a81b900460ff161580156105a5575060015460ff808316600160a01b90920416105b6105c15760405162461bcd60e51b815260040161024690611762565b6001805460ff60a81b1960ff8416600160a01b021661ffff60a01b1990911617600160a81b179055600054610601906002906001600160a01b0316610c72565b600154610619906008906001600160a01b0316610c72565b600080546001600160a01b031916905560018054600161ff0160a01b031916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b61067b61130e565b61068481611368565b61068e8282610c72565b5050565b600261069d81610d16565b6106a5610d62565b60006106b16008610b8b565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106ee573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071291906117c6565b905061071c610d70565b6000600a6000876002811115610734576107346117b0565b6002811115610745576107456117b0565b81526020019081526020016000206000868152602001908152602001600020905080600001546000036107a7576001908101805491820181556000908152602090200180546001600160a01b0319166001600160a01b038516179055506102de565b6107b386868685611012565b600b548281101561048357600b8381556000906107cf90610b8b565b6001600160a01b0316639b19dbfd6040518163ffffffff1660e01b8152600401600060405180830381865afa15801561080c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108349190810190611816565b90506000610842838361139e565b9050600061084f84610c01565b9050600061085c85610b56565b9050600061086a600c610b8b565b9050600080826001600160a01b0316878786888c6040516024016108929594939291906118db565b60408051601f198184030181529181526020820180516001600160e01b0316634dca592560e01b179052516108c79190611975565b6000604051808303816000865af19150503d8060008114610904576040519150601f19603f3d011682016040523d82523d6000602084013e610909565b606091505b50915091508161096057604051634dca592560e01b906001600160a01b038516907feaa424ccc38ebcf22402729592dedf8315790e0128cb577cdeff1a3ee627f82790610957908590611991565b60405180910390a35b600061096c600d610b8b565b9050806001600160a01b03168b60405160240161098b91815260200190565b60408051601f198184030181529181526020820180516001600160e01b03166302ddfca960e61b179052516109c09190611975565b6000604051808303816000865af19150503d80600081146109fd576040519150601f19603f3d011682016040523d82523d6000602084013e610a02565b606091505b50909350915082610a5a576040516302ddfca960e61b906001600160a01b038316907feaa424ccc38ebcf22402729592dedf8315790e0128cb577cdeff1a3ee627f82790610a51908690611991565b60405180910390a35b505050505050505050505050505050565b600154600390600160a81b900460ff16158015610a96575060015460ff808316600160a01b90920416105b610ab25760405162461bcd60e51b815260040161024690611762565b6001805460ff60a81b1960ff8416600160a01b021661ffff60a01b1990911617600160a81b179055610ae5600b86610c72565b610af0600c85610c72565b610afb600d84610c72565b610b06600483610c72565b600019600b556001805460ff60a81b1916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050565b600081815260096020526040902060010154610b7182611192565b15610b8657600654610b8390826119c4565b90505b919050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115610bc257610bc26117b0565b60ff1681526020810191909152604001600020546001600160a01b0316905080610b86578160405163409140df60e11b815260040161024691906119f9565b600081815260096020526040902054610c1982611192565b15610b8657600454610b8390826119c4565b6060610c6a8484848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061139e92505050565b949350505050565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f811115610ca857610ca86117b0565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115610ce957610ce96117b0565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b610d1f81610b8b565b6001600160a01b0316336001600160a01b031614610559576000356001600160e01b03191681336040516320e0f98d60e21b815260040161024693929190611a07565b600254431015610d6e57005b565b6000610d7c6008610b8b565b60405163a3d545f560e01b81524360048201529091506000906001600160a01b0383169063a3d545f590602401602060405180830381865afa158015610dc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dea91906117c6565b905080600360000154101561068e576000826001600160a01b031663468c96ae6003600001546001610e1c91906119c4565b6040518263ffffffff1660e01b8152600401610e3a91815260200190565b6040805180830381865afa158015610e56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7a9190611a3e565b60038490556000818152600960205260408120600454815493955090935091839190610ea79084906119c4565b9091555050600654600182018054600090610ec39084906119c4565b90915550600090505b600854811015610f5357600880546000919083908110610eee57610eee6117df565b60009182526020808320909101546001600160a01b0316808352600782526040808420546002880190935283208054919450919290610f2e9084906119c4565b90915550506001600160a01b0316600090815260076020526040812055600101610ecc565b5060005b600454811015610fe557600060036001018281548110610f7957610f796117df565b6000918252602082206002918202018054909350600a91839160ff1690811115610fa557610fa56117b0565b6002811115610fb657610fb66117b0565b815260208082019290925260409081016000908120600195860154825290925290206003018590555001610f57565b50610ff260046000611470565b6000600581815560068290559061100a600882611452565b505050505050565b6000600a600086600281111561102a5761102a6117b0565b600281111561103b5761103b6117b0565b81526020808201929092526040908101600090812087825283528181206001600160a01b038716825260028101909352205490915060ff161561107e57506102de565b6001600160a01b03831660009081526002820160205260408120805460ff1916600117905560038201549081900361114b576001600160a01b038416600090815260076020526040812054900361111b57600880546001810182556000919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180546001600160a01b0319166001600160a01b0386161790555b6006805460019081019091556001600160a01b03851660009081526007602052604090208054909101905561100a565b82810361100a57600090815260096020908152604080832060018082018054820190556001600160a01b039790971684526002019091529020805490930190925550505050565b60008061119f6008610b8b565b60405163a3d545f560e01b81524360048201529091506000906001600160a01b0383169063a3d545f590602401602060405180830381865afa1580156111e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120d91906117c6565b9050600080836001600160a01b031663468c96ae600360000154600161123391906119c4565b6040518263ffffffff1660e01b815260040161125191815260200190565b6040805180830381865afa15801561126d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112919190611a3e565b915091508180156112a157508086145b80156112ae575060035483115b9695505050505050565b60008381526009602090815260408083206001600160a01b03861684526002019091529020548115611307576001600160a01b038316600090815260076020526040902054610c6a90826119c4565b9392505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610d6e576000356001600160e01b0319166001604051620f948f60ea1b8152600401610246929190611a71565b806001600160a01b03163b60000361055957604051630bfc64a360e21b81526001600160a01b0382166004820152602401610246565b80516060908067ffffffffffffffff8111156113bc576113bc6117f5565b6040519080825280602002602001820160405280156113e5578160200160208202803683370190505b50915060006113f385611192565b905060005b828110156114495761142486868381518110611416576114166117df565b6020026020010151846112b8565b848281518110611436576114366117df565b60209081029190910101526001016113f8565b50505092915050565b50805460008255906000526020600020908101906105599190611491565b508054600082556002029060005260206000209081019061055991906114aa565b5b808211156114a65760008155600101611492565b5090565b5b808211156114a657805460ff19168155600060018201556002016114ab565b6001600160a01b038116811461055957600080fd5b6000806000606084860312156114f457600080fd5b83356114ff816114ca565b9250602084013561150f816114ca565b929592945050506040919091013590565b803560038110610b8657600080fd5b6000806040838503121561154257600080fd5b61154b83611520565b946020939093013593505050565b6000806040838503121561156c57600080fd5b82359150602083013561157e816114ca565b809150509250929050565b803560108110610b8657600080fd5b600080604083850312156115ab57600080fd5b6115b483611589565b9150602083013561157e816114ca565b6000806000606084860312156115d957600080fd5b6115e284611520565b92506020840135915060408401356115f9816114ca565b809150509250925092565b6000806000806080858703121561161a57600080fd5b8435611625816114ca565b93506020850135611635816114ca565b92506040850135611645816114ca565b91506060850135611655816114ca565b939692955090935050565b60006020828403121561167257600080fd5b5035919050565b60006020828403121561168b57600080fd5b61057182611589565b6000806000604084860312156116a957600080fd5b83359250602084013567ffffffffffffffff808211156116c857600080fd5b818601915086601f8301126116dc57600080fd5b8135818111156116eb57600080fd5b8760208260051b850101111561170057600080fd5b6020830194508093505050509250925092565b60008151808452602080850194506020840160005b8381101561174457815187529582019590820190600101611728565b509495945050505050565b6020815260006105716020830184611713565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b6000602082840312156117d857600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8051610b86816114ca565b6000602080838503121561182957600080fd5b825167ffffffffffffffff8082111561184157600080fd5b818501915085601f83011261185557600080fd5b815181811115611867576118676117f5565b8060051b604051601f19603f8301168101818110858211171561188c5761188c6117f5565b6040529182528482019250838101850191888311156118aa57600080fd5b938501935b828510156118cf576118c08561180b565b845293850193928501926118af565b98975050505050505050565b60a0808252865190820181905260009060209060c0840190828a01845b8281101561191d5781516001600160a01b0316845292840192908401906001016118f8565b50505083810360208501526119328189611713565b6040850197909752505050606081019290925260809091015292915050565b60005b8381101561196c578181015183820152602001611954565b50506000910152565b60008251611987818460208701611951565b9190910192915050565b60208152600082518060208401526119b0816040850160208701611951565b601f01601f19169190910160400192915050565b8082018082111561057457634e487b7160e01b600052601160045260246000fd5b601081106119f5576119f56117b0565b9052565b6020810161057482846119e5565b6001600160e01b03198416815260608101611a2560208301856119e5565b6001600160a01b03929092166040919091015292915050565b60008060408385031215611a5157600080fd5b82518015158114611a6157600080fd5b6020939093015192949293505050565b6001600160e01b03198316815260408101600b8310611a9257611a926117b0565b826020830152939250505056fea2646970667358221220262d80d2feb74067f3cddee2705a4fff0aac4921a9a54ee2314b0f244bccac3e64736f6c63430008170033", + "deployer": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "devdoc": { + "version": 1, "kind": "dev", "methods": { "getContract(uint8)": { @@ -440,6 +395,9 @@ "initialize(address,address,uint256)": { "details": "Initializes the contract storage." }, + "initializeREP2()": { + "details": "Helper for running upgrade script, required to only revoked once by the DPoS's governance admin. The following must be assured after initializing REP2: `_lastSyncPeriod` == `{BridgeReward}.latestRewardedPeriod + 1` == `{BridgeSlash}._startedAtPeriod - 1` == `currentPeriod()`" + }, "recordVote(uint8,uint256,address)": { "details": "Records vote for a receipt and a operator. Requirements: - The method caller is the bridge contract." }, @@ -463,99 +421,119 @@ "details": "Returns the total number of votes at the specific period `_period`." } }, - "stateVariables": { - "_bufferMetric": { - "details": "The temporary info of votes and ballots" - }, - "_lastSyncPeriod": { - "details": "The latest period that get synced with bridge's slashing and rewarding contract" + "events": { + "ContractUpdated(uint8,address)": { + "details": "Emitted when a contract is updated." }, - "_periodMetric": { - "details": "Mapping from period number => vote stats based on period" - }, - "_receiptTrackingInfo": { - "details": "Mapping from vote kind => receipt id => receipt stats" - }, - "_startedAtBlock": { - "details": "The block that the contract allows incoming mutable calls." + "Initialized(uint8)": { + "details": "Triggered when the contract has been initialized or reinitialized." } }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 + "errors": { + "ErrContractTypeNotFound(uint8)": [ + { + "details": "Error of invalid role." + } + ], + "ErrUnauthorized(bytes4,uint8)": [ + { + "details": "Error indicating that the caller is unauthorized to perform a specific function.", + "params": { + "expectedRole": "The role required to perform the function.", + "msgSig": "The function signature (bytes4) that the caller is unauthorized to perform." + } + } + ], + "ErrUnexpectedInternalCall(bytes4,uint8,address)": [ + { + "details": "Error indicating that the caller is unauthorized to perform a specific function.", + "params": { + "actual": "The actual address that called to the function.", + "expectedContractType": "The contract type required to perform the function.", + "msgSig": "The function signature (bytes4)." + } + } + ], + "ErrZeroCodeContract(address)": [ + { + "details": "Error of set to non-contract." + } + ] + } }, + "isFoundry": true, + "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"ErrContractTypeNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum RoleAccess\",\"name\":\"expectedRole\",\"type\":\"uint8\"}],\"name\":\"ErrUnauthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum ContractType\",\"name\":\"expectedContractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"actual\",\"type\":\"address\"}],\"name\":\"ErrUnexpectedInternalCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrZeroCodeContract\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ContractUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"reason\",\"type\":\"bytes\"}],\"name\":\"ExternalCallFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"getContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"contract_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"period\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"operators\",\"type\":\"address[]\"}],\"name\":\"getManyTotalBallots\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"_res\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum IBridgeTracking.VoteKind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"name\":\"handleVoteApproved\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeContract\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"validatorContract\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"startedAtBlock_\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initializeREP2\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initializeV2\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeManager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"bridgeSlash\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"bridgeReward\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"dposGA\",\"type\":\"address\"}],\"name\":\"initializeV3\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum IBridgeTracking.VoteKind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"recordVote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startedAtBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"period\",\"type\":\"uint256\"}],\"name\":\"totalBallot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"totalBallot_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"period\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"bridgeOperator\",\"type\":\"address\"}],\"name\":\"totalBallotOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"period\",\"type\":\"uint256\"}],\"name\":\"totalVote\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"totalVote_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"ErrContractTypeNotFound(uint8)\":[{\"details\":\"Error of invalid role.\"}],\"ErrUnauthorized(bytes4,uint8)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"expectedRole\":\"The role required to perform the function.\",\"msgSig\":\"The function signature (bytes4) that the caller is unauthorized to perform.\"}}],\"ErrUnexpectedInternalCall(bytes4,uint8,address)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"actual\":\"The actual address that called to the function.\",\"expectedContractType\":\"The contract type required to perform the function.\",\"msgSig\":\"The function signature (bytes4).\"}}],\"ErrZeroCodeContract(address)\":[{\"details\":\"Error of set to non-contract.\"}]},\"events\":{\"ContractUpdated(uint8,address)\":{\"details\":\"Emitted when a contract is updated.\"},\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"}},\"kind\":\"dev\",\"methods\":{\"getContract(uint8)\":{\"details\":\"Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.\",\"params\":{\"contractType\":\"The role of the contract to retrieve.\"},\"returns\":{\"contract_\":\"The address of the contract with the specified role.\"}},\"getManyTotalBallots(uint256,address[])\":{\"details\":\"Returns the total number of ballots of bridge operators at the specific period `_period`.\"},\"handleVoteApproved(uint8,uint256)\":{\"details\":\"Handles the request once it is approved. Requirements: - The method caller is the bridge contract.\"},\"initialize(address,address,uint256)\":{\"details\":\"Initializes the contract storage.\"},\"initializeREP2()\":{\"details\":\"Helper for running upgrade script, required to only revoked once by the DPoS's governance admin. The following must be assured after initializing REP2: `_lastSyncPeriod` == `{BridgeReward}.latestRewardedPeriod + 1` == `{BridgeSlash}._startedAtPeriod - 1` == `currentPeriod()`\"},\"recordVote(uint8,uint256,address)\":{\"details\":\"Records vote for a receipt and a operator. Requirements: - The method caller is the bridge contract.\"},\"setContract(uint8,address)\":{\"details\":\"Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.\",\"params\":{\"addr\":\"The address of the contract to set.\",\"contractType\":\"The role of the contract to set.\"}},\"startedAtBlock()\":{\"details\":\"Returns the block that allow incomming mutable call.\"},\"totalBallot(uint256)\":{\"details\":\"Returns the total number of ballots at the specific period `_period`.\"},\"totalBallotOf(uint256,address)\":{\"details\":\"Returns the total number of ballots of a bridge operator at the specific period `_period`.\"},\"totalVote(uint256)\":{\"details\":\"Returns the total number of votes at the specific period `_period`.\"}},\"stateVariables\":{\"_bufferMetric\":{\"details\":\"The temporary info of votes and ballots\"},\"_lastSyncPeriod\":{\"details\":\"The latest period that get synced with bridge's slashing and rewarding contract\"},\"_periodMetric\":{\"details\":\"Mapping from period number => vote stats based on period\"},\"_receiptTrackingInfo\":{\"details\":\"Mapping from vote kind => receipt id => receipt stats\"},\"_startedAtBlock\":{\"details\":\"The block that the contract allows incoming mutable calls.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/ronin/gateway/BridgeTracking.sol\":\"BridgeTracking\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@fdk/=lib/foundry-deployment-kit/script/\",\":@openzeppelin/=lib/openzeppelin-contracts/\",\":@prb/math/=lib/prb-math/\",\":@prb/test/=lib/prb-test/src/\",\":@ronin/contracts/=src/\",\":@ronin/script/=script/\",\":@ronin/test/=test/\",\":contract-libs/=lib/foundry-deployment-kit/lib/contract-libs/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/foundry-deployment-kit/lib/forge-std/src/\",\":foundry-deployment-kit/=lib/foundry-deployment-kit/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/contracts/\",\":prb-math/=lib/prb-math/src/\",\":prb-test/=lib/prb-test/src/\",\":solady/=lib/solady/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0xa6a787e7a901af6511e19aa53e1a00352db215a011d2c7a438d0582dd5da76f9\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2a21b14ff90012878752f230d3ffd5c3405e5938d06c97a7d89c0a64561d0d66\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"src/extensions/TransparentUpgradeableProxyV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\\\";\\n\\ncontract TransparentUpgradeableProxyV2 is TransparentUpgradeableProxy {\\n constructor(address _logic, address admin_, bytes memory _data) payable TransparentUpgradeableProxy(_logic, admin_, _data) { }\\n\\n /**\\n * @dev Calls a function from the current implementation as specified by `_data`, which should be an encoded function call.\\n *\\n * Requirements:\\n * - Only the admin can call this function.\\n *\\n * Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid\\n * triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider\\n * reviewing the encoded data `_data` and the method which is called before using this.\\n *\\n */\\n function functionDelegateCall(bytes memory _data) public payable ifAdmin {\\n address _addr = _implementation();\\n assembly {\\n let _result := delegatecall(gas(), _addr, add(_data, 32), mload(_data), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n switch _result\\n case 0 { revert(0, returndatasize()) }\\n default { return(0, returndatasize()) }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x45fc7b71d09da99414b977a56e586b3604670d865e5f36f395d5c98bc4ba64af\",\"license\":\"MIT\"},\"src/extensions/collections/HasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { HasProxyAdmin } from \\\"./HasProxyAdmin.sol\\\";\\nimport \\\"../../interfaces/collections/IHasContracts.sol\\\";\\nimport { IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\nimport { ErrUnexpectedInternalCall } from \\\"../../utils/CommonErrors.sol\\\";\\n\\n/**\\n * @title HasContracts\\n * @dev A contract that provides functionality to manage multiple contracts with different roles.\\n */\\nabstract contract HasContracts is HasProxyAdmin, IHasContracts, IdentityGuard {\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.collections.HasContracts.slot\\\") - 1\\n bytes32 private constant _STORAGE_SLOT = 0xdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb;\\n\\n /**\\n * @dev Modifier to restrict access to functions only to contracts with a specific role.\\n * @param contractType The contract type that allowed to call\\n */\\n modifier onlyContract(ContractType contractType) virtual {\\n _requireContract(contractType);\\n _;\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function setContract(ContractType contractType, address addr) external virtual onlyProxyAdmin {\\n _requireHasCode(addr);\\n _setContract(contractType, addr);\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function getContract(ContractType contractType) public view returns (address contract_) {\\n contract_ = _getContractMap()[uint8(contractType)];\\n if (contract_ == address(0)) revert ErrContractTypeNotFound(contractType);\\n }\\n\\n /**\\n * @dev Internal function to set the address of a contract with a specific role.\\n * @param contractType The contract type of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function _setContract(ContractType contractType, address addr) internal virtual {\\n _getContractMap()[uint8(contractType)] = addr;\\n emit ContractUpdated(contractType, addr);\\n }\\n\\n /**\\n * @dev Internal function to access the mapping of contract addresses with roles.\\n * @return contracts_ The mapping of contract addresses with roles.\\n */\\n function _getContractMap() private pure returns (mapping(uint8 => address) storage contracts_) {\\n assembly {\\n contracts_.slot := _STORAGE_SLOT\\n }\\n }\\n\\n /**\\n * @dev Internal function to check if the calling contract has a specific role.\\n * @param contractType The contract type that the calling contract must have.\\n * @dev Throws an error if the calling contract does not have the specified role.\\n */\\n function _requireContract(ContractType contractType) private view {\\n if (msg.sender != getContract(contractType)) {\\n revert ErrUnexpectedInternalCall(msg.sig, contractType, msg.sender);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7dbefa31230e6e4bd319f02d94893cbfd07ee12a0e016f5fadc57660df01891\",\"license\":\"MIT\"},\"src/extensions/collections/HasProxyAdmin.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/StorageSlot.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\n\\nabstract contract HasProxyAdmin {\\n // bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n modifier onlyProxyAdmin() {\\n _requireProxyAdmin();\\n _;\\n }\\n\\n /**\\n * @dev Returns proxy admin.\\n */\\n function _getProxyAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n function _requireProxyAdmin() internal view {\\n if (msg.sender != _getProxyAdmin()) revert ErrUnauthorized(msg.sig, RoleAccess.ADMIN);\\n }\\n}\\n\",\"keccak256\":\"0xad3db02c99a960b60151f2ad45eed46073d14fe1ed861f496c7aeefacbbc528e\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IBridgeManagerEvents } from \\\"./events/IBridgeManagerEvents.sol\\\";\\n\\n/**\\n * @title IBridgeManager\\n * @dev The interface for managing bridge operators.\\n */\\ninterface IBridgeManager is IBridgeManagerEvents {\\n /// @notice Error indicating that cannot find the querying operator\\n error ErrOperatorNotFound(address operator);\\n /// @notice Error indicating that cannot find the querying governor\\n error ErrGovernorNotFound(address governor);\\n /// @notice Error indicating that the msg.sender is not match the required governor\\n error ErrGovernorNotMatch(address required, address sender);\\n /// @notice Error indicating that the governors list will go below minimum number of required governor.\\n error ErrBelowMinRequiredGovernors();\\n /// @notice Common invalid input error\\n error ErrInvalidInput();\\n\\n /**\\n * @dev The domain separator used for computing hash digests in the contract.\\n */\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n\\n /**\\n * @dev Returns the total number of bridge operators.\\n * @return The total number of bridge operators.\\n */\\n function totalBridgeOperator() external view returns (uint256);\\n\\n /**\\n * @dev Checks if the given address is a bridge operator.\\n * @param addr The address to check.\\n * @return A boolean indicating whether the address is a bridge operator.\\n */\\n function isBridgeOperator(address addr) external view returns (bool);\\n\\n /**\\n * @dev Retrieves the full information of all registered bridge operators.\\n *\\n * This external function allows external callers to obtain the full information of all the registered bridge operators.\\n * The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.\\n *\\n * @return governors An array of addresses representing the governors of each bridge operator.\\n * @return bridgeOperators An array of addresses representing the registered bridge operators.\\n * @return weights An array of uint256 values representing the vote weights of each bridge operator.\\n *\\n * Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator.\\n *\\n * Example Usage:\\n * ```\\n * (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos();\\n * for (uint256 i = 0; i < bridgeOperators.length; i++) {\\n * // Access individual information for each bridge operator.\\n * address governor = governors[i];\\n * address bridgeOperator = bridgeOperators[i];\\n * uint256 weight = weights[i];\\n * // ... (Process or use the information as required) ...\\n * }\\n * ```\\n *\\n */\\n function getFullBridgeOperatorInfos() external view returns (address[] memory governors, address[] memory bridgeOperators, uint96[] memory weights);\\n\\n /**\\n * @dev Returns total weights of the governor list.\\n */\\n function sumGovernorsWeight(address[] calldata governors) external view returns (uint256 sum);\\n\\n /**\\n * @dev Returns total weights.\\n */\\n function getTotalWeight() external view returns (uint256);\\n\\n /**\\n * @dev Returns an array of all bridge operators.\\n * @return An array containing the addresses of all bridge operators.\\n */\\n function getBridgeOperators() external view returns (address[] memory);\\n\\n /**\\n * @dev Returns the corresponding `operator` of a `governor`.\\n */\\n function getOperatorOf(address governor) external view returns (address operator);\\n\\n /**\\n * @dev Returns the corresponding `governor` of a `operator`.\\n */\\n function getGovernorOf(address operator) external view returns (address governor);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific governor.\\n * @param governor The address of the governor to get the vote weight for.\\n * @return voteWeight The vote weight of the specified governor.\\n */\\n function getGovernorWeight(address governor) external view returns (uint96);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific bridge operator.\\n * @param bridgeOperator The address of the bridge operator to get the vote weight for.\\n * @return weight The vote weight of the specified bridge operator.\\n */\\n function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint96 weight);\\n\\n /**\\n * @dev Returns the weights of a list of governor addresses.\\n */\\n function getGovernorWeights(address[] calldata governors) external view returns (uint96[] memory weights);\\n\\n /**\\n * @dev Returns an array of all governors.\\n * @return An array containing the addresses of all governors.\\n */\\n function getGovernors() external view returns (address[] memory);\\n\\n /**\\n * @dev Adds multiple bridge operators.\\n * @param governors An array of addresses of hot/cold wallets for bridge operator to update their node address.\\n * @param bridgeOperators An array of addresses representing the bridge operators to add.\\n */\\n function addBridgeOperators(uint96[] calldata voteWeights, address[] calldata governors, address[] calldata bridgeOperators) external;\\n\\n /**\\n * @dev Removes multiple bridge operators.\\n * @param bridgeOperators An array of addresses representing the bridge operators to remove.\\n */\\n function removeBridgeOperators(address[] calldata bridgeOperators) external;\\n\\n /**\\n * @dev Self-call to update the minimum required governor.\\n * @param min The minimum number, this must not less than 3.\\n */\\n function setMinRequiredGovernor(uint min) external;\\n}\\n\",\"keccak256\":\"0xefc46318a240371031e77ef3c355e2c18432e4479145378de6782277f9b44923\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeReward.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport { IBridgeRewardEvents } from \\\"./events/IBridgeRewardEvents.sol\\\";\\n\\ninterface IBridgeReward is IBridgeRewardEvents {\\n /**\\n * @dev This function allows bridge operators to manually synchronize the reward for a given period length.\\n * @param periodCount The length of the reward period for which synchronization is requested.\\n */\\n function syncRewardManual(uint256 periodCount) external;\\n\\n /**\\n * @dev Receives RON from any address.\\n */\\n function receiveRON() external payable;\\n\\n /**\\n * @dev Invoke calculate and transfer reward to operators based on their performance.\\n *\\n * Requirements:\\n * - This method is only called once each period.\\n * - The caller must be the bridge tracking contract\\n */\\n function execSyncRewardAuto(uint256 currentPeriod) external;\\n\\n /**\\n * @dev Returns the total amount of rewards that have been topped up in the contract.\\n */\\n function getTotalRewardToppedUp() external view returns (uint256);\\n\\n /**\\n * @dev Returns the total reward amount scattered to the operators, excluding the slashed reward and failed-to-transfer reward.\\n */\\n function getTotalRewardScattered() external view returns (uint256);\\n\\n /**\\n * @dev Getter for all bridge operators per period.\\n */\\n function getRewardPerPeriod() external view returns (uint256);\\n\\n /**\\n * @dev External function to retrieve the latest rewarded period in the contract.\\n */\\n function getLatestRewardedPeriod() external view returns (uint256);\\n\\n /**\\n * @dev Returns the claimed and slashed reward amount of the `operator`.\\n */\\n function getRewardInfo(address operator) external view returns (BridgeRewardInfo memory rewardInfo);\\n\\n /**\\n * @dev Setter for all bridge operators per period.\\n */\\n function setRewardPerPeriod(uint256 rewardPerPeriod) external;\\n}\\n\",\"keccak256\":\"0x5707468c0c1f1f9bb104d8a5b3c2ae2ec8ffe09bb91229463b1f7dade3dcdfe7\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeSlash.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IBridgeSlashEvents } from \\\"./events/IBridgeSlashEvents.sol\\\";\\n\\n/**\\n * @title IBridgeSlash\\n * @dev Interface for the BridgeSlash contract to manage slashing functionality for bridge operators.\\n */\\ninterface IBridgeSlash is IBridgeSlashEvents {\\n /**\\n * @dev Slashes the unavailability of bridge operators during a specific period.\\n * @param period The period to slash the bridge operators for.\\n */\\n function execSlashBridgeOperators(address[] calldata operators, uint256[] calldata ballots, uint256 totalBallot, uint256 totalVote, uint256 period) external;\\n\\n /**\\n * @dev Returns the penalize durations for the specified bridge operators.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @return untilPeriods The penalized periods for the bridge operators.\\n */\\n function getSlashUntilPeriodOf(address[] calldata bridgeOperators) external returns (uint256[] memory untilPeriods);\\n\\n /**\\n * @dev Retrieves the added periods of the specified bridge operators.\\n * @param bridgeOperators An array of bridge operator addresses.\\n * @return addedPeriods An array of uint256 values representing the added periods for each bridge operator.\\n */\\n function getAddedPeriodOf(address[] calldata bridgeOperators) external view returns (uint256[] memory addedPeriods);\\n\\n /**\\n * @dev Gets the slash tier based on the given ballot and total ballots.\\n * @param ballot The ballot count for a bridge operator.\\n * @param totalVote The total vote count for the period.\\n * @return tier The slash tier.\\n */\\n function getSlashTier(uint256 ballot, uint256 totalVote) external pure returns (Tier tier);\\n\\n /**\\n * @dev Retrieve the penalty durations for different slash tiers.\\n * @return penaltyDurations The array of penalty durations for each slash tier.\\n */\\n function getPenaltyDurations() external pure returns (uint256[] memory penaltyDurations);\\n\\n /**\\n * @dev Returns the penalty duration for Tier 1 slashing.\\n * @return The duration in period number for Tier 1 slashing.\\n */\\n function TIER_1_PENALTY_DURATION() external view returns (uint256);\\n\\n /**\\n * @dev Returns the penalty duration for Tier 2 slashing.\\n * @return The duration in period number for Tier 2 slashing.\\n */\\n function TIER_2_PENALTY_DURATION() external view returns (uint256);\\n\\n /**\\n * @dev Returns the threshold duration for removing bridge operators.\\n * @return The duration in period number that exceeds which a bridge operator will be removed.\\n */\\n function REMOVE_DURATION_THRESHOLD() external view returns (uint256);\\n\\n /**\\n * @dev External function to retrieve the value of the minimum vote threshold to execute slashing rule.\\n * @return minimumVoteThreshold The minimum vote threshold value.\\n */\\n function MINIMUM_VOTE_THRESHOLD() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xb22e3ead9060f2c139d143b8db4dcda7cdf4e4e3960fa98a481ad8b3a2460134\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeTracking.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeTracking {\\n struct Request {\\n VoteKind kind;\\n uint256 id;\\n }\\n\\n enum VoteKind {\\n Deposit,\\n Withdrawal,\\n MainchainWithdrawal\\n }\\n\\n event ExternalCallFailed(address indexed to, bytes4 indexed msgSig, bytes reason);\\n\\n /**\\n * @dev Returns the block that allow incomming mutable call.\\n */\\n function startedAtBlock() external view returns (uint256);\\n\\n /**\\n * @dev Returns the total number of votes at the specific period `_period`.\\n */\\n function totalVote(uint256 _period) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total number of ballots at the specific period `_period`.\\n */\\n function totalBallot(uint256 _period) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total number of ballots of bridge operators at the specific period `_period`.\\n */\\n function getManyTotalBallots(uint256 _period, address[] calldata _bridgeOperators) external view returns (uint256[] memory);\\n\\n /**\\n * @dev Returns the total number of ballots of a bridge operator at the specific period `_period`.\\n */\\n function totalBallotOf(uint256 _period, address _bridgeOperator) external view returns (uint256);\\n\\n /**\\n * @dev Handles the request once it is approved.\\n *\\n * Requirements:\\n * - The method caller is the bridge contract.\\n *\\n */\\n function handleVoteApproved(VoteKind _kind, uint256 _requestId) external;\\n\\n /**\\n * @dev Records vote for a receipt and a operator.\\n *\\n * Requirements:\\n * - The method caller is the bridge contract.\\n *\\n */\\n function recordVote(VoteKind _kind, uint256 _requestId, address _operator) external;\\n}\\n\",\"keccak256\":\"0x53ac425ff6efebc200030ceef302c2871a4b2edfcc5e512ce326aa704989ff7a\",\"license\":\"MIT\"},\"src/interfaces/bridge/events/IBridgeManagerEvents.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeManagerEvents {\\n /**\\n * @dev Emitted when new bridge operators are added.\\n */\\n event BridgeOperatorsAdded(bool[] statuses, uint96[] voteWeights, address[] governors, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is failed to add.\\n */\\n event BridgeOperatorAddingFailed(address indexed operator);\\n\\n /**\\n * @dev Emitted when bridge operators are removed.\\n */\\n event BridgeOperatorsRemoved(bool[] statuses, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is failed to remove.\\n */\\n event BridgeOperatorRemovingFailed(address indexed operator);\\n\\n /**\\n * @dev Emitted when a bridge operator is updated.\\n */\\n event BridgeOperatorUpdated(address indexed governor, address indexed fromBridgeOperator, address indexed toBridgeOperator);\\n\\n /**\\n * @dev Emitted when the minimum number of required governors is updated.\\n */\\n event MinRequiredGovernorUpdated(uint min);\\n}\\n\",\"keccak256\":\"0x38bc3709c98a7c08fb9b6fa3e07a725903dcb0bd07de8a828bac6c3bcf7d997d\",\"license\":\"MIT\"},\"src/interfaces/bridge/events/IBridgeRewardEvents.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeRewardEvents {\\n /**\\n * @dev Reward-related information for a bridge operator.\\n * @param claimed The amount of rewards claimed by the bridge operator.\\n * @param slashed The amount of rewards that have been slashed from the bridge operator.\\n */\\n struct BridgeRewardInfo {\\n uint256 claimed;\\n uint256 slashed;\\n }\\n\\n /**\\n * @dev Emitted when RON are safely received as rewards in the contract.\\n * @param from The address of the sender who transferred RON tokens as rewards.\\n * @param balanceBefore The balance of the contract before receiving the RON tokens.\\n * @param amount The amount of RON received.\\n */\\n event SafeReceived(address indexed from, uint256 balanceBefore, uint256 amount);\\n /// @dev Event emitted when the reward per period config is updated.\\n event UpdatedRewardPerPeriod(uint256 newRewardPerPeriod);\\n /// @dev Event emitted when the reward of the `operator` is scattered with `amount`.\\n event BridgeRewardScattered(uint256 indexed period, address operator, uint256 amount);\\n /// @dev Event emitted when the reward of the `operator` is slashed with `amount`.\\n event BridgeRewardSlashed(uint256 indexed period, address operator, uint256 amount);\\n /// @dev Event emitted when the reward of the `operator` is scattered with `amount` but failed to transfer.\\n event BridgeRewardScatterFailed(uint256 indexed period, address operator, uint256 amount);\\n /// @dev Event emitted when the requesting period to sync is too far.\\n event BridgeRewardSyncTooFarPeriod(uint256 requestingPeriod, uint256 latestPeriod);\\n\\n error ErrPeriodNotHappen(uint256 currentPeriod, uint256 latestRewardedPeriod, uint256 periodCount);\\n error ErrPeriodAlreadyRewarded(uint256 currentPeriod, uint256 latestRewardedPeriod);\\n error ErrPeriodCountIsZero();\\n}\\n\",\"keccak256\":\"0x715180c3b50edfc2e7b8c4dd6cde55cf383c471a48a96ebc4ca33103a3791356\",\"license\":\"MIT\"},\"src/interfaces/bridge/events/IBridgeSlashEvents.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeSlashEvents {\\n /**\\n * @dev Enumeration representing the slashing tiers for bridge operators.\\n */\\n enum Tier {\\n Tier0,\\n Tier1,\\n Tier2\\n }\\n\\n /**\\n * @dev Struct representing the status of a bridge operator.\\n */\\n struct BridgeSlashInfo {\\n uint128 slashUntilPeriod;\\n uint128 newlyAddedAtPeriod;\\n }\\n\\n /**\\n * @dev Event emitted when a bridge operator is slashed.\\n * @param tier The slash tier of the operator.\\n * @param bridgeOperator The address of the slashed bridge operator.\\n * @param period The period in which the operator is slashed.\\n * @param slashUntilPeriod The period until which the operator is penalized.\\n */\\n event BridgeSlashed(Tier indexed tier, address indexed bridgeOperator, uint256 indexed period, uint256 slashUntilPeriod);\\n\\n /**\\n * @dev Emitted when a removal request is made for a bridge operator.\\n * @param period The period for which the removal request is made.\\n * @param bridgeOperator The address of the bridge operator being requested for removal.\\n */\\n event RemovalRequested(uint256 indexed period, address indexed bridgeOperator);\\n}\\n\",\"keccak256\":\"0x43850ce839ef382c6e6d176e1de4de776fb54b7baa697f52d79858fba13c1b90\",\"license\":\"MIT\"},\"src/interfaces/collections/IHasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport { ContractType } from \\\"../../utils/ContractType.sol\\\";\\n\\ninterface IHasContracts {\\n /// @dev Error of invalid role.\\n error ErrContractTypeNotFound(ContractType contractType);\\n\\n /// @dev Emitted when a contract is updated.\\n event ContractUpdated(ContractType indexed contractType, address indexed addr);\\n\\n /**\\n * @dev Returns the address of a contract with a specific role.\\n * Throws an error if no contract is set for the specified role.\\n *\\n * @param contractType The role of the contract to retrieve.\\n * @return contract_ The address of the contract with the specified role.\\n */\\n function getContract(ContractType contractType) external view returns (address contract_);\\n\\n /**\\n * @dev Sets the address of a contract with a specific role.\\n * Emits the event {ContractUpdated}.\\n * @param contractType The role of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function setContract(ContractType contractType, address addr) external;\\n}\\n\",\"keccak256\":\"0x99d8213d857e30d367155abd15dc42730afdfbbac3a22dfb3b95ffea2083a92e\",\"license\":\"MIT\"},\"src/interfaces/validator/ICandidateManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface ICandidateManager {\\n struct ValidatorCandidate {\\n // Admin of the candidate\\n address admin;\\n // Address of the validator that produces block, e.g. block.coinbase. This is so-called validator address.\\n address consensusAddr;\\n // Address that receives mining reward of the validator\\n address payable treasuryAddr;\\n // Address of the bridge operator corresponding to the candidate\\n address ______deprecatedbridgeOperatorAddr;\\n // The percentage of reward that validators can be received, the rest goes to the delegators.\\n // Values in range [0; 100_00] stands for 0-100%\\n uint256 commissionRate;\\n // The timestamp that scheduled to revoke the candidate (no schedule=0)\\n uint256 revokingTimestamp;\\n // The deadline that the candidate must top up staking amount to keep it larger than or equal to the threshold (no deadline=0)\\n uint256 topupDeadline;\\n }\\n\\n struct CommissionSchedule {\\n // The timestamp that the commission schedule gets affected (no schedule=0).\\n uint256 effectiveTimestamp;\\n // The new commission rate. Value is in range [0; 100_00], stands for 0-100%\\n uint256 commissionRate;\\n }\\n\\n /// @dev Emitted when the maximum number of validator candidates is updated.\\n event MaxValidatorCandidateUpdated(uint256 threshold);\\n /// @dev Emitted when the min offset to the effective date of commission rate change is updated.\\n event MinEffectiveDaysOnwardsUpdated(uint256 numOfDays);\\n /// @dev Emitted when the validator candidate is granted.\\n event CandidateGranted(address indexed consensusAddr, address indexed treasuryAddr, address indexed admin);\\n /// @dev Emitted when the revoking timestamp of a candidate is updated.\\n event CandidateRevokingTimestampUpdated(address indexed consensusAddr, uint256 revokingTimestamp);\\n /// @dev Emitted when the topup deadline of a candidate is updated.\\n event CandidateTopupDeadlineUpdated(address indexed consensusAddr, uint256 topupDeadline);\\n /// @dev Emitted when the validator candidate is revoked.\\n event CandidatesRevoked(address[] consensusAddrs);\\n\\n /// @dev Emitted when a schedule for updating commission rate is set.\\n event CommissionRateUpdateScheduled(address indexed consensusAddr, uint256 effectiveTimestamp, uint256 rate);\\n /// @dev Emitted when the commission rate of a validator is updated.\\n event CommissionRateUpdated(address indexed consensusAddr, uint256 rate);\\n\\n /// @dev Error of exceeding maximum number of candidates.\\n error ErrExceedsMaxNumberOfCandidate();\\n /// @dev Error of querying for already existent candidate.\\n error ErrExistentCandidate();\\n /// @dev Error of querying for non-existent candidate.\\n error ErrNonExistentCandidate();\\n /// @dev Error of candidate admin already exists.\\n error ErrExistentCandidateAdmin(address _candidateAdminAddr);\\n /// @dev Error of treasury already exists.\\n error ErrExistentTreasury(address _treasuryAddr);\\n /// @dev Error of invalid commission rate.\\n error ErrInvalidCommissionRate();\\n /// @dev Error of invalid effective days onwards.\\n error ErrInvalidEffectiveDaysOnwards();\\n /// @dev Error of invalid min effective days onwards.\\n error ErrInvalidMinEffectiveDaysOnwards();\\n /// @dev Error of already requested revoking candidate before.\\n error ErrAlreadyRequestedRevokingCandidate();\\n /// @dev Error of commission change schedule exists.\\n error ErrAlreadyRequestedUpdatingCommissionRate();\\n /// @dev Error of trusted org cannot renounce.\\n error ErrTrustedOrgCannotRenounce();\\n\\n /**\\n * @dev Returns the maximum number of validator candidate.\\n */\\n function maxValidatorCandidate() external view returns (uint256);\\n\\n /**\\n * @dev Returns the minimum number of days to the effective date of commission rate change.\\n */\\n function minEffectiveDaysOnward() external view returns (uint256);\\n\\n /**\\n * @dev Sets the maximum number of validator candidate.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `MaxValidatorCandidateUpdated` event.\\n *\\n */\\n function setMaxValidatorCandidate(uint256) external;\\n\\n /**\\n * @dev Sets the minimum number of days to the effective date of commision rate change.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `MinEffectiveDaysOnwardsUpdated` event.\\n *\\n */\\n function setMinEffectiveDaysOnwards(uint256 _numOfDays) external;\\n\\n /**\\n * @dev Grants a validator candidate.\\n *\\n * Requirements:\\n * - The method caller is staking contract.\\n *\\n * Emits the event `CandidateGranted`.\\n *\\n */\\n function execApplyValidatorCandidate(address _admin, address _consensusAddr, address payable _treasuryAddr, uint256 _commissionRate) external;\\n\\n /**\\n * @dev Requests to revoke a validator candidate in next `_secsLeft` seconds.\\n *\\n * Requirements:\\n * - The method caller is staking contract.\\n *\\n * Emits the event `CandidateRevokingTimestampUpdated`.\\n *\\n */\\n function execRequestRenounceCandidate(address, uint256 _secsLeft) external;\\n\\n /**\\n * @dev Fallback function of `CandidateStaking-requestUpdateCommissionRate`.\\n *\\n * Requirements:\\n * - The method caller is the staking contract.\\n * - The `_effectiveTimestamp` must be the beginning of a UTC day, and at least from 7 days onwards\\n * - The `_rate` must be in range of [0_00; 100_00].\\n *\\n * Emits the event `CommissionRateUpdateScheduled`.\\n *\\n */\\n function execRequestUpdateCommissionRate(address _consensusAddr, uint256 _effectiveTimestamp, uint256 _rate) external;\\n\\n /**\\n * @dev Returns whether the address is a validator (candidate).\\n */\\n function isValidatorCandidate(address _addr) external view returns (bool);\\n\\n /**\\n * @dev Returns the validator candidate.\\n */\\n function getValidatorCandidates() external view returns (address[] memory);\\n\\n /**\\n * @dev Returns all candidate info.\\n */\\n function getCandidateInfos() external view returns (ValidatorCandidate[] memory);\\n\\n /**\\n * @dev Returns the info of a candidate.\\n */\\n function getCandidateInfo(address _candidate) external view returns (ValidatorCandidate memory);\\n\\n /**\\n * @dev Returns whether the address is the candidate admin.\\n */\\n function isCandidateAdmin(address _candidate, address _admin) external view returns (bool);\\n\\n /**\\n * @dev Returns the schedule of changing commission rate of a candidate address.\\n */\\n function getCommissionChangeSchedule(address _candidate) external view returns (CommissionSchedule memory);\\n}\\n\",\"keccak256\":\"0x37b15d36774a3f18291e85efa9df6caaf52b8fa751a8222a3ac8f467656950c1\",\"license\":\"MIT\"},\"src/interfaces/validator/ICoinbaseExecution.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"./ISlashingExecution.sol\\\";\\n\\ninterface ICoinbaseExecution is ISlashingExecution {\\n enum BlockRewardDeprecatedType {\\n UNKNOWN,\\n UNAVAILABILITY,\\n AFTER_BAILOUT\\n }\\n\\n /// @dev Emitted when the validator set is updated\\n event ValidatorSetUpdated(uint256 indexed period, address[] consensusAddrs);\\n /// @dev Emitted when the bridge operator set is updated, to mirror the in-jail and maintaining status of the validator.\\n event BlockProducerSetUpdated(uint256 indexed period, uint256 indexed epoch, address[] consensusAddrs);\\n /// @dev Emitted when the bridge operator set is updated.\\n event BridgeOperatorSetUpdated(uint256 indexed period, uint256 indexed epoch, address[] bridgeOperators);\\n\\n /// @dev Emitted when the reward of the block producer is deprecated.\\n event BlockRewardDeprecated(address indexed coinbaseAddr, uint256 rewardAmount, BlockRewardDeprecatedType deprecatedType);\\n /// @dev Emitted when the block reward is submitted.\\n event BlockRewardSubmitted(address indexed coinbaseAddr, uint256 submittedAmount, uint256 bonusAmount);\\n\\n /// @dev Emitted when the block producer reward is distributed.\\n event MiningRewardDistributed(address indexed consensusAddr, address indexed recipient, uint256 amount);\\n /// @dev Emitted when the contract fails when distributing the block producer reward.\\n event MiningRewardDistributionFailed(address indexed consensusAddr, address indexed recipient, uint256 amount, uint256 contractBalance);\\n\\n /// @dev Emitted when the bridge operator reward is distributed.\\n event BridgeOperatorRewardDistributed(address indexed consensusAddr, address indexed bridgeOperator, address indexed recipientAddr, uint256 amount);\\n /// @dev Emitted when the contract fails when distributing the bridge operator reward.\\n event BridgeOperatorRewardDistributionFailed(\\n address indexed consensusAddr, address indexed bridgeOperator, address indexed recipient, uint256 amount, uint256 contractBalance\\n );\\n\\n /// @dev Emitted when the fast finality reward is distributed.\\n event FastFinalityRewardDistributed(address indexed consensusAddr, address indexed recipient, uint256 amount);\\n /// @dev Emitted when the contract fails when distributing the fast finality reward.\\n event FastFinalityRewardDistributionFailed(address indexed consensusAddr, address indexed recipient, uint256 amount, uint256 contractBalance);\\n\\n /// @dev Emitted when the amount of RON reward is distributed to staking contract.\\n event StakingRewardDistributed(uint256 totalAmount, address[] consensusAddrs, uint256[] amounts);\\n /// @dev Emitted when the contracts fails when distributing the amount of RON to the staking contract.\\n event StakingRewardDistributionFailed(uint256 totalAmount, address[] consensusAddrs, uint256[] amounts, uint256 contractBalance);\\n\\n /// @dev Emitted when the epoch is wrapped up.\\n event WrappedUpEpoch(uint256 indexed periodNumber, uint256 indexed epochNumber, bool periodEnding);\\n\\n /// @dev Error of only allowed at the end of epoch\\n error ErrAtEndOfEpochOnly();\\n /// @dev Error of query for already wrapped up epoch\\n error ErrAlreadyWrappedEpoch();\\n\\n /**\\n * @dev Submits reward of the current block.\\n *\\n * Requirements:\\n * - The method caller is coinbase.\\n *\\n * Emits the event `MiningRewardDeprecated` if the coinbase is slashed or no longer be a block producer.\\n * Emits the event `BlockRewardSubmitted` for the valid call.\\n *\\n */\\n function submitBlockReward() external payable;\\n\\n /**\\n * @dev Wraps up the current epoch.\\n *\\n * Requirements:\\n * - The method must be called when the current epoch is ending.\\n * - The epoch is not wrapped yet.\\n * - The method caller is coinbase.\\n *\\n * Emits the event `MiningRewardDistributed` when some validator has reward distributed.\\n * Emits the event `StakingRewardDistributed` when some staking pool has reward distributed.\\n * Emits the event `BlockProducerSetUpdated` when the epoch is wrapped up.\\n * Emits the event `BridgeOperatorSetUpdated` when the epoch is wrapped up at period ending.\\n * Emits the event `ValidatorSetUpdated` when the epoch is wrapped up at period ending, and the validator set gets updated.\\n * Emits the event `WrappedUpEpoch`.\\n *\\n */\\n function wrapUpEpoch() external payable;\\n}\\n\",\"keccak256\":\"0x3030ef01bb0277f8607fb3b6358a4cd1d75f6a756e5c884153fbf94f0a16b4d4\",\"license\":\"MIT\"},\"src/interfaces/validator/IEmergencyExit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface IEmergencyExit {\\n /// @dev Emitted when the fund is locked from an emergency exit request\\n event EmergencyExitRequested(address indexed consensusAddr, uint256 lockedAmount);\\n /// @dev Emitted when the fund that locked from an emergency exit request is transferred to the recipient.\\n event EmergencyExitLockedFundReleased(address indexed consensusAddr, address indexed recipient, uint256 unlockedAmount);\\n /// @dev Emitted when the fund that locked from an emergency exit request is failed to transferred back.\\n event EmergencyExitLockedFundReleasingFailed(address indexed consensusAddr, address indexed recipient, uint256 unlockedAmount, uint256 contractBalance);\\n\\n /// @dev Emitted when the emergency exit locked amount is updated.\\n event EmergencyExitLockedAmountUpdated(uint256 amount);\\n /// @dev Emitted when the emergency expiry duration is updated.\\n event EmergencyExpiryDurationUpdated(uint256 amount);\\n\\n /// @dev Error of already requested emergency exit before.\\n error ErrAlreadyRequestedEmergencyExit();\\n\\n /**\\n * @dev Returns the amount of RON to lock from a consensus address.\\n */\\n function emergencyExitLockedAmount() external returns (uint256);\\n\\n /**\\n * @dev Returns the duration that an emergency request is expired and the fund will be recycled.\\n */\\n function emergencyExpiryDuration() external returns (uint256);\\n\\n /**\\n * @dev Sets the amount of RON to lock from a consensus address.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the event `EmergencyExitLockedAmountUpdated`.\\n *\\n */\\n function setEmergencyExitLockedAmount(uint256 _emergencyExitLockedAmount) external;\\n\\n /**\\n * @dev Sets the duration that an emergency request is expired and the fund will be recycled.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the event `EmergencyExpiryDurationUpdated`.\\n *\\n */\\n function setEmergencyExpiryDuration(uint256 _emergencyExpiryDuration) external;\\n\\n /**\\n * @dev Unlocks fund for emergency exit request.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the event `EmergencyExitLockedFundReleased` if the fund is successfully unlocked.\\n * Emits the event `EmergencyExitLockedFundReleasingFailed` if the fund is failed to unlock.\\n *\\n */\\n function execReleaseLockedFundForEmergencyExitRequest(address _consensusAddr, address payable _recipient) external;\\n\\n /**\\n * @dev Fallback function of `IStaking-requestEmergencyExit`.\\n *\\n * Requirements:\\n * - The method caller is staking contract.\\n *\\n */\\n function execEmergencyExit(address _consensusAddr, uint256 _secLeftToRevoke) external;\\n}\\n\",\"keccak256\":\"0x2df640817e7fb957f923dd583e82be9610a8441735b69519db5bd9457683bec2\",\"license\":\"MIT\"},\"src/interfaces/validator/IRoninValidatorSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"./ICandidateManager.sol\\\";\\nimport \\\"./info-fragments/ICommonInfo.sol\\\";\\nimport \\\"./ICoinbaseExecution.sol\\\";\\nimport \\\"./ISlashingExecution.sol\\\";\\nimport \\\"./IEmergencyExit.sol\\\";\\n\\ninterface IRoninValidatorSet is ICandidateManager, ICommonInfo, ISlashingExecution, ICoinbaseExecution, IEmergencyExit { }\\n\",\"keccak256\":\"0x5ae53ab78a38d9c59d74b4723ead82146bc402874ebbdc90b70ce084516e010f\",\"license\":\"MIT\"},\"src/interfaces/validator/ISlashingExecution.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface ISlashingExecution {\\n /// @dev Emitted when the validator is punished.\\n event ValidatorPunished(\\n address indexed consensusAddr,\\n uint256 indexed period,\\n uint256 jailedUntil,\\n uint256 deductedStakingAmount,\\n bool blockProducerRewardDeprecated,\\n bool bridgeOperatorRewardDeprecated\\n );\\n /// @dev Emitted when the validator get out of jail by bailout.\\n event ValidatorUnjailed(address indexed validator, uint256 period);\\n\\n /// @dev Error of cannot bailout due to high tier slash.\\n error ErrCannotBailout(address validator);\\n\\n /**\\n * @dev Finalize the slash request from slash indicator contract.\\n *\\n * Requirements:\\n * - The method caller is slash indicator contract.\\n *\\n * Emits the event `ValidatorPunished`.\\n *\\n */\\n function execSlash(address validatorAddr, uint256 newJailedUntil, uint256 slashAmount, bool cannotBailout) external;\\n\\n /**\\n * @dev Finalize the bailout request from slash indicator contract.\\n *\\n * Requirements:\\n * - The method caller is slash indicator contract.\\n *\\n * Emits the event `ValidatorUnjailed`.\\n *\\n */\\n function execBailOut(address _validatorAddr, uint256 _period) external;\\n}\\n\",\"keccak256\":\"0xac0b772f2fca9dafd7cc6742f91b442f9f545bf9472185b8d817fe045b680193\",\"license\":\"MIT\"},\"src/interfaces/validator/info-fragments/ICommonInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"./IJailingInfo.sol\\\";\\nimport \\\"./ITimingInfo.sol\\\";\\n\\ninterface ICommonInfo is ITimingInfo, IJailingInfo {\\n struct EmergencyExitInfo {\\n uint256 lockedAmount;\\n // The timestamp that this locked amount will be recycled to staking vesting contract\\n uint256 recyclingAt;\\n }\\n\\n /// @dev Emitted when the deprecated reward is withdrawn.\\n event DeprecatedRewardRecycled(address indexed recipientAddr, uint256 amount);\\n /// @dev Emitted when the deprecated reward withdrawal is failed\\n event DeprecatedRewardRecycleFailed(address indexed recipientAddr, uint256 amount, uint256 balance);\\n\\n /// @dev Error thrown when receives RON from neither staking vesting contract nor staking contract\\n error ErrUnauthorizedReceiveRON();\\n /// @dev Error thrown when queries for a non existent info.\\n error NonExistentRecyclingInfo();\\n\\n /**\\n * @dev Returns the total deprecated reward, which includes reward that is not sent for slashed validators and unsastified bridge operators\\n */\\n function totalDeprecatedReward() external view returns (uint256);\\n\\n /**\\n * @dev Returns the emergency exit request.\\n */\\n function getEmergencyExitInfo(address _consensusAddr) external view returns (EmergencyExitInfo memory);\\n}\\n\",\"keccak256\":\"0x4a215273f535697ecf54a97c8fd9de9c666ca64b88dafe7ab60b2903f71ffb41\",\"license\":\"MIT\"},\"src/interfaces/validator/info-fragments/IJailingInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface IJailingInfo {\\n /**\\n * @dev Returns whether the validator are put in jail (cannot join the set of validators) during the current period.\\n */\\n function checkJailed(address) external view returns (bool);\\n\\n /**\\n * @dev Returns whether the validator are put in jail and the number of block and epoch that he still is in the jail.\\n */\\n function getJailedTimeLeft(address _addr) external view returns (bool isJailed_, uint256 blockLeft_, uint256 epochLeft_);\\n\\n /**\\n * @dev Returns whether the validator are put in jail (cannot join the set of validators) at a specific block.\\n */\\n function checkJailedAtBlock(address _addr, uint256 _blockNum) external view returns (bool);\\n\\n /**\\n * @dev Returns whether the validator are put in jail at a specific block and the number of block and epoch that he still is in the jail.\\n */\\n function getJailedTimeLeftAtBlock(address _addr, uint256 _blockNum) external view returns (bool isJailed_, uint256 blockLeft_, uint256 epochLeft_);\\n\\n /**\\n * @dev Returns whether the validators are put in jail (cannot join the set of validators) during the current period.\\n */\\n function checkManyJailed(address[] calldata) external view returns (bool[] memory);\\n\\n /**\\n * @dev Returns whether the incoming reward of the block producer is deprecated during the current period.\\n */\\n function checkMiningRewardDeprecated(address _blockProducer) external view returns (bool);\\n\\n /**\\n * @dev Returns whether the incoming reward of the block producer is deprecated during a specific period.\\n */\\n function checkMiningRewardDeprecatedAtPeriod(address _blockProducer, uint256 _period) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xd83e85bea11509406213b8d06956b33238d27fa1b5e555c1f064bdfd41d6d216\",\"license\":\"MIT\"},\"src/interfaces/validator/info-fragments/ITimingInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface ITimingInfo {\\n /**\\n * @dev Returns the block that validator set was updated.\\n */\\n function getLastUpdatedBlock() external view returns (uint256);\\n\\n /**\\n * @dev Returns the number of blocks in a epoch.\\n */\\n function numberOfBlocksInEpoch() external view returns (uint256 _numberOfBlocks);\\n\\n /**\\n * @dev Returns the epoch index from the block number.\\n */\\n function epochOf(uint256 _block) external view returns (uint256);\\n\\n /**\\n * @dev Returns whether the epoch ending is at the block number `_block`.\\n */\\n function epochEndingAt(uint256 _block) external view returns (bool);\\n\\n /**\\n * @dev Tries to get the period index from the epoch number.\\n */\\n function tryGetPeriodOfEpoch(uint256 _epoch) external view returns (bool _filled, uint256 _periodNumber);\\n\\n /**\\n * @dev Returns whether the period ending at the current block number.\\n */\\n function isPeriodEnding() external view returns (bool);\\n\\n /**\\n * @dev Returns the period index from the current block.\\n */\\n function currentPeriod() external view returns (uint256);\\n\\n /**\\n * @dev Returns the block number that the current period starts at.\\n */\\n function currentPeriodStartAtBlock() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x77b86a68149389fed0eb0c5b8d56f278d3bd103ba64f504697d709b24c3212d5\",\"license\":\"MIT\"},\"src/libraries/AddressArrayUtils.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\nlibrary AddressArrayUtils {\\n /**\\n * @dev Error thrown when a duplicated element is detected in an array.\\n * @param msgSig The function signature that invoke the error.\\n */\\n error ErrDuplicated(bytes4 msgSig);\\n\\n /**\\n * @dev Returns whether or not there's a duplicate. Runs in O(n^2).\\n * @param A Array to search\\n * @return Returns true if duplicate, false otherwise\\n */\\n function hasDuplicate(address[] memory A) internal pure returns (bool) {\\n if (A.length == 0) {\\n return false;\\n }\\n unchecked {\\n for (uint256 i = 0; i < A.length - 1; i++) {\\n for (uint256 j = i + 1; j < A.length; j++) {\\n if (A[i] == A[j]) {\\n return true;\\n }\\n }\\n }\\n }\\n return false;\\n }\\n\\n /**\\n * @dev Returns whether two arrays of addresses are equal or not.\\n */\\n function isEqual(address[] memory _this, address[] memory _other) internal pure returns (bool yes_) {\\n // Hashing two arrays and compare their hash\\n assembly {\\n let _thisHash := keccak256(add(_this, 32), mul(mload(_this), 32))\\n let _otherHash := keccak256(add(_other, 32), mul(mload(_other), 32))\\n yes_ := eq(_thisHash, _otherHash)\\n }\\n }\\n\\n /**\\n * @dev Return the concatenated array from a and b.\\n */\\n function extend(address[] memory a, address[] memory b) internal pure returns (address[] memory c) {\\n uint256 lengthA = a.length;\\n uint256 lengthB = b.length;\\n unchecked {\\n c = new address[](lengthA + lengthB);\\n }\\n uint256 i;\\n for (; i < lengthA;) {\\n c[i] = a[i];\\n unchecked {\\n ++i;\\n }\\n }\\n for (uint256 j; j < lengthB;) {\\n c[i] = b[j];\\n unchecked {\\n ++i;\\n ++j;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce5d578861167da47a965c8a0e1592b808aad6eb79ccb1873bf2e2280ddb85ee\",\"license\":\"UNLICENSED\"},\"src/ronin/gateway/BridgeTracking.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport \\\"../../extensions/collections/HasContracts.sol\\\";\\nimport \\\"../../interfaces/bridge/IBridgeTracking.sol\\\";\\nimport { IBridgeManager } from \\\"../../interfaces/bridge/IBridgeManager.sol\\\";\\nimport { IBridgeSlash } from \\\"../../interfaces/bridge/IBridgeSlash.sol\\\";\\nimport { IBridgeReward } from \\\"../../interfaces/bridge/IBridgeReward.sol\\\";\\nimport { IRoninValidatorSet } from \\\"../../interfaces/validator/IRoninValidatorSet.sol\\\";\\nimport { HasBridgeDeprecated, HasValidatorDeprecated } from \\\"../../utils/DeprecatedSlots.sol\\\";\\n\\ncontract BridgeTracking is HasBridgeDeprecated, HasValidatorDeprecated, HasContracts, Initializable, IBridgeTracking {\\n struct PeriodVotingMetric {\\n /// @dev Total requests that are tracked in the period. This value is 0 until the {_bufferMetric.requests[]} gets added into a period metric.\\n uint256 totalRequest;\\n uint256 totalBallot;\\n mapping(address => uint256) totalBallotOf;\\n address[] voters;\\n }\\n\\n struct PeriodVotingMetricTimeWrapper {\\n uint256 lastEpoch;\\n Request[] requests;\\n PeriodVotingMetric data;\\n }\\n\\n struct ReceiptTrackingInfo {\\n /// @dev The period that the receipt is approved. Value 0 means the receipt is not approved yet.\\n uint256 approvedPeriod;\\n /// @dev The address list of voters\\n address[] voters;\\n /// @dev Mapping from voter => flag indicating the voter casts vote for this receipt\\n mapping(address => bool) voted;\\n /// @dev The period that the receipt is tracked, i.e. the metric is transferred from buffer to the period. Value 0 means the receipt is currently in buffer or not tracked yet.\\n uint256 trackedPeriod;\\n }\\n\\n /// @dev The block that the contract allows incoming mutable calls.\\n uint256 internal _startedAtBlock;\\n\\n /// @dev The temporary info of votes and ballots\\n PeriodVotingMetricTimeWrapper internal _bufferMetric;\\n /// @dev Mapping from period number => vote stats based on period\\n mapping(uint256 => PeriodVotingMetric) internal _periodMetric;\\n /// @dev Mapping from vote kind => receipt id => receipt stats\\n mapping(VoteKind => mapping(uint256 => ReceiptTrackingInfo)) internal _receiptTrackingInfo;\\n /// @dev The latest period that get synced with bridge's slashing and rewarding contract\\n uint256 internal _lastSyncPeriod;\\n\\n modifier skipOnNotStarted() {\\n _skipOnNotStarted();\\n _;\\n }\\n\\n /**\\n * @dev Returns the whole transaction in case the current block is less than start block.\\n */\\n function _skipOnNotStarted() private view {\\n if (block.number < _startedAtBlock) {\\n assembly {\\n return(0, 0)\\n }\\n }\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /**\\n * @dev Initializes the contract storage.\\n */\\n function initialize(address bridgeContract, address validatorContract, uint256 startedAtBlock_) external initializer {\\n _setContract(ContractType.BRIDGE, bridgeContract);\\n _setContract(ContractType.VALIDATOR, validatorContract);\\n _startedAtBlock = startedAtBlock_;\\n }\\n\\n function initializeV2() external reinitializer(2) {\\n _setContract(ContractType.BRIDGE, ______deprecatedBridge);\\n _setContract(ContractType.VALIDATOR, ______deprecatedValidator);\\n\\n delete ______deprecatedBridge;\\n delete ______deprecatedValidator;\\n }\\n\\n function initializeV3(address bridgeManager, address bridgeSlash, address bridgeReward, address dposGA) external reinitializer(3) {\\n _setContract(ContractType.BRIDGE_MANAGER, bridgeManager);\\n _setContract(ContractType.BRIDGE_SLASH, bridgeSlash);\\n _setContract(ContractType.BRIDGE_REWARD, bridgeReward);\\n _setContract(ContractType.GOVERNANCE_ADMIN, dposGA);\\n _lastSyncPeriod = type(uint256).max;\\n }\\n\\n /**\\n * @dev Helper for running upgrade script, required to only revoked once by the DPoS's governance admin.\\n * The following must be assured after initializing REP2:\\n * `_lastSyncPeriod`\\n * == `{BridgeReward}.latestRewardedPeriod + 1`\\n * == `{BridgeSlash}._startedAtPeriod - 1`\\n * == `currentPeriod()`\\n */\\n function initializeREP2() external onlyContract(ContractType.GOVERNANCE_ADMIN) {\\n require(_lastSyncPeriod == type(uint256).max, \\\"already init rep 2\\\");\\n _lastSyncPeriod = IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod();\\n _setContract(ContractType.GOVERNANCE_ADMIN, address(0));\\n }\\n\\n /**\\n * @inheritdoc IBridgeTracking\\n */\\n function startedAtBlock() external view override returns (uint256) {\\n return _startedAtBlock;\\n }\\n\\n /**\\n * @inheritdoc IBridgeTracking\\n */\\n function totalVote(uint256 period) public view override returns (uint256 totalVote_) {\\n totalVote_ = _periodMetric[period].totalRequest;\\n if (_isBufferCountedForPeriod(period)) {\\n totalVote_ += _bufferMetric.requests.length;\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeTracking\\n */\\n function totalBallot(uint256 period) public view override returns (uint256 totalBallot_) {\\n totalBallot_ = _periodMetric[period].totalBallot;\\n if (_isBufferCountedForPeriod(period)) {\\n totalBallot_ += _bufferMetric.data.totalBallot;\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeTracking\\n */\\n function getManyTotalBallots(uint256 period, address[] calldata operators) external view override returns (uint256[] memory _res) {\\n _res = _getManyTotalBallots(period, operators);\\n }\\n\\n function _getManyTotalBallots(uint256 period, address[] memory operators) internal view returns (uint256[] memory res) {\\n uint256 length = operators.length;\\n res = new uint256[](length);\\n bool isBufferCounted = _isBufferCountedForPeriod(period);\\n for (uint i = 0; i < length;) {\\n res[i] = _totalBallotOf(period, operators[i], isBufferCounted);\\n\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeTracking\\n */\\n function totalBallotOf(uint256 period, address bridgeOperator) public view override returns (uint256) {\\n return _totalBallotOf(period, bridgeOperator, _isBufferCountedForPeriod(period));\\n }\\n\\n /**\\n * @inheritdoc IBridgeTracking\\n */\\n function handleVoteApproved(VoteKind kind, uint256 requestId) external override onlyContract(ContractType.BRIDGE) skipOnNotStarted {\\n ReceiptTrackingInfo storage _receiptInfo = _receiptTrackingInfo[kind][requestId];\\n\\n // Only records for the receipt which not approved\\n if (_receiptInfo.approvedPeriod == 0) {\\n _trySyncBuffer();\\n uint256 currentPeriod = IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod();\\n _receiptInfo.approvedPeriod = currentPeriod;\\n\\n Request storage _bufferRequest = _bufferMetric.requests.push();\\n _bufferRequest.kind = kind;\\n _bufferRequest.id = requestId;\\n\\n address[] storage _voters = _receiptInfo.voters;\\n for (uint i = 0; i < _voters.length;) {\\n _increaseBallot(kind, requestId, _voters[i], currentPeriod);\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n delete _receiptInfo.voters;\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeTracking\\n */\\n function recordVote(VoteKind kind, uint256 requestId, address operator) external override onlyContract(ContractType.BRIDGE) skipOnNotStarted {\\n uint256 currPd = IRoninValidatorSet(getContract(ContractType.VALIDATOR)).currentPeriod();\\n _trySyncBuffer();\\n ReceiptTrackingInfo storage _receiptInfo = _receiptTrackingInfo[kind][requestId];\\n\\n // When the vote is not approved yet, the voters are saved in the receipt info, and not increase ballot metric.\\n // The ballot metric will be increased later in the {handleVoteApproved} method.\\n if (_receiptInfo.approvedPeriod == 0) {\\n _receiptInfo.voters.push(operator);\\n return;\\n }\\n\\n _increaseBallot(kind, requestId, operator, currPd);\\n\\n uint256 lastSyncPeriod = _lastSyncPeriod;\\n // When switching to new period, wrap up vote info, then slash and distribute reward accordingly.\\n if (lastSyncPeriod < currPd) {\\n _lastSyncPeriod = currPd;\\n\\n address[] memory allOperators = IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)).getBridgeOperators();\\n uint256[] memory ballots = _getManyTotalBallots(lastSyncPeriod, allOperators);\\n\\n uint256 totalVote_ = totalVote(lastSyncPeriod);\\n uint256 totalBallot_ = totalBallot(lastSyncPeriod);\\n\\n address bridgeSlashContract = getContract(ContractType.BRIDGE_SLASH);\\n (bool success, bytes memory returnOrRevertData) =\\n bridgeSlashContract.call(abi.encodeCall(IBridgeSlash.execSlashBridgeOperators, (allOperators, ballots, totalBallot_, totalVote_, lastSyncPeriod)));\\n if (!success) {\\n emit ExternalCallFailed(bridgeSlashContract, IBridgeSlash.execSlashBridgeOperators.selector, returnOrRevertData);\\n }\\n\\n address bridgeRewardContract = getContract(ContractType.BRIDGE_REWARD);\\n (success, returnOrRevertData) = bridgeRewardContract.call(abi.encodeCall(IBridgeReward.execSyncRewardAuto, (currPd)));\\n if (!success) {\\n emit ExternalCallFailed(bridgeRewardContract, IBridgeReward.execSyncRewardAuto.selector, returnOrRevertData);\\n }\\n }\\n }\\n\\n /**\\n * @dev Increases the ballot for the operator at a period.\\n */\\n function _increaseBallot(VoteKind kind, uint256 requestId, address operator, uint256 currentPeriod) internal {\\n ReceiptTrackingInfo storage _receiptInfo = _receiptTrackingInfo[kind][requestId];\\n if (_receiptInfo.voted[operator]) {\\n return;\\n }\\n\\n _receiptInfo.voted[operator] = true;\\n\\n uint256 trackedPeriod = _receiptInfo.trackedPeriod;\\n\\n // Do not increase ballot for receipt that is neither in the buffer, nor in the most current tracked period.\\n // If the receipt is not tracked in a period, increase metric in buffer.\\n unchecked {\\n if (trackedPeriod == 0) {\\n if (_bufferMetric.data.totalBallotOf[operator] == 0) {\\n _bufferMetric.data.voters.push(operator);\\n }\\n _bufferMetric.data.totalBallot++;\\n _bufferMetric.data.totalBallotOf[operator]++;\\n }\\n // If the receipt is tracked in the most current tracked period, increase metric in the period.\\n else if (trackedPeriod == currentPeriod) {\\n PeriodVotingMetric storage _metric = _periodMetric[trackedPeriod];\\n _metric.totalBallot++;\\n _metric.totalBallotOf[operator]++;\\n }\\n }\\n }\\n\\n /**\\n * @dev See `totalBallotOf`.\\n */\\n function _totalBallotOf(uint256 period, address operator, bool mustCountLastStats) internal view returns (uint256 _totalBallot) {\\n _totalBallot = _periodMetric[period].totalBallotOf[operator];\\n if (mustCountLastStats) {\\n _totalBallot += _bufferMetric.data.totalBallotOf[operator];\\n }\\n }\\n\\n /**\\n * @dev Syncs period stats. Move all data from the buffer metric to the period metric.\\n *\\n * Requirements:\\n * - The epoch after the buffer epoch is wrapped up.\\n */\\n function _trySyncBuffer() internal {\\n IRoninValidatorSet validatorContract = IRoninValidatorSet(getContract(ContractType.VALIDATOR));\\n uint256 currentEpoch = validatorContract.epochOf(block.number);\\n if (_bufferMetric.lastEpoch < currentEpoch) {\\n (, uint256 trackedPeriod) = validatorContract.tryGetPeriodOfEpoch(_bufferMetric.lastEpoch + 1);\\n _bufferMetric.lastEpoch = currentEpoch;\\n\\n // Copy numbers of totals\\n PeriodVotingMetric storage _metric = _periodMetric[trackedPeriod];\\n _metric.totalRequest += _bufferMetric.requests.length;\\n _metric.totalBallot += _bufferMetric.data.totalBallot;\\n\\n // Copy voters info and voters' ballot\\n for (uint i = 0; i < _bufferMetric.data.voters.length;) {\\n address voter = _bufferMetric.data.voters[i];\\n _metric.totalBallotOf[voter] += _bufferMetric.data.totalBallotOf[voter];\\n delete _bufferMetric.data.totalBallotOf[voter]; // need to manually delete each element, due to mapping\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n // Mark all receipts in the buffer as tracked. Keep total number of receipts and delete receipt details.\\n for (uint i = 0; i < _bufferMetric.requests.length;) {\\n Request storage _bufferRequest = _bufferMetric.requests[i];\\n ReceiptTrackingInfo storage _receiptInfo = _receiptTrackingInfo[_bufferRequest.kind][_bufferRequest.id];\\n _receiptInfo.trackedPeriod = trackedPeriod;\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n delete _bufferMetric.requests;\\n delete _bufferMetric.data;\\n }\\n }\\n\\n /**\\n * @dev Returns whether the buffer stats must be counted or not.\\n */\\n function _isBufferCountedForPeriod(uint256 queriedPeriod) internal view returns (bool) {\\n IRoninValidatorSet validatorContract = IRoninValidatorSet(getContract(ContractType.VALIDATOR));\\n uint256 currentEpoch = validatorContract.epochOf(block.number);\\n (bool filled, uint256 periodOfNextTemporaryEpoch) = validatorContract.tryGetPeriodOfEpoch(_bufferMetric.lastEpoch + 1);\\n return filled && queriedPeriod == periodOfNextTemporaryEpoch && _bufferMetric.lastEpoch < currentEpoch;\\n }\\n}\\n\",\"keccak256\":\"0x61371c8207bb80356d02d912376a61bdc60d76eff1d0e508b17c1428bcddee27\",\"license\":\"MIT\"},\"src/utils/CommonErrors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ContractType } from \\\"./ContractType.sol\\\";\\nimport { RoleAccess } from \\\"./RoleAccess.sol\\\";\\n\\nerror ErrSyncTooFarPeriod(uint256 period, uint256 latestRewardedPeriod);\\n/**\\n * @dev Error thrown when an address is expected to be an already created externally owned account (EOA).\\n * This error indicates that the provided address is invalid for certain contract operations that require already created EOA.\\n */\\nerror ErrAddressIsNotCreatedEOA(address addr, bytes32 codehash);\\n/**\\n * @dev Error raised when a bridge operator update operation fails.\\n * @param bridgeOperator The address of the bridge operator that failed to update.\\n */\\nerror ErrBridgeOperatorUpdateFailed(address bridgeOperator);\\n/**\\n * @dev Error thrown when attempting to add a bridge operator that already exists in the contract.\\n * This error indicates that the provided bridge operator address is already registered as a bridge operator in the contract.\\n */\\nerror ErrBridgeOperatorAlreadyExisted(address bridgeOperator);\\n/**\\n * @dev The error indicating an unsupported interface.\\n * @param interfaceId The bytes4 interface identifier that is not supported.\\n * @param addr The address where the unsupported interface was encountered.\\n */\\nerror ErrUnsupportedInterface(bytes4 interfaceId, address addr);\\n/**\\n * @dev Error thrown when the return data from a callback function is invalid.\\n * @param callbackFnSig The signature of the callback function that returned invalid data.\\n * @param register The address of the register where the callback function was invoked.\\n * @param returnData The invalid return data received from the callback function.\\n */\\nerror ErrInvalidReturnData(bytes4 callbackFnSig, address register, bytes returnData);\\n/**\\n * @dev Error of set to non-contract.\\n */\\nerror ErrZeroCodeContract(address addr);\\n/**\\n * @dev Error indicating that arguments are invalid.\\n */\\nerror ErrInvalidArguments(bytes4 msgSig);\\n/**\\n * @dev Error indicating that given address is null when it should not.\\n */\\nerror ErrZeroAddress(bytes4 msgSig);\\n/**\\n * @dev Error indicating that the provided threshold is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that the invalid threshold applies to.\\n */\\nerror ErrInvalidThreshold(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a function can only be called by the contract itself.\\n * @param msgSig The function signature (bytes4) that can only be called by the contract itself.\\n */\\nerror ErrOnlySelfCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n * @param expectedRole The role required to perform the function.\\n */\\nerror ErrUnauthorized(bytes4 msgSig, RoleAccess expectedRole);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n */\\nerror ErrUnauthorizedCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4).\\n * @param expectedContractType The contract type required to perform the function.\\n * @param actual The actual address that called to the function.\\n */\\nerror ErrUnexpectedInternalCall(bytes4 msgSig, ContractType expectedContractType, address actual);\\n\\n/**\\n * @dev Error indicating that an array is empty when it should contain elements.\\n */\\nerror ErrEmptyArray();\\n\\n/**\\n * @dev Error indicating a mismatch in the length of input parameters or arrays for a specific function.\\n * @param msgSig The function signature (bytes4) that has a length mismatch.\\n */\\nerror ErrLengthMismatch(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a proxy call to an external contract has failed.\\n * @param msgSig The function signature (bytes4) of the proxy call that failed.\\n * @param extCallSig The function signature (bytes4) of the external contract call that failed.\\n */\\nerror ErrProxyCallFailed(bytes4 msgSig, bytes4 extCallSig);\\n\\n/**\\n * @dev Error indicating that a function tried to call a precompiled contract that is not allowed.\\n * @param msgSig The function signature (bytes4) that attempted to call a precompiled contract.\\n */\\nerror ErrCallPrecompiled(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a native token transfer has failed.\\n * @param msgSig The function signature (bytes4) of the token transfer that failed.\\n */\\nerror ErrNativeTransferFailed(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that an order is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid order.\\n */\\nerror ErrInvalidOrder(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the chain ID is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid chain ID.\\n * @param actual Current chain ID that executing function.\\n * @param expected Expected chain ID required for the tx to success.\\n */\\nerror ErrInvalidChainId(bytes4 msgSig, uint256 actual, uint256 expected);\\n\\n/**\\n * @dev Error indicating that a vote type is not supported.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an unsupported vote type.\\n */\\nerror ErrUnsupportedVoteType(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the proposal nonce is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid proposal nonce.\\n */\\nerror ErrInvalidProposalNonce(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a voter has already voted.\\n * @param voter The address of the voter who has already voted.\\n */\\nerror ErrAlreadyVoted(address voter);\\n\\n/**\\n * @dev Error indicating that a signature is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid signature.\\n */\\nerror ErrInvalidSignatures(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a relay call has failed.\\n * @param msgSig The function signature (bytes4) of the relay call that failed.\\n */\\nerror ErrRelayFailed(bytes4 msgSig);\\n/**\\n * @dev Error indicating that a vote weight is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid vote weight.\\n */\\nerror ErrInvalidVoteWeight(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a query was made for an outdated bridge operator set.\\n */\\nerror ErrQueryForOutdatedBridgeOperatorSet();\\n\\n/**\\n * @dev Error indicating that a request is invalid.\\n */\\nerror ErrInvalidRequest();\\n\\n/**\\n * @dev Error indicating that a token standard is invalid.\\n */\\nerror ErrInvalidTokenStandard();\\n\\n/**\\n * @dev Error indicating that a token is not supported.\\n */\\nerror ErrUnsupportedToken();\\n\\n/**\\n * @dev Error indicating that a receipt kind is invalid.\\n */\\nerror ErrInvalidReceiptKind();\\n\\n/**\\n * @dev Error indicating that a receipt is invalid.\\n */\\nerror ErrInvalidReceipt();\\n\\n/**\\n * @dev Error indicating that an address is not payable.\\n */\\nerror ErrNonpayableAddress(address);\\n\\n/**\\n * @dev Error indicating that the period is already processed, i.e. scattered reward.\\n */\\nerror ErrPeriodAlreadyProcessed(uint256 requestingPeriod, uint256 latestPeriod);\\n\\n/**\\n * @dev Error thrown when an invalid vote hash is provided.\\n */\\nerror ErrInvalidVoteHash();\\n\\n/**\\n * @dev Error thrown when querying for an empty vote.\\n */\\nerror ErrQueryForEmptyVote();\\n\\n/**\\n * @dev Error thrown when querying for an expired vote.\\n */\\nerror ErrQueryForExpiredVote();\\n\\n/**\\n * @dev Error thrown when querying for a non-existent vote.\\n */\\nerror ErrQueryForNonExistentVote();\\n\\n/**\\n * @dev Error indicating that the method is only called once per block.\\n */\\nerror ErrOncePerBlock();\\n\\n/**\\n * @dev Error of method caller must be coinbase\\n */\\nerror ErrCallerMustBeCoinbase();\\n\\n/**\\n * @dev Error thrown when an invalid proposal is encountered.\\n * @param actual The actual value of the proposal.\\n * @param expected The expected value of the proposal.\\n */\\nerror ErrInvalidProposal(bytes32 actual, bytes32 expected);\\n\\n/**\\n * @dev Error of proposal is not approved for executing.\\n */\\nerror ErrProposalNotApproved();\\n\\n/**\\n * @dev Error of the caller is not the specified executor.\\n */\\nerror ErrInvalidExecutor();\\n\\n/**\\n * @dev Error of the `caller` to relay is not the specified `executor`.\\n */\\nerror ErrNonExecutorCannotRelay(address executor, address caller);\\n\",\"keccak256\":\"0x0d9e2fd98f6b704273faad707ed9eadbd4c79551ee3f902bff5b29213a204679\",\"license\":\"MIT\"},\"src/utils/ContractType.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum ContractType {\\n UNKNOWN, // 0\\n PAUSE_ENFORCER, // 1\\n BRIDGE, // 2\\n BRIDGE_TRACKING, // 3\\n GOVERNANCE_ADMIN, // 4\\n MAINTENANCE, // 5\\n SLASH_INDICATOR, // 6\\n STAKING_VESTING, // 7\\n VALIDATOR, // 8\\n STAKING, // 9\\n RONIN_TRUSTED_ORGANIZATION, // 10\\n BRIDGE_MANAGER, // 11\\n BRIDGE_SLASH, // 12\\n BRIDGE_REWARD, // 13\\n FAST_FINALITY_TRACKING, // 14\\n PROFILE // 15\\n\\n}\\n\",\"keccak256\":\"0xec088aa939cd885dbe84e944942d7ea674e1fff8802c1f2ae5d8e84e4578357d\",\"license\":\"MIT\"},\"src/utils/DeprecatedSlots.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title Deprecated Contracts\\n * @dev These abstract contracts are deprecated and should not be used in new implementations.\\n * They provide functionality related to various aspects of a smart contract but have been marked\\n * as deprecated to indicate that they are no longer actively maintained or recommended for use.\\n * The purpose of these contracts is to preserve the slots for already deployed contracts.\\n */\\ncontract HasBridgeDeprecated {\\n /// @custom:deprecated Previously `_bridgeContract` (non-zero value)\\n address internal ______deprecatedBridge;\\n}\\n\\ncontract HasValidatorDeprecated {\\n /// @custom:deprecated Previously `_validatorContract` (non-zero value)\\n address internal ______deprecatedValidator;\\n}\\n\",\"keccak256\":\"0xd468881c7548ff0e125752a85ece9f3046932fdba24a16ac3208dc1b7d3eee0b\",\"license\":\"MIT\"},\"src/utils/IdentityGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { AddressArrayUtils } from \\\"../libraries/AddressArrayUtils.sol\\\";\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport { TransparentUpgradeableProxyV2 } from \\\"../extensions/TransparentUpgradeableProxyV2.sol\\\";\\nimport { ErrAddressIsNotCreatedEOA, ErrZeroAddress, ErrOnlySelfCall, ErrZeroCodeContract, ErrUnsupportedInterface } from \\\"./CommonErrors.sol\\\";\\n\\nabstract contract IdentityGuard {\\n using AddressArrayUtils for address[];\\n\\n /// @dev value is equal to keccak256(abi.encode())\\n /// @dev see: https://eips.ethereum.org/EIPS/eip-1052\\n bytes32 internal constant CREATED_ACCOUNT_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\\n\\n /**\\n * @dev Modifier to restrict functions to only be called by this contract.\\n * @dev Reverts if the caller is not this contract.\\n */\\n modifier onlySelfCall() virtual {\\n _requireSelfCall();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to ensure that the elements in the `arr` array are non-duplicates.\\n * It calls the internal `_checkDuplicate` function to perform the duplicate check.\\n *\\n * Requirements:\\n * - The elements in the `arr` array must not contain any duplicates.\\n */\\n modifier nonDuplicate(address[] memory arr) virtual {\\n _requireNonDuplicate(arr);\\n _;\\n }\\n\\n /**\\n * @dev Internal method to check the method caller.\\n * @dev Reverts if the method caller is not this contract.\\n */\\n function _requireSelfCall() internal view virtual {\\n if (msg.sender != address(this)) revert ErrOnlySelfCall(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to check if a contract address has code.\\n * @param addr The address of the contract to check.\\n * @dev Throws an error if the contract address has no code.\\n */\\n function _requireHasCode(address addr) internal view {\\n if (addr.code.length == 0) revert ErrZeroCodeContract(addr);\\n }\\n\\n /**\\n * @dev Checks if an address is zero and reverts if it is.\\n * @param addr The address to check.\\n */\\n function _requireNonZeroAddress(address addr) internal pure {\\n if (addr == address(0)) revert ErrZeroAddress(msg.sig);\\n }\\n\\n /**\\n * @dev Check if arr is empty and revert if it is.\\n * Checks if an array contains any duplicate addresses and reverts if duplicates are found.\\n * @param arr The array of addresses to check.\\n */\\n function _requireNonDuplicate(address[] memory arr) internal pure {\\n if (arr.hasDuplicate()) revert AddressArrayUtils.ErrDuplicated(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to require that the provided address is a created externally owned account (EOA).\\n * This internal function is used to ensure that the provided address is a valid externally owned account (EOA).\\n * It checks the codehash of the address against a predefined constant to confirm that the address is a created EOA.\\n * @notice This method only works with non-state EOA accounts\\n */\\n function _requireCreatedEOA(address addr) internal view {\\n _requireNonZeroAddress(addr);\\n bytes32 codehash = addr.codehash;\\n if (codehash != CREATED_ACCOUNT_HASH) revert ErrAddressIsNotCreatedEOA(addr, codehash);\\n }\\n\\n /**\\n * @dev Internal function to require that the specified contract supports the given interface. This method handle in\\n * both case that the callee is either or not the proxy admin of the caller. If the contract does not support the\\n * interface `interfaceId` or EIP165, a revert with the corresponding error message is triggered.\\n *\\n * @param contractAddr The address of the contract to check for interface support.\\n * @param interfaceId The interface ID to check for support.\\n */\\n function _requireSupportsInterface(address contractAddr, bytes4 interfaceId) internal view {\\n bytes memory supportsInterfaceParams = abi.encodeCall(IERC165.supportsInterface, (interfaceId));\\n (bool success, bytes memory returnOrRevertData) = contractAddr.staticcall(supportsInterfaceParams);\\n if (!success) {\\n (success, returnOrRevertData) = contractAddr.staticcall(abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (supportsInterfaceParams)));\\n if (!success) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n if (!abi.decode(returnOrRevertData, (bool))) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n}\\n\",\"keccak256\":\"0x546ab4c9cdb0e7f8e650f140349225305ba1d0706dcaceeb9180c96aa765da59\",\"license\":\"MIT\"},\"src/utils/RoleAccess.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum RoleAccess {\\n UNKNOWN, // 0\\n ADMIN, // 1\\n COINBASE, // 2\\n GOVERNOR, // 3\\n CANDIDATE_ADMIN, // 4\\n WITHDRAWAL_MIGRATOR, // 5\\n __DEPRECATED_BRIDGE_OPERATOR, // 6\\n BLOCK_PRODUCER, // 7\\n VALIDATOR_CANDIDATE, // 8\\n CONSENSUS, // 9\\n TREASURY // 10\\n\\n}\\n\",\"keccak256\":\"0x671ff40dd874c508c4b3879a580996c7987fc018669256f47151e420a55c0e51\",\"license\":\"MIT\"}},\"version\":1}", + "nonce": 192810, + "numDeployments": 9, "storageLayout": { "storage": [ { - "astId": 39592, - "contract": "contracts/ronin/gateway/BridgeTracking.sol:BridgeTracking", + "astId": 123451, + "contract": "src/ronin/gateway/BridgeTracking.sol:BridgeTracking", "label": "______deprecatedBridge", "offset": 0, "slot": "0", "type": "t_address" }, { - "astId": 39596, - "contract": "contracts/ronin/gateway/BridgeTracking.sol:BridgeTracking", + "astId": 123455, + "contract": "src/ronin/gateway/BridgeTracking.sol:BridgeTracking", "label": "______deprecatedValidator", "offset": 0, "slot": "1", "type": "t_address" }, { - "astId": 1373, - "contract": "contracts/ronin/gateway/BridgeTracking.sol:BridgeTracking", + "astId": 58190, + "contract": "src/ronin/gateway/BridgeTracking.sol:BridgeTracking", "label": "_initialized", "offset": 20, "slot": "1", "type": "t_uint8" }, { - "astId": 1376, - "contract": "contracts/ronin/gateway/BridgeTracking.sol:BridgeTracking", + "astId": 58193, + "contract": "src/ronin/gateway/BridgeTracking.sol:BridgeTracking", "label": "_initializing", "offset": 21, "slot": "1", "type": "t_bool" }, { - "astId": 26922, - "contract": "contracts/ronin/gateway/BridgeTracking.sol:BridgeTracking", + "astId": 119558, + "contract": "src/ronin/gateway/BridgeTracking.sol:BridgeTracking", "label": "_startedAtBlock", "offset": 0, "slot": "2", "type": "t_uint256" }, { - "astId": 26926, - "contract": "contracts/ronin/gateway/BridgeTracking.sol:BridgeTracking", + "astId": 119562, + "contract": "src/ronin/gateway/BridgeTracking.sol:BridgeTracking", "label": "_bufferMetric", "offset": 0, "slot": "3", - "type": "t_struct(PeriodVotingMetricTimeWrapper)26903_storage" + "type": "t_struct(PeriodVotingMetricTimeWrapper)119539_storage" }, { - "astId": 26932, - "contract": "contracts/ronin/gateway/BridgeTracking.sol:BridgeTracking", + "astId": 119568, + "contract": "src/ronin/gateway/BridgeTracking.sol:BridgeTracking", "label": "_periodMetric", "offset": 0, "slot": "9", - "type": "t_mapping(t_uint256,t_struct(PeriodVotingMetric)26893_storage)" + "type": "t_mapping(t_uint256,t_struct(PeriodVotingMetric)119529_storage)" }, { - "astId": 26941, - "contract": "contracts/ronin/gateway/BridgeTracking.sol:BridgeTracking", + "astId": 119577, + "contract": "src/ronin/gateway/BridgeTracking.sol:BridgeTracking", "label": "_receiptTrackingInfo", "offset": 0, "slot": "10", - "type": "t_mapping(t_enum(VoteKind)12343,t_mapping(t_uint256,t_struct(ReceiptTrackingInfo)26919_storage))" + "type": "t_mapping(t_enum(VoteKind)110385,t_mapping(t_uint256,t_struct(ReceiptTrackingInfo)119555_storage))" }, { - "astId": 26944, - "contract": "contracts/ronin/gateway/BridgeTracking.sol:BridgeTracking", + "astId": 119580, + "contract": "src/ronin/gateway/BridgeTracking.sol:BridgeTracking", "label": "_lastSyncPeriod", "offset": 0, "slot": "11", @@ -569,23 +547,23 @@ "numberOfBytes": "20" }, "t_array(t_address)dyn_storage": { - "base": "t_address", "encoding": "dynamic_array", "label": "address[]", - "numberOfBytes": "32" + "numberOfBytes": "32", + "base": "t_address" }, - "t_array(t_struct(Request)12339_storage)dyn_storage": { - "base": "t_struct(Request)12339_storage", + "t_array(t_struct(Request)110381_storage)dyn_storage": { "encoding": "dynamic_array", "label": "struct IBridgeTracking.Request[]", - "numberOfBytes": "32" + "numberOfBytes": "32", + "base": "t_struct(Request)110381_storage" }, "t_bool": { "encoding": "inplace", "label": "bool", "numberOfBytes": "1" }, - "t_enum(VoteKind)12343": { + "t_enum(VoteKind)110385": { "encoding": "inplace", "label": "enum IBridgeTracking.VoteKind", "numberOfBytes": "1" @@ -604,158 +582,158 @@ "numberOfBytes": "32", "value": "t_uint256" }, - "t_mapping(t_enum(VoteKind)12343,t_mapping(t_uint256,t_struct(ReceiptTrackingInfo)26919_storage))": { + "t_mapping(t_enum(VoteKind)110385,t_mapping(t_uint256,t_struct(ReceiptTrackingInfo)119555_storage))": { "encoding": "mapping", - "key": "t_enum(VoteKind)12343", + "key": "t_enum(VoteKind)110385", "label": "mapping(enum IBridgeTracking.VoteKind => mapping(uint256 => struct BridgeTracking.ReceiptTrackingInfo))", "numberOfBytes": "32", - "value": "t_mapping(t_uint256,t_struct(ReceiptTrackingInfo)26919_storage)" + "value": "t_mapping(t_uint256,t_struct(ReceiptTrackingInfo)119555_storage)" }, - "t_mapping(t_uint256,t_struct(PeriodVotingMetric)26893_storage)": { + "t_mapping(t_uint256,t_struct(PeriodVotingMetric)119529_storage)": { "encoding": "mapping", "key": "t_uint256", "label": "mapping(uint256 => struct BridgeTracking.PeriodVotingMetric)", "numberOfBytes": "32", - "value": "t_struct(PeriodVotingMetric)26893_storage" + "value": "t_struct(PeriodVotingMetric)119529_storage" }, - "t_mapping(t_uint256,t_struct(ReceiptTrackingInfo)26919_storage)": { + "t_mapping(t_uint256,t_struct(ReceiptTrackingInfo)119555_storage)": { "encoding": "mapping", "key": "t_uint256", "label": "mapping(uint256 => struct BridgeTracking.ReceiptTrackingInfo)", "numberOfBytes": "32", - "value": "t_struct(ReceiptTrackingInfo)26919_storage" + "value": "t_struct(ReceiptTrackingInfo)119555_storage" }, - "t_struct(PeriodVotingMetric)26893_storage": { + "t_struct(PeriodVotingMetric)119529_storage": { "encoding": "inplace", "label": "struct BridgeTracking.PeriodVotingMetric", + "numberOfBytes": "128", "members": [ { - "astId": 26883, - "contract": "contracts/ronin/gateway/BridgeTracking.sol:BridgeTracking", + "astId": 119519, + "contract": "src/ronin/gateway/BridgeTracking.sol:BridgeTracking", "label": "totalRequest", "offset": 0, "slot": "0", "type": "t_uint256" }, { - "astId": 26885, - "contract": "contracts/ronin/gateway/BridgeTracking.sol:BridgeTracking", + "astId": 119521, + "contract": "src/ronin/gateway/BridgeTracking.sol:BridgeTracking", "label": "totalBallot", "offset": 0, "slot": "1", "type": "t_uint256" }, { - "astId": 26889, - "contract": "contracts/ronin/gateway/BridgeTracking.sol:BridgeTracking", + "astId": 119525, + "contract": "src/ronin/gateway/BridgeTracking.sol:BridgeTracking", "label": "totalBallotOf", "offset": 0, "slot": "2", "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 26892, - "contract": "contracts/ronin/gateway/BridgeTracking.sol:BridgeTracking", + "astId": 119528, + "contract": "src/ronin/gateway/BridgeTracking.sol:BridgeTracking", "label": "voters", "offset": 0, "slot": "3", "type": "t_array(t_address)dyn_storage" } - ], - "numberOfBytes": "128" + ] }, - "t_struct(PeriodVotingMetricTimeWrapper)26903_storage": { + "t_struct(PeriodVotingMetricTimeWrapper)119539_storage": { "encoding": "inplace", "label": "struct BridgeTracking.PeriodVotingMetricTimeWrapper", + "numberOfBytes": "192", "members": [ { - "astId": 26895, - "contract": "contracts/ronin/gateway/BridgeTracking.sol:BridgeTracking", + "astId": 119531, + "contract": "src/ronin/gateway/BridgeTracking.sol:BridgeTracking", "label": "lastEpoch", "offset": 0, "slot": "0", "type": "t_uint256" }, { - "astId": 26899, - "contract": "contracts/ronin/gateway/BridgeTracking.sol:BridgeTracking", + "astId": 119535, + "contract": "src/ronin/gateway/BridgeTracking.sol:BridgeTracking", "label": "requests", "offset": 0, "slot": "1", - "type": "t_array(t_struct(Request)12339_storage)dyn_storage" + "type": "t_array(t_struct(Request)110381_storage)dyn_storage" }, { - "astId": 26902, - "contract": "contracts/ronin/gateway/BridgeTracking.sol:BridgeTracking", + "astId": 119538, + "contract": "src/ronin/gateway/BridgeTracking.sol:BridgeTracking", "label": "data", "offset": 0, "slot": "2", - "type": "t_struct(PeriodVotingMetric)26893_storage" + "type": "t_struct(PeriodVotingMetric)119529_storage" } - ], - "numberOfBytes": "192" + ] }, - "t_struct(ReceiptTrackingInfo)26919_storage": { + "t_struct(ReceiptTrackingInfo)119555_storage": { "encoding": "inplace", "label": "struct BridgeTracking.ReceiptTrackingInfo", + "numberOfBytes": "128", "members": [ { - "astId": 26906, - "contract": "contracts/ronin/gateway/BridgeTracking.sol:BridgeTracking", + "astId": 119542, + "contract": "src/ronin/gateway/BridgeTracking.sol:BridgeTracking", "label": "approvedPeriod", "offset": 0, "slot": "0", "type": "t_uint256" }, { - "astId": 26910, - "contract": "contracts/ronin/gateway/BridgeTracking.sol:BridgeTracking", + "astId": 119546, + "contract": "src/ronin/gateway/BridgeTracking.sol:BridgeTracking", "label": "voters", "offset": 0, "slot": "1", "type": "t_array(t_address)dyn_storage" }, { - "astId": 26915, - "contract": "contracts/ronin/gateway/BridgeTracking.sol:BridgeTracking", + "astId": 119551, + "contract": "src/ronin/gateway/BridgeTracking.sol:BridgeTracking", "label": "voted", "offset": 0, "slot": "2", "type": "t_mapping(t_address,t_bool)" }, { - "astId": 26918, - "contract": "contracts/ronin/gateway/BridgeTracking.sol:BridgeTracking", + "astId": 119554, + "contract": "src/ronin/gateway/BridgeTracking.sol:BridgeTracking", "label": "trackedPeriod", "offset": 0, "slot": "3", "type": "t_uint256" } - ], - "numberOfBytes": "128" + ] }, - "t_struct(Request)12339_storage": { + "t_struct(Request)110381_storage": { "encoding": "inplace", "label": "struct IBridgeTracking.Request", + "numberOfBytes": "64", "members": [ { - "astId": 12336, - "contract": "contracts/ronin/gateway/BridgeTracking.sol:BridgeTracking", + "astId": 110378, + "contract": "src/ronin/gateway/BridgeTracking.sol:BridgeTracking", "label": "kind", "offset": 0, "slot": "0", - "type": "t_enum(VoteKind)12343" + "type": "t_enum(VoteKind)110385" }, { - "astId": 12338, - "contract": "contracts/ronin/gateway/BridgeTracking.sol:BridgeTracking", + "astId": 110380, + "contract": "src/ronin/gateway/BridgeTracking.sol:BridgeTracking", "label": "id", "offset": 0, "slot": "1", "type": "t_uint256" } - ], - "numberOfBytes": "64" + ] }, "t_uint256": { "encoding": "inplace", @@ -768,5 +746,10 @@ "numberOfBytes": "1" } } + }, + "timestamp": 1713251844, + "userdoc": { + "version": 1, + "kind": "user" } } \ No newline at end of file diff --git a/deployments/ronin-testnet/RoninGatewayPauseEnforcerLogic.json b/deployments/ronin-testnet/RoninGatewayPauseEnforcerLogic.json index 7807ec57..289aef4c 100644 --- a/deployments/ronin-testnet/RoninGatewayPauseEnforcerLogic.json +++ b/deployments/ronin-testnet/RoninGatewayPauseEnforcerLogic.json @@ -1,505 +1,451 @@ { - "address": "0x39394AbCfBeA3D5829eB8b0995073BC48bBFF2cF", "abi": [ { + "type": "constructor", "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" + "stateMutability": "nonpayable" }, { - "inputs": [], - "name": "ErrNotOnEmergencyPause", - "type": "error" - }, - { - "inputs": [], - "name": "ErrTargetIsNotOnPaused", - "type": "error" - }, - { - "inputs": [], - "name": "ErrTargetIsOnPaused", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "EmergencyPaused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "EmergencyUnpaused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "contract IPauseTarget", - "name": "target", - "type": "address" - } - ], - "name": "TargetChanged", - "type": "event" - }, - { - "inputs": [], + "type": "function", "name": "DEFAULT_ADMIN_ROLE", + "inputs": [], "outputs": [ { - "internalType": "bytes32", "name": "", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "SENTRY_ROLE", + "inputs": [], "outputs": [ { - "internalType": "bytes32", "name": "", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "changeTarget", "inputs": [ { - "internalType": "contract IPauseTarget", "name": "_target", - "type": "address" + "type": "address", + "internalType": "contract IPauseTarget" } ], - "name": "changeTarget", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { - "inputs": [], + "type": "function", "name": "emergency", + "inputs": [], "outputs": [ { - "internalType": "bool", "name": "", - "type": "bool" + "type": "bool", + "internalType": "bool" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getRoleAdmin", "inputs": [ { - "internalType": "bytes32", "name": "role", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "name": "getRoleAdmin", "outputs": [ { - "internalType": "bytes32", "name": "", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getRoleMember", "inputs": [ { - "internalType": "bytes32", "name": "role", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "uint256", "name": "index", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "getRoleMember", "outputs": [ { - "internalType": "address", "name": "", - "type": "address" + "type": "address", + "internalType": "address" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "getRoleMemberCount", "inputs": [ { - "internalType": "bytes32", "name": "role", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "name": "getRoleMemberCount", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "grantRole", "inputs": [ { - "internalType": "bytes32", "name": "role", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "address", "name": "account", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "grantRole", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "grantSentry", "inputs": [ { - "internalType": "address", "name": "_sentry", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "grantSentry", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "hasRole", "inputs": [ { - "internalType": "bytes32", "name": "role", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "address", "name": "account", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "hasRole", "outputs": [ { - "internalType": "bool", "name": "", - "type": "bool" + "type": "bool", + "internalType": "bool" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "type": "function", + "name": "initialize", "inputs": [ { - "internalType": "contract IPauseTarget", "name": "_target", - "type": "address" + "type": "address", + "internalType": "contract IPauseTarget" }, { - "internalType": "address", "name": "_admin", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address[]", "name": "_sentries", - "type": "address[]" + "type": "address[]", + "internalType": "address[]" } ], - "name": "initialize", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "renounceRole", "inputs": [ { - "internalType": "bytes32", "name": "role", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "address", "name": "account", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "renounceRole", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "revokeRole", "inputs": [ { - "internalType": "bytes32", "name": "role", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "address", "name": "account", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "revokeRole", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "revokeSentry", "inputs": [ { - "internalType": "address", "name": "_sentry", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "revokeSentry", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "supportsInterface", "inputs": [ { - "internalType": "bytes4", "name": "interfaceId", - "type": "bytes4" + "type": "bytes4", + "internalType": "bytes4" } ], - "name": "supportsInterface", "outputs": [ { - "internalType": "bool", "name": "", - "type": "bool" + "type": "bool", + "internalType": "bool" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "target", + "inputs": [], "outputs": [ { - "internalType": "contract IPauseTarget", "name": "", - "type": "address" + "type": "address", + "internalType": "contract IPauseTarget" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], + "type": "function", "name": "triggerPause", + "inputs": [], "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { - "inputs": [], + "type": "function", "name": "triggerUnpause", + "inputs": [], "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x71a23d976aeef588c14e34581ac5449358a01a15862420ea979fad26d8f9934a", - "receipt": { - "to": null, - "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", - "contractAddress": "0x39394AbCfBeA3D5829eB8b0995073BC48bBFF2cF", - "transactionIndex": 0, - "gasUsed": "1052959", - "logsBloom": "0x00000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000010000000000000000000000000000000000000000000000000000000000010000000000000000", - "blockHash": "0xb251a956ac535611fe52c94f508b118f61603bcf7e23aaaf9308e26e64d65cac", - "transactionHash": "0x71a23d976aeef588c14e34581ac5449358a01a15862420ea979fad26d8f9934a", - "logs": [ - { - "transactionIndex": 0, - "blockNumber": 18056476, - "transactionHash": "0x71a23d976aeef588c14e34581ac5449358a01a15862420ea979fad26d8f9934a", - "address": "0x39394AbCfBeA3D5829eB8b0995073BC48bBFF2cF", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", - "logIndex": 0, - "blockHash": "0xb251a956ac535611fe52c94f508b118f61603bcf7e23aaaf9308e26e64d65cac" - } - ], - "blockNumber": 18056476, - "cumulativeGasUsed": "1052959", - "status": 1, - "byzantium": true - }, - "args": [], - "numDeployments": 1, - "solcInputHash": "1abe3fccfa260ef2553161b857d04cdf", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ErrNotOnEmergencyPause\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrTargetIsNotOnPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrTargetIsOnPaused\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"EmergencyPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"EmergencyUnpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IPauseTarget\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"TargetChanged\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SENTRY_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPauseTarget\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"changeTarget\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"emergency\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getRoleMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleMemberCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sentry\",\"type\":\"address\"}],\"name\":\"grantSentry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPauseTarget\",\"name\":\"_target\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_admin\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"_sentries\",\"type\":\"address[]\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sentry\",\"type\":\"address\"}],\"name\":\"revokeSentry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"target\",\"outputs\":[{\"internalType\":\"contract IPauseTarget\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"triggerPause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"triggerUnpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"ErrNotOnEmergencyPause()\":[{\"details\":\"Error thrown when the contract is not on emergency pause.\"}],\"ErrTargetIsNotOnPaused()\":[{\"details\":\"Error thrown when the target is not on paused state.\"}],\"ErrTargetIsOnPaused()\":[{\"details\":\"Error thrown when the target is already on paused state.\"}]},\"events\":{\"EmergencyPaused(address)\":{\"details\":\"Emitted when the emergency ppause is triggered by `account`.\"},\"EmergencyUnpaused(address)\":{\"details\":\"Emitted when the emergency unpause is triggered by `account`.\"},\"TargetChanged(address)\":{\"details\":\"Emitted when the target is changed.\"}},\"kind\":\"dev\",\"methods\":{\"changeTarget(address)\":{\"details\":\"Setter for `target`. Requirements: - Only admin can call this method.\"},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"getRoleMember(bytes32,uint256)\":{\"details\":\"Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.\"},\"getRoleMemberCount(bytes32)\":{\"details\":\"Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"grantSentry(address)\":{\"details\":\"Grants the SENTRY_ROLE to the specified address.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"initialize(address,address,address[])\":{\"details\":\"Initializes the contract storage.\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`. May emit a {RoleRevoked} event.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"revokeSentry(address)\":{\"details\":\"Revokes the SENTRY_ROLE from the specified address.\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"},\"triggerPause()\":{\"details\":\"Triggers a pause on the target contract. Requirements: - Only be called by accounts with the SENTRY_ROLE, - The target contract is not already paused.\"},\"triggerUnpause()\":{\"details\":\"Triggers an unpause on the target contract. Requirements: - Only be called by accounts with the SENTRY_ROLE, - The target contract is already paused. - The target contract is paused in emergency mode.\"}},\"stateVariables\":{\"emergency\":{\"details\":\"Indicating whether or not the target contract is paused in emergency mode.\"},\"target\":{\"details\":\"The contract that can be paused or unpaused by the SENTRY_ROLE.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/ronin/gateway/PauseEnforcer.sol\":\"PauseEnforcer\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"none\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@ronin/contracts/=./contracts/\",\":bridge-operator-governance/=contracts/extensions/bridge-operator-governance/\",\":collections/=contracts/extensions/collections/\",\":consumers/=contracts/extensions/consumers/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":forge-std/=lib/forge-std/src/\",\":forwarder/=contracts/extensions/forwarder/\",\":sequential-governance/=contracts/extensions/sequential-governance/\",\":slash-indicator/=contracts/interfaces/slash-indicator/\",\":staking/=contracts/interfaces/staking/\",\":validator/=contracts/interfaces/validator/\",\":version-control/=contracts/extensions/version-control/\"]},\"sources\":{\"@openzeppelin/contracts/access/AccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\nimport \\\"../utils/Context.sol\\\";\\nimport \\\"../utils/Strings.sol\\\";\\nimport \\\"../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it.\\n */\\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\\n struct RoleData {\\n mapping(address => bool) members;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with a standardized message including the required role.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n *\\n * _Available since v4.1._\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role);\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\\n return _roles[role].members[account];\\n }\\n\\n /**\\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\\n * Overriding this function changes the behavior of the {onlyRole} modifier.\\n *\\n * Format of the revert message is described in {_checkRole}.\\n *\\n * _Available since v4.6._\\n */\\n function _checkRole(bytes32 role) internal view virtual {\\n _checkRole(role, _msgSender());\\n }\\n\\n /**\\n * @dev Revert with a standard message if `account` is missing `role`.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert(\\n string(\\n abi.encodePacked(\\n \\\"AccessControl: account \\\",\\n Strings.toHexString(uint160(account), 20),\\n \\\" is missing role \\\",\\n Strings.toHexString(uint256(role), 32)\\n )\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function renounceRole(bytes32 role, address account) public virtual override {\\n require(account == _msgSender(), \\\"AccessControl: can only renounce roles for self\\\");\\n\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event. Note that unlike {grantRole}, this function doesn't perform any\\n * checks on the calling account.\\n *\\n * May emit a {RoleGranted} event.\\n *\\n * [WARNING]\\n * ====\\n * This function should only be called from the constructor when setting\\n * up the initial roles for the system.\\n *\\n * Using this function in any other way is effectively circumventing the admin\\n * system imposed by {AccessControl}.\\n * ====\\n *\\n * NOTE: This function is deprecated in favor of {_grantRole}.\\n */\\n function _setupRole(bytes32 role, address account) internal virtual {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual {\\n if (!hasRole(role, account)) {\\n _roles[role].members[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n }\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual {\\n if (hasRole(role, account)) {\\n _roles[role].members[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5b35d8e68aeaccc685239bd9dd79b9ba01a0357930f8a3307ab85511733d9724\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/AccessControlEnumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlEnumerable.sol\\\";\\nimport \\\"./AccessControl.sol\\\";\\nimport \\\"../utils/structs/EnumerableSet.sol\\\";\\n\\n/**\\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\\n */\\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {\\n return _roleMembers[role].at(index);\\n }\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {\\n return _roleMembers[role].length();\\n }\\n\\n /**\\n * @dev Overload {_grantRole} to track enumerable memberships\\n */\\n function _grantRole(bytes32 role, address account) internal virtual override {\\n super._grantRole(role, account);\\n _roleMembers[role].add(account);\\n }\\n\\n /**\\n * @dev Overload {_revokeRole} to track enumerable memberships\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual override {\\n super._revokeRole(role, account);\\n _roleMembers[role].remove(account);\\n }\\n}\\n\",\"keccak256\":\"0x13f5e15f2a0650c0b6aaee2ef19e89eaf4870d6e79662d572a393334c1397247\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControlEnumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\n\\n/**\\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\\n */\\ninterface IAccessControlEnumerable is IAccessControl {\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xba4459ab871dfa300f5212c6c30178b63898c03533a1ede28436f11546626676\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2a21b14ff90012878752f230d3ffd5c3405e5938d06c97a7d89c0a64561d0d66\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _HEX_SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n // Inspired by OraclizeAPI's implementation - MIT licence\\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\\n\\n if (value == 0) {\\n return \\\"0\\\";\\n }\\n uint256 temp = value;\\n uint256 digits;\\n while (temp != 0) {\\n digits++;\\n temp /= 10;\\n }\\n bytes memory buffer = new bytes(digits);\\n while (value != 0) {\\n digits -= 1;\\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\\n value /= 10;\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n if (value == 0) {\\n return \\\"0x00\\\";\\n }\\n uint256 temp = value;\\n uint256 length = 0;\\n while (temp != 0) {\\n length++;\\n temp >>= 8;\\n }\\n return toHexString(value, length);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xaf159a8b1923ad2a26d516089bceca9bdeaeacd04be50983ea00ba63070f08a3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n *\\n * [WARNING]\\n * ====\\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.\\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\\n *\\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.\\n * ====\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n bytes32 lastValue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastValue;\\n // Update the index for the moved value\\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n return set._values[index];\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function _values(Set storage set) private view returns (bytes32[] memory) {\\n return set._values;\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\\n return _values(set._inner);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(AddressSet storage set) internal view returns (address[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n address[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(UintSet storage set) internal view returns (uint256[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n uint256[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0x5050943b32b6a8f282573d166b2e9d87ab7eb4dbba4ab6acf36ecb54fe6995e4\",\"license\":\"MIT\"},\"contracts/interfaces/IPauseTarget.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IPauseTarget {\\n function pause() external;\\n\\n function unpause() external;\\n\\n function paused() external returns (bool);\\n}\\n\",\"keccak256\":\"0xc91073e61da572de0087b41018fd30b03661d58e0c5061e7b9d1c9235cd7c1c3\",\"license\":\"MIT\"},\"contracts/ronin/gateway/PauseEnforcer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/access/AccessControlEnumerable.sol\\\";\\nimport \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport \\\"../../interfaces/IPauseTarget.sol\\\";\\n\\ncontract PauseEnforcer is AccessControlEnumerable, Initializable {\\n /**\\n * @dev Error thrown when the target is already on paused state.\\n */\\n error ErrTargetIsOnPaused();\\n\\n /**\\n * @dev Error thrown when the target is not on paused state.\\n */\\n error ErrTargetIsNotOnPaused();\\n\\n /**\\n * @dev Error thrown when the contract is not on emergency pause.\\n */\\n error ErrNotOnEmergencyPause();\\n\\n bytes32 public constant SENTRY_ROLE = keccak256(\\\"SENTRY_ROLE\\\");\\n\\n /// @dev The contract that can be paused or unpaused by the SENTRY_ROLE.\\n IPauseTarget public target;\\n /// @dev Indicating whether or not the target contract is paused in emergency mode.\\n bool public emergency;\\n\\n /// @dev Emitted when the emergency ppause is triggered by `account`.\\n event EmergencyPaused(address account);\\n /// @dev Emitted when the emergency unpause is triggered by `account`.\\n event EmergencyUnpaused(address account);\\n /// @dev Emitted when the target is changed.\\n event TargetChanged(IPauseTarget target);\\n\\n modifier onEmergency() {\\n if (!emergency) revert ErrNotOnEmergencyPause();\\n\\n _;\\n }\\n\\n modifier targetPaused() {\\n if (!target.paused()) revert ErrTargetIsOnPaused();\\n\\n _;\\n }\\n\\n modifier targetNotPaused() {\\n if (target.paused()) revert ErrTargetIsNotOnPaused();\\n\\n _;\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /**\\n * @dev Initializes the contract storage.\\n */\\n function initialize(IPauseTarget _target, address _admin, address[] memory _sentries) external initializer {\\n _changeTarget(_target);\\n _setupRole(DEFAULT_ADMIN_ROLE, _admin);\\n for (uint _i; _i < _sentries.length; ) {\\n _grantRole(SENTRY_ROLE, _sentries[_i]);\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n }\\n\\n /**\\n * @dev Grants the SENTRY_ROLE to the specified address.\\n */\\n function grantSentry(address _sentry) external onlyRole(DEFAULT_ADMIN_ROLE) {\\n _grantRole(SENTRY_ROLE, _sentry);\\n }\\n\\n /**\\n * @dev Revokes the SENTRY_ROLE from the specified address.\\n */\\n function revokeSentry(address _sentry) external onlyRole(DEFAULT_ADMIN_ROLE) {\\n _revokeRole(SENTRY_ROLE, _sentry);\\n }\\n\\n /**\\n * @dev Triggers a pause on the target contract.\\n *\\n * Requirements:\\n * - Only be called by accounts with the SENTRY_ROLE,\\n * - The target contract is not already paused.\\n */\\n function triggerPause() external onlyRole(SENTRY_ROLE) targetNotPaused {\\n emergency = true;\\n target.pause();\\n emit EmergencyPaused(msg.sender);\\n }\\n\\n /**\\n * @dev Triggers an unpause on the target contract.\\n *\\n * Requirements:\\n * - Only be called by accounts with the SENTRY_ROLE,\\n * - The target contract is already paused.\\n * - The target contract is paused in emergency mode.\\n */\\n function triggerUnpause() external onlyRole(SENTRY_ROLE) onEmergency targetPaused {\\n emergency = false;\\n target.unpause();\\n emit EmergencyUnpaused(msg.sender);\\n }\\n\\n /**\\n * @dev Setter for `target`.\\n *\\n * Requirements:\\n * - Only admin can call this method.\\n */\\n function changeTarget(IPauseTarget _target) external onlyRole(DEFAULT_ADMIN_ROLE) {\\n _changeTarget(_target);\\n }\\n\\n /**\\n * @dev Internal helper for setting value to `target`.\\n */\\n function _changeTarget(IPauseTarget _target) internal {\\n target = _target;\\n emit TargetChanged(_target);\\n }\\n}\\n\",\"keccak256\":\"0x22412c51c9877e24696d4bf2e0ce86c2cd2a27c6dbd2633e6e9843f720d960e1\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b5061001961001e565b6100de565b600254610100900460ff161561008a5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60025460ff90811610156100dc576002805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61119b806100ed6000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c806391d14854116100a2578063caa6fea411610071578063caa6fea414610240578063d4b8399214610254578063d547741f1461026d578063dcf7bb5c14610280578063f82ec70b1461029357600080fd5b806391d148541461020a578063a217fddf1461021d578063b9f3163b14610225578063ca15c8731461022d57600080fd5b80636833f60d116100e95780636833f60d1461019c57806377a24f36146101a45780637a9ad019146101b75780637d4f7fc9146101cc5780639010d07c146101df57600080fd5b806301ffc9a71461011b578063248a9ca3146101435780632f2ff15d1461017457806336568abe14610189575b600080fd5b61012e610129366004610e11565b6102a6565b60405190151581526020015b60405180910390f35b610166610151366004610e3b565b60009081526020819052604090206001015490565b60405190815260200161013a565b610187610182366004610e79565b6102d1565b005b610187610197366004610e79565b6102fb565b61018761037e565b6101876101b2366004610ebf565b6104da565b61016660008051602061116f83398151915281565b6101876101da366004610fab565b610640565b6101f26101ed366004610fc8565b610663565b6040516001600160a01b03909116815260200161013a565b61012e610218366004610e79565b610682565b610166600081565b6101876106ab565b61016661023b366004610e3b565b610821565b60025461012e90600160b01b900460ff1681565b6002546101f2906201000090046001600160a01b031681565b61018761027b366004610e79565b610838565b61018761028e366004610fab565b61085d565b6101876102a1366004610fab565b610871565b60006001600160e01b03198216635a05180f60e01b14806102cb57506102cb82610894565b92915050565b6000828152602081905260409020600101546102ec816108c9565b6102f683836108d6565b505050565b6001600160a01b03811633146103705760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61037a82826108f8565b5050565b60008051602061116f833981519152610396816108c9565b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af11580156103e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040d9190610fea565b1561042b576040516310067f7560e11b815260040160405180910390fd5b60028054600160b01b60ff60b01b19909116179081905560408051638456cb5960e01b81529051620100009092046001600160a01b031691638456cb599160048082019260009290919082900301818387803b15801561048a57600080fd5b505af115801561049e573d6000803e3d6000fd5b50506040513381527fb8fad2fa0ed7a383e747c309ef2c4391d7b65592a48893e57ccc1fab70791456925060200190505b60405180910390a150565b600254610100900460ff16158080156104fa5750600254600160ff909116105b806105145750303b158015610514575060025460ff166001145b6105775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610367565b6002805460ff19166001179055801561059a576002805461ff0019166101001790555b6105a38461091a565b6105ae600084610972565b60005b82518110156105f3576105eb60008051602061116f8339815191528483815181106105de576105de61100c565b60200260200101516108d6565b6001016105b1565b50801561063a576002805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b600061064b816108c9565b61037a60008051602061116f833981519152836108d6565b600082815260016020526040812061067b908361097c565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008051602061116f8339815191526106c3816108c9565b600254600160b01b900460ff166106ed57604051631b2fd53f60e31b815260040160405180910390fd5b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610740573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107649190610fea565b61078157604051631e87b57b60e31b815260040160405180910390fd5b6002805460ff60b01b19169081905560408051631fa5d41d60e11b81529051620100009092046001600160a01b031691633f4ba83a9160048082019260009290919082900301818387803b1580156107d857600080fd5b505af11580156107ec573d6000803e3d6000fd5b50506040513381527ff5cbf596165cc457b2cd92e8d8450827ee314968160a5696402d75766fc52caf925060200190506104cf565b60008181526001602052604081206102cb90610988565b600082815260208190526040902060010154610853816108c9565b6102f683836108f8565b6000610868816108c9565b61037a8261091a565b600061087c816108c9565b61037a60008051602061116f833981519152836108f8565b60006001600160e01b03198216637965db0b60e01b14806102cb57506301ffc9a760e01b6001600160e01b03198316146102cb565b6108d38133610992565b50565b6108e082826109f6565b60008281526001602052604090206102f69082610a7a565b6109028282610a8f565b60008281526001602052604090206102f69082610af4565b6002805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040519081527f7f8cffd58ac96898bdd25ab64868bd933141d15ad1cd4a0df228fd3fcba2a26d906020016104cf565b61037a82826108d6565b600061067b8383610b09565b60006102cb825490565b61099c8282610682565b61037a576109b4816001600160a01b03166014610b33565b6109bf836020610b33565b6040516020016109d0929190611046565b60408051601f198184030181529082905262461bcd60e51b8252610367916004016110bb565b610a008282610682565b61037a576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610a363390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061067b836001600160a01b038416610ccf565b610a998282610682565b1561037a576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061067b836001600160a01b038416610d1e565b6000826000018281548110610b2057610b2061100c565b9060005260206000200154905092915050565b60606000610b42836002611104565b610b4d90600261111b565b67ffffffffffffffff811115610b6557610b65610ea9565b6040519080825280601f01601f191660200182016040528015610b8f576020820181803683370190505b509050600360fc1b81600081518110610baa57610baa61100c565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610bd957610bd961100c565b60200101906001600160f81b031916908160001a9053506000610bfd846002611104565b610c0890600161111b565b90505b6001811115610c80576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610c3c57610c3c61100c565b1a60f81b828281518110610c5257610c5261100c565b60200101906001600160f81b031916908160001a90535060049490941c93610c798161112e565b9050610c0b565b50831561067b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610367565b6000818152600183016020526040812054610d16575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556102cb565b5060006102cb565b60008181526001830160205260408120548015610e07576000610d42600183611145565b8554909150600090610d5690600190611145565b9050818114610dbb576000866000018281548110610d7657610d7661100c565b9060005260206000200154905080876000018481548110610d9957610d9961100c565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610dcc57610dcc611158565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506102cb565b60009150506102cb565b600060208284031215610e2357600080fd5b81356001600160e01b03198116811461067b57600080fd5b600060208284031215610e4d57600080fd5b5035919050565b6001600160a01b03811681146108d357600080fd5b8035610e7481610e54565b919050565b60008060408385031215610e8c57600080fd5b823591506020830135610e9e81610e54565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600060608486031215610ed457600080fd5b8335610edf81610e54565b9250602084810135610ef081610e54565b9250604085013567ffffffffffffffff80821115610f0d57600080fd5b818701915087601f830112610f2157600080fd5b813581811115610f3357610f33610ea9565b8060051b604051601f19603f83011681018181108582111715610f5857610f58610ea9565b60405291825284820192508381018501918a831115610f7657600080fd5b938501935b82851015610f9b57610f8c85610e69565b84529385019392850192610f7b565b8096505050505050509250925092565b600060208284031215610fbd57600080fd5b813561067b81610e54565b60008060408385031215610fdb57600080fd5b50508035926020909101359150565b600060208284031215610ffc57600080fd5b8151801515811461067b57600080fd5b634e487b7160e01b600052603260045260246000fd5b60005b8381101561103d578181015183820152602001611025565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161107e816017850160208801611022565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516110af816028840160208801611022565b01602801949350505050565b60208152600082518060208401526110da816040850160208701611022565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176102cb576102cb6110ee565b808201808211156102cb576102cb6110ee565b60008161113d5761113d6110ee565b506000190190565b818103818111156102cb576102cb6110ee565b634e487b7160e01b600052603160045260246000fdfe5bea60102f2a7acc9e82b1af0e3bd4069661102bb5dd143a6051cd1980dded1ca164736f6c6343000811000a", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101165760003560e01c806391d14854116100a2578063caa6fea411610071578063caa6fea414610240578063d4b8399214610254578063d547741f1461026d578063dcf7bb5c14610280578063f82ec70b1461029357600080fd5b806391d148541461020a578063a217fddf1461021d578063b9f3163b14610225578063ca15c8731461022d57600080fd5b80636833f60d116100e95780636833f60d1461019c57806377a24f36146101a45780637a9ad019146101b75780637d4f7fc9146101cc5780639010d07c146101df57600080fd5b806301ffc9a71461011b578063248a9ca3146101435780632f2ff15d1461017457806336568abe14610189575b600080fd5b61012e610129366004610e11565b6102a6565b60405190151581526020015b60405180910390f35b610166610151366004610e3b565b60009081526020819052604090206001015490565b60405190815260200161013a565b610187610182366004610e79565b6102d1565b005b610187610197366004610e79565b6102fb565b61018761037e565b6101876101b2366004610ebf565b6104da565b61016660008051602061116f83398151915281565b6101876101da366004610fab565b610640565b6101f26101ed366004610fc8565b610663565b6040516001600160a01b03909116815260200161013a565b61012e610218366004610e79565b610682565b610166600081565b6101876106ab565b61016661023b366004610e3b565b610821565b60025461012e90600160b01b900460ff1681565b6002546101f2906201000090046001600160a01b031681565b61018761027b366004610e79565b610838565b61018761028e366004610fab565b61085d565b6101876102a1366004610fab565b610871565b60006001600160e01b03198216635a05180f60e01b14806102cb57506102cb82610894565b92915050565b6000828152602081905260409020600101546102ec816108c9565b6102f683836108d6565b505050565b6001600160a01b03811633146103705760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61037a82826108f8565b5050565b60008051602061116f833981519152610396816108c9565b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af11580156103e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040d9190610fea565b1561042b576040516310067f7560e11b815260040160405180910390fd5b60028054600160b01b60ff60b01b19909116179081905560408051638456cb5960e01b81529051620100009092046001600160a01b031691638456cb599160048082019260009290919082900301818387803b15801561048a57600080fd5b505af115801561049e573d6000803e3d6000fd5b50506040513381527fb8fad2fa0ed7a383e747c309ef2c4391d7b65592a48893e57ccc1fab70791456925060200190505b60405180910390a150565b600254610100900460ff16158080156104fa5750600254600160ff909116105b806105145750303b158015610514575060025460ff166001145b6105775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610367565b6002805460ff19166001179055801561059a576002805461ff0019166101001790555b6105a38461091a565b6105ae600084610972565b60005b82518110156105f3576105eb60008051602061116f8339815191528483815181106105de576105de61100c565b60200260200101516108d6565b6001016105b1565b50801561063a576002805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b600061064b816108c9565b61037a60008051602061116f833981519152836108d6565b600082815260016020526040812061067b908361097c565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008051602061116f8339815191526106c3816108c9565b600254600160b01b900460ff166106ed57604051631b2fd53f60e31b815260040160405180910390fd5b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610740573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107649190610fea565b61078157604051631e87b57b60e31b815260040160405180910390fd5b6002805460ff60b01b19169081905560408051631fa5d41d60e11b81529051620100009092046001600160a01b031691633f4ba83a9160048082019260009290919082900301818387803b1580156107d857600080fd5b505af11580156107ec573d6000803e3d6000fd5b50506040513381527ff5cbf596165cc457b2cd92e8d8450827ee314968160a5696402d75766fc52caf925060200190506104cf565b60008181526001602052604081206102cb90610988565b600082815260208190526040902060010154610853816108c9565b6102f683836108f8565b6000610868816108c9565b61037a8261091a565b600061087c816108c9565b61037a60008051602061116f833981519152836108f8565b60006001600160e01b03198216637965db0b60e01b14806102cb57506301ffc9a760e01b6001600160e01b03198316146102cb565b6108d38133610992565b50565b6108e082826109f6565b60008281526001602052604090206102f69082610a7a565b6109028282610a8f565b60008281526001602052604090206102f69082610af4565b6002805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040519081527f7f8cffd58ac96898bdd25ab64868bd933141d15ad1cd4a0df228fd3fcba2a26d906020016104cf565b61037a82826108d6565b600061067b8383610b09565b60006102cb825490565b61099c8282610682565b61037a576109b4816001600160a01b03166014610b33565b6109bf836020610b33565b6040516020016109d0929190611046565b60408051601f198184030181529082905262461bcd60e51b8252610367916004016110bb565b610a008282610682565b61037a576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610a363390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061067b836001600160a01b038416610ccf565b610a998282610682565b1561037a576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061067b836001600160a01b038416610d1e565b6000826000018281548110610b2057610b2061100c565b9060005260206000200154905092915050565b60606000610b42836002611104565b610b4d90600261111b565b67ffffffffffffffff811115610b6557610b65610ea9565b6040519080825280601f01601f191660200182016040528015610b8f576020820181803683370190505b509050600360fc1b81600081518110610baa57610baa61100c565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610bd957610bd961100c565b60200101906001600160f81b031916908160001a9053506000610bfd846002611104565b610c0890600161111b565b90505b6001811115610c80576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610c3c57610c3c61100c565b1a60f81b828281518110610c5257610c5261100c565b60200101906001600160f81b031916908160001a90535060049490941c93610c798161112e565b9050610c0b565b50831561067b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610367565b6000818152600183016020526040812054610d16575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556102cb565b5060006102cb565b60008181526001830160205260408120548015610e07576000610d42600183611145565b8554909150600090610d5690600190611145565b9050818114610dbb576000866000018281548110610d7657610d7661100c565b9060005260206000200154905080876000018481548110610d9957610d9961100c565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610dcc57610dcc611158565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506102cb565b60009150506102cb565b600060208284031215610e2357600080fd5b81356001600160e01b03198116811461067b57600080fd5b600060208284031215610e4d57600080fd5b5035919050565b6001600160a01b03811681146108d357600080fd5b8035610e7481610e54565b919050565b60008060408385031215610e8c57600080fd5b823591506020830135610e9e81610e54565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600060608486031215610ed457600080fd5b8335610edf81610e54565b9250602084810135610ef081610e54565b9250604085013567ffffffffffffffff80821115610f0d57600080fd5b818701915087601f830112610f2157600080fd5b813581811115610f3357610f33610ea9565b8060051b604051601f19603f83011681018181108582111715610f5857610f58610ea9565b60405291825284820192508381018501918a831115610f7657600080fd5b938501935b82851015610f9b57610f8c85610e69565b84529385019392850192610f7b565b8096505050505050509250925092565b600060208284031215610fbd57600080fd5b813561067b81610e54565b60008060408385031215610fdb57600080fd5b50508035926020909101359150565b600060208284031215610ffc57600080fd5b8151801515811461067b57600080fd5b634e487b7160e01b600052603260045260246000fd5b60005b8381101561103d578181015183820152602001611025565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161107e816017850160208801611022565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516110af816028840160208801611022565b01602801949350505050565b60208152600082518060208401526110da816040850160208701611022565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176102cb576102cb6110ee565b808201808211156102cb576102cb6110ee565b60008161113d5761113d6110ee565b506000190190565b818103818111156102cb576102cb6110ee565b634e487b7160e01b600052603160045260246000fdfe5bea60102f2a7acc9e82b1af0e3bd4069661102bb5dd143a6051cd1980dded1ca164736f6c6343000811000a", - "devdoc": { - "errors": { - "ErrNotOnEmergencyPause()": [ + "stateMutability": "nonpayable" + }, + { + "type": "event", + "name": "EmergencyPaused", + "inputs": [ { - "details": "Error thrown when the contract is not on emergency pause." + "name": "account", + "type": "address", + "indexed": false, + "internalType": "address" } ], - "ErrTargetIsNotOnPaused()": [ + "anonymous": false + }, + { + "type": "event", + "name": "EmergencyUnpaused", + "inputs": [ { - "details": "Error thrown when the target is not on paused state." + "name": "account", + "type": "address", + "indexed": false, + "internalType": "address" } ], - "ErrTargetIsOnPaused()": [ + "anonymous": false + }, + { + "type": "event", + "name": "Initialized", + "inputs": [ { - "details": "Error thrown when the target is already on paused state." + "name": "version", + "type": "uint8", + "indexed": false, + "internalType": "uint8" } - ] + ], + "anonymous": false }, - "events": { - "EmergencyPaused(address)": { - "details": "Emitted when the emergency ppause is triggered by `account`." - }, - "EmergencyUnpaused(address)": { - "details": "Emitted when the emergency unpause is triggered by `account`." - }, - "TargetChanged(address)": { - "details": "Emitted when the target is changed." - } + { + "type": "event", + "name": "RoleAdminChanged", + "inputs": [ + { + "name": "role", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "previousAdminRole", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "newAdminRole", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RoleGranted", + "inputs": [ + { + "name": "role", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "account", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "sender", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RoleRevoked", + "inputs": [ + { + "name": "role", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "account", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "sender", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "TargetChanged", + "inputs": [ + { + "name": "target", + "type": "address", + "indexed": false, + "internalType": "contract IPauseTarget" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "ErrNotOnEmergencyPause", + "inputs": [] }, + { + "type": "error", + "name": "ErrTargetIsNotOnPaused", + "inputs": [] + }, + { + "type": "error", + "name": "ErrTargetIsOnPaused", + "inputs": [] + } + ], + "address": "0x4222384E84C248aa8D50FDC702a1b55E6b4efc99", + "args": "0x", + "ast": "", + "blockNumber": 26515571, + "bytecode": "0x608060405234801561001057600080fd5b5061001961001e565b6100de565b600254610100900460ff161561008a5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60025460ff90811610156100dc576002805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6111c4806100ed6000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c806391d14854116100a2578063caa6fea411610071578063caa6fea414610240578063d4b8399214610254578063d547741f1461026d578063dcf7bb5c14610280578063f82ec70b1461029357600080fd5b806391d148541461020a578063a217fddf1461021d578063b9f3163b14610225578063ca15c8731461022d57600080fd5b80636833f60d116100e95780636833f60d1461019c57806377a24f36146101a45780637a9ad019146101b75780637d4f7fc9146101cc5780639010d07c146101df57600080fd5b806301ffc9a71461011b578063248a9ca3146101435780632f2ff15d1461017457806336568abe14610189575b600080fd5b61012e610129366004610e11565b6102a6565b60405190151581526020015b60405180910390f35b610166610151366004610e3b565b60009081526020819052604090206001015490565b60405190815260200161013a565b610187610182366004610e79565b6102d1565b005b610187610197366004610e79565b6102fb565b61018761037e565b6101876101b2366004610ebf565b6104da565b61016660008051602061116f83398151915281565b6101876101da366004610fab565b610640565b6101f26101ed366004610fc8565b610663565b6040516001600160a01b03909116815260200161013a565b61012e610218366004610e79565b610682565b610166600081565b6101876106ab565b61016661023b366004610e3b565b610821565b60025461012e90600160b01b900460ff1681565b6002546101f2906201000090046001600160a01b031681565b61018761027b366004610e79565b610838565b61018761028e366004610fab565b61085d565b6101876102a1366004610fab565b610871565b60006001600160e01b03198216635a05180f60e01b14806102cb57506102cb82610894565b92915050565b6000828152602081905260409020600101546102ec816108c9565b6102f683836108d6565b505050565b6001600160a01b03811633146103705760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61037a82826108f8565b5050565b60008051602061116f833981519152610396816108c9565b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af11580156103e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040d9190610fea565b1561042b576040516310067f7560e11b815260040160405180910390fd5b60028054600160b01b60ff60b01b19909116179081905560408051638456cb5960e01b81529051620100009092046001600160a01b031691638456cb599160048082019260009290919082900301818387803b15801561048a57600080fd5b505af115801561049e573d6000803e3d6000fd5b50506040513381527fb8fad2fa0ed7a383e747c309ef2c4391d7b65592a48893e57ccc1fab70791456925060200190505b60405180910390a150565b600254610100900460ff16158080156104fa5750600254600160ff909116105b806105145750303b158015610514575060025460ff166001145b6105775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610367565b6002805460ff19166001179055801561059a576002805461ff0019166101001790555b6105a38461091a565b6105ae600084610972565b60005b82518110156105f3576105eb60008051602061116f8339815191528483815181106105de576105de61100c565b60200260200101516108d6565b6001016105b1565b50801561063a576002805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b600061064b816108c9565b61037a60008051602061116f833981519152836108d6565b600082815260016020526040812061067b908361097c565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008051602061116f8339815191526106c3816108c9565b600254600160b01b900460ff166106ed57604051631b2fd53f60e31b815260040160405180910390fd5b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610740573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107649190610fea565b61078157604051631e87b57b60e31b815260040160405180910390fd5b6002805460ff60b01b19169081905560408051631fa5d41d60e11b81529051620100009092046001600160a01b031691633f4ba83a9160048082019260009290919082900301818387803b1580156107d857600080fd5b505af11580156107ec573d6000803e3d6000fd5b50506040513381527ff5cbf596165cc457b2cd92e8d8450827ee314968160a5696402d75766fc52caf925060200190506104cf565b60008181526001602052604081206102cb90610988565b600082815260208190526040902060010154610853816108c9565b6102f683836108f8565b6000610868816108c9565b61037a8261091a565b600061087c816108c9565b61037a60008051602061116f833981519152836108f8565b60006001600160e01b03198216637965db0b60e01b14806102cb57506301ffc9a760e01b6001600160e01b03198316146102cb565b6108d38133610992565b50565b6108e082826109f6565b60008281526001602052604090206102f69082610a7a565b6109028282610a8f565b60008281526001602052604090206102f69082610af4565b6002805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040519081527f7f8cffd58ac96898bdd25ab64868bd933141d15ad1cd4a0df228fd3fcba2a26d906020016104cf565b61037a82826108d6565b600061067b8383610b09565b60006102cb825490565b61099c8282610682565b61037a576109b4816001600160a01b03166014610b33565b6109bf836020610b33565b6040516020016109d0929190611046565b60408051601f198184030181529082905262461bcd60e51b8252610367916004016110bb565b610a008282610682565b61037a576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610a363390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061067b836001600160a01b038416610ccf565b610a998282610682565b1561037a576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061067b836001600160a01b038416610d1e565b6000826000018281548110610b2057610b2061100c565b9060005260206000200154905092915050565b60606000610b42836002611104565b610b4d90600261111b565b67ffffffffffffffff811115610b6557610b65610ea9565b6040519080825280601f01601f191660200182016040528015610b8f576020820181803683370190505b509050600360fc1b81600081518110610baa57610baa61100c565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610bd957610bd961100c565b60200101906001600160f81b031916908160001a9053506000610bfd846002611104565b610c0890600161111b565b90505b6001811115610c80576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610c3c57610c3c61100c565b1a60f81b828281518110610c5257610c5261100c565b60200101906001600160f81b031916908160001a90535060049490941c93610c798161112e565b9050610c0b565b50831561067b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610367565b6000818152600183016020526040812054610d16575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556102cb565b5060006102cb565b60008181526001830160205260408120548015610e07576000610d42600183611145565b8554909150600090610d5690600190611145565b9050818114610dbb576000866000018281548110610d7657610d7661100c565b9060005260206000200154905080876000018481548110610d9957610d9961100c565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610dcc57610dcc611158565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506102cb565b60009150506102cb565b600060208284031215610e2357600080fd5b81356001600160e01b03198116811461067b57600080fd5b600060208284031215610e4d57600080fd5b5035919050565b6001600160a01b03811681146108d357600080fd5b8035610e7481610e54565b919050565b60008060408385031215610e8c57600080fd5b823591506020830135610e9e81610e54565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600060608486031215610ed457600080fd5b8335610edf81610e54565b9250602084810135610ef081610e54565b9250604085013567ffffffffffffffff80821115610f0d57600080fd5b818701915087601f830112610f2157600080fd5b813581811115610f3357610f33610ea9565b8060051b604051601f19603f83011681018181108582111715610f5857610f58610ea9565b60405291825284820192508381018501918a831115610f7657600080fd5b938501935b82851015610f9b57610f8c85610e69565b84529385019392850192610f7b565b8096505050505050509250925092565b600060208284031215610fbd57600080fd5b813561067b81610e54565b60008060408385031215610fdb57600080fd5b50508035926020909101359150565b600060208284031215610ffc57600080fd5b8151801515811461067b57600080fd5b634e487b7160e01b600052603260045260246000fd5b60005b8381101561103d578181015183820152602001611025565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161107e816017850160208801611022565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516110af816028840160208801611022565b01602801949350505050565b60208152600082518060208401526110da816040850160208701611022565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176102cb576102cb6110ee565b808201808211156102cb576102cb6110ee565b60008161113d5761113d6110ee565b506000190190565b818103818111156102cb576102cb6110ee565b634e487b7160e01b600052603160045260246000fdfe5bea60102f2a7acc9e82b1af0e3bd4069661102bb5dd143a6051cd1980dded1ca26469706673582212205cd579cff7903082498e437ed3eb21f8623bfa7f518ca2799b5e3497b22a08a864736f6c63430008170033", + "chainId": 2021, + "contractAbsolutePath": "PauseEnforcer.sol", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101165760003560e01c806391d14854116100a2578063caa6fea411610071578063caa6fea414610240578063d4b8399214610254578063d547741f1461026d578063dcf7bb5c14610280578063f82ec70b1461029357600080fd5b806391d148541461020a578063a217fddf1461021d578063b9f3163b14610225578063ca15c8731461022d57600080fd5b80636833f60d116100e95780636833f60d1461019c57806377a24f36146101a45780637a9ad019146101b75780637d4f7fc9146101cc5780639010d07c146101df57600080fd5b806301ffc9a71461011b578063248a9ca3146101435780632f2ff15d1461017457806336568abe14610189575b600080fd5b61012e610129366004610e11565b6102a6565b60405190151581526020015b60405180910390f35b610166610151366004610e3b565b60009081526020819052604090206001015490565b60405190815260200161013a565b610187610182366004610e79565b6102d1565b005b610187610197366004610e79565b6102fb565b61018761037e565b6101876101b2366004610ebf565b6104da565b61016660008051602061116f83398151915281565b6101876101da366004610fab565b610640565b6101f26101ed366004610fc8565b610663565b6040516001600160a01b03909116815260200161013a565b61012e610218366004610e79565b610682565b610166600081565b6101876106ab565b61016661023b366004610e3b565b610821565b60025461012e90600160b01b900460ff1681565b6002546101f2906201000090046001600160a01b031681565b61018761027b366004610e79565b610838565b61018761028e366004610fab565b61085d565b6101876102a1366004610fab565b610871565b60006001600160e01b03198216635a05180f60e01b14806102cb57506102cb82610894565b92915050565b6000828152602081905260409020600101546102ec816108c9565b6102f683836108d6565b505050565b6001600160a01b03811633146103705760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61037a82826108f8565b5050565b60008051602061116f833981519152610396816108c9565b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af11580156103e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040d9190610fea565b1561042b576040516310067f7560e11b815260040160405180910390fd5b60028054600160b01b60ff60b01b19909116179081905560408051638456cb5960e01b81529051620100009092046001600160a01b031691638456cb599160048082019260009290919082900301818387803b15801561048a57600080fd5b505af115801561049e573d6000803e3d6000fd5b50506040513381527fb8fad2fa0ed7a383e747c309ef2c4391d7b65592a48893e57ccc1fab70791456925060200190505b60405180910390a150565b600254610100900460ff16158080156104fa5750600254600160ff909116105b806105145750303b158015610514575060025460ff166001145b6105775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610367565b6002805460ff19166001179055801561059a576002805461ff0019166101001790555b6105a38461091a565b6105ae600084610972565b60005b82518110156105f3576105eb60008051602061116f8339815191528483815181106105de576105de61100c565b60200260200101516108d6565b6001016105b1565b50801561063a576002805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b600061064b816108c9565b61037a60008051602061116f833981519152836108d6565b600082815260016020526040812061067b908361097c565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008051602061116f8339815191526106c3816108c9565b600254600160b01b900460ff166106ed57604051631b2fd53f60e31b815260040160405180910390fd5b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610740573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107649190610fea565b61078157604051631e87b57b60e31b815260040160405180910390fd5b6002805460ff60b01b19169081905560408051631fa5d41d60e11b81529051620100009092046001600160a01b031691633f4ba83a9160048082019260009290919082900301818387803b1580156107d857600080fd5b505af11580156107ec573d6000803e3d6000fd5b50506040513381527ff5cbf596165cc457b2cd92e8d8450827ee314968160a5696402d75766fc52caf925060200190506104cf565b60008181526001602052604081206102cb90610988565b600082815260208190526040902060010154610853816108c9565b6102f683836108f8565b6000610868816108c9565b61037a8261091a565b600061087c816108c9565b61037a60008051602061116f833981519152836108f8565b60006001600160e01b03198216637965db0b60e01b14806102cb57506301ffc9a760e01b6001600160e01b03198316146102cb565b6108d38133610992565b50565b6108e082826109f6565b60008281526001602052604090206102f69082610a7a565b6109028282610a8f565b60008281526001602052604090206102f69082610af4565b6002805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040519081527f7f8cffd58ac96898bdd25ab64868bd933141d15ad1cd4a0df228fd3fcba2a26d906020016104cf565b61037a82826108d6565b600061067b8383610b09565b60006102cb825490565b61099c8282610682565b61037a576109b4816001600160a01b03166014610b33565b6109bf836020610b33565b6040516020016109d0929190611046565b60408051601f198184030181529082905262461bcd60e51b8252610367916004016110bb565b610a008282610682565b61037a576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610a363390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061067b836001600160a01b038416610ccf565b610a998282610682565b1561037a576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061067b836001600160a01b038416610d1e565b6000826000018281548110610b2057610b2061100c565b9060005260206000200154905092915050565b60606000610b42836002611104565b610b4d90600261111b565b67ffffffffffffffff811115610b6557610b65610ea9565b6040519080825280601f01601f191660200182016040528015610b8f576020820181803683370190505b509050600360fc1b81600081518110610baa57610baa61100c565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610bd957610bd961100c565b60200101906001600160f81b031916908160001a9053506000610bfd846002611104565b610c0890600161111b565b90505b6001811115610c80576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610c3c57610c3c61100c565b1a60f81b828281518110610c5257610c5261100c565b60200101906001600160f81b031916908160001a90535060049490941c93610c798161112e565b9050610c0b565b50831561067b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610367565b6000818152600183016020526040812054610d16575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556102cb565b5060006102cb565b60008181526001830160205260408120548015610e07576000610d42600183611145565b8554909150600090610d5690600190611145565b9050818114610dbb576000866000018281548110610d7657610d7661100c565b9060005260206000200154905080876000018481548110610d9957610d9961100c565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610dcc57610dcc611158565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506102cb565b60009150506102cb565b600060208284031215610e2357600080fd5b81356001600160e01b03198116811461067b57600080fd5b600060208284031215610e4d57600080fd5b5035919050565b6001600160a01b03811681146108d357600080fd5b8035610e7481610e54565b919050565b60008060408385031215610e8c57600080fd5b823591506020830135610e9e81610e54565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600060608486031215610ed457600080fd5b8335610edf81610e54565b9250602084810135610ef081610e54565b9250604085013567ffffffffffffffff80821115610f0d57600080fd5b818701915087601f830112610f2157600080fd5b813581811115610f3357610f33610ea9565b8060051b604051601f19603f83011681018181108582111715610f5857610f58610ea9565b60405291825284820192508381018501918a831115610f7657600080fd5b938501935b82851015610f9b57610f8c85610e69565b84529385019392850192610f7b565b8096505050505050509250925092565b600060208284031215610fbd57600080fd5b813561067b81610e54565b60008060408385031215610fdb57600080fd5b50508035926020909101359150565b600060208284031215610ffc57600080fd5b8151801515811461067b57600080fd5b634e487b7160e01b600052603260045260246000fd5b60005b8381101561103d578181015183820152602001611025565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161107e816017850160208801611022565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516110af816028840160208801611022565b01602801949350505050565b60208152600082518060208401526110da816040850160208701611022565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176102cb576102cb6110ee565b808201808211156102cb576102cb6110ee565b60008161113d5761113d6110ee565b506000190190565b818103818111156102cb576102cb6110ee565b634e487b7160e01b600052603160045260246000fdfe5bea60102f2a7acc9e82b1af0e3bd4069661102bb5dd143a6051cd1980dded1ca26469706673582212205cd579cff7903082498e437ed3eb21f8623bfa7f518ca2799b5e3497b22a08a864736f6c63430008170033", + "deployer": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "devdoc": { + "version": 1, "kind": "dev", "methods": { "changeTarget(address)": { @@ -545,66 +491,96 @@ "details": "Triggers an unpause on the target contract. Requirements: - Only be called by accounts with the SENTRY_ROLE, - The target contract is already paused. - The target contract is paused in emergency mode." } }, - "stateVariables": { - "emergency": { - "details": "Indicating whether or not the target contract is paused in emergency mode." + "events": { + "EmergencyPaused(address)": { + "details": "Emitted when the emergency ppause is triggered by `account`." + }, + "EmergencyUnpaused(address)": { + "details": "Emitted when the emergency unpause is triggered by `account`." + }, + "Initialized(uint8)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "RoleAdminChanged(bytes32,bytes32,bytes32)": { + "details": "Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this. _Available since v3.1._" + }, + "RoleGranted(bytes32,address,address)": { + "details": "Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}." }, - "target": { - "details": "The contract that can be paused or unpaused by the SENTRY_ROLE." + "RoleRevoked(bytes32,address,address)": { + "details": "Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)" + }, + "TargetChanged(address)": { + "details": "Emitted when the target is changed." } }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 + "errors": { + "ErrNotOnEmergencyPause()": [ + { + "details": "Error thrown when the contract is not on emergency pause." + } + ], + "ErrTargetIsNotOnPaused()": [ + { + "details": "Error thrown when the target is not on paused state." + } + ], + "ErrTargetIsOnPaused()": [ + { + "details": "Error thrown when the target is already on paused state." + } + ] + } }, + "isFoundry": true, + "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ErrNotOnEmergencyPause\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrTargetIsNotOnPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrTargetIsOnPaused\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"EmergencyPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"EmergencyUnpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IPauseTarget\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"TargetChanged\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SENTRY_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPauseTarget\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"changeTarget\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"emergency\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getRoleMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleMemberCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sentry\",\"type\":\"address\"}],\"name\":\"grantSentry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPauseTarget\",\"name\":\"_target\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_admin\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"_sentries\",\"type\":\"address[]\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sentry\",\"type\":\"address\"}],\"name\":\"revokeSentry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"target\",\"outputs\":[{\"internalType\":\"contract IPauseTarget\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"triggerPause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"triggerUnpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"ErrNotOnEmergencyPause()\":[{\"details\":\"Error thrown when the contract is not on emergency pause.\"}],\"ErrTargetIsNotOnPaused()\":[{\"details\":\"Error thrown when the target is not on paused state.\"}],\"ErrTargetIsOnPaused()\":[{\"details\":\"Error thrown when the target is already on paused state.\"}]},\"events\":{\"EmergencyPaused(address)\":{\"details\":\"Emitted when the emergency ppause is triggered by `account`.\"},\"EmergencyUnpaused(address)\":{\"details\":\"Emitted when the emergency unpause is triggered by `account`.\"},\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"RoleAdminChanged(bytes32,bytes32,bytes32)\":{\"details\":\"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this. _Available since v3.1._\"},\"RoleGranted(bytes32,address,address)\":{\"details\":\"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.\"},\"RoleRevoked(bytes32,address,address)\":{\"details\":\"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)\"},\"TargetChanged(address)\":{\"details\":\"Emitted when the target is changed.\"}},\"kind\":\"dev\",\"methods\":{\"changeTarget(address)\":{\"details\":\"Setter for `target`. Requirements: - Only admin can call this method.\"},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"getRoleMember(bytes32,uint256)\":{\"details\":\"Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.\"},\"getRoleMemberCount(bytes32)\":{\"details\":\"Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"grantSentry(address)\":{\"details\":\"Grants the SENTRY_ROLE to the specified address.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"initialize(address,address,address[])\":{\"details\":\"Initializes the contract storage.\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`. May emit a {RoleRevoked} event.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"revokeSentry(address)\":{\"details\":\"Revokes the SENTRY_ROLE from the specified address.\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"},\"triggerPause()\":{\"details\":\"Triggers a pause on the target contract. Requirements: - Only be called by accounts with the SENTRY_ROLE, - The target contract is not already paused.\"},\"triggerUnpause()\":{\"details\":\"Triggers an unpause on the target contract. Requirements: - Only be called by accounts with the SENTRY_ROLE, - The target contract is already paused. - The target contract is paused in emergency mode.\"}},\"stateVariables\":{\"emergency\":{\"details\":\"Indicating whether or not the target contract is paused in emergency mode.\"},\"target\":{\"details\":\"The contract that can be paused or unpaused by the SENTRY_ROLE.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/ronin/gateway/PauseEnforcer.sol\":\"PauseEnforcer\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@fdk/=lib/foundry-deployment-kit/script/\",\":@openzeppelin/=lib/openzeppelin-contracts/\",\":@prb/math/=lib/prb-math/\",\":@prb/test/=lib/prb-test/src/\",\":@ronin/contracts/=src/\",\":@ronin/script/=script/\",\":@ronin/test/=test/\",\":contract-libs/=lib/foundry-deployment-kit/lib/contract-libs/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/foundry-deployment-kit/lib/forge-std/src/\",\":foundry-deployment-kit/=lib/foundry-deployment-kit/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/contracts/\",\":prb-math/=lib/prb-math/src/\",\":prb-test/=lib/prb-test/src/\",\":solady/=lib/solady/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/access/AccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\nimport \\\"../utils/Context.sol\\\";\\nimport \\\"../utils/Strings.sol\\\";\\nimport \\\"../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it.\\n */\\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\\n struct RoleData {\\n mapping(address => bool) members;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with a standardized message including the required role.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n *\\n * _Available since v4.1._\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role);\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\\n return _roles[role].members[account];\\n }\\n\\n /**\\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\\n * Overriding this function changes the behavior of the {onlyRole} modifier.\\n *\\n * Format of the revert message is described in {_checkRole}.\\n *\\n * _Available since v4.6._\\n */\\n function _checkRole(bytes32 role) internal view virtual {\\n _checkRole(role, _msgSender());\\n }\\n\\n /**\\n * @dev Revert with a standard message if `account` is missing `role`.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert(\\n string(\\n abi.encodePacked(\\n \\\"AccessControl: account \\\",\\n Strings.toHexString(uint160(account), 20),\\n \\\" is missing role \\\",\\n Strings.toHexString(uint256(role), 32)\\n )\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function renounceRole(bytes32 role, address account) public virtual override {\\n require(account == _msgSender(), \\\"AccessControl: can only renounce roles for self\\\");\\n\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event. Note that unlike {grantRole}, this function doesn't perform any\\n * checks on the calling account.\\n *\\n * May emit a {RoleGranted} event.\\n *\\n * [WARNING]\\n * ====\\n * This function should only be called from the constructor when setting\\n * up the initial roles for the system.\\n *\\n * Using this function in any other way is effectively circumventing the admin\\n * system imposed by {AccessControl}.\\n * ====\\n *\\n * NOTE: This function is deprecated in favor of {_grantRole}.\\n */\\n function _setupRole(bytes32 role, address account) internal virtual {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual {\\n if (!hasRole(role, account)) {\\n _roles[role].members[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n }\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual {\\n if (hasRole(role, account)) {\\n _roles[role].members[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5b35d8e68aeaccc685239bd9dd79b9ba01a0357930f8a3307ab85511733d9724\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/access/AccessControlEnumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlEnumerable.sol\\\";\\nimport \\\"./AccessControl.sol\\\";\\nimport \\\"../utils/structs/EnumerableSet.sol\\\";\\n\\n/**\\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\\n */\\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {\\n return _roleMembers[role].at(index);\\n }\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {\\n return _roleMembers[role].length();\\n }\\n\\n /**\\n * @dev Overload {_grantRole} to track enumerable memberships\\n */\\n function _grantRole(bytes32 role, address account) internal virtual override {\\n super._grantRole(role, account);\\n _roleMembers[role].add(account);\\n }\\n\\n /**\\n * @dev Overload {_revokeRole} to track enumerable memberships\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual override {\\n super._revokeRole(role, account);\\n _roleMembers[role].remove(account);\\n }\\n}\\n\",\"keccak256\":\"0x13f5e15f2a0650c0b6aaee2ef19e89eaf4870d6e79662d572a393334c1397247\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/access/IAccessControlEnumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\n\\n/**\\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\\n */\\ninterface IAccessControlEnumerable is IAccessControl {\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xba4459ab871dfa300f5212c6c30178b63898c03533a1ede28436f11546626676\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2a21b14ff90012878752f230d3ffd5c3405e5938d06c97a7d89c0a64561d0d66\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _HEX_SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n // Inspired by OraclizeAPI's implementation - MIT licence\\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\\n\\n if (value == 0) {\\n return \\\"0\\\";\\n }\\n uint256 temp = value;\\n uint256 digits;\\n while (temp != 0) {\\n digits++;\\n temp /= 10;\\n }\\n bytes memory buffer = new bytes(digits);\\n while (value != 0) {\\n digits -= 1;\\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\\n value /= 10;\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n if (value == 0) {\\n return \\\"0x00\\\";\\n }\\n uint256 temp = value;\\n uint256 length = 0;\\n while (temp != 0) {\\n length++;\\n temp >>= 8;\\n }\\n return toHexString(value, length);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xaf159a8b1923ad2a26d516089bceca9bdeaeacd04be50983ea00ba63070f08a3\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n *\\n * [WARNING]\\n * ====\\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.\\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\\n *\\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.\\n * ====\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n bytes32 lastValue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastValue;\\n // Update the index for the moved value\\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n return set._values[index];\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function _values(Set storage set) private view returns (bytes32[] memory) {\\n return set._values;\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\\n return _values(set._inner);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(AddressSet storage set) internal view returns (address[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n address[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(UintSet storage set) internal view returns (uint256[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n uint256[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0x5050943b32b6a8f282573d166b2e9d87ab7eb4dbba4ab6acf36ecb54fe6995e4\",\"license\":\"MIT\"},\"src/interfaces/IPauseTarget.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IPauseTarget {\\n function pause() external;\\n\\n function unpause() external;\\n\\n function paused() external returns (bool);\\n}\\n\",\"keccak256\":\"0xc91073e61da572de0087b41018fd30b03661d58e0c5061e7b9d1c9235cd7c1c3\",\"license\":\"MIT\"},\"src/ronin/gateway/PauseEnforcer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/access/AccessControlEnumerable.sol\\\";\\nimport \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport \\\"../../interfaces/IPauseTarget.sol\\\";\\n\\ncontract PauseEnforcer is AccessControlEnumerable, Initializable {\\n /**\\n * @dev Error thrown when the target is already on paused state.\\n */\\n error ErrTargetIsOnPaused();\\n\\n /**\\n * @dev Error thrown when the target is not on paused state.\\n */\\n error ErrTargetIsNotOnPaused();\\n\\n /**\\n * @dev Error thrown when the contract is not on emergency pause.\\n */\\n error ErrNotOnEmergencyPause();\\n\\n bytes32 public constant SENTRY_ROLE = keccak256(\\\"SENTRY_ROLE\\\");\\n\\n /// @dev The contract that can be paused or unpaused by the SENTRY_ROLE.\\n IPauseTarget public target;\\n /// @dev Indicating whether or not the target contract is paused in emergency mode.\\n bool public emergency;\\n\\n /// @dev Emitted when the emergency ppause is triggered by `account`.\\n event EmergencyPaused(address account);\\n /// @dev Emitted when the emergency unpause is triggered by `account`.\\n event EmergencyUnpaused(address account);\\n /// @dev Emitted when the target is changed.\\n event TargetChanged(IPauseTarget target);\\n\\n modifier onEmergency() {\\n if (!emergency) revert ErrNotOnEmergencyPause();\\n\\n _;\\n }\\n\\n modifier targetPaused() {\\n if (!target.paused()) revert ErrTargetIsOnPaused();\\n\\n _;\\n }\\n\\n modifier targetNotPaused() {\\n if (target.paused()) revert ErrTargetIsNotOnPaused();\\n\\n _;\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /**\\n * @dev Initializes the contract storage.\\n */\\n function initialize(IPauseTarget _target, address _admin, address[] memory _sentries) external initializer {\\n _changeTarget(_target);\\n _setupRole(DEFAULT_ADMIN_ROLE, _admin);\\n for (uint _i; _i < _sentries.length;) {\\n _grantRole(SENTRY_ROLE, _sentries[_i]);\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n }\\n\\n /**\\n * @dev Grants the SENTRY_ROLE to the specified address.\\n */\\n function grantSentry(address _sentry) external onlyRole(DEFAULT_ADMIN_ROLE) {\\n _grantRole(SENTRY_ROLE, _sentry);\\n }\\n\\n /**\\n * @dev Revokes the SENTRY_ROLE from the specified address.\\n */\\n function revokeSentry(address _sentry) external onlyRole(DEFAULT_ADMIN_ROLE) {\\n _revokeRole(SENTRY_ROLE, _sentry);\\n }\\n\\n /**\\n * @dev Triggers a pause on the target contract.\\n *\\n * Requirements:\\n * - Only be called by accounts with the SENTRY_ROLE,\\n * - The target contract is not already paused.\\n */\\n function triggerPause() external onlyRole(SENTRY_ROLE) targetNotPaused {\\n emergency = true;\\n target.pause();\\n emit EmergencyPaused(msg.sender);\\n }\\n\\n /**\\n * @dev Triggers an unpause on the target contract.\\n *\\n * Requirements:\\n * - Only be called by accounts with the SENTRY_ROLE,\\n * - The target contract is already paused.\\n * - The target contract is paused in emergency mode.\\n */\\n function triggerUnpause() external onlyRole(SENTRY_ROLE) onEmergency targetPaused {\\n emergency = false;\\n target.unpause();\\n emit EmergencyUnpaused(msg.sender);\\n }\\n\\n /**\\n * @dev Setter for `target`.\\n *\\n * Requirements:\\n * - Only admin can call this method.\\n */\\n function changeTarget(IPauseTarget _target) external onlyRole(DEFAULT_ADMIN_ROLE) {\\n _changeTarget(_target);\\n }\\n\\n /**\\n * @dev Internal helper for setting value to `target`.\\n */\\n function _changeTarget(IPauseTarget _target) internal {\\n target = _target;\\n emit TargetChanged(_target);\\n }\\n}\\n\",\"keccak256\":\"0x4a758f6cc62826d0f513903df7cf9e63a5bbd7420d3f8349595fabea346beb37\",\"license\":\"MIT\"}},\"version\":1}", + "nonce": 192811, + "numDeployments": 2, "storageLayout": { "storage": [ { - "astId": 24, - "contract": "contracts/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", + "astId": 56841, + "contract": "src/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", "label": "_roles", "offset": 0, "slot": "0", - "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" + "type": "t_mapping(t_bytes32,t_struct(RoleData)56836_storage)" }, { - "astId": 338, - "contract": "contracts/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", + "astId": 57155, + "contract": "src/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", "label": "_roleMembers", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(AddressSet)4026_storage)" + "type": "t_mapping(t_bytes32,t_struct(AddressSet)64060_storage)" }, { - "astId": 1373, - "contract": "contracts/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", + "astId": 58190, + "contract": "src/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", "label": "_initialized", "offset": 0, "slot": "2", "type": "t_uint8" }, { - "astId": 1376, - "contract": "contracts/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", + "astId": 58193, + "contract": "src/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", "label": "_initializing", "offset": 1, "slot": "2", "type": "t_bool" }, { - "astId": 24083, - "contract": "contracts/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", + "astId": 121661, + "contract": "src/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", "label": "target", "offset": 2, "slot": "2", - "type": "t_contract(IPauseTarget)9588" + "type": "t_contract(IPauseTarget)110573" }, { - "astId": 24086, - "contract": "contracts/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", + "astId": 121664, + "contract": "src/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", "label": "emergency", "offset": 22, "slot": "2", @@ -618,10 +594,10 @@ "numberOfBytes": "20" }, "t_array(t_bytes32)dyn_storage": { - "base": "t_bytes32", "encoding": "dynamic_array", "label": "bytes32[]", - "numberOfBytes": "32" + "numberOfBytes": "32", + "base": "t_bytes32" }, "t_bool": { "encoding": "inplace", @@ -633,7 +609,7 @@ "label": "bytes32", "numberOfBytes": "32" }, - "t_contract(IPauseTarget)9588": { + "t_contract(IPauseTarget)110573": { "encoding": "inplace", "label": "contract IPauseTarget", "numberOfBytes": "20" @@ -645,19 +621,19 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_struct(AddressSet)4026_storage)": { + "t_mapping(t_bytes32,t_struct(AddressSet)64060_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct EnumerableSet.AddressSet)", "numberOfBytes": "32", - "value": "t_struct(AddressSet)4026_storage" + "value": "t_struct(AddressSet)64060_storage" }, - "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { + "t_mapping(t_bytes32,t_struct(RoleData)56836_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct AccessControl.RoleData)", "numberOfBytes": "32", - "value": "t_struct(RoleData)19_storage" + "value": "t_struct(RoleData)56836_storage" }, "t_mapping(t_bytes32,t_uint256)": { "encoding": "mapping", @@ -666,66 +642,66 @@ "numberOfBytes": "32", "value": "t_uint256" }, - "t_struct(AddressSet)4026_storage": { + "t_struct(AddressSet)64060_storage": { "encoding": "inplace", "label": "struct EnumerableSet.AddressSet", + "numberOfBytes": "64", "members": [ { - "astId": 4025, - "contract": "contracts/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", + "astId": 64059, + "contract": "src/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", "label": "_inner", "offset": 0, "slot": "0", - "type": "t_struct(Set)3725_storage" + "type": "t_struct(Set)63759_storage" } - ], - "numberOfBytes": "64" + ] }, - "t_struct(RoleData)19_storage": { + "t_struct(RoleData)56836_storage": { "encoding": "inplace", "label": "struct AccessControl.RoleData", + "numberOfBytes": "64", "members": [ { - "astId": 16, - "contract": "contracts/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", + "astId": 56833, + "contract": "src/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", "label": "members", "offset": 0, "slot": "0", "type": "t_mapping(t_address,t_bool)" }, { - "astId": 18, - "contract": "contracts/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", + "astId": 56835, + "contract": "src/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", "label": "adminRole", "offset": 0, "slot": "1", "type": "t_bytes32" } - ], - "numberOfBytes": "64" + ] }, - "t_struct(Set)3725_storage": { + "t_struct(Set)63759_storage": { "encoding": "inplace", "label": "struct EnumerableSet.Set", + "numberOfBytes": "64", "members": [ { - "astId": 3720, - "contract": "contracts/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", + "astId": 63754, + "contract": "src/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", "label": "_values", "offset": 0, "slot": "0", "type": "t_array(t_bytes32)dyn_storage" }, { - "astId": 3724, - "contract": "contracts/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", + "astId": 63758, + "contract": "src/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", "label": "_indexes", "offset": 0, "slot": "1", "type": "t_mapping(t_bytes32,t_uint256)" } - ], - "numberOfBytes": "64" + ] }, "t_uint256": { "encoding": "inplace", @@ -738,5 +714,10 @@ "numberOfBytes": "1" } } + }, + "timestamp": 1713251844, + "userdoc": { + "version": 1, + "kind": "user" } } \ No newline at end of file diff --git a/deployments/ronin-testnet/RoninGatewayV3Logic.json b/deployments/ronin-testnet/RoninGatewayV3Logic.json new file mode 100644 index 00000000..9a8936a0 --- /dev/null +++ b/deployments/ronin-testnet/RoninGatewayV3Logic.json @@ -0,0 +1,3198 @@ +{ + "abi": [ + { + "type": "constructor", + "inputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "fallback", + "stateMutability": "payable" + }, + { + "type": "receive", + "stateMutability": "payable" + }, + { + "type": "function", + "name": "DEFAULT_ADMIN_ROLE", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "bulkRequestWithdrawalFor", + "inputs": [ + { + "name": "requests", + "type": "tuple[]", + "internalType": "struct Transfer.Request[]", + "components": [ + { + "name": "recipientAddr", + "type": "address", + "internalType": "address" + }, + { + "name": "tokenAddr", + "type": "address", + "internalType": "address" + }, + { + "name": "info", + "type": "tuple", + "internalType": "struct TokenInfo", + "components": [ + { + "name": "erc", + "type": "uint8", + "internalType": "enum TokenStandard" + }, + { + "name": "id", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "quantity", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ] + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "bulkSubmitWithdrawalSignatures", + "inputs": [ + { + "name": "withdrawals", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "signatures", + "type": "bytes[]", + "internalType": "bytes[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "checkThreshold", + "inputs": [ + { + "name": "_voteWeight", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "depositFor", + "inputs": [ + { + "name": "_receipt", + "type": "tuple", + "internalType": "struct Transfer.Receipt", + "components": [ + { + "name": "id", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "kind", + "type": "uint8", + "internalType": "enum Transfer.Kind" + }, + { + "name": "mainchain", + "type": "tuple", + "internalType": "struct TokenOwner", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "tokenAddr", + "type": "address", + "internalType": "address" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "ronin", + "type": "tuple", + "internalType": "struct TokenOwner", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "tokenAddr", + "type": "address", + "internalType": "address" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "info", + "type": "tuple", + "internalType": "struct TokenInfo", + "components": [ + { + "name": "erc", + "type": "uint8", + "internalType": "enum TokenStandard" + }, + { + "name": "id", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "quantity", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "depositVote", + "inputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "status", + "type": "uint8", + "internalType": "enum VoteStatusConsumer.VoteStatus" + }, + { + "name": "finalHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "expiredAt", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "createdAt", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "depositVoted", + "inputs": [ + { + "name": "_chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_depositId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_voter", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "emergencyPauser", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getContract", + "inputs": [ + { + "name": "contractType", + "type": "uint8", + "internalType": "enum ContractType" + } + ], + "outputs": [ + { + "name": "contract_", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getMainchainToken", + "inputs": [ + { + "name": "_roninToken", + "type": "address", + "internalType": "address" + }, + { + "name": "_chainId", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "_token", + "type": "tuple", + "internalType": "struct MappedTokenConsumer.MappedToken", + "components": [ + { + "name": "erc", + "type": "uint8", + "internalType": "enum TokenStandard" + }, + { + "name": "tokenAddr", + "type": "address", + "internalType": "address" + } + ] + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getRoleAdmin", + "inputs": [ + { + "name": "role", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getRoleMember", + "inputs": [ + { + "name": "role", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "index", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getRoleMemberCount", + "inputs": [ + { + "name": "role", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getThreshold", + "inputs": [], + "outputs": [ + { + "name": "num_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "denom_", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getTrustedThreshold", + "inputs": [], + "outputs": [ + { + "name": "trustedNum_", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "trustedDenom_", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getWithdrawalSignatures", + "inputs": [ + { + "name": "withdrawalId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "operators", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [ + { + "name": "_signatures", + "type": "bytes[]", + "internalType": "bytes[]" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "grantRole", + "inputs": [ + { + "name": "role", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "account", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "hasRole", + "inputs": [ + { + "name": "role", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "account", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "initialize", + "inputs": [ + { + "name": "_roleSetter", + "type": "address", + "internalType": "address" + }, + { + "name": "_numerator", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_denominator", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_trustedNumerator", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_trustedDenominator", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "_packedAddresses", + "type": "address[][2]", + "internalType": "address[][2]" + }, + { + "name": "_packedNumbers", + "type": "uint256[][2]", + "internalType": "uint256[][2]" + }, + { + "name": "_standards", + "type": "uint8[]", + "internalType": "enum TokenStandard[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "initializeV2", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "initializeV3", + "inputs": [ + { + "name": "bridgeAdmin", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "mainchainWithdrew", + "inputs": [ + { + "name": "_withdrawalId", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "mainchainWithdrewVote", + "inputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "status", + "type": "uint8", + "internalType": "enum VoteStatusConsumer.VoteStatus" + }, + { + "name": "finalHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "expiredAt", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "createdAt", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "mainchainWithdrewVoted", + "inputs": [ + { + "name": "_withdrawalId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_voter", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "mapTokens", + "inputs": [ + { + "name": "_roninTokens", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "_mainchainTokens", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "_chainIds", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "_standards", + "type": "uint8[]", + "internalType": "enum TokenStandard[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "minimumThreshold", + "inputs": [ + { + "name": "mainchainToken", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "minimumVoteWeight", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "nonce", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "onERC1155BatchReceived", + "inputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + }, + { + "name": "", + "type": "address", + "internalType": "address" + }, + { + "name": "", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes4", + "internalType": "bytes4" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "onERC1155Received", + "inputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + }, + { + "name": "", + "type": "address", + "internalType": "address" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes4", + "internalType": "bytes4" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "pause", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "paused", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "renounceRole", + "inputs": [ + { + "name": "role", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "account", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "requestWithdrawalFor", + "inputs": [ + { + "name": "_request", + "type": "tuple", + "internalType": "struct Transfer.Request", + "components": [ + { + "name": "recipientAddr", + "type": "address", + "internalType": "address" + }, + { + "name": "tokenAddr", + "type": "address", + "internalType": "address" + }, + { + "name": "info", + "type": "tuple", + "internalType": "struct TokenInfo", + "components": [ + { + "name": "erc", + "type": "uint8", + "internalType": "enum TokenStandard" + }, + { + "name": "id", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "quantity", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ] + }, + { + "name": "_chainId", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "requestWithdrawalSignatures", + "inputs": [ + { + "name": "_withdrawalId", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "revokeRole", + "inputs": [ + { + "name": "role", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "account", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "setContract", + "inputs": [ + { + "name": "contractType", + "type": "uint8", + "internalType": "enum ContractType" + }, + { + "name": "addr", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "setEmergencyPauser", + "inputs": [ + { + "name": "_addr", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "setMinimumThresholds", + "inputs": [ + { + "name": "_tokens", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "_thresholds", + "type": "uint256[]", + "internalType": "uint256[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "setThreshold", + "inputs": [ + { + "name": "_numerator", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_denominator", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "setTrustedThreshold", + "inputs": [ + { + "name": "_trustedNumerator", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_trustedDenominator", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "supportsInterface", + "inputs": [ + { + "name": "interfaceId", + "type": "bytes4", + "internalType": "bytes4" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "tryBulkAcknowledgeMainchainWithdrew", + "inputs": [ + { + "name": "_withdrawalIds", + "type": "uint256[]", + "internalType": "uint256[]" + } + ], + "outputs": [ + { + "name": "_executedReceipts", + "type": "bool[]", + "internalType": "bool[]" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "tryBulkDepositFor", + "inputs": [ + { + "name": "receipts", + "type": "tuple[]", + "internalType": "struct Transfer.Receipt[]", + "components": [ + { + "name": "id", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "kind", + "type": "uint8", + "internalType": "enum Transfer.Kind" + }, + { + "name": "mainchain", + "type": "tuple", + "internalType": "struct TokenOwner", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "tokenAddr", + "type": "address", + "internalType": "address" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "ronin", + "type": "tuple", + "internalType": "struct TokenOwner", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "tokenAddr", + "type": "address", + "internalType": "address" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "info", + "type": "tuple", + "internalType": "struct TokenInfo", + "components": [ + { + "name": "erc", + "type": "uint8", + "internalType": "enum TokenStandard" + }, + { + "name": "id", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "quantity", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ] + } + ], + "outputs": [ + { + "name": "_executedReceipts", + "type": "bool[]", + "internalType": "bool[]" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "unpause", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "withdrawal", + "inputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "id", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "kind", + "type": "uint8", + "internalType": "enum Transfer.Kind" + }, + { + "name": "mainchain", + "type": "tuple", + "internalType": "struct TokenOwner", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "tokenAddr", + "type": "address", + "internalType": "address" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "ronin", + "type": "tuple", + "internalType": "struct TokenOwner", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "tokenAddr", + "type": "address", + "internalType": "address" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "info", + "type": "tuple", + "internalType": "struct TokenInfo", + "components": [ + { + "name": "erc", + "type": "uint8", + "internalType": "enum TokenStandard" + }, + { + "name": "id", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "quantity", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "withdrawalCount", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "withdrawalStatVote", + "inputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "status", + "type": "uint8", + "internalType": "enum VoteStatusConsumer.VoteStatus" + }, + { + "name": "finalHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "expiredAt", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "createdAt", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "event", + "name": "ContractUpdated", + "inputs": [ + { + "name": "contractType", + "type": "uint8", + "indexed": true, + "internalType": "enum ContractType" + }, + { + "name": "addr", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "DepositVoted", + "inputs": [ + { + "name": "bridgeOperator", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "id", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "chainId", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "receiptHash", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Deposited", + "inputs": [ + { + "name": "receiptHash", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + }, + { + "name": "receipt", + "type": "tuple", + "indexed": false, + "internalType": "struct Transfer.Receipt", + "components": [ + { + "name": "id", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "kind", + "type": "uint8", + "internalType": "enum Transfer.Kind" + }, + { + "name": "mainchain", + "type": "tuple", + "internalType": "struct TokenOwner", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "tokenAddr", + "type": "address", + "internalType": "address" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "ronin", + "type": "tuple", + "internalType": "struct TokenOwner", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "tokenAddr", + "type": "address", + "internalType": "address" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "info", + "type": "tuple", + "internalType": "struct TokenInfo", + "components": [ + { + "name": "erc", + "type": "uint8", + "internalType": "enum TokenStandard" + }, + { + "name": "id", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "quantity", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ] + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Initialized", + "inputs": [ + { + "name": "version", + "type": "uint8", + "indexed": false, + "internalType": "uint8" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "MainchainWithdrew", + "inputs": [ + { + "name": "receiptHash", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + }, + { + "name": "receipt", + "type": "tuple", + "indexed": false, + "internalType": "struct Transfer.Receipt", + "components": [ + { + "name": "id", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "kind", + "type": "uint8", + "internalType": "enum Transfer.Kind" + }, + { + "name": "mainchain", + "type": "tuple", + "internalType": "struct TokenOwner", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "tokenAddr", + "type": "address", + "internalType": "address" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "ronin", + "type": "tuple", + "internalType": "struct TokenOwner", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "tokenAddr", + "type": "address", + "internalType": "address" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "info", + "type": "tuple", + "internalType": "struct TokenInfo", + "components": [ + { + "name": "erc", + "type": "uint8", + "internalType": "enum TokenStandard" + }, + { + "name": "id", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "quantity", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ] + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "MinimumThresholdsUpdated", + "inputs": [ + { + "name": "tokens", + "type": "address[]", + "indexed": false, + "internalType": "address[]" + }, + { + "name": "threshold", + "type": "uint256[]", + "indexed": false, + "internalType": "uint256[]" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Paused", + "inputs": [ + { + "name": "account", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RoleAdminChanged", + "inputs": [ + { + "name": "role", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "previousAdminRole", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "newAdminRole", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RoleGranted", + "inputs": [ + { + "name": "role", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "account", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "sender", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RoleRevoked", + "inputs": [ + { + "name": "role", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "account", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "sender", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ThresholdUpdated", + "inputs": [ + { + "name": "nonce", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "numerator", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "denominator", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "previousNumerator", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "previousDenominator", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "TokenMapped", + "inputs": [ + { + "name": "roninTokens", + "type": "address[]", + "indexed": false, + "internalType": "address[]" + }, + { + "name": "mainchainTokens", + "type": "address[]", + "indexed": false, + "internalType": "address[]" + }, + { + "name": "chainIds", + "type": "uint256[]", + "indexed": false, + "internalType": "uint256[]" + }, + { + "name": "standards", + "type": "uint8[]", + "indexed": false, + "internalType": "enum TokenStandard[]" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "TrustedThresholdUpdated", + "inputs": [ + { + "name": "nonce", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "numerator", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "denominator", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "previousNumerator", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "previousDenominator", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Unpaused", + "inputs": [ + { + "name": "account", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "WithdrawalRequested", + "inputs": [ + { + "name": "receiptHash", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + }, + { + "name": "", + "type": "tuple", + "indexed": false, + "internalType": "struct Transfer.Receipt", + "components": [ + { + "name": "id", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "kind", + "type": "uint8", + "internalType": "enum Transfer.Kind" + }, + { + "name": "mainchain", + "type": "tuple", + "internalType": "struct TokenOwner", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "tokenAddr", + "type": "address", + "internalType": "address" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "ronin", + "type": "tuple", + "internalType": "struct TokenOwner", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "tokenAddr", + "type": "address", + "internalType": "address" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "info", + "type": "tuple", + "internalType": "struct TokenInfo", + "components": [ + { + "name": "erc", + "type": "uint8", + "internalType": "enum TokenStandard" + }, + { + "name": "id", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "quantity", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ] + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "WithdrawalSignaturesRequested", + "inputs": [ + { + "name": "receiptHash", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + }, + { + "name": "", + "type": "tuple", + "indexed": false, + "internalType": "struct Transfer.Receipt", + "components": [ + { + "name": "id", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "kind", + "type": "uint8", + "internalType": "enum Transfer.Kind" + }, + { + "name": "mainchain", + "type": "tuple", + "internalType": "struct TokenOwner", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "tokenAddr", + "type": "address", + "internalType": "address" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "ronin", + "type": "tuple", + "internalType": "struct TokenOwner", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "tokenAddr", + "type": "address", + "internalType": "address" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "info", + "type": "tuple", + "internalType": "struct TokenInfo", + "components": [ + { + "name": "erc", + "type": "uint8", + "internalType": "enum TokenStandard" + }, + { + "name": "id", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "quantity", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ] + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "ErrAlreadyVoted", + "inputs": [ + { + "name": "voter", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ErrContractTypeNotFound", + "inputs": [ + { + "name": "contractType", + "type": "uint8", + "internalType": "enum ContractType" + } + ] + }, + { + "type": "error", + "name": "ErrERC1155MintingFailed", + "inputs": [] + }, + { + "type": "error", + "name": "ErrERC20MintingFailed", + "inputs": [] + }, + { + "type": "error", + "name": "ErrERC721MintingFailed", + "inputs": [] + }, + { + "type": "error", + "name": "ErrEmptyArray", + "inputs": [] + }, + { + "type": "error", + "name": "ErrInvalidChainId", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + }, + { + "name": "actual", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expected", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "ErrInvalidInfo", + "inputs": [] + }, + { + "type": "error", + "name": "ErrInvalidReceipt", + "inputs": [] + }, + { + "type": "error", + "name": "ErrInvalidReceiptKind", + "inputs": [] + }, + { + "type": "error", + "name": "ErrInvalidRequest", + "inputs": [] + }, + { + "type": "error", + "name": "ErrInvalidThreshold", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrInvalidTokenStandard", + "inputs": [] + }, + { + "type": "error", + "name": "ErrInvalidTrustedThreshold", + "inputs": [] + }, + { + "type": "error", + "name": "ErrLengthMismatch", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrQueryForTooSmallQuantity", + "inputs": [] + }, + { + "type": "error", + "name": "ErrTokenCouldNotTransfer", + "inputs": [ + { + "name": "tokenInfo", + "type": "tuple", + "internalType": "struct TokenInfo", + "components": [ + { + "name": "erc", + "type": "uint8", + "internalType": "enum TokenStandard" + }, + { + "name": "id", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "quantity", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "to", + "type": "address", + "internalType": "address" + }, + { + "name": "token", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ErrTokenCouldNotTransferFrom", + "inputs": [ + { + "name": "tokenInfo", + "type": "tuple", + "internalType": "struct TokenInfo", + "components": [ + { + "name": "erc", + "type": "uint8", + "internalType": "enum TokenStandard" + }, + { + "name": "id", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "quantity", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "from", + "type": "address", + "internalType": "address" + }, + { + "name": "to", + "type": "address", + "internalType": "address" + }, + { + "name": "token", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ErrUnauthorized", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + }, + { + "name": "expectedRole", + "type": "uint8", + "internalType": "enum RoleAccess" + } + ] + }, + { + "type": "error", + "name": "ErrUnsupportedStandard", + "inputs": [] + }, + { + "type": "error", + "name": "ErrUnsupportedToken", + "inputs": [] + }, + { + "type": "error", + "name": "ErrWithdrawalsMigrated", + "inputs": [] + }, + { + "type": "error", + "name": "ErrWithdrawnOnMainchainAlready", + "inputs": [] + }, + { + "type": "error", + "name": "ErrZeroCodeContract", + "inputs": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + } + ] + } + ], + "address": "0xdA48f437Eb827CB997a7D09487D53bE72F2C57a8", + "args": "0x", + "ast": "", + "blockNumber": 26515571, + "bytecode": "0x60806040523480156200001157600080fd5b506000805460ff19169055620000266200002c565b620000ee565b603754610100900460ff1615620000995760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60375460ff9081161015620000ec576037805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6150b880620000fe6000396000f3fe6080604052600436106102975760003560e01c80638456cb591161015a578063ca15c873116100c1578063ecc836491161007a578063ecc836491461089f578063f0ce418e146108cc578063f23a6e6114610912578063f668214a1461093e578063fa3896591461095e578063fc6574bc1461097e576102a6565b8063ca15c873146107e7578063d547741f14610807578063dafae40814610827578063dbd2ef6c14610847578063de981f1b14610867578063e75235b814610887576102a6565b8063affed0e011610113578063affed0e0146106e5578063b9afa177146106fb578063b9c362091461071b578063bc197c811461073b578063bc7f038614610774578063c28f7894146107a1576102a6565b80638456cb591461063b578063865e6fd3146106505780639010d07c1461067057806391d14854146106905780639584a592146106b0578063a217fddf146106d0576102a6565b80633f4ba83a116101fe5780635d6a9a90116101b75780635d6a9a901461057257806364363f781461059f57806371706cbe146105bf57806375535f86146105d55780637de5dedd146105f5578063835fc6ca1461060a576102a6565b80633f4ba83a1461048f57806347b56b2c146104a45780634d92c4f0146104c45780635a7dd06a146105255780635c975abb146105455780635cd8a76b1461055d576102a6565b8063248a9ca311610250578063248a9ca3146103b15780632f2ff15d146103ef5780633101cfcb1461040f57806336568abe1461042f5780633e4574ec1461044f5780633e70838b1461046f576102a6565b806301ffc9a7146102ae578063065b3adf146102e35780630b1ff17f1461031b578063109679ef1461033b57806317892f961461035b57806317fa2ea114610384576102a6565b366102a6576102a46109d0565b005b6102a46109d0565b3480156102ba57600080fd5b506102ce6102c9366004613c2d565b6109e9565b60405190151581526020015b60405180910390f35b3480156102ef57600080fd5b50600554610303906001600160a01b031681565b6040516001600160a01b0390911681526020016102da565b34801561032757600080fd5b506102a4610336366004613c57565b610a09565b34801561034757600080fd5b506102a4610356366004613c88565b610a20565b34801561036757600080fd5b506078546079545b604080519283526020830191909152016102da565b34801561039057600080fd5b506103a461039f366004613ce5565b610a53565b6040516102da9190613d26565b3480156103bd57600080fd5b506103e16103cc366004613d60565b6000908152606b602052604090206001015490565b6040519081526020016102da565b3480156103fb57600080fd5b506102a461040a366004613d99565b610d90565b34801561041b57600080fd5b506102a461042a366004613dc9565b610dba565b34801561043b57600080fd5b506102a461044a366004613d99565b610e66565b34801561045b57600080fd5b506102ce61046a366004613d99565b610ee0565b34801561047b57600080fd5b506102a461048a366004613dc9565b610f10565b34801561049b57600080fd5b506102a4610f3a565b3480156104b057600080fd5b506102a46104bf366004613d60565b610f4c565b3480156104d057600080fd5b506105156104df366004613de6565b606f602090815260009283526040808420909152908252902080546001820154600383015460049093015460ff90921692909184565b6040516102da9493929190613e1e565b34801561053157600080fd5b506102a4610540366004613e4e565b611117565b34801561055157600080fd5b5060005460ff166102ce565b34801561056957600080fd5b506102a461117e565b34801561057e57600080fd5b5061059261058d366004613ec8565b611280565b6040516102da9190613f04565b3480156105ab57600080fd5b506102a46105ba366004613f30565b611324565b3480156105cb57600080fd5b506103e1606e5481565b3480156105e157600080fd5b5061036f6105f0366004613de6565b611360565b34801561060157600080fd5b506103e1611381565b34801561061657600080fd5b5061062a610625366004613d60565b611398565b6040516102da959493929190613ff8565b34801561064757600080fd5b506102a461146a565b34801561065c57600080fd5b506102a461066b36600461404e565b61147a565b34801561067c57600080fd5b5061030361068b366004613de6565b611495565b34801561069c57600080fd5b506102ce6106ab366004613d99565b6114ad565b3480156106bc57600080fd5b506102a46106cb36600461408b565b6114d8565b3480156106dc57600080fd5b506103e1600081565b3480156106f157600080fd5b506103e160045481565b34801561070757600080fd5b506103a4610716366004614184565b611625565b34801561072757600080fd5b506102a4610736366004613de6565b611743565b34801561074757600080fd5b50610767610756366004614368565b63bc197c8160e01b95945050505050565b6040516102da9190614415565b34801561078057600080fd5b506103e161078f366004613dc9565b60386020526000908152604090205481565b3480156107ad57600080fd5b506105156107bc366004613d60565b607660205260009081526040902080546001820154600383015460049093015460ff90921692909184565b3480156107f357600080fd5b506103e1610802366004613d60565b611755565b34801561081357600080fd5b506102a4610822366004613d99565b61176c565b34801561083357600080fd5b506102ce610842366004613d60565b611791565b34801561085357600080fd5b506102a461086236600461442a565b6117bd565b34801561087357600080fd5b506103036108823660046144ed565b61180f565b34801561089357600080fd5b5060015460025461036f565b3480156108ab57600080fd5b506108bf6108ba366004614508565b61188a565b6040516102da91906145a3565b3480156108d857600080fd5b506105156108e7366004613d60565b607060205260009081526040902080546001820154600383015460049093015460ff90921692909184565b34801561091e57600080fd5b5061076761092d366004614607565b63f23a6e6160e01b95945050505050565b34801561094a57600080fd5b506102ce610959366004613d60565b6119f1565b34801561096a57600080fd5b506102a4610979366004613f30565b611a1f565b34801561098a57600080fd5b506102ce61099936600461466f565b6000928352606f602090815260408085209385529281528284206001600160a01b0392909216845260029091019052902054151590565b60405163129c2ce160e31b815260040160405180910390fd5b60006109f482611c1a565b80610a035750610a0382611c3f565b92915050565b610a11611c64565b610a1c823383611caa565b5050565b610a28611c64565b610a30611d79565b610a50610a4236839003830183614746565b33610a4b611381565b611e1a565b50565b6060610a5d611d79565b336000610a68611381565b9050600084806001600160401b03811115610a8557610a856141f9565b604051908082528060200260200182016040528015610aae578160200160208202803683370190505b5094506000610abd600361180f565b905060005b82811015610d8457888882818110610adc57610adc6147d7565b905060200201359350816001600160a01b031663c7c4fea9600286896040518463ffffffff1660e01b8152600401610b16939291906147ed565b600060405180830381600087803b158015610b3057600080fd5b505af1158015610b44573d6000803e3d6000fd5b50505050610b51846119f1565b15610b7b576001878281518110610b6a57610b6a6147d7565b911515602092830291909101909101525b600084815260706020908152604080832060718352818420825160a081019093528054835260018082015492959491929184019160ff1690811115610bc257610bc2613e08565b6001811115610bd357610bd3613e08565b815260408051606080820183526002858101546001600160a01b039081168452600387015481166020858101919091526004880154858701528087019490945284518084018652600588015482168152600688015490911693810193909352600786015483850152838501929092528251808201909352600885018054919094019391839160ff1690811115610c6b57610c6b613e08565b6002811115610c7c57610c7c613e08565b81526001820154602082015260029091015460409091015290525090506000610ca482612121565b90506000610cb4848b8b856121eb565b90506001816004811115610cca57610cca613e08565b03610d7557835460ff19166002908117855560405163114fc47560e11b81526001600160a01b0388169163229f88ea91610d0991908c90600401614817565b600060405180830381600087803b158015610d2357600080fd5b505af1158015610d37573d6000803e3d6000fd5b505050507f62520d049932cdee872e9b3c59c0f6073637147e5e9bc8b050b062430eaf5c9f8284604051610d6c92919061482e565b60405180910390a15b50505050806001019050610ac2565b50505050505092915050565b6000828152606b6020526040902060010154610dab8161221e565b610db58383612228565b505050565b603754600390610100900460ff16158015610ddc575060375460ff8083169116105b610e015760405162461bcd60e51b8152600401610df89061488d565b60405180910390fd5b6037805461ffff191660ff831617610100179055610e20600b8361224a565b6037805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b6001600160a01b0381163314610ed65760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610df8565b610a1c82826122ee565b60008281526070602090815260408083206001600160a01b038516845260020190915281205415155b9392505050565b610f18612310565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b610f4261236a565b610f4a6123d9565b565b610f54611c64565b610f5d816119f1565b15610f7b576040516327ddf84960e11b815260040160405180910390fd5b6000818152607160209081526040808320815160a0810190925280548252600180820154929391929184019160ff1690811115610fba57610fba613e08565b6001811115610fcb57610fcb613e08565b815260408051606080820183526002858101546001600160a01b039081168452600387015481166020858101919091526004880154858701528087019490945284518084018652600588015482168152600688015490911693810193909352600786015483850152838501929092528251808201909352600885018054919094019391839160ff169081111561106357611063613e08565b600281111561107457611074613e08565b8152600182015460208201526002909101546040918201529152606083015101519192505046146110de576060810151604090810151905163092048d160e11b81526001600160e01b03196000351660048201526024810191909152466044820152606401610df8565b7f04e8cbd836dea43a2dc7eb19de345cca3a8e6978a2ef5225d924775500f67c7c61110882612121565b82604051610e5a92919061482e565b61111f611c64565b816000819003611142576040516316ee9d3b60e11b815260040160405180910390fd5b60005b818110156111775761116f858583818110611162576111626147d7565b905060a002013385611caa565b600101611145565b5050505050565b603754600290610100900460ff161580156111a0575060375460ff8083169116105b6111bc5760405162461bcd60e51b8152600401610df89061488d565b6037805461ffff191660ff8316176101001790556074546111e8906008906001600160a01b031661224a565b607554611200906003906001600160a01b031661224a565b60775461121890600a906001600160a01b031661224a565b607480546001600160a01b031990811690915560758054821690556077805490911690556037805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b604080518082018252600080825260208083018290526001600160a01b038616825260738152838220858352905282902082518084019093528054919291829060ff1660028111156112d4576112d4613e08565b60028111156112e5576112e5613e08565b815290546001600160a01b0361010090910481166020928301529082015191925016610a0357604051631b79f53b60e21b815260040160405180910390fd5b61132c612310565b600083900361134e576040516316ee9d3b60e11b815260040160405180910390fd5b61135a8484848461242b565b50505050565b60008061136b612310565b611375848461250e565b915091505b9250929050565b600061139361138e612598565b612605565b905090565b607160209081526000918252604091829020805460018201548451606080820187526002808601546001600160a01b03908116845260038701548116848901526004870154848a015288518084018a526005880154821681526006880154909116978101979097526007860154878901528751918201909752600885018054949760ff94851697939693959394929391928492169081111561143c5761143c613e08565b600281111561144d5761144d613e08565b815260200160018201548152602001600282015481525050905085565b61147261236a565b610f4a61263b565b611482612310565b61148b81612678565b610a1c828261224a565b6000828152606c60205260408120610f0990836126ae565b6000918252606b602090815260408084206001600160a01b0393909316845291905290205460ff1690565b603754610100900460ff16158080156114f85750603754600160ff909116105b806115125750303b158015611512575060375460ff166001145b61152e5760405162461bcd60e51b8152600401610df89061488d565b6037805460ff191660011790558015611551576037805461ff0019166101001790555b61155c60008d6126ba565b6115668b8b6126c4565b611570898961250e565b506000905061157f86806148db565b905011156115d1576115b261159486806148db565b6115a160208901896148db565b6115ab89806148db565b8989612754565b6115d16115bf86806148db565b6115cc60208801886148db565b61242b565b8015611617576037805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050505050565b606061162f611c64565b611637611d79565b81806001600160401b03811115611650576116506141f9565b604051908082528060200260200182016040528015611679578160200160208202803683370190505b5091506000611686611381565b9050611690613bc0565b60005b83811015611739578686828181106116ad576116ad6147d7565b905061016002018036038101906116c49190614746565b915060026040808401518101516000908152606f6020908152828220865183529052205460ff1660048111156116fc576116fc613e08565b03611726576001858281518110611715576117156147d7565b911515602092830291909101909101525b611731823385611e1a565b600101611693565b5050505092915050565b61174b612310565b610a1c82826126c4565b6000818152606c60205260408120610a0390612970565b6000828152606b60205260409020600101546117878161221e565b610db583836122ee565b600061179b612598565b6001546117a8919061493a565b6002546117b5908461493a565b101592915050565b6117c5612310565b60008790036117f5576000356001600160e01b0319166040516306b5667560e21b8152600401610df89190614415565b6118058888888888888888612754565b5050505050505050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f81111561184657611846613e08565b60ff1681526020810191909152604001600020546001600160a01b0316905080611885578160405163409140df60e11b8152600401610df89190614951565b919050565b6060816001600160401b038111156118a4576118a46141f9565b6040519080825280602002602001820160405280156118d757816020015b60608152602001906001900390816118c25790505b50905060005b828110156119e957600085815260726020526040812090858584818110611906576119066147d7565b905060200201602081019061191b9190613dc9565b6001600160a01b03166001600160a01b0316815260200190815260200160002080546119469061496b565b80601f01602080910402602001604051908101604052809291908181526020018280546119729061496b565b80156119bf5780601f10611994576101008083540402835291602001916119bf565b820191906000526020600020905b8154815290600101906020018083116119a257829003601f168201915b50505050508282815181106119d6576119d66147d7565b60209081029190910101526001016118dd565b509392505050565b6000600260008381526070602052604090205460ff166004811115611a1857611a18613e08565b1492915050565b611a27611c64565b611a2f611d79565b33838015801590611a3f57508083145b611a6a576000356001600160e01b0319166040516306b5667560e21b8152600401610df89190614415565b6000611a74611381565b9050600080611a83600361180f565b905060005b84811015611c0e57898982818110611aa257611aa26147d7565b905060200201359250878782818110611abd57611abd6147d7565b9050602002810190611acf919061499f565b60008581526072602090815260408083206001600160a01b038c168452909152902091611afd919083614a35565b5060405163c7c4fea960e01b81526001600160a01b0383169063c7c4fea990611b2f9060019087908b906004016147ed565b600060405180830381600087803b158015611b4957600080fd5b505af1158015611b5d573d6000803e3d6000fd5b50505060008481526076602052604081209150611b7c828988886121eb565b90506001816004811115611b9257611b92613e08565b03611c0457815460ff1916600217825560405163114fc47560e11b81526001600160a01b0385169063229f88ea90611bd1906001908990600401614817565b600060405180830381600087803b158015611beb57600080fd5b505af1158015611bff573d6000803e3d6000fd5b505050505b5050600101611a88565b50505050505050505050565b60006001600160e01b03198216635a05180f60e01b1480610a035750610a038261297a565b60006001600160e01b03198216630271189760e51b1480610a035750610a0382611c1a565b60005460ff1615610f4a5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610df8565b611cc4611cbf36859003850160408601614af4565b6129af565b611ccd836129f3565b6000611ce8611ce26040860160208701613dc9565b83611280565b80519091506002811115611cfe57611cfe613e08565b611d0e6060860160408701614b10565b6002811115611d1f57611d1f613e08565b14611d3c5760405162035e2b60ea1b815260040160405180910390fd5b611d6983611d506040870160208801613dc9565b611d6236889003880160408901614af4565b9190612a71565b6111778483858460200151612bfc565b611d83600b61180f565b604051635a02d57960e11b81523360048201526001600160a01b03919091169063b405aaf290602401602060405180830381865afa158015611dc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ded9190614b2b565b610f4a576000356001600160e01b0319166006604051620f948f60ea1b8152600401610df8929190614b4d565b82516080840151611e2a906129af565b600084602001516001811115611e4257611e42613e08565b14611e605760405163182f3d8760e11b815260040160405180910390fd5b4684606001516040015114611eae576060840151604090810151905163092048d160e11b81526001600160e01b03196000351660048201526024810191909152466044820152606401610df8565b6000611eca856060015160200151866040015160400151611280565b6080860151519091506002811115611ee457611ee4613e08565b81516002811115611ef757611ef7613e08565b148015611f2157508460400151602001516001600160a01b031681602001516001600160a01b0316145b611f3e5760405163f4b8742f60e01b815260040160405180910390fd5b6040808601518101516000908152606f6020908152828220858352905290812090611f6887612121565b90506000611f78838888856121eb565b905087604001516040015185886001600160a01b03167f48c4262ed68beb92fe5d7d48d70772e49cd50c317937dea60a99f15f794b645985604051611fbf91815260200190565b60405180910390a46000611fd3600361180f565b90506001826004811115611fe957611fe9613e08565b036120b357835460ff191660021784556060890151805160209091015160808b01516120189290916000612d8e565b885160405163114fc47560e11b81526001600160a01b0383169163229f88ea9161204791600091600401614817565b600060405180830381600087803b15801561206157600080fd5b505af1158015612075573d6000803e3d6000fd5b505050507f8d20d8121a34dded9035ff5b43e901c142824f7a22126392992c353c37890524838a6040516120aa92919061482e565b60405180910390a15b885160405163c7c4fea960e01b81526001600160a01b0383169163c7c4fea9916120e4916000918d906004016147ed565b600060405180830381600087803b1580156120fe57600080fd5b505af1158015612112573d6000803e3d6000fd5b50505050505050505050505050565b6000806121318360400151612fa7565b905060006121428460600151612fa7565b905060006121968560800151604080517f1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d815282516020808301919091528301518183015291015160608201526080902090565b604080517fb9d1fe7c9deeec5dc90a2f47ff1684239519f2545b2228d3d91fb27df3189eea815287516020808301919091529097015190870152606086019390935250608084015260a08301525060c0902090565b60006121f8858584612fef565b600061220486846130a5565b9050612212868583866131a9565b9150505b949350505050565b610a5081336131f5565b6122328282613259565b6000828152606c60205260409020610db590826132df565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f81111561228057612280613e08565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f8111156122c1576122c1613e08565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b6122f882826132f4565b6000828152606c60205260409020610db5908261335b565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610f4a576000356001600160e01b0319166001604051620f948f60ea1b8152600401610df8929190614b4d565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314806123ac57506005546001600160a01b031633145b610f4a576000356001600160e01b0319166001604051620f948f60ea1b8152600401610df8929190614b4d565b6123e1613370565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b828114612459576000356001600160e01b0319166040516306b5667560e21b8152600401610df89190614415565b60005b838110156124ca57828282818110612476576124766147d7565b9050602002013560386000878785818110612493576124936147d7565b90506020020160208101906124a89190613dc9565b6001600160a01b0316815260208101919091526040016000205560010161245c565b507f6f52f53a938df83439fa4c6055c7df0a6906d621aa6dfa4708187037fdfc41da848484846040516125009493929190614bf6565b60405180910390a150505050565b600080828411156125325760405163964a4d2760e01b815260040160405180910390fd5b505060018054600254607885905560798490556004805493840190556040805183815260208101839052929391928592879290917feac82d4d949d2d4f77f96aa68ab6b1bb750da73f14e55d41a1b93f387471ecba910160405180910390a49250929050565b60006125a4600b61180f565b6001600160a01b03166306aba0e16040518163ffffffff1660e01b8152600401602060405180830381865afa1580156125e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113939190614c28565b600060025460016002548460015461261d919061493a565b6126279190614c41565b6126319190614c54565b610a039190614c67565b612643611c64565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861240e3390565b806001600160a01b03163b600003610a5057604051630bfc64a360e21b81526001600160a01b0382166004820152602401610df8565b6000610f0983836133b9565b610a1c8282612228565b808211156126f3576000356001600160e01b0319166040516387f6f09560e01b8152600401610df89190614415565b6001805460028054858455908490556004805493840190556040805183815260208101839052929391928592879290917f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a450505050565b868514801561276257508683145b61278d576000356001600160e01b0319166040516306b5667560e21b8152600401610df89190614415565b60005b87811015612920578686828181106127aa576127aa6147d7565b90506020020160208101906127bf9190613dc9565b607360008b8b858181106127d5576127d56147d7565b90506020020160208101906127ea9190613dc9565b6001600160a01b03166001600160a01b03168152602001908152602001600020600087878581811061281e5761281e6147d7565b90506020020135815260200190815260200160002060000160016101000a8154816001600160a01b0302191690836001600160a01b0316021790555082828281811061286c5761286c6147d7565b90506020020160208101906128819190614b10565b607360008b8b85818110612897576128976147d7565b90506020020160208101906128ac9190613dc9565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008787858181106128e0576128e06147d7565b60209081029290920135835250810191909152604001600020805460ff1916600183600281111561291357612913613e08565b0217905550600101612790565b507f2544bff60c6d5b84946e06804af9f84e150bbee85238dbdee79efca4e0adf401888888888888888860405161295e989796959493929190614c89565b60405180910390a15050505050505050565b6000610a03825490565b60006001600160e01b03198216637965db0b60e01b1480610a0357506301ffc9a760e01b6001600160e01b0319831614610a03565b6129b8816133e3565b806129c757506129c78161341a565b806129d657506129d681613442565b610a505760405163034992a760e51b815260040160405180910390fd5b6000612a056060830160408401614b10565b6002811115612a1657612a16613e08565b148015612a53575060386000612a326040840160208501613dc9565b6001600160a01b031681526020810191909152604001600020546080820135105b15610a5057604051636eff4a8560e11b815260040160405180910390fd5b600060608185516002811115612a8957612a89613e08565b03612b645760408581015181516001600160a01b03878116602483015230604483015260648083019390935283518083039093018352608490910183526020820180516001600160e01b03166323b872dd60e01b179052915191851691612af09190614d18565b6000604051808303816000865af19150503d8060008114612b2d576040519150601f19603f3d011682016040523d82523d6000602084013e612b32565b606091505b509092509050818015612b5d575080511580612b5d575080806020019051810190612b5d9190614b2b565b9150612bd6565b600185516002811115612b7957612b79613e08565b03612b8e57612b5d838530886020015161346b565b600285516002811115612ba357612ba3613e08565b03612bbd57612b5d83853088602001518960400151613519565b6040516361e411a760e11b815260040160405180910390fd5b816111775784843085604051639d2e4c6760e01b8152600401610df89493929190614d34565b606e805460009182612c0d83614d6a565b9091555090506000612c3484838588612c2b368c90038c018c614d83565b939291906135cd565b60008381526071602090815260409091208251815590820151600180830180549495508594909160ff19909116908381811115612c7357612c73613e08565b02179055506040828101518051600280850180546001600160a01b039384166001600160a01b03199182161790915560208085015160038801805491861691841691909117905593850151600487015560608701518051600588018054918616918416919091179055938401516006870180549190941691161790915591015160078301556080830151805160088401805492939092839160ff19909116906001908490811115612d2657612d26613e08565b0217905550602082015181600101556040820151816002015550509050507ff313c253a5be72c29d0deb2c8768a9543744ac03d6b3cafd50cc976f1c2632fc612d6e82612121565b82604051612d7d92919061482e565b60405180910390a150949350505050565b806001600160a01b0316826001600160a01b031603612e3b5760408085015190516001600160a01b0385169180156108fc02916000818181858888f19350505050612e3657806001600160a01b031663d0e30db085604001516040518263ffffffff1660e01b81526004016000604051808303818588803b158015612e1257600080fd5b505af1158015612e26573d6000803e3d6000fd5b5050505050612e36848484613639565b61135a565b600084516002811115612e5057612e50613e08565b03612f16576040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa158015612e9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ec09190614c28565b90508460400151811015612f0557612ee88330838860400151612ee39190614c54565b6136b8565b612f0557604051632f739fff60e11b815260040160405180910390fd5b612f10858585613639565b5061135a565b600184516002811115612f2b57612f2b613e08565b03612f5c57612f3f8284866020015161375d565b612e365760405163c8e3a09f60e01b815260040160405180910390fd5b600284516002811115612f7157612f71613e08565b03612bbd57612f8a828486602001518760400151613784565b612e36576040516334b471a760e21b815260040160405180910390fd5b604080517f353bdd8d69b9e3185b3972e08b03845c0c14a21a390215302776a7a34b0e8764815282516020808301919091528301518183015291015160608201526080902090565b60008360030154118015613007575042836003015411155b1561301857825460ff191660041783555b6001600160a01b03821660009081526002840160205260409020541561305c5760405163025fd59560e41b81526001600160a01b0383166004820152602401610df8565b6001600160a01b039091166000818152600284016020908152604082209390935560059093018054600181018255908452919092200180546001600160a01b0319169091179055565b60008060006130b4600b61180f565b6001600160a01b031663c441c4a86040518163ffffffff1660e01b8152600401600060405180830381865afa1580156130f1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526131199190810190614e3e565b81519194509250905060005b818110156117395785876002016000868481518110613146576131466147d7565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002054036131a157828181518110613186576131866147d7565b60200260200101516bffffffffffffffffffffffff16850194505b600101613125565b60008383101580156131d057506000855460ff1660048111156131ce576131ce613e08565b145b156131e857845460ff19166001908117865585018290555b5050915460ff1692915050565b6131ff82826114ad565b610a1c57613217816001600160a01b031660146137ad565b6132228360206137ad565b604051602001613233929190614f36565b60408051601f198184030181529082905262461bcd60e51b8252610df891600401614fab565b61326382826114ad565b610a1c576000828152606b602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561329b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610f09836001600160a01b038416613948565b6132fe82826114ad565b15610a1c576000828152606b602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610f09836001600160a01b038416613997565b60005460ff16610f4a5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610df8565b60008260000182815481106133d0576133d06147d7565b9060005260206000200154905092915050565b600080825160028111156133f9576133f9613e08565b14801561340a575060008260400151115b8015610a03575050602001511590565b600060018251600281111561343157613431613e08565b148015610a03575050604001511590565b600060028251600281111561345957613459613e08565b148015610a0357505060400151151590565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928716916134cb91614d18565b6000604051808303816000865af19150503d8060008114613508576040519150601f19603f3d011682016040523d82523d6000602084013e61350d565b606091505b50909695505050505050565b604080516000808252602082019092526001600160a01b0387169061354990879087908790879060448101614fbe565b60408051601f198184030181529181526020820180516001600160e01b0316637921219560e11b1790525161357e9190614d18565b6000604051808303816000865af19150503d80600081146135bb576040519150601f19603f3d011682016040523d82523d6000602084013e6135c0565b606091505b5090979650505050505050565b6135d5613bc0565b92835260016020808501919091526060840180516001600160a01b0396871690528682015181519087169083015251466040918201528651818601805191881690915280519490961693909101929092529251810192909252910151608082015290565b6000808451600281111561364f5761364f613e08565b0361366a5761366382848660400151613a8a565b9050613694565b60018451600281111561367f5761367f613e08565b03612bbd57613663823085876020015161346b565b8061135a578383836040516341bd7d9160e11b8152600401610df893929190614ff8565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b03166340c10f1960e01b179052915160009286169161371091614d18565b6000604051808303816000865af19150503d806000811461374d576040519150601f19603f3d011682016040523d82523d6000602084013e613752565b606091505b509095945050505050565b600061376b8430858561346b565b905080610f095761377d8484846136b8565b9050610f09565b60006137938530868686613519565b905080612216576137a685858585613b5d565b9050612216565b606060006137bc83600261493a565b6137c7906002614c41565b6001600160401b038111156137de576137de6141f9565b6040519080825280601f01601f191660200182016040528015613808576020820181803683370190505b509050600360fc1b81600081518110613823576138236147d7565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613852576138526147d7565b60200101906001600160f81b031916908160001a905350600061387684600261493a565b613881906001614c41565b90505b60018111156138f9576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106138b5576138b56147d7565b1a60f81b8282815181106138cb576138cb6147d7565b60200101906001600160f81b031916908160001a90535060049490941c936138f281615028565b9050613884565b508315610f095760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610df8565b600081815260018301602052604081205461398f57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610a03565b506000610a03565b60008181526001830160205260408120548015613a805760006139bb600183614c54565b85549091506000906139cf90600190614c54565b9050818114613a345760008660000182815481106139ef576139ef6147d7565b9060005260206000200154905080876000018481548110613a1257613a126147d7565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613a4557613a4561503f565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610a03565b6000915050610a03565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b179052915160009260609290871691613ae79190614d18565b6000604051808303816000865af19150503d8060008114613b24576040519150601f19603f3d011682016040523d82523d6000602084013e613b29565b606091505b509092509050818015613b54575080511580613b54575080806020019051810190613b549190614b2b565b95945050505050565b604080516000808252602082019092526001600160a01b03861690613b8b9086908690869060448101615055565b60408051601f198184030181529181526020820180516001600160e01b031663731133e960e01b179052516134cb9190614d18565b6040805160a08101825260008082526020808301829052835160608082018652838252818301849052818601849052848601919091528451808201865283815280830184905280860184905281850152845190810185528281529081018290529283015290608082015290565b600060208284031215613c3f57600080fd5b81356001600160e01b031981168114610f0957600080fd5b60008082840360c0811215613c6b57600080fd5b60a0811215613c7957600080fd5b50919360a08501359350915050565b60006101608284031215613c9b57600080fd5b50919050565b60008083601f840112613cb357600080fd5b5081356001600160401b03811115613cca57600080fd5b6020830191508360208260051b850101111561137a57600080fd5b60008060208385031215613cf857600080fd5b82356001600160401b03811115613d0e57600080fd5b613d1a85828601613ca1565b90969095509350505050565b6020808252825182820181905260009190848201906040850190845b8181101561350d578351151583529284019291840191600101613d42565b600060208284031215613d7257600080fd5b5035919050565b6001600160a01b0381168114610a5057600080fd5b803561188581613d79565b60008060408385031215613dac57600080fd5b823591506020830135613dbe81613d79565b809150509250929050565b600060208284031215613ddb57600080fd5b8135610f0981613d79565b60008060408385031215613df957600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b6080810160058610613e3257613e32613e08565b9481526020810193909352604083019190915260609091015290565b600080600060408486031215613e6357600080fd5b83356001600160401b0380821115613e7a57600080fd5b818601915086601f830112613e8e57600080fd5b813581811115613e9d57600080fd5b87602060a083028501011115613eb257600080fd5b6020928301989097509590910135949350505050565b60008060408385031215613edb57600080fd5b8235613ee681613d79565b946020939093013593505050565b60038110610a5057610a50613e08565b81516040820190613f1481613ef4565b82526020928301516001600160a01b0316929091019190915290565b60008060008060408587031215613f4657600080fd5b84356001600160401b0380821115613f5d57600080fd5b613f6988838901613ca1565b90965094506020870135915080821115613f8257600080fd5b50613f8f87828801613ca1565b95989497509550505050565b60028110613fab57613fab613e08565b9052565b80516001600160a01b03908116835260208083015190911690830152604090810151910152565b8051613fe181613ef4565b825260208181015190830152604090810151910152565b858152610160810161400d6020830187613f9b565b61401a6040830186613faf565b61402760a0830185613faf565b614035610100830184613fd6565b9695505050505050565b80356010811061188557600080fd5b6000806040838503121561406157600080fd5b61406a8361403f565b91506020830135613dbe81613d79565b8060408101831015610a0357600080fd5b60008060008060008060008060008060006101208c8e0312156140ad57600080fd5b6140b68c613d8e565b9a5060208c0135995060408c0135985060608c0135975060808c013596506001600160401b038060a08e013511156140ed57600080fd5b6140fd8e60a08f01358f01613ca1565b909750955060c08d013581101561411357600080fd5b6141238e60c08f01358f0161407a565b94508060e08e0135111561413657600080fd5b6141468e60e08f01358f0161407a565b9350806101008e0135111561415a57600080fd5b5061416c8d6101008e01358e01613ca1565b81935080925050509295989b509295989b9093969950565b6000806020838503121561419757600080fd5b82356001600160401b03808211156141ae57600080fd5b818501915085601f8301126141c257600080fd5b8135818111156141d157600080fd5b866020610160830285010111156141e757600080fd5b60209290920196919550909350505050565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715614231576142316141f9565b60405290565b604051601f8201601f191681016001600160401b038111828210171561425f5761425f6141f9565b604052919050565b60006001600160401b03821115614280576142806141f9565b5060051b60200190565b600082601f83011261429b57600080fd5b813560206142b06142ab83614267565b614237565b8083825260208201915060208460051b8701019350868411156142d257600080fd5b602086015b848110156142ee57803583529183019183016142d7565b509695505050505050565b600082601f83011261430a57600080fd5b81356001600160401b03811115614323576143236141f9565b614336601f8201601f1916602001614237565b81815284602083860101111561434b57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561438057600080fd5b853561438b81613d79565b9450602086013561439b81613d79565b935060408601356001600160401b03808211156143b757600080fd5b6143c389838a0161428a565b945060608801359150808211156143d957600080fd5b6143e589838a0161428a565b935060808801359150808211156143fb57600080fd5b50614408888289016142f9565b9150509295509295909350565b6001600160e01b031991909116815260200190565b6000806000806000806000806080898b03121561444657600080fd5b88356001600160401b038082111561445d57600080fd5b6144698c838d01613ca1565b909a50985060208b013591508082111561448257600080fd5b61448e8c838d01613ca1565b909850965060408b01359150808211156144a757600080fd5b6144b38c838d01613ca1565b909650945060608b01359150808211156144cc57600080fd5b506144d98b828c01613ca1565b999c989b5096995094979396929594505050565b6000602082840312156144ff57600080fd5b610f098261403f565b60008060006040848603121561451d57600080fd5b8335925060208401356001600160401b0381111561453a57600080fd5b61454686828701613ca1565b9497909650939450505050565b60005b8381101561456e578181015183820152602001614556565b50506000910152565b6000815180845261458f816020860160208601614553565b601f01601f19169290920160200192915050565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b828110156145fa57603f198886030184526145e8858351614577565b945092850192908501906001016145cc565b5092979650505050505050565b600080600080600060a0868803121561461f57600080fd5b853561462a81613d79565b9450602086013561463a81613d79565b9350604086013592506060860135915060808601356001600160401b0381111561466357600080fd5b614408888289016142f9565b60008060006060848603121561468457600080fd5b8335925060208401359150604084013561469d81613d79565b809150509250925092565b6000606082840312156146ba57600080fd5b6146c261420f565b905081356146cf81613d79565b815260208201356146df81613d79565b806020830152506040820135604082015292915050565b80356003811061188557600080fd5b60006060828403121561471757600080fd5b61471f61420f565b905061472a826146f6565b8152602082013560208201526040820135604082015292915050565b6000610160828403121561475957600080fd5b60405160a081018181106001600160401b038211171561477b5761477b6141f9565b6040528235815260208301356002811061479457600080fd5b60208201526147a684604085016146a8565b60408201526147b88460a085016146a8565b60608201526147cb846101008501614705565b60808201529392505050565b634e487b7160e01b600052603260045260246000fd5b606081016147fa85613ef4565b93815260208101929092526001600160a01b031660409091015290565b6040810161482484613ef4565b9281526020015290565b6000610180820190508382528251602083015260208301516148536040840182613f9b565b5060408301516148666060840182613faf565b50606083015161487960c0840182613faf565b5060808301516119e9610120840182613fd6565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6000808335601e198436030181126148f257600080fd5b8301803591506001600160401b0382111561490c57600080fd5b6020019150600581901b360382131561137a57600080fd5b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610a0357610a03614924565b602081016010831061496557614965613e08565b91905290565b600181811c9082168061497f57607f821691505b602082108103613c9b57634e487b7160e01b600052602260045260246000fd5b6000808335601e198436030181126149b657600080fd5b8301803591506001600160401b038211156149d057600080fd5b60200191503681900382131561137a57600080fd5b601f821115610db5576000816000526020600020601f850160051c81016020861015614a0e5750805b601f850160051c820191505b81811015614a2d57828155600101614a1a565b505050505050565b6001600160401b03831115614a4c57614a4c6141f9565b614a6083614a5a835461496b565b836149e5565b6000601f841160018114614a945760008515614a7c5750838201355b600019600387901b1c1916600186901b178355611177565b600083815260209020601f19861690835b82811015614ac55786850135825560209485019460019092019101614aa5565b5086821015614ae25760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b600060608284031215614b0657600080fd5b610f098383614705565b600060208284031215614b2257600080fd5b610f09826146f6565b600060208284031215614b3d57600080fd5b81518015158114610f0957600080fd5b6001600160e01b03198316815260408101600b8310614b6e57614b6e613e08565b8260208301529392505050565b8183526000602080850194508260005b85811015614bb9578135614b9e81613d79565b6001600160a01b031687529582019590820190600101614b8b565b509495945050505050565b81835260006001600160fb1b03831115614bdd57600080fd5b8260051b80836020870137939093016020019392505050565b604081526000614c0a604083018688614b7b565b8281036020840152614c1d818587614bc4565b979650505050505050565b600060208284031215614c3a57600080fd5b5051919050565b80820180821115610a0357610a03614924565b81810381811115610a0357610a03614924565b600082614c8457634e487b7160e01b600052601260045260246000fd5b500490565b608081526000614c9d608083018a8c614b7b565b60208382036020850152614cb2828a8c614b7b565b91508382036040850152614cc782888a614bc4565b848103606086015285815286925060200160005b86811015614d0757614cec846146f6565b614cf581613ef4565b82529282019290820190600101614cdb565b509c9b505050505050505050505050565b60008251614d2a818460208701614553565b9190910192915050565b60c08101614d428287613fd6565b6001600160a01b0394851660608301529284166080820152921660a090920191909152919050565b600060018201614d7c57614d7c614924565b5060010190565b600060a08284031215614d9557600080fd5b614d9d61420f565b8235614da881613d79565b81526020830135614db881613d79565b6020820152614dca8460408501614705565b60408201529392505050565b600082601f830112614de757600080fd5b81516020614df76142ab83614267565b8083825260208201915060208460051b870101935086841115614e1957600080fd5b602086015b848110156142ee578051614e3181613d79565b8352918301918301614e1e565b600080600060608486031215614e5357600080fd5b83516001600160401b0380821115614e6a57600080fd5b614e7687838801614dd6565b9450602091508186015181811115614e8d57600080fd5b614e9988828901614dd6565b945050604086015181811115614eae57600080fd5b86019050601f81018713614ec157600080fd5b8051614ecf6142ab82614267565b81815260059190911b82018301908381019089831115614eee57600080fd5b928401925b82841015614f275783516bffffffffffffffffffffffff81168114614f185760008081fd5b82529284019290840190614ef3565b80955050505050509250925092565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351614f6e816017850160208801614553565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351614f9f816028840160208801614553565b01602801949350505050565b602081526000610f096020830184614577565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090614c1d90830184614577565b60a081016150068286613fd6565b6001600160a01b03938416606083015291909216608090920191909152919050565b60008161503757615037614924565b506000190190565b634e487b7160e01b600052603160045260246000fd5b60018060a01b0385168152836020820152826040820152608060608201526000614035608083018461457756fea2646970667358221220f2c96cbb22626006ee11ff90975b91b23886e548ed7a61504409d1948b356f0f64736f6c63430008170033", + "chainId": 2021, + "contractAbsolutePath": "RoninGatewayV3.sol", + "deployedBytecode": "0x6080604052600436106102975760003560e01c80638456cb591161015a578063ca15c873116100c1578063ecc836491161007a578063ecc836491461089f578063f0ce418e146108cc578063f23a6e6114610912578063f668214a1461093e578063fa3896591461095e578063fc6574bc1461097e576102a6565b8063ca15c873146107e7578063d547741f14610807578063dafae40814610827578063dbd2ef6c14610847578063de981f1b14610867578063e75235b814610887576102a6565b8063affed0e011610113578063affed0e0146106e5578063b9afa177146106fb578063b9c362091461071b578063bc197c811461073b578063bc7f038614610774578063c28f7894146107a1576102a6565b80638456cb591461063b578063865e6fd3146106505780639010d07c1461067057806391d14854146106905780639584a592146106b0578063a217fddf146106d0576102a6565b80633f4ba83a116101fe5780635d6a9a90116101b75780635d6a9a901461057257806364363f781461059f57806371706cbe146105bf57806375535f86146105d55780637de5dedd146105f5578063835fc6ca1461060a576102a6565b80633f4ba83a1461048f57806347b56b2c146104a45780634d92c4f0146104c45780635a7dd06a146105255780635c975abb146105455780635cd8a76b1461055d576102a6565b8063248a9ca311610250578063248a9ca3146103b15780632f2ff15d146103ef5780633101cfcb1461040f57806336568abe1461042f5780633e4574ec1461044f5780633e70838b1461046f576102a6565b806301ffc9a7146102ae578063065b3adf146102e35780630b1ff17f1461031b578063109679ef1461033b57806317892f961461035b57806317fa2ea114610384576102a6565b366102a6576102a46109d0565b005b6102a46109d0565b3480156102ba57600080fd5b506102ce6102c9366004613c2d565b6109e9565b60405190151581526020015b60405180910390f35b3480156102ef57600080fd5b50600554610303906001600160a01b031681565b6040516001600160a01b0390911681526020016102da565b34801561032757600080fd5b506102a4610336366004613c57565b610a09565b34801561034757600080fd5b506102a4610356366004613c88565b610a20565b34801561036757600080fd5b506078546079545b604080519283526020830191909152016102da565b34801561039057600080fd5b506103a461039f366004613ce5565b610a53565b6040516102da9190613d26565b3480156103bd57600080fd5b506103e16103cc366004613d60565b6000908152606b602052604090206001015490565b6040519081526020016102da565b3480156103fb57600080fd5b506102a461040a366004613d99565b610d90565b34801561041b57600080fd5b506102a461042a366004613dc9565b610dba565b34801561043b57600080fd5b506102a461044a366004613d99565b610e66565b34801561045b57600080fd5b506102ce61046a366004613d99565b610ee0565b34801561047b57600080fd5b506102a461048a366004613dc9565b610f10565b34801561049b57600080fd5b506102a4610f3a565b3480156104b057600080fd5b506102a46104bf366004613d60565b610f4c565b3480156104d057600080fd5b506105156104df366004613de6565b606f602090815260009283526040808420909152908252902080546001820154600383015460049093015460ff90921692909184565b6040516102da9493929190613e1e565b34801561053157600080fd5b506102a4610540366004613e4e565b611117565b34801561055157600080fd5b5060005460ff166102ce565b34801561056957600080fd5b506102a461117e565b34801561057e57600080fd5b5061059261058d366004613ec8565b611280565b6040516102da9190613f04565b3480156105ab57600080fd5b506102a46105ba366004613f30565b611324565b3480156105cb57600080fd5b506103e1606e5481565b3480156105e157600080fd5b5061036f6105f0366004613de6565b611360565b34801561060157600080fd5b506103e1611381565b34801561061657600080fd5b5061062a610625366004613d60565b611398565b6040516102da959493929190613ff8565b34801561064757600080fd5b506102a461146a565b34801561065c57600080fd5b506102a461066b36600461404e565b61147a565b34801561067c57600080fd5b5061030361068b366004613de6565b611495565b34801561069c57600080fd5b506102ce6106ab366004613d99565b6114ad565b3480156106bc57600080fd5b506102a46106cb36600461408b565b6114d8565b3480156106dc57600080fd5b506103e1600081565b3480156106f157600080fd5b506103e160045481565b34801561070757600080fd5b506103a4610716366004614184565b611625565b34801561072757600080fd5b506102a4610736366004613de6565b611743565b34801561074757600080fd5b50610767610756366004614368565b63bc197c8160e01b95945050505050565b6040516102da9190614415565b34801561078057600080fd5b506103e161078f366004613dc9565b60386020526000908152604090205481565b3480156107ad57600080fd5b506105156107bc366004613d60565b607660205260009081526040902080546001820154600383015460049093015460ff90921692909184565b3480156107f357600080fd5b506103e1610802366004613d60565b611755565b34801561081357600080fd5b506102a4610822366004613d99565b61176c565b34801561083357600080fd5b506102ce610842366004613d60565b611791565b34801561085357600080fd5b506102a461086236600461442a565b6117bd565b34801561087357600080fd5b506103036108823660046144ed565b61180f565b34801561089357600080fd5b5060015460025461036f565b3480156108ab57600080fd5b506108bf6108ba366004614508565b61188a565b6040516102da91906145a3565b3480156108d857600080fd5b506105156108e7366004613d60565b607060205260009081526040902080546001820154600383015460049093015460ff90921692909184565b34801561091e57600080fd5b5061076761092d366004614607565b63f23a6e6160e01b95945050505050565b34801561094a57600080fd5b506102ce610959366004613d60565b6119f1565b34801561096a57600080fd5b506102a4610979366004613f30565b611a1f565b34801561098a57600080fd5b506102ce61099936600461466f565b6000928352606f602090815260408085209385529281528284206001600160a01b0392909216845260029091019052902054151590565b60405163129c2ce160e31b815260040160405180910390fd5b60006109f482611c1a565b80610a035750610a0382611c3f565b92915050565b610a11611c64565b610a1c823383611caa565b5050565b610a28611c64565b610a30611d79565b610a50610a4236839003830183614746565b33610a4b611381565b611e1a565b50565b6060610a5d611d79565b336000610a68611381565b9050600084806001600160401b03811115610a8557610a856141f9565b604051908082528060200260200182016040528015610aae578160200160208202803683370190505b5094506000610abd600361180f565b905060005b82811015610d8457888882818110610adc57610adc6147d7565b905060200201359350816001600160a01b031663c7c4fea9600286896040518463ffffffff1660e01b8152600401610b16939291906147ed565b600060405180830381600087803b158015610b3057600080fd5b505af1158015610b44573d6000803e3d6000fd5b50505050610b51846119f1565b15610b7b576001878281518110610b6a57610b6a6147d7565b911515602092830291909101909101525b600084815260706020908152604080832060718352818420825160a081019093528054835260018082015492959491929184019160ff1690811115610bc257610bc2613e08565b6001811115610bd357610bd3613e08565b815260408051606080820183526002858101546001600160a01b039081168452600387015481166020858101919091526004880154858701528087019490945284518084018652600588015482168152600688015490911693810193909352600786015483850152838501929092528251808201909352600885018054919094019391839160ff1690811115610c6b57610c6b613e08565b6002811115610c7c57610c7c613e08565b81526001820154602082015260029091015460409091015290525090506000610ca482612121565b90506000610cb4848b8b856121eb565b90506001816004811115610cca57610cca613e08565b03610d7557835460ff19166002908117855560405163114fc47560e11b81526001600160a01b0388169163229f88ea91610d0991908c90600401614817565b600060405180830381600087803b158015610d2357600080fd5b505af1158015610d37573d6000803e3d6000fd5b505050507f62520d049932cdee872e9b3c59c0f6073637147e5e9bc8b050b062430eaf5c9f8284604051610d6c92919061482e565b60405180910390a15b50505050806001019050610ac2565b50505050505092915050565b6000828152606b6020526040902060010154610dab8161221e565b610db58383612228565b505050565b603754600390610100900460ff16158015610ddc575060375460ff8083169116105b610e015760405162461bcd60e51b8152600401610df89061488d565b60405180910390fd5b6037805461ffff191660ff831617610100179055610e20600b8361224a565b6037805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b6001600160a01b0381163314610ed65760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610df8565b610a1c82826122ee565b60008281526070602090815260408083206001600160a01b038516845260020190915281205415155b9392505050565b610f18612310565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b610f4261236a565b610f4a6123d9565b565b610f54611c64565b610f5d816119f1565b15610f7b576040516327ddf84960e11b815260040160405180910390fd5b6000818152607160209081526040808320815160a0810190925280548252600180820154929391929184019160ff1690811115610fba57610fba613e08565b6001811115610fcb57610fcb613e08565b815260408051606080820183526002858101546001600160a01b039081168452600387015481166020858101919091526004880154858701528087019490945284518084018652600588015482168152600688015490911693810193909352600786015483850152838501929092528251808201909352600885018054919094019391839160ff169081111561106357611063613e08565b600281111561107457611074613e08565b8152600182015460208201526002909101546040918201529152606083015101519192505046146110de576060810151604090810151905163092048d160e11b81526001600160e01b03196000351660048201526024810191909152466044820152606401610df8565b7f04e8cbd836dea43a2dc7eb19de345cca3a8e6978a2ef5225d924775500f67c7c61110882612121565b82604051610e5a92919061482e565b61111f611c64565b816000819003611142576040516316ee9d3b60e11b815260040160405180910390fd5b60005b818110156111775761116f858583818110611162576111626147d7565b905060a002013385611caa565b600101611145565b5050505050565b603754600290610100900460ff161580156111a0575060375460ff8083169116105b6111bc5760405162461bcd60e51b8152600401610df89061488d565b6037805461ffff191660ff8316176101001790556074546111e8906008906001600160a01b031661224a565b607554611200906003906001600160a01b031661224a565b60775461121890600a906001600160a01b031661224a565b607480546001600160a01b031990811690915560758054821690556077805490911690556037805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b604080518082018252600080825260208083018290526001600160a01b038616825260738152838220858352905282902082518084019093528054919291829060ff1660028111156112d4576112d4613e08565b60028111156112e5576112e5613e08565b815290546001600160a01b0361010090910481166020928301529082015191925016610a0357604051631b79f53b60e21b815260040160405180910390fd5b61132c612310565b600083900361134e576040516316ee9d3b60e11b815260040160405180910390fd5b61135a8484848461242b565b50505050565b60008061136b612310565b611375848461250e565b915091505b9250929050565b600061139361138e612598565b612605565b905090565b607160209081526000918252604091829020805460018201548451606080820187526002808601546001600160a01b03908116845260038701548116848901526004870154848a015288518084018a526005880154821681526006880154909116978101979097526007860154878901528751918201909752600885018054949760ff94851697939693959394929391928492169081111561143c5761143c613e08565b600281111561144d5761144d613e08565b815260200160018201548152602001600282015481525050905085565b61147261236a565b610f4a61263b565b611482612310565b61148b81612678565b610a1c828261224a565b6000828152606c60205260408120610f0990836126ae565b6000918252606b602090815260408084206001600160a01b0393909316845291905290205460ff1690565b603754610100900460ff16158080156114f85750603754600160ff909116105b806115125750303b158015611512575060375460ff166001145b61152e5760405162461bcd60e51b8152600401610df89061488d565b6037805460ff191660011790558015611551576037805461ff0019166101001790555b61155c60008d6126ba565b6115668b8b6126c4565b611570898961250e565b506000905061157f86806148db565b905011156115d1576115b261159486806148db565b6115a160208901896148db565b6115ab89806148db565b8989612754565b6115d16115bf86806148db565b6115cc60208801886148db565b61242b565b8015611617576037805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050505050565b606061162f611c64565b611637611d79565b81806001600160401b03811115611650576116506141f9565b604051908082528060200260200182016040528015611679578160200160208202803683370190505b5091506000611686611381565b9050611690613bc0565b60005b83811015611739578686828181106116ad576116ad6147d7565b905061016002018036038101906116c49190614746565b915060026040808401518101516000908152606f6020908152828220865183529052205460ff1660048111156116fc576116fc613e08565b03611726576001858281518110611715576117156147d7565b911515602092830291909101909101525b611731823385611e1a565b600101611693565b5050505092915050565b61174b612310565b610a1c82826126c4565b6000818152606c60205260408120610a0390612970565b6000828152606b60205260409020600101546117878161221e565b610db583836122ee565b600061179b612598565b6001546117a8919061493a565b6002546117b5908461493a565b101592915050565b6117c5612310565b60008790036117f5576000356001600160e01b0319166040516306b5667560e21b8152600401610df89190614415565b6118058888888888888888612754565b5050505050505050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f81111561184657611846613e08565b60ff1681526020810191909152604001600020546001600160a01b0316905080611885578160405163409140df60e11b8152600401610df89190614951565b919050565b6060816001600160401b038111156118a4576118a46141f9565b6040519080825280602002602001820160405280156118d757816020015b60608152602001906001900390816118c25790505b50905060005b828110156119e957600085815260726020526040812090858584818110611906576119066147d7565b905060200201602081019061191b9190613dc9565b6001600160a01b03166001600160a01b0316815260200190815260200160002080546119469061496b565b80601f01602080910402602001604051908101604052809291908181526020018280546119729061496b565b80156119bf5780601f10611994576101008083540402835291602001916119bf565b820191906000526020600020905b8154815290600101906020018083116119a257829003601f168201915b50505050508282815181106119d6576119d66147d7565b60209081029190910101526001016118dd565b509392505050565b6000600260008381526070602052604090205460ff166004811115611a1857611a18613e08565b1492915050565b611a27611c64565b611a2f611d79565b33838015801590611a3f57508083145b611a6a576000356001600160e01b0319166040516306b5667560e21b8152600401610df89190614415565b6000611a74611381565b9050600080611a83600361180f565b905060005b84811015611c0e57898982818110611aa257611aa26147d7565b905060200201359250878782818110611abd57611abd6147d7565b9050602002810190611acf919061499f565b60008581526072602090815260408083206001600160a01b038c168452909152902091611afd919083614a35565b5060405163c7c4fea960e01b81526001600160a01b0383169063c7c4fea990611b2f9060019087908b906004016147ed565b600060405180830381600087803b158015611b4957600080fd5b505af1158015611b5d573d6000803e3d6000fd5b50505060008481526076602052604081209150611b7c828988886121eb565b90506001816004811115611b9257611b92613e08565b03611c0457815460ff1916600217825560405163114fc47560e11b81526001600160a01b0385169063229f88ea90611bd1906001908990600401614817565b600060405180830381600087803b158015611beb57600080fd5b505af1158015611bff573d6000803e3d6000fd5b505050505b5050600101611a88565b50505050505050505050565b60006001600160e01b03198216635a05180f60e01b1480610a035750610a038261297a565b60006001600160e01b03198216630271189760e51b1480610a035750610a0382611c1a565b60005460ff1615610f4a5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610df8565b611cc4611cbf36859003850160408601614af4565b6129af565b611ccd836129f3565b6000611ce8611ce26040860160208701613dc9565b83611280565b80519091506002811115611cfe57611cfe613e08565b611d0e6060860160408701614b10565b6002811115611d1f57611d1f613e08565b14611d3c5760405162035e2b60ea1b815260040160405180910390fd5b611d6983611d506040870160208801613dc9565b611d6236889003880160408901614af4565b9190612a71565b6111778483858460200151612bfc565b611d83600b61180f565b604051635a02d57960e11b81523360048201526001600160a01b03919091169063b405aaf290602401602060405180830381865afa158015611dc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ded9190614b2b565b610f4a576000356001600160e01b0319166006604051620f948f60ea1b8152600401610df8929190614b4d565b82516080840151611e2a906129af565b600084602001516001811115611e4257611e42613e08565b14611e605760405163182f3d8760e11b815260040160405180910390fd5b4684606001516040015114611eae576060840151604090810151905163092048d160e11b81526001600160e01b03196000351660048201526024810191909152466044820152606401610df8565b6000611eca856060015160200151866040015160400151611280565b6080860151519091506002811115611ee457611ee4613e08565b81516002811115611ef757611ef7613e08565b148015611f2157508460400151602001516001600160a01b031681602001516001600160a01b0316145b611f3e5760405163f4b8742f60e01b815260040160405180910390fd5b6040808601518101516000908152606f6020908152828220858352905290812090611f6887612121565b90506000611f78838888856121eb565b905087604001516040015185886001600160a01b03167f48c4262ed68beb92fe5d7d48d70772e49cd50c317937dea60a99f15f794b645985604051611fbf91815260200190565b60405180910390a46000611fd3600361180f565b90506001826004811115611fe957611fe9613e08565b036120b357835460ff191660021784556060890151805160209091015160808b01516120189290916000612d8e565b885160405163114fc47560e11b81526001600160a01b0383169163229f88ea9161204791600091600401614817565b600060405180830381600087803b15801561206157600080fd5b505af1158015612075573d6000803e3d6000fd5b505050507f8d20d8121a34dded9035ff5b43e901c142824f7a22126392992c353c37890524838a6040516120aa92919061482e565b60405180910390a15b885160405163c7c4fea960e01b81526001600160a01b0383169163c7c4fea9916120e4916000918d906004016147ed565b600060405180830381600087803b1580156120fe57600080fd5b505af1158015612112573d6000803e3d6000fd5b50505050505050505050505050565b6000806121318360400151612fa7565b905060006121428460600151612fa7565b905060006121968560800151604080517f1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d815282516020808301919091528301518183015291015160608201526080902090565b604080517fb9d1fe7c9deeec5dc90a2f47ff1684239519f2545b2228d3d91fb27df3189eea815287516020808301919091529097015190870152606086019390935250608084015260a08301525060c0902090565b60006121f8858584612fef565b600061220486846130a5565b9050612212868583866131a9565b9150505b949350505050565b610a5081336131f5565b6122328282613259565b6000828152606c60205260409020610db590826132df565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f81111561228057612280613e08565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f8111156122c1576122c1613e08565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b6122f882826132f4565b6000828152606c60205260409020610db5908261335b565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610f4a576000356001600160e01b0319166001604051620f948f60ea1b8152600401610df8929190614b4d565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314806123ac57506005546001600160a01b031633145b610f4a576000356001600160e01b0319166001604051620f948f60ea1b8152600401610df8929190614b4d565b6123e1613370565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b828114612459576000356001600160e01b0319166040516306b5667560e21b8152600401610df89190614415565b60005b838110156124ca57828282818110612476576124766147d7565b9050602002013560386000878785818110612493576124936147d7565b90506020020160208101906124a89190613dc9565b6001600160a01b0316815260208101919091526040016000205560010161245c565b507f6f52f53a938df83439fa4c6055c7df0a6906d621aa6dfa4708187037fdfc41da848484846040516125009493929190614bf6565b60405180910390a150505050565b600080828411156125325760405163964a4d2760e01b815260040160405180910390fd5b505060018054600254607885905560798490556004805493840190556040805183815260208101839052929391928592879290917feac82d4d949d2d4f77f96aa68ab6b1bb750da73f14e55d41a1b93f387471ecba910160405180910390a49250929050565b60006125a4600b61180f565b6001600160a01b03166306aba0e16040518163ffffffff1660e01b8152600401602060405180830381865afa1580156125e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113939190614c28565b600060025460016002548460015461261d919061493a565b6126279190614c41565b6126319190614c54565b610a039190614c67565b612643611c64565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861240e3390565b806001600160a01b03163b600003610a5057604051630bfc64a360e21b81526001600160a01b0382166004820152602401610df8565b6000610f0983836133b9565b610a1c8282612228565b808211156126f3576000356001600160e01b0319166040516387f6f09560e01b8152600401610df89190614415565b6001805460028054858455908490556004805493840190556040805183815260208101839052929391928592879290917f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a450505050565b868514801561276257508683145b61278d576000356001600160e01b0319166040516306b5667560e21b8152600401610df89190614415565b60005b87811015612920578686828181106127aa576127aa6147d7565b90506020020160208101906127bf9190613dc9565b607360008b8b858181106127d5576127d56147d7565b90506020020160208101906127ea9190613dc9565b6001600160a01b03166001600160a01b03168152602001908152602001600020600087878581811061281e5761281e6147d7565b90506020020135815260200190815260200160002060000160016101000a8154816001600160a01b0302191690836001600160a01b0316021790555082828281811061286c5761286c6147d7565b90506020020160208101906128819190614b10565b607360008b8b85818110612897576128976147d7565b90506020020160208101906128ac9190613dc9565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008787858181106128e0576128e06147d7565b60209081029290920135835250810191909152604001600020805460ff1916600183600281111561291357612913613e08565b0217905550600101612790565b507f2544bff60c6d5b84946e06804af9f84e150bbee85238dbdee79efca4e0adf401888888888888888860405161295e989796959493929190614c89565b60405180910390a15050505050505050565b6000610a03825490565b60006001600160e01b03198216637965db0b60e01b1480610a0357506301ffc9a760e01b6001600160e01b0319831614610a03565b6129b8816133e3565b806129c757506129c78161341a565b806129d657506129d681613442565b610a505760405163034992a760e51b815260040160405180910390fd5b6000612a056060830160408401614b10565b6002811115612a1657612a16613e08565b148015612a53575060386000612a326040840160208501613dc9565b6001600160a01b031681526020810191909152604001600020546080820135105b15610a5057604051636eff4a8560e11b815260040160405180910390fd5b600060608185516002811115612a8957612a89613e08565b03612b645760408581015181516001600160a01b03878116602483015230604483015260648083019390935283518083039093018352608490910183526020820180516001600160e01b03166323b872dd60e01b179052915191851691612af09190614d18565b6000604051808303816000865af19150503d8060008114612b2d576040519150601f19603f3d011682016040523d82523d6000602084013e612b32565b606091505b509092509050818015612b5d575080511580612b5d575080806020019051810190612b5d9190614b2b565b9150612bd6565b600185516002811115612b7957612b79613e08565b03612b8e57612b5d838530886020015161346b565b600285516002811115612ba357612ba3613e08565b03612bbd57612b5d83853088602001518960400151613519565b6040516361e411a760e11b815260040160405180910390fd5b816111775784843085604051639d2e4c6760e01b8152600401610df89493929190614d34565b606e805460009182612c0d83614d6a565b9091555090506000612c3484838588612c2b368c90038c018c614d83565b939291906135cd565b60008381526071602090815260409091208251815590820151600180830180549495508594909160ff19909116908381811115612c7357612c73613e08565b02179055506040828101518051600280850180546001600160a01b039384166001600160a01b03199182161790915560208085015160038801805491861691841691909117905593850151600487015560608701518051600588018054918616918416919091179055938401516006870180549190941691161790915591015160078301556080830151805160088401805492939092839160ff19909116906001908490811115612d2657612d26613e08565b0217905550602082015181600101556040820151816002015550509050507ff313c253a5be72c29d0deb2c8768a9543744ac03d6b3cafd50cc976f1c2632fc612d6e82612121565b82604051612d7d92919061482e565b60405180910390a150949350505050565b806001600160a01b0316826001600160a01b031603612e3b5760408085015190516001600160a01b0385169180156108fc02916000818181858888f19350505050612e3657806001600160a01b031663d0e30db085604001516040518263ffffffff1660e01b81526004016000604051808303818588803b158015612e1257600080fd5b505af1158015612e26573d6000803e3d6000fd5b5050505050612e36848484613639565b61135a565b600084516002811115612e5057612e50613e08565b03612f16576040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa158015612e9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ec09190614c28565b90508460400151811015612f0557612ee88330838860400151612ee39190614c54565b6136b8565b612f0557604051632f739fff60e11b815260040160405180910390fd5b612f10858585613639565b5061135a565b600184516002811115612f2b57612f2b613e08565b03612f5c57612f3f8284866020015161375d565b612e365760405163c8e3a09f60e01b815260040160405180910390fd5b600284516002811115612f7157612f71613e08565b03612bbd57612f8a828486602001518760400151613784565b612e36576040516334b471a760e21b815260040160405180910390fd5b604080517f353bdd8d69b9e3185b3972e08b03845c0c14a21a390215302776a7a34b0e8764815282516020808301919091528301518183015291015160608201526080902090565b60008360030154118015613007575042836003015411155b1561301857825460ff191660041783555b6001600160a01b03821660009081526002840160205260409020541561305c5760405163025fd59560e41b81526001600160a01b0383166004820152602401610df8565b6001600160a01b039091166000818152600284016020908152604082209390935560059093018054600181018255908452919092200180546001600160a01b0319169091179055565b60008060006130b4600b61180f565b6001600160a01b031663c441c4a86040518163ffffffff1660e01b8152600401600060405180830381865afa1580156130f1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526131199190810190614e3e565b81519194509250905060005b818110156117395785876002016000868481518110613146576131466147d7565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002054036131a157828181518110613186576131866147d7565b60200260200101516bffffffffffffffffffffffff16850194505b600101613125565b60008383101580156131d057506000855460ff1660048111156131ce576131ce613e08565b145b156131e857845460ff19166001908117865585018290555b5050915460ff1692915050565b6131ff82826114ad565b610a1c57613217816001600160a01b031660146137ad565b6132228360206137ad565b604051602001613233929190614f36565b60408051601f198184030181529082905262461bcd60e51b8252610df891600401614fab565b61326382826114ad565b610a1c576000828152606b602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561329b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610f09836001600160a01b038416613948565b6132fe82826114ad565b15610a1c576000828152606b602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610f09836001600160a01b038416613997565b60005460ff16610f4a5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610df8565b60008260000182815481106133d0576133d06147d7565b9060005260206000200154905092915050565b600080825160028111156133f9576133f9613e08565b14801561340a575060008260400151115b8015610a03575050602001511590565b600060018251600281111561343157613431613e08565b148015610a03575050604001511590565b600060028251600281111561345957613459613e08565b148015610a0357505060400151151590565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928716916134cb91614d18565b6000604051808303816000865af19150503d8060008114613508576040519150601f19603f3d011682016040523d82523d6000602084013e61350d565b606091505b50909695505050505050565b604080516000808252602082019092526001600160a01b0387169061354990879087908790879060448101614fbe565b60408051601f198184030181529181526020820180516001600160e01b0316637921219560e11b1790525161357e9190614d18565b6000604051808303816000865af19150503d80600081146135bb576040519150601f19603f3d011682016040523d82523d6000602084013e6135c0565b606091505b5090979650505050505050565b6135d5613bc0565b92835260016020808501919091526060840180516001600160a01b0396871690528682015181519087169083015251466040918201528651818601805191881690915280519490961693909101929092529251810192909252910151608082015290565b6000808451600281111561364f5761364f613e08565b0361366a5761366382848660400151613a8a565b9050613694565b60018451600281111561367f5761367f613e08565b03612bbd57613663823085876020015161346b565b8061135a578383836040516341bd7d9160e11b8152600401610df893929190614ff8565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b03166340c10f1960e01b179052915160009286169161371091614d18565b6000604051808303816000865af19150503d806000811461374d576040519150601f19603f3d011682016040523d82523d6000602084013e613752565b606091505b509095945050505050565b600061376b8430858561346b565b905080610f095761377d8484846136b8565b9050610f09565b60006137938530868686613519565b905080612216576137a685858585613b5d565b9050612216565b606060006137bc83600261493a565b6137c7906002614c41565b6001600160401b038111156137de576137de6141f9565b6040519080825280601f01601f191660200182016040528015613808576020820181803683370190505b509050600360fc1b81600081518110613823576138236147d7565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613852576138526147d7565b60200101906001600160f81b031916908160001a905350600061387684600261493a565b613881906001614c41565b90505b60018111156138f9576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106138b5576138b56147d7565b1a60f81b8282815181106138cb576138cb6147d7565b60200101906001600160f81b031916908160001a90535060049490941c936138f281615028565b9050613884565b508315610f095760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610df8565b600081815260018301602052604081205461398f57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610a03565b506000610a03565b60008181526001830160205260408120548015613a805760006139bb600183614c54565b85549091506000906139cf90600190614c54565b9050818114613a345760008660000182815481106139ef576139ef6147d7565b9060005260206000200154905080876000018481548110613a1257613a126147d7565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613a4557613a4561503f565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610a03565b6000915050610a03565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b179052915160009260609290871691613ae79190614d18565b6000604051808303816000865af19150503d8060008114613b24576040519150601f19603f3d011682016040523d82523d6000602084013e613b29565b606091505b509092509050818015613b54575080511580613b54575080806020019051810190613b549190614b2b565b95945050505050565b604080516000808252602082019092526001600160a01b03861690613b8b9086908690869060448101615055565b60408051601f198184030181529181526020820180516001600160e01b031663731133e960e01b179052516134cb9190614d18565b6040805160a08101825260008082526020808301829052835160608082018652838252818301849052818601849052848601919091528451808201865283815280830184905280860184905281850152845190810185528281529081018290529283015290608082015290565b600060208284031215613c3f57600080fd5b81356001600160e01b031981168114610f0957600080fd5b60008082840360c0811215613c6b57600080fd5b60a0811215613c7957600080fd5b50919360a08501359350915050565b60006101608284031215613c9b57600080fd5b50919050565b60008083601f840112613cb357600080fd5b5081356001600160401b03811115613cca57600080fd5b6020830191508360208260051b850101111561137a57600080fd5b60008060208385031215613cf857600080fd5b82356001600160401b03811115613d0e57600080fd5b613d1a85828601613ca1565b90969095509350505050565b6020808252825182820181905260009190848201906040850190845b8181101561350d578351151583529284019291840191600101613d42565b600060208284031215613d7257600080fd5b5035919050565b6001600160a01b0381168114610a5057600080fd5b803561188581613d79565b60008060408385031215613dac57600080fd5b823591506020830135613dbe81613d79565b809150509250929050565b600060208284031215613ddb57600080fd5b8135610f0981613d79565b60008060408385031215613df957600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b6080810160058610613e3257613e32613e08565b9481526020810193909352604083019190915260609091015290565b600080600060408486031215613e6357600080fd5b83356001600160401b0380821115613e7a57600080fd5b818601915086601f830112613e8e57600080fd5b813581811115613e9d57600080fd5b87602060a083028501011115613eb257600080fd5b6020928301989097509590910135949350505050565b60008060408385031215613edb57600080fd5b8235613ee681613d79565b946020939093013593505050565b60038110610a5057610a50613e08565b81516040820190613f1481613ef4565b82526020928301516001600160a01b0316929091019190915290565b60008060008060408587031215613f4657600080fd5b84356001600160401b0380821115613f5d57600080fd5b613f6988838901613ca1565b90965094506020870135915080821115613f8257600080fd5b50613f8f87828801613ca1565b95989497509550505050565b60028110613fab57613fab613e08565b9052565b80516001600160a01b03908116835260208083015190911690830152604090810151910152565b8051613fe181613ef4565b825260208181015190830152604090810151910152565b858152610160810161400d6020830187613f9b565b61401a6040830186613faf565b61402760a0830185613faf565b614035610100830184613fd6565b9695505050505050565b80356010811061188557600080fd5b6000806040838503121561406157600080fd5b61406a8361403f565b91506020830135613dbe81613d79565b8060408101831015610a0357600080fd5b60008060008060008060008060008060006101208c8e0312156140ad57600080fd5b6140b68c613d8e565b9a5060208c0135995060408c0135985060608c0135975060808c013596506001600160401b038060a08e013511156140ed57600080fd5b6140fd8e60a08f01358f01613ca1565b909750955060c08d013581101561411357600080fd5b6141238e60c08f01358f0161407a565b94508060e08e0135111561413657600080fd5b6141468e60e08f01358f0161407a565b9350806101008e0135111561415a57600080fd5b5061416c8d6101008e01358e01613ca1565b81935080925050509295989b509295989b9093969950565b6000806020838503121561419757600080fd5b82356001600160401b03808211156141ae57600080fd5b818501915085601f8301126141c257600080fd5b8135818111156141d157600080fd5b866020610160830285010111156141e757600080fd5b60209290920196919550909350505050565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715614231576142316141f9565b60405290565b604051601f8201601f191681016001600160401b038111828210171561425f5761425f6141f9565b604052919050565b60006001600160401b03821115614280576142806141f9565b5060051b60200190565b600082601f83011261429b57600080fd5b813560206142b06142ab83614267565b614237565b8083825260208201915060208460051b8701019350868411156142d257600080fd5b602086015b848110156142ee57803583529183019183016142d7565b509695505050505050565b600082601f83011261430a57600080fd5b81356001600160401b03811115614323576143236141f9565b614336601f8201601f1916602001614237565b81815284602083860101111561434b57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561438057600080fd5b853561438b81613d79565b9450602086013561439b81613d79565b935060408601356001600160401b03808211156143b757600080fd5b6143c389838a0161428a565b945060608801359150808211156143d957600080fd5b6143e589838a0161428a565b935060808801359150808211156143fb57600080fd5b50614408888289016142f9565b9150509295509295909350565b6001600160e01b031991909116815260200190565b6000806000806000806000806080898b03121561444657600080fd5b88356001600160401b038082111561445d57600080fd5b6144698c838d01613ca1565b909a50985060208b013591508082111561448257600080fd5b61448e8c838d01613ca1565b909850965060408b01359150808211156144a757600080fd5b6144b38c838d01613ca1565b909650945060608b01359150808211156144cc57600080fd5b506144d98b828c01613ca1565b999c989b5096995094979396929594505050565b6000602082840312156144ff57600080fd5b610f098261403f565b60008060006040848603121561451d57600080fd5b8335925060208401356001600160401b0381111561453a57600080fd5b61454686828701613ca1565b9497909650939450505050565b60005b8381101561456e578181015183820152602001614556565b50506000910152565b6000815180845261458f816020860160208601614553565b601f01601f19169290920160200192915050565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b828110156145fa57603f198886030184526145e8858351614577565b945092850192908501906001016145cc565b5092979650505050505050565b600080600080600060a0868803121561461f57600080fd5b853561462a81613d79565b9450602086013561463a81613d79565b9350604086013592506060860135915060808601356001600160401b0381111561466357600080fd5b614408888289016142f9565b60008060006060848603121561468457600080fd5b8335925060208401359150604084013561469d81613d79565b809150509250925092565b6000606082840312156146ba57600080fd5b6146c261420f565b905081356146cf81613d79565b815260208201356146df81613d79565b806020830152506040820135604082015292915050565b80356003811061188557600080fd5b60006060828403121561471757600080fd5b61471f61420f565b905061472a826146f6565b8152602082013560208201526040820135604082015292915050565b6000610160828403121561475957600080fd5b60405160a081018181106001600160401b038211171561477b5761477b6141f9565b6040528235815260208301356002811061479457600080fd5b60208201526147a684604085016146a8565b60408201526147b88460a085016146a8565b60608201526147cb846101008501614705565b60808201529392505050565b634e487b7160e01b600052603260045260246000fd5b606081016147fa85613ef4565b93815260208101929092526001600160a01b031660409091015290565b6040810161482484613ef4565b9281526020015290565b6000610180820190508382528251602083015260208301516148536040840182613f9b565b5060408301516148666060840182613faf565b50606083015161487960c0840182613faf565b5060808301516119e9610120840182613fd6565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6000808335601e198436030181126148f257600080fd5b8301803591506001600160401b0382111561490c57600080fd5b6020019150600581901b360382131561137a57600080fd5b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610a0357610a03614924565b602081016010831061496557614965613e08565b91905290565b600181811c9082168061497f57607f821691505b602082108103613c9b57634e487b7160e01b600052602260045260246000fd5b6000808335601e198436030181126149b657600080fd5b8301803591506001600160401b038211156149d057600080fd5b60200191503681900382131561137a57600080fd5b601f821115610db5576000816000526020600020601f850160051c81016020861015614a0e5750805b601f850160051c820191505b81811015614a2d57828155600101614a1a565b505050505050565b6001600160401b03831115614a4c57614a4c6141f9565b614a6083614a5a835461496b565b836149e5565b6000601f841160018114614a945760008515614a7c5750838201355b600019600387901b1c1916600186901b178355611177565b600083815260209020601f19861690835b82811015614ac55786850135825560209485019460019092019101614aa5565b5086821015614ae25760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b600060608284031215614b0657600080fd5b610f098383614705565b600060208284031215614b2257600080fd5b610f09826146f6565b600060208284031215614b3d57600080fd5b81518015158114610f0957600080fd5b6001600160e01b03198316815260408101600b8310614b6e57614b6e613e08565b8260208301529392505050565b8183526000602080850194508260005b85811015614bb9578135614b9e81613d79565b6001600160a01b031687529582019590820190600101614b8b565b509495945050505050565b81835260006001600160fb1b03831115614bdd57600080fd5b8260051b80836020870137939093016020019392505050565b604081526000614c0a604083018688614b7b565b8281036020840152614c1d818587614bc4565b979650505050505050565b600060208284031215614c3a57600080fd5b5051919050565b80820180821115610a0357610a03614924565b81810381811115610a0357610a03614924565b600082614c8457634e487b7160e01b600052601260045260246000fd5b500490565b608081526000614c9d608083018a8c614b7b565b60208382036020850152614cb2828a8c614b7b565b91508382036040850152614cc782888a614bc4565b848103606086015285815286925060200160005b86811015614d0757614cec846146f6565b614cf581613ef4565b82529282019290820190600101614cdb565b509c9b505050505050505050505050565b60008251614d2a818460208701614553565b9190910192915050565b60c08101614d428287613fd6565b6001600160a01b0394851660608301529284166080820152921660a090920191909152919050565b600060018201614d7c57614d7c614924565b5060010190565b600060a08284031215614d9557600080fd5b614d9d61420f565b8235614da881613d79565b81526020830135614db881613d79565b6020820152614dca8460408501614705565b60408201529392505050565b600082601f830112614de757600080fd5b81516020614df76142ab83614267565b8083825260208201915060208460051b870101935086841115614e1957600080fd5b602086015b848110156142ee578051614e3181613d79565b8352918301918301614e1e565b600080600060608486031215614e5357600080fd5b83516001600160401b0380821115614e6a57600080fd5b614e7687838801614dd6565b9450602091508186015181811115614e8d57600080fd5b614e9988828901614dd6565b945050604086015181811115614eae57600080fd5b86019050601f81018713614ec157600080fd5b8051614ecf6142ab82614267565b81815260059190911b82018301908381019089831115614eee57600080fd5b928401925b82841015614f275783516bffffffffffffffffffffffff81168114614f185760008081fd5b82529284019290840190614ef3565b80955050505050509250925092565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351614f6e816017850160208801614553565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351614f9f816028840160208801614553565b01602801949350505050565b602081526000610f096020830184614577565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090614c1d90830184614577565b60a081016150068286613fd6565b6001600160a01b03938416606083015291909216608090920191909152919050565b60008161503757615037614924565b506000190190565b634e487b7160e01b600052603160045260246000fd5b60018060a01b0385168152836020820152826040820152608060608201526000614035608083018461457756fea2646970667358221220f2c96cbb22626006ee11ff90975b91b23886e548ed7a61504409d1948b356f0f64736f6c63430008170033", + "deployer": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "devdoc": { + "version": 1, + "kind": "dev", + "methods": { + "bulkRequestWithdrawalFor((address,address,(uint8,uint256,uint256))[],uint256)": { + "details": "Bulk requests withdrawals. Emits the `WithdrawalRequested` events." + }, + "bulkSubmitWithdrawalSignatures(uint256[],bytes[])": { + "details": "Submits withdrawal signatures. Requirements: - The method caller is a validator." + }, + "checkThreshold(uint256)": { + "details": "Checks whether the `_voteWeight` passes the threshold." + }, + "depositFor((uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))": { + "details": "Deposits based on the receipt. Requirements: - The method caller is a validator. Emits the `Deposited` once the assets are released." + }, + "depositVoted(uint256,uint256,address)": { + "details": "Returns whether the deposit is casted by the voter." + }, + "getContract(uint8)": { + "details": "Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.", + "params": { + "contractType": "The role of the contract to retrieve." + }, + "returns": { + "contract_": "The address of the contract with the specified role." + } + }, + "getMainchainToken(address,uint256)": { + "details": "Returns mainchain token address. Reverts for unsupported token." + }, + "getRoleAdmin(bytes32)": { + "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." + }, + "getRoleMember(bytes32,uint256)": { + "details": "Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information." + }, + "getRoleMemberCount(bytes32)": { + "details": "Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role." + }, + "getThreshold()": { + "details": "Returns the threshold." + }, + "getTrustedThreshold()": { + "details": "Returns the threshold about trusted org." + }, + "getWithdrawalSignatures(uint256,address[])": { + "details": "Returns withdrawal signatures." + }, + "grantRole(bytes32,address)": { + "details": "Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event." + }, + "hasRole(bytes32,address)": { + "details": "Returns `true` if `account` has been granted `role`." + }, + "initialize(address,uint256,uint256,uint256,uint256,address[],address[][2],uint256[][2],uint8[])": { + "details": "Initializes contract storage." + }, + "mainchainWithdrew(uint256)": { + "details": "Returns whether the withdrawal is done on mainchain." + }, + "mainchainWithdrewVoted(uint256,address)": { + "details": "Returns whether the mainchain withdrew is casted by the voter." + }, + "mapTokens(address[],address[],uint256[],uint8[])": { + "details": "Maps Ronin tokens to mainchain networks. Requirement: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `TokenMapped` event." + }, + "minimumVoteWeight()": { + "details": "Returns the minimum vote weight to pass the threshold." + }, + "pause()": { + "details": "Triggers paused state." + }, + "paused()": { + "details": "Returns true if the contract is paused, and false otherwise." + }, + "renounceRole(bytes32,address)": { + "details": "Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`. May emit a {RoleRevoked} event." + }, + "requestWithdrawalFor((address,address,(uint8,uint256,uint256)),uint256)": { + "details": "Locks the assets and request withdrawal. Emits the `WithdrawalRequested` event." + }, + "requestWithdrawalSignatures(uint256)": { + "details": "Requests withdrawal signatures for a specific withdrawal. Emits the `WithdrawalSignaturesRequested` event." + }, + "revokeRole(bytes32,address)": { + "details": "Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event." + }, + "setContract(uint8,address)": { + "details": "Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.", + "params": { + "addr": "The address of the contract to set.", + "contractType": "The role of the contract to set." + } + }, + "setEmergencyPauser(address)": { + "details": "Grant emergency pauser role for `_addr`." + }, + "setMinimumThresholds(address[],uint256[])": { + "details": "Sets the minimum thresholds to withdraw. Requirements: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `MinimumThresholdsUpdated` event." + }, + "setThreshold(uint256,uint256)": { + "details": "Sets the threshold. Requirements: - The method caller is admin. Emits the `ThresholdUpdated` event." + }, + "tryBulkAcknowledgeMainchainWithdrew(uint256[])": { + "details": "Marks the withdrawals are done on mainchain and returns the boolean array indicating whether the withdrawal vote is already done before. Requirements: - The method caller is a validator. Emits the `MainchainWithdrew` once the valid call passes the quorum threshold." + }, + "tryBulkDepositFor((uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256))[])": { + "details": "Tries bulk deposits based on the receipts and returns the boolean array indicating whether the deposit vote is already done before. Reverts if the deposit is invalid or is voted by the validator again. Requirements: - The method caller is a validator. Emits the `Deposited` once the assets are released." + }, + "unpause()": { + "details": "Triggers unpaused state." + } + }, + "events": { + "ContractUpdated(uint8,address)": { + "details": "Emitted when a contract is updated." + }, + "DepositVoted(address,uint256,uint256,bytes32)": { + "details": "Emitted when a deposit is voted" + }, + "Deposited(bytes32,(uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))": { + "details": "Emitted when the assets are depositted" + }, + "Initialized(uint8)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "MainchainWithdrew(bytes32,(uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))": { + "details": "Emitted when the assets are withdrawn on mainchain" + }, + "MinimumThresholdsUpdated(address[],uint256[])": { + "details": "Emitted when the minimum thresholds are updated" + }, + "Paused(address)": { + "details": "Emitted when the pause is triggered by `account`." + }, + "RoleAdminChanged(bytes32,bytes32,bytes32)": { + "details": "Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this. _Available since v3.1._" + }, + "RoleGranted(bytes32,address,address)": { + "details": "Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}." + }, + "RoleRevoked(bytes32,address,address)": { + "details": "Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)" + }, + "ThresholdUpdated(uint256,uint256,uint256,uint256,uint256)": { + "details": "Emitted when the threshold is updated" + }, + "TokenMapped(address[],address[],uint256[],uint8[])": { + "details": "Emitted when the tokens are mapped" + }, + "TrustedThresholdUpdated(uint256,uint256,uint256,uint256,uint256)": { + "details": "Emitted when the threshold is updated" + }, + "Unpaused(address)": { + "details": "Emitted when the pause is lifted by `account`." + }, + "WithdrawalRequested(bytes32,(uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))": { + "details": "Emitted when the withdrawal is requested" + }, + "WithdrawalSignaturesRequested(bytes32,(uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))": { + "details": "Emitted when the withdrawal signatures is requested" + } + }, + "errors": { + "ErrAlreadyVoted(address)": [ + { + "details": "Error indicating that a voter has already voted.", + "params": { + "voter": "The address of the voter who has already voted." + } + } + ], + "ErrContractTypeNotFound(uint8)": [ + { + "details": "Error of invalid role." + } + ], + "ErrERC1155MintingFailed()": [ + { + "details": "Error indicating that the mint of ERC1155 tokens has failed." + } + ], + "ErrERC20MintingFailed()": [ + { + "details": "Error indicating that the minting of ERC20 tokens has failed." + } + ], + "ErrERC721MintingFailed()": [ + { + "details": "Error indicating that the minting of ERC721 tokens has failed." + } + ], + "ErrEmptyArray()": [ + { + "details": "Error indicating that an array is empty when it should contain elements." + } + ], + "ErrInvalidChainId(bytes4,uint256,uint256)": [ + { + "details": "Error indicating that the chain ID is invalid.", + "params": { + "actual": "Current chain ID that executing function.", + "expected": "Expected chain ID required for the tx to success.", + "msgSig": "The function signature (bytes4) of the operation that encountered an invalid chain ID." + } + } + ], + "ErrInvalidInfo()": [ + { + "details": "Error indicating that the provided information is invalid." + } + ], + "ErrInvalidReceipt()": [ + { + "details": "Error indicating that a receipt is invalid." + } + ], + "ErrInvalidReceiptKind()": [ + { + "details": "Error indicating that a receipt kind is invalid." + } + ], + "ErrInvalidRequest()": [ + { + "details": "Error indicating that a request is invalid." + } + ], + "ErrInvalidThreshold(bytes4)": [ + { + "details": "Error indicating that the provided threshold is invalid for a specific function signature.", + "params": { + "msgSig": "The function signature (bytes4) that the invalid threshold applies to." + } + } + ], + "ErrInvalidTokenStandard()": [ + { + "details": "Error indicating that a token standard is invalid." + } + ], + "ErrInvalidTrustedThreshold()": [ + { + "details": "Error thrown when an invalid trusted threshold is specified." + } + ], + "ErrLengthMismatch(bytes4)": [ + { + "details": "Error indicating a mismatch in the length of input parameters or arrays for a specific function.", + "params": { + "msgSig": "The function signature (bytes4) that has a length mismatch." + } + } + ], + "ErrQueryForTooSmallQuantity()": [ + { + "details": "Throwed when the ERC20 withdrawal quantity is less than the minimum threshold." + } + ], + "ErrTokenCouldNotTransfer((uint8,uint256,uint256),address,address)": [ + { + "details": "Error indicating that the `transfer` has failed.", + "params": { + "to": "Receiver of the token value.", + "token": "Address of the token.", + "tokenInfo": "Info of the token including ERC standard, id or quantity." + } + } + ], + "ErrTokenCouldNotTransferFrom((uint8,uint256,uint256),address,address,address)": [ + { + "details": "Error indicating that the `handleAssetIn` has failed.", + "params": { + "from": "Owner of the token value.", + "to": "Receiver of the token value.", + "token": "Address of the token.", + "tokenInfo": "Info of the token including ERC standard, id or quantity." + } + } + ], + "ErrUnauthorized(bytes4,uint8)": [ + { + "details": "Error indicating that the caller is unauthorized to perform a specific function.", + "params": { + "expectedRole": "The role required to perform the function.", + "msgSig": "The function signature (bytes4) that the caller is unauthorized to perform." + } + } + ], + "ErrUnsupportedStandard()": [ + { + "details": "Error indicating that an unsupported standard is encountered." + } + ], + "ErrUnsupportedToken()": [ + { + "details": "Error indicating that a token is not supported." + } + ], + "ErrWithdrawalsMigrated()": [ + { + "details": "Error thrown when attempting to withdraw funds that have already been migrated." + } + ], + "ErrWithdrawnOnMainchainAlready()": [ + { + "details": "Error thrown when attempting to withdraw funds that have already been withdrawn on the mainchain." + } + ], + "ErrZeroCodeContract(address)": [ + { + "details": "Error of set to non-contract." + } + ] + } + }, + "isFoundry": true, + "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"ErrAlreadyVoted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"ErrContractTypeNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrERC1155MintingFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrERC20MintingFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrERC721MintingFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrEmptyArray\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"}],\"name\":\"ErrInvalidChainId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidInfo\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidReceipt\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidReceiptKind\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidRequest\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidThreshold\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidTokenStandard\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidTrustedThreshold\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrLengthMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrQueryForTooSmallQuantity\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"tokenInfo\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"ErrTokenCouldNotTransfer\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"tokenInfo\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"ErrTokenCouldNotTransferFrom\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum RoleAccess\",\"name\":\"expectedRole\",\"type\":\"uint8\"}],\"name\":\"ErrUnauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrUnsupportedStandard\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrUnsupportedToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrWithdrawalsMigrated\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrWithdrawnOnMainchainAlready\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrZeroCodeContract\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ContractUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"bridgeOperator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"receiptHash\",\"type\":\"bytes32\"}],\"name\":\"DepositVoted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"receiptHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"struct Transfer.Receipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"Deposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"receiptHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"struct Transfer.Receipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"MainchainWithdrew\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"threshold\",\"type\":\"uint256[]\"}],\"name\":\"MinimumThresholdsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"numerator\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"denominator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousNumerator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousDenominator\",\"type\":\"uint256\"}],\"name\":\"ThresholdUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"roninTokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"mainchainTokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"chainIds\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"enum TokenStandard[]\",\"name\":\"standards\",\"type\":\"uint8[]\"}],\"name\":\"TokenMapped\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"numerator\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"denominator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousNumerator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousDenominator\",\"type\":\"uint256\"}],\"name\":\"TrustedThresholdUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"receiptHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"struct Transfer.Receipt\",\"name\":\"\",\"type\":\"tuple\"}],\"name\":\"WithdrawalRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"receiptHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"struct Transfer.Receipt\",\"name\":\"\",\"type\":\"tuple\"}],\"name\":\"WithdrawalSignaturesRequested\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipientAddr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"internalType\":\"struct Transfer.Request[]\",\"name\":\"requests\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"bulkRequestWithdrawalFor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"withdrawals\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"signatures\",\"type\":\"bytes[]\"}],\"name\":\"bulkSubmitWithdrawalSignatures\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_voteWeight\",\"type\":\"uint256\"}],\"name\":\"checkThreshold\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"internalType\":\"struct Transfer.Receipt\",\"name\":\"_receipt\",\"type\":\"tuple\"}],\"name\":\"depositFor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"depositVote\",\"outputs\":[{\"internalType\":\"enum VoteStatusConsumer.VoteStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"finalHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"expiredAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"createdAt\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_depositId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_voter\",\"type\":\"address\"}],\"name\":\"depositVoted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"emergencyPauser\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"getContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"contract_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_roninToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_chainId\",\"type\":\"uint256\"}],\"name\":\"getMainchainToken\",\"outputs\":[{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"}],\"internalType\":\"struct MappedTokenConsumer.MappedToken\",\"name\":\"_token\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getRoleMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleMemberCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"num_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTrustedThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"trustedNum_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"trustedDenom_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"withdrawalId\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"operators\",\"type\":\"address[]\"}],\"name\":\"getWithdrawalSignatures\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"_signatures\",\"type\":\"bytes[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_roleSetter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_numerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_denominator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_trustedNumerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_trustedDenominator\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"},{\"internalType\":\"address[][2]\",\"name\":\"_packedAddresses\",\"type\":\"address[][2]\"},{\"internalType\":\"uint256[][2]\",\"name\":\"_packedNumbers\",\"type\":\"uint256[][2]\"},{\"internalType\":\"enum TokenStandard[]\",\"name\":\"_standards\",\"type\":\"uint8[]\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initializeV2\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeAdmin\",\"type\":\"address\"}],\"name\":\"initializeV3\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_withdrawalId\",\"type\":\"uint256\"}],\"name\":\"mainchainWithdrew\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"mainchainWithdrewVote\",\"outputs\":[{\"internalType\":\"enum VoteStatusConsumer.VoteStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"finalHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"expiredAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"createdAt\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_withdrawalId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_voter\",\"type\":\"address\"}],\"name\":\"mainchainWithdrewVoted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_roninTokens\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"_mainchainTokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_chainIds\",\"type\":\"uint256[]\"},{\"internalType\":\"enum TokenStandard[]\",\"name\":\"_standards\",\"type\":\"uint8[]\"}],\"name\":\"mapTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"mainchainToken\",\"type\":\"address\"}],\"name\":\"minimumThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minimumVoteWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155BatchReceived\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipientAddr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"internalType\":\"struct Transfer.Request\",\"name\":\"_request\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"_chainId\",\"type\":\"uint256\"}],\"name\":\"requestWithdrawalFor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_withdrawalId\",\"type\":\"uint256\"}],\"name\":\"requestWithdrawalSignatures\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"setEmergencyPauser\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_tokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_thresholds\",\"type\":\"uint256[]\"}],\"name\":\"setMinimumThresholds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_numerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_denominator\",\"type\":\"uint256\"}],\"name\":\"setThreshold\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_trustedNumerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_trustedDenominator\",\"type\":\"uint256\"}],\"name\":\"setTrustedThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"_withdrawalIds\",\"type\":\"uint256[]\"}],\"name\":\"tryBulkAcknowledgeMainchainWithdrew\",\"outputs\":[{\"internalType\":\"bool[]\",\"name\":\"_executedReceipts\",\"type\":\"bool[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"internalType\":\"struct Transfer.Receipt[]\",\"name\":\"receipts\",\"type\":\"tuple[]\"}],\"name\":\"tryBulkDepositFor\",\"outputs\":[{\"internalType\":\"bool[]\",\"name\":\"_executedReceipts\",\"type\":\"bool[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"withdrawal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdrawalCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"withdrawalStatVote\",\"outputs\":[{\"internalType\":\"enum VoteStatusConsumer.VoteStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"finalHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"expiredAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"createdAt\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"errors\":{\"ErrAlreadyVoted(address)\":[{\"details\":\"Error indicating that a voter has already voted.\",\"params\":{\"voter\":\"The address of the voter who has already voted.\"}}],\"ErrContractTypeNotFound(uint8)\":[{\"details\":\"Error of invalid role.\"}],\"ErrERC1155MintingFailed()\":[{\"details\":\"Error indicating that the mint of ERC1155 tokens has failed.\"}],\"ErrERC20MintingFailed()\":[{\"details\":\"Error indicating that the minting of ERC20 tokens has failed.\"}],\"ErrERC721MintingFailed()\":[{\"details\":\"Error indicating that the minting of ERC721 tokens has failed.\"}],\"ErrEmptyArray()\":[{\"details\":\"Error indicating that an array is empty when it should contain elements.\"}],\"ErrInvalidChainId(bytes4,uint256,uint256)\":[{\"details\":\"Error indicating that the chain ID is invalid.\",\"params\":{\"actual\":\"Current chain ID that executing function.\",\"expected\":\"Expected chain ID required for the tx to success.\",\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid chain ID.\"}}],\"ErrInvalidInfo()\":[{\"details\":\"Error indicating that the provided information is invalid.\"}],\"ErrInvalidReceipt()\":[{\"details\":\"Error indicating that a receipt is invalid.\"}],\"ErrInvalidReceiptKind()\":[{\"details\":\"Error indicating that a receipt kind is invalid.\"}],\"ErrInvalidRequest()\":[{\"details\":\"Error indicating that a request is invalid.\"}],\"ErrInvalidThreshold(bytes4)\":[{\"details\":\"Error indicating that the provided threshold is invalid for a specific function signature.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that the invalid threshold applies to.\"}}],\"ErrInvalidTokenStandard()\":[{\"details\":\"Error indicating that a token standard is invalid.\"}],\"ErrInvalidTrustedThreshold()\":[{\"details\":\"Error thrown when an invalid trusted threshold is specified.\"}],\"ErrLengthMismatch(bytes4)\":[{\"details\":\"Error indicating a mismatch in the length of input parameters or arrays for a specific function.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that has a length mismatch.\"}}],\"ErrQueryForTooSmallQuantity()\":[{\"details\":\"Throwed when the ERC20 withdrawal quantity is less than the minimum threshold.\"}],\"ErrTokenCouldNotTransfer((uint8,uint256,uint256),address,address)\":[{\"details\":\"Error indicating that the `transfer` has failed.\",\"params\":{\"to\":\"Receiver of the token value.\",\"token\":\"Address of the token.\",\"tokenInfo\":\"Info of the token including ERC standard, id or quantity.\"}}],\"ErrTokenCouldNotTransferFrom((uint8,uint256,uint256),address,address,address)\":[{\"details\":\"Error indicating that the `handleAssetIn` has failed.\",\"params\":{\"from\":\"Owner of the token value.\",\"to\":\"Receiver of the token value.\",\"token\":\"Address of the token.\",\"tokenInfo\":\"Info of the token including ERC standard, id or quantity.\"}}],\"ErrUnauthorized(bytes4,uint8)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"expectedRole\":\"The role required to perform the function.\",\"msgSig\":\"The function signature (bytes4) that the caller is unauthorized to perform.\"}}],\"ErrUnsupportedStandard()\":[{\"details\":\"Error indicating that an unsupported standard is encountered.\"}],\"ErrUnsupportedToken()\":[{\"details\":\"Error indicating that a token is not supported.\"}],\"ErrWithdrawalsMigrated()\":[{\"details\":\"Error thrown when attempting to withdraw funds that have already been migrated.\"}],\"ErrWithdrawnOnMainchainAlready()\":[{\"details\":\"Error thrown when attempting to withdraw funds that have already been withdrawn on the mainchain.\"}],\"ErrZeroCodeContract(address)\":[{\"details\":\"Error of set to non-contract.\"}]},\"events\":{\"ContractUpdated(uint8,address)\":{\"details\":\"Emitted when a contract is updated.\"},\"DepositVoted(address,uint256,uint256,bytes32)\":{\"details\":\"Emitted when a deposit is voted\"},\"Deposited(bytes32,(uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Emitted when the assets are depositted\"},\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"MainchainWithdrew(bytes32,(uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Emitted when the assets are withdrawn on mainchain\"},\"MinimumThresholdsUpdated(address[],uint256[])\":{\"details\":\"Emitted when the minimum thresholds are updated\"},\"Paused(address)\":{\"details\":\"Emitted when the pause is triggered by `account`.\"},\"RoleAdminChanged(bytes32,bytes32,bytes32)\":{\"details\":\"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this. _Available since v3.1._\"},\"RoleGranted(bytes32,address,address)\":{\"details\":\"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.\"},\"RoleRevoked(bytes32,address,address)\":{\"details\":\"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)\"},\"ThresholdUpdated(uint256,uint256,uint256,uint256,uint256)\":{\"details\":\"Emitted when the threshold is updated\"},\"TokenMapped(address[],address[],uint256[],uint8[])\":{\"details\":\"Emitted when the tokens are mapped\"},\"TrustedThresholdUpdated(uint256,uint256,uint256,uint256,uint256)\":{\"details\":\"Emitted when the threshold is updated\"},\"Unpaused(address)\":{\"details\":\"Emitted when the pause is lifted by `account`.\"},\"WithdrawalRequested(bytes32,(uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Emitted when the withdrawal is requested\"},\"WithdrawalSignaturesRequested(bytes32,(uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Emitted when the withdrawal signatures is requested\"}},\"kind\":\"dev\",\"methods\":{\"bulkRequestWithdrawalFor((address,address,(uint8,uint256,uint256))[],uint256)\":{\"details\":\"Bulk requests withdrawals. Emits the `WithdrawalRequested` events.\"},\"bulkSubmitWithdrawalSignatures(uint256[],bytes[])\":{\"details\":\"Submits withdrawal signatures. Requirements: - The method caller is a validator.\"},\"checkThreshold(uint256)\":{\"details\":\"Checks whether the `_voteWeight` passes the threshold.\"},\"depositFor((uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Deposits based on the receipt. Requirements: - The method caller is a validator. Emits the `Deposited` once the assets are released.\"},\"depositVoted(uint256,uint256,address)\":{\"details\":\"Returns whether the deposit is casted by the voter.\"},\"getContract(uint8)\":{\"details\":\"Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.\",\"params\":{\"contractType\":\"The role of the contract to retrieve.\"},\"returns\":{\"contract_\":\"The address of the contract with the specified role.\"}},\"getMainchainToken(address,uint256)\":{\"details\":\"Returns mainchain token address. Reverts for unsupported token.\"},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"getRoleMember(bytes32,uint256)\":{\"details\":\"Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.\"},\"getRoleMemberCount(bytes32)\":{\"details\":\"Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.\"},\"getThreshold()\":{\"details\":\"Returns the threshold.\"},\"getTrustedThreshold()\":{\"details\":\"Returns the threshold about trusted org.\"},\"getWithdrawalSignatures(uint256,address[])\":{\"details\":\"Returns withdrawal signatures.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"initialize(address,uint256,uint256,uint256,uint256,address[],address[][2],uint256[][2],uint8[])\":{\"details\":\"Initializes contract storage.\"},\"mainchainWithdrew(uint256)\":{\"details\":\"Returns whether the withdrawal is done on mainchain.\"},\"mainchainWithdrewVoted(uint256,address)\":{\"details\":\"Returns whether the mainchain withdrew is casted by the voter.\"},\"mapTokens(address[],address[],uint256[],uint8[])\":{\"details\":\"Maps Ronin tokens to mainchain networks. Requirement: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `TokenMapped` event.\"},\"minimumVoteWeight()\":{\"details\":\"Returns the minimum vote weight to pass the threshold.\"},\"pause()\":{\"details\":\"Triggers paused state.\"},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`. May emit a {RoleRevoked} event.\"},\"requestWithdrawalFor((address,address,(uint8,uint256,uint256)),uint256)\":{\"details\":\"Locks the assets and request withdrawal. Emits the `WithdrawalRequested` event.\"},\"requestWithdrawalSignatures(uint256)\":{\"details\":\"Requests withdrawal signatures for a specific withdrawal. Emits the `WithdrawalSignaturesRequested` event.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"setContract(uint8,address)\":{\"details\":\"Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.\",\"params\":{\"addr\":\"The address of the contract to set.\",\"contractType\":\"The role of the contract to set.\"}},\"setEmergencyPauser(address)\":{\"details\":\"Grant emergency pauser role for `_addr`.\"},\"setMinimumThresholds(address[],uint256[])\":{\"details\":\"Sets the minimum thresholds to withdraw. Requirements: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `MinimumThresholdsUpdated` event.\"},\"setThreshold(uint256,uint256)\":{\"details\":\"Sets the threshold. Requirements: - The method caller is admin. Emits the `ThresholdUpdated` event.\"},\"tryBulkAcknowledgeMainchainWithdrew(uint256[])\":{\"details\":\"Marks the withdrawals are done on mainchain and returns the boolean array indicating whether the withdrawal vote is already done before. Requirements: - The method caller is a validator. Emits the `MainchainWithdrew` once the valid call passes the quorum threshold.\"},\"tryBulkDepositFor((uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256))[])\":{\"details\":\"Tries bulk deposits based on the receipts and returns the boolean array indicating whether the deposit vote is already done before. Reverts if the deposit is invalid or is voted by the validator again. Requirements: - The method caller is a validator. Emits the `Deposited` once the assets are released.\"},\"unpause()\":{\"details\":\"Triggers unpaused state.\"}},\"stateVariables\":{\"____deprecated0\":{\"custom:deprecated\":\"Previously `_validatorContract` (non-zero value)\"},\"____deprecated1\":{\"custom:deprecated\":\"Previously `_bridgeTrackingContract` (non-zero value)\"},\"____deprecated2\":{\"custom:deprecated\":\"Previously `_trustedOrgContract` (non-zero value)\"},\"___deprecated4\":{\"custom:deprecated\":\"Previously `withdrawalMigrated` (non-zero value)\"},\"_mainchainToken\":{\"details\":\"Mapping from token address => chain id => mainchain token address\"},\"_withdrawalSig\":{\"details\":\"Mapping from withdrawal id => validator address => signatures\"},\"depositVote\":{\"details\":\"Mapping from chain id => deposit id => deposit vote\"},\"mainchainWithdrewVote\":{\"details\":\"Mapping from withdrawal id => mainchain withdrew vote\"},\"withdrawal\":{\"details\":\"Mapping from withdrawal id => withdrawal receipt\"},\"withdrawalCount\":{\"details\":\"Total withdrawal\"},\"withdrawalStatVote\":{\"details\":\"Mapping from withdrawal id => vote for recording withdrawal stats\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"depositFor((uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"notice\":\"The assets will be transferred whenever the valid call passes the quorum threshold.\"},\"tryBulkAcknowledgeMainchainWithdrew(uint256[])\":{\"notice\":\"Not reverting to avoid unnecessary failed transactions because the validators can send transactions at the same time.\"},\"tryBulkDepositFor((uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256))[])\":{\"notice\":\"The assets will be transferred whenever the valid call for the receipt passes the quorum threshold. Not reverting to avoid unnecessary failed transactions because the validators can send transactions at the same time.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/ronin/gateway/RoninGatewayV3.sol\":\"RoninGatewayV3\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@fdk/=lib/foundry-deployment-kit/script/\",\":@openzeppelin/=lib/openzeppelin-contracts/\",\":@prb/math/=lib/prb-math/\",\":@prb/test/=lib/prb-test/src/\",\":@ronin/contracts/=src/\",\":@ronin/script/=script/\",\":@ronin/test/=test/\",\":contract-libs/=lib/foundry-deployment-kit/lib/contract-libs/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/foundry-deployment-kit/lib/forge-std/src/\",\":foundry-deployment-kit/=lib/foundry-deployment-kit/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/contracts/\",\":prb-math/=lib/prb-math/src/\",\":prb-test/=lib/prb-test/src/\",\":solady/=lib/solady/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/access/AccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\nimport \\\"../utils/Context.sol\\\";\\nimport \\\"../utils/Strings.sol\\\";\\nimport \\\"../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it.\\n */\\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\\n struct RoleData {\\n mapping(address => bool) members;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with a standardized message including the required role.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n *\\n * _Available since v4.1._\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role);\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\\n return _roles[role].members[account];\\n }\\n\\n /**\\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\\n * Overriding this function changes the behavior of the {onlyRole} modifier.\\n *\\n * Format of the revert message is described in {_checkRole}.\\n *\\n * _Available since v4.6._\\n */\\n function _checkRole(bytes32 role) internal view virtual {\\n _checkRole(role, _msgSender());\\n }\\n\\n /**\\n * @dev Revert with a standard message if `account` is missing `role`.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert(\\n string(\\n abi.encodePacked(\\n \\\"AccessControl: account \\\",\\n Strings.toHexString(uint160(account), 20),\\n \\\" is missing role \\\",\\n Strings.toHexString(uint256(role), 32)\\n )\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function renounceRole(bytes32 role, address account) public virtual override {\\n require(account == _msgSender(), \\\"AccessControl: can only renounce roles for self\\\");\\n\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event. Note that unlike {grantRole}, this function doesn't perform any\\n * checks on the calling account.\\n *\\n * May emit a {RoleGranted} event.\\n *\\n * [WARNING]\\n * ====\\n * This function should only be called from the constructor when setting\\n * up the initial roles for the system.\\n *\\n * Using this function in any other way is effectively circumventing the admin\\n * system imposed by {AccessControl}.\\n * ====\\n *\\n * NOTE: This function is deprecated in favor of {_grantRole}.\\n */\\n function _setupRole(bytes32 role, address account) internal virtual {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual {\\n if (!hasRole(role, account)) {\\n _roles[role].members[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n }\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual {\\n if (hasRole(role, account)) {\\n _roles[role].members[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5b35d8e68aeaccc685239bd9dd79b9ba01a0357930f8a3307ab85511733d9724\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/access/AccessControlEnumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlEnumerable.sol\\\";\\nimport \\\"./AccessControl.sol\\\";\\nimport \\\"../utils/structs/EnumerableSet.sol\\\";\\n\\n/**\\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\\n */\\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {\\n return _roleMembers[role].at(index);\\n }\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {\\n return _roleMembers[role].length();\\n }\\n\\n /**\\n * @dev Overload {_grantRole} to track enumerable memberships\\n */\\n function _grantRole(bytes32 role, address account) internal virtual override {\\n super._grantRole(role, account);\\n _roleMembers[role].add(account);\\n }\\n\\n /**\\n * @dev Overload {_revokeRole} to track enumerable memberships\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual override {\\n super._revokeRole(role, account);\\n _roleMembers[role].remove(account);\\n }\\n}\\n\",\"keccak256\":\"0x13f5e15f2a0650c0b6aaee2ef19e89eaf4870d6e79662d572a393334c1397247\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/access/IAccessControlEnumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\n\\n/**\\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\\n */\\ninterface IAccessControlEnumerable is IAccessControl {\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xba4459ab871dfa300f5212c6c30178b63898c03533a1ede28436f11546626676\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0xa6a787e7a901af6511e19aa53e1a00352db215a011d2c7a438d0582dd5da76f9\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2a21b14ff90012878752f230d3ffd5c3405e5938d06c97a7d89c0a64561d0d66\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/security/Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract Pausable is Context {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n constructor() {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n _requireNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n _requirePaused();\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Throws if the contract is paused.\\n */\\n function _requireNotPaused() internal view virtual {\\n require(!paused(), \\\"Pausable: paused\\\");\\n }\\n\\n /**\\n * @dev Throws if the contract is not paused.\\n */\\n function _requirePaused() internal view virtual {\\n require(paused(), \\\"Pausable: not paused\\\");\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n}\\n\",\"keccak256\":\"0x0849d93b16c9940beb286a7864ed02724b248b93e0d80ef6355af5ef15c64773\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/ERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/ERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC1155.sol\\\";\\nimport \\\"./IERC1155Receiver.sol\\\";\\nimport \\\"./extensions/IERC1155MetadataURI.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\nimport \\\"../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the basic standard multi-token.\\n * See https://eips.ethereum.org/EIPS/eip-1155\\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\\n *\\n * _Available since v3.1._\\n */\\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\\n using Address for address;\\n\\n // Mapping from token ID to account balances\\n mapping(uint256 => mapping(address => uint256)) private _balances;\\n\\n // Mapping from account to operator approvals\\n mapping(address => mapping(address => bool)) private _operatorApprovals;\\n\\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\\n string private _uri;\\n\\n /**\\n * @dev See {_setURI}.\\n */\\n constructor(string memory uri_) {\\n _setURI(uri_);\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return\\n interfaceId == type(IERC1155).interfaceId ||\\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC1155MetadataURI-uri}.\\n *\\n * This implementation returns the same URI for *all* token types. It relies\\n * on the token type ID substitution mechanism\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\\n *\\n * Clients calling this function must replace the `\\\\{id\\\\}` substring with the\\n * actual token type ID.\\n */\\n function uri(uint256) public view virtual override returns (string memory) {\\n return _uri;\\n }\\n\\n /**\\n * @dev See {IERC1155-balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\\n require(account != address(0), \\\"ERC1155: address zero is not a valid owner\\\");\\n return _balances[id][account];\\n }\\n\\n /**\\n * @dev See {IERC1155-balanceOfBatch}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\\n public\\n view\\n virtual\\n override\\n returns (uint256[] memory)\\n {\\n require(accounts.length == ids.length, \\\"ERC1155: accounts and ids length mismatch\\\");\\n\\n uint256[] memory batchBalances = new uint256[](accounts.length);\\n\\n for (uint256 i = 0; i < accounts.length; ++i) {\\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\\n }\\n\\n return batchBalances;\\n }\\n\\n /**\\n * @dev See {IERC1155-setApprovalForAll}.\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual override {\\n _setApprovalForAll(_msgSender(), operator, approved);\\n }\\n\\n /**\\n * @dev See {IERC1155-isApprovedForAll}.\\n */\\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\\n return _operatorApprovals[account][operator];\\n }\\n\\n /**\\n * @dev See {IERC1155-safeTransferFrom}.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) public virtual override {\\n require(\\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\\n \\\"ERC1155: caller is not token owner nor approved\\\"\\n );\\n _safeTransferFrom(from, to, id, amount, data);\\n }\\n\\n /**\\n * @dev See {IERC1155-safeBatchTransferFrom}.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) public virtual override {\\n require(\\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\\n \\\"ERC1155: caller is not token owner nor approved\\\"\\n );\\n _safeBatchTransferFrom(from, to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function _safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: transfer to the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: insufficient balance for transfer\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n _balances[id][to] += amount;\\n\\n emit TransferSingle(operator, from, to, id, amount);\\n\\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function _safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n require(to != address(0), \\\"ERC1155: transfer to the zero address\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n for (uint256 i = 0; i < ids.length; ++i) {\\n uint256 id = ids[i];\\n uint256 amount = amounts[i];\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: insufficient balance for transfer\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n _balances[id][to] += amount;\\n }\\n\\n emit TransferBatch(operator, from, to, ids, amounts);\\n\\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Sets a new URI for all token types, by relying on the token type ID\\n * substitution mechanism\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\\n *\\n * By this mechanism, any occurrence of the `\\\\{id\\\\}` substring in either the\\n * URI or any of the amounts in the JSON file at said URI will be replaced by\\n * clients with the token type ID.\\n *\\n * For example, the `https://token-cdn-domain/\\\\{id\\\\}.json` URI would be\\n * interpreted by clients as\\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\\n * for token type ID 0x4cce0.\\n *\\n * See {uri}.\\n *\\n * Because these URIs cannot be meaningfully represented by the {URI} event,\\n * this function emits no events.\\n */\\n function _setURI(string memory newuri) internal virtual {\\n _uri = newuri;\\n }\\n\\n /**\\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function _mint(\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: mint to the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _balances[id][to] += amount;\\n emit TransferSingle(operator, address(0), to, id, amount);\\n\\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function _mintBatch(\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: mint to the zero address\\\");\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n for (uint256 i = 0; i < ids.length; i++) {\\n _balances[ids[i]][to] += amounts[i];\\n }\\n\\n emit TransferBatch(operator, address(0), to, ids, amounts);\\n\\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens of token type `id` from `from`\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `from` must have at least `amount` tokens of token type `id`.\\n */\\n function _burn(\\n address from,\\n uint256 id,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC1155: burn from the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n\\n emit TransferSingle(operator, from, address(0), id, amount);\\n\\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n */\\n function _burnBatch(\\n address from,\\n uint256[] memory ids,\\n uint256[] memory amounts\\n ) internal virtual {\\n require(from != address(0), \\\"ERC1155: burn from the zero address\\\");\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n\\n for (uint256 i = 0; i < ids.length; i++) {\\n uint256 id = ids[i];\\n uint256 amount = amounts[i];\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n }\\n\\n emit TransferBatch(operator, from, address(0), ids, amounts);\\n\\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n }\\n\\n /**\\n * @dev Approve `operator` to operate on all of `owner` tokens\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function _setApprovalForAll(\\n address owner,\\n address operator,\\n bool approved\\n ) internal virtual {\\n require(owner != operator, \\\"ERC1155: setting approval status for self\\\");\\n _operatorApprovals[owner][operator] = approved;\\n emit ApprovalForAll(owner, operator, approved);\\n }\\n\\n /**\\n * @dev Hook that is called before any token transfer. This includes minting\\n * and burning, as well as batched variants.\\n *\\n * The same hook is called on both single and batched variants. For single\\n * transfers, the length of the `ids` and `amounts` arrays will be 1.\\n *\\n * Calling conditions (for each `id` and `amount` pair):\\n *\\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * of token type `id` will be transferred to `to`.\\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\\n * for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\\n * will be burned.\\n * - `from` and `to` are never both zero.\\n * - `ids` and `amounts` have the same, non-zero length.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any token transfer. This includes minting\\n * and burning, as well as batched variants.\\n *\\n * The same hook is called on both single and batched variants. For single\\n * transfers, the length of the `id` and `amount` arrays will be 1.\\n *\\n * Calling conditions (for each `id` and `amount` pair):\\n *\\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * of token type `id` will be transferred to `to`.\\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\\n * for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\\n * will be burned.\\n * - `from` and `to` are never both zero.\\n * - `ids` and `amounts` have the same, non-zero length.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {}\\n\\n function _doSafeTransferAcceptanceCheck(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) private {\\n if (to.isContract()) {\\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\\n if (response != IERC1155Receiver.onERC1155Received.selector) {\\n revert(\\\"ERC1155: ERC1155Receiver rejected tokens\\\");\\n }\\n } catch Error(string memory reason) {\\n revert(reason);\\n } catch {\\n revert(\\\"ERC1155: transfer to non ERC1155Receiver implementer\\\");\\n }\\n }\\n }\\n\\n function _doSafeBatchTransferAcceptanceCheck(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) private {\\n if (to.isContract()) {\\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\\n bytes4 response\\n ) {\\n if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\\n revert(\\\"ERC1155: ERC1155Receiver rejected tokens\\\");\\n }\\n } catch Error(string memory reason) {\\n revert(reason);\\n } catch {\\n revert(\\\"ERC1155: transfer to non ERC1155Receiver implementer\\\");\\n }\\n }\\n }\\n\\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\\n uint256[] memory array = new uint256[](1);\\n array[0] = element;\\n\\n return array;\\n }\\n}\\n\",\"keccak256\":\"0x447a21c87433c0f11252912313a96f3454629ef88cca7a4eefbb283b3ec409f9\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155 is IERC165 {\\n /**\\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\\n */\\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\\n\\n /**\\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\\n * transfers.\\n */\\n event TransferBatch(\\n address indexed operator,\\n address indexed from,\\n address indexed to,\\n uint256[] ids,\\n uint256[] values\\n );\\n\\n /**\\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\\n * `approved`.\\n */\\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\\n\\n /**\\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\\n *\\n * If an {URI} event was emitted for `id`, the standard\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\\n * returned by {IERC1155MetadataURI-uri}.\\n */\\n event URI(string value, uint256 indexed id);\\n\\n /**\\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\\n external\\n view\\n returns (uint256[] memory);\\n\\n /**\\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\\n *\\n * Emits an {ApprovalForAll} event.\\n *\\n * Requirements:\\n *\\n * - `operator` cannot be the caller.\\n */\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n /**\\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\\n *\\n * See {setApprovalForAll}.\\n */\\n function isApprovedForAll(address account, address operator) external view returns (bool);\\n\\n /**\\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] calldata ids,\\n uint256[] calldata amounts,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x6392f2cfe3a5ee802227fe7a2dfd47096d881aec89bddd214b35c5b46d3cd941\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev _Available since v3.1._\\n */\\ninterface IERC1155Receiver is IERC165 {\\n /**\\n * @dev Handles the receipt of a single ERC1155 token type. This function is\\n * called at the end of a `safeTransferFrom` after the balance has been updated.\\n *\\n * NOTE: To accept the transfer, this must return\\n * `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))`\\n * (i.e. 0xf23a6e61, or its own function selector).\\n *\\n * @param operator The address which initiated the transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param id The ID of the token being transferred\\n * @param value The amount of tokens being transferred\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155Received(\\n address operator,\\n address from,\\n uint256 id,\\n uint256 value,\\n bytes calldata data\\n ) external returns (bytes4);\\n\\n /**\\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\\n * is called at the end of a `safeBatchTransferFrom` after the balances have\\n * been updated.\\n *\\n * NOTE: To accept the transfer(s), this must return\\n * `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))`\\n * (i.e. 0xbc197c81, or its own function selector).\\n *\\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155BatchReceived(\\n address operator,\\n address from,\\n uint256[] calldata ids,\\n uint256[] calldata values,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xeb373f1fdc7b755c6a750123a9b9e3a8a02c1470042fd6505d875000a80bde0b\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/ERC1155Burnable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/extensions/ERC1155Burnable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1155.sol\\\";\\n\\n/**\\n * @dev Extension of {ERC1155} that allows token holders to destroy both their\\n * own tokens and those that they have been approved to use.\\n *\\n * _Available since v3.1._\\n */\\nabstract contract ERC1155Burnable is ERC1155 {\\n function burn(\\n address account,\\n uint256 id,\\n uint256 value\\n ) public virtual {\\n require(\\n account == _msgSender() || isApprovedForAll(account, _msgSender()),\\n \\\"ERC1155: caller is not token owner nor approved\\\"\\n );\\n\\n _burn(account, id, value);\\n }\\n\\n function burnBatch(\\n address account,\\n uint256[] memory ids,\\n uint256[] memory values\\n ) public virtual {\\n require(\\n account == _msgSender() || isApprovedForAll(account, _msgSender()),\\n \\\"ERC1155: caller is not token owner nor approved\\\"\\n );\\n\\n _burnBatch(account, ids, values);\\n }\\n}\\n\",\"keccak256\":\"0xb11d1ade7146ac3da122e1f387ea82b0bd385d50823946c3f967dbffef3e9f4f\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/ERC1155Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1155.sol\\\";\\nimport \\\"../../../security/Pausable.sol\\\";\\n\\n/**\\n * @dev ERC1155 token with pausable token transfers, minting and burning.\\n *\\n * Useful for scenarios such as preventing trades until the end of an evaluation\\n * period, or having an emergency switch for freezing all token transfers in the\\n * event of a large bug.\\n *\\n * _Available since v3.1._\\n */\\nabstract contract ERC1155Pausable is ERC1155, Pausable {\\n /**\\n * @dev See {ERC1155-_beforeTokenTransfer}.\\n *\\n * Requirements:\\n *\\n * - the contract must not be paused.\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual override {\\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n require(!paused(), \\\"ERC1155Pausable: token transfer while paused\\\");\\n }\\n}\\n\",\"keccak256\":\"0xdad22b949de979bb2ad9001c044b2aeaacf8a25e3de09ed6f022a9469f936d5b\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC1155.sol\\\";\\n\\n/**\\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155MetadataURI is IERC1155 {\\n /**\\n * @dev Returns the URI for token type `id`.\\n *\\n * If the `\\\\{id\\\\}` substring is present in the URI, it must be replaced by\\n * clients with the actual token type ID.\\n */\\n function uri(uint256 id) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xa66d18b9a85458d28fc3304717964502ae36f7f8a2ff35bc83f6f85d74b03574\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/presets/ERC1155PresetMinterPauser.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/presets/ERC1155PresetMinterPauser.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1155.sol\\\";\\nimport \\\"../extensions/ERC1155Burnable.sol\\\";\\nimport \\\"../extensions/ERC1155Pausable.sol\\\";\\nimport \\\"../../../access/AccessControlEnumerable.sol\\\";\\nimport \\\"../../../utils/Context.sol\\\";\\n\\n/**\\n * @dev {ERC1155} token, including:\\n *\\n * - ability for holders to burn (destroy) their tokens\\n * - a minter role that allows for token minting (creation)\\n * - a pauser role that allows to stop all token transfers\\n *\\n * This contract uses {AccessControl} to lock permissioned functions using the\\n * different roles - head to its documentation for details.\\n *\\n * The account that deploys the contract will be granted the minter and pauser\\n * roles, as well as the default admin role, which will let it grant both minter\\n * and pauser roles to other accounts.\\n *\\n * _Deprecated in favor of https://wizard.openzeppelin.com/[Contracts Wizard]._\\n */\\ncontract ERC1155PresetMinterPauser is Context, AccessControlEnumerable, ERC1155Burnable, ERC1155Pausable {\\n bytes32 public constant MINTER_ROLE = keccak256(\\\"MINTER_ROLE\\\");\\n bytes32 public constant PAUSER_ROLE = keccak256(\\\"PAUSER_ROLE\\\");\\n\\n /**\\n * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE`, and `PAUSER_ROLE` to the account that\\n * deploys the contract.\\n */\\n constructor(string memory uri) ERC1155(uri) {\\n _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());\\n\\n _setupRole(MINTER_ROLE, _msgSender());\\n _setupRole(PAUSER_ROLE, _msgSender());\\n }\\n\\n /**\\n * @dev Creates `amount` new tokens for `to`, of token type `id`.\\n *\\n * See {ERC1155-_mint}.\\n *\\n * Requirements:\\n *\\n * - the caller must have the `MINTER_ROLE`.\\n */\\n function mint(\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) public virtual {\\n require(hasRole(MINTER_ROLE, _msgSender()), \\\"ERC1155PresetMinterPauser: must have minter role to mint\\\");\\n\\n _mint(to, id, amount, data);\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] variant of {mint}.\\n */\\n function mintBatch(\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) public virtual {\\n require(hasRole(MINTER_ROLE, _msgSender()), \\\"ERC1155PresetMinterPauser: must have minter role to mint\\\");\\n\\n _mintBatch(to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Pauses all token transfers.\\n *\\n * See {ERC1155Pausable} and {Pausable-_pause}.\\n *\\n * Requirements:\\n *\\n * - the caller must have the `PAUSER_ROLE`.\\n */\\n function pause() public virtual {\\n require(hasRole(PAUSER_ROLE, _msgSender()), \\\"ERC1155PresetMinterPauser: must have pauser role to pause\\\");\\n _pause();\\n }\\n\\n /**\\n * @dev Unpauses all token transfers.\\n *\\n * See {ERC1155Pausable} and {Pausable-_unpause}.\\n *\\n * Requirements:\\n *\\n * - the caller must have the `PAUSER_ROLE`.\\n */\\n function unpause() public virtual {\\n require(hasRole(PAUSER_ROLE, _msgSender()), \\\"ERC1155PresetMinterPauser: must have pauser role to unpause\\\");\\n _unpause();\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId)\\n public\\n view\\n virtual\\n override(AccessControlEnumerable, ERC1155)\\n returns (bool)\\n {\\n return super.supportsInterface(interfaceId);\\n }\\n\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual override(ERC1155, ERC1155Pausable) {\\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n }\\n}\\n\",\"keccak256\":\"0x775e248004d21e0666740534a732daa9f17ceeee660ded876829e98a3a62b657\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/utils/ERC1155Holder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ERC1155Receiver.sol\\\";\\n\\n/**\\n * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens.\\n *\\n * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be\\n * stuck.\\n *\\n * @dev _Available since v3.1._\\n */\\ncontract ERC1155Holder is ERC1155Receiver {\\n function onERC1155Received(\\n address,\\n address,\\n uint256,\\n uint256,\\n bytes memory\\n ) public virtual override returns (bytes4) {\\n return this.onERC1155Received.selector;\\n }\\n\\n function onERC1155BatchReceived(\\n address,\\n address,\\n uint256[] memory,\\n uint256[] memory,\\n bytes memory\\n ) public virtual override returns (bytes4) {\\n return this.onERC1155BatchReceived.selector;\\n }\\n}\\n\",\"keccak256\":\"0x2e024ca51ce5abe16c0d34e6992a1104f356e2244eb4ccbec970435e8b3405e3\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/utils/ERC1155Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC1155Receiver.sol\\\";\\nimport \\\"../../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev _Available since v3.1._\\n */\\nabstract contract ERC1155Receiver is ERC165, IERC1155Receiver {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);\\n }\\n}\\n\",\"keccak256\":\"0x3dd5e1a66a56f30302108a1da97d677a42b1daa60e503696b2bcbbf3e4c95bcb\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC721 compliant contract.\\n */\\ninterface IERC721 is IERC165 {\\n /**\\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\\n */\\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\\n */\\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\\n\\n /**\\n * @dev Returns the number of tokens in ``owner``'s account.\\n */\\n function balanceOf(address owner) external view returns (uint256 balance);\\n\\n /**\\n * @dev Returns the owner of the `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function ownerOf(uint256 tokenId) external view returns (address owner);\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) external;\\n\\n /**\\n * @dev Transfers `tokenId` token from `from` to `to`.\\n *\\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) external;\\n\\n /**\\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\\n * The approval is cleared when the token is transferred.\\n *\\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\\n *\\n * Requirements:\\n *\\n * - The caller must own the token or be an approved operator.\\n * - `tokenId` must exist.\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Approve or remove `operator` as an operator for the caller.\\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\\n *\\n * Requirements:\\n *\\n * - The `operator` cannot be the caller.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function setApprovalForAll(address operator, bool _approved) external;\\n\\n /**\\n * @dev Returns the account approved for `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function getApproved(uint256 tokenId) external view returns (address operator);\\n\\n /**\\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\\n *\\n * See {setApprovalForAll}\\n */\\n function isApprovedForAll(address owner, address operator) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xed6a749c5373af398105ce6ee3ac4763aa450ea7285d268c85d9eeca809cdb1f\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _HEX_SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n // Inspired by OraclizeAPI's implementation - MIT licence\\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\\n\\n if (value == 0) {\\n return \\\"0\\\";\\n }\\n uint256 temp = value;\\n uint256 digits;\\n while (temp != 0) {\\n digits++;\\n temp /= 10;\\n }\\n bytes memory buffer = new bytes(digits);\\n while (value != 0) {\\n digits -= 1;\\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\\n value /= 10;\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n if (value == 0) {\\n return \\\"0x00\\\";\\n }\\n uint256 temp = value;\\n uint256 length = 0;\\n while (temp != 0) {\\n length++;\\n temp >>= 8;\\n }\\n return toHexString(value, length);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xaf159a8b1923ad2a26d516089bceca9bdeaeacd04be50983ea00ba63070f08a3\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.3) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSA {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n } else if (error == RecoverError.InvalidSignatureV) {\\n revert(\\\"ECDSA: invalid signature 'v' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n if (v != 27 && v != 28) {\\n return (address(0), RecoverError.InvalidSignatureV);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", Strings.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0xdb7f5c28fc61cda0bd8ab60ce288e206b791643bcd3ba464a70cbec18895a2f5\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n *\\n * [WARNING]\\n * ====\\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.\\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\\n *\\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.\\n * ====\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n bytes32 lastValue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastValue;\\n // Update the index for the moved value\\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n return set._values[index];\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function _values(Set storage set) private view returns (bytes32[] memory) {\\n return set._values;\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\\n return _values(set._inner);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(AddressSet storage set) internal view returns (address[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n address[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(UintSet storage set) internal view returns (uint256[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n uint256[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0x5050943b32b6a8f282573d166b2e9d87ab7eb4dbba4ab6acf36ecb54fe6995e4\",\"license\":\"MIT\"},\"src/extensions/GatewayV3.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/security/Pausable.sol\\\";\\nimport \\\"../interfaces/IQuorum.sol\\\";\\nimport \\\"./collections/HasProxyAdmin.sol\\\";\\n\\nabstract contract GatewayV3 is HasProxyAdmin, Pausable, IQuorum {\\n uint256 internal _num;\\n uint256 internal _denom;\\n\\n address private ______deprecated;\\n uint256 public nonce;\\n\\n address public emergencyPauser;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n */\\n uint256[49] private ______gap;\\n\\n /**\\n * @dev Grant emergency pauser role for `_addr`.\\n */\\n function setEmergencyPauser(address _addr) external onlyProxyAdmin {\\n emergencyPauser = _addr;\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function getThreshold() external view virtual returns (uint256 num_, uint256 denom_) {\\n return (_num, _denom);\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function checkThreshold(uint256 _voteWeight) external view virtual returns (bool) {\\n return _voteWeight * _denom >= _num * _getTotalWeight();\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function setThreshold(uint256 _numerator, uint256 _denominator) external virtual onlyProxyAdmin {\\n return _setThreshold(_numerator, _denominator);\\n }\\n\\n /**\\n * @dev Triggers paused state.\\n */\\n function pause() external {\\n _requireAuth();\\n _pause();\\n }\\n\\n /**\\n * @dev Triggers unpaused state.\\n */\\n function unpause() external {\\n _requireAuth();\\n _unpause();\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function minimumVoteWeight() public view virtual returns (uint256) {\\n return _minimumVoteWeight(_getTotalWeight());\\n }\\n\\n /**\\n * @dev Sets threshold and returns the old one.\\n *\\n * Emits the `ThresholdUpdated` event.\\n *\\n */\\n function _setThreshold(uint256 num, uint256 denom) internal virtual {\\n if (num > denom) revert ErrInvalidThreshold(msg.sig);\\n uint256 prevNum = _num;\\n uint256 prevDenom = _denom;\\n _num = num;\\n _denom = denom;\\n unchecked {\\n emit ThresholdUpdated(nonce++, num, denom, prevNum, prevDenom);\\n }\\n }\\n\\n /**\\n * @dev Returns minimum vote weight.\\n */\\n function _minimumVoteWeight(uint256 _totalWeight) internal view virtual returns (uint256) {\\n return (_num * _totalWeight + _denom - 1) / _denom;\\n }\\n\\n /**\\n * @dev Internal method to check method caller.\\n *\\n * Requirements:\\n *\\n * - The method caller must be admin or pauser.\\n *\\n */\\n function _requireAuth() private view {\\n if (!(msg.sender == _getProxyAdmin() || msg.sender == emergencyPauser)) {\\n revert ErrUnauthorized(msg.sig, RoleAccess.ADMIN);\\n }\\n }\\n\\n /**\\n * @dev Returns the total weight.\\n */\\n function _getTotalWeight() internal view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0x010a0021a377e4b23a4f56269b9c6e3e3fc2684897928ff9b9da1b47c3f07baf\",\"license\":\"MIT\"},\"src/extensions/MinimumWithdrawal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./collections/HasProxyAdmin.sol\\\";\\nimport \\\"../libraries/Transfer.sol\\\";\\n\\nabstract contract MinimumWithdrawal is HasProxyAdmin {\\n /// @dev Throwed when the ERC20 withdrawal quantity is less than the minimum threshold.\\n error ErrQueryForTooSmallQuantity();\\n\\n /// @dev Emitted when the minimum thresholds are updated\\n event MinimumThresholdsUpdated(address[] tokens, uint256[] threshold);\\n\\n /// @dev Mapping from mainchain token address => minimum thresholds\\n mapping(address mainchainToken => uint256) public minimumThreshold;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n */\\n uint256[50] private ______gap;\\n\\n /**\\n * @dev Sets the minimum thresholds to withdraw.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n * - The arrays have the same length and its length larger than 0.\\n *\\n * Emits the `MinimumThresholdsUpdated` event.\\n *\\n */\\n function setMinimumThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) external virtual onlyProxyAdmin {\\n if (_tokens.length == 0) revert ErrEmptyArray();\\n _setMinimumThresholds(_tokens, _thresholds);\\n }\\n\\n /**\\n * @dev Sets minimum thresholds.\\n *\\n * Requirements:\\n * - The array lengths are equal.\\n *\\n * Emits the `MinimumThresholdsUpdated` event.\\n *\\n */\\n function _setMinimumThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) internal virtual {\\n if (_tokens.length != _thresholds.length) revert ErrLengthMismatch(msg.sig);\\n\\n for (uint256 _i; _i < _tokens.length;) {\\n minimumThreshold[_tokens[_i]] = _thresholds[_i];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n emit MinimumThresholdsUpdated(_tokens, _thresholds);\\n }\\n\\n /**\\n * @dev Checks whether the request is larger than or equal to the minimum threshold.\\n */\\n function _checkWithdrawal(Transfer.Request calldata _request) internal view {\\n if (_request.info.erc == TokenStandard.ERC20 && _request.info.quantity < minimumThreshold[_request.tokenAddr]) {\\n revert ErrQueryForTooSmallQuantity();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x56a1e5650f8a9046d5afbc161ac9ffdb75cc2c9c4bea13325f2363abafee6985\",\"license\":\"MIT\"},\"src/extensions/TransparentUpgradeableProxyV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\\\";\\n\\ncontract TransparentUpgradeableProxyV2 is TransparentUpgradeableProxy {\\n constructor(address _logic, address admin_, bytes memory _data) payable TransparentUpgradeableProxy(_logic, admin_, _data) { }\\n\\n /**\\n * @dev Calls a function from the current implementation as specified by `_data`, which should be an encoded function call.\\n *\\n * Requirements:\\n * - Only the admin can call this function.\\n *\\n * Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid\\n * triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider\\n * reviewing the encoded data `_data` and the method which is called before using this.\\n *\\n */\\n function functionDelegateCall(bytes memory _data) public payable ifAdmin {\\n address _addr = _implementation();\\n assembly {\\n let _result := delegatecall(gas(), _addr, add(_data, 32), mload(_data), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n switch _result\\n case 0 { revert(0, returndatasize()) }\\n default { return(0, returndatasize()) }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x45fc7b71d09da99414b977a56e586b3604670d865e5f36f395d5c98bc4ba64af\",\"license\":\"MIT\"},\"src/extensions/collections/HasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { HasProxyAdmin } from \\\"./HasProxyAdmin.sol\\\";\\nimport \\\"../../interfaces/collections/IHasContracts.sol\\\";\\nimport { IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\nimport { ErrUnexpectedInternalCall } from \\\"../../utils/CommonErrors.sol\\\";\\n\\n/**\\n * @title HasContracts\\n * @dev A contract that provides functionality to manage multiple contracts with different roles.\\n */\\nabstract contract HasContracts is HasProxyAdmin, IHasContracts, IdentityGuard {\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.collections.HasContracts.slot\\\") - 1\\n bytes32 private constant _STORAGE_SLOT = 0xdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb;\\n\\n /**\\n * @dev Modifier to restrict access to functions only to contracts with a specific role.\\n * @param contractType The contract type that allowed to call\\n */\\n modifier onlyContract(ContractType contractType) virtual {\\n _requireContract(contractType);\\n _;\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function setContract(ContractType contractType, address addr) external virtual onlyProxyAdmin {\\n _requireHasCode(addr);\\n _setContract(contractType, addr);\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function getContract(ContractType contractType) public view returns (address contract_) {\\n contract_ = _getContractMap()[uint8(contractType)];\\n if (contract_ == address(0)) revert ErrContractTypeNotFound(contractType);\\n }\\n\\n /**\\n * @dev Internal function to set the address of a contract with a specific role.\\n * @param contractType The contract type of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function _setContract(ContractType contractType, address addr) internal virtual {\\n _getContractMap()[uint8(contractType)] = addr;\\n emit ContractUpdated(contractType, addr);\\n }\\n\\n /**\\n * @dev Internal function to access the mapping of contract addresses with roles.\\n * @return contracts_ The mapping of contract addresses with roles.\\n */\\n function _getContractMap() private pure returns (mapping(uint8 => address) storage contracts_) {\\n assembly {\\n contracts_.slot := _STORAGE_SLOT\\n }\\n }\\n\\n /**\\n * @dev Internal function to check if the calling contract has a specific role.\\n * @param contractType The contract type that the calling contract must have.\\n * @dev Throws an error if the calling contract does not have the specified role.\\n */\\n function _requireContract(ContractType contractType) private view {\\n if (msg.sender != getContract(contractType)) {\\n revert ErrUnexpectedInternalCall(msg.sig, contractType, msg.sender);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7dbefa31230e6e4bd319f02d94893cbfd07ee12a0e016f5fadc57660df01891\",\"license\":\"MIT\"},\"src/extensions/collections/HasProxyAdmin.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/StorageSlot.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\n\\nabstract contract HasProxyAdmin {\\n // bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n modifier onlyProxyAdmin() {\\n _requireProxyAdmin();\\n _;\\n }\\n\\n /**\\n * @dev Returns proxy admin.\\n */\\n function _getProxyAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n function _requireProxyAdmin() internal view {\\n if (msg.sender != _getProxyAdmin()) revert ErrUnauthorized(msg.sig, RoleAccess.ADMIN);\\n }\\n}\\n\",\"keccak256\":\"0xad3db02c99a960b60151f2ad45eed46073d14fe1ed861f496c7aeefacbbc528e\",\"license\":\"MIT\"},\"src/interfaces/IERC20Mintable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.2;\\n\\ninterface IERC20Mintable {\\n function mint(address _to, uint256 _value) external returns (bool _success);\\n}\\n\",\"keccak256\":\"0x6632cb3345e581a0b7868d6ce9a883f55d107576f9557f500a042c8285e51005\",\"license\":\"MIT\"},\"src/interfaces/IERC721Mintable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IERC721Mintable {\\n function mint(address _to, uint256 _tokenId) external returns (bool);\\n}\\n\",\"keccak256\":\"0x4f001516a2596c79c205a9e28de092aa866eb440040e78b8be9027451028f169\",\"license\":\"MIT\"},\"src/interfaces/IQuorum.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IQuorum {\\n /// @dev Emitted when the threshold is updated\\n event ThresholdUpdated(uint256 indexed nonce, uint256 indexed numerator, uint256 indexed denominator, uint256 previousNumerator, uint256 previousDenominator);\\n\\n /**\\n * @dev Returns the threshold.\\n */\\n function getThreshold() external view returns (uint256 _num, uint256 _denom);\\n\\n /**\\n * @dev Checks whether the `_voteWeight` passes the threshold.\\n */\\n function checkThreshold(uint256 _voteWeight) external view returns (bool);\\n\\n /**\\n * @dev Returns the minimum vote weight to pass the threshold.\\n */\\n function minimumVoteWeight() external view returns (uint256);\\n\\n /**\\n * @dev Sets the threshold.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `ThresholdUpdated` event.\\n *\\n */\\n function setThreshold(uint256 numerator, uint256 denominator) external;\\n}\\n\",\"keccak256\":\"0xc924e9480f59acc9bc8c033f05d3be9451de5cee0c224d76d4542fa5b67fa10f\",\"license\":\"MIT\"},\"src/interfaces/IRoninGatewayV3.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../libraries/Transfer.sol\\\";\\nimport \\\"./consumers/MappedTokenConsumer.sol\\\";\\n\\ninterface IRoninGatewayV3 is MappedTokenConsumer {\\n /**\\n * @dev Error thrown when attempting to withdraw funds that have already been migrated.\\n */\\n error ErrWithdrawalsMigrated();\\n\\n /**\\n * @dev Error thrown when an invalid trusted threshold is specified.\\n */\\n error ErrInvalidTrustedThreshold();\\n\\n /**\\n * @dev Error thrown when attempting to withdraw funds that have already been withdrawn on the mainchain.\\n */\\n error ErrWithdrawnOnMainchainAlready();\\n\\n /// @dev Emitted when the assets are depositted\\n event Deposited(bytes32 receiptHash, Transfer.Receipt receipt);\\n /// @dev Emitted when the withdrawal is requested\\n event WithdrawalRequested(bytes32 receiptHash, Transfer.Receipt);\\n /// @dev Emitted when the assets are withdrawn on mainchain\\n event MainchainWithdrew(bytes32 receiptHash, Transfer.Receipt receipt);\\n /// @dev Emitted when the withdrawal signatures is requested\\n event WithdrawalSignaturesRequested(bytes32 receiptHash, Transfer.Receipt);\\n /// @dev Emitted when the tokens are mapped\\n event TokenMapped(address[] roninTokens, address[] mainchainTokens, uint256[] chainIds, TokenStandard[] standards);\\n /// @dev Emitted when the threshold is updated\\n event TrustedThresholdUpdated(\\n uint256 indexed nonce, uint256 indexed numerator, uint256 indexed denominator, uint256 previousNumerator, uint256 previousDenominator\\n );\\n /// @dev Emitted when a deposit is voted\\n event DepositVoted(address indexed bridgeOperator, uint256 indexed id, uint256 indexed chainId, bytes32 receiptHash);\\n\\n /**\\n * @dev Returns withdrawal count.\\n */\\n function withdrawalCount() external view returns (uint256);\\n\\n /**\\n * @dev Returns withdrawal signatures.\\n */\\n function getWithdrawalSignatures(uint256 _withdrawalId, address[] calldata _validators) external view returns (bytes[] memory);\\n\\n /**\\n * @dev Deposits based on the receipt.\\n *\\n * Requirements:\\n * - The method caller is a validator.\\n *\\n * Emits the `Deposited` once the assets are released.\\n *\\n * @notice The assets will be transferred whenever the valid call passes the quorum threshold.\\n *\\n */\\n function depositFor(Transfer.Receipt calldata _receipt) external;\\n\\n /**\\n * @dev Marks the withdrawals are done on mainchain and returns the boolean array indicating whether the withdrawal\\n * vote is already done before.\\n *\\n * Requirements:\\n * - The method caller is a validator.\\n *\\n * Emits the `MainchainWithdrew` once the valid call passes the quorum threshold.\\n *\\n * @notice Not reverting to avoid unnecessary failed transactions because the validators can send transactions at the\\n * same time.\\n *\\n */\\n function tryBulkAcknowledgeMainchainWithdrew(uint256[] calldata _withdrawalIds) external returns (bool[] memory);\\n\\n /**\\n * @dev Tries bulk deposits based on the receipts and returns the boolean array indicating whether the deposit vote\\n * is already done before. Reverts if the deposit is invalid or is voted by the validator again.\\n *\\n * Requirements:\\n * - The method caller is a validator.\\n *\\n * Emits the `Deposited` once the assets are released.\\n *\\n * @notice The assets will be transferred whenever the valid call for the receipt passes the quorum threshold. Not\\n * reverting to avoid unnecessary failed transactions because the validators can send transactions at the same time.\\n *\\n */\\n function tryBulkDepositFor(Transfer.Receipt[] calldata _receipts) external returns (bool[] memory);\\n\\n /**\\n * @dev Locks the assets and request withdrawal.\\n *\\n * Emits the `WithdrawalRequested` event.\\n *\\n */\\n function requestWithdrawalFor(Transfer.Request calldata _request, uint256 _chainId) external;\\n\\n /**\\n * @dev Bulk requests withdrawals.\\n *\\n * Emits the `WithdrawalRequested` events.\\n *\\n */\\n function bulkRequestWithdrawalFor(Transfer.Request[] calldata _requests, uint256 _chainId) external;\\n\\n /**\\n * @dev Requests withdrawal signatures for a specific withdrawal.\\n *\\n * Emits the `WithdrawalSignaturesRequested` event.\\n *\\n */\\n function requestWithdrawalSignatures(uint256 _withdrawalId) external;\\n\\n /**\\n * @dev Submits withdrawal signatures.\\n *\\n * Requirements:\\n * - The method caller is a validator.\\n *\\n */\\n function bulkSubmitWithdrawalSignatures(uint256[] calldata _withdrawals, bytes[] calldata _signatures) external;\\n\\n /**\\n * @dev Maps Ronin tokens to mainchain networks.\\n *\\n * Requirement:\\n * - The method caller is admin.\\n * - The arrays have the same length and its length larger than 0.\\n *\\n * Emits the `TokenMapped` event.\\n *\\n */\\n function mapTokens(\\n address[] calldata _roninTokens,\\n address[] calldata _mainchainTokens,\\n uint256[] calldata chainIds,\\n TokenStandard[] calldata _standards\\n ) external;\\n\\n /**\\n * @dev Returns whether the deposit is casted by the voter.\\n */\\n function depositVoted(uint256 _chainId, uint256 _depositId, address _voter) external view returns (bool);\\n\\n /**\\n * @dev Returns whether the mainchain withdrew is casted by the voter.\\n */\\n function mainchainWithdrewVoted(uint256 _withdrawalId, address _voter) external view returns (bool);\\n\\n /**\\n * @dev Returns whether the withdrawal is done on mainchain.\\n */\\n function mainchainWithdrew(uint256 _withdrawalId) external view returns (bool);\\n\\n /**\\n * @dev Returns mainchain token address.\\n * Reverts for unsupported token.\\n */\\n function getMainchainToken(address _roninToken, uint256 _chainId) external view returns (MappedToken memory _token);\\n}\\n\",\"keccak256\":\"0x063bbad71da3acad745c2f2bf306643a3e089f430d1ba10e095de2ba108aeb87\",\"license\":\"MIT\"},\"src/interfaces/IWETH.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IWETH {\\n event Transfer(address indexed src, address indexed dst, uint wad);\\n\\n function deposit() external payable;\\n\\n function transfer(address dst, uint wad) external returns (bool);\\n\\n function approve(address guy, uint wad) external returns (bool);\\n\\n function transferFrom(address src, address dst, uint wad) external returns (bool);\\n\\n function withdraw(uint256 _wad) external;\\n\\n function balanceOf(address) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x000700e2b9c1985d53bb1cdba435f0f3d7b48e76e596e7dbbdfec1da47131415\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IBridgeManagerEvents } from \\\"./events/IBridgeManagerEvents.sol\\\";\\n\\n/**\\n * @title IBridgeManager\\n * @dev The interface for managing bridge operators.\\n */\\ninterface IBridgeManager is IBridgeManagerEvents {\\n /// @notice Error indicating that cannot find the querying operator\\n error ErrOperatorNotFound(address operator);\\n /// @notice Error indicating that cannot find the querying governor\\n error ErrGovernorNotFound(address governor);\\n /// @notice Error indicating that the msg.sender is not match the required governor\\n error ErrGovernorNotMatch(address required, address sender);\\n /// @notice Error indicating that the governors list will go below minimum number of required governor.\\n error ErrBelowMinRequiredGovernors();\\n /// @notice Common invalid input error\\n error ErrInvalidInput();\\n\\n /**\\n * @dev The domain separator used for computing hash digests in the contract.\\n */\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n\\n /**\\n * @dev Returns the total number of bridge operators.\\n * @return The total number of bridge operators.\\n */\\n function totalBridgeOperator() external view returns (uint256);\\n\\n /**\\n * @dev Checks if the given address is a bridge operator.\\n * @param addr The address to check.\\n * @return A boolean indicating whether the address is a bridge operator.\\n */\\n function isBridgeOperator(address addr) external view returns (bool);\\n\\n /**\\n * @dev Retrieves the full information of all registered bridge operators.\\n *\\n * This external function allows external callers to obtain the full information of all the registered bridge operators.\\n * The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.\\n *\\n * @return governors An array of addresses representing the governors of each bridge operator.\\n * @return bridgeOperators An array of addresses representing the registered bridge operators.\\n * @return weights An array of uint256 values representing the vote weights of each bridge operator.\\n *\\n * Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator.\\n *\\n * Example Usage:\\n * ```\\n * (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos();\\n * for (uint256 i = 0; i < bridgeOperators.length; i++) {\\n * // Access individual information for each bridge operator.\\n * address governor = governors[i];\\n * address bridgeOperator = bridgeOperators[i];\\n * uint256 weight = weights[i];\\n * // ... (Process or use the information as required) ...\\n * }\\n * ```\\n *\\n */\\n function getFullBridgeOperatorInfos() external view returns (address[] memory governors, address[] memory bridgeOperators, uint96[] memory weights);\\n\\n /**\\n * @dev Returns total weights of the governor list.\\n */\\n function sumGovernorsWeight(address[] calldata governors) external view returns (uint256 sum);\\n\\n /**\\n * @dev Returns total weights.\\n */\\n function getTotalWeight() external view returns (uint256);\\n\\n /**\\n * @dev Returns an array of all bridge operators.\\n * @return An array containing the addresses of all bridge operators.\\n */\\n function getBridgeOperators() external view returns (address[] memory);\\n\\n /**\\n * @dev Returns the corresponding `operator` of a `governor`.\\n */\\n function getOperatorOf(address governor) external view returns (address operator);\\n\\n /**\\n * @dev Returns the corresponding `governor` of a `operator`.\\n */\\n function getGovernorOf(address operator) external view returns (address governor);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific governor.\\n * @param governor The address of the governor to get the vote weight for.\\n * @return voteWeight The vote weight of the specified governor.\\n */\\n function getGovernorWeight(address governor) external view returns (uint96);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific bridge operator.\\n * @param bridgeOperator The address of the bridge operator to get the vote weight for.\\n * @return weight The vote weight of the specified bridge operator.\\n */\\n function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint96 weight);\\n\\n /**\\n * @dev Returns the weights of a list of governor addresses.\\n */\\n function getGovernorWeights(address[] calldata governors) external view returns (uint96[] memory weights);\\n\\n /**\\n * @dev Returns an array of all governors.\\n * @return An array containing the addresses of all governors.\\n */\\n function getGovernors() external view returns (address[] memory);\\n\\n /**\\n * @dev Adds multiple bridge operators.\\n * @param governors An array of addresses of hot/cold wallets for bridge operator to update their node address.\\n * @param bridgeOperators An array of addresses representing the bridge operators to add.\\n */\\n function addBridgeOperators(uint96[] calldata voteWeights, address[] calldata governors, address[] calldata bridgeOperators) external;\\n\\n /**\\n * @dev Removes multiple bridge operators.\\n * @param bridgeOperators An array of addresses representing the bridge operators to remove.\\n */\\n function removeBridgeOperators(address[] calldata bridgeOperators) external;\\n\\n /**\\n * @dev Self-call to update the minimum required governor.\\n * @param min The minimum number, this must not less than 3.\\n */\\n function setMinRequiredGovernor(uint min) external;\\n}\\n\",\"keccak256\":\"0xefc46318a240371031e77ef3c355e2c18432e4479145378de6782277f9b44923\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeTracking.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeTracking {\\n struct Request {\\n VoteKind kind;\\n uint256 id;\\n }\\n\\n enum VoteKind {\\n Deposit,\\n Withdrawal,\\n MainchainWithdrawal\\n }\\n\\n event ExternalCallFailed(address indexed to, bytes4 indexed msgSig, bytes reason);\\n\\n /**\\n * @dev Returns the block that allow incomming mutable call.\\n */\\n function startedAtBlock() external view returns (uint256);\\n\\n /**\\n * @dev Returns the total number of votes at the specific period `_period`.\\n */\\n function totalVote(uint256 _period) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total number of ballots at the specific period `_period`.\\n */\\n function totalBallot(uint256 _period) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total number of ballots of bridge operators at the specific period `_period`.\\n */\\n function getManyTotalBallots(uint256 _period, address[] calldata _bridgeOperators) external view returns (uint256[] memory);\\n\\n /**\\n * @dev Returns the total number of ballots of a bridge operator at the specific period `_period`.\\n */\\n function totalBallotOf(uint256 _period, address _bridgeOperator) external view returns (uint256);\\n\\n /**\\n * @dev Handles the request once it is approved.\\n *\\n * Requirements:\\n * - The method caller is the bridge contract.\\n *\\n */\\n function handleVoteApproved(VoteKind _kind, uint256 _requestId) external;\\n\\n /**\\n * @dev Records vote for a receipt and a operator.\\n *\\n * Requirements:\\n * - The method caller is the bridge contract.\\n *\\n */\\n function recordVote(VoteKind _kind, uint256 _requestId, address _operator) external;\\n}\\n\",\"keccak256\":\"0x53ac425ff6efebc200030ceef302c2871a4b2edfcc5e512ce326aa704989ff7a\",\"license\":\"MIT\"},\"src/interfaces/bridge/events/IBridgeManagerEvents.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeManagerEvents {\\n /**\\n * @dev Emitted when new bridge operators are added.\\n */\\n event BridgeOperatorsAdded(bool[] statuses, uint96[] voteWeights, address[] governors, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is failed to add.\\n */\\n event BridgeOperatorAddingFailed(address indexed operator);\\n\\n /**\\n * @dev Emitted when bridge operators are removed.\\n */\\n event BridgeOperatorsRemoved(bool[] statuses, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is failed to remove.\\n */\\n event BridgeOperatorRemovingFailed(address indexed operator);\\n\\n /**\\n * @dev Emitted when a bridge operator is updated.\\n */\\n event BridgeOperatorUpdated(address indexed governor, address indexed fromBridgeOperator, address indexed toBridgeOperator);\\n\\n /**\\n * @dev Emitted when the minimum number of required governors is updated.\\n */\\n event MinRequiredGovernorUpdated(uint min);\\n}\\n\",\"keccak256\":\"0x38bc3709c98a7c08fb9b6fa3e07a725903dcb0bd07de8a828bac6c3bcf7d997d\",\"license\":\"MIT\"},\"src/interfaces/collections/IHasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport { ContractType } from \\\"../../utils/ContractType.sol\\\";\\n\\ninterface IHasContracts {\\n /// @dev Error of invalid role.\\n error ErrContractTypeNotFound(ContractType contractType);\\n\\n /// @dev Emitted when a contract is updated.\\n event ContractUpdated(ContractType indexed contractType, address indexed addr);\\n\\n /**\\n * @dev Returns the address of a contract with a specific role.\\n * Throws an error if no contract is set for the specified role.\\n *\\n * @param contractType The role of the contract to retrieve.\\n * @return contract_ The address of the contract with the specified role.\\n */\\n function getContract(ContractType contractType) external view returns (address contract_);\\n\\n /**\\n * @dev Sets the address of a contract with a specific role.\\n * Emits the event {ContractUpdated}.\\n * @param contractType The role of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function setContract(ContractType contractType, address addr) external;\\n}\\n\",\"keccak256\":\"0x99d8213d857e30d367155abd15dc42730afdfbbac3a22dfb3b95ffea2083a92e\",\"license\":\"MIT\"},\"src/interfaces/consumers/MappedTokenConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../libraries/LibTokenInfo.sol\\\";\\n\\ninterface MappedTokenConsumer {\\n struct MappedToken {\\n TokenStandard erc;\\n address tokenAddr;\\n }\\n}\\n\",\"keccak256\":\"0xc53dcba9dc7d950ab6561149f76b45617ddbce5037e4c86ea00b976018bbfde1\",\"license\":\"MIT\"},\"src/interfaces/consumers/VoteStatusConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface VoteStatusConsumer {\\n enum VoteStatus {\\n Pending,\\n Approved,\\n Executed,\\n Rejected,\\n Expired\\n }\\n}\\n\",\"keccak256\":\"0xa5045232c0c053fcf31fb3fe71942344444159c48d5f1b2063dbb06b6a1c9752\",\"license\":\"MIT\"},\"src/interfaces/validator/ICandidateManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface ICandidateManager {\\n struct ValidatorCandidate {\\n // Admin of the candidate\\n address admin;\\n // Address of the validator that produces block, e.g. block.coinbase. This is so-called validator address.\\n address consensusAddr;\\n // Address that receives mining reward of the validator\\n address payable treasuryAddr;\\n // Address of the bridge operator corresponding to the candidate\\n address ______deprecatedbridgeOperatorAddr;\\n // The percentage of reward that validators can be received, the rest goes to the delegators.\\n // Values in range [0; 100_00] stands for 0-100%\\n uint256 commissionRate;\\n // The timestamp that scheduled to revoke the candidate (no schedule=0)\\n uint256 revokingTimestamp;\\n // The deadline that the candidate must top up staking amount to keep it larger than or equal to the threshold (no deadline=0)\\n uint256 topupDeadline;\\n }\\n\\n struct CommissionSchedule {\\n // The timestamp that the commission schedule gets affected (no schedule=0).\\n uint256 effectiveTimestamp;\\n // The new commission rate. Value is in range [0; 100_00], stands for 0-100%\\n uint256 commissionRate;\\n }\\n\\n /// @dev Emitted when the maximum number of validator candidates is updated.\\n event MaxValidatorCandidateUpdated(uint256 threshold);\\n /// @dev Emitted when the min offset to the effective date of commission rate change is updated.\\n event MinEffectiveDaysOnwardsUpdated(uint256 numOfDays);\\n /// @dev Emitted when the validator candidate is granted.\\n event CandidateGranted(address indexed consensusAddr, address indexed treasuryAddr, address indexed admin);\\n /// @dev Emitted when the revoking timestamp of a candidate is updated.\\n event CandidateRevokingTimestampUpdated(address indexed consensusAddr, uint256 revokingTimestamp);\\n /// @dev Emitted when the topup deadline of a candidate is updated.\\n event CandidateTopupDeadlineUpdated(address indexed consensusAddr, uint256 topupDeadline);\\n /// @dev Emitted when the validator candidate is revoked.\\n event CandidatesRevoked(address[] consensusAddrs);\\n\\n /// @dev Emitted when a schedule for updating commission rate is set.\\n event CommissionRateUpdateScheduled(address indexed consensusAddr, uint256 effectiveTimestamp, uint256 rate);\\n /// @dev Emitted when the commission rate of a validator is updated.\\n event CommissionRateUpdated(address indexed consensusAddr, uint256 rate);\\n\\n /// @dev Error of exceeding maximum number of candidates.\\n error ErrExceedsMaxNumberOfCandidate();\\n /// @dev Error of querying for already existent candidate.\\n error ErrExistentCandidate();\\n /// @dev Error of querying for non-existent candidate.\\n error ErrNonExistentCandidate();\\n /// @dev Error of candidate admin already exists.\\n error ErrExistentCandidateAdmin(address _candidateAdminAddr);\\n /// @dev Error of treasury already exists.\\n error ErrExistentTreasury(address _treasuryAddr);\\n /// @dev Error of invalid commission rate.\\n error ErrInvalidCommissionRate();\\n /// @dev Error of invalid effective days onwards.\\n error ErrInvalidEffectiveDaysOnwards();\\n /// @dev Error of invalid min effective days onwards.\\n error ErrInvalidMinEffectiveDaysOnwards();\\n /// @dev Error of already requested revoking candidate before.\\n error ErrAlreadyRequestedRevokingCandidate();\\n /// @dev Error of commission change schedule exists.\\n error ErrAlreadyRequestedUpdatingCommissionRate();\\n /// @dev Error of trusted org cannot renounce.\\n error ErrTrustedOrgCannotRenounce();\\n\\n /**\\n * @dev Returns the maximum number of validator candidate.\\n */\\n function maxValidatorCandidate() external view returns (uint256);\\n\\n /**\\n * @dev Returns the minimum number of days to the effective date of commission rate change.\\n */\\n function minEffectiveDaysOnward() external view returns (uint256);\\n\\n /**\\n * @dev Sets the maximum number of validator candidate.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `MaxValidatorCandidateUpdated` event.\\n *\\n */\\n function setMaxValidatorCandidate(uint256) external;\\n\\n /**\\n * @dev Sets the minimum number of days to the effective date of commision rate change.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `MinEffectiveDaysOnwardsUpdated` event.\\n *\\n */\\n function setMinEffectiveDaysOnwards(uint256 _numOfDays) external;\\n\\n /**\\n * @dev Grants a validator candidate.\\n *\\n * Requirements:\\n * - The method caller is staking contract.\\n *\\n * Emits the event `CandidateGranted`.\\n *\\n */\\n function execApplyValidatorCandidate(address _admin, address _consensusAddr, address payable _treasuryAddr, uint256 _commissionRate) external;\\n\\n /**\\n * @dev Requests to revoke a validator candidate in next `_secsLeft` seconds.\\n *\\n * Requirements:\\n * - The method caller is staking contract.\\n *\\n * Emits the event `CandidateRevokingTimestampUpdated`.\\n *\\n */\\n function execRequestRenounceCandidate(address, uint256 _secsLeft) external;\\n\\n /**\\n * @dev Fallback function of `CandidateStaking-requestUpdateCommissionRate`.\\n *\\n * Requirements:\\n * - The method caller is the staking contract.\\n * - The `_effectiveTimestamp` must be the beginning of a UTC day, and at least from 7 days onwards\\n * - The `_rate` must be in range of [0_00; 100_00].\\n *\\n * Emits the event `CommissionRateUpdateScheduled`.\\n *\\n */\\n function execRequestUpdateCommissionRate(address _consensusAddr, uint256 _effectiveTimestamp, uint256 _rate) external;\\n\\n /**\\n * @dev Returns whether the address is a validator (candidate).\\n */\\n function isValidatorCandidate(address _addr) external view returns (bool);\\n\\n /**\\n * @dev Returns the validator candidate.\\n */\\n function getValidatorCandidates() external view returns (address[] memory);\\n\\n /**\\n * @dev Returns all candidate info.\\n */\\n function getCandidateInfos() external view returns (ValidatorCandidate[] memory);\\n\\n /**\\n * @dev Returns the info of a candidate.\\n */\\n function getCandidateInfo(address _candidate) external view returns (ValidatorCandidate memory);\\n\\n /**\\n * @dev Returns whether the address is the candidate admin.\\n */\\n function isCandidateAdmin(address _candidate, address _admin) external view returns (bool);\\n\\n /**\\n * @dev Returns the schedule of changing commission rate of a candidate address.\\n */\\n function getCommissionChangeSchedule(address _candidate) external view returns (CommissionSchedule memory);\\n}\\n\",\"keccak256\":\"0x37b15d36774a3f18291e85efa9df6caaf52b8fa751a8222a3ac8f467656950c1\",\"license\":\"MIT\"},\"src/interfaces/validator/ICoinbaseExecution.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"./ISlashingExecution.sol\\\";\\n\\ninterface ICoinbaseExecution is ISlashingExecution {\\n enum BlockRewardDeprecatedType {\\n UNKNOWN,\\n UNAVAILABILITY,\\n AFTER_BAILOUT\\n }\\n\\n /// @dev Emitted when the validator set is updated\\n event ValidatorSetUpdated(uint256 indexed period, address[] consensusAddrs);\\n /// @dev Emitted when the bridge operator set is updated, to mirror the in-jail and maintaining status of the validator.\\n event BlockProducerSetUpdated(uint256 indexed period, uint256 indexed epoch, address[] consensusAddrs);\\n /// @dev Emitted when the bridge operator set is updated.\\n event BridgeOperatorSetUpdated(uint256 indexed period, uint256 indexed epoch, address[] bridgeOperators);\\n\\n /// @dev Emitted when the reward of the block producer is deprecated.\\n event BlockRewardDeprecated(address indexed coinbaseAddr, uint256 rewardAmount, BlockRewardDeprecatedType deprecatedType);\\n /// @dev Emitted when the block reward is submitted.\\n event BlockRewardSubmitted(address indexed coinbaseAddr, uint256 submittedAmount, uint256 bonusAmount);\\n\\n /// @dev Emitted when the block producer reward is distributed.\\n event MiningRewardDistributed(address indexed consensusAddr, address indexed recipient, uint256 amount);\\n /// @dev Emitted when the contract fails when distributing the block producer reward.\\n event MiningRewardDistributionFailed(address indexed consensusAddr, address indexed recipient, uint256 amount, uint256 contractBalance);\\n\\n /// @dev Emitted when the bridge operator reward is distributed.\\n event BridgeOperatorRewardDistributed(address indexed consensusAddr, address indexed bridgeOperator, address indexed recipientAddr, uint256 amount);\\n /// @dev Emitted when the contract fails when distributing the bridge operator reward.\\n event BridgeOperatorRewardDistributionFailed(\\n address indexed consensusAddr, address indexed bridgeOperator, address indexed recipient, uint256 amount, uint256 contractBalance\\n );\\n\\n /// @dev Emitted when the fast finality reward is distributed.\\n event FastFinalityRewardDistributed(address indexed consensusAddr, address indexed recipient, uint256 amount);\\n /// @dev Emitted when the contract fails when distributing the fast finality reward.\\n event FastFinalityRewardDistributionFailed(address indexed consensusAddr, address indexed recipient, uint256 amount, uint256 contractBalance);\\n\\n /// @dev Emitted when the amount of RON reward is distributed to staking contract.\\n event StakingRewardDistributed(uint256 totalAmount, address[] consensusAddrs, uint256[] amounts);\\n /// @dev Emitted when the contracts fails when distributing the amount of RON to the staking contract.\\n event StakingRewardDistributionFailed(uint256 totalAmount, address[] consensusAddrs, uint256[] amounts, uint256 contractBalance);\\n\\n /// @dev Emitted when the epoch is wrapped up.\\n event WrappedUpEpoch(uint256 indexed periodNumber, uint256 indexed epochNumber, bool periodEnding);\\n\\n /// @dev Error of only allowed at the end of epoch\\n error ErrAtEndOfEpochOnly();\\n /// @dev Error of query for already wrapped up epoch\\n error ErrAlreadyWrappedEpoch();\\n\\n /**\\n * @dev Submits reward of the current block.\\n *\\n * Requirements:\\n * - The method caller is coinbase.\\n *\\n * Emits the event `MiningRewardDeprecated` if the coinbase is slashed or no longer be a block producer.\\n * Emits the event `BlockRewardSubmitted` for the valid call.\\n *\\n */\\n function submitBlockReward() external payable;\\n\\n /**\\n * @dev Wraps up the current epoch.\\n *\\n * Requirements:\\n * - The method must be called when the current epoch is ending.\\n * - The epoch is not wrapped yet.\\n * - The method caller is coinbase.\\n *\\n * Emits the event `MiningRewardDistributed` when some validator has reward distributed.\\n * Emits the event `StakingRewardDistributed` when some staking pool has reward distributed.\\n * Emits the event `BlockProducerSetUpdated` when the epoch is wrapped up.\\n * Emits the event `BridgeOperatorSetUpdated` when the epoch is wrapped up at period ending.\\n * Emits the event `ValidatorSetUpdated` when the epoch is wrapped up at period ending, and the validator set gets updated.\\n * Emits the event `WrappedUpEpoch`.\\n *\\n */\\n function wrapUpEpoch() external payable;\\n}\\n\",\"keccak256\":\"0x3030ef01bb0277f8607fb3b6358a4cd1d75f6a756e5c884153fbf94f0a16b4d4\",\"license\":\"MIT\"},\"src/interfaces/validator/IEmergencyExit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface IEmergencyExit {\\n /// @dev Emitted when the fund is locked from an emergency exit request\\n event EmergencyExitRequested(address indexed consensusAddr, uint256 lockedAmount);\\n /// @dev Emitted when the fund that locked from an emergency exit request is transferred to the recipient.\\n event EmergencyExitLockedFundReleased(address indexed consensusAddr, address indexed recipient, uint256 unlockedAmount);\\n /// @dev Emitted when the fund that locked from an emergency exit request is failed to transferred back.\\n event EmergencyExitLockedFundReleasingFailed(address indexed consensusAddr, address indexed recipient, uint256 unlockedAmount, uint256 contractBalance);\\n\\n /// @dev Emitted when the emergency exit locked amount is updated.\\n event EmergencyExitLockedAmountUpdated(uint256 amount);\\n /// @dev Emitted when the emergency expiry duration is updated.\\n event EmergencyExpiryDurationUpdated(uint256 amount);\\n\\n /// @dev Error of already requested emergency exit before.\\n error ErrAlreadyRequestedEmergencyExit();\\n\\n /**\\n * @dev Returns the amount of RON to lock from a consensus address.\\n */\\n function emergencyExitLockedAmount() external returns (uint256);\\n\\n /**\\n * @dev Returns the duration that an emergency request is expired and the fund will be recycled.\\n */\\n function emergencyExpiryDuration() external returns (uint256);\\n\\n /**\\n * @dev Sets the amount of RON to lock from a consensus address.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the event `EmergencyExitLockedAmountUpdated`.\\n *\\n */\\n function setEmergencyExitLockedAmount(uint256 _emergencyExitLockedAmount) external;\\n\\n /**\\n * @dev Sets the duration that an emergency request is expired and the fund will be recycled.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the event `EmergencyExpiryDurationUpdated`.\\n *\\n */\\n function setEmergencyExpiryDuration(uint256 _emergencyExpiryDuration) external;\\n\\n /**\\n * @dev Unlocks fund for emergency exit request.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the event `EmergencyExitLockedFundReleased` if the fund is successfully unlocked.\\n * Emits the event `EmergencyExitLockedFundReleasingFailed` if the fund is failed to unlock.\\n *\\n */\\n function execReleaseLockedFundForEmergencyExitRequest(address _consensusAddr, address payable _recipient) external;\\n\\n /**\\n * @dev Fallback function of `IStaking-requestEmergencyExit`.\\n *\\n * Requirements:\\n * - The method caller is staking contract.\\n *\\n */\\n function execEmergencyExit(address _consensusAddr, uint256 _secLeftToRevoke) external;\\n}\\n\",\"keccak256\":\"0x2df640817e7fb957f923dd583e82be9610a8441735b69519db5bd9457683bec2\",\"license\":\"MIT\"},\"src/interfaces/validator/IRoninValidatorSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"./ICandidateManager.sol\\\";\\nimport \\\"./info-fragments/ICommonInfo.sol\\\";\\nimport \\\"./ICoinbaseExecution.sol\\\";\\nimport \\\"./ISlashingExecution.sol\\\";\\nimport \\\"./IEmergencyExit.sol\\\";\\n\\ninterface IRoninValidatorSet is ICandidateManager, ICommonInfo, ISlashingExecution, ICoinbaseExecution, IEmergencyExit { }\\n\",\"keccak256\":\"0x5ae53ab78a38d9c59d74b4723ead82146bc402874ebbdc90b70ce084516e010f\",\"license\":\"MIT\"},\"src/interfaces/validator/ISlashingExecution.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface ISlashingExecution {\\n /// @dev Emitted when the validator is punished.\\n event ValidatorPunished(\\n address indexed consensusAddr,\\n uint256 indexed period,\\n uint256 jailedUntil,\\n uint256 deductedStakingAmount,\\n bool blockProducerRewardDeprecated,\\n bool bridgeOperatorRewardDeprecated\\n );\\n /// @dev Emitted when the validator get out of jail by bailout.\\n event ValidatorUnjailed(address indexed validator, uint256 period);\\n\\n /// @dev Error of cannot bailout due to high tier slash.\\n error ErrCannotBailout(address validator);\\n\\n /**\\n * @dev Finalize the slash request from slash indicator contract.\\n *\\n * Requirements:\\n * - The method caller is slash indicator contract.\\n *\\n * Emits the event `ValidatorPunished`.\\n *\\n */\\n function execSlash(address validatorAddr, uint256 newJailedUntil, uint256 slashAmount, bool cannotBailout) external;\\n\\n /**\\n * @dev Finalize the bailout request from slash indicator contract.\\n *\\n * Requirements:\\n * - The method caller is slash indicator contract.\\n *\\n * Emits the event `ValidatorUnjailed`.\\n *\\n */\\n function execBailOut(address _validatorAddr, uint256 _period) external;\\n}\\n\",\"keccak256\":\"0xac0b772f2fca9dafd7cc6742f91b442f9f545bf9472185b8d817fe045b680193\",\"license\":\"MIT\"},\"src/interfaces/validator/info-fragments/ICommonInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"./IJailingInfo.sol\\\";\\nimport \\\"./ITimingInfo.sol\\\";\\n\\ninterface ICommonInfo is ITimingInfo, IJailingInfo {\\n struct EmergencyExitInfo {\\n uint256 lockedAmount;\\n // The timestamp that this locked amount will be recycled to staking vesting contract\\n uint256 recyclingAt;\\n }\\n\\n /// @dev Emitted when the deprecated reward is withdrawn.\\n event DeprecatedRewardRecycled(address indexed recipientAddr, uint256 amount);\\n /// @dev Emitted when the deprecated reward withdrawal is failed\\n event DeprecatedRewardRecycleFailed(address indexed recipientAddr, uint256 amount, uint256 balance);\\n\\n /// @dev Error thrown when receives RON from neither staking vesting contract nor staking contract\\n error ErrUnauthorizedReceiveRON();\\n /// @dev Error thrown when queries for a non existent info.\\n error NonExistentRecyclingInfo();\\n\\n /**\\n * @dev Returns the total deprecated reward, which includes reward that is not sent for slashed validators and unsastified bridge operators\\n */\\n function totalDeprecatedReward() external view returns (uint256);\\n\\n /**\\n * @dev Returns the emergency exit request.\\n */\\n function getEmergencyExitInfo(address _consensusAddr) external view returns (EmergencyExitInfo memory);\\n}\\n\",\"keccak256\":\"0x4a215273f535697ecf54a97c8fd9de9c666ca64b88dafe7ab60b2903f71ffb41\",\"license\":\"MIT\"},\"src/interfaces/validator/info-fragments/IJailingInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface IJailingInfo {\\n /**\\n * @dev Returns whether the validator are put in jail (cannot join the set of validators) during the current period.\\n */\\n function checkJailed(address) external view returns (bool);\\n\\n /**\\n * @dev Returns whether the validator are put in jail and the number of block and epoch that he still is in the jail.\\n */\\n function getJailedTimeLeft(address _addr) external view returns (bool isJailed_, uint256 blockLeft_, uint256 epochLeft_);\\n\\n /**\\n * @dev Returns whether the validator are put in jail (cannot join the set of validators) at a specific block.\\n */\\n function checkJailedAtBlock(address _addr, uint256 _blockNum) external view returns (bool);\\n\\n /**\\n * @dev Returns whether the validator are put in jail at a specific block and the number of block and epoch that he still is in the jail.\\n */\\n function getJailedTimeLeftAtBlock(address _addr, uint256 _blockNum) external view returns (bool isJailed_, uint256 blockLeft_, uint256 epochLeft_);\\n\\n /**\\n * @dev Returns whether the validators are put in jail (cannot join the set of validators) during the current period.\\n */\\n function checkManyJailed(address[] calldata) external view returns (bool[] memory);\\n\\n /**\\n * @dev Returns whether the incoming reward of the block producer is deprecated during the current period.\\n */\\n function checkMiningRewardDeprecated(address _blockProducer) external view returns (bool);\\n\\n /**\\n * @dev Returns whether the incoming reward of the block producer is deprecated during a specific period.\\n */\\n function checkMiningRewardDeprecatedAtPeriod(address _blockProducer, uint256 _period) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xd83e85bea11509406213b8d06956b33238d27fa1b5e555c1f064bdfd41d6d216\",\"license\":\"MIT\"},\"src/interfaces/validator/info-fragments/ITimingInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\ninterface ITimingInfo {\\n /**\\n * @dev Returns the block that validator set was updated.\\n */\\n function getLastUpdatedBlock() external view returns (uint256);\\n\\n /**\\n * @dev Returns the number of blocks in a epoch.\\n */\\n function numberOfBlocksInEpoch() external view returns (uint256 _numberOfBlocks);\\n\\n /**\\n * @dev Returns the epoch index from the block number.\\n */\\n function epochOf(uint256 _block) external view returns (uint256);\\n\\n /**\\n * @dev Returns whether the epoch ending is at the block number `_block`.\\n */\\n function epochEndingAt(uint256 _block) external view returns (bool);\\n\\n /**\\n * @dev Tries to get the period index from the epoch number.\\n */\\n function tryGetPeriodOfEpoch(uint256 _epoch) external view returns (bool _filled, uint256 _periodNumber);\\n\\n /**\\n * @dev Returns whether the period ending at the current block number.\\n */\\n function isPeriodEnding() external view returns (bool);\\n\\n /**\\n * @dev Returns the period index from the current block.\\n */\\n function currentPeriod() external view returns (uint256);\\n\\n /**\\n * @dev Returns the block number that the current period starts at.\\n */\\n function currentPeriodStartAtBlock() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x77b86a68149389fed0eb0c5b8d56f278d3bd103ba64f504697d709b24c3212d5\",\"license\":\"MIT\"},\"src/libraries/AddressArrayUtils.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\nlibrary AddressArrayUtils {\\n /**\\n * @dev Error thrown when a duplicated element is detected in an array.\\n * @param msgSig The function signature that invoke the error.\\n */\\n error ErrDuplicated(bytes4 msgSig);\\n\\n /**\\n * @dev Returns whether or not there's a duplicate. Runs in O(n^2).\\n * @param A Array to search\\n * @return Returns true if duplicate, false otherwise\\n */\\n function hasDuplicate(address[] memory A) internal pure returns (bool) {\\n if (A.length == 0) {\\n return false;\\n }\\n unchecked {\\n for (uint256 i = 0; i < A.length - 1; i++) {\\n for (uint256 j = i + 1; j < A.length; j++) {\\n if (A[i] == A[j]) {\\n return true;\\n }\\n }\\n }\\n }\\n return false;\\n }\\n\\n /**\\n * @dev Returns whether two arrays of addresses are equal or not.\\n */\\n function isEqual(address[] memory _this, address[] memory _other) internal pure returns (bool yes_) {\\n // Hashing two arrays and compare their hash\\n assembly {\\n let _thisHash := keccak256(add(_this, 32), mul(mload(_this), 32))\\n let _otherHash := keccak256(add(_other, 32), mul(mload(_other), 32))\\n yes_ := eq(_thisHash, _otherHash)\\n }\\n }\\n\\n /**\\n * @dev Return the concatenated array from a and b.\\n */\\n function extend(address[] memory a, address[] memory b) internal pure returns (address[] memory c) {\\n uint256 lengthA = a.length;\\n uint256 lengthB = b.length;\\n unchecked {\\n c = new address[](lengthA + lengthB);\\n }\\n uint256 i;\\n for (; i < lengthA;) {\\n c[i] = a[i];\\n unchecked {\\n ++i;\\n }\\n }\\n for (uint256 j; j < lengthB;) {\\n c[i] = b[j];\\n unchecked {\\n ++i;\\n ++j;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce5d578861167da47a965c8a0e1592b808aad6eb79ccb1873bf2e2280ddb85ee\",\"license\":\"UNLICENSED\"},\"src/libraries/IsolatedGovernance.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../interfaces/consumers/VoteStatusConsumer.sol\\\";\\nimport \\\"../utils/CommonErrors.sol\\\";\\n\\nlibrary IsolatedGovernance {\\n struct Vote {\\n VoteStatusConsumer.VoteStatus status;\\n bytes32 finalHash;\\n /// @dev Mapping from voter => receipt hash\\n mapping(address => bytes32) voteHashOf;\\n /// @dev The timestamp that voting is expired (no expiration=0)\\n uint256 expiredAt;\\n /// @dev The timestamp that voting is created\\n uint256 createdAt;\\n /// @dev The list of voters\\n address[] voters;\\n }\\n\\n /**\\n * @dev Casts vote for the receipt with the receipt hash `_hash`.\\n *\\n * Requirements:\\n * - The voter has not voted for the round.\\n *\\n */\\n function castVote(Vote storage _v, address _voter, bytes32 _hash) internal {\\n if (_v.expiredAt > 0 && _v.expiredAt <= block.timestamp) {\\n _v.status = VoteStatusConsumer.VoteStatus.Expired;\\n }\\n\\n if (voted(_v, _voter)) revert ErrAlreadyVoted(_voter);\\n\\n _v.voteHashOf[_voter] = _hash;\\n _v.voters.push(_voter);\\n }\\n\\n /**\\n * @dev Updates vote with the requirement of minimum vote weight.\\n */\\n function syncVoteStatus(\\n Vote storage _v,\\n uint256 _minimumVoteWeight,\\n uint256 _votedWeightForHash,\\n bytes32 _hash\\n ) internal returns (VoteStatusConsumer.VoteStatus _status) {\\n if (_votedWeightForHash >= _minimumVoteWeight && _v.status == VoteStatusConsumer.VoteStatus.Pending) {\\n _v.status = VoteStatusConsumer.VoteStatus.Approved;\\n _v.finalHash = _hash;\\n }\\n\\n return _v.status;\\n }\\n\\n /**\\n * @dev Returns the list of vote's addresses that voted for the hash `_hash`.\\n */\\n function filterByHash(Vote storage _v, bytes32 _hash) internal view returns (address[] memory _voters) {\\n uint256 _count;\\n _voters = new address[](_v.voters.length);\\n\\n unchecked {\\n for (uint _i; _i < _voters.length; ++_i) {\\n address _voter = _v.voters[_i];\\n if (_v.voteHashOf[_voter] == _hash) {\\n _voters[_count++] = _voter;\\n }\\n }\\n }\\n\\n assembly {\\n mstore(_voters, _count)\\n }\\n }\\n\\n /**\\n * @dev Returns whether the voter casted for the proposal.\\n */\\n function voted(Vote storage _v, address _voter) internal view returns (bool) {\\n return _v.voteHashOf[_voter] != bytes32(0);\\n }\\n}\\n\",\"keccak256\":\"0xa6a1e04b914580c099ac87f65ec24c35445eee34809e3decf1c57b6c52942d36\",\"license\":\"MIT\"},\"src/libraries/LibTokenInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/IERC721.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC1155/presets/ERC1155PresetMinterPauser.sol\\\";\\nimport \\\"../interfaces/IWETH.sol\\\";\\n\\nenum TokenStandard {\\n ERC20,\\n ERC721,\\n ERC1155\\n}\\n\\nstruct TokenInfo {\\n TokenStandard erc;\\n // For ERC20: the id must be 0 and the quantity is larger than 0.\\n // For ERC721: the quantity must be 0.\\n uint256 id;\\n uint256 quantity;\\n}\\n\\n/**\\n * @dev Error indicating that the `transfer` has failed.\\n * @param tokenInfo Info of the token including ERC standard, id or quantity.\\n * @param to Receiver of the token value.\\n * @param token Address of the token.\\n */\\nerror ErrTokenCouldNotTransfer(TokenInfo tokenInfo, address to, address token);\\n\\n/**\\n * @dev Error indicating that the `handleAssetIn` has failed.\\n * @param tokenInfo Info of the token including ERC standard, id or quantity.\\n * @param from Owner of the token value.\\n * @param to Receiver of the token value.\\n * @param token Address of the token.\\n */\\nerror ErrTokenCouldNotTransferFrom(TokenInfo tokenInfo, address from, address to, address token);\\n\\n/// @dev Error indicating that the provided information is invalid.\\nerror ErrInvalidInfo();\\n\\n/// @dev Error indicating that the minting of ERC20 tokens has failed.\\nerror ErrERC20MintingFailed();\\n\\n/// @dev Error indicating that the minting of ERC721 tokens has failed.\\nerror ErrERC721MintingFailed();\\n\\n/// @dev Error indicating that the transfer of ERC1155 tokens has failed.\\nerror ErrERC1155TransferFailed();\\n\\n/// @dev Error indicating that the mint of ERC1155 tokens has failed.\\nerror ErrERC1155MintingFailed();\\n\\n/// @dev Error indicating that an unsupported standard is encountered.\\nerror ErrUnsupportedStandard();\\n\\nlibrary LibTokenInfo {\\n /**\\n *\\n * HASH\\n *\\n */\\n\\n // keccak256(\\\"TokenInfo(uint8 erc,uint256 id,uint256 quantity)\\\");\\n bytes32 public constant INFO_TYPE_HASH_SINGLE = 0x1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d;\\n\\n /**\\n * @dev Returns token info struct hash.\\n */\\n function hash(TokenInfo memory self) internal pure returns (bytes32 digest) {\\n // keccak256(abi.encode(INFO_TYPE_HASH_SINGLE, info.erc, info.id, info.quantity))\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n mstore(ptr, INFO_TYPE_HASH_SINGLE)\\n mstore(add(ptr, 0x20), mload(self)) // info.erc\\n mstore(add(ptr, 0x40), mload(add(self, 0x20))) // info.id\\n mstore(add(ptr, 0x60), mload(add(self, 0x40))) // info.quantity\\n digest := keccak256(ptr, 0x80)\\n }\\n }\\n\\n /**\\n *\\n * VALIDATE\\n *\\n */\\n\\n /**\\n * @dev Validates the token info.\\n */\\n function validate(TokenInfo memory self) internal pure {\\n if (!(_checkERC20(self) || _checkERC721(self) || _checkERC1155(self))) {\\n revert ErrInvalidInfo();\\n }\\n }\\n\\n function _checkERC20(TokenInfo memory self) private pure returns (bool) {\\n return (self.erc == TokenStandard.ERC20 && self.quantity > 0 && self.id == 0);\\n }\\n\\n function _checkERC721(TokenInfo memory self) private pure returns (bool) {\\n return (self.erc == TokenStandard.ERC721 && self.quantity == 0);\\n }\\n\\n function _checkERC1155(TokenInfo memory self) private pure returns (bool res) {\\n // Only validate the quantity, because id of ERC-1155 can be 0.\\n return (self.erc == TokenStandard.ERC1155 && self.quantity > 0);\\n }\\n\\n /**\\n *\\n * TRANSFER IN/OUT METHOD\\n *\\n */\\n\\n /**\\n * @dev Transfer asset in.\\n *\\n * Requirements:\\n * - The `_from` address must approve for the contract using this library.\\n *\\n */\\n function handleAssetIn(TokenInfo memory self, address from, address token) internal {\\n bool success;\\n bytes memory data;\\n if (self.erc == TokenStandard.ERC20) {\\n (success, data) = token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, address(this), self.quantity));\\n success = success && (data.length == 0 || abi.decode(data, (bool)));\\n } else if (self.erc == TokenStandard.ERC721) {\\n success = _tryTransferFromERC721(token, from, address(this), self.id);\\n } else if (self.erc == TokenStandard.ERC1155) {\\n success = _tryTransferFromERC1155(token, from, address(this), self.id, self.quantity);\\n } else {\\n revert ErrUnsupportedStandard();\\n }\\n\\n if (!success) revert ErrTokenCouldNotTransferFrom(self, from, address(this), token);\\n }\\n\\n /**\\n * @dev Tries transfer assets out, or mint the assets if cannot transfer.\\n *\\n * @notice Prioritizes transfer native token if the token is wrapped.\\n *\\n */\\n function handleAssetOut(TokenInfo memory self, address payable to, address token, IWETH wrappedNativeToken) internal {\\n if (token == address(wrappedNativeToken)) {\\n // Try sending the native token before transferring the wrapped token\\n if (!to.send(self.quantity)) {\\n wrappedNativeToken.deposit{ value: self.quantity }();\\n _transferTokenOut(self, to, token);\\n }\\n\\n return;\\n }\\n\\n if (self.erc == TokenStandard.ERC20) {\\n uint256 balance = IERC20(token).balanceOf(address(this));\\n if (balance < self.quantity) {\\n if (!_tryMintERC20(token, address(this), self.quantity - balance)) revert ErrERC20MintingFailed();\\n }\\n\\n _transferTokenOut(self, to, token);\\n return;\\n }\\n\\n if (self.erc == TokenStandard.ERC721) {\\n if (!_tryTransferOutOrMintERC721(token, to, self.id)) {\\n revert ErrERC721MintingFailed();\\n }\\n return;\\n }\\n\\n if (self.erc == TokenStandard.ERC1155) {\\n if (!_tryTransferOutOrMintERC1155(token, to, self.id, self.quantity)) {\\n revert ErrERC1155MintingFailed();\\n }\\n return;\\n }\\n\\n revert ErrUnsupportedStandard();\\n }\\n\\n /**\\n *\\n * TRANSFER HELPERS\\n *\\n */\\n\\n /**\\n * @dev Transfer assets from current address to `_to` address.\\n */\\n function _transferTokenOut(TokenInfo memory self, address to, address token) private {\\n bool success;\\n if (self.erc == TokenStandard.ERC20) {\\n success = _tryTransferERC20(token, to, self.quantity);\\n } else if (self.erc == TokenStandard.ERC721) {\\n success = _tryTransferFromERC721(token, address(this), to, self.id);\\n } else {\\n revert ErrUnsupportedStandard();\\n }\\n\\n if (!success) revert ErrTokenCouldNotTransfer(self, to, token);\\n }\\n\\n /**\\n * TRANSFER ERC-20\\n */\\n\\n /**\\n * @dev Transfers ERC20 token and returns the result.\\n */\\n function _tryTransferERC20(address token, address to, uint256 quantity) private returns (bool success) {\\n bytes memory data;\\n (success, data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, quantity));\\n success = success && (data.length == 0 || abi.decode(data, (bool)));\\n }\\n\\n /**\\n * @dev Mints ERC20 token and returns the result.\\n */\\n function _tryMintERC20(address token, address to, uint256 quantity) private returns (bool success) {\\n // bytes4(keccak256(\\\"mint(address,uint256)\\\"))\\n (success,) = token.call(abi.encodeWithSelector(0x40c10f19, to, quantity));\\n }\\n\\n /**\\n * TRANSFER ERC-721\\n */\\n\\n /**\\n * @dev Transfers the ERC721 token out. If the transfer failed, mints the ERC721.\\n * @return success Returns `false` if both transfer and mint are failed.\\n */\\n function _tryTransferOutOrMintERC721(address token, address to, uint256 id) private returns (bool success) {\\n success = _tryTransferFromERC721(token, address(this), to, id);\\n if (!success) {\\n return _tryMintERC721(token, to, id);\\n }\\n }\\n\\n /**\\n * @dev Transfers ERC721 token and returns the result.\\n */\\n function _tryTransferFromERC721(address token, address from, address to, uint256 id) private returns (bool success) {\\n (success,) = token.call(abi.encodeWithSelector(IERC721.transferFrom.selector, from, to, id));\\n }\\n\\n /**\\n * @dev Mints ERC721 token and returns the result.\\n */\\n function _tryMintERC721(address token, address to, uint256 id) private returns (bool success) {\\n // bytes4(keccak256(\\\"mint(address,uint256)\\\"))\\n (success,) = token.call(abi.encodeWithSelector(0x40c10f19, to, id));\\n }\\n\\n /**\\n * TRANSFER ERC-1155\\n */\\n\\n /**\\n * @dev Transfers the ERC1155 token out. If the transfer failed, mints the ERC11555.\\n * @return success Returns `false` if both transfer and mint are failed.\\n */\\n function _tryTransferOutOrMintERC1155(address token, address to, uint256 id, uint256 amount) private returns (bool success) {\\n success = _tryTransferFromERC1155(token, address(this), to, id, amount);\\n if (!success) {\\n return _tryMintERC1155(token, to, id, amount);\\n }\\n }\\n\\n /**\\n * @dev Transfers ERC1155 token and returns the result.\\n */\\n function _tryTransferFromERC1155(address token, address from, address to, uint256 id, uint256 amount) private returns (bool success) {\\n (success,) = token.call(abi.encodeCall(IERC1155.safeTransferFrom, (from, to, id, amount, new bytes(0))));\\n }\\n\\n /**\\n * @dev Mints ERC1155 token and returns the result.\\n */\\n function _tryMintERC1155(address token, address to, uint256 id, uint256 amount) private returns (bool success) {\\n (success,) = token.call(abi.encodeCall(ERC1155PresetMinterPauser.mint, (to, id, amount, new bytes(0))));\\n }\\n}\\n\",\"keccak256\":\"0x56b413a42c6c39a51dc1737e735d1623b89ecdf00bacd960f70b3f18ccaa6de2\",\"license\":\"MIT\"},\"src/libraries/LibTokenOwner.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nstruct TokenOwner {\\n address addr;\\n address tokenAddr;\\n uint256 chainId;\\n}\\n\\nlibrary LibTokenOwner {\\n // keccak256(\\\"TokenOwner(address addr,address tokenAddr,uint256 chainId)\\\");\\n bytes32 public constant OWNER_TYPE_HASH = 0x353bdd8d69b9e3185b3972e08b03845c0c14a21a390215302776a7a34b0e8764;\\n\\n /**\\n * @dev Returns ownership struct hash.\\n */\\n function hash(TokenOwner memory owner) internal pure returns (bytes32 digest) {\\n // keccak256(abi.encode(OWNER_TYPE_HASH, owner.addr, owner.tokenAddr, owner.chainId))\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n mstore(ptr, OWNER_TYPE_HASH)\\n mstore(add(ptr, 0x20), mload(owner)) // owner.addr\\n mstore(add(ptr, 0x40), mload(add(owner, 0x20))) // owner.tokenAddr\\n mstore(add(ptr, 0x60), mload(add(owner, 0x40))) // owner.chainId\\n digest := keccak256(ptr, 0x80)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb104fd02056a3ed52bf06c202e87b748200320682871b1801985050587ec2d51\",\"license\":\"MIT\"},\"src/libraries/Transfer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./LibTokenInfo.sol\\\";\\nimport \\\"./LibTokenOwner.sol\\\";\\n\\nlibrary Transfer {\\n using ECDSA for bytes32;\\n using LibTokenOwner for TokenOwner;\\n using LibTokenInfo for TokenInfo;\\n\\n enum Kind {\\n Deposit,\\n Withdrawal\\n }\\n\\n struct Request {\\n // For deposit request: Recipient address on Ronin network\\n // For withdrawal request: Recipient address on mainchain network\\n address recipientAddr;\\n // Token address to deposit/withdraw\\n // Value 0: native token\\n address tokenAddr;\\n TokenInfo info;\\n }\\n\\n /**\\n * @dev Converts the transfer request into the deposit receipt.\\n */\\n function into_deposit_receipt(\\n Request memory _request,\\n address _requester,\\n uint256 _id,\\n address _roninTokenAddr,\\n uint256 _roninChainId\\n ) internal view returns (Receipt memory _receipt) {\\n _receipt.id = _id;\\n _receipt.kind = Kind.Deposit;\\n _receipt.mainchain.addr = _requester;\\n _receipt.mainchain.tokenAddr = _request.tokenAddr;\\n _receipt.mainchain.chainId = block.chainid;\\n _receipt.ronin.addr = _request.recipientAddr;\\n _receipt.ronin.tokenAddr = _roninTokenAddr;\\n _receipt.ronin.chainId = _roninChainId;\\n _receipt.info = _request.info;\\n }\\n\\n /**\\n * @dev Converts the transfer request into the withdrawal receipt.\\n */\\n function into_withdrawal_receipt(\\n Request memory _request,\\n address _requester,\\n uint256 _id,\\n address _mainchainTokenAddr,\\n uint256 _mainchainId\\n ) internal view returns (Receipt memory _receipt) {\\n _receipt.id = _id;\\n _receipt.kind = Kind.Withdrawal;\\n _receipt.ronin.addr = _requester;\\n _receipt.ronin.tokenAddr = _request.tokenAddr;\\n _receipt.ronin.chainId = block.chainid;\\n _receipt.mainchain.addr = _request.recipientAddr;\\n _receipt.mainchain.tokenAddr = _mainchainTokenAddr;\\n _receipt.mainchain.chainId = _mainchainId;\\n _receipt.info = _request.info;\\n }\\n\\n struct Receipt {\\n uint256 id;\\n Kind kind;\\n TokenOwner mainchain;\\n TokenOwner ronin;\\n TokenInfo info;\\n }\\n\\n // keccak256(\\\"Receipt(uint256 id,uint8 kind,TokenOwner mainchain,TokenOwner ronin,TokenInfo info)TokenInfo(uint8 erc,uint256 id,uint256 quantity)TokenOwner(address addr,address tokenAddr,uint256 chainId)\\\");\\n bytes32 public constant TYPE_HASH = 0xb9d1fe7c9deeec5dc90a2f47ff1684239519f2545b2228d3d91fb27df3189eea;\\n\\n /**\\n * @dev Returns token info struct hash.\\n */\\n function hash(Receipt memory _receipt) internal pure returns (bytes32 digest) {\\n bytes32 hashedReceiptMainchain = _receipt.mainchain.hash();\\n bytes32 hashedReceiptRonin = _receipt.ronin.hash();\\n bytes32 hashedReceiptInfo = _receipt.info.hash();\\n\\n /*\\n * return\\n * keccak256(\\n * abi.encode(\\n * TYPE_HASH,\\n * _receipt.id,\\n * _receipt.kind,\\n * Token.hash(_receipt.mainchain),\\n * Token.hash(_receipt.ronin),\\n * Token.hash(_receipt.info)\\n * )\\n * );\\n */\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, TYPE_HASH)\\n mstore(add(ptr, 0x20), mload(_receipt)) // _receipt.id\\n mstore(add(ptr, 0x40), mload(add(_receipt, 0x20))) // _receipt.kind\\n mstore(add(ptr, 0x60), hashedReceiptMainchain)\\n mstore(add(ptr, 0x80), hashedReceiptRonin)\\n mstore(add(ptr, 0xa0), hashedReceiptInfo)\\n digest := keccak256(ptr, 0xc0)\\n }\\n }\\n\\n /**\\n * @dev Returns the receipt digest.\\n */\\n function receiptDigest(bytes32 _domainSeparator, bytes32 _receiptHash) internal pure returns (bytes32) {\\n return _domainSeparator.toTypedDataHash(_receiptHash);\\n }\\n}\\n\",\"keccak256\":\"0x652c72f4e9aeffed1be05759c84c538a416d2c264deef9af4c53de0a1ad04ee4\",\"license\":\"MIT\"},\"src/ronin/gateway/RoninGatewayV3.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/access/AccessControlEnumerable.sol\\\";\\nimport \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol\\\";\\nimport \\\"../../extensions/GatewayV3.sol\\\";\\nimport \\\"../../extensions/collections/HasContracts.sol\\\";\\nimport \\\"../../extensions/MinimumWithdrawal.sol\\\";\\nimport \\\"../../interfaces/IERC20Mintable.sol\\\";\\nimport \\\"../../interfaces/IERC721Mintable.sol\\\";\\nimport \\\"../../interfaces/bridge/IBridgeTracking.sol\\\";\\nimport \\\"../../interfaces/IRoninGatewayV3.sol\\\";\\nimport \\\"../../interfaces/consumers/VoteStatusConsumer.sol\\\";\\nimport \\\"../../interfaces/validator/IRoninValidatorSet.sol\\\";\\nimport \\\"../../libraries/IsolatedGovernance.sol\\\";\\nimport \\\"../../interfaces/bridge/IBridgeManager.sol\\\";\\n\\ncontract RoninGatewayV3 is\\n GatewayV3,\\n Initializable,\\n MinimumWithdrawal,\\n AccessControlEnumerable,\\n ERC1155Holder,\\n VoteStatusConsumer,\\n IRoninGatewayV3,\\n HasContracts\\n{\\n using LibTokenInfo for TokenInfo;\\n using Transfer for Transfer.Request;\\n using Transfer for Transfer.Receipt;\\n using IsolatedGovernance for IsolatedGovernance.Vote;\\n\\n /// @custom:deprecated Previously `withdrawalMigrated` (non-zero value)\\n bool private ___deprecated4;\\n /// @dev Total withdrawal\\n uint256 public withdrawalCount;\\n /// @dev Mapping from chain id => deposit id => deposit vote\\n mapping(uint256 => mapping(uint256 => IsolatedGovernance.Vote)) public depositVote;\\n /// @dev Mapping from withdrawal id => mainchain withdrew vote\\n mapping(uint256 => IsolatedGovernance.Vote) public mainchainWithdrewVote;\\n /// @dev Mapping from withdrawal id => withdrawal receipt\\n mapping(uint256 => Transfer.Receipt) public withdrawal;\\n /// @dev Mapping from withdrawal id => validator address => signatures\\n mapping(uint256 => mapping(address => bytes)) internal _withdrawalSig;\\n /// @dev Mapping from token address => chain id => mainchain token address\\n mapping(address => mapping(uint256 => MappedToken)) internal _mainchainToken;\\n\\n /// @custom:deprecated Previously `_validatorContract` (non-zero value)\\n address private ____deprecated0;\\n /// @custom:deprecated Previously `_bridgeTrackingContract` (non-zero value)\\n address private ____deprecated1;\\n\\n /// @dev Mapping from withdrawal id => vote for recording withdrawal stats\\n mapping(uint256 => IsolatedGovernance.Vote) public withdrawalStatVote;\\n\\n /// @custom:deprecated Previously `_trustedOrgContract` (non-zero value)\\n address private ____deprecated2;\\n\\n uint256 internal _trustedNum;\\n uint256 internal _trustedDenom;\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n receive() external payable {\\n _fallback();\\n }\\n\\n modifier onlyBridgeOperator() {\\n _requireBridgeOperator();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the method caller is not bridge operator.\\n */\\n function _requireBridgeOperator() internal view {\\n if (!IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)).isBridgeOperator(msg.sender)) {\\n revert ErrUnauthorized(msg.sig, RoleAccess.__DEPRECATED_BRIDGE_OPERATOR);\\n }\\n }\\n\\n /**\\n * @dev Initializes contract storage.\\n */\\n function initialize(\\n address _roleSetter,\\n uint256 _numerator,\\n uint256 _denominator,\\n uint256 _trustedNumerator,\\n uint256 _trustedDenominator,\\n address[] calldata, /* _withdrawalMigrators */\\n // _packedAddresses[0]: roninTokens\\n // _packedAddresses[1]: mainchainTokens\\n address[][2] calldata _packedAddresses,\\n // _packedNumbers[0]: chainIds\\n // _packedNumbers[1]: minimumThresholds\\n uint256[][2] calldata _packedNumbers,\\n TokenStandard[] calldata _standards\\n ) external virtual initializer {\\n _setupRole(DEFAULT_ADMIN_ROLE, _roleSetter);\\n _setThreshold(_numerator, _denominator);\\n _setTrustedThreshold(_trustedNumerator, _trustedDenominator);\\n if (_packedAddresses[0].length > 0) {\\n _mapTokens(_packedAddresses[0], _packedAddresses[1], _packedNumbers[0], _standards);\\n _setMinimumThresholds(_packedAddresses[0], _packedNumbers[1]);\\n }\\n }\\n\\n function initializeV2() external reinitializer(2) {\\n _setContract(ContractType.VALIDATOR, ____deprecated0);\\n _setContract(ContractType.BRIDGE_TRACKING, ____deprecated1);\\n _setContract(ContractType.RONIN_TRUSTED_ORGANIZATION, ____deprecated2);\\n delete ____deprecated0;\\n delete ____deprecated1;\\n delete ____deprecated2;\\n }\\n\\n function initializeV3(address bridgeAdmin) external reinitializer(3) {\\n _setContract(ContractType.BRIDGE_MANAGER, bridgeAdmin);\\n }\\n\\n /**\\n * @inheritdoc IRoninGatewayV3\\n */\\n function getWithdrawalSignatures(uint256 withdrawalId, address[] calldata operators) external view returns (bytes[] memory _signatures) {\\n _signatures = new bytes[](operators.length);\\n for (uint256 _i = 0; _i < operators.length;) {\\n _signatures[_i] = _withdrawalSig[withdrawalId][operators[_i]];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n }\\n\\n /**\\n * @inheritdoc IRoninGatewayV3\\n */\\n function depositFor(Transfer.Receipt calldata _receipt) external whenNotPaused onlyBridgeOperator {\\n _depositFor(_receipt, msg.sender, minimumVoteWeight());\\n }\\n\\n /**\\n * @inheritdoc IRoninGatewayV3\\n */\\n function tryBulkAcknowledgeMainchainWithdrew(uint256[] calldata _withdrawalIds) external onlyBridgeOperator returns (bool[] memory _executedReceipts) {\\n address governor = msg.sender;\\n uint256 minVoteWeight = minimumVoteWeight();\\n\\n uint256 withdrawalId;\\n uint length = _withdrawalIds.length;\\n\\n _executedReceipts = new bool[](length);\\n IBridgeTracking bridgeTrackingContract = IBridgeTracking(getContract(ContractType.BRIDGE_TRACKING));\\n\\n for (uint256 i; i < length; ++i) {\\n withdrawalId = _withdrawalIds[i];\\n bridgeTrackingContract.recordVote(IBridgeTracking.VoteKind.MainchainWithdrawal, withdrawalId, governor);\\n\\n // Mark the withdrawal is executed\\n if (mainchainWithdrew(withdrawalId)) {\\n _executedReceipts[i] = true;\\n }\\n\\n // Process all votes, not early-exit to track all votes in BridgeTracking\\n IsolatedGovernance.Vote storage _vote = mainchainWithdrewVote[withdrawalId];\\n Transfer.Receipt memory _withdrawal = withdrawal[withdrawalId];\\n bytes32 _hash = _withdrawal.hash();\\n VoteStatus _status = _castIsolatedVote(_vote, governor, minVoteWeight, _hash);\\n if (_status == VoteStatus.Approved) {\\n _vote.status = VoteStatus.Executed;\\n bridgeTrackingContract.handleVoteApproved(IBridgeTracking.VoteKind.MainchainWithdrawal, withdrawalId);\\n emit MainchainWithdrew(_hash, _withdrawal);\\n }\\n }\\n }\\n\\n /**\\n * @inheritdoc IRoninGatewayV3\\n */\\n function tryBulkDepositFor(Transfer.Receipt[] calldata receipts) external whenNotPaused onlyBridgeOperator returns (bool[] memory _executedReceipts) {\\n uint length = receipts.length;\\n _executedReceipts = new bool[](length);\\n uint256 minVoteWeight = minimumVoteWeight();\\n\\n Transfer.Receipt memory iReceipt;\\n for (uint i; i < length; ++i) {\\n iReceipt = receipts[i];\\n if (depositVote[iReceipt.mainchain.chainId][iReceipt.id].status == VoteStatus.Executed) {\\n _executedReceipts[i] = true;\\n }\\n\\n // Process all votes, not early-exit to track all votes in BridgeTracking\\n _depositFor(iReceipt, msg.sender, minVoteWeight);\\n }\\n }\\n\\n /**\\n * @inheritdoc IRoninGatewayV3\\n */\\n function requestWithdrawalFor(Transfer.Request calldata _request, uint256 _chainId) external whenNotPaused {\\n _requestWithdrawalFor(_request, msg.sender, _chainId);\\n }\\n\\n /**\\n * @inheritdoc IRoninGatewayV3\\n */\\n function bulkRequestWithdrawalFor(Transfer.Request[] calldata requests, uint256 chainId) external whenNotPaused {\\n uint length = requests.length;\\n if (length == 0) revert ErrEmptyArray();\\n\\n for (uint i; i < length; ++i) {\\n _requestWithdrawalFor(requests[i], msg.sender, chainId);\\n }\\n }\\n\\n /**\\n * @inheritdoc IRoninGatewayV3\\n */\\n function requestWithdrawalSignatures(uint256 _withdrawalId) external whenNotPaused {\\n if (mainchainWithdrew(_withdrawalId)) revert ErrWithdrawnOnMainchainAlready();\\n\\n Transfer.Receipt memory _receipt = withdrawal[_withdrawalId];\\n if (_receipt.ronin.chainId != block.chainid) {\\n revert ErrInvalidChainId(msg.sig, _receipt.ronin.chainId, block.chainid);\\n }\\n\\n emit WithdrawalSignaturesRequested(_receipt.hash(), _receipt);\\n }\\n\\n /**\\n * @inheritdoc IRoninGatewayV3\\n */\\n function bulkSubmitWithdrawalSignatures(uint256[] calldata withdrawals, bytes[] calldata signatures) external whenNotPaused onlyBridgeOperator {\\n address operator = msg.sender;\\n\\n uint length = withdrawals.length;\\n if (!(length > 0 && length == signatures.length)) {\\n revert ErrLengthMismatch(msg.sig);\\n }\\n\\n uint256 _minVoteWeight = minimumVoteWeight();\\n\\n uint256 id;\\n IBridgeTracking _bridgeTrackingContract = IBridgeTracking(getContract(ContractType.BRIDGE_TRACKING));\\n for (uint i; i < length; ++i) {\\n id = withdrawals[i];\\n _withdrawalSig[id][operator] = signatures[i];\\n _bridgeTrackingContract.recordVote(IBridgeTracking.VoteKind.Withdrawal, id, operator);\\n\\n IsolatedGovernance.Vote storage _proposal = withdrawalStatVote[id];\\n VoteStatus _status = _castIsolatedVote(_proposal, operator, _minVoteWeight, bytes32(id));\\n if (_status == VoteStatus.Approved) {\\n _proposal.status = VoteStatus.Executed;\\n _bridgeTrackingContract.handleVoteApproved(IBridgeTracking.VoteKind.Withdrawal, id);\\n }\\n }\\n }\\n\\n /**\\n * @inheritdoc IRoninGatewayV3\\n */\\n function mapTokens(\\n address[] calldata _roninTokens,\\n address[] calldata _mainchainTokens,\\n uint256[] calldata _chainIds,\\n TokenStandard[] calldata _standards\\n ) external onlyProxyAdmin {\\n if (_roninTokens.length == 0) revert ErrLengthMismatch(msg.sig);\\n _mapTokens(_roninTokens, _mainchainTokens, _chainIds, _standards);\\n }\\n\\n /**\\n * @inheritdoc IRoninGatewayV3\\n */\\n function depositVoted(uint256 _chainId, uint256 _depositId, address _voter) external view returns (bool) {\\n return depositVote[_chainId][_depositId].voted(_voter);\\n }\\n\\n /**\\n * @inheritdoc IRoninGatewayV3\\n */\\n function mainchainWithdrewVoted(uint256 _withdrawalId, address _voter) external view returns (bool) {\\n return mainchainWithdrewVote[_withdrawalId].voted(_voter);\\n }\\n\\n /**\\n * @inheritdoc IRoninGatewayV3\\n */\\n function mainchainWithdrew(uint256 _withdrawalId) public view returns (bool) {\\n return mainchainWithdrewVote[_withdrawalId].status == VoteStatus.Executed;\\n }\\n\\n /**\\n * @inheritdoc IRoninGatewayV3\\n */\\n function getMainchainToken(address _roninToken, uint256 _chainId) public view returns (MappedToken memory _token) {\\n _token = _mainchainToken[_roninToken][_chainId];\\n if (_token.tokenAddr == address(0)) revert ErrUnsupportedToken();\\n }\\n\\n /**\\n * @dev Maps Ronin tokens to mainchain networks.\\n *\\n * Requirement:\\n * - The arrays have the same length.\\n *\\n * Emits the `TokenMapped` event.\\n *\\n */\\n function _mapTokens(\\n address[] calldata _roninTokens,\\n address[] calldata _mainchainTokens,\\n uint256[] calldata _chainIds,\\n TokenStandard[] calldata _standards\\n ) internal {\\n if (!(_roninTokens.length == _mainchainTokens.length && _roninTokens.length == _chainIds.length)) {\\n revert ErrLengthMismatch(msg.sig);\\n }\\n\\n for (uint256 _i; _i < _roninTokens.length;) {\\n _mainchainToken[_roninTokens[_i]][_chainIds[_i]].tokenAddr = _mainchainTokens[_i];\\n _mainchainToken[_roninTokens[_i]][_chainIds[_i]].erc = _standards[_i];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n\\n emit TokenMapped(_roninTokens, _mainchainTokens, _chainIds, _standards);\\n }\\n\\n /**\\n * @dev Deposits based on the receipt.\\n *\\n * Emits the `Deposited` once the assets are released.\\n *\\n */\\n function _depositFor(Transfer.Receipt memory receipt, address operator, uint256 minVoteWeight) internal {\\n uint256 id = receipt.id;\\n receipt.info.validate();\\n if (receipt.kind != Transfer.Kind.Deposit) revert ErrInvalidReceiptKind();\\n if (receipt.ronin.chainId != block.chainid) revert ErrInvalidChainId(msg.sig, receipt.ronin.chainId, block.chainid);\\n\\n MappedToken memory token = getMainchainToken(receipt.ronin.tokenAddr, receipt.mainchain.chainId);\\n\\n if (!(token.erc == receipt.info.erc && token.tokenAddr == receipt.mainchain.tokenAddr)) {\\n revert ErrInvalidReceipt();\\n }\\n\\n IsolatedGovernance.Vote storage _proposal = depositVote[receipt.mainchain.chainId][id];\\n bytes32 _receiptHash = receipt.hash();\\n VoteStatus status = _castIsolatedVote(_proposal, operator, minVoteWeight, _receiptHash);\\n emit DepositVoted(operator, id, receipt.mainchain.chainId, _receiptHash);\\n\\n // Transfer assets and handle when the vote is approved.\\n IBridgeTracking bridgeTrackingContract = IBridgeTracking(getContract(ContractType.BRIDGE_TRACKING));\\n if (status == VoteStatus.Approved) {\\n _proposal.status = VoteStatus.Executed;\\n receipt.info.handleAssetOut(payable(receipt.ronin.addr), receipt.ronin.tokenAddr, IWETH(address(0)));\\n bridgeTrackingContract.handleVoteApproved(IBridgeTracking.VoteKind.Deposit, receipt.id);\\n emit Deposited(_receiptHash, receipt);\\n }\\n\\n // Announce to BridgeTracking to record the vote, after marking the VoteStatus as Executed.\\n bridgeTrackingContract.recordVote(IBridgeTracking.VoteKind.Deposit, receipt.id, operator);\\n }\\n\\n /**\\n * @dev Locks the assets and request withdrawal.\\n *\\n * Requirements:\\n * - The token info is valid.\\n *\\n * Emits the `WithdrawalRequested` event.\\n *\\n */\\n function _requestWithdrawalFor(Transfer.Request calldata _request, address _requester, uint256 _chainId) internal {\\n _request.info.validate();\\n _checkWithdrawal(_request);\\n MappedToken memory _token = getMainchainToken(_request.tokenAddr, _chainId);\\n if (_request.info.erc != _token.erc) revert ErrInvalidTokenStandard();\\n\\n _request.info.handleAssetIn(_requester, _request.tokenAddr);\\n _storeAsReceipt(_request, _chainId, _requester, _token.tokenAddr);\\n }\\n\\n /**\\n * @dev Stores the withdrawal request as a receipt.\\n *\\n * Emits the `WithdrawalRequested` event.\\n *\\n */\\n function _storeAsReceipt(\\n Transfer.Request calldata _request,\\n uint256 _chainId,\\n address _requester,\\n address _mainchainTokenAddr\\n ) internal returns (uint256 _withdrawalId) {\\n _withdrawalId = withdrawalCount++;\\n Transfer.Receipt memory _receipt = _request.into_withdrawal_receipt(_requester, _withdrawalId, _mainchainTokenAddr, _chainId);\\n withdrawal[_withdrawalId] = _receipt;\\n emit WithdrawalRequested(_receipt.hash(), _receipt);\\n }\\n\\n /**\\n * @dev Don't send me RON.\\n */\\n function _fallback() internal virtual {\\n revert ErrInvalidRequest();\\n }\\n\\n /**\\n * @inheritdoc GatewayV3\\n */\\n function _getTotalWeight() internal view virtual override returns (uint256) {\\n return IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)).getTotalWeight();\\n }\\n\\n /**\\n * @dev Casts and updates the vote result.\\n *\\n * Requirements:\\n * - The vote is not finalized.\\n * - The voter has not voted for the round.\\n *\\n */\\n function _castIsolatedVote(\\n IsolatedGovernance.Vote storage _v,\\n address _voter,\\n uint256 _minVoteWeight,\\n bytes32 _hash\\n ) internal virtual returns (VoteStatus _status) {\\n _v.castVote(_voter, _hash);\\n uint256 _totalWeight = _getVoteWeight(_v, _hash);\\n return _v.syncVoteStatus(_minVoteWeight, _totalWeight, _hash);\\n }\\n\\n /**\\n * @dev Returns the vote weight for a specified hash.\\n */\\n function _getVoteWeight(IsolatedGovernance.Vote storage _v, bytes32 _hash) internal view returns (uint256 _totalWeight) {\\n (, address[] memory bridgeOperators, uint96[] memory weights) = IBridgeManager(getContract(ContractType.BRIDGE_MANAGER)).getFullBridgeOperatorInfos();\\n uint256 length = bridgeOperators.length;\\n unchecked {\\n for (uint _i; _i < length; ++_i) {\\n if (_v.voteHashOf[bridgeOperators[_i]] == _hash) {\\n _totalWeight += weights[_i];\\n }\\n }\\n }\\n }\\n\\n function setTrustedThreshold(uint256 _trustedNumerator, uint256 _trustedDenominator) external virtual onlyProxyAdmin returns (uint256, uint256) {\\n return _setTrustedThreshold(_trustedNumerator, _trustedDenominator);\\n }\\n\\n /**\\n * @dev Returns the threshold about trusted org.\\n */\\n function getTrustedThreshold() external view virtual returns (uint256 trustedNum_, uint256 trustedDenom_) {\\n return (_trustedNum, _trustedDenom);\\n }\\n\\n /**\\n * @dev Sets trusted threshold and returns the old one.\\n *\\n * Emits the `TrustedThresholdUpdated` event.\\n *\\n */\\n function _setTrustedThreshold(\\n uint256 _trustedNumerator,\\n uint256 _trustedDenominator\\n ) internal virtual returns (uint256 _previousTrustedNum, uint256 _previousTrustedDenom) {\\n if (_trustedNumerator > _trustedDenominator) revert ErrInvalidTrustedThreshold();\\n\\n _previousTrustedNum = _num;\\n _previousTrustedDenom = _denom;\\n _trustedNum = _trustedNumerator;\\n _trustedDenom = _trustedDenominator;\\n unchecked {\\n emit TrustedThresholdUpdated(nonce++, _trustedNumerator, _trustedDenominator, _previousTrustedNum, _previousTrustedDenom);\\n }\\n }\\n\\n /**\\n * @dev Returns minimum trusted vote weight.\\n */\\n function _minimumTrustedVoteWeight(uint256 _totalTrustedWeight) internal view virtual returns (uint256) {\\n return (_trustedNum * _totalTrustedWeight + _trustedDenom - 1) / _trustedDenom;\\n }\\n\\n function supportsInterface(bytes4 interfaceId) public view override(AccessControlEnumerable, ERC1155Receiver) returns (bool) {\\n return AccessControlEnumerable.supportsInterface(interfaceId) || ERC1155Receiver.supportsInterface(interfaceId);\\n }\\n}\\n\",\"keccak256\":\"0x07763d6e838ecb550b9f8276fe4e4706be18f29707e1d8124db2abdf0f6489e1\",\"license\":\"MIT\"},\"src/utils/CommonErrors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ContractType } from \\\"./ContractType.sol\\\";\\nimport { RoleAccess } from \\\"./RoleAccess.sol\\\";\\n\\nerror ErrSyncTooFarPeriod(uint256 period, uint256 latestRewardedPeriod);\\n/**\\n * @dev Error thrown when an address is expected to be an already created externally owned account (EOA).\\n * This error indicates that the provided address is invalid for certain contract operations that require already created EOA.\\n */\\nerror ErrAddressIsNotCreatedEOA(address addr, bytes32 codehash);\\n/**\\n * @dev Error raised when a bridge operator update operation fails.\\n * @param bridgeOperator The address of the bridge operator that failed to update.\\n */\\nerror ErrBridgeOperatorUpdateFailed(address bridgeOperator);\\n/**\\n * @dev Error thrown when attempting to add a bridge operator that already exists in the contract.\\n * This error indicates that the provided bridge operator address is already registered as a bridge operator in the contract.\\n */\\nerror ErrBridgeOperatorAlreadyExisted(address bridgeOperator);\\n/**\\n * @dev The error indicating an unsupported interface.\\n * @param interfaceId The bytes4 interface identifier that is not supported.\\n * @param addr The address where the unsupported interface was encountered.\\n */\\nerror ErrUnsupportedInterface(bytes4 interfaceId, address addr);\\n/**\\n * @dev Error thrown when the return data from a callback function is invalid.\\n * @param callbackFnSig The signature of the callback function that returned invalid data.\\n * @param register The address of the register where the callback function was invoked.\\n * @param returnData The invalid return data received from the callback function.\\n */\\nerror ErrInvalidReturnData(bytes4 callbackFnSig, address register, bytes returnData);\\n/**\\n * @dev Error of set to non-contract.\\n */\\nerror ErrZeroCodeContract(address addr);\\n/**\\n * @dev Error indicating that arguments are invalid.\\n */\\nerror ErrInvalidArguments(bytes4 msgSig);\\n/**\\n * @dev Error indicating that given address is null when it should not.\\n */\\nerror ErrZeroAddress(bytes4 msgSig);\\n/**\\n * @dev Error indicating that the provided threshold is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that the invalid threshold applies to.\\n */\\nerror ErrInvalidThreshold(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a function can only be called by the contract itself.\\n * @param msgSig The function signature (bytes4) that can only be called by the contract itself.\\n */\\nerror ErrOnlySelfCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n * @param expectedRole The role required to perform the function.\\n */\\nerror ErrUnauthorized(bytes4 msgSig, RoleAccess expectedRole);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n */\\nerror ErrUnauthorizedCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4).\\n * @param expectedContractType The contract type required to perform the function.\\n * @param actual The actual address that called to the function.\\n */\\nerror ErrUnexpectedInternalCall(bytes4 msgSig, ContractType expectedContractType, address actual);\\n\\n/**\\n * @dev Error indicating that an array is empty when it should contain elements.\\n */\\nerror ErrEmptyArray();\\n\\n/**\\n * @dev Error indicating a mismatch in the length of input parameters or arrays for a specific function.\\n * @param msgSig The function signature (bytes4) that has a length mismatch.\\n */\\nerror ErrLengthMismatch(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a proxy call to an external contract has failed.\\n * @param msgSig The function signature (bytes4) of the proxy call that failed.\\n * @param extCallSig The function signature (bytes4) of the external contract call that failed.\\n */\\nerror ErrProxyCallFailed(bytes4 msgSig, bytes4 extCallSig);\\n\\n/**\\n * @dev Error indicating that a function tried to call a precompiled contract that is not allowed.\\n * @param msgSig The function signature (bytes4) that attempted to call a precompiled contract.\\n */\\nerror ErrCallPrecompiled(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a native token transfer has failed.\\n * @param msgSig The function signature (bytes4) of the token transfer that failed.\\n */\\nerror ErrNativeTransferFailed(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that an order is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid order.\\n */\\nerror ErrInvalidOrder(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the chain ID is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid chain ID.\\n * @param actual Current chain ID that executing function.\\n * @param expected Expected chain ID required for the tx to success.\\n */\\nerror ErrInvalidChainId(bytes4 msgSig, uint256 actual, uint256 expected);\\n\\n/**\\n * @dev Error indicating that a vote type is not supported.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an unsupported vote type.\\n */\\nerror ErrUnsupportedVoteType(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the proposal nonce is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid proposal nonce.\\n */\\nerror ErrInvalidProposalNonce(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a voter has already voted.\\n * @param voter The address of the voter who has already voted.\\n */\\nerror ErrAlreadyVoted(address voter);\\n\\n/**\\n * @dev Error indicating that a signature is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid signature.\\n */\\nerror ErrInvalidSignatures(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a relay call has failed.\\n * @param msgSig The function signature (bytes4) of the relay call that failed.\\n */\\nerror ErrRelayFailed(bytes4 msgSig);\\n/**\\n * @dev Error indicating that a vote weight is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid vote weight.\\n */\\nerror ErrInvalidVoteWeight(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a query was made for an outdated bridge operator set.\\n */\\nerror ErrQueryForOutdatedBridgeOperatorSet();\\n\\n/**\\n * @dev Error indicating that a request is invalid.\\n */\\nerror ErrInvalidRequest();\\n\\n/**\\n * @dev Error indicating that a token standard is invalid.\\n */\\nerror ErrInvalidTokenStandard();\\n\\n/**\\n * @dev Error indicating that a token is not supported.\\n */\\nerror ErrUnsupportedToken();\\n\\n/**\\n * @dev Error indicating that a receipt kind is invalid.\\n */\\nerror ErrInvalidReceiptKind();\\n\\n/**\\n * @dev Error indicating that a receipt is invalid.\\n */\\nerror ErrInvalidReceipt();\\n\\n/**\\n * @dev Error indicating that an address is not payable.\\n */\\nerror ErrNonpayableAddress(address);\\n\\n/**\\n * @dev Error indicating that the period is already processed, i.e. scattered reward.\\n */\\nerror ErrPeriodAlreadyProcessed(uint256 requestingPeriod, uint256 latestPeriod);\\n\\n/**\\n * @dev Error thrown when an invalid vote hash is provided.\\n */\\nerror ErrInvalidVoteHash();\\n\\n/**\\n * @dev Error thrown when querying for an empty vote.\\n */\\nerror ErrQueryForEmptyVote();\\n\\n/**\\n * @dev Error thrown when querying for an expired vote.\\n */\\nerror ErrQueryForExpiredVote();\\n\\n/**\\n * @dev Error thrown when querying for a non-existent vote.\\n */\\nerror ErrQueryForNonExistentVote();\\n\\n/**\\n * @dev Error indicating that the method is only called once per block.\\n */\\nerror ErrOncePerBlock();\\n\\n/**\\n * @dev Error of method caller must be coinbase\\n */\\nerror ErrCallerMustBeCoinbase();\\n\\n/**\\n * @dev Error thrown when an invalid proposal is encountered.\\n * @param actual The actual value of the proposal.\\n * @param expected The expected value of the proposal.\\n */\\nerror ErrInvalidProposal(bytes32 actual, bytes32 expected);\\n\\n/**\\n * @dev Error of proposal is not approved for executing.\\n */\\nerror ErrProposalNotApproved();\\n\\n/**\\n * @dev Error of the caller is not the specified executor.\\n */\\nerror ErrInvalidExecutor();\\n\\n/**\\n * @dev Error of the `caller` to relay is not the specified `executor`.\\n */\\nerror ErrNonExecutorCannotRelay(address executor, address caller);\\n\",\"keccak256\":\"0x0d9e2fd98f6b704273faad707ed9eadbd4c79551ee3f902bff5b29213a204679\",\"license\":\"MIT\"},\"src/utils/ContractType.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum ContractType {\\n UNKNOWN, // 0\\n PAUSE_ENFORCER, // 1\\n BRIDGE, // 2\\n BRIDGE_TRACKING, // 3\\n GOVERNANCE_ADMIN, // 4\\n MAINTENANCE, // 5\\n SLASH_INDICATOR, // 6\\n STAKING_VESTING, // 7\\n VALIDATOR, // 8\\n STAKING, // 9\\n RONIN_TRUSTED_ORGANIZATION, // 10\\n BRIDGE_MANAGER, // 11\\n BRIDGE_SLASH, // 12\\n BRIDGE_REWARD, // 13\\n FAST_FINALITY_TRACKING, // 14\\n PROFILE // 15\\n\\n}\\n\",\"keccak256\":\"0xec088aa939cd885dbe84e944942d7ea674e1fff8802c1f2ae5d8e84e4578357d\",\"license\":\"MIT\"},\"src/utils/IdentityGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { AddressArrayUtils } from \\\"../libraries/AddressArrayUtils.sol\\\";\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport { TransparentUpgradeableProxyV2 } from \\\"../extensions/TransparentUpgradeableProxyV2.sol\\\";\\nimport { ErrAddressIsNotCreatedEOA, ErrZeroAddress, ErrOnlySelfCall, ErrZeroCodeContract, ErrUnsupportedInterface } from \\\"./CommonErrors.sol\\\";\\n\\nabstract contract IdentityGuard {\\n using AddressArrayUtils for address[];\\n\\n /// @dev value is equal to keccak256(abi.encode())\\n /// @dev see: https://eips.ethereum.org/EIPS/eip-1052\\n bytes32 internal constant CREATED_ACCOUNT_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\\n\\n /**\\n * @dev Modifier to restrict functions to only be called by this contract.\\n * @dev Reverts if the caller is not this contract.\\n */\\n modifier onlySelfCall() virtual {\\n _requireSelfCall();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to ensure that the elements in the `arr` array are non-duplicates.\\n * It calls the internal `_checkDuplicate` function to perform the duplicate check.\\n *\\n * Requirements:\\n * - The elements in the `arr` array must not contain any duplicates.\\n */\\n modifier nonDuplicate(address[] memory arr) virtual {\\n _requireNonDuplicate(arr);\\n _;\\n }\\n\\n /**\\n * @dev Internal method to check the method caller.\\n * @dev Reverts if the method caller is not this contract.\\n */\\n function _requireSelfCall() internal view virtual {\\n if (msg.sender != address(this)) revert ErrOnlySelfCall(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to check if a contract address has code.\\n * @param addr The address of the contract to check.\\n * @dev Throws an error if the contract address has no code.\\n */\\n function _requireHasCode(address addr) internal view {\\n if (addr.code.length == 0) revert ErrZeroCodeContract(addr);\\n }\\n\\n /**\\n * @dev Checks if an address is zero and reverts if it is.\\n * @param addr The address to check.\\n */\\n function _requireNonZeroAddress(address addr) internal pure {\\n if (addr == address(0)) revert ErrZeroAddress(msg.sig);\\n }\\n\\n /**\\n * @dev Check if arr is empty and revert if it is.\\n * Checks if an array contains any duplicate addresses and reverts if duplicates are found.\\n * @param arr The array of addresses to check.\\n */\\n function _requireNonDuplicate(address[] memory arr) internal pure {\\n if (arr.hasDuplicate()) revert AddressArrayUtils.ErrDuplicated(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to require that the provided address is a created externally owned account (EOA).\\n * This internal function is used to ensure that the provided address is a valid externally owned account (EOA).\\n * It checks the codehash of the address against a predefined constant to confirm that the address is a created EOA.\\n * @notice This method only works with non-state EOA accounts\\n */\\n function _requireCreatedEOA(address addr) internal view {\\n _requireNonZeroAddress(addr);\\n bytes32 codehash = addr.codehash;\\n if (codehash != CREATED_ACCOUNT_HASH) revert ErrAddressIsNotCreatedEOA(addr, codehash);\\n }\\n\\n /**\\n * @dev Internal function to require that the specified contract supports the given interface. This method handle in\\n * both case that the callee is either or not the proxy admin of the caller. If the contract does not support the\\n * interface `interfaceId` or EIP165, a revert with the corresponding error message is triggered.\\n *\\n * @param contractAddr The address of the contract to check for interface support.\\n * @param interfaceId The interface ID to check for support.\\n */\\n function _requireSupportsInterface(address contractAddr, bytes4 interfaceId) internal view {\\n bytes memory supportsInterfaceParams = abi.encodeCall(IERC165.supportsInterface, (interfaceId));\\n (bool success, bytes memory returnOrRevertData) = contractAddr.staticcall(supportsInterfaceParams);\\n if (!success) {\\n (success, returnOrRevertData) = contractAddr.staticcall(abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (supportsInterfaceParams)));\\n if (!success) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n if (!abi.decode(returnOrRevertData, (bool))) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n}\\n\",\"keccak256\":\"0x546ab4c9cdb0e7f8e650f140349225305ba1d0706dcaceeb9180c96aa765da59\",\"license\":\"MIT\"},\"src/utils/RoleAccess.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum RoleAccess {\\n UNKNOWN, // 0\\n ADMIN, // 1\\n COINBASE, // 2\\n GOVERNOR, // 3\\n CANDIDATE_ADMIN, // 4\\n WITHDRAWAL_MIGRATOR, // 5\\n __DEPRECATED_BRIDGE_OPERATOR, // 6\\n BLOCK_PRODUCER, // 7\\n VALIDATOR_CANDIDATE, // 8\\n CONSENSUS, // 9\\n TREASURY // 10\\n\\n}\\n\",\"keccak256\":\"0x671ff40dd874c508c4b3879a580996c7987fc018669256f47151e420a55c0e51\",\"license\":\"MIT\"}},\"version\":1}", + "nonce": 192812, + "numDeployments": 1, + "storageLayout": { + "storage": [ + { + "astId": 58352, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "_paused", + "offset": 0, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 103484, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "_num", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 103486, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "_denom", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 103488, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "______deprecated", + "offset": 0, + "slot": "3", + "type": "t_address" + }, + { + "astId": 103490, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "nonce", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 103492, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "emergencyPauser", + "offset": 0, + "slot": "5", + "type": "t_address" + }, + { + "astId": 103497, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "______gap", + "offset": 0, + "slot": "6", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 58190, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "_initialized", + "offset": 0, + "slot": "55", + "type": "t_uint8" + }, + { + "astId": 58193, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "_initializing", + "offset": 1, + "slot": "55", + "type": "t_bool" + }, + { + "astId": 103711, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "minimumThreshold", + "offset": 0, + "slot": "56", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 103716, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "______gap", + "offset": 0, + "slot": "57", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 56841, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "_roles", + "offset": 0, + "slot": "107", + "type": "t_mapping(t_bytes32,t_struct(RoleData)56836_storage)" + }, + { + "astId": 57155, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "_roleMembers", + "offset": 0, + "slot": "108", + "type": "t_mapping(t_bytes32,t_struct(AddressSet)63339_storage)" + }, + { + "astId": 121409, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "___deprecated4", + "offset": 0, + "slot": "109", + "type": "t_bool" + }, + { + "astId": 121412, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "withdrawalCount", + "offset": 0, + "slot": "110", + "type": "t_uint256" + }, + { + "astId": 121420, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "depositVote", + "offset": 0, + "slot": "111", + "type": "t_mapping(t_uint256,t_mapping(t_uint256,t_struct(Vote)111952_storage))" + }, + { + "astId": 121426, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "mainchainWithdrewVote", + "offset": 0, + "slot": "112", + "type": "t_mapping(t_uint256,t_struct(Vote)111952_storage)" + }, + { + "astId": 121432, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "withdrawal", + "offset": 0, + "slot": "113", + "type": "t_mapping(t_uint256,t_struct(Receipt)114148_storage)" + }, + { + "astId": 121439, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "_withdrawalSig", + "offset": 0, + "slot": "114", + "type": "t_mapping(t_uint256,t_mapping(t_address,t_bytes_storage))" + }, + { + "astId": 121447, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "_mainchainToken", + "offset": 0, + "slot": "115", + "type": "t_mapping(t_address,t_mapping(t_uint256,t_struct(MappedToken)110667_storage))" + }, + { + "astId": 121450, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "____deprecated0", + "offset": 0, + "slot": "116", + "type": "t_address" + }, + { + "astId": 121453, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "____deprecated1", + "offset": 0, + "slot": "117", + "type": "t_address" + }, + { + "astId": 121459, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "withdrawalStatVote", + "offset": 0, + "slot": "118", + "type": "t_mapping(t_uint256,t_struct(Vote)111952_storage)" + }, + { + "astId": 121462, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "____deprecated2", + "offset": 0, + "slot": "119", + "type": "t_address" + }, + { + "astId": 121464, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "_trustedNum", + "offset": 0, + "slot": "120", + "type": "t_uint256" + }, + { + "astId": 121466, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "_trustedDenom", + "offset": 0, + "slot": "121", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_address)dyn_storage": { + "encoding": "dynamic_array", + "label": "address[]", + "numberOfBytes": "32", + "base": "t_address" + }, + "t_array(t_bytes32)dyn_storage": { + "encoding": "dynamic_array", + "label": "bytes32[]", + "numberOfBytes": "32", + "base": "t_bytes32" + }, + "t_array(t_uint256)49_storage": { + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568", + "base": "t_uint256" + }, + "t_array(t_uint256)50_storage": { + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600", + "base": "t_uint256" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_enum(Kind)113945": { + "encoding": "inplace", + "label": "enum Transfer.Kind", + "numberOfBytes": "1" + }, + "t_enum(TokenStandard)112271": { + "encoding": "inplace", + "label": "enum TokenStandard", + "numberOfBytes": "1" + }, + "t_enum(VoteStatus)110686": { + "encoding": "inplace", + "label": "enum VoteStatusConsumer.VoteStatus", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_address,t_bytes32)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bytes32)", + "numberOfBytes": "32", + "value": "t_bytes32" + }, + "t_mapping(t_address,t_bytes_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bytes)", + "numberOfBytes": "32", + "value": "t_bytes_storage" + }, + "t_mapping(t_address,t_mapping(t_uint256,t_struct(MappedToken)110667_storage))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(uint256 => struct MappedTokenConsumer.MappedToken))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint256,t_struct(MappedToken)110667_storage)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes32,t_struct(AddressSet)63339_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct EnumerableSet.AddressSet)", + "numberOfBytes": "32", + "value": "t_struct(AddressSet)63339_storage" + }, + "t_mapping(t_bytes32,t_struct(RoleData)56836_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct AccessControl.RoleData)", + "numberOfBytes": "32", + "value": "t_struct(RoleData)56836_storage" + }, + "t_mapping(t_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_uint256,t_mapping(t_address,t_bytes_storage))": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => mapping(address => bytes))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_bytes_storage)" + }, + "t_mapping(t_uint256,t_mapping(t_uint256,t_struct(Vote)111952_storage))": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => mapping(uint256 => struct IsolatedGovernance.Vote))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint256,t_struct(Vote)111952_storage)" + }, + "t_mapping(t_uint256,t_struct(MappedToken)110667_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct MappedTokenConsumer.MappedToken)", + "numberOfBytes": "32", + "value": "t_struct(MappedToken)110667_storage" + }, + "t_mapping(t_uint256,t_struct(Receipt)114148_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct Transfer.Receipt)", + "numberOfBytes": "32", + "value": "t_struct(Receipt)114148_storage" + }, + "t_mapping(t_uint256,t_struct(Vote)111952_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct IsolatedGovernance.Vote)", + "numberOfBytes": "32", + "value": "t_struct(Vote)111952_storage" + }, + "t_struct(AddressSet)63339_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.AddressSet", + "numberOfBytes": "64", + "members": [ + { + "astId": 63338, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "_inner", + "offset": 0, + "slot": "0", + "type": "t_struct(Set)63038_storage" + } + ] + }, + "t_struct(MappedToken)110667_storage": { + "encoding": "inplace", + "label": "struct MappedTokenConsumer.MappedToken", + "numberOfBytes": "32", + "members": [ + { + "astId": 110664, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "erc", + "offset": 0, + "slot": "0", + "type": "t_enum(TokenStandard)112271" + }, + { + "astId": 110666, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "tokenAddr", + "offset": 1, + "slot": "0", + "type": "t_address" + } + ] + }, + "t_struct(Receipt)114148_storage": { + "encoding": "inplace", + "label": "struct Transfer.Receipt", + "numberOfBytes": "352", + "members": [ + { + "astId": 114135, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "id", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 114138, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "kind", + "offset": 0, + "slot": "1", + "type": "t_enum(Kind)113945" + }, + { + "astId": 114141, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "mainchain", + "offset": 0, + "slot": "2", + "type": "t_struct(TokenOwner)113435_storage" + }, + { + "astId": 114144, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "ronin", + "offset": 0, + "slot": "5", + "type": "t_struct(TokenOwner)113435_storage" + }, + { + "astId": 114147, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "info", + "offset": 0, + "slot": "8", + "type": "t_struct(TokenInfo)112279_storage" + } + ] + }, + "t_struct(RoleData)56836_storage": { + "encoding": "inplace", + "label": "struct AccessControl.RoleData", + "numberOfBytes": "64", + "members": [ + { + "astId": 56833, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "members", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 56835, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "adminRole", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + } + ] + }, + "t_struct(Set)63038_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.Set", + "numberOfBytes": "64", + "members": [ + { + "astId": 63033, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "_values", + "offset": 0, + "slot": "0", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "astId": 63037, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "_indexes", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ] + }, + "t_struct(TokenInfo)112279_storage": { + "encoding": "inplace", + "label": "struct TokenInfo", + "numberOfBytes": "96", + "members": [ + { + "astId": 112274, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "erc", + "offset": 0, + "slot": "0", + "type": "t_enum(TokenStandard)112271" + }, + { + "astId": 112276, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "id", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 112278, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "quantity", + "offset": 0, + "slot": "2", + "type": "t_uint256" + } + ] + }, + "t_struct(TokenOwner)113435_storage": { + "encoding": "inplace", + "label": "struct TokenOwner", + "numberOfBytes": "96", + "members": [ + { + "astId": 113430, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "addr", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 113432, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "tokenAddr", + "offset": 0, + "slot": "1", + "type": "t_address" + }, + { + "astId": 113434, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "chainId", + "offset": 0, + "slot": "2", + "type": "t_uint256" + } + ] + }, + "t_struct(Vote)111952_storage": { + "encoding": "inplace", + "label": "struct IsolatedGovernance.Vote", + "numberOfBytes": "192", + "members": [ + { + "astId": 111934, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "status", + "offset": 0, + "slot": "0", + "type": "t_enum(VoteStatus)110686" + }, + { + "astId": 111936, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "finalHash", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + }, + { + "astId": 111941, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "voteHashOf", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_address,t_bytes32)" + }, + { + "astId": 111944, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "expiredAt", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 111947, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "createdAt", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 111951, + "contract": "src/ronin/gateway/RoninGatewayV3.sol:RoninGatewayV3", + "label": "voters", + "offset": 0, + "slot": "5", + "type": "t_array(t_address)dyn_storage" + } + ] + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + }, + "timestamp": 1713251844, + "userdoc": { + "version": 1, + "kind": "user", + "methods": { + "depositFor((uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))": { + "notice": "The assets will be transferred whenever the valid call passes the quorum threshold." + }, + "tryBulkAcknowledgeMainchainWithdrew(uint256[])": { + "notice": "Not reverting to avoid unnecessary failed transactions because the validators can send transactions at the same time." + }, + "tryBulkDepositFor((uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256))[])": { + "notice": "The assets will be transferred whenever the valid call for the receipt passes the quorum threshold. Not reverting to avoid unnecessary failed transactions because the validators can send transactions at the same time." + } + } + } +} \ No newline at end of file From 45101441222066cabd1e079624710774760e91ca Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 16 Apr 2024 15:11:48 +0700 Subject: [PATCH 174/180] chore: add artifacts Mainchain side --- .../sepolia/MainchainBridgeManagerLogic.json | 2324 +++++++++++++++++ .../sepolia/MainchainBridgeManagerProxy.json | 218 ++ .../MainchainGatewayPauseEnforcerLogic.json | 64 +- .../sepolia/MainchainGatewayV3Logic.json | 497 +++- deployments/sepolia/WethUnwrapper.json | 134 + 5 files changed, 3085 insertions(+), 152 deletions(-) create mode 100644 deployments/sepolia/MainchainBridgeManagerLogic.json create mode 100644 deployments/sepolia/MainchainBridgeManagerProxy.json create mode 100644 deployments/sepolia/WethUnwrapper.json diff --git a/deployments/sepolia/MainchainBridgeManagerLogic.json b/deployments/sepolia/MainchainBridgeManagerLogic.json new file mode 100644 index 00000000..5aa46af1 --- /dev/null +++ b/deployments/sepolia/MainchainBridgeManagerLogic.json @@ -0,0 +1,2324 @@ +{ + "abi": [ + { + "type": "function", + "name": "DOMAIN_SEPARATOR", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "addBridgeOperators", + "inputs": [ + { + "name": "voteWeights", + "type": "uint96[]", + "internalType": "uint96[]" + }, + { + "name": "governors", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "bridgeOperators", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "checkThreshold", + "inputs": [ + { + "name": "voteWeight", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getBridgeOperatorWeight", + "inputs": [ + { + "name": "bridgeOperator", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "weight", + "type": "uint96", + "internalType": "uint96" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getBridgeOperators", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address[]", + "internalType": "address[]" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getCallbackRegisters", + "inputs": [], + "outputs": [ + { + "name": "registers", + "type": "address[]", + "internalType": "address[]" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getContract", + "inputs": [ + { + "name": "contractType", + "type": "uint8", + "internalType": "enum ContractType" + } + ], + "outputs": [ + { + "name": "contract_", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getFullBridgeOperatorInfos", + "inputs": [], + "outputs": [ + { + "name": "governors", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "bridgeOperators", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "weights", + "type": "uint96[]", + "internalType": "uint96[]" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getGovernorOf", + "inputs": [ + { + "name": "operator", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "governor", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getGovernorWeight", + "inputs": [ + { + "name": "governor", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "weight", + "type": "uint96", + "internalType": "uint96" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getGovernorWeights", + "inputs": [ + { + "name": "governors", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [ + { + "name": "weights", + "type": "uint96[]", + "internalType": "uint96[]" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getGovernors", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address[]", + "internalType": "address[]" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getOperatorOf", + "inputs": [ + { + "name": "governor", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "operator", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getProposalExpiryDuration", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getThreshold", + "inputs": [], + "outputs": [ + { + "name": "num", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "denom", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getTotalWeight", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "globalProposalRelayed", + "inputs": [ + { + "name": "_round", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "initialize", + "inputs": [ + { + "name": "num", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "denom", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "roninChainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "bridgeContract", + "type": "address", + "internalType": "address" + }, + { + "name": "callbackRegisters", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "bridgeOperators", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "governors", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "voteWeights", + "type": "uint96[]", + "internalType": "uint96[]" + }, + { + "name": "targetOptions", + "type": "uint8[]", + "internalType": "enum GlobalProposal.TargetOption[]" + }, + { + "name": "targets", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "isBridgeOperator", + "inputs": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "minimumVoteWeight", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "registerCallbacks", + "inputs": [ + { + "name": "registers", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "relayGlobalProposal", + "inputs": [ + { + "name": "globalProposal", + "type": "tuple", + "internalType": "struct GlobalProposal.GlobalProposalDetail", + "components": [ + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiryTimestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "executor", + "type": "address", + "internalType": "address" + }, + { + "name": "targetOptions", + "type": "uint8[]", + "internalType": "enum GlobalProposal.TargetOption[]" + }, + { + "name": "values", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "calldatas", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "gasAmounts", + "type": "uint256[]", + "internalType": "uint256[]" + } + ] + }, + { + "name": "supports_", + "type": "uint8[]", + "internalType": "enum Ballot.VoteType[]" + }, + { + "name": "signatures", + "type": "tuple[]", + "internalType": "struct SignatureConsumer.Signature[]", + "components": [ + { + "name": "v", + "type": "uint8", + "internalType": "uint8" + }, + { + "name": "r", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "s", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "relayProposal", + "inputs": [ + { + "name": "proposal", + "type": "tuple", + "internalType": "struct Proposal.ProposalDetail", + "components": [ + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiryTimestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "executor", + "type": "address", + "internalType": "address" + }, + { + "name": "targets", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "values", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "calldatas", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "gasAmounts", + "type": "uint256[]", + "internalType": "uint256[]" + } + ] + }, + { + "name": "supports_", + "type": "uint8[]", + "internalType": "enum Ballot.VoteType[]" + }, + { + "name": "signatures", + "type": "tuple[]", + "internalType": "struct SignatureConsumer.Signature[]", + "components": [ + { + "name": "v", + "type": "uint8", + "internalType": "uint8" + }, + { + "name": "r", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "s", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "removeBridgeOperators", + "inputs": [ + { + "name": "bridgeOperators", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "resolveTargets", + "inputs": [ + { + "name": "targetOptions", + "type": "uint8[]", + "internalType": "enum GlobalProposal.TargetOption[]" + } + ], + "outputs": [ + { + "name": "targets", + "type": "address[]", + "internalType": "address[]" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "round", + "inputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "setContract", + "inputs": [ + { + "name": "contractType", + "type": "uint8", + "internalType": "enum ContractType" + }, + { + "name": "addr", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "setMinRequiredGovernor", + "inputs": [ + { + "name": "min", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "setThreshold", + "inputs": [ + { + "name": "num", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "denom", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "sumGovernorsWeight", + "inputs": [ + { + "name": "governors", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [ + { + "name": "sum", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "totalBridgeOperator", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "unregisterCallbacks", + "inputs": [ + { + "name": "registers", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "updateManyTargetOption", + "inputs": [ + { + "name": "targetOptions", + "type": "uint8[]", + "internalType": "enum GlobalProposal.TargetOption[]" + }, + { + "name": "targets", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "vote", + "inputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "status", + "type": "uint8", + "internalType": "enum VoteStatusConsumer.VoteStatus" + }, + { + "name": "hash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "againstVoteWeight", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "forVoteWeight", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiryTimestamp", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "event", + "name": "BridgeOperatorAddingFailed", + "inputs": [ + { + "name": "operator", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "BridgeOperatorRemovingFailed", + "inputs": [ + { + "name": "operator", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "BridgeOperatorUpdated", + "inputs": [ + { + "name": "governor", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "fromBridgeOperator", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "toBridgeOperator", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "BridgeOperatorsAdded", + "inputs": [ + { + "name": "statuses", + "type": "bool[]", + "indexed": false, + "internalType": "bool[]" + }, + { + "name": "voteWeights", + "type": "uint96[]", + "indexed": false, + "internalType": "uint96[]" + }, + { + "name": "governors", + "type": "address[]", + "indexed": false, + "internalType": "address[]" + }, + { + "name": "bridgeOperators", + "type": "address[]", + "indexed": false, + "internalType": "address[]" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "BridgeOperatorsRemoved", + "inputs": [ + { + "name": "statuses", + "type": "bool[]", + "indexed": false, + "internalType": "bool[]" + }, + { + "name": "bridgeOperators", + "type": "address[]", + "indexed": false, + "internalType": "address[]" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "CallbackRegistered", + "inputs": [ + { + "name": "", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "", + "type": "bool", + "indexed": false, + "internalType": "bool" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ContractUpdated", + "inputs": [ + { + "name": "contractType", + "type": "uint8", + "indexed": true, + "internalType": "enum ContractType" + }, + { + "name": "addr", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "GlobalProposalCreated", + "inputs": [ + { + "name": "round", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "proposalHash", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "proposal", + "type": "tuple", + "indexed": false, + "internalType": "struct Proposal.ProposalDetail", + "components": [ + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiryTimestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "executor", + "type": "address", + "internalType": "address" + }, + { + "name": "targets", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "values", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "calldatas", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "gasAmounts", + "type": "uint256[]", + "internalType": "uint256[]" + } + ] + }, + { + "name": "globalProposalHash", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + }, + { + "name": "globalProposal", + "type": "tuple", + "indexed": false, + "internalType": "struct GlobalProposal.GlobalProposalDetail", + "components": [ + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiryTimestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "executor", + "type": "address", + "internalType": "address" + }, + { + "name": "targetOptions", + "type": "uint8[]", + "internalType": "enum GlobalProposal.TargetOption[]" + }, + { + "name": "values", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "calldatas", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "gasAmounts", + "type": "uint256[]", + "internalType": "uint256[]" + } + ] + }, + { + "name": "creator", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Initialized", + "inputs": [ + { + "name": "version", + "type": "uint8", + "indexed": false, + "internalType": "uint8" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "MinRequiredGovernorUpdated", + "inputs": [ + { + "name": "min", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Notified", + "inputs": [ + { + "name": "callData", + "type": "bytes", + "indexed": false, + "internalType": "bytes" + }, + { + "name": "registers", + "type": "address[]", + "indexed": false, + "internalType": "address[]" + }, + { + "name": "statuses", + "type": "bool[]", + "indexed": false, + "internalType": "bool[]" + }, + { + "name": "returnDatas", + "type": "bytes[]", + "indexed": false, + "internalType": "bytes[]" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ProposalApproved", + "inputs": [ + { + "name": "proposalHash", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ProposalCreated", + "inputs": [ + { + "name": "chainId", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "round", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "proposalHash", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "proposal", + "type": "tuple", + "indexed": false, + "internalType": "struct Proposal.ProposalDetail", + "components": [ + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expiryTimestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "executor", + "type": "address", + "internalType": "address" + }, + { + "name": "targets", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "values", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "calldatas", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "gasAmounts", + "type": "uint256[]", + "internalType": "uint256[]" + } + ] + }, + { + "name": "creator", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ProposalExecuted", + "inputs": [ + { + "name": "proposalHash", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "successCalls", + "type": "bool[]", + "indexed": false, + "internalType": "bool[]" + }, + { + "name": "returnDatas", + "type": "bytes[]", + "indexed": false, + "internalType": "bytes[]" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ProposalExpired", + "inputs": [ + { + "name": "proposalHash", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ProposalExpiryDurationChanged", + "inputs": [ + { + "name": "duration", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ProposalRejected", + "inputs": [ + { + "name": "proposalHash", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ProposalVoted", + "inputs": [ + { + "name": "proposalHash", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "voter", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "support", + "type": "uint8", + "indexed": false, + "internalType": "enum Ballot.VoteType" + }, + { + "name": "weight", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "TargetOptionUpdated", + "inputs": [ + { + "name": "targetOption", + "type": "uint8", + "indexed": true, + "internalType": "enum GlobalProposal.TargetOption" + }, + { + "name": "addr", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ThresholdUpdated", + "inputs": [ + { + "name": "nonce", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "numerator", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "denominator", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "previousNumerator", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "previousDenominator", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "ErrBelowMinRequiredGovernors", + "inputs": [] + }, + { + "type": "error", + "name": "ErrContractTypeNotFound", + "inputs": [ + { + "name": "contractType", + "type": "uint8", + "internalType": "enum ContractType" + } + ] + }, + { + "type": "error", + "name": "ErrCurrentProposalIsNotCompleted", + "inputs": [] + }, + { + "type": "error", + "name": "ErrDuplicated", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrExistOneInternalCallFailed", + "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address" + }, + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + }, + { + "name": "callData", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "type": "error", + "name": "ErrGovernorNotFound", + "inputs": [ + { + "name": "governor", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ErrGovernorNotMatch", + "inputs": [ + { + "name": "required", + "type": "address", + "internalType": "address" + }, + { + "name": "sender", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ErrInsufficientGas", + "inputs": [ + { + "name": "proposalHash", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "type": "error", + "name": "ErrInvalidArguments", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrInvalidChainId", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + }, + { + "name": "actual", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expected", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "ErrInvalidExpiryTimestamp", + "inputs": [] + }, + { + "type": "error", + "name": "ErrInvalidInput", + "inputs": [] + }, + { + "type": "error", + "name": "ErrInvalidOrder", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrInvalidProposalNonce", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrInvalidThreshold", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrInvalidVoteWeight", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrLengthMismatch", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrLooseProposalInternallyRevert", + "inputs": [ + { + "name": "callIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "revertMsg", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "type": "error", + "name": "ErrNonExecutorCannotRelay", + "inputs": [ + { + "name": "executor", + "type": "address", + "internalType": "address" + }, + { + "name": "caller", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ErrOnlySelfCall", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrOperatorNotFound", + "inputs": [ + { + "name": "operator", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ErrRelayFailed", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrUnauthorized", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + }, + { + "name": "expectedRole", + "type": "uint8", + "internalType": "enum RoleAccess" + } + ] + }, + { + "type": "error", + "name": "ErrUnsupportedInterface", + "inputs": [ + { + "name": "interfaceId", + "type": "bytes4", + "internalType": "bytes4" + }, + { + "name": "addr", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ErrUnsupportedVoteType", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrVoteIsFinalized", + "inputs": [] + }, + { + "type": "error", + "name": "ErrZeroAddress", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrZeroCodeContract", + "inputs": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + } + ] + } + ], + "address": "0x31b070817dbF268Bfe1484bD1b4D902c8c4f62df", + "args": "0x", + "ast": "", + "blockNumber": 5709352, + "bytecode": "0x60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61519e80620000f46000396000f3fe608060405234801561001057600080fd5b50600436106102065760003560e01c80639b19dbfd1161011a578063cc7e6b3b116100ad578063de981f1b1161007c578063de981f1b146104ae578063e75235b8146104c1578063e9c03498146104de578063f80b5352146104f1578063f896f070146104f957600080fd5b8063cc7e6b3b14610460578063d0a50db014610480578063d78392f814610488578063dafae4081461049b57600080fd5b8063b405aaf2116100e9578063b405aaf21461041b578063b9c362091461042e578063bc96180b14610441578063c441c4a81461044957600080fd5b80639b19dbfd14610392578063a64a83801461039a578063aee1767f146103ad578063b384abef146103c057600080fd5b80633644e5151161019d5780637f7fe0581161016c5780637f7fe05814610303578063800eaab31461032e578063865e6fd3146103415780638dc0dbc614610354578063901979d51461036757600080fd5b80633644e515146102bc57806362077409146102c5578063776fb1ec146102d85780637de5dedd146102fb57600080fd5b80631f425338116101d95780631f425338146102635780632d6d7d731461027657806334d5f37b1461028957806335da8121146102a957600080fd5b806301a5f43f1461020b57806306aba0e1146102205780630a44fa431461023b5780630f7c31891461024e575b600080fd5b61021e610219366004613fd0565b61050c565b005b6102286105bb565b6040519081526020015b60405180910390f35b610228610249366004614069565b6105ca565b61025661064f565b60405161023291906140ef565b61021e610271366004614069565b610668565b610256610284366004614069565b61070a565b610228610297366004614102565b60026020526000908152604090205481565b61021e6102b7366004614069565b610751565b61022860015481565b61021e6102d336600461415f565b610799565b6102eb6102e6366004614102565b6107c9565b6040519015158152602001610232565b610228610816565b610316610311366004614212565b61086c565b6040516001600160a01b039091168152602001610232565b61021e61033c3660046143c4565b6108ed565b61021e61034f366004614436565b610925565b61021e610362366004614469565b610940565b61037a610375366004614212565b61096a565b6040516001600160601b039091168152602001610232565b6102566109a0565b61021e6103a8366004614102565b610a0b565b6103166103bb366004614212565b610a1f565b61040a6103ce3660046144ad565b600360208181526000938452604080852090915291835291208054600182015460028301549383015460069093015460ff909216939092909185565b6040516102329594939291906144e5565b6102eb610429366004614212565b610a31565b61021e61043c3660046144ad565b610a69565b600454610228565b610451610a7b565b60405161023293929190614554565b61047361046e366004614069565b610b55565b6040516102329190614597565b610228610b93565b61037a610496366004614212565b610ba6565b6102eb6104a9366004614102565b610bb1565b6103166104bc3660046145aa565b610c03565b6104c9610c7e565b60408051928352602083019190915201610232565b61021e6104ec366004614069565b610cc6565b610256610d0f565b61021e61050736600461463a565b610d72565b610514610eac565b6105b286868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808a0282810182019093528982529093508992508891829185019084908082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250610f0892505050565b50505050505050565b60006105c561126a565b905090565b600082828080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061060b925083915061127d9050565b6106478484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506112b292505050565b949350505050565b60606105c5600080516020615149833981519152611337565b610670610eac565b8181808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506106af925083915061127d9050565b60008051602061514983398151915260005b83811015610703576106fa8585838181106106de576106de61475f565b90506020020160208101906106f39190614212565b839061134b565b506001016106c1565b5050505050565b606061074883838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250611360915050565b90505b92915050565b610759610eac565b6107958282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506114b392505050565b5050565b6107a233611570565b6107bb6107b56060870160408801614212565b336115b2565b61070385858585853361160d565b60008060008381527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff602052604090205460ff16600481111561080e5761080e6144cf565b141592915050565b600080610821611641565b905060008061082e610c7e565b9150915080600182856004015485610846919061478b565b61085091906147a2565b61085a91906147b5565b61086491906147c8565b935050505090565b600080600061088261087c611641565b85611665565b91509150816108b45760405163141e2e1f60e11b81526001600160a01b03851660048201526024015b60405180910390fd5b6108bc611641565b60010181815481106108d0576108d061475f565b6000918252602090912001546001600160a01b0316949350505050565b33301461091b576000356001600160e01b0319166040516307337e1960e41b81526004016108ab91906147ea565b61079582826116ca565b61092d610eac565b61093681611773565b61079582826117a9565b61094933611570565b61095c6107b56080870160608801614212565b61070385858585853361184d565b600080610975611641565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b031690565b60606109aa611641565b600101805480602002602001604051908101604052809291908181526020018280548015610a0157602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116109e3575b5050505050905090565b610a13610eac565b610a1c81611881565b50565b6000610a2a826118ee565b5092915050565b600080610a3c611641565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b0316151590565b610a71610eac565b610795828261196e565b60608060606000610a8a611641565b805460408051602080840282018101909252828152929350839190830182828015610ade57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610ac0575b5050505050935080600101805480602002602001604051908101604052809291908181526020018280548015610b3d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b1f575b50505050509250610b4d84611a70565b915050909192565b6060610748838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611a7092505050565b6000610b9d611641565b60010154919050565b600061074b82611b5c565b60007ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00610bdc61126a565b8160010154610beb919061478b565b6002820154610bfa908561478b565b10159392505050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115610c3a57610c3a6144cf565b60ff1681526020810191909152604001600020546001600160a01b0316905080610c79578160405163409140df60e11b81526004016108ab91906147ff565b919050565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f01547ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f02549091565b610cce610eac565b610d0a828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611b9192505050565b505050565b6060610d19611641565b805460408051602080840282018101909252828152929190830182828015610a01576020028201919060005260206000209081546001600160a01b031681526001909101906020018083116109e3575050505050905090565b600054610100900460ff1615808015610d925750600054600160ff909116105b80610dac5750303b158015610dac575060005460ff166001145b610e0f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016108ab565b6000805460ff191660011790558015610e32576000805461ff0019166101001790555b610e3f600160ff1b611f77565b610e498383611fa7565b610e598b8b8b8b8b8b8b8b611fd8565b8015610e9f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610f06576000356001600160e01b0319166001604051620f948f60ea1b81526004016108ab929190614819565b565b6060610f148383612029565b610f1d8161127d565b6000610f27611641565b845187519192509081148015610f3d5750855181145b610f68576000356001600160e01b0319166040516306b5667560e21b81526004016108ab91906147ea565b806001600160401b03811115610f8057610f8061422d565b604051908082528060200260200182016040528015610fa9578160200160208202803683370190505b50935080600003610fbb575050611262565b60008060008060005b858110156111ce578a8181518110610fde57610fde61475f565b60200260200101519450898181518110610ffa57610ffa61475f565b602002602001015193508b81815181106110165761101661475f565b6020026020010151925061102985612133565b61103284612133565b826001600160601b031660000361106a576000356001600160e01b031916604051637f11b8a360e11b81526004016108ab91906147ea565b6001600160a01b03808616600081815260038a01602090815260408083205494891683528083205460028d0190925280832054938352909120546001600160601b0393841693918216926110c2929081169116614847565b6110cc9190614847565b6110d69190614847565b6001600160601b03166000148982815181106110f4576110f461475f565b6020026020010190151590811515815250508881815181106111185761111861475f565b6020026020010151156111c6578654600181810189556000898152602080822090930180546001600160a01b03808b166001600160a01b0319928316811790935591835260028c018552604080842080546001600160601b038b166001600160601b03199182168117909255868f018054978801815586528786209096018054948c1694909316841790925591835260038c0190945290208054909116821790556111c390836147a2565b91505b600101610fc4565b50808660040160008282546111e391906147a2565b909155505060405161121e906347c28ec560e11b9061120a908c908f908d9060200161489a565b604051602081830303815290604052612168565b7f897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b78888c8c8c60405161125394939291906148d3565b60405180910390a15050505050505b509392505050565b6000611274611641565b60040154905090565b61128681612195565b15610a1c576000356001600160e01b031916604051630d697db160e11b81526004016108ab91906147ea565b6000816112be8161127d565b60006112c8611641565b905060005b845181101561132f578160020160008683815181106112ee576112ee61475f565b6020908102919091018101516001600160a01b0316825281019190915260400160002054611325906001600160601b0316856147a2565b93506001016112cd565b505050919050565b6060600061134483612234565b9392505050565b6000610748836001600160a01b038416612290565b606082516001600160401b0381111561137b5761137b61422d565b6040519080825280602002602001820160405280156113a4578160200160208202803683370190505b50905060005b8351811015610a2a57600560008583815181106113c9576113c961475f565b602002602001015160058111156113e2576113e26144cf565b60058111156113f3576113f36144cf565b815260200190815260200160002060009054906101000a90046001600160a01b03168282815181106114275761142761475f565b60200260200101906001600160a01b031690816001600160a01b03168152505082801561147f575060006001600160a01b031682828151811061146c5761146c61475f565b60200260200101516001600160a01b0316145b156114ab576000356001600160e01b03191660405163053265f160e01b81526004016108ab91906147ea565b6001016113aa565b806114bd8161127d565b600080516020615149833981519152600080805b8551811015611568578581815181106114ec576114ec61475f565b602002602001015192506114ff83611773565b611510836312c0151560e21b612383565b61151a8484612516565b604080516001600160a01b038616815282151560208201529193507fb85c58eeff9fe423669ae0841666f4c8499e8731b8275eb462e4fa1720ec420e910160405180910390a16001016114d1565b505050505050565b61157981611b5c565b6001600160601b0316600003610a1c576000356001600160e01b0319166003604051620f948f60ea1b81526004016108ab929190614819565b6001600160a01b038216158015906115dc5750816001600160a01b0316816001600160a01b031614155b15610795576040516301df97c360e51b81526001600160a01b038084166004830152821660248201526044016108ab565b600061162161161b88614a6e565b8361252b565b90506105b2818787878761163c6116378e614a6e565b61263d565b61277c565b7fc648703095712c0419b6431ae642c061f0a105ac2d7c3d9604061ef4ebc3830090565b60008060005b84548110156116b8578481815481106116865761168661475f565b6000918252602090912001546001600160a01b03908116908516036116b0576001925090506116c3565b60010161166b565b506000600019915091505b9250929050565b60005b8251811015610d0a57306001600160a01b03168282815181106116f2576116f261475f565b60200260200101516001600160a01b03160361172f576000356001600160e01b03191660405163053265f160e01b81526004016108ab91906147ea565b61176b8382815181106117445761174461475f565b602002602001015183838151811061175e5761175e61475f565b6020026020010151612c48565b6001016116cd565b806001600160a01b03163b600003610a1c57604051630bfc64a360e21b81526001600160a01b03821660048201526024016108ab565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f8111156117df576117df6144cf565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115611820576118206144cf565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b61185f61185987614b49565b82612cdb565b5061156861186c87614b49565b8686868661163c61187c8d614b49565b612de2565b60038110156118a3576040516305f4dee960e31b815260040160405180910390fd5b60006118ad611641565b600581018390556040518381529091507f22d5bb5059ffe2949a098666fc198587200c8118483074120d3ca7050c7753f19060200160405180910390a15050565b6000806000806119086118ff611641565b60010186611665565b9150915081611935576040516326527e1760e01b81526001600160a01b03861660048201526024016108ab565b61193d611641565b80548290811061194f5761194f61475f565b6000918252602090912001546001600160a01b03169590945092505050565b8082118061197d575060018111155b156119a9576000356001600160e01b0319166040516387f6f09560e01b81526004016108ab91906147ea565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f0180547ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f028054928590558390557ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00805490929084908690856000611a2c83614c2f565b9091555060408051868152602081018690527f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a45050505050565b60606000611a7c611641565b905082516001600160401b03811115611a9757611a9761422d565b604051908082528060200260200182016040528015611ac0578160200160208202803683370190505b50915060005b8351811015611b5557816002016000858381518110611ae757611ae761475f565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160601b0316838281518110611b3557611b3561475f565b6001600160601b0390921660209283029190910190910152600101611ac6565b5050919050565b6000611b66611641565b6001600160a01b0390921660009081526002929092016020525060409020546001600160601b031690565b606081611b9d8161127d565b6000611ba7611641565b8451909150806001600160401b03811115611bc457611bc461422d565b604051908082528060200260200182016040528015611bed578160200160208202803683370190505b50935080600003611bff575050611f71565b60058201548254611c119083906147b5565b1015611c305760405163b2e765cb60e01b815260040160405180910390fd5b60008060008060005b85811015611ef757898181518110611c5357611c5361475f565b60200260200101519350611c66846118ee565b9095509150611c7485612133565b611c7d84612133565b6001600160a01b03851660009081526002880160205260409020546001600160601b031615801590611cd157506001600160a01b03841660009081526003880160205260409020546001600160601b031615155b898281518110611ce357611ce361475f565b602002602001019015159081151581525050888181518110611d0757611d0761475f565b602002602001015115611eef576001600160a01b038516600090815260028801602052604081205488546001600160601b039091169190611d4a906001906147b5565b9050886000018181548110611d6157611d6161475f565b60009182526020909120015489546001600160a01b03909116908a9086908110611d8d57611d8d61475f565b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790558854899080611dc757611dc7614c48565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038916825260028b0190526040902080546001600160601b031916905560018901805482908110611e2757611e2761475f565b60009182526020909120015460018a0180546001600160a01b039092169186908110611e5557611e5561475f565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555088600101805480611e9657611e96614c48565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038816825260038b0190526040902080546001600160601b0319169055611eea82866147a2565b945050505b600101611c39565b5081866004016000828254611f0c91906147b5565b9091555050604051611f3190636242a4ef60e11b9061120a908c908c90602001614c5e565b7fdf3dcd7987202f64648f3acdbf12401e3a2bb23e77e19f99826b5475cbb86369888a604051611f62929190614c8c565b60405180910390a15050505050505b50919050565b600054610100900460ff16611f9e5760405162461bcd60e51b81526004016108ab90614cb1565b610a1c81612f2c565b600054610100900460ff16611fce5760405162461bcd60e51b81526004016108ab90614cb1565b6107958282612f5c565b600054610100900460ff16611fff5760405162461bcd60e51b81526004016108ab90614cb1565b6120098888612f8e565b61201284612fe5565b61201f8686858585613015565b5050505050505050565b81518151606091908082016001600160401b0381111561204b5761204b61422d565b604051908082528060200260200182016040528015612074578160200160208202803683370190505b50925060005b828110156120ce578581815181106120945761209461475f565b60200260200101518482815181106120ae576120ae61475f565b6001600160a01b039092166020928302919091019091015260010161207a565b60005b82811015612129578581815181106120eb576120eb61475f565b60200260200101518583815181106121055761210561475f565b6001600160a01b0390921660209283029190910190910152600191820191016120d1565b5050505092915050565b6001600160a01b038116610a1c576000356001600160e01b03191660405163104c66df60e31b81526004016108ab91906147ea565b612172828261313f565b610795573382826040516319b5fdcb60e31b81526004016108ab93929190614d4c565b600081516000036121a857506000919050565b60005b600183510381101561222b57600181015b8351811015612222578381815181106121d7576121d761475f565b60200260200101516001600160a01b03168483815181106121fa576121fa61475f565b60200260200101516001600160a01b03160361221a575060019392505050565b6001016121bc565b506001016121ab565b50600092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561228457602002820191906000526020600020905b815481526020019060010190808311612270575b50505050509050919050565b600081815260018301602052604081205480156123795760006122b46001836147b5565b85549091506000906122c8906001906147b5565b905081811461232d5760008660000182815481106122e8576122e861475f565b906000526020600020015490508087600001848154811061230b5761230b61475f565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061233e5761233e614c48565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061074b565b600091505061074b565b60008160405160240161239691906147ea565b60408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b1790525190915060009081906001600160a01b038616906123df908590614d80565b600060405180830381855afa9150503d806000811461241a576040519150601f19603f3d011682016040523d82523d6000602084013e61241f565b606091505b5091509150816124e157846001600160a01b0316836040516024016124449190614d9c565b60408051601f198184030181529181526020820180516001600160e01b03166325da93a560e11b179052516124799190614d80565b600060405180830381855afa9150503d80600081146124b4576040519150601f19603f3d011682016040523d82523d6000602084013e6124b9565b606091505b509092509050816124e157838560405163069d427960e11b81526004016108ab929190614daf565b808060200190518101906124f59190614dd2565b61070357838560405163069d427960e11b81526004016108ab929190614daf565b6000610748836001600160a01b038416613471565b612533613f0c565b61254c61254584606001516001611360565b84906134c0565b9050612563600454826135c690919063ffffffff16565b600061256e82612de2565b9050600061257c6000613667565b60008181527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff6020908152604090912090870151600182018590556006909101559050825181146125ee576000356001600160e01b03191660405163d4cec26960e01b81526004016108ab91906147ea565b81817fe5af2d3fb7bcab8f865476bc675bf1bbb8b5a749c827ee1cd215dc9c2b8f92d78561261b8961263d565b898960405161262d9493929190614f5d565b60405180910390a3505092915050565b6080810151606082015160a083015151600092919083906001600160401b0381111561266b5761266b61422d565b604051908082528060200260200182016040528015612694578160200160208202803683370190505b5060c086015190915060005b82518110156126f3578660a0015181815181106126bf576126bf61475f565b6020026020010151805190602001208382815181106126e0576126e061475f565b60209081029190910101526001016126a0565b50604080517fde480f0c53a3651c08fbab1dffbc45fe574f31188827fe52cb9035da9fe57e4a8152875160208083019190915280890151828401529790910151606082015283518702938701939093206080840152835186029386019390932060a0830152805185029085012060c082015281518402919093012060e083015250610100902090565b831580159061278a57508382145b6127b5576000356001600160e01b0319166040516306b5667560e21b81526004016108ab91906147ea565b60006128426127c360015490565b612802846000604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b60405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b9050600061289161285260015490565b612802856001604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b90506000846001600160401b038111156128ad576128ad61422d565b6040519080825280602002602001820160405280156128d6578160200160208202803683370190505b5090506000856001600160401b038111156128f3576128f361422d565b60405190808252806020026020018201604052801561291c578160200160208202803683370190505b50905060008060008060003660005b8c811015612ab0578d8d828181106129455761294561475f565b90506060020191508f8f8281811061295f5761295f61475f565b9050602002016020810190612974919061501e565b9250600083600181111561298a5761298a6144cf565b036129f4576129af8b6129a0602085018561503f565b84602001358560400135613703565b94508489886129bd81614c2f565b9950815181106129cf576129cf61475f565b60200260200101906001600160a01b031690816001600160a01b031681525050612a65565b6001836001811115612a0857612a086144cf565b03612a3e57612a1e8a6129a0602085018561503f565b9450848887612a2c81614c2f565b9850815181106129cf576129cf61475f565b6000356001600160e01b031916604051630612418f60e11b81526004016108ab91906147ea565b846001600160a01b0316846001600160a01b031610612aa5576000356001600160e01b031916604051635d3dcd3160e01b81526004016108ab91906147ea565b84935060010161292b565b505050928552508252506020808b015160009081526003825260408082208d51835290925290812090612ae161372b565b90506000612aee85613735565b9050818110612b755780600003612b26576000356001600160e01b031916604051637f11b8a360e11b81526004016108ab91906147ea565b825460ff1916600190811784558301546040517f5c819725ea53655a3b898f3df59b66489761935454e9212ca1e5ebd759953d0b90600090a2612b69838e613740565b50505050505050611568565b600082612b806137ad565b612b8a91906147b5565b612b959060016147a2565b90506000612ba286613735565b9050818110612c215780600003612bda576000356001600160e01b031916604051637f11b8a360e11b81526004016108ab91906147ea565b845460ff1916600317855560018501546040517f55295d4ce992922fa2e5ffbf3a3dcdb367de0a15e125ace083456017fd22060f90600090a2505050505050505050611568565b6000356001600160e01b031916604051634ccfe64360e11b81526004016108ab91906147ea565b8060056000846005811115612c5f57612c5f6144cf565b6005811115612c7057612c706144cf565b8152602081019190915260400160002080546001600160a01b0319166001600160a01b039283161790558116826005811115612cae57612cae6144cf565b6040517f356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d90600090a35050565b6020820151600090808203612d1d5760405163092048d160e11b8152600080356001600160e01b031916600483015260248201524660448201526064016108ab565b600454612d2b9085906135c6565b6000612d3685612de2565b9050612d4182613667565b6000838152600360209081526040808320848452909152908190209087015160018201849055600690910155925084518314612d9e576000356001600160e01b03191660405163d4cec26960e01b81526004016108ab91906147ea565b8083837fd1221ffb98610024a29755d7db3c71692310f43a7cfcce7ee488a8c7e9e0bfa48888604051612dd2929190615062565b60405180910390a4505092915050565b60a0810151608082015160c083015151600092919083906001600160401b03811115612e1057612e1061422d565b604051908082528060200260200182016040528015612e39578160200160208202803683370190505b5060e086015190915060005b8251811015612e98578660c001518181518110612e6457612e6461475f565b602002602001015180519060200120838281518110612e8557612e8561475f565b6020908102919091010152600101612e45565b50604080517f1b59eeec7c321899dc1e7a5b3d876c9a445dffc6d2f96ba842d7489908fdee1281528751602080830191909152808901518284015291880151606080830191909152909701516080880152835181029381019390932060a0870152835183029383019390932060c0860152805182029082012060e08501528151810291012061010083015250610120902090565b600054610100900460ff16612f535760405162461bcd60e51b81526004016108ab90614cb1565b610a1c816137b7565b600054610100900460ff16612f835760405162461bcd60e51b81526004016108ab90614cb1565b61091b600030612c48565b600054610100900460ff16612fb55760405162461bcd60e51b81526004016108ab90614cb1565b60017ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00908155610d0a838361196e565b600054610100900460ff1661300c5760405162461bcd60e51b81526004016108ab90614cb1565b610a1c816114b3565b600054610100900460ff1661303c5760405162461bcd60e51b81526004016108ab90614cb1565b6130476002856117a9565b604080516020808201839052600e60608301526d212924a223a2afa6a0a720a3a2a960911b6080808401919091528284018990528351808403909101815260a0830184528051908201207f599a80fcaa47b95e2323ab4d34d34e0cc9feda4b843edafcc30c7bdf60ea15bf60c08401527fe4d2346818310a10fac5a6d073d3dce255578caf4aa81ddcbcc7c2b98405eef060e08401527f2a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4de61010084015261012080840191909152835180840390910181526101409092019092528051910120600155613134818385610f08565b506107036003611881565b6001600061315a600080516020615149833981519152611337565b8051909150600081900361316f57505061074b565b6000816001600160401b038111156131895761318961422d565b6040519080825280602002602001820160405280156131b2578160200160208202803683370190505b5090506000826001600160401b038111156131cf576131cf61422d565b60405190808252806020026020018201604052801561320257816020015b60608152602001906001900390816131ed5790505b5090506000878760405160200161321a92919061508c565b604051602081830303815290604052905060008160405160240161323e9190614d9c565b60408051601f198184030181529190526020810180516001600160e01b03166325da93a560e11b179052905060005b85811015613427578681815181106132875761328761475f565b60200260200101516001600160a01b0316836040516132a69190614d80565b6000604051808303816000865af19150503d80600081146132e3576040519150601f19603f3d011682016040523d82523d6000602084013e6132e8565b606091505b508683815181106132fb576132fb61475f565b602002602001018684815181106133145761331461475f565b602002602001018290528215151515815250505084818151811061333a5761333a61475f565b602002602001015161341f578681815181106133585761335861475f565b60200260200101516001600160a01b0316826040516133779190614d80565b6000604051808303816000865af19150503d80600081146133b4576040519150601f19603f3d011682016040523d82523d6000602084013e6133b9565b606091505b508683815181106133cc576133cc61475f565b602002602001018684815181106133e5576133e561475f565b602002602001018290528215151515815250505087801561341c57508481815181106134135761341361475f565b60200260200101515b97505b60010161326d565b507fc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b638287868660405161345d94939291906150bd565b60405180910390a150505050505092915050565b60008181526001830160205260408120546134b85750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561074b565b50600061074b565b6134c8613f0c565b8251815260006020808301919091528301516040808301919091528301516001600160a01b0316606080830191909152830151516001600160401b038111156135135761351361422d565b60405190808252806020026020018201604052801561353c578160200160208202803683370190505b5060808083019190915283015160a08083019190915283015160c08083019190915283015160e082015260005b836060015151811015610a2a578281815181106135885761358861475f565b6020026020010151826080015182815181106135a6576135a661475f565b6001600160a01b0390921660209283029190910190910152600101613569565b60008260800151511180156135e457508160a0015151826080015151145b80156135f957508160c0015151826080015151145b801561360e57508160e0015151826080015151145b613639576000356001600160e01b0319166040516306b5667560e21b81526004016108ab91906147ea565b61364381426147a2565b826040015111156107955760405163ad89be9d60e01b815260040160405180910390fd5b600081815260026020526040812054908190036136965750600090815260026020526040902060019081905590565b60008281526003602090815260408083208484529091528120906000825460ff1660048111156136c8576136c86144cf565b036136e65760405163757a436360e01b815260040160405180910390fd5b505050600090815260026020526040902080546001019081905590565b60008060006137148787878761399c565b9150915061372181613a89565b5095945050505050565b60006105c5610816565b600061074b826112b2565b61374981613c3f565b1561079557815460ff1916600217825560008061376583613c59565b9150915083600101547fe134987599ae266ec90edeff1b26125b287dbb57b10822649432d1bb26537fba838360405161379f92919061510a565b60405180910390a250505050565b60006105c56105bb565b600481905560405181907fe5cd1c123a8cf63fa1b7229678db61fe8ae99dbbd27889370b6667c8cae97da190600090a250565b600483015481101561389d578260080160008460040183815481106138115761381161475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff19169055600484018054600786019291908490811061385a5761385a61475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff191681556001818101839055600290910191909155016137ea565b5060005b6005830154811015613954578260080160008460050183815481106138c8576138c861475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff1916905560058401805460078601929190849081106139115761391161475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff191681556001818101839055600290910191909155016138a1565b50815460ff191682556000600183018190556002830181905560038301819055613982906004840190613f5a565b613990600583016000613f5a565b60006006830155919050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156139d35750600090506003613a80565b8460ff16601b141580156139eb57508460ff16601c14155b156139fc5750600090506004613a80565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613a50573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613a7957600060019250925050613a80565b9150600090505b94509492505050565b6000816004811115613a9d57613a9d6144cf565b03613aa55750565b6001816004811115613ab957613ab96144cf565b03613b065760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016108ab565b6002816004811115613b1a57613b1a6144cf565b03613b675760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016108ab565b6003816004811115613b7b57613b7b6144cf565b03613bd35760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016108ab565b6004816004811115613be757613be76144cf565b03610a1c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016108ab565b600081602001516000148061074b57505060200151461490565b606080613c6583613c3f565b613ca357602083015160405163092048d160e11b81526000356001600160e01b031916600482015260248101919091524660448201526064016108ab565b8260800151516001600160401b03811115613cc057613cc061422d565b604051908082528060200260200182016040528015613ce9578160200160208202803683370190505b5091508260800151516001600160401b03811115613d0957613d0961422d565b604051908082528060200260200182016040528015613d3c57816020015b6060815260200190600190039081613d275790505b50905060005b836080015151811015613f06578360e001518181518110613d6557613d6561475f565b60200260200101515a11613d9857613d7c84612de2565b6040516307aec4ab60e21b81526004016108ab91815260200190565b83608001518181518110613dae57613dae61475f565b60200260200101516001600160a01b03168460a001518281518110613dd557613dd561475f565b60200260200101518560e001518381518110613df357613df361475f565b6020026020010151908660c001518481518110613e1257613e1261475f565b6020026020010151604051613e279190614d80565b600060405180830381858888f193505050503d8060008114613e65576040519150601f19603f3d011682016040523d82523d6000602084013e613e6a565b606091505b50848381518110613e7d57613e7d61475f565b60200260200101848481518110613e9657613e9661475f565b6020026020010182905282151515158152505050828181518110613ebc57613ebc61475f565b6020026020010151613efe5780828281518110613edb57613edb61475f565b60200260200101516040516376df417560e11b81526004016108ab92919061512f565b600101613d42565b50915091565b60405180610100016040528060008152602001600081526020016000815260200160006001600160a01b03168152602001606081526020016060815260200160608152602001606081525090565b5080546000825590600052602060002090810190610a1c91905b80821115613f885760008155600101613f74565b5090565b60008083601f840112613f9e57600080fd5b5081356001600160401b03811115613fb557600080fd5b6020830191508360208260051b85010111156116c357600080fd5b60008060008060008060608789031215613fe957600080fd5b86356001600160401b038082111561400057600080fd5b61400c8a838b01613f8c565b9098509650602089013591508082111561402557600080fd5b6140318a838b01613f8c565b9096509450604089013591508082111561404a57600080fd5b5061405789828a01613f8c565b979a9699509497509295939492505050565b6000806020838503121561407c57600080fd5b82356001600160401b0381111561409257600080fd5b61409e85828601613f8c565b90969095509350505050565b60008151808452602080850194506020840160005b838110156140e45781516001600160a01b0316875295820195908201906001016140bf565b509495945050505050565b60208152600061074860208301846140aa565b60006020828403121561411457600080fd5b5035919050565b60008083601f84011261412d57600080fd5b5081356001600160401b0381111561414457600080fd5b6020830191508360206060830285010111156116c357600080fd5b60008060008060006060868803121561417757600080fd5b85356001600160401b038082111561418e57600080fd5b9087019060e0828a0312156141a257600080fd5b909550602087013590808211156141b857600080fd5b6141c489838a01613f8c565b909650945060408801359150808211156141dd57600080fd5b506141ea8882890161411b565b969995985093965092949392505050565b80356001600160a01b0381168114610c7957600080fd5b60006020828403121561422457600080fd5b610748826141fb565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b03811182821017156142655761426561422d565b60405290565b60405161010081016001600160401b03811182821017156142655761426561422d565b604051601f8201601f191681016001600160401b03811182821017156142b6576142b661422d565b604052919050565b60006001600160401b038211156142d7576142d761422d565b5060051b60200190565b600082601f8301126142f257600080fd5b81356020614307614302836142be565b61428e565b8083825260208201915060208460051b87010193508684111561432957600080fd5b602086015b84811015614353578035600681106143465760008081fd5b835291830191830161432e565b509695505050505050565b600082601f83011261436f57600080fd5b8135602061437f614302836142be565b8083825260208201915060208460051b8701019350868411156143a157600080fd5b602086015b84811015614353576143b7816141fb565b83529183019183016143a6565b600080604083850312156143d757600080fd5b82356001600160401b03808211156143ee57600080fd5b6143fa868387016142e1565b9350602085013591508082111561441057600080fd5b5061441d8582860161435e565b9150509250929050565b803560108110610c7957600080fd5b6000806040838503121561444957600080fd5b61445283614427565b9150614460602084016141fb565b90509250929050565b60008060008060006060868803121561448157600080fd5b85356001600160401b038082111561449857600080fd5b90870190610100828a0312156141a257600080fd5b600080604083850312156144c057600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60a08101600587106144f9576144f96144cf565b95815260208101949094526040840192909252606083015260809091015290565b60008151808452602080850194506020840160005b838110156140e45781516001600160601b03168752958201959082019060010161452f565b60608152600061456760608301866140aa565b828103602084015261457981866140aa565b9050828103604084015261458d818561451a565b9695505050505050565b602081526000610748602083018461451a565b6000602082840312156145bc57600080fd5b61074882614427565b600082601f8301126145d657600080fd5b813560206145e6614302836142be565b8083825260208201915060208460051b87010193508684111561460857600080fd5b602086015b848110156143535780356001600160601b038116811461462d5760008081fd5b835291830191830161460d565b6000806000806000806000806000806101408b8d03121561465a57600080fd5b8a35995060208b0135985060408b0135975061467860608c016141fb565b965060808b01356001600160401b038082111561469457600080fd5b6146a08e838f0161435e565b975060a08d01359150808211156146b657600080fd5b6146c28e838f0161435e565b965060c08d01359150808211156146d857600080fd5b6146e48e838f0161435e565b955060e08d01359150808211156146fa57600080fd5b6147068e838f016145c5565b94506101008d013591508082111561471d57600080fd5b6147298e838f016142e1565b93506101208d013591508082111561474057600080fd5b5061474d8d828e0161435e565b9150509295989b9194979a5092959850565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761074b5761074b614775565b8082018082111561074b5761074b614775565b8181038181111561074b5761074b614775565b6000826147e557634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031991909116815260200190565b6020810160108310614813576148136144cf565b91905290565b6001600160e01b03198316815260408101600b831061483a5761483a6144cf565b8260208301529392505050565b6001600160601b03818116838216019080821115610a2a57610a2a614775565b60008151808452602080850194506020840160005b838110156140e457815115158752958201959082019060010161487c565b6060815260006148ad60608301866140aa565b82810360208401526148bf818661451a565b9050828103604084015261458d8185614867565b6080815260006148e66080830187614867565b82810360208401526148f8818761451a565b9050828103604084015261490c81866140aa565b9050828103606084015261492081856140aa565b979650505050505050565b600082601f83011261493c57600080fd5b8135602061494c614302836142be565b8083825260208201915060208460051b87010193508684111561496e57600080fd5b602086015b848110156143535780358352918301918301614973565b6000601f83601f84011261499d57600080fd5b823560206149ad614302836142be565b82815260059290921b850181019181810190878411156149cc57600080fd5b8287015b84811015614a625780356001600160401b03808211156149f05760008081fd5b818a0191508a603f830112614a055760008081fd5b85820135604082821115614a1b57614a1b61422d565b614a2c828b01601f1916890161428e565b92508183528c81838601011115614a435760008081fd5b81818501898501375060009082018701528452509183019183016149d0565b50979650505050505050565b600060e08236031215614a8057600080fd5b614a88614243565b8235815260208301356020820152614aa2604084016141fb565b604082015260608301356001600160401b0380821115614ac157600080fd5b614acd368387016142e1565b60608401526080850135915080821115614ae657600080fd5b614af23683870161492b565b608084015260a0850135915080821115614b0b57600080fd5b614b173683870161498a565b60a084015260c0850135915080821115614b3057600080fd5b50614b3d3682860161492b565b60c08301525092915050565b60006101008236031215614b5c57600080fd5b614b6461426b565b823581526020830135602082015260408301356040820152614b88606084016141fb565b606082015260808301356001600160401b0380821115614ba757600080fd5b614bb33683870161435e565b608084015260a0850135915080821115614bcc57600080fd5b614bd83683870161492b565b60a084015260c0850135915080821115614bf157600080fd5b614bfd3683870161498a565b60c084015260e0850135915080821115614c1657600080fd5b50614c233682860161492b565b60e08301525092915050565b600060018201614c4157614c41614775565b5060010190565b634e487b7160e01b600052603160045260246000fd5b604081526000614c7160408301856140aa565b8281036020840152614c838185614867565b95945050505050565b604081526000614c9f6040830185614867565b8281036020840152614c8381856140aa565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60005b83811015614d17578181015183820152602001614cff565b50506000910152565b60008151808452614d38816020860160208601614cfc565b601f01601f19169290920160200192915050565b6001600160a01b03841681526001600160e01b031983166020820152606060408201819052600090614c8390830184614d20565b60008251614d92818460208701614cfc565b9190910192915050565b6020815260006107486020830184614d20565b6001600160e01b03199290921682526001600160a01b0316602082015260400190565b600060208284031215614de457600080fd5b8151801515811461134457600080fd5b60008151808452602080850194506020840160005b838110156140e457815187529582019590820190600101614e09565b60008282518085526020808601955060208260051b8401016020860160005b84811015614e7257601f19868403018952614e60838351614d20565b98840198925090830190600101614e44565b5090979650505050505050565b60006101008251845260208301516020850152604083015160408501526060830151614eb660608601826001600160a01b03169052565b506080830151816080860152614ece828601826140aa565b91505060a083015184820360a0860152614ee88282614df4565b91505060c083015184820360c0860152614f028282614e25565b91505060e083015184820360e0860152614c838282614df4565b60008151808452602080850194506020840160005b838110156140e457815160068110614f4b57614f4b6144cf565b87529582019590820190600101614f31565b608081526000614f706080830187614e7f565b8560208401528281036040840152845181526020850151602082015260018060a01b036040860151166040820152606085015160e06060830152614fb760e0830182614f1c565b905060808601518282036080840152614fd08282614df4565b91505060a086015182820360a0840152614fea8282614e25565b91505060c086015182820360c08401526150048282614df4565b9350505050614c8360608301846001600160a01b03169052565b60006020828403121561503057600080fd5b81356002811061134457600080fd5b60006020828403121561505157600080fd5b813560ff8116811461134457600080fd5b6040815260006150756040830185614e7f565b905060018060a01b03831660208301529392505050565b6001600160e01b03198316815281516000906150af816004850160208701614cfc565b919091016004019392505050565b6080815260006150d06080830187614d20565b82810360208401526150e281876140aa565b905082810360408401526150f68186614867565b905082810360608401526149208185614e25565b60408152600061511d6040830185614867565b8281036020840152614c838185614e25565b8281526040602082015260006106476040830184614d2056fe5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd976240a26469706673582212200c6f63384302c679c24a323da0191d39419570db3a104ad821b83178df1126da64736f6c63430008170033", + "chainId": 11155111, + "contractAbsolutePath": "MainchainBridgeManager.sol", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102065760003560e01c80639b19dbfd1161011a578063cc7e6b3b116100ad578063de981f1b1161007c578063de981f1b146104ae578063e75235b8146104c1578063e9c03498146104de578063f80b5352146104f1578063f896f070146104f957600080fd5b8063cc7e6b3b14610460578063d0a50db014610480578063d78392f814610488578063dafae4081461049b57600080fd5b8063b405aaf2116100e9578063b405aaf21461041b578063b9c362091461042e578063bc96180b14610441578063c441c4a81461044957600080fd5b80639b19dbfd14610392578063a64a83801461039a578063aee1767f146103ad578063b384abef146103c057600080fd5b80633644e5151161019d5780637f7fe0581161016c5780637f7fe05814610303578063800eaab31461032e578063865e6fd3146103415780638dc0dbc614610354578063901979d51461036757600080fd5b80633644e515146102bc57806362077409146102c5578063776fb1ec146102d85780637de5dedd146102fb57600080fd5b80631f425338116101d95780631f425338146102635780632d6d7d731461027657806334d5f37b1461028957806335da8121146102a957600080fd5b806301a5f43f1461020b57806306aba0e1146102205780630a44fa431461023b5780630f7c31891461024e575b600080fd5b61021e610219366004613fd0565b61050c565b005b6102286105bb565b6040519081526020015b60405180910390f35b610228610249366004614069565b6105ca565b61025661064f565b60405161023291906140ef565b61021e610271366004614069565b610668565b610256610284366004614069565b61070a565b610228610297366004614102565b60026020526000908152604090205481565b61021e6102b7366004614069565b610751565b61022860015481565b61021e6102d336600461415f565b610799565b6102eb6102e6366004614102565b6107c9565b6040519015158152602001610232565b610228610816565b610316610311366004614212565b61086c565b6040516001600160a01b039091168152602001610232565b61021e61033c3660046143c4565b6108ed565b61021e61034f366004614436565b610925565b61021e610362366004614469565b610940565b61037a610375366004614212565b61096a565b6040516001600160601b039091168152602001610232565b6102566109a0565b61021e6103a8366004614102565b610a0b565b6103166103bb366004614212565b610a1f565b61040a6103ce3660046144ad565b600360208181526000938452604080852090915291835291208054600182015460028301549383015460069093015460ff909216939092909185565b6040516102329594939291906144e5565b6102eb610429366004614212565b610a31565b61021e61043c3660046144ad565b610a69565b600454610228565b610451610a7b565b60405161023293929190614554565b61047361046e366004614069565b610b55565b6040516102329190614597565b610228610b93565b61037a610496366004614212565b610ba6565b6102eb6104a9366004614102565b610bb1565b6103166104bc3660046145aa565b610c03565b6104c9610c7e565b60408051928352602083019190915201610232565b61021e6104ec366004614069565b610cc6565b610256610d0f565b61021e61050736600461463a565b610d72565b610514610eac565b6105b286868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808a0282810182019093528982529093508992508891829185019084908082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250610f0892505050565b50505050505050565b60006105c561126a565b905090565b600082828080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061060b925083915061127d9050565b6106478484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506112b292505050565b949350505050565b60606105c5600080516020615149833981519152611337565b610670610eac565b8181808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506106af925083915061127d9050565b60008051602061514983398151915260005b83811015610703576106fa8585838181106106de576106de61475f565b90506020020160208101906106f39190614212565b839061134b565b506001016106c1565b5050505050565b606061074883838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250611360915050565b90505b92915050565b610759610eac565b6107958282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506114b392505050565b5050565b6107a233611570565b6107bb6107b56060870160408801614212565b336115b2565b61070385858585853361160d565b60008060008381527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff602052604090205460ff16600481111561080e5761080e6144cf565b141592915050565b600080610821611641565b905060008061082e610c7e565b9150915080600182856004015485610846919061478b565b61085091906147a2565b61085a91906147b5565b61086491906147c8565b935050505090565b600080600061088261087c611641565b85611665565b91509150816108b45760405163141e2e1f60e11b81526001600160a01b03851660048201526024015b60405180910390fd5b6108bc611641565b60010181815481106108d0576108d061475f565b6000918252602090912001546001600160a01b0316949350505050565b33301461091b576000356001600160e01b0319166040516307337e1960e41b81526004016108ab91906147ea565b61079582826116ca565b61092d610eac565b61093681611773565b61079582826117a9565b61094933611570565b61095c6107b56080870160608801614212565b61070385858585853361184d565b600080610975611641565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b031690565b60606109aa611641565b600101805480602002602001604051908101604052809291908181526020018280548015610a0157602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116109e3575b5050505050905090565b610a13610eac565b610a1c81611881565b50565b6000610a2a826118ee565b5092915050565b600080610a3c611641565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b0316151590565b610a71610eac565b610795828261196e565b60608060606000610a8a611641565b805460408051602080840282018101909252828152929350839190830182828015610ade57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610ac0575b5050505050935080600101805480602002602001604051908101604052809291908181526020018280548015610b3d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b1f575b50505050509250610b4d84611a70565b915050909192565b6060610748838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611a7092505050565b6000610b9d611641565b60010154919050565b600061074b82611b5c565b60007ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00610bdc61126a565b8160010154610beb919061478b565b6002820154610bfa908561478b565b10159392505050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115610c3a57610c3a6144cf565b60ff1681526020810191909152604001600020546001600160a01b0316905080610c79578160405163409140df60e11b81526004016108ab91906147ff565b919050565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f01547ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f02549091565b610cce610eac565b610d0a828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611b9192505050565b505050565b6060610d19611641565b805460408051602080840282018101909252828152929190830182828015610a01576020028201919060005260206000209081546001600160a01b031681526001909101906020018083116109e3575050505050905090565b600054610100900460ff1615808015610d925750600054600160ff909116105b80610dac5750303b158015610dac575060005460ff166001145b610e0f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016108ab565b6000805460ff191660011790558015610e32576000805461ff0019166101001790555b610e3f600160ff1b611f77565b610e498383611fa7565b610e598b8b8b8b8b8b8b8b611fd8565b8015610e9f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610f06576000356001600160e01b0319166001604051620f948f60ea1b81526004016108ab929190614819565b565b6060610f148383612029565b610f1d8161127d565b6000610f27611641565b845187519192509081148015610f3d5750855181145b610f68576000356001600160e01b0319166040516306b5667560e21b81526004016108ab91906147ea565b806001600160401b03811115610f8057610f8061422d565b604051908082528060200260200182016040528015610fa9578160200160208202803683370190505b50935080600003610fbb575050611262565b60008060008060005b858110156111ce578a8181518110610fde57610fde61475f565b60200260200101519450898181518110610ffa57610ffa61475f565b602002602001015193508b81815181106110165761101661475f565b6020026020010151925061102985612133565b61103284612133565b826001600160601b031660000361106a576000356001600160e01b031916604051637f11b8a360e11b81526004016108ab91906147ea565b6001600160a01b03808616600081815260038a01602090815260408083205494891683528083205460028d0190925280832054938352909120546001600160601b0393841693918216926110c2929081169116614847565b6110cc9190614847565b6110d69190614847565b6001600160601b03166000148982815181106110f4576110f461475f565b6020026020010190151590811515815250508881815181106111185761111861475f565b6020026020010151156111c6578654600181810189556000898152602080822090930180546001600160a01b03808b166001600160a01b0319928316811790935591835260028c018552604080842080546001600160601b038b166001600160601b03199182168117909255868f018054978801815586528786209096018054948c1694909316841790925591835260038c0190945290208054909116821790556111c390836147a2565b91505b600101610fc4565b50808660040160008282546111e391906147a2565b909155505060405161121e906347c28ec560e11b9061120a908c908f908d9060200161489a565b604051602081830303815290604052612168565b7f897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b78888c8c8c60405161125394939291906148d3565b60405180910390a15050505050505b509392505050565b6000611274611641565b60040154905090565b61128681612195565b15610a1c576000356001600160e01b031916604051630d697db160e11b81526004016108ab91906147ea565b6000816112be8161127d565b60006112c8611641565b905060005b845181101561132f578160020160008683815181106112ee576112ee61475f565b6020908102919091018101516001600160a01b0316825281019190915260400160002054611325906001600160601b0316856147a2565b93506001016112cd565b505050919050565b6060600061134483612234565b9392505050565b6000610748836001600160a01b038416612290565b606082516001600160401b0381111561137b5761137b61422d565b6040519080825280602002602001820160405280156113a4578160200160208202803683370190505b50905060005b8351811015610a2a57600560008583815181106113c9576113c961475f565b602002602001015160058111156113e2576113e26144cf565b60058111156113f3576113f36144cf565b815260200190815260200160002060009054906101000a90046001600160a01b03168282815181106114275761142761475f565b60200260200101906001600160a01b031690816001600160a01b03168152505082801561147f575060006001600160a01b031682828151811061146c5761146c61475f565b60200260200101516001600160a01b0316145b156114ab576000356001600160e01b03191660405163053265f160e01b81526004016108ab91906147ea565b6001016113aa565b806114bd8161127d565b600080516020615149833981519152600080805b8551811015611568578581815181106114ec576114ec61475f565b602002602001015192506114ff83611773565b611510836312c0151560e21b612383565b61151a8484612516565b604080516001600160a01b038616815282151560208201529193507fb85c58eeff9fe423669ae0841666f4c8499e8731b8275eb462e4fa1720ec420e910160405180910390a16001016114d1565b505050505050565b61157981611b5c565b6001600160601b0316600003610a1c576000356001600160e01b0319166003604051620f948f60ea1b81526004016108ab929190614819565b6001600160a01b038216158015906115dc5750816001600160a01b0316816001600160a01b031614155b15610795576040516301df97c360e51b81526001600160a01b038084166004830152821660248201526044016108ab565b600061162161161b88614a6e565b8361252b565b90506105b2818787878761163c6116378e614a6e565b61263d565b61277c565b7fc648703095712c0419b6431ae642c061f0a105ac2d7c3d9604061ef4ebc3830090565b60008060005b84548110156116b8578481815481106116865761168661475f565b6000918252602090912001546001600160a01b03908116908516036116b0576001925090506116c3565b60010161166b565b506000600019915091505b9250929050565b60005b8251811015610d0a57306001600160a01b03168282815181106116f2576116f261475f565b60200260200101516001600160a01b03160361172f576000356001600160e01b03191660405163053265f160e01b81526004016108ab91906147ea565b61176b8382815181106117445761174461475f565b602002602001015183838151811061175e5761175e61475f565b6020026020010151612c48565b6001016116cd565b806001600160a01b03163b600003610a1c57604051630bfc64a360e21b81526001600160a01b03821660048201526024016108ab565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f8111156117df576117df6144cf565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115611820576118206144cf565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b61185f61185987614b49565b82612cdb565b5061156861186c87614b49565b8686868661163c61187c8d614b49565b612de2565b60038110156118a3576040516305f4dee960e31b815260040160405180910390fd5b60006118ad611641565b600581018390556040518381529091507f22d5bb5059ffe2949a098666fc198587200c8118483074120d3ca7050c7753f19060200160405180910390a15050565b6000806000806119086118ff611641565b60010186611665565b9150915081611935576040516326527e1760e01b81526001600160a01b03861660048201526024016108ab565b61193d611641565b80548290811061194f5761194f61475f565b6000918252602090912001546001600160a01b03169590945092505050565b8082118061197d575060018111155b156119a9576000356001600160e01b0319166040516387f6f09560e01b81526004016108ab91906147ea565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f0180547ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f028054928590558390557ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00805490929084908690856000611a2c83614c2f565b9091555060408051868152602081018690527f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a45050505050565b60606000611a7c611641565b905082516001600160401b03811115611a9757611a9761422d565b604051908082528060200260200182016040528015611ac0578160200160208202803683370190505b50915060005b8351811015611b5557816002016000858381518110611ae757611ae761475f565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160601b0316838281518110611b3557611b3561475f565b6001600160601b0390921660209283029190910190910152600101611ac6565b5050919050565b6000611b66611641565b6001600160a01b0390921660009081526002929092016020525060409020546001600160601b031690565b606081611b9d8161127d565b6000611ba7611641565b8451909150806001600160401b03811115611bc457611bc461422d565b604051908082528060200260200182016040528015611bed578160200160208202803683370190505b50935080600003611bff575050611f71565b60058201548254611c119083906147b5565b1015611c305760405163b2e765cb60e01b815260040160405180910390fd5b60008060008060005b85811015611ef757898181518110611c5357611c5361475f565b60200260200101519350611c66846118ee565b9095509150611c7485612133565b611c7d84612133565b6001600160a01b03851660009081526002880160205260409020546001600160601b031615801590611cd157506001600160a01b03841660009081526003880160205260409020546001600160601b031615155b898281518110611ce357611ce361475f565b602002602001019015159081151581525050888181518110611d0757611d0761475f565b602002602001015115611eef576001600160a01b038516600090815260028801602052604081205488546001600160601b039091169190611d4a906001906147b5565b9050886000018181548110611d6157611d6161475f565b60009182526020909120015489546001600160a01b03909116908a9086908110611d8d57611d8d61475f565b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790558854899080611dc757611dc7614c48565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038916825260028b0190526040902080546001600160601b031916905560018901805482908110611e2757611e2761475f565b60009182526020909120015460018a0180546001600160a01b039092169186908110611e5557611e5561475f565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555088600101805480611e9657611e96614c48565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038816825260038b0190526040902080546001600160601b0319169055611eea82866147a2565b945050505b600101611c39565b5081866004016000828254611f0c91906147b5565b9091555050604051611f3190636242a4ef60e11b9061120a908c908c90602001614c5e565b7fdf3dcd7987202f64648f3acdbf12401e3a2bb23e77e19f99826b5475cbb86369888a604051611f62929190614c8c565b60405180910390a15050505050505b50919050565b600054610100900460ff16611f9e5760405162461bcd60e51b81526004016108ab90614cb1565b610a1c81612f2c565b600054610100900460ff16611fce5760405162461bcd60e51b81526004016108ab90614cb1565b6107958282612f5c565b600054610100900460ff16611fff5760405162461bcd60e51b81526004016108ab90614cb1565b6120098888612f8e565b61201284612fe5565b61201f8686858585613015565b5050505050505050565b81518151606091908082016001600160401b0381111561204b5761204b61422d565b604051908082528060200260200182016040528015612074578160200160208202803683370190505b50925060005b828110156120ce578581815181106120945761209461475f565b60200260200101518482815181106120ae576120ae61475f565b6001600160a01b039092166020928302919091019091015260010161207a565b60005b82811015612129578581815181106120eb576120eb61475f565b60200260200101518583815181106121055761210561475f565b6001600160a01b0390921660209283029190910190910152600191820191016120d1565b5050505092915050565b6001600160a01b038116610a1c576000356001600160e01b03191660405163104c66df60e31b81526004016108ab91906147ea565b612172828261313f565b610795573382826040516319b5fdcb60e31b81526004016108ab93929190614d4c565b600081516000036121a857506000919050565b60005b600183510381101561222b57600181015b8351811015612222578381815181106121d7576121d761475f565b60200260200101516001600160a01b03168483815181106121fa576121fa61475f565b60200260200101516001600160a01b03160361221a575060019392505050565b6001016121bc565b506001016121ab565b50600092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561228457602002820191906000526020600020905b815481526020019060010190808311612270575b50505050509050919050565b600081815260018301602052604081205480156123795760006122b46001836147b5565b85549091506000906122c8906001906147b5565b905081811461232d5760008660000182815481106122e8576122e861475f565b906000526020600020015490508087600001848154811061230b5761230b61475f565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061233e5761233e614c48565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061074b565b600091505061074b565b60008160405160240161239691906147ea565b60408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b1790525190915060009081906001600160a01b038616906123df908590614d80565b600060405180830381855afa9150503d806000811461241a576040519150601f19603f3d011682016040523d82523d6000602084013e61241f565b606091505b5091509150816124e157846001600160a01b0316836040516024016124449190614d9c565b60408051601f198184030181529181526020820180516001600160e01b03166325da93a560e11b179052516124799190614d80565b600060405180830381855afa9150503d80600081146124b4576040519150601f19603f3d011682016040523d82523d6000602084013e6124b9565b606091505b509092509050816124e157838560405163069d427960e11b81526004016108ab929190614daf565b808060200190518101906124f59190614dd2565b61070357838560405163069d427960e11b81526004016108ab929190614daf565b6000610748836001600160a01b038416613471565b612533613f0c565b61254c61254584606001516001611360565b84906134c0565b9050612563600454826135c690919063ffffffff16565b600061256e82612de2565b9050600061257c6000613667565b60008181527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff6020908152604090912090870151600182018590556006909101559050825181146125ee576000356001600160e01b03191660405163d4cec26960e01b81526004016108ab91906147ea565b81817fe5af2d3fb7bcab8f865476bc675bf1bbb8b5a749c827ee1cd215dc9c2b8f92d78561261b8961263d565b898960405161262d9493929190614f5d565b60405180910390a3505092915050565b6080810151606082015160a083015151600092919083906001600160401b0381111561266b5761266b61422d565b604051908082528060200260200182016040528015612694578160200160208202803683370190505b5060c086015190915060005b82518110156126f3578660a0015181815181106126bf576126bf61475f565b6020026020010151805190602001208382815181106126e0576126e061475f565b60209081029190910101526001016126a0565b50604080517fde480f0c53a3651c08fbab1dffbc45fe574f31188827fe52cb9035da9fe57e4a8152875160208083019190915280890151828401529790910151606082015283518702938701939093206080840152835186029386019390932060a0830152805185029085012060c082015281518402919093012060e083015250610100902090565b831580159061278a57508382145b6127b5576000356001600160e01b0319166040516306b5667560e21b81526004016108ab91906147ea565b60006128426127c360015490565b612802846000604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b60405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b9050600061289161285260015490565b612802856001604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b90506000846001600160401b038111156128ad576128ad61422d565b6040519080825280602002602001820160405280156128d6578160200160208202803683370190505b5090506000856001600160401b038111156128f3576128f361422d565b60405190808252806020026020018201604052801561291c578160200160208202803683370190505b50905060008060008060003660005b8c811015612ab0578d8d828181106129455761294561475f565b90506060020191508f8f8281811061295f5761295f61475f565b9050602002016020810190612974919061501e565b9250600083600181111561298a5761298a6144cf565b036129f4576129af8b6129a0602085018561503f565b84602001358560400135613703565b94508489886129bd81614c2f565b9950815181106129cf576129cf61475f565b60200260200101906001600160a01b031690816001600160a01b031681525050612a65565b6001836001811115612a0857612a086144cf565b03612a3e57612a1e8a6129a0602085018561503f565b9450848887612a2c81614c2f565b9850815181106129cf576129cf61475f565b6000356001600160e01b031916604051630612418f60e11b81526004016108ab91906147ea565b846001600160a01b0316846001600160a01b031610612aa5576000356001600160e01b031916604051635d3dcd3160e01b81526004016108ab91906147ea565b84935060010161292b565b505050928552508252506020808b015160009081526003825260408082208d51835290925290812090612ae161372b565b90506000612aee85613735565b9050818110612b755780600003612b26576000356001600160e01b031916604051637f11b8a360e11b81526004016108ab91906147ea565b825460ff1916600190811784558301546040517f5c819725ea53655a3b898f3df59b66489761935454e9212ca1e5ebd759953d0b90600090a2612b69838e613740565b50505050505050611568565b600082612b806137ad565b612b8a91906147b5565b612b959060016147a2565b90506000612ba286613735565b9050818110612c215780600003612bda576000356001600160e01b031916604051637f11b8a360e11b81526004016108ab91906147ea565b845460ff1916600317855560018501546040517f55295d4ce992922fa2e5ffbf3a3dcdb367de0a15e125ace083456017fd22060f90600090a2505050505050505050611568565b6000356001600160e01b031916604051634ccfe64360e11b81526004016108ab91906147ea565b8060056000846005811115612c5f57612c5f6144cf565b6005811115612c7057612c706144cf565b8152602081019190915260400160002080546001600160a01b0319166001600160a01b039283161790558116826005811115612cae57612cae6144cf565b6040517f356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d90600090a35050565b6020820151600090808203612d1d5760405163092048d160e11b8152600080356001600160e01b031916600483015260248201524660448201526064016108ab565b600454612d2b9085906135c6565b6000612d3685612de2565b9050612d4182613667565b6000838152600360209081526040808320848452909152908190209087015160018201849055600690910155925084518314612d9e576000356001600160e01b03191660405163d4cec26960e01b81526004016108ab91906147ea565b8083837fd1221ffb98610024a29755d7db3c71692310f43a7cfcce7ee488a8c7e9e0bfa48888604051612dd2929190615062565b60405180910390a4505092915050565b60a0810151608082015160c083015151600092919083906001600160401b03811115612e1057612e1061422d565b604051908082528060200260200182016040528015612e39578160200160208202803683370190505b5060e086015190915060005b8251811015612e98578660c001518181518110612e6457612e6461475f565b602002602001015180519060200120838281518110612e8557612e8561475f565b6020908102919091010152600101612e45565b50604080517f1b59eeec7c321899dc1e7a5b3d876c9a445dffc6d2f96ba842d7489908fdee1281528751602080830191909152808901518284015291880151606080830191909152909701516080880152835181029381019390932060a0870152835183029383019390932060c0860152805182029082012060e08501528151810291012061010083015250610120902090565b600054610100900460ff16612f535760405162461bcd60e51b81526004016108ab90614cb1565b610a1c816137b7565b600054610100900460ff16612f835760405162461bcd60e51b81526004016108ab90614cb1565b61091b600030612c48565b600054610100900460ff16612fb55760405162461bcd60e51b81526004016108ab90614cb1565b60017ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00908155610d0a838361196e565b600054610100900460ff1661300c5760405162461bcd60e51b81526004016108ab90614cb1565b610a1c816114b3565b600054610100900460ff1661303c5760405162461bcd60e51b81526004016108ab90614cb1565b6130476002856117a9565b604080516020808201839052600e60608301526d212924a223a2afa6a0a720a3a2a960911b6080808401919091528284018990528351808403909101815260a0830184528051908201207f599a80fcaa47b95e2323ab4d34d34e0cc9feda4b843edafcc30c7bdf60ea15bf60c08401527fe4d2346818310a10fac5a6d073d3dce255578caf4aa81ddcbcc7c2b98405eef060e08401527f2a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4de61010084015261012080840191909152835180840390910181526101409092019092528051910120600155613134818385610f08565b506107036003611881565b6001600061315a600080516020615149833981519152611337565b8051909150600081900361316f57505061074b565b6000816001600160401b038111156131895761318961422d565b6040519080825280602002602001820160405280156131b2578160200160208202803683370190505b5090506000826001600160401b038111156131cf576131cf61422d565b60405190808252806020026020018201604052801561320257816020015b60608152602001906001900390816131ed5790505b5090506000878760405160200161321a92919061508c565b604051602081830303815290604052905060008160405160240161323e9190614d9c565b60408051601f198184030181529190526020810180516001600160e01b03166325da93a560e11b179052905060005b85811015613427578681815181106132875761328761475f565b60200260200101516001600160a01b0316836040516132a69190614d80565b6000604051808303816000865af19150503d80600081146132e3576040519150601f19603f3d011682016040523d82523d6000602084013e6132e8565b606091505b508683815181106132fb576132fb61475f565b602002602001018684815181106133145761331461475f565b602002602001018290528215151515815250505084818151811061333a5761333a61475f565b602002602001015161341f578681815181106133585761335861475f565b60200260200101516001600160a01b0316826040516133779190614d80565b6000604051808303816000865af19150503d80600081146133b4576040519150601f19603f3d011682016040523d82523d6000602084013e6133b9565b606091505b508683815181106133cc576133cc61475f565b602002602001018684815181106133e5576133e561475f565b602002602001018290528215151515815250505087801561341c57508481815181106134135761341361475f565b60200260200101515b97505b60010161326d565b507fc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b638287868660405161345d94939291906150bd565b60405180910390a150505050505092915050565b60008181526001830160205260408120546134b85750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561074b565b50600061074b565b6134c8613f0c565b8251815260006020808301919091528301516040808301919091528301516001600160a01b0316606080830191909152830151516001600160401b038111156135135761351361422d565b60405190808252806020026020018201604052801561353c578160200160208202803683370190505b5060808083019190915283015160a08083019190915283015160c08083019190915283015160e082015260005b836060015151811015610a2a578281815181106135885761358861475f565b6020026020010151826080015182815181106135a6576135a661475f565b6001600160a01b0390921660209283029190910190910152600101613569565b60008260800151511180156135e457508160a0015151826080015151145b80156135f957508160c0015151826080015151145b801561360e57508160e0015151826080015151145b613639576000356001600160e01b0319166040516306b5667560e21b81526004016108ab91906147ea565b61364381426147a2565b826040015111156107955760405163ad89be9d60e01b815260040160405180910390fd5b600081815260026020526040812054908190036136965750600090815260026020526040902060019081905590565b60008281526003602090815260408083208484529091528120906000825460ff1660048111156136c8576136c86144cf565b036136e65760405163757a436360e01b815260040160405180910390fd5b505050600090815260026020526040902080546001019081905590565b60008060006137148787878761399c565b9150915061372181613a89565b5095945050505050565b60006105c5610816565b600061074b826112b2565b61374981613c3f565b1561079557815460ff1916600217825560008061376583613c59565b9150915083600101547fe134987599ae266ec90edeff1b26125b287dbb57b10822649432d1bb26537fba838360405161379f92919061510a565b60405180910390a250505050565b60006105c56105bb565b600481905560405181907fe5cd1c123a8cf63fa1b7229678db61fe8ae99dbbd27889370b6667c8cae97da190600090a250565b600483015481101561389d578260080160008460040183815481106138115761381161475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff19169055600484018054600786019291908490811061385a5761385a61475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff191681556001818101839055600290910191909155016137ea565b5060005b6005830154811015613954578260080160008460050183815481106138c8576138c861475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff1916905560058401805460078601929190849081106139115761391161475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff191681556001818101839055600290910191909155016138a1565b50815460ff191682556000600183018190556002830181905560038301819055613982906004840190613f5a565b613990600583016000613f5a565b60006006830155919050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156139d35750600090506003613a80565b8460ff16601b141580156139eb57508460ff16601c14155b156139fc5750600090506004613a80565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613a50573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613a7957600060019250925050613a80565b9150600090505b94509492505050565b6000816004811115613a9d57613a9d6144cf565b03613aa55750565b6001816004811115613ab957613ab96144cf565b03613b065760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016108ab565b6002816004811115613b1a57613b1a6144cf565b03613b675760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016108ab565b6003816004811115613b7b57613b7b6144cf565b03613bd35760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016108ab565b6004816004811115613be757613be76144cf565b03610a1c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016108ab565b600081602001516000148061074b57505060200151461490565b606080613c6583613c3f565b613ca357602083015160405163092048d160e11b81526000356001600160e01b031916600482015260248101919091524660448201526064016108ab565b8260800151516001600160401b03811115613cc057613cc061422d565b604051908082528060200260200182016040528015613ce9578160200160208202803683370190505b5091508260800151516001600160401b03811115613d0957613d0961422d565b604051908082528060200260200182016040528015613d3c57816020015b6060815260200190600190039081613d275790505b50905060005b836080015151811015613f06578360e001518181518110613d6557613d6561475f565b60200260200101515a11613d9857613d7c84612de2565b6040516307aec4ab60e21b81526004016108ab91815260200190565b83608001518181518110613dae57613dae61475f565b60200260200101516001600160a01b03168460a001518281518110613dd557613dd561475f565b60200260200101518560e001518381518110613df357613df361475f565b6020026020010151908660c001518481518110613e1257613e1261475f565b6020026020010151604051613e279190614d80565b600060405180830381858888f193505050503d8060008114613e65576040519150601f19603f3d011682016040523d82523d6000602084013e613e6a565b606091505b50848381518110613e7d57613e7d61475f565b60200260200101848481518110613e9657613e9661475f565b6020026020010182905282151515158152505050828181518110613ebc57613ebc61475f565b6020026020010151613efe5780828281518110613edb57613edb61475f565b60200260200101516040516376df417560e11b81526004016108ab92919061512f565b600101613d42565b50915091565b60405180610100016040528060008152602001600081526020016000815260200160006001600160a01b03168152602001606081526020016060815260200160608152602001606081525090565b5080546000825590600052602060002090810190610a1c91905b80821115613f885760008155600101613f74565b5090565b60008083601f840112613f9e57600080fd5b5081356001600160401b03811115613fb557600080fd5b6020830191508360208260051b85010111156116c357600080fd5b60008060008060008060608789031215613fe957600080fd5b86356001600160401b038082111561400057600080fd5b61400c8a838b01613f8c565b9098509650602089013591508082111561402557600080fd5b6140318a838b01613f8c565b9096509450604089013591508082111561404a57600080fd5b5061405789828a01613f8c565b979a9699509497509295939492505050565b6000806020838503121561407c57600080fd5b82356001600160401b0381111561409257600080fd5b61409e85828601613f8c565b90969095509350505050565b60008151808452602080850194506020840160005b838110156140e45781516001600160a01b0316875295820195908201906001016140bf565b509495945050505050565b60208152600061074860208301846140aa565b60006020828403121561411457600080fd5b5035919050565b60008083601f84011261412d57600080fd5b5081356001600160401b0381111561414457600080fd5b6020830191508360206060830285010111156116c357600080fd5b60008060008060006060868803121561417757600080fd5b85356001600160401b038082111561418e57600080fd5b9087019060e0828a0312156141a257600080fd5b909550602087013590808211156141b857600080fd5b6141c489838a01613f8c565b909650945060408801359150808211156141dd57600080fd5b506141ea8882890161411b565b969995985093965092949392505050565b80356001600160a01b0381168114610c7957600080fd5b60006020828403121561422457600080fd5b610748826141fb565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b03811182821017156142655761426561422d565b60405290565b60405161010081016001600160401b03811182821017156142655761426561422d565b604051601f8201601f191681016001600160401b03811182821017156142b6576142b661422d565b604052919050565b60006001600160401b038211156142d7576142d761422d565b5060051b60200190565b600082601f8301126142f257600080fd5b81356020614307614302836142be565b61428e565b8083825260208201915060208460051b87010193508684111561432957600080fd5b602086015b84811015614353578035600681106143465760008081fd5b835291830191830161432e565b509695505050505050565b600082601f83011261436f57600080fd5b8135602061437f614302836142be565b8083825260208201915060208460051b8701019350868411156143a157600080fd5b602086015b84811015614353576143b7816141fb565b83529183019183016143a6565b600080604083850312156143d757600080fd5b82356001600160401b03808211156143ee57600080fd5b6143fa868387016142e1565b9350602085013591508082111561441057600080fd5b5061441d8582860161435e565b9150509250929050565b803560108110610c7957600080fd5b6000806040838503121561444957600080fd5b61445283614427565b9150614460602084016141fb565b90509250929050565b60008060008060006060868803121561448157600080fd5b85356001600160401b038082111561449857600080fd5b90870190610100828a0312156141a257600080fd5b600080604083850312156144c057600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60a08101600587106144f9576144f96144cf565b95815260208101949094526040840192909252606083015260809091015290565b60008151808452602080850194506020840160005b838110156140e45781516001600160601b03168752958201959082019060010161452f565b60608152600061456760608301866140aa565b828103602084015261457981866140aa565b9050828103604084015261458d818561451a565b9695505050505050565b602081526000610748602083018461451a565b6000602082840312156145bc57600080fd5b61074882614427565b600082601f8301126145d657600080fd5b813560206145e6614302836142be565b8083825260208201915060208460051b87010193508684111561460857600080fd5b602086015b848110156143535780356001600160601b038116811461462d5760008081fd5b835291830191830161460d565b6000806000806000806000806000806101408b8d03121561465a57600080fd5b8a35995060208b0135985060408b0135975061467860608c016141fb565b965060808b01356001600160401b038082111561469457600080fd5b6146a08e838f0161435e565b975060a08d01359150808211156146b657600080fd5b6146c28e838f0161435e565b965060c08d01359150808211156146d857600080fd5b6146e48e838f0161435e565b955060e08d01359150808211156146fa57600080fd5b6147068e838f016145c5565b94506101008d013591508082111561471d57600080fd5b6147298e838f016142e1565b93506101208d013591508082111561474057600080fd5b5061474d8d828e0161435e565b9150509295989b9194979a5092959850565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761074b5761074b614775565b8082018082111561074b5761074b614775565b8181038181111561074b5761074b614775565b6000826147e557634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031991909116815260200190565b6020810160108310614813576148136144cf565b91905290565b6001600160e01b03198316815260408101600b831061483a5761483a6144cf565b8260208301529392505050565b6001600160601b03818116838216019080821115610a2a57610a2a614775565b60008151808452602080850194506020840160005b838110156140e457815115158752958201959082019060010161487c565b6060815260006148ad60608301866140aa565b82810360208401526148bf818661451a565b9050828103604084015261458d8185614867565b6080815260006148e66080830187614867565b82810360208401526148f8818761451a565b9050828103604084015261490c81866140aa565b9050828103606084015261492081856140aa565b979650505050505050565b600082601f83011261493c57600080fd5b8135602061494c614302836142be565b8083825260208201915060208460051b87010193508684111561496e57600080fd5b602086015b848110156143535780358352918301918301614973565b6000601f83601f84011261499d57600080fd5b823560206149ad614302836142be565b82815260059290921b850181019181810190878411156149cc57600080fd5b8287015b84811015614a625780356001600160401b03808211156149f05760008081fd5b818a0191508a603f830112614a055760008081fd5b85820135604082821115614a1b57614a1b61422d565b614a2c828b01601f1916890161428e565b92508183528c81838601011115614a435760008081fd5b81818501898501375060009082018701528452509183019183016149d0565b50979650505050505050565b600060e08236031215614a8057600080fd5b614a88614243565b8235815260208301356020820152614aa2604084016141fb565b604082015260608301356001600160401b0380821115614ac157600080fd5b614acd368387016142e1565b60608401526080850135915080821115614ae657600080fd5b614af23683870161492b565b608084015260a0850135915080821115614b0b57600080fd5b614b173683870161498a565b60a084015260c0850135915080821115614b3057600080fd5b50614b3d3682860161492b565b60c08301525092915050565b60006101008236031215614b5c57600080fd5b614b6461426b565b823581526020830135602082015260408301356040820152614b88606084016141fb565b606082015260808301356001600160401b0380821115614ba757600080fd5b614bb33683870161435e565b608084015260a0850135915080821115614bcc57600080fd5b614bd83683870161492b565b60a084015260c0850135915080821115614bf157600080fd5b614bfd3683870161498a565b60c084015260e0850135915080821115614c1657600080fd5b50614c233682860161492b565b60e08301525092915050565b600060018201614c4157614c41614775565b5060010190565b634e487b7160e01b600052603160045260246000fd5b604081526000614c7160408301856140aa565b8281036020840152614c838185614867565b95945050505050565b604081526000614c9f6040830185614867565b8281036020840152614c8381856140aa565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60005b83811015614d17578181015183820152602001614cff565b50506000910152565b60008151808452614d38816020860160208601614cfc565b601f01601f19169290920160200192915050565b6001600160a01b03841681526001600160e01b031983166020820152606060408201819052600090614c8390830184614d20565b60008251614d92818460208701614cfc565b9190910192915050565b6020815260006107486020830184614d20565b6001600160e01b03199290921682526001600160a01b0316602082015260400190565b600060208284031215614de457600080fd5b8151801515811461134457600080fd5b60008151808452602080850194506020840160005b838110156140e457815187529582019590820190600101614e09565b60008282518085526020808601955060208260051b8401016020860160005b84811015614e7257601f19868403018952614e60838351614d20565b98840198925090830190600101614e44565b5090979650505050505050565b60006101008251845260208301516020850152604083015160408501526060830151614eb660608601826001600160a01b03169052565b506080830151816080860152614ece828601826140aa565b91505060a083015184820360a0860152614ee88282614df4565b91505060c083015184820360c0860152614f028282614e25565b91505060e083015184820360e0860152614c838282614df4565b60008151808452602080850194506020840160005b838110156140e457815160068110614f4b57614f4b6144cf565b87529582019590820190600101614f31565b608081526000614f706080830187614e7f565b8560208401528281036040840152845181526020850151602082015260018060a01b036040860151166040820152606085015160e06060830152614fb760e0830182614f1c565b905060808601518282036080840152614fd08282614df4565b91505060a086015182820360a0840152614fea8282614e25565b91505060c086015182820360c08401526150048282614df4565b9350505050614c8360608301846001600160a01b03169052565b60006020828403121561503057600080fd5b81356002811061134457600080fd5b60006020828403121561505157600080fd5b813560ff8116811461134457600080fd5b6040815260006150756040830185614e7f565b905060018060a01b03831660208301529392505050565b6001600160e01b03198316815281516000906150af816004850160208701614cfc565b919091016004019392505050565b6080815260006150d06080830187614d20565b82810360208401526150e281876140aa565b905082810360408401526150f68186614867565b905082810360608401526149208185614e25565b60408152600061511d6040830185614867565b8281036020840152614c838185614e25565b8281526040602082015260006106476040830184614d2056fe5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd976240a26469706673582212200c6f63384302c679c24a323da0191d39419570db3a104ad821b83178df1126da64736f6c63430008170033", + "deployer": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "devdoc": { + "version": 1, + "kind": "dev", + "methods": { + "addBridgeOperators(uint96[],address[],address[])": { + "details": "Adds multiple bridge operators.", + "params": { + "bridgeOperators": "An array of addresses representing the bridge operators to add.", + "governors": "An array of addresses of hot/cold wallets for bridge operator to update their node address." + } + }, + "checkThreshold(uint256)": { + "details": "Checks whether the `_voteWeight` passes the threshold." + }, + "getBridgeOperatorWeight(address)": { + "details": "External function to retrieve the vote weight of a specific bridge operator.", + "params": { + "bridgeOperator": "The address of the bridge operator to get the vote weight for." + }, + "returns": { + "weight": "The vote weight of the specified bridge operator." + } + }, + "getBridgeOperators()": { + "details": "Returns an array of all bridge operators.", + "returns": { + "_0": "An array containing the addresses of all bridge operators." + } + }, + "getCallbackRegisters()": { + "details": "Retrieves the addresses of registered callbacks.", + "returns": { + "registers": "An array containing the addresses of registered callbacks." + } + }, + "getContract(uint8)": { + "details": "Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.", + "params": { + "contractType": "The role of the contract to retrieve." + }, + "returns": { + "contract_": "The address of the contract with the specified role." + } + }, + "getFullBridgeOperatorInfos()": { + "details": "Retrieves the full information of all registered bridge operators. This external function allows external callers to obtain the full information of all the registered bridge operators. The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.", + "returns": { + "bridgeOperators": "An array of addresses representing the registered bridge operators.", + "governors": "An array of addresses representing the governors of each bridge operator.", + "weights": "An array of uint256 values representing the vote weights of each bridge operator. Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator. Example Usage: ``` (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos(); for (uint256 i = 0; i < bridgeOperators.length; i++) { // Access individual information for each bridge operator. address governor = governors[i]; address bridgeOperator = bridgeOperators[i]; uint256 weight = weights[i]; // ... (Process or use the information as required) ... } ```" + } + }, + "getGovernorOf(address)": { + "details": "Returns the corresponding `governor` of a `operator`." + }, + "getGovernorWeight(address)": { + "details": "External function to retrieve the vote weight of a specific governor.", + "params": { + "governor": "The address of the governor to get the vote weight for." + }, + "returns": { + "weight": "voteWeight The vote weight of the specified governor." + } + }, + "getGovernorWeights(address[])": { + "details": "Returns the weights of a list of governor addresses." + }, + "getGovernors()": { + "details": "Returns an array of all governors.", + "returns": { + "_0": "An array containing the addresses of all governors." + } + }, + "getOperatorOf(address)": { + "details": "Returns the corresponding `operator` of a `governor`." + }, + "getProposalExpiryDuration()": { + "details": "Returns the expiry duration for a new proposal." + }, + "getThreshold()": { + "details": "Returns the threshold." + }, + "getTotalWeight()": { + "details": "Returns total weights." + }, + "globalProposalRelayed(uint256)": { + "details": "Returns whether the voter `_voter` casted vote for the proposal." + }, + "isBridgeOperator(address)": { + "details": "Checks if the given address is a bridge operator.", + "params": { + "addr": "The address to check." + }, + "returns": { + "_0": "A boolean indicating whether the address is a bridge operator." + } + }, + "minimumVoteWeight()": { + "details": "Returns the minimum vote weight to pass the threshold." + }, + "registerCallbacks(address[])": { + "details": "Registers multiple callbacks with the bridge.", + "params": { + "registers": "The array of callback addresses to register." + } + }, + "relayGlobalProposal((uint256,uint256,address,uint8[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])": { + "details": "See `GovernanceRelay-_relayGlobalProposal`. Requirements: - The method caller is governor." + }, + "relayProposal((uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])": { + "details": "See `GovernanceRelay-_relayProposal`. Requirements: - The method caller is governor." + }, + "removeBridgeOperators(address[])": { + "details": "Removes multiple bridge operators.", + "params": { + "bridgeOperators": "An array of addresses representing the bridge operators to remove." + } + }, + "resolveTargets(uint8[])": { + "details": "Returns corresponding address of target options. Return address(0) on non-existent target." + }, + "setContract(uint8,address)": { + "details": "Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.", + "params": { + "addr": "The address of the contract to set.", + "contractType": "The role of the contract to set." + } + }, + "setMinRequiredGovernor(uint256)": { + "details": "Self-call to update the minimum required governor.", + "params": { + "min": "The minimum number, this must not less than 3." + } + }, + "setThreshold(uint256,uint256)": { + "details": "Sets the threshold. Requirements: - The method caller is admin. Emits the `ThresholdUpdated` event." + }, + "sumGovernorsWeight(address[])": { + "details": "Returns total weights of the governor list." + }, + "totalBridgeOperator()": { + "details": "Returns the total number of bridge operators.", + "returns": { + "_0": "The total number of bridge operators." + } + }, + "unregisterCallbacks(address[])": { + "details": "Unregisters multiple callbacks from the bridge.", + "params": { + "registers": "The array of callback addresses to unregister." + } + }, + "updateManyTargetOption(uint8[],address[])": { + "details": "Updates list of `targetOptions` to `targets`. Requirement: - Only allow self-call through proposal." + } + }, + "events": { + "BridgeOperatorAddingFailed(address)": { + "details": "Emitted when a bridge operator is failed to add." + }, + "BridgeOperatorRemovingFailed(address)": { + "details": "Emitted when a bridge operator is failed to remove." + }, + "BridgeOperatorUpdated(address,address,address)": { + "details": "Emitted when a bridge operator is updated." + }, + "BridgeOperatorsAdded(bool[],uint96[],address[],address[])": { + "details": "Emitted when new bridge operators are added." + }, + "BridgeOperatorsRemoved(bool[],address[])": { + "details": "Emitted when bridge operators are removed." + }, + "ContractUpdated(uint8,address)": { + "details": "Emitted when a contract is updated." + }, + "GlobalProposalCreated(uint256,bytes32,(uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),bytes32,(uint256,uint256,address,uint8[],uint256[],bytes[],uint256[]),address)": { + "details": "Emitted when a proposal is created" + }, + "Initialized(uint8)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "MinRequiredGovernorUpdated(uint256)": { + "details": "Emitted when the minimum number of required governors is updated." + }, + "Notified(bytes,address[],bool[],bytes[])": { + "details": "Emitted when the contract notifies multiple registers with statuses and return data." + }, + "ProposalApproved(bytes32)": { + "details": "Emitted when the proposal is approved" + }, + "ProposalCreated(uint256,uint256,bytes32,(uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),address)": { + "details": "Emitted when a proposal is created" + }, + "ProposalExecuted(bytes32,bool[],bytes[])": { + "details": "Emitted when the proposal is executed" + }, + "ProposalExpired(bytes32)": { + "details": "Emitted when the vote is expired" + }, + "ProposalExpiryDurationChanged(uint256)": { + "details": "Emitted when the proposal expiry duration is changed." + }, + "ProposalRejected(bytes32)": { + "details": "Emitted when the vote is reject" + }, + "ProposalVoted(bytes32,address,uint8,uint256)": { + "details": "Emitted when the proposal is voted" + }, + "TargetOptionUpdated(uint8,address)": { + "details": "Emitted when the target options are updated" + }, + "ThresholdUpdated(uint256,uint256,uint256,uint256,uint256)": { + "details": "Emitted when the threshold is updated" + } + }, + "errors": { + "ErrContractTypeNotFound(uint8)": [ + { + "details": "Error of invalid role." + } + ], + "ErrCurrentProposalIsNotCompleted()": [ + { + "details": "Error thrown when the current proposal is not completed." + } + ], + "ErrDuplicated(bytes4)": [ + { + "details": "Error thrown when a duplicated element is detected in an array.", + "params": { + "msgSig": "The function signature that invoke the error." + } + } + ], + "ErrInsufficientGas(bytes32)": [ + { + "details": "Error thrown when there is insufficient gas to execute a function." + } + ], + "ErrInvalidArguments(bytes4)": [ + { + "details": "Error indicating that arguments are invalid." + } + ], + "ErrInvalidChainId(bytes4,uint256,uint256)": [ + { + "details": "Error indicating that the chain ID is invalid.", + "params": { + "actual": "Current chain ID that executing function.", + "expected": "Expected chain ID required for the tx to success.", + "msgSig": "The function signature (bytes4) of the operation that encountered an invalid chain ID." + } + } + ], + "ErrInvalidExpiryTimestamp()": [ + { + "details": "Error thrown when an invalid expiry timestamp is provided." + } + ], + "ErrInvalidOrder(bytes4)": [ + { + "details": "Error indicating that an order is invalid.", + "params": { + "msgSig": "The function signature (bytes4) of the operation that encountered an invalid order." + } + } + ], + "ErrInvalidProposalNonce(bytes4)": [ + { + "details": "Error indicating that the proposal nonce is invalid.", + "params": { + "msgSig": "The function signature (bytes4) of the operation that encountered an invalid proposal nonce." + } + } + ], + "ErrInvalidThreshold(bytes4)": [ + { + "details": "Error indicating that the provided threshold is invalid for a specific function signature.", + "params": { + "msgSig": "The function signature (bytes4) that the invalid threshold applies to." + } + } + ], + "ErrInvalidVoteWeight(bytes4)": [ + { + "details": "Error indicating that a vote weight is invalid for a specific function signature.", + "params": { + "msgSig": "The function signature (bytes4) that encountered an invalid vote weight." + } + } + ], + "ErrLengthMismatch(bytes4)": [ + { + "details": "Error indicating a mismatch in the length of input parameters or arrays for a specific function.", + "params": { + "msgSig": "The function signature (bytes4) that has a length mismatch." + } + } + ], + "ErrLooseProposalInternallyRevert(uint256,bytes)": [ + { + "details": "Error thrown when the proposal reverts when execute the internal call no. `callIndex` with revert message is `revertMsg`." + } + ], + "ErrNonExecutorCannotRelay(address,address)": [ + { + "details": "Error of the `caller` to relay is not the specified `executor`." + } + ], + "ErrOnlySelfCall(bytes4)": [ + { + "details": "Error indicating that a function can only be called by the contract itself.", + "params": { + "msgSig": "The function signature (bytes4) that can only be called by the contract itself." + } + } + ], + "ErrRelayFailed(bytes4)": [ + { + "details": "Error indicating that a relay call has failed.", + "params": { + "msgSig": "The function signature (bytes4) of the relay call that failed." + } + } + ], + "ErrUnauthorized(bytes4,uint8)": [ + { + "details": "Error indicating that the caller is unauthorized to perform a specific function.", + "params": { + "expectedRole": "The role required to perform the function.", + "msgSig": "The function signature (bytes4) that the caller is unauthorized to perform." + } + } + ], + "ErrUnsupportedInterface(bytes4,address)": [ + { + "details": "The error indicating an unsupported interface.", + "params": { + "addr": "The address where the unsupported interface was encountered.", + "interfaceId": "The bytes4 interface identifier that is not supported." + } + } + ], + "ErrUnsupportedVoteType(bytes4)": [ + { + "details": "Error indicating that a vote type is not supported.", + "params": { + "msgSig": "The function signature (bytes4) of the operation that encountered an unsupported vote type." + } + } + ], + "ErrVoteIsFinalized()": [ + { + "details": "Error thrown when attempting to interact with a finalized vote." + } + ], + "ErrZeroAddress(bytes4)": [ + { + "details": "Error indicating that given address is null when it should not." + } + ], + "ErrZeroCodeContract(address)": [ + { + "details": "Error of set to non-contract." + } + ] + } + }, + "isFoundry": true, + "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"ErrBelowMinRequiredGovernors\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"ErrContractTypeNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrCurrentProposalIsNotCompleted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrDuplicated\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"name\":\"ErrExistOneInternalCallFailed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"}],\"name\":\"ErrGovernorNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"required\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ErrGovernorNotMatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ErrInsufficientGas\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidArguments\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"}],\"name\":\"ErrInvalidChainId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidExpiryTimestamp\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidInput\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidOrder\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidProposalNonce\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidThreshold\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidVoteWeight\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrLengthMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"callIndex\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"revertMsg\",\"type\":\"bytes\"}],\"name\":\"ErrLooseProposalInternallyRevert\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"ErrNonExecutorCannotRelay\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrOnlySelfCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"ErrOperatorNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrRelayFailed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum RoleAccess\",\"name\":\"expectedRole\",\"type\":\"uint8\"}],\"name\":\"ErrUnauthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrUnsupportedInterface\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrUnsupportedVoteType\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrVoteIsFinalized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrZeroAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrZeroCodeContract\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"BridgeOperatorAddingFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"BridgeOperatorRemovingFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fromBridgeOperator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"toBridgeOperator\",\"type\":\"address\"}],\"name\":\"BridgeOperatorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"statuses\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"uint96[]\",\"name\":\"voteWeights\",\"type\":\"uint96[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"BridgeOperatorsAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"statuses\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"BridgeOperatorsRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"name\":\"CallbackRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ContractUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"round\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"indexed\":false,\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"globalProposalHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"indexed\":false,\"internalType\":\"struct GlobalProposal.GlobalProposalDetail\",\"name\":\"globalProposal\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"}],\"name\":\"GlobalProposalCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"}],\"name\":\"MinRequiredGovernorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"statuses\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"returnDatas\",\"type\":\"bytes[]\"}],\"name\":\"Notified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ProposalApproved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"round\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"indexed\":false,\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"}],\"name\":\"ProposalCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"successCalls\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"returnDatas\",\"type\":\"bytes[]\"}],\"name\":\"ProposalExecuted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ProposalExpired\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"ProposalExpiryDurationChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ProposalRejected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"enum Ballot.VoteType\",\"name\":\"support\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\"}],\"name\":\"ProposalVoted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum GlobalProposal.TargetOption\",\"name\":\"targetOption\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"TargetOptionUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"numerator\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"denominator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousNumerator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousDenominator\",\"type\":\"uint256\"}],\"name\":\"ThresholdUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96[]\",\"name\":\"voteWeights\",\"type\":\"uint96[]\"},{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"addBridgeOperators\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"voteWeight\",\"type\":\"uint256\"}],\"name\":\"checkThreshold\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeOperator\",\"type\":\"address\"}],\"name\":\"getBridgeOperatorWeight\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"weight\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBridgeOperators\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCallbackRegisters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"getContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"contract_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFullBridgeOperatorInfos\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"},{\"internalType\":\"uint96[]\",\"name\":\"weights\",\"type\":\"uint96[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"getGovernorOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"}],\"name\":\"getGovernorWeight\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"weight\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"}],\"name\":\"getGovernorWeights\",\"outputs\":[{\"internalType\":\"uint96[]\",\"name\":\"weights\",\"type\":\"uint96[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGovernors\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"}],\"name\":\"getOperatorOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getProposalExpiryDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"globalProposalRelayed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"roninChainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"bridgeContract\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"callbackRegisters\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"internalType\":\"uint96[]\",\"name\":\"voteWeights\",\"type\":\"uint96[]\"},{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isBridgeOperator\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minimumVoteWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"}],\"name\":\"registerCallbacks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"internalType\":\"struct GlobalProposal.GlobalProposalDetail\",\"name\":\"globalProposal\",\"type\":\"tuple\"},{\"internalType\":\"enum Ballot.VoteType[]\",\"name\":\"supports_\",\"type\":\"uint8[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"signatures\",\"type\":\"tuple[]\"}],\"name\":\"relayGlobalProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"internalType\":\"enum Ballot.VoteType[]\",\"name\":\"supports_\",\"type\":\"uint8[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"signatures\",\"type\":\"tuple[]\"}],\"name\":\"relayProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"removeBridgeOperators\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"}],\"name\":\"resolveTargets\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"round\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"}],\"name\":\"setMinRequiredGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom\",\"type\":\"uint256\"}],\"name\":\"setThreshold\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"}],\"name\":\"sumGovernorsWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"sum\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalBridgeOperator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"}],\"name\":\"unregisterCallbacks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"}],\"name\":\"updateManyTargetOption\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"vote\",\"outputs\":[{\"internalType\":\"enum VoteStatusConsumer.VoteStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"againstVoteWeight\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"forVoteWeight\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"ErrContractTypeNotFound(uint8)\":[{\"details\":\"Error of invalid role.\"}],\"ErrCurrentProposalIsNotCompleted()\":[{\"details\":\"Error thrown when the current proposal is not completed.\"}],\"ErrDuplicated(bytes4)\":[{\"details\":\"Error thrown when a duplicated element is detected in an array.\",\"params\":{\"msgSig\":\"The function signature that invoke the error.\"}}],\"ErrInsufficientGas(bytes32)\":[{\"details\":\"Error thrown when there is insufficient gas to execute a function.\"}],\"ErrInvalidArguments(bytes4)\":[{\"details\":\"Error indicating that arguments are invalid.\"}],\"ErrInvalidChainId(bytes4,uint256,uint256)\":[{\"details\":\"Error indicating that the chain ID is invalid.\",\"params\":{\"actual\":\"Current chain ID that executing function.\",\"expected\":\"Expected chain ID required for the tx to success.\",\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid chain ID.\"}}],\"ErrInvalidExpiryTimestamp()\":[{\"details\":\"Error thrown when an invalid expiry timestamp is provided.\"}],\"ErrInvalidOrder(bytes4)\":[{\"details\":\"Error indicating that an order is invalid.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid order.\"}}],\"ErrInvalidProposalNonce(bytes4)\":[{\"details\":\"Error indicating that the proposal nonce is invalid.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid proposal nonce.\"}}],\"ErrInvalidThreshold(bytes4)\":[{\"details\":\"Error indicating that the provided threshold is invalid for a specific function signature.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that the invalid threshold applies to.\"}}],\"ErrInvalidVoteWeight(bytes4)\":[{\"details\":\"Error indicating that a vote weight is invalid for a specific function signature.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that encountered an invalid vote weight.\"}}],\"ErrLengthMismatch(bytes4)\":[{\"details\":\"Error indicating a mismatch in the length of input parameters or arrays for a specific function.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that has a length mismatch.\"}}],\"ErrLooseProposalInternallyRevert(uint256,bytes)\":[{\"details\":\"Error thrown when the proposal reverts when execute the internal call no. `callIndex` with revert message is `revertMsg`.\"}],\"ErrNonExecutorCannotRelay(address,address)\":[{\"details\":\"Error of the `caller` to relay is not the specified `executor`.\"}],\"ErrOnlySelfCall(bytes4)\":[{\"details\":\"Error indicating that a function can only be called by the contract itself.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that can only be called by the contract itself.\"}}],\"ErrRelayFailed(bytes4)\":[{\"details\":\"Error indicating that a relay call has failed.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the relay call that failed.\"}}],\"ErrUnauthorized(bytes4,uint8)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"expectedRole\":\"The role required to perform the function.\",\"msgSig\":\"The function signature (bytes4) that the caller is unauthorized to perform.\"}}],\"ErrUnsupportedInterface(bytes4,address)\":[{\"details\":\"The error indicating an unsupported interface.\",\"params\":{\"addr\":\"The address where the unsupported interface was encountered.\",\"interfaceId\":\"The bytes4 interface identifier that is not supported.\"}}],\"ErrUnsupportedVoteType(bytes4)\":[{\"details\":\"Error indicating that a vote type is not supported.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the operation that encountered an unsupported vote type.\"}}],\"ErrVoteIsFinalized()\":[{\"details\":\"Error thrown when attempting to interact with a finalized vote.\"}],\"ErrZeroAddress(bytes4)\":[{\"details\":\"Error indicating that given address is null when it should not.\"}],\"ErrZeroCodeContract(address)\":[{\"details\":\"Error of set to non-contract.\"}]},\"events\":{\"BridgeOperatorAddingFailed(address)\":{\"details\":\"Emitted when a bridge operator is failed to add.\"},\"BridgeOperatorRemovingFailed(address)\":{\"details\":\"Emitted when a bridge operator is failed to remove.\"},\"BridgeOperatorUpdated(address,address,address)\":{\"details\":\"Emitted when a bridge operator is updated.\"},\"BridgeOperatorsAdded(bool[],uint96[],address[],address[])\":{\"details\":\"Emitted when new bridge operators are added.\"},\"BridgeOperatorsRemoved(bool[],address[])\":{\"details\":\"Emitted when bridge operators are removed.\"},\"ContractUpdated(uint8,address)\":{\"details\":\"Emitted when a contract is updated.\"},\"GlobalProposalCreated(uint256,bytes32,(uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),bytes32,(uint256,uint256,address,uint8[],uint256[],bytes[],uint256[]),address)\":{\"details\":\"Emitted when a proposal is created\"},\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"MinRequiredGovernorUpdated(uint256)\":{\"details\":\"Emitted when the minimum number of required governors is updated.\"},\"Notified(bytes,address[],bool[],bytes[])\":{\"details\":\"Emitted when the contract notifies multiple registers with statuses and return data.\"},\"ProposalApproved(bytes32)\":{\"details\":\"Emitted when the proposal is approved\"},\"ProposalCreated(uint256,uint256,bytes32,(uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),address)\":{\"details\":\"Emitted when a proposal is created\"},\"ProposalExecuted(bytes32,bool[],bytes[])\":{\"details\":\"Emitted when the proposal is executed\"},\"ProposalExpired(bytes32)\":{\"details\":\"Emitted when the vote is expired\"},\"ProposalExpiryDurationChanged(uint256)\":{\"details\":\"Emitted when the proposal expiry duration is changed.\"},\"ProposalRejected(bytes32)\":{\"details\":\"Emitted when the vote is reject\"},\"ProposalVoted(bytes32,address,uint8,uint256)\":{\"details\":\"Emitted when the proposal is voted\"},\"TargetOptionUpdated(uint8,address)\":{\"details\":\"Emitted when the target options are updated\"},\"ThresholdUpdated(uint256,uint256,uint256,uint256,uint256)\":{\"details\":\"Emitted when the threshold is updated\"}},\"kind\":\"dev\",\"methods\":{\"addBridgeOperators(uint96[],address[],address[])\":{\"details\":\"Adds multiple bridge operators.\",\"params\":{\"bridgeOperators\":\"An array of addresses representing the bridge operators to add.\",\"governors\":\"An array of addresses of hot/cold wallets for bridge operator to update their node address.\"}},\"checkThreshold(uint256)\":{\"details\":\"Checks whether the `_voteWeight` passes the threshold.\"},\"getBridgeOperatorWeight(address)\":{\"details\":\"External function to retrieve the vote weight of a specific bridge operator.\",\"params\":{\"bridgeOperator\":\"The address of the bridge operator to get the vote weight for.\"},\"returns\":{\"weight\":\"The vote weight of the specified bridge operator.\"}},\"getBridgeOperators()\":{\"details\":\"Returns an array of all bridge operators.\",\"returns\":{\"_0\":\"An array containing the addresses of all bridge operators.\"}},\"getCallbackRegisters()\":{\"details\":\"Retrieves the addresses of registered callbacks.\",\"returns\":{\"registers\":\"An array containing the addresses of registered callbacks.\"}},\"getContract(uint8)\":{\"details\":\"Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.\",\"params\":{\"contractType\":\"The role of the contract to retrieve.\"},\"returns\":{\"contract_\":\"The address of the contract with the specified role.\"}},\"getFullBridgeOperatorInfos()\":{\"details\":\"Retrieves the full information of all registered bridge operators. This external function allows external callers to obtain the full information of all the registered bridge operators. The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.\",\"returns\":{\"bridgeOperators\":\"An array of addresses representing the registered bridge operators.\",\"governors\":\"An array of addresses representing the governors of each bridge operator.\",\"weights\":\"An array of uint256 values representing the vote weights of each bridge operator. Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator. Example Usage: ``` (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos(); for (uint256 i = 0; i < bridgeOperators.length; i++) { // Access individual information for each bridge operator. address governor = governors[i]; address bridgeOperator = bridgeOperators[i]; uint256 weight = weights[i]; // ... (Process or use the information as required) ... } ```\"}},\"getGovernorOf(address)\":{\"details\":\"Returns the corresponding `governor` of a `operator`.\"},\"getGovernorWeight(address)\":{\"details\":\"External function to retrieve the vote weight of a specific governor.\",\"params\":{\"governor\":\"The address of the governor to get the vote weight for.\"},\"returns\":{\"weight\":\"voteWeight The vote weight of the specified governor.\"}},\"getGovernorWeights(address[])\":{\"details\":\"Returns the weights of a list of governor addresses.\"},\"getGovernors()\":{\"details\":\"Returns an array of all governors.\",\"returns\":{\"_0\":\"An array containing the addresses of all governors.\"}},\"getOperatorOf(address)\":{\"details\":\"Returns the corresponding `operator` of a `governor`.\"},\"getProposalExpiryDuration()\":{\"details\":\"Returns the expiry duration for a new proposal.\"},\"getThreshold()\":{\"details\":\"Returns the threshold.\"},\"getTotalWeight()\":{\"details\":\"Returns total weights.\"},\"globalProposalRelayed(uint256)\":{\"details\":\"Returns whether the voter `_voter` casted vote for the proposal.\"},\"isBridgeOperator(address)\":{\"details\":\"Checks if the given address is a bridge operator.\",\"params\":{\"addr\":\"The address to check.\"},\"returns\":{\"_0\":\"A boolean indicating whether the address is a bridge operator.\"}},\"minimumVoteWeight()\":{\"details\":\"Returns the minimum vote weight to pass the threshold.\"},\"registerCallbacks(address[])\":{\"details\":\"Registers multiple callbacks with the bridge.\",\"params\":{\"registers\":\"The array of callback addresses to register.\"}},\"relayGlobalProposal((uint256,uint256,address,uint8[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])\":{\"details\":\"See `GovernanceRelay-_relayGlobalProposal`. Requirements: - The method caller is governor.\"},\"relayProposal((uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])\":{\"details\":\"See `GovernanceRelay-_relayProposal`. Requirements: - The method caller is governor.\"},\"removeBridgeOperators(address[])\":{\"details\":\"Removes multiple bridge operators.\",\"params\":{\"bridgeOperators\":\"An array of addresses representing the bridge operators to remove.\"}},\"resolveTargets(uint8[])\":{\"details\":\"Returns corresponding address of target options. Return address(0) on non-existent target.\"},\"setContract(uint8,address)\":{\"details\":\"Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.\",\"params\":{\"addr\":\"The address of the contract to set.\",\"contractType\":\"The role of the contract to set.\"}},\"setMinRequiredGovernor(uint256)\":{\"details\":\"Self-call to update the minimum required governor.\",\"params\":{\"min\":\"The minimum number, this must not less than 3.\"}},\"setThreshold(uint256,uint256)\":{\"details\":\"Sets the threshold. Requirements: - The method caller is admin. Emits the `ThresholdUpdated` event.\"},\"sumGovernorsWeight(address[])\":{\"details\":\"Returns total weights of the governor list.\"},\"totalBridgeOperator()\":{\"details\":\"Returns the total number of bridge operators.\",\"returns\":{\"_0\":\"The total number of bridge operators.\"}},\"unregisterCallbacks(address[])\":{\"details\":\"Unregisters multiple callbacks from the bridge.\",\"params\":{\"registers\":\"The array of callback addresses to unregister.\"}},\"updateManyTargetOption(uint8[],address[])\":{\"details\":\"Updates list of `targetOptions` to `targets`. Requirement: - Only allow self-call through proposal.\"}},\"version\":1},\"userdoc\":{\"errors\":{\"ErrBelowMinRequiredGovernors()\":[{\"notice\":\"Error indicating that the governors list will go below minimum number of required governor.\"}],\"ErrGovernorNotFound(address)\":[{\"notice\":\"Error indicating that cannot find the querying governor\"}],\"ErrGovernorNotMatch(address,address)\":[{\"notice\":\"Error indicating that the msg.sender is not match the required governor\"}],\"ErrInvalidInput()\":[{\"notice\":\"Common invalid input error\"}],\"ErrOperatorNotFound(address)\":[{\"notice\":\"Error indicating that cannot find the querying operator\"}]},\"kind\":\"user\",\"methods\":{\"round(uint256)\":{\"notice\":\"chain id = 0 for global proposal\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/mainchain/MainchainBridgeManager.sol\":\"MainchainBridgeManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@fdk/=lib/foundry-deployment-kit/script/\",\":@openzeppelin/=lib/openzeppelin-contracts/\",\":@prb/math/=lib/prb-math/\",\":@prb/test/=lib/prb-test/src/\",\":@ronin/contracts/=src/\",\":@ronin/script/=script/\",\":@ronin/test/=test/\",\":contract-libs/=lib/foundry-deployment-kit/lib/contract-libs/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/foundry-deployment-kit/lib/forge-std/src/\",\":foundry-deployment-kit/=lib/foundry-deployment-kit/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/contracts/\",\":prb-math/=lib/prb-math/src/\",\":prb-test/=lib/prb-test/src/\",\":solady/=lib/solady/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0xa6a787e7a901af6511e19aa53e1a00352db215a011d2c7a438d0582dd5da76f9\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2a21b14ff90012878752f230d3ffd5c3405e5938d06c97a7d89c0a64561d0d66\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _HEX_SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n // Inspired by OraclizeAPI's implementation - MIT licence\\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\\n\\n if (value == 0) {\\n return \\\"0\\\";\\n }\\n uint256 temp = value;\\n uint256 digits;\\n while (temp != 0) {\\n digits++;\\n temp /= 10;\\n }\\n bytes memory buffer = new bytes(digits);\\n while (value != 0) {\\n digits -= 1;\\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\\n value /= 10;\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n if (value == 0) {\\n return \\\"0x00\\\";\\n }\\n uint256 temp = value;\\n uint256 length = 0;\\n while (temp != 0) {\\n length++;\\n temp >>= 8;\\n }\\n return toHexString(value, length);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xaf159a8b1923ad2a26d516089bceca9bdeaeacd04be50983ea00ba63070f08a3\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.3) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSA {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n } else if (error == RecoverError.InvalidSignatureV) {\\n revert(\\\"ECDSA: invalid signature 'v' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n if (v != 27 && v != 28) {\\n return (address(0), RecoverError.InvalidSignatureV);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", Strings.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0xdb7f5c28fc61cda0bd8ab60ce288e206b791643bcd3ba464a70cbec18895a2f5\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n *\\n * [WARNING]\\n * ====\\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.\\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\\n *\\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.\\n * ====\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n bytes32 lastValue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastValue;\\n // Update the index for the moved value\\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n return set._values[index];\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function _values(Set storage set) private view returns (bytes32[] memory) {\\n return set._values;\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\\n return _values(set._inner);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(AddressSet storage set) internal view returns (address[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n address[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(UintSet storage set) internal view returns (uint256[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n uint256[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0x5050943b32b6a8f282573d166b2e9d87ab7eb4dbba4ab6acf36ecb54fe6995e4\",\"license\":\"MIT\"},\"src/extensions/TransparentUpgradeableProxyV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\\\";\\n\\ncontract TransparentUpgradeableProxyV2 is TransparentUpgradeableProxy {\\n constructor(address _logic, address admin_, bytes memory _data) payable TransparentUpgradeableProxy(_logic, admin_, _data) { }\\n\\n /**\\n * @dev Calls a function from the current implementation as specified by `_data`, which should be an encoded function call.\\n *\\n * Requirements:\\n * - Only the admin can call this function.\\n *\\n * Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid\\n * triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider\\n * reviewing the encoded data `_data` and the method which is called before using this.\\n *\\n */\\n function functionDelegateCall(bytes memory _data) public payable ifAdmin {\\n address _addr = _implementation();\\n assembly {\\n let _result := delegatecall(gas(), _addr, add(_data, 32), mload(_data), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n switch _result\\n case 0 { revert(0, returndatasize()) }\\n default { return(0, returndatasize()) }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x45fc7b71d09da99414b977a56e586b3604670d865e5f36f395d5c98bc4ba64af\",\"license\":\"MIT\"},\"src/extensions/bridge-operator-governance/BridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.23;\\n\\nimport { Initializable } from \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport { IBridgeManagerCallback, BridgeManagerCallbackRegister } from \\\"./BridgeManagerCallbackRegister.sol\\\";\\nimport { IHasContracts, HasContracts } from \\\"../../extensions/collections/HasContracts.sol\\\";\\n\\nimport { IBridgeManager } from \\\"../../interfaces/bridge/IBridgeManager.sol\\\";\\nimport { AddressArrayUtils } from \\\"../../libraries/AddressArrayUtils.sol\\\";\\nimport { ContractType } from \\\"../../utils/ContractType.sol\\\";\\nimport { RoleAccess } from \\\"../../utils/RoleAccess.sol\\\";\\nimport { TUint256Slot } from \\\"../../types/Types.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\nimport \\\"./BridgeManagerQuorum.sol\\\";\\n\\nabstract contract BridgeManager is IBridgeManager, BridgeManagerQuorum, BridgeManagerCallbackRegister {\\n using AddressArrayUtils for address[];\\n\\n struct BridgeManagerStorage {\\n /// @notice List of the governors.\\n /// @dev We do not use EnumerableSet here to maintain identical order of `governors` and `operators`. If `.contains` is needed, use the corresponding weight mapping.\\n address[] _governors;\\n address[] _operators;\\n /// @dev Mapping from address to the governor weight\\n mapping(address governor => uint96 weight) _governorWeight;\\n /// @dev Mapping from address to the operator weight. This must always be identical `_governorWeight`.\\n mapping(address operator => uint96 weight) _operatorWeight;\\n /// @dev Total weight of all governors / operators.\\n uint256 _totalWeight;\\n /// @dev The minimum number of governors that must exist in the contract, to avoid the contract become non-accessible.\\n uint256 _minRequiredGovernor;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"ronin.storage.BridgeManagerStorageLocation\\\")) - 1)) & ~bytes32(uint256(0xff))\\n bytes32 private constant $$_BridgeManagerStorageLocation = 0xc648703095712c0419b6431ae642c061f0a105ac2d7c3d9604061ef4ebc38300;\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n bytes32 public DOMAIN_SEPARATOR;\\n\\n modifier onlyGovernor() virtual {\\n _requireGovernor(msg.sender);\\n _;\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n function __BridgeManager_init(\\n uint256 num,\\n uint256 denom,\\n uint256 roninChainId,\\n address bridgeContract,\\n address[] memory callbackRegisters,\\n address[] memory bridgeOperators,\\n address[] memory governors,\\n uint96[] memory voteWeights\\n ) internal onlyInitializing {\\n __BridgeManagerQuorum_init_unchained(num, denom);\\n __BridgeManagerCallbackRegister_init_unchained(callbackRegisters);\\n __BridgeManager_init_unchained(roninChainId, bridgeContract, bridgeOperators, governors, voteWeights);\\n }\\n\\n function __BridgeManager_init_unchained(\\n uint256 roninChainId,\\n address bridgeContract,\\n address[] memory bridgeOperators,\\n address[] memory governors,\\n uint96[] memory voteWeights\\n ) internal onlyInitializing {\\n _setContract(ContractType.BRIDGE, bridgeContract);\\n\\n DOMAIN_SEPARATOR = keccak256(\\n abi.encode(\\n keccak256(\\\"EIP712Domain(string name,string version,bytes32 salt)\\\"),\\n keccak256(\\\"BridgeManager\\\"), // name hash\\n keccak256(\\\"3\\\"), // version hash\\n keccak256(abi.encode(\\\"BRIDGE_MANAGER\\\", roninChainId)) // salt\\n )\\n );\\n\\n _addBridgeOperators(voteWeights, governors, bridgeOperators);\\n _setMinRequiredGovernor(3);\\n }\\n\\n function _getBridgeManagerStorage() private pure returns (BridgeManagerStorage storage $) {\\n assembly {\\n $.slot := $$_BridgeManagerStorageLocation\\n }\\n }\\n\\n // ===================== CONFIG ========================\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function setContract(ContractType contractType, address addr) external override onlyProxyAdmin {\\n _requireHasCode(addr);\\n _setContract(contractType, addr);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function setMinRequiredGovernor(uint min) external override onlyProxyAdmin {\\n _setMinRequiredGovernor(min);\\n }\\n\\n function _setMinRequiredGovernor(uint min) internal {\\n if (min < 3) revert ErrInvalidInput();\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n $._minRequiredGovernor = min;\\n emit MinRequiredGovernorUpdated(min);\\n }\\n\\n /**\\n * @dev Internal function to require that the caller has governor role access.\\n */\\n function _requireGovernor(address addr) internal view {\\n if (_getGovernorWeight(addr) == 0) {\\n revert ErrUnauthorized(msg.sig, RoleAccess.GOVERNOR);\\n }\\n }\\n\\n // ===================== WEIGHTS METHOD ========================\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getTotalWeight() public view returns (uint256) {\\n return _totalWeight();\\n }\\n\\n function _totalWeight() internal view override returns (uint256) {\\n return _getBridgeManagerStorage()._totalWeight;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getGovernorWeights(address[] calldata governors) external view returns (uint96[] memory weights) {\\n weights = _getGovernorWeights(governors);\\n }\\n\\n /**\\n * @dev Internal function to get the vote weights of a given array of governors.\\n */\\n function _getGovernorWeights(address[] memory governors) internal view returns (uint96[] memory weights) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n weights = new uint96[](governors.length);\\n\\n for (uint256 i; i < governors.length; i++) {\\n weights[i] = $._governorWeight[governors[i]];\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getGovernorWeight(address governor) external view returns (uint96 weight) {\\n weight = _getGovernorWeight(governor);\\n }\\n\\n /**\\n * @dev Internal function to retrieve the vote weight of a specific governor.\\n */\\n function _getGovernorWeight(address governor) internal view returns (uint96) {\\n return _getBridgeManagerStorage()._governorWeight[governor];\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function sumGovernorsWeight(address[] calldata governors) external view nonDuplicate(governors) returns (uint256 sum) {\\n sum = _sumGovernorsWeight(governors);\\n }\\n\\n /**\\n * @dev Internal function to calculate the sum of vote weights for a given array of governors.\\n * @param governors The non-duplicated input.\\n */\\n function _sumGovernorsWeight(address[] memory governors) internal view nonDuplicate(governors) returns (uint256 sum) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n for (uint256 i; i < governors.length; i++) {\\n sum += $._governorWeight[governors[i]];\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint96 weight) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n return $._operatorWeight[bridgeOperator];\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function minimumVoteWeight() public view virtual returns (uint256) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n (uint256 numerator, uint256 denominator) = getThreshold();\\n return (numerator * $._totalWeight + denominator - 1) / denominator;\\n }\\n\\n // ===================== MANAGER CRUD ========================\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function addBridgeOperators(uint96[] calldata voteWeights, address[] calldata governors, address[] calldata bridgeOperators) external onlyProxyAdmin {\\n _addBridgeOperators(voteWeights, governors, bridgeOperators);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function removeBridgeOperators(address[] calldata bridgeOperators) external onlyProxyAdmin {\\n _removeBridgeOperators(bridgeOperators);\\n }\\n\\n /**\\n * @dev Internal function to add bridge operators.\\n *\\n * This function adds the specified `bridgeOperators` to the bridge operator set and establishes the associated mappings.\\n *\\n * Requirements:\\n * - The caller must have the necessary permission to add bridge operators.\\n * - The lengths of `voteWeights`, `governors`, and `bridgeOperators` arrays must be equal.\\n *\\n * @return addeds An array of boolean values indicating whether each bridge operator was successfully added.\\n */\\n function _addBridgeOperators(\\n uint96[] memory voteWeights,\\n address[] memory newGovernors,\\n address[] memory newOperators\\n ) internal nonDuplicate(newGovernors.extend(newOperators)) returns (bool[] memory addeds) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n uint256 length = newOperators.length;\\n if (!(length == voteWeights.length && length == newGovernors.length)) revert ErrLengthMismatch(msg.sig);\\n addeds = new bool[](length);\\n\\n // simply skip add operations if inputs are empty.\\n if (length == 0) return addeds;\\n\\n address iGovernor;\\n address iOperator;\\n uint96 iVoteWeight;\\n uint256 accumulatedWeight;\\n\\n for (uint256 i; i < length; i++) {\\n iGovernor = newGovernors[i];\\n iOperator = newOperators[i];\\n iVoteWeight = voteWeights[i];\\n\\n // Check non-zero inputs\\n _requireNonZeroAddress(iGovernor);\\n _requireNonZeroAddress(iOperator);\\n if (iVoteWeight == 0) revert ErrInvalidVoteWeight(msg.sig);\\n\\n // Check not yet added operators\\n addeds[i] = ($._governorWeight[iGovernor] + $._governorWeight[iOperator] + $._operatorWeight[iOperator] + $._operatorWeight[iGovernor]) == 0;\\n\\n // Only add the valid operator\\n if (addeds[i]) {\\n // Add governor to list, update governor weight\\n $._governors.push(iGovernor);\\n $._governorWeight[iGovernor] = iVoteWeight;\\n\\n // Add operator to list, update governor weight\\n $._operators.push(iOperator);\\n $._operatorWeight[iOperator] = iVoteWeight;\\n\\n accumulatedWeight += iVoteWeight;\\n }\\n }\\n\\n $._totalWeight += accumulatedWeight;\\n\\n _notifyRegisters(IBridgeManagerCallback.onBridgeOperatorsAdded.selector, abi.encode(newOperators, voteWeights, addeds));\\n\\n emit BridgeOperatorsAdded(addeds, voteWeights, newGovernors, newOperators);\\n }\\n\\n /**\\n * @dev Internal function to remove bridge operators.\\n *\\n * This function removes the specified `bridgeOperators` from the bridge operator set and related mappings.\\n *\\n * Requirements:\\n * - The caller must have the necessary permission to remove bridge operators.\\n *\\n * @param removingOperators An array of addresses representing the bridge operators to be removed.\\n * @return removeds An array of boolean values indicating whether each bridge operator was successfully removed.\\n */\\n function _removeBridgeOperators(address[] memory removingOperators) internal nonDuplicate(removingOperators) returns (bool[] memory removeds) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n uint256 length = removingOperators.length;\\n removeds = new bool[](length);\\n\\n // simply skip remove operations if inputs are empty.\\n if (length == 0) return removeds;\\n if ($._governors.length - length < $._minRequiredGovernor) {\\n revert ErrBelowMinRequiredGovernors();\\n }\\n\\n address iGovernor;\\n address iOperator;\\n uint256 accumulatedWeight;\\n uint idx;\\n\\n for (uint256 i; i < length; i++) {\\n iOperator = removingOperators[i];\\n\\n // Check non-zero inputs\\n (iGovernor, idx) = _getGovernorOf(iOperator);\\n _requireNonZeroAddress(iGovernor);\\n _requireNonZeroAddress(iOperator);\\n\\n // Check existing operators\\n removeds[i] = $._governorWeight[iGovernor] > 0 && $._operatorWeight[iOperator] > 0;\\n\\n // Only remove the valid operator\\n if (removeds[i]) {\\n uint removingVoteWeight = $._governorWeight[iGovernor];\\n\\n // Remove governor from list, update governor weight\\n uint lastIdx = $._governors.length - 1;\\n $._governors[idx] = $._governors[lastIdx];\\n $._governors.pop();\\n delete $._governorWeight[iGovernor];\\n\\n // Remove operator from list, update operator weight\\n $._operators[idx] = $._operators[lastIdx];\\n $._operators.pop();\\n delete $._operatorWeight[iOperator];\\n\\n accumulatedWeight += removingVoteWeight;\\n }\\n }\\n\\n $._totalWeight -= accumulatedWeight;\\n\\n _notifyRegisters(IBridgeManagerCallback.onBridgeOperatorsRemoved.selector, abi.encode(removingOperators, removeds));\\n\\n emit BridgeOperatorsRemoved(removeds, removingOperators);\\n }\\n\\n function _findInArray(address[] storage $_array, address addr) internal view returns (bool found, uint idx) {\\n for (uint i; i < $_array.length; i++) {\\n if (addr == $_array[i]) {\\n return (true, i);\\n }\\n }\\n\\n return (false, type(uint256).max);\\n }\\n\\n // ================= MANAGER VIEW METHODS =============\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function totalBridgeOperator() external view returns (uint256) {\\n return _getBridgeManagerStorage()._operators.length;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function isBridgeOperator(address addr) external view returns (bool) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n return $._operatorWeight[addr] > 0;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getBridgeOperators() external view returns (address[] memory) {\\n return _getBridgeManagerStorage()._operators;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getGovernors() external view returns (address[] memory) {\\n return _getBridgeManagerStorage()._governors;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getOperatorOf(address governor) external view returns (address operator) {\\n (bool found, uint idx) = _findInArray(_getBridgeManagerStorage()._governors, governor);\\n if (!found) revert ErrGovernorNotFound(governor);\\n\\n return _getBridgeManagerStorage()._operators[idx];\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getGovernorOf(address operator) external view returns (address governor) {\\n (governor,) = _getGovernorOf(operator);\\n }\\n\\n function _getGovernorOf(address operator) internal view returns (address governor, uint idx) {\\n (bool found, uint foundId) = _findInArray(_getBridgeManagerStorage()._operators, operator);\\n if (!found) revert ErrOperatorNotFound(operator);\\n\\n return (_getBridgeManagerStorage()._governors[foundId], foundId);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getFullBridgeOperatorInfos() external view returns (address[] memory governors, address[] memory bridgeOperators, uint96[] memory weights) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n governors = $._governors;\\n bridgeOperators = $._operators;\\n weights = _getGovernorWeights(governors);\\n }\\n}\\n\",\"keccak256\":\"0xa66d73d33f953f3262714999043f99fb7b7542d1d29c481e376d9ecd2b15b28b\",\"license\":\"MIT\"},\"src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { Initializable } from \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport { EnumerableSet } from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\nimport { IBridgeManagerCallbackRegister } from \\\"../../interfaces/bridge/IBridgeManagerCallbackRegister.sol\\\";\\nimport { IBridgeManagerCallback } from \\\"../../interfaces/bridge/IBridgeManagerCallback.sol\\\";\\nimport { HasContracts } from \\\"../../extensions/collections/HasContracts.sol\\\";\\nimport { TransparentUpgradeableProxyV2, IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\n\\n/**\\n * @title BridgeManagerCallbackRegister\\n * @dev A contract that manages callback registrations and execution for a bridge.\\n */\\nabstract contract BridgeManagerCallbackRegister is IBridgeManagerCallbackRegister, IdentityGuard, Initializable, HasContracts {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n /**\\n * @dev Storage slot for the address set of callback registers.\\n * @dev Value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeAdmin.callbackRegisters.slot\\\") - 1.\\n */\\n bytes32 private constant CALLBACK_REGISTERS_SLOT = 0x5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd976240;\\n\\n function __BridgeManagerCallbackRegister_init_unchained(address[] memory callbackRegisters) internal onlyInitializing {\\n _registerCallbacks(callbackRegisters);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallbackRegister\\n */\\n function registerCallbacks(address[] calldata registers) external onlyProxyAdmin {\\n _registerCallbacks(registers);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallbackRegister\\n */\\n function unregisterCallbacks(address[] calldata registers) external onlyProxyAdmin nonDuplicate(registers) {\\n EnumerableSet.AddressSet storage _callbackRegisters = _getCallbackRegisters();\\n\\n for (uint256 i; i < registers.length; i++) {\\n _callbackRegisters.remove(registers[i]);\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallbackRegister\\n */\\n function getCallbackRegisters() external view returns (address[] memory registers) {\\n registers = _getCallbackRegisters().values();\\n }\\n\\n /**\\n * @dev Internal function to register multiple callbacks with the bridge.\\n * @param registers The array of callback addresses to register.\\n */\\n function _registerCallbacks(address[] memory registers) internal nonDuplicate(registers) {\\n EnumerableSet.AddressSet storage _callbackRegisters = _getCallbackRegisters();\\n address register;\\n bool regSuccess;\\n\\n for (uint256 i; i < registers.length; i++) {\\n register = registers[i];\\n\\n _requireHasCode(register);\\n _requireSupportsInterface(register, type(IBridgeManagerCallback).interfaceId);\\n\\n regSuccess = _callbackRegisters.add(register);\\n\\n emit CallbackRegistered(register, regSuccess);\\n }\\n }\\n\\n /**\\n * @dev Same as {_notifyRegistersUnsafe} but revert when there at least one failed internal call.\\n */\\n function _notifyRegisters(bytes4 callbackFnSig, bytes memory inputs) internal {\\n if (!_notifyRegistersUnsafe(callbackFnSig, inputs)) {\\n revert ErrExistOneInternalCallFailed(msg.sender, callbackFnSig, inputs);\\n }\\n }\\n\\n /**\\n * @dev Internal function to notify all registered callbacks with the provided function signature and data.\\n * @param callbackFnSig The function signature of the callback method.\\n * @param inputs The data to pass to the callback method.\\n * @return allSuccess Return true if all internal calls are success\\n */\\n function _notifyRegistersUnsafe(bytes4 callbackFnSig, bytes memory inputs) internal returns (bool allSuccess) {\\n allSuccess = true;\\n\\n address[] memory registers = _getCallbackRegisters().values();\\n uint256 length = registers.length;\\n if (length == 0) return allSuccess;\\n\\n bool[] memory successes = new bool[](length);\\n bytes[] memory returnDatas = new bytes[](length);\\n bytes memory callData = abi.encodePacked(callbackFnSig, inputs);\\n bytes memory proxyCallData = abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (callData));\\n\\n for (uint256 i; i < length; i++) {\\n // First, attempt to call normally\\n (successes[i], returnDatas[i]) = registers[i].call(callData);\\n\\n // If cannot call normally, attempt to call as the recipient is the proxy, and this caller is its admin.\\n if (!successes[i]) {\\n (successes[i], returnDatas[i]) = registers[i].call(proxyCallData);\\n allSuccess = allSuccess && successes[i];\\n }\\n }\\n\\n emit Notified(callData, registers, successes, returnDatas);\\n }\\n\\n /**\\n * @dev Internal function to retrieve the address set of callback registers.\\n * @return callbackRegisters The storage reference to the callback registers.\\n */\\n function _getCallbackRegisters() internal pure returns (EnumerableSet.AddressSet storage callbackRegisters) {\\n assembly (\\\"memory-safe\\\") {\\n callbackRegisters.slot := CALLBACK_REGISTERS_SLOT\\n }\\n }\\n}\\n\",\"keccak256\":\"0xee1c849d6b50cda917d6c918a23116cc288488958f58ef215707204e7c2f847f\",\"license\":\"MIT\"},\"src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.23;\\n\\nimport { Initializable } from \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport { IQuorum } from \\\"../../interfaces/IQuorum.sol\\\";\\nimport { IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\nimport { HasContracts } from \\\"../../extensions/collections/HasContracts.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\n\\nabstract contract BridgeManagerQuorum is IQuorum, IdentityGuard, Initializable, HasContracts {\\n struct BridgeManagerQuorumStorage {\\n uint256 _nonce;\\n uint256 _numerator;\\n uint256 _denominator;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"ronin.storage.BridgeManagerQuorumStorage\\\")) - 1)) & ~bytes32(uint256(0xff))\\n bytes32 private constant $$_BridgeManagerQuorumStorage = 0xf3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00;\\n\\n function __BridgeManagerQuorum_init_unchained(uint256 num, uint256 denom) internal onlyInitializing {\\n BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage();\\n $._nonce = 1;\\n\\n _setThreshold(num, denom);\\n }\\n\\n function _getBridgeManagerQuorumStorage() private pure returns (BridgeManagerQuorumStorage storage $) {\\n assembly {\\n $.slot := $$_BridgeManagerQuorumStorage\\n }\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function setThreshold(uint256 num, uint256 denom) external override onlyProxyAdmin {\\n _setThreshold(num, denom);\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function getThreshold() public view virtual returns (uint256 num, uint256 denom) {\\n BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage();\\n return ($._numerator, $._denominator);\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function checkThreshold(uint256 voteWeight) external view virtual returns (bool) {\\n BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage();\\n\\n return voteWeight * $._denominator >= $._numerator * _totalWeight();\\n }\\n\\n /**\\n * @dev Sets threshold and returns the old one.\\n *\\n * Emits the `ThresholdUpdated` event.\\n *\\n */\\n function _setThreshold(uint256 num, uint256 denom) internal virtual {\\n if (num > denom || denom <= 1) revert ErrInvalidThreshold(msg.sig);\\n\\n BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage();\\n\\n uint256 prevNum = $._numerator;\\n uint256 prevDenom = $._denominator;\\n\\n $._numerator = num;\\n $._denominator = denom;\\n\\n emit ThresholdUpdated($._nonce++, num, denom, prevNum, prevDenom);\\n }\\n\\n function _totalWeight() internal view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0xd49face0efa89eac09d2d6a5eb69598fd706ba1aac8d431b22212643a507b74e\",\"license\":\"MIT\"},\"src/extensions/collections/HasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { HasProxyAdmin } from \\\"./HasProxyAdmin.sol\\\";\\nimport \\\"../../interfaces/collections/IHasContracts.sol\\\";\\nimport { IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\nimport { ErrUnexpectedInternalCall } from \\\"../../utils/CommonErrors.sol\\\";\\n\\n/**\\n * @title HasContracts\\n * @dev A contract that provides functionality to manage multiple contracts with different roles.\\n */\\nabstract contract HasContracts is HasProxyAdmin, IHasContracts, IdentityGuard {\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.collections.HasContracts.slot\\\") - 1\\n bytes32 private constant _STORAGE_SLOT = 0xdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb;\\n\\n /**\\n * @dev Modifier to restrict access to functions only to contracts with a specific role.\\n * @param contractType The contract type that allowed to call\\n */\\n modifier onlyContract(ContractType contractType) virtual {\\n _requireContract(contractType);\\n _;\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function setContract(ContractType contractType, address addr) external virtual onlyProxyAdmin {\\n _requireHasCode(addr);\\n _setContract(contractType, addr);\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function getContract(ContractType contractType) public view returns (address contract_) {\\n contract_ = _getContractMap()[uint8(contractType)];\\n if (contract_ == address(0)) revert ErrContractTypeNotFound(contractType);\\n }\\n\\n /**\\n * @dev Internal function to set the address of a contract with a specific role.\\n * @param contractType The contract type of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function _setContract(ContractType contractType, address addr) internal virtual {\\n _getContractMap()[uint8(contractType)] = addr;\\n emit ContractUpdated(contractType, addr);\\n }\\n\\n /**\\n * @dev Internal function to access the mapping of contract addresses with roles.\\n * @return contracts_ The mapping of contract addresses with roles.\\n */\\n function _getContractMap() private pure returns (mapping(uint8 => address) storage contracts_) {\\n assembly {\\n contracts_.slot := _STORAGE_SLOT\\n }\\n }\\n\\n /**\\n * @dev Internal function to check if the calling contract has a specific role.\\n * @param contractType The contract type that the calling contract must have.\\n * @dev Throws an error if the calling contract does not have the specified role.\\n */\\n function _requireContract(ContractType contractType) private view {\\n if (msg.sender != getContract(contractType)) {\\n revert ErrUnexpectedInternalCall(msg.sig, contractType, msg.sender);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7dbefa31230e6e4bd319f02d94893cbfd07ee12a0e016f5fadc57660df01891\",\"license\":\"MIT\"},\"src/extensions/collections/HasProxyAdmin.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/StorageSlot.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\n\\nabstract contract HasProxyAdmin {\\n // bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n modifier onlyProxyAdmin() {\\n _requireProxyAdmin();\\n _;\\n }\\n\\n /**\\n * @dev Returns proxy admin.\\n */\\n function _getProxyAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n function _requireProxyAdmin() internal view {\\n if (msg.sender != _getProxyAdmin()) revert ErrUnauthorized(msg.sig, RoleAccess.ADMIN);\\n }\\n}\\n\",\"keccak256\":\"0xad3db02c99a960b60151f2ad45eed46073d14fe1ed861f496c7aeefacbbc528e\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/CoreGovernance.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport \\\"../../libraries/Proposal.sol\\\";\\nimport \\\"../../libraries/GlobalProposal.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\nimport \\\"../../libraries/Ballot.sol\\\";\\nimport \\\"../../interfaces/consumers/ChainTypeConsumer.sol\\\";\\nimport \\\"../../interfaces/consumers/SignatureConsumer.sol\\\";\\nimport \\\"../../interfaces/consumers/VoteStatusConsumer.sol\\\";\\n\\nabstract contract CoreGovernance is Initializable, SignatureConsumer, VoteStatusConsumer, ChainTypeConsumer {\\n using Proposal for Proposal.ProposalDetail;\\n\\n /**\\n * @dev Error thrown when attempting to interact with a finalized vote.\\n */\\n error ErrVoteIsFinalized();\\n\\n /**\\n * @dev Error thrown when the current proposal is not completed.\\n */\\n error ErrCurrentProposalIsNotCompleted();\\n\\n struct ProposalVote {\\n VoteStatus status;\\n bytes32 hash;\\n uint256 againstVoteWeight; // Total weight of against votes\\n uint256 forVoteWeight; // Total weight of for votes\\n address[] forVoteds; // Array of addresses voting for\\n address[] againstVoteds; // Array of addresses voting against\\n uint256 expiryTimestamp;\\n mapping(address => Signature) sig;\\n mapping(address => bool) voted;\\n }\\n\\n /// @dev Emitted when a proposal is created\\n event ProposalCreated(uint256 indexed chainId, uint256 indexed round, bytes32 indexed proposalHash, Proposal.ProposalDetail proposal, address creator);\\n /// @dev Emitted when the proposal is voted\\n event ProposalVoted(bytes32 indexed proposalHash, address indexed voter, Ballot.VoteType support, uint256 weight);\\n /// @dev Emitted when the proposal is approved\\n event ProposalApproved(bytes32 indexed proposalHash);\\n /// @dev Emitted when the vote is reject\\n event ProposalRejected(bytes32 indexed proposalHash);\\n /// @dev Emitted when the vote is expired\\n event ProposalExpired(bytes32 indexed proposalHash);\\n /// @dev Emitted when the proposal is executed\\n event ProposalExecuted(bytes32 indexed proposalHash, bool[] successCalls, bytes[] returnDatas);\\n /// @dev Emitted when the proposal expiry duration is changed.\\n event ProposalExpiryDurationChanged(uint256 indexed duration);\\n\\n /// @dev Mapping from chain id => vote round\\n /// @notice chain id = 0 for global proposal\\n mapping(uint256 => uint256) public round;\\n /// @dev Mapping from chain id => vote round => proposal vote\\n mapping(uint256 => mapping(uint256 => ProposalVote)) public vote;\\n\\n uint256 internal _proposalExpiryDuration;\\n\\n function __CoreGovernance_init(uint256 expiryDuration) internal onlyInitializing {\\n __CoreGovernance_init_unchained(expiryDuration);\\n }\\n\\n function __CoreGovernance_init_unchained(uint256 expiryDuration) internal onlyInitializing {\\n _setProposalExpiryDuration(expiryDuration);\\n }\\n\\n /**\\n * @dev Creates new voting round by calculating the `_round` number of chain `_chainId`.\\n * Increases the `_round` number if the previous one is not expired. Delete the previous proposal\\n * if it is expired and not increase the `_round`.\\n */\\n function _createVotingRound(uint256 _chainId) internal returns (uint256 _round) {\\n _round = round[_chainId];\\n // Skip checking for the first ever round\\n if (_round == 0) {\\n _round = round[_chainId] = 1;\\n } else {\\n ProposalVote storage _latestProposalVote = vote[_chainId][_round];\\n bool _isExpired = _tryDeleteExpiredVotingRound(_latestProposalVote);\\n // Skip increasing round number if the latest round is expired, allow the vote to be overridden\\n if (!_isExpired) {\\n if (_latestProposalVote.status == VoteStatus.Pending) revert ErrCurrentProposalIsNotCompleted();\\n unchecked {\\n _round = ++round[_chainId];\\n }\\n }\\n }\\n }\\n\\n /**\\n * @dev Saves new round voting for the proposal `_proposalHash` of chain `_chainId`.\\n */\\n function _saveVotingRound(ProposalVote storage _vote, bytes32 _proposalHash, uint256 _expiryTimestamp) internal {\\n _vote.hash = _proposalHash;\\n _vote.expiryTimestamp = _expiryTimestamp;\\n }\\n\\n /**\\n * @dev Proposes proposal struct.\\n *\\n * Requirements:\\n * - The chain id is not equal to 0.\\n * - The proposal nonce is equal to the new round.\\n *\\n * Emits the `ProposalCreated` event.\\n *\\n */\\n function _proposeProposalStruct(Proposal.ProposalDetail memory proposal, address creator) internal virtual returns (uint256 round_) {\\n uint256 chainId = proposal.chainId;\\n if (chainId == 0) revert ErrInvalidChainId(msg.sig, 0, block.chainid);\\n proposal.validate(_proposalExpiryDuration);\\n\\n bytes32 proposalHash = proposal.hash();\\n round_ = _createVotingRound(chainId);\\n _saveVotingRound(vote[chainId][round_], proposalHash, proposal.expiryTimestamp);\\n if (round_ != proposal.nonce) revert ErrInvalidProposalNonce(msg.sig);\\n emit ProposalCreated(chainId, round_, proposalHash, proposal, creator);\\n }\\n\\n /**\\n * @dev Casts vote for the proposal with data and returns whether the voting is done.\\n *\\n * Requirements:\\n * - The proposal nonce is equal to the round.\\n * - The vote is not finalized.\\n * - The voter has not voted for the round.\\n *\\n * Emits the `ProposalVoted` event. Emits the `ProposalApproved`, `ProposalExecuted` or `ProposalRejected` once the\\n * proposal is approved, executed or rejected.\\n *\\n */\\n function _castVote(\\n Proposal.ProposalDetail memory proposal,\\n Ballot.VoteType support,\\n uint256 minimumForVoteWeight,\\n uint256 minimumAgainstVoteWeight,\\n address voter,\\n Signature memory signature,\\n uint256 voterWeight\\n ) internal virtual returns (bool done) {\\n uint256 chainId = proposal.chainId;\\n uint256 round_ = proposal.nonce;\\n ProposalVote storage _vote = vote[chainId][round_];\\n\\n if (_tryDeleteExpiredVotingRound(_vote)) {\\n return true;\\n }\\n\\n if (round[proposal.chainId] != round_) revert ErrInvalidProposalNonce(msg.sig);\\n if (_vote.status != VoteStatus.Pending) revert ErrVoteIsFinalized();\\n if (_voted(_vote, voter)) revert ErrAlreadyVoted(voter);\\n\\n _vote.voted[voter] = true;\\n // Stores the signature if it is not empty\\n if (signature.r > 0 || signature.s > 0 || signature.v > 0) {\\n _vote.sig[voter] = signature;\\n }\\n emit ProposalVoted(_vote.hash, voter, support, voterWeight);\\n\\n uint256 _forVoteWeight;\\n uint256 _againstVoteWeight;\\n if (support == Ballot.VoteType.For) {\\n _vote.forVoteds.push(voter);\\n _forVoteWeight = _vote.forVoteWeight += voterWeight;\\n } else if (support == Ballot.VoteType.Against) {\\n _vote.againstVoteds.push(voter);\\n _againstVoteWeight = _vote.againstVoteWeight += voterWeight;\\n } else {\\n revert ErrUnsupportedVoteType(msg.sig);\\n }\\n\\n if (_forVoteWeight >= minimumForVoteWeight) {\\n done = true;\\n _vote.status = VoteStatus.Approved;\\n emit ProposalApproved(_vote.hash);\\n if (proposal.isAutoExecute()) {\\n _tryExecute(_vote, proposal);\\n }\\n } else if (_againstVoteWeight >= minimumAgainstVoteWeight) {\\n done = true;\\n _vote.status = VoteStatus.Rejected;\\n emit ProposalRejected(_vote.hash);\\n }\\n }\\n\\n /**\\n * @dev The specified executor executes the proposal on an approved proposal.\\n */\\n function _executeWithCaller(Proposal.ProposalDetail memory proposal, address caller) internal {\\n bytes32 proposalHash = proposal.hash();\\n ProposalVote storage _vote = vote[proposal.chainId][proposal.nonce];\\n\\n if (_vote.hash != proposalHash) {\\n revert ErrInvalidProposal(proposalHash, _vote.hash);\\n }\\n\\n if (_vote.status != VoteStatus.Approved) revert ErrProposalNotApproved();\\n if (caller != proposal.executor) revert ErrInvalidExecutor();\\n\\n _tryExecute(_vote, proposal);\\n }\\n\\n /**\\n * @dev When the contract is on Ronin chain, checks whether the proposal is expired and delete it if is expired.\\n *\\n * Emits the event `ProposalExpired` if the vote is expired.\\n *\\n * Note: This function assumes the vote `_proposalVote` is already created, consider verifying the vote's existence\\n * before or it will emit an unexpected event of `ProposalExpired`.\\n */\\n function _tryDeleteExpiredVotingRound(ProposalVote storage proposalVote) internal returns (bool isExpired) {\\n isExpired = _getChainType() == ChainType.RoninChain && proposalVote.status == VoteStatus.Pending && proposalVote.expiryTimestamp <= block.timestamp;\\n\\n if (isExpired) {\\n emit ProposalExpired(proposalVote.hash);\\n\\n for (uint256 _i; _i < proposalVote.forVoteds.length;) {\\n delete proposalVote.voted[proposalVote.forVoteds[_i]];\\n delete proposalVote.sig[proposalVote.forVoteds[_i]];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n for (uint256 _i; _i < proposalVote.againstVoteds.length;) {\\n delete proposalVote.voted[proposalVote.againstVoteds[_i]];\\n delete proposalVote.sig[proposalVote.againstVoteds[_i]];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n delete proposalVote.status;\\n delete proposalVote.hash;\\n delete proposalVote.againstVoteWeight;\\n delete proposalVote.forVoteWeight;\\n delete proposalVote.forVoteds;\\n delete proposalVote.againstVoteds;\\n delete proposalVote.expiryTimestamp;\\n }\\n }\\n\\n /**\\n * @dev Executes the proposal and update the vote status once the proposal is executable.\\n */\\n function _tryExecute(ProposalVote storage vote_, Proposal.ProposalDetail memory proposal) internal {\\n if (proposal.executable()) {\\n vote_.status = VoteStatus.Executed;\\n (bool[] memory _successCalls, bytes[] memory _returnDatas) = proposal.execute();\\n emit ProposalExecuted(vote_.hash, _successCalls, _returnDatas);\\n }\\n }\\n\\n /**\\n * @dev Sets the expiry duration for a new proposal.\\n */\\n function _setProposalExpiryDuration(uint256 expiryDuration) internal {\\n _proposalExpiryDuration = expiryDuration;\\n emit ProposalExpiryDurationChanged(expiryDuration);\\n }\\n\\n /**\\n * @dev Returns whether the voter casted for the proposal.\\n */\\n function _voted(ProposalVote storage vote_, address voter) internal view returns (bool) {\\n return vote_.voted[voter];\\n }\\n\\n /**\\n * @dev Returns total weight from validators.\\n */\\n function _getTotalWeight() internal view virtual returns (uint256);\\n\\n /**\\n * @dev Returns minimum vote to pass a proposal.\\n */\\n function _getMinimumVoteWeight() internal view virtual returns (uint256);\\n\\n /**\\n * @dev Returns current context is running on whether Ronin chain or on mainchain.\\n */\\n function _getChainType() internal view virtual returns (ChainType);\\n}\\n\",\"keccak256\":\"0xa8dfef02fbfbda8ec1cc681a59719d1d570fb8b652f6775b7d9af9c3e32fed26\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/GlobalCoreGovernance.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../libraries/Proposal.sol\\\";\\nimport \\\"../../libraries/GlobalProposal.sol\\\";\\nimport \\\"./CoreGovernance.sol\\\";\\n\\nabstract contract GlobalCoreGovernance is CoreGovernance {\\n using Proposal for Proposal.ProposalDetail;\\n using GlobalProposal for GlobalProposal.GlobalProposalDetail;\\n\\n mapping(GlobalProposal.TargetOption => address) internal _targetOptionsMap;\\n\\n /// @dev Emitted when a proposal is created\\n event GlobalProposalCreated(\\n uint256 indexed round,\\n bytes32 indexed proposalHash,\\n Proposal.ProposalDetail proposal,\\n bytes32 globalProposalHash,\\n GlobalProposal.GlobalProposalDetail globalProposal,\\n address creator\\n );\\n\\n /// @dev Emitted when the target options are updated\\n event TargetOptionUpdated(GlobalProposal.TargetOption indexed targetOption, address indexed addr);\\n\\n function __GlobalCoreGovernance_init(GlobalProposal.TargetOption[] memory targetOptions, address[] memory addrs) internal onlyInitializing {\\n __GlobalCoreGovernance_init_unchained(targetOptions, addrs);\\n }\\n\\n function __GlobalCoreGovernance_init_unchained(GlobalProposal.TargetOption[] memory targetOptions, address[] memory addrs) internal onlyInitializing {\\n _updateTargetOption(GlobalProposal.TargetOption.BridgeManager, address(this));\\n _updateManyTargetOption(targetOptions, addrs);\\n }\\n\\n /**\\n * @dev Proposes for a global proposal.\\n *\\n * Emits the `GlobalProposalCreated` event.\\n *\\n */\\n function _proposeGlobal(\\n uint256 expiryTimestamp,\\n GlobalProposal.TargetOption[] calldata targetOptions,\\n address executor,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n uint256[] memory gasAmounts,\\n address creator\\n ) internal virtual {\\n uint256 round_ = _createVotingRound(0);\\n GlobalProposal.GlobalProposalDetail memory globalProposal =\\n GlobalProposal.GlobalProposalDetail(round_, expiryTimestamp, executor, targetOptions, values, calldatas, gasAmounts);\\n Proposal.ProposalDetail memory proposal = globalProposal.intoProposalDetail(_resolveTargets({ targetOptions: targetOptions, strict: true }));\\n proposal.validate(_proposalExpiryDuration);\\n\\n bytes32 proposalHash = proposal.hash();\\n _saveVotingRound(vote[0][round_], proposalHash, expiryTimestamp);\\n emit GlobalProposalCreated(round_, proposalHash, proposal, globalProposal.hash(), globalProposal, creator);\\n }\\n\\n /**\\n * @dev Proposes global proposal struct.\\n *\\n * Requirements:\\n * - The proposal nonce is equal to the new round.\\n *\\n * Emits the `GlobalProposalCreated` event.\\n *\\n */\\n function _proposeGlobalStruct(\\n GlobalProposal.GlobalProposalDetail memory globalProposal,\\n address creator\\n ) internal virtual returns (Proposal.ProposalDetail memory proposal) {\\n proposal = globalProposal.intoProposalDetail(_resolveTargets({ targetOptions: globalProposal.targetOptions, strict: true }));\\n proposal.validate(_proposalExpiryDuration);\\n\\n bytes32 proposalHash = proposal.hash();\\n uint256 round_ = _createVotingRound(0);\\n _saveVotingRound(vote[0][round_], proposalHash, globalProposal.expiryTimestamp);\\n\\n if (round_ != proposal.nonce) revert ErrInvalidProposalNonce(msg.sig);\\n emit GlobalProposalCreated(round_, proposalHash, proposal, globalProposal.hash(), globalProposal, creator);\\n }\\n\\n /**\\n * @dev Returns corresponding address of target options. Return address(0) on non-existent target.\\n */\\n function resolveTargets(GlobalProposal.TargetOption[] calldata targetOptions) external view returns (address[] memory targets) {\\n return _resolveTargets({ targetOptions: targetOptions, strict: false });\\n }\\n\\n /**\\n * @dev Internal helper of {resolveTargets}.\\n *\\n * @param strict When the param is set to `true`, revert on non-existent target.\\n */\\n function _resolveTargets(GlobalProposal.TargetOption[] memory targetOptions, bool strict) internal view returns (address[] memory targets) {\\n targets = new address[](targetOptions.length);\\n\\n for (uint256 i; i < targetOptions.length; ++i) {\\n targets[i] = _targetOptionsMap[targetOptions[i]];\\n if (strict && targets[i] == address(0)) revert ErrInvalidArguments(msg.sig);\\n }\\n }\\n\\n /**\\n * @dev Updates list of `targetOptions` to `targets`.\\n *\\n * Requirement:\\n * - Only allow self-call through proposal.\\n *\\n */\\n function updateManyTargetOption(GlobalProposal.TargetOption[] memory targetOptions, address[] memory targets) external {\\n // HACK: Cannot reuse the existing library due to too deep stack\\n if (msg.sender != address(this)) revert ErrOnlySelfCall(msg.sig);\\n _updateManyTargetOption(targetOptions, targets);\\n }\\n\\n /**\\n * @dev Updates list of `targetOptions` to `targets`.\\n */\\n function _updateManyTargetOption(GlobalProposal.TargetOption[] memory targetOptions, address[] memory targets) internal {\\n for (uint256 i; i < targetOptions.length; ++i) {\\n if (targets[i] == address(this)) revert ErrInvalidArguments(msg.sig);\\n _updateTargetOption(targetOptions[i], targets[i]);\\n }\\n }\\n\\n /**\\n * @dev Updates `targetOption` to `target`.\\n *\\n * Requirement:\\n * - Emit a `TargetOptionUpdated` event.\\n */\\n function _updateTargetOption(GlobalProposal.TargetOption targetOption, address target) internal {\\n _targetOptionsMap[targetOption] = target;\\n emit TargetOptionUpdated(targetOption, target);\\n }\\n}\\n\",\"keccak256\":\"0xe5db4e1b31d9ff83e8962d17a815d39e72f5945023e6309172d875b47d5a1c3d\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/governance-relay/CommonGovernanceRelay.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../CoreGovernance.sol\\\";\\n\\nabstract contract CommonGovernanceRelay is CoreGovernance {\\n using Proposal for Proposal.ProposalDetail;\\n using GlobalProposal for GlobalProposal.GlobalProposalDetail;\\n\\n /**\\n * @dev Relays votes by signatures.\\n *\\n * @notice Does not store the voter signature into storage.\\n *\\n */\\n function _relayVotesBySignatures(\\n Proposal.ProposalDetail memory _proposal,\\n Ballot.VoteType[] calldata _supports,\\n Signature[] calldata _signatures,\\n bytes32 proposalHash\\n ) internal {\\n if (!(_supports.length > 0 && _supports.length == _signatures.length)) revert ErrLengthMismatch(msg.sig);\\n\\n bytes32 _forDigest = ECDSA.toTypedDataHash(_proposalDomainSeparator(), Ballot.hash(proposalHash, Ballot.VoteType.For));\\n bytes32 _againstDigest = ECDSA.toTypedDataHash(_proposalDomainSeparator(), Ballot.hash(proposalHash, Ballot.VoteType.Against));\\n\\n address[] memory _forVoteSigners = new address[](_signatures.length);\\n address[] memory _againstVoteSigners = new address[](_signatures.length);\\n\\n {\\n uint256 _forVoteCount;\\n uint256 _againstVoteCount;\\n\\n {\\n address _signer;\\n address _lastSigner;\\n Ballot.VoteType _support;\\n Signature calldata _sig;\\n\\n for (uint256 _i; _i < _signatures.length;) {\\n _sig = _signatures[_i];\\n _support = _supports[_i];\\n\\n if (_support == Ballot.VoteType.For) {\\n _signer = ECDSA.recover(_forDigest, _sig.v, _sig.r, _sig.s);\\n _forVoteSigners[_forVoteCount++] = _signer;\\n } else if (_support == Ballot.VoteType.Against) {\\n _signer = ECDSA.recover(_againstDigest, _sig.v, _sig.r, _sig.s);\\n _againstVoteSigners[_againstVoteCount++] = _signer;\\n } else {\\n revert ErrUnsupportedVoteType(msg.sig);\\n }\\n\\n if (_lastSigner >= _signer) revert ErrInvalidOrder(msg.sig);\\n _lastSigner = _signer;\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n }\\n\\n assembly {\\n mstore(_forVoteSigners, _forVoteCount)\\n mstore(_againstVoteSigners, _againstVoteCount)\\n }\\n }\\n\\n ProposalVote storage _vote = vote[_proposal.chainId][_proposal.nonce];\\n uint256 _minimumForVoteWeight = _getMinimumVoteWeight();\\n uint256 _totalForVoteWeight = _sumWeight(_forVoteSigners);\\n if (_totalForVoteWeight >= _minimumForVoteWeight) {\\n if (_totalForVoteWeight == 0) revert ErrInvalidVoteWeight(msg.sig);\\n _vote.status = VoteStatus.Approved;\\n emit ProposalApproved(_vote.hash);\\n _tryExecute(_vote, _proposal);\\n return;\\n }\\n\\n uint256 _minimumAgainstVoteWeight = _getTotalWeight() - _minimumForVoteWeight + 1;\\n uint256 _totalAgainstVoteWeight = _sumWeight(_againstVoteSigners);\\n if (_totalAgainstVoteWeight >= _minimumAgainstVoteWeight) {\\n if (_totalAgainstVoteWeight == 0) revert ErrInvalidVoteWeight(msg.sig);\\n _vote.status = VoteStatus.Rejected;\\n emit ProposalRejected(_vote.hash);\\n return;\\n }\\n\\n revert ErrRelayFailed(msg.sig);\\n }\\n\\n /**\\n * @dev Returns the weight of the governor list.\\n */\\n function _sumWeight(address[] memory _governors) internal view virtual returns (uint256);\\n\\n function _proposalDomainSeparator() internal view virtual returns (bytes32);\\n}\\n\",\"keccak256\":\"0x48b03ea86a3e312de4242115554d2188891719bcd3a20d8e4504b03319ba6993\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/governance-relay/GlobalGovernanceRelay.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../GlobalCoreGovernance.sol\\\";\\nimport \\\"./CommonGovernanceRelay.sol\\\";\\n\\nabstract contract GlobalGovernanceRelay is CommonGovernanceRelay, GlobalCoreGovernance {\\n using GlobalProposal for GlobalProposal.GlobalProposalDetail;\\n\\n /**\\n * @dev Returns whether the voter `_voter` casted vote for the proposal.\\n */\\n function globalProposalRelayed(uint256 _round) external view returns (bool) {\\n return vote[0][_round].status != VoteStatus.Pending;\\n }\\n\\n /**\\n * @dev Relays voted global proposal.\\n *\\n * Requirements:\\n * - The relay proposal is finalized.\\n *\\n */\\n function _relayGlobalProposal(\\n GlobalProposal.GlobalProposalDetail calldata globalProposal,\\n Ballot.VoteType[] calldata supports_,\\n Signature[] calldata signatures,\\n address creator\\n ) internal {\\n Proposal.ProposalDetail memory _proposal = _proposeGlobalStruct(globalProposal, creator);\\n _relayVotesBySignatures(_proposal, supports_, signatures, globalProposal.hash());\\n }\\n}\\n\",\"keccak256\":\"0x1d168ae3300e07f3b6312c61ea3d6021a12722c7122d9f2f3f782909d47e05d4\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/governance-relay/GovernanceRelay.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../CoreGovernance.sol\\\";\\nimport \\\"./CommonGovernanceRelay.sol\\\";\\n\\nabstract contract GovernanceRelay is CoreGovernance, CommonGovernanceRelay {\\n using Proposal for Proposal.ProposalDetail;\\n using GlobalProposal for GlobalProposal.GlobalProposalDetail;\\n\\n /**\\n * @dev Relays voted proposal.\\n *\\n * Requirements:\\n * - The relay proposal is finalized.\\n *\\n */\\n function _relayProposal(\\n Proposal.ProposalDetail calldata _proposal,\\n Ballot.VoteType[] calldata _supports,\\n Signature[] calldata _signatures,\\n address _creator\\n ) internal {\\n _proposeProposalStruct(_proposal, _creator);\\n _relayVotesBySignatures(_proposal, _supports, _signatures, _proposal.hash());\\n }\\n}\\n\",\"keccak256\":\"0x050da96d4079cfb515a09ee8a61d5b6c782adf4559b2c66b618bd51f41ca1cd4\",\"license\":\"MIT\"},\"src/interfaces/IQuorum.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IQuorum {\\n /// @dev Emitted when the threshold is updated\\n event ThresholdUpdated(uint256 indexed nonce, uint256 indexed numerator, uint256 indexed denominator, uint256 previousNumerator, uint256 previousDenominator);\\n\\n /**\\n * @dev Returns the threshold.\\n */\\n function getThreshold() external view returns (uint256 _num, uint256 _denom);\\n\\n /**\\n * @dev Checks whether the `_voteWeight` passes the threshold.\\n */\\n function checkThreshold(uint256 _voteWeight) external view returns (bool);\\n\\n /**\\n * @dev Returns the minimum vote weight to pass the threshold.\\n */\\n function minimumVoteWeight() external view returns (uint256);\\n\\n /**\\n * @dev Sets the threshold.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `ThresholdUpdated` event.\\n *\\n */\\n function setThreshold(uint256 numerator, uint256 denominator) external;\\n}\\n\",\"keccak256\":\"0xc924e9480f59acc9bc8c033f05d3be9451de5cee0c224d76d4542fa5b67fa10f\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IBridgeManagerEvents } from \\\"./events/IBridgeManagerEvents.sol\\\";\\n\\n/**\\n * @title IBridgeManager\\n * @dev The interface for managing bridge operators.\\n */\\ninterface IBridgeManager is IBridgeManagerEvents {\\n /// @notice Error indicating that cannot find the querying operator\\n error ErrOperatorNotFound(address operator);\\n /// @notice Error indicating that cannot find the querying governor\\n error ErrGovernorNotFound(address governor);\\n /// @notice Error indicating that the msg.sender is not match the required governor\\n error ErrGovernorNotMatch(address required, address sender);\\n /// @notice Error indicating that the governors list will go below minimum number of required governor.\\n error ErrBelowMinRequiredGovernors();\\n /// @notice Common invalid input error\\n error ErrInvalidInput();\\n\\n /**\\n * @dev The domain separator used for computing hash digests in the contract.\\n */\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n\\n /**\\n * @dev Returns the total number of bridge operators.\\n * @return The total number of bridge operators.\\n */\\n function totalBridgeOperator() external view returns (uint256);\\n\\n /**\\n * @dev Checks if the given address is a bridge operator.\\n * @param addr The address to check.\\n * @return A boolean indicating whether the address is a bridge operator.\\n */\\n function isBridgeOperator(address addr) external view returns (bool);\\n\\n /**\\n * @dev Retrieves the full information of all registered bridge operators.\\n *\\n * This external function allows external callers to obtain the full information of all the registered bridge operators.\\n * The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.\\n *\\n * @return governors An array of addresses representing the governors of each bridge operator.\\n * @return bridgeOperators An array of addresses representing the registered bridge operators.\\n * @return weights An array of uint256 values representing the vote weights of each bridge operator.\\n *\\n * Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator.\\n *\\n * Example Usage:\\n * ```\\n * (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos();\\n * for (uint256 i = 0; i < bridgeOperators.length; i++) {\\n * // Access individual information for each bridge operator.\\n * address governor = governors[i];\\n * address bridgeOperator = bridgeOperators[i];\\n * uint256 weight = weights[i];\\n * // ... (Process or use the information as required) ...\\n * }\\n * ```\\n *\\n */\\n function getFullBridgeOperatorInfos() external view returns (address[] memory governors, address[] memory bridgeOperators, uint96[] memory weights);\\n\\n /**\\n * @dev Returns total weights of the governor list.\\n */\\n function sumGovernorsWeight(address[] calldata governors) external view returns (uint256 sum);\\n\\n /**\\n * @dev Returns total weights.\\n */\\n function getTotalWeight() external view returns (uint256);\\n\\n /**\\n * @dev Returns an array of all bridge operators.\\n * @return An array containing the addresses of all bridge operators.\\n */\\n function getBridgeOperators() external view returns (address[] memory);\\n\\n /**\\n * @dev Returns the corresponding `operator` of a `governor`.\\n */\\n function getOperatorOf(address governor) external view returns (address operator);\\n\\n /**\\n * @dev Returns the corresponding `governor` of a `operator`.\\n */\\n function getGovernorOf(address operator) external view returns (address governor);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific governor.\\n * @param governor The address of the governor to get the vote weight for.\\n * @return voteWeight The vote weight of the specified governor.\\n */\\n function getGovernorWeight(address governor) external view returns (uint96);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific bridge operator.\\n * @param bridgeOperator The address of the bridge operator to get the vote weight for.\\n * @return weight The vote weight of the specified bridge operator.\\n */\\n function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint96 weight);\\n\\n /**\\n * @dev Returns the weights of a list of governor addresses.\\n */\\n function getGovernorWeights(address[] calldata governors) external view returns (uint96[] memory weights);\\n\\n /**\\n * @dev Returns an array of all governors.\\n * @return An array containing the addresses of all governors.\\n */\\n function getGovernors() external view returns (address[] memory);\\n\\n /**\\n * @dev Adds multiple bridge operators.\\n * @param governors An array of addresses of hot/cold wallets for bridge operator to update their node address.\\n * @param bridgeOperators An array of addresses representing the bridge operators to add.\\n */\\n function addBridgeOperators(uint96[] calldata voteWeights, address[] calldata governors, address[] calldata bridgeOperators) external;\\n\\n /**\\n * @dev Removes multiple bridge operators.\\n * @param bridgeOperators An array of addresses representing the bridge operators to remove.\\n */\\n function removeBridgeOperators(address[] calldata bridgeOperators) external;\\n\\n /**\\n * @dev Self-call to update the minimum required governor.\\n * @param min The minimum number, this must not less than 3.\\n */\\n function setMinRequiredGovernor(uint min) external;\\n}\\n\",\"keccak256\":\"0xefc46318a240371031e77ef3c355e2c18432e4479145378de6782277f9b44923\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManagerCallback.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @title IBridgeManagerCallback\\n * @dev Interface for the callback functions to be implemented by the Bridge Manager contract.\\n */\\ninterface IBridgeManagerCallback is IERC165 {\\n /**\\n * @dev Handles the event when bridge operators are added.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @param addeds The corresponding boolean values indicating whether the operators were added or not.\\n * @return selector The selector of the function being called.\\n */\\n function onBridgeOperatorsAdded(address[] memory bridgeOperators, uint96[] calldata weights, bool[] memory addeds) external returns (bytes4 selector);\\n\\n /**\\n * @dev Handles the event when bridge operators are removed.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @param removeds The corresponding boolean values indicating whether the operators were removed or not.\\n * @return selector The selector of the function being called.\\n */\\n function onBridgeOperatorsRemoved(address[] memory bridgeOperators, bool[] memory removeds) external returns (bytes4 selector);\\n}\\n\",\"keccak256\":\"0x6c8ce7e2478e28c5ed5e6f5d8305a77d6d5f9125a47adfb77632940b9a0f3625\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManagerCallbackRegister.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeManagerCallbackRegister {\\n error ErrExistOneInternalCallFailed(address sender, bytes4 msgSig, bytes callData);\\n\\n event CallbackRegistered(address, bool);\\n /**\\n * @dev Emitted when the contract notifies multiple registers with statuses and return data.\\n */\\n event Notified(bytes callData, address[] registers, bool[] statuses, bytes[] returnDatas);\\n\\n /**\\n * @dev Retrieves the addresses of registered callbacks.\\n * @return registers An array containing the addresses of registered callbacks.\\n */\\n function getCallbackRegisters() external view returns (address[] memory registers);\\n\\n /**\\n * @dev Registers multiple callbacks with the bridge.\\n * @param registers The array of callback addresses to register.\\n */\\n function registerCallbacks(address[] calldata registers) external;\\n\\n /**\\n * @dev Unregisters multiple callbacks from the bridge.\\n * @param registers The array of callback addresses to unregister.\\n */\\n function unregisterCallbacks(address[] calldata registers) external;\\n}\\n\",\"keccak256\":\"0x493f7a40fc058eb6654a636316be99c2ddd9ee26ee215ff86c7107a7fa20ff97\",\"license\":\"MIT\"},\"src/interfaces/bridge/events/IBridgeManagerEvents.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeManagerEvents {\\n /**\\n * @dev Emitted when new bridge operators are added.\\n */\\n event BridgeOperatorsAdded(bool[] statuses, uint96[] voteWeights, address[] governors, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is failed to add.\\n */\\n event BridgeOperatorAddingFailed(address indexed operator);\\n\\n /**\\n * @dev Emitted when bridge operators are removed.\\n */\\n event BridgeOperatorsRemoved(bool[] statuses, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is failed to remove.\\n */\\n event BridgeOperatorRemovingFailed(address indexed operator);\\n\\n /**\\n * @dev Emitted when a bridge operator is updated.\\n */\\n event BridgeOperatorUpdated(address indexed governor, address indexed fromBridgeOperator, address indexed toBridgeOperator);\\n\\n /**\\n * @dev Emitted when the minimum number of required governors is updated.\\n */\\n event MinRequiredGovernorUpdated(uint min);\\n}\\n\",\"keccak256\":\"0x38bc3709c98a7c08fb9b6fa3e07a725903dcb0bd07de8a828bac6c3bcf7d997d\",\"license\":\"MIT\"},\"src/interfaces/collections/IHasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport { ContractType } from \\\"../../utils/ContractType.sol\\\";\\n\\ninterface IHasContracts {\\n /// @dev Error of invalid role.\\n error ErrContractTypeNotFound(ContractType contractType);\\n\\n /// @dev Emitted when a contract is updated.\\n event ContractUpdated(ContractType indexed contractType, address indexed addr);\\n\\n /**\\n * @dev Returns the address of a contract with a specific role.\\n * Throws an error if no contract is set for the specified role.\\n *\\n * @param contractType The role of the contract to retrieve.\\n * @return contract_ The address of the contract with the specified role.\\n */\\n function getContract(ContractType contractType) external view returns (address contract_);\\n\\n /**\\n * @dev Sets the address of a contract with a specific role.\\n * Emits the event {ContractUpdated}.\\n * @param contractType The role of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function setContract(ContractType contractType, address addr) external;\\n}\\n\",\"keccak256\":\"0x99d8213d857e30d367155abd15dc42730afdfbbac3a22dfb3b95ffea2083a92e\",\"license\":\"MIT\"},\"src/interfaces/consumers/ChainTypeConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface ChainTypeConsumer {\\n enum ChainType {\\n RoninChain,\\n Mainchain\\n }\\n}\\n\",\"keccak256\":\"0xe0d20e00c8d237f8e0fb881abf1ff1ef114173bcb428f06f689c581666a22db7\",\"license\":\"MIT\"},\"src/interfaces/consumers/SignatureConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface SignatureConsumer {\\n struct Signature {\\n uint8 v;\\n bytes32 r;\\n bytes32 s;\\n }\\n}\\n\",\"keccak256\":\"0xd370e350722067097dec1a5c31bda6e47e83417fa5c3288293bb910028cd136b\",\"license\":\"MIT\"},\"src/interfaces/consumers/VoteStatusConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface VoteStatusConsumer {\\n enum VoteStatus {\\n Pending,\\n Approved,\\n Executed,\\n Rejected,\\n Expired\\n }\\n}\\n\",\"keccak256\":\"0xa5045232c0c053fcf31fb3fe71942344444159c48d5f1b2063dbb06b6a1c9752\",\"license\":\"MIT\"},\"src/libraries/AddressArrayUtils.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\nlibrary AddressArrayUtils {\\n /**\\n * @dev Error thrown when a duplicated element is detected in an array.\\n * @param msgSig The function signature that invoke the error.\\n */\\n error ErrDuplicated(bytes4 msgSig);\\n\\n /**\\n * @dev Returns whether or not there's a duplicate. Runs in O(n^2).\\n * @param A Array to search\\n * @return Returns true if duplicate, false otherwise\\n */\\n function hasDuplicate(address[] memory A) internal pure returns (bool) {\\n if (A.length == 0) {\\n return false;\\n }\\n unchecked {\\n for (uint256 i = 0; i < A.length - 1; i++) {\\n for (uint256 j = i + 1; j < A.length; j++) {\\n if (A[i] == A[j]) {\\n return true;\\n }\\n }\\n }\\n }\\n return false;\\n }\\n\\n /**\\n * @dev Returns whether two arrays of addresses are equal or not.\\n */\\n function isEqual(address[] memory _this, address[] memory _other) internal pure returns (bool yes_) {\\n // Hashing two arrays and compare their hash\\n assembly {\\n let _thisHash := keccak256(add(_this, 32), mul(mload(_this), 32))\\n let _otherHash := keccak256(add(_other, 32), mul(mload(_other), 32))\\n yes_ := eq(_thisHash, _otherHash)\\n }\\n }\\n\\n /**\\n * @dev Return the concatenated array from a and b.\\n */\\n function extend(address[] memory a, address[] memory b) internal pure returns (address[] memory c) {\\n uint256 lengthA = a.length;\\n uint256 lengthB = b.length;\\n unchecked {\\n c = new address[](lengthA + lengthB);\\n }\\n uint256 i;\\n for (; i < lengthA;) {\\n c[i] = a[i];\\n unchecked {\\n ++i;\\n }\\n }\\n for (uint256 j; j < lengthB;) {\\n c[i] = b[j];\\n unchecked {\\n ++i;\\n ++j;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce5d578861167da47a965c8a0e1592b808aad6eb79ccb1873bf2e2280ddb85ee\",\"license\":\"UNLICENSED\"},\"src/libraries/Ballot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\n\\nlibrary Ballot {\\n using ECDSA for bytes32;\\n\\n enum VoteType {\\n For,\\n Against\\n }\\n\\n // keccak256(\\\"Ballot(bytes32 proposalHash,uint8 support)\\\");\\n bytes32 private constant BALLOT_TYPEHASH = 0xd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2;\\n\\n function hash(bytes32 _proposalHash, VoteType _support) internal pure returns (bytes32 digest) {\\n // return keccak256(abi.encode(BALLOT_TYPEHASH, _proposalHash, _support));\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, BALLOT_TYPEHASH)\\n mstore(add(ptr, 0x20), _proposalHash)\\n mstore(add(ptr, 0x40), _support)\\n digest := keccak256(ptr, 0x60)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xaa1e66bcd86baa6f18c7c5e9b67496535f229cbd2e2ecb4c66bcbfed2b1365de\",\"license\":\"MIT\"},\"src/libraries/GlobalProposal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./Proposal.sol\\\";\\n\\nlibrary GlobalProposal {\\n /**\\n * @dev Error thrown when attempting to interact with an unsupported target.\\n */\\n error ErrUnsupportedTarget(bytes32 proposalHash, uint256 targetNumber);\\n\\n enum TargetOption {\\n BridgeManager, // 0\\n GatewayContract, // 1\\n BridgeReward, // 2\\n BridgeSlash, // 3\\n BridgeTracking, // 4\\n PauseEnforcer // 5\\n\\n }\\n\\n struct GlobalProposalDetail {\\n // Nonce to make sure proposals are executed in order\\n uint256 nonce;\\n uint256 expiryTimestamp;\\n address executor;\\n TargetOption[] targetOptions;\\n uint256[] values;\\n bytes[] calldatas;\\n uint256[] gasAmounts;\\n }\\n\\n // keccak256(\\\"GlobalProposalDetail(uint256 nonce,uint256 expiryTimestamp,address executor,uint8[] targetOptions,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)\\\");\\n bytes32 internal constant TYPE_HASH = 0xde480f0c53a3651c08fbab1dffbc45fe574f31188827fe52cb9035da9fe57e4a;\\n\\n /**\\n * @dev Returns struct hash of the proposal.\\n */\\n function hash(GlobalProposalDetail memory self) internal pure returns (bytes32 digest_) {\\n uint256[] memory values = self.values;\\n TargetOption[] memory targets = self.targetOptions;\\n bytes32[] memory calldataHashList = new bytes32[](self.calldatas.length);\\n uint256[] memory gasAmounts = self.gasAmounts;\\n\\n for (uint256 i; i < calldataHashList.length;) {\\n calldataHashList[i] = keccak256(self.calldatas[i]);\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n /*\\n * return\\n * keccak256(\\n * abi.encode(\\n * TYPE_HASH,\\n * proposal.nonce,\\n * proposal.expiryTimestamp,\\n * proposal.executor,\\n * targetsHash,\\n * valuesHash,\\n * calldatasHash,\\n * gasAmountsHash\\n * )\\n * );\\n */\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, TYPE_HASH)\\n mstore(add(ptr, 0x20), mload(self)) // proposal.nonce\\n mstore(add(ptr, 0x40), mload(add(self, 0x20))) // proposal.expiryTimestamp\\n mstore(add(ptr, 0x60), mload(add(self, 0x40))) // proposal.executor\\n\\n let arrayHashed\\n arrayHashed := keccak256(add(targets, 32), mul(mload(targets), 32)) // targetsHash\\n mstore(add(ptr, 0x80), arrayHashed)\\n arrayHashed := keccak256(add(values, 32), mul(mload(values), 32)) // valuesHash\\n mstore(add(ptr, 0xa0), arrayHashed)\\n arrayHashed := keccak256(add(calldataHashList, 32), mul(mload(calldataHashList), 32)) // calldatasHash\\n mstore(add(ptr, 0xc0), arrayHashed)\\n arrayHashed := keccak256(add(gasAmounts, 32), mul(mload(gasAmounts), 32)) // gasAmountsHash\\n mstore(add(ptr, 0xe0), arrayHashed)\\n digest_ := keccak256(ptr, 0x100)\\n }\\n }\\n\\n /**\\n * @dev Converts into the normal proposal.\\n */\\n function intoProposalDetail(GlobalProposalDetail memory self, address[] memory targets) internal pure returns (Proposal.ProposalDetail memory detail_) {\\n detail_.nonce = self.nonce;\\n detail_.chainId = 0;\\n detail_.expiryTimestamp = self.expiryTimestamp;\\n detail_.executor = self.executor;\\n\\n detail_.targets = new address[](self.targetOptions.length);\\n detail_.values = self.values;\\n detail_.calldatas = self.calldatas;\\n detail_.gasAmounts = self.gasAmounts;\\n\\n for (uint256 i; i < self.targetOptions.length; ++i) {\\n detail_.targets[i] = targets[i];\\n }\\n }\\n}\\n\",\"keccak256\":\"0x76d362e1a4c8ef6d1aac45aae0f443a218cb256176ad5fbe952b2ff7c2132e6e\",\"license\":\"MIT\"},\"src/libraries/Proposal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ErrInvalidChainId, ErrLengthMismatch } from \\\"../utils/CommonErrors.sol\\\";\\n\\nlibrary Proposal {\\n /**\\n * @dev Error thrown when there is insufficient gas to execute a function.\\n */\\n error ErrInsufficientGas(bytes32 proposalHash);\\n\\n /**\\n * @dev Error thrown when an invalid expiry timestamp is provided.\\n */\\n error ErrInvalidExpiryTimestamp();\\n\\n /**\\n * @dev Error thrown when the proposal reverts when execute the internal call no. `callIndex` with revert message is `revertMsg`.\\n */\\n error ErrLooseProposalInternallyRevert(uint256 callIndex, bytes revertMsg);\\n\\n struct ProposalDetail {\\n // Nonce to make sure proposals are executed in order\\n uint256 nonce;\\n // Value 0: all chain should run this proposal\\n // Other values: only specific chain has to execute\\n uint256 chainId;\\n uint256 expiryTimestamp;\\n // The address that execute the proposal after the proposal passes.\\n // Leave this address as address(0) to auto-execute by the last valid vote.\\n address executor;\\n address[] targets;\\n uint256[] values;\\n bytes[] calldatas;\\n uint256[] gasAmounts;\\n }\\n\\n // keccak256(\\\"ProposalDetail(uint256 nonce,uint256 chainId,uint256 expiryTimestamp,address executor,address[] targets,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)\\\");\\n bytes32 internal constant TYPE_HASH = 0x1b59eeec7c321899dc1e7a5b3d876c9a445dffc6d2f96ba842d7489908fdee12;\\n\\n /**\\n * @dev Validates the proposal.\\n */\\n function validate(ProposalDetail memory proposal, uint256 maxExpiryDuration) internal view {\\n if (\\n !(\\n proposal.targets.length > 0 && proposal.targets.length == proposal.values.length && proposal.targets.length == proposal.calldatas.length\\n && proposal.targets.length == proposal.gasAmounts.length\\n )\\n ) {\\n revert ErrLengthMismatch(msg.sig);\\n }\\n\\n if (proposal.expiryTimestamp > block.timestamp + maxExpiryDuration) {\\n revert ErrInvalidExpiryTimestamp();\\n }\\n }\\n\\n /**\\n * @dev Returns struct hash of the proposal.\\n */\\n function hash(ProposalDetail memory proposal) internal pure returns (bytes32 digest_) {\\n uint256[] memory values = proposal.values;\\n address[] memory targets = proposal.targets;\\n bytes32[] memory calldataHashList = new bytes32[](proposal.calldatas.length);\\n uint256[] memory gasAmounts = proposal.gasAmounts;\\n\\n for (uint256 i; i < calldataHashList.length; ++i) {\\n calldataHashList[i] = keccak256(proposal.calldatas[i]);\\n }\\n\\n // return\\n // keccak256(\\n // abi.encode(\\n // TYPE_HASH,\\n // proposal.nonce,\\n // proposal.chainId,\\n // proposal.expiryTimestamp\\n // proposal.executor\\n // targetsHash,\\n // valuesHash,\\n // calldatasHash,\\n // gasAmountsHash\\n // )\\n // );\\n // /\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, TYPE_HASH)\\n mstore(add(ptr, 0x20), mload(proposal)) // proposal.nonce\\n mstore(add(ptr, 0x40), mload(add(proposal, 0x20))) // proposal.chainId\\n mstore(add(ptr, 0x60), mload(add(proposal, 0x40))) // proposal.expiryTimestamp\\n mstore(add(ptr, 0x80), mload(add(proposal, 0x60))) // proposal.executor\\n\\n let arrayHashed\\n arrayHashed := keccak256(add(targets, 32), mul(mload(targets), 32)) // targetsHash\\n mstore(add(ptr, 0xa0), arrayHashed)\\n arrayHashed := keccak256(add(values, 32), mul(mload(values), 32)) // valuesHash\\n mstore(add(ptr, 0xc0), arrayHashed)\\n arrayHashed := keccak256(add(calldataHashList, 32), mul(mload(calldataHashList), 32)) // calldatasHash\\n mstore(add(ptr, 0xe0), arrayHashed)\\n arrayHashed := keccak256(add(gasAmounts, 32), mul(mload(gasAmounts), 32)) // gasAmountsHash\\n mstore(add(ptr, 0x100), arrayHashed)\\n digest_ := keccak256(ptr, 0x120)\\n }\\n }\\n\\n /**\\n * @dev Returns whether the proposal is auto-executed on the last valid vote.\\n */\\n function isAutoExecute(ProposalDetail memory proposal) internal pure returns (bool) {\\n return proposal.executor == address(0);\\n }\\n\\n /**\\n * @dev Returns whether the proposal is executable for the current chain.\\n *\\n * @notice Does not check whether the call result is successful or not. Please use `execute` instead.\\n *\\n */\\n function executable(ProposalDetail memory proposal) internal view returns (bool result) {\\n return proposal.chainId == 0 || proposal.chainId == block.chainid;\\n }\\n\\n /**\\n * @dev Executes the proposal.\\n */\\n function execute(ProposalDetail memory proposal) internal returns (bool[] memory successCalls, bytes[] memory returnDatas) {\\n if (!executable(proposal)) revert ErrInvalidChainId(msg.sig, proposal.chainId, block.chainid);\\n\\n successCalls = new bool[](proposal.targets.length);\\n returnDatas = new bytes[](proposal.targets.length);\\n for (uint256 i = 0; i < proposal.targets.length; ++i) {\\n if (gasleft() <= proposal.gasAmounts[i]) revert ErrInsufficientGas(hash(proposal));\\n\\n (successCalls[i], returnDatas[i]) = proposal.targets[i].call{ value: proposal.values[i], gas: proposal.gasAmounts[i] }(proposal.calldatas[i]);\\n\\n if (!successCalls[i]) {\\n revert ErrLooseProposalInternallyRevert(i, returnDatas[i]);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0ef21852c8a90ebf3ec4d4cc11acd9b6aa1fd932fb6858b2f6cdd3722fab6cb1\",\"license\":\"MIT\"},\"src/mainchain/MainchainBridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { CoreGovernance } from \\\"../extensions/sequential-governance/CoreGovernance.sol\\\";\\nimport { GlobalCoreGovernance, GlobalGovernanceRelay } from \\\"../extensions/sequential-governance/governance-relay/GlobalGovernanceRelay.sol\\\";\\nimport { GovernanceRelay } from \\\"../extensions/sequential-governance/governance-relay/GovernanceRelay.sol\\\";\\nimport { ContractType, BridgeManager } from \\\"../extensions/bridge-operator-governance/BridgeManager.sol\\\";\\nimport { Ballot } from \\\"../libraries/Ballot.sol\\\";\\nimport { Proposal } from \\\"../libraries/Proposal.sol\\\";\\nimport { GlobalProposal } from \\\"../libraries/GlobalProposal.sol\\\";\\nimport \\\"../utils/CommonErrors.sol\\\";\\n\\ncontract MainchainBridgeManager is BridgeManager, GovernanceRelay, GlobalGovernanceRelay {\\n uint256 private constant DEFAULT_EXPIRY_DURATION = 1 << 255;\\n\\n function initialize(\\n uint256 num,\\n uint256 denom,\\n uint256 roninChainId,\\n address bridgeContract,\\n address[] memory callbackRegisters,\\n address[] memory bridgeOperators,\\n address[] memory governors,\\n uint96[] memory voteWeights,\\n GlobalProposal.TargetOption[] memory targetOptions,\\n address[] memory targets\\n ) external initializer {\\n __CoreGovernance_init(DEFAULT_EXPIRY_DURATION);\\n __GlobalCoreGovernance_init(targetOptions, targets);\\n __BridgeManager_init(num, denom, roninChainId, bridgeContract, callbackRegisters, bridgeOperators, governors, voteWeights);\\n }\\n\\n /**\\n * @dev See `GovernanceRelay-_relayProposal`.\\n *\\n * Requirements:\\n * - The method caller is governor.\\n */\\n function relayProposal(\\n Proposal.ProposalDetail calldata proposal,\\n Ballot.VoteType[] calldata supports_,\\n Signature[] calldata signatures\\n ) external onlyGovernor {\\n _requireExecutor(proposal.executor, msg.sender);\\n _relayProposal(proposal, supports_, signatures, msg.sender);\\n }\\n\\n /**\\n * @dev See `GovernanceRelay-_relayGlobalProposal`.\\n *\\n * Requirements:\\n * - The method caller is governor.\\n */\\n function relayGlobalProposal(\\n GlobalProposal.GlobalProposalDetail calldata globalProposal,\\n Ballot.VoteType[] calldata supports_,\\n Signature[] calldata signatures\\n ) external onlyGovernor {\\n _requireExecutor(globalProposal.executor, msg.sender);\\n _relayGlobalProposal({ globalProposal: globalProposal, supports_: supports_, signatures: signatures, creator: msg.sender });\\n }\\n\\n function _requireExecutor(address executor, address caller) internal pure {\\n if (executor != address(0) && caller != executor) {\\n revert ErrNonExecutorCannotRelay(executor, caller);\\n }\\n }\\n\\n /**\\n * @dev Internal function to retrieve the minimum vote weight required for governance actions.\\n * @return minimumVoteWeight The minimum vote weight required for governance actions.\\n */\\n function _getMinimumVoteWeight() internal view override returns (uint256) {\\n return minimumVoteWeight();\\n }\\n\\n /**\\n * @dev Returns the expiry duration for a new proposal.\\n */\\n function getProposalExpiryDuration() external view returns (uint256) {\\n return _proposalExpiryDuration;\\n }\\n\\n /**\\n * @dev Internal function to retrieve the total weights of all governors.\\n * @return totalWeights The total weights of all governors combined.\\n */\\n function _getTotalWeight() internal view override returns (uint256) {\\n return getTotalWeight();\\n }\\n\\n /**\\n * @dev Internal function to calculate the sum of weights for a given array of governors.\\n * @param governors An array containing the addresses of governors to calculate the sum of weights.\\n * @return sumWeights The sum of weights for the provided governors.\\n */\\n function _sumWeight(address[] memory governors) internal view override returns (uint256) {\\n return _sumGovernorsWeight(governors);\\n }\\n\\n /**\\n * @dev Internal function to retrieve the chain type of the contract.\\n * @return chainType The chain type, indicating the type of the chain the contract operates on (e.g., Mainchain).\\n */\\n function _getChainType() internal pure override returns (ChainType) {\\n return ChainType.Mainchain;\\n }\\n\\n function _proposalDomainSeparator() internal view override returns (bytes32) {\\n return DOMAIN_SEPARATOR;\\n }\\n}\\n\",\"keccak256\":\"0xea177997b7100f310369b8fd530ea48ab823b06a53424c14f150cef723584c02\",\"license\":\"MIT\"},\"src/types/Types.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.17;\\n\\nimport { LibTUint256Slot } from \\\"./operations/LibTUint256Slot.sol\\\";\\n\\ntype TUint256Slot is bytes32;\\n\\nusing {\\n LibTUint256Slot.add,\\n LibTUint256Slot.sub,\\n LibTUint256Slot.mul,\\n LibTUint256Slot.div,\\n LibTUint256Slot.load,\\n LibTUint256Slot.store,\\n LibTUint256Slot.addAssign,\\n LibTUint256Slot.subAssign,\\n LibTUint256Slot.preDecrement,\\n LibTUint256Slot.postDecrement,\\n LibTUint256Slot.preIncrement,\\n LibTUint256Slot.postIncrement\\n} for TUint256Slot global;\\n\",\"keccak256\":\"0x20ab58f1c9ae4936f9dd9891d064301d78ef508c1dd2ce0c19a7b5b81d530e36\",\"license\":\"MIT\"},\"src/types/operations/LibTUint256Slot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.17;\\n\\nimport { TUint256Slot } from \\\"../Types.sol\\\";\\n\\n/**\\n * @title LibTUint256Slot\\n * @dev Library for handling unsigned 256-bit integers.\\n */\\nlibrary LibTUint256Slot {\\n /// @dev value is equal to bytes4(keccak256(\\\"Panic(uint256)\\\"))\\n /// @dev see: https://github.com/foundry-rs/forge-std/blob/master/src/StdError.sol\\n uint256 private constant PANIC_ERROR_SIGNATURE = 0x4e487b71;\\n /// @dev error code for {Arithmetic over/underflow} error\\n uint256 private constant ARITHMETIC_ERROR_CODE = 0x11;\\n /// @dev error code for {Division or modulo by 0} error\\n uint256 private constant DIVISION_ERROR_CODE = 0x12;\\n\\n /**\\n * @dev Loads the value of the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @return val The loaded value.\\n */\\n function load(TUint256Slot self) internal view returns (uint256 val) {\\n assembly {\\n val := sload(self)\\n }\\n }\\n\\n /**\\n * @dev Stores a value into the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @param other The value to be stored.\\n */\\n function store(TUint256Slot self, uint256 other) internal {\\n assembly {\\n sstore(self, other)\\n }\\n }\\n\\n /**\\n * @dev Multiplies the TUint256Slot variable by a given value.\\n * @param self The TUint256Slot variable.\\n * @param other The value to multiply by.\\n * @return res The resulting value after multiplication.\\n */\\n function mul(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n if iszero(iszero(storedVal)) {\\n res := mul(storedVal, other)\\n\\n // Overflow check\\n if iszero(eq(other, div(res, storedVal))) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, ARITHMETIC_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n }\\n }\\n }\\n\\n /**\\n * @dev Divides the TUint256Slot variable by a given value.\\n * @param self The TUint256Slot variable.\\n * @param other The value to divide by.\\n * @return res The resulting value after division.\\n */\\n function div(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n // revert if divide by zero\\n if iszero(other) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, DIVISION_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n res := div(storedVal, other)\\n }\\n }\\n\\n /**\\n * @dev Subtracts a given value from the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @param other The value to subtract.\\n * @return res The resulting value after subtraction.\\n */\\n function sub(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n\\n // Underflow check\\n if lt(storedVal, other) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, ARITHMETIC_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n\\n res := sub(storedVal, other)\\n }\\n }\\n\\n /**\\n * @dev Adds a given value to the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @param other The value to add.\\n * @return res The resulting value after addition.\\n */\\n function add(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n res := add(storedVal, other)\\n\\n // Overflow check\\n if lt(res, other) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, ARITHMETIC_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n }\\n }\\n\\n /**\\n * @dev Increments the TUint256Slot variable by 1 and returns the new value.\\n * @param self The TUint256Slot variable.\\n * @return res The resulting value after incrementing.\\n */\\n function preIncrement(TUint256Slot self) internal returns (uint256 res) {\\n res = addAssign(self, 1);\\n }\\n\\n /**\\n * @dev Increments the TUint256Slot variable by 1 and returns the original value.\\n * @param self The TUint256Slot variable.\\n * @return res The original value before incrementing.\\n */\\n function postIncrement(TUint256Slot self) internal returns (uint256 res) {\\n res = load(self);\\n store(self, res + 1);\\n }\\n\\n /**\\n * @dev Decrements the TUint256Slot variable by 1 and returns the new value.\\n * @param self The TUint256Slot variable.\\n * @return res The resulting value after decrementing.\\n */\\n function preDecrement(TUint256Slot self) internal returns (uint256 res) {\\n res = subAssign(self, 1);\\n }\\n\\n /**\\n * @dev Decrements the TUint256Slot variable by 1 and returns the new value.\\n * @param self The TUint256Slot variable.\\n * @return res The resulting value before decrementing.\\n */\\n function postDecrement(TUint256Slot self) internal returns (uint256 res) {\\n res = load(self);\\n store(self, res - 1);\\n }\\n\\n /**\\n * @dev Adds a given value to the TUint256Slot variable and stores the result.\\n * @param self The TUint256Slot variable.\\n * @param other The value to add.\\n * @return res The resulting value after addition and storage.\\n */\\n function addAssign(TUint256Slot self, uint256 other) internal returns (uint256 res) {\\n store(self, res = add(self, other));\\n }\\n\\n /**\\n * @dev Subtracts a given value from the TUint256Slot variable and stores the result.\\n * @param self The TUint256Slot variable.\\n * @param other The value to subtract.\\n * @return res The resulting value after subtraction and storage.\\n */\\n function subAssign(TUint256Slot self, uint256 other) internal returns (uint256 res) {\\n store(self, res = sub(self, other));\\n }\\n}\\n\",\"keccak256\":\"0xe10c089459baf373494d76b00e582d49f6e43c500ab0f1657d53afc2fa472cbb\",\"license\":\"MIT\"},\"src/utils/CommonErrors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ContractType } from \\\"./ContractType.sol\\\";\\nimport { RoleAccess } from \\\"./RoleAccess.sol\\\";\\n\\nerror ErrSyncTooFarPeriod(uint256 period, uint256 latestRewardedPeriod);\\n/**\\n * @dev Error thrown when an address is expected to be an already created externally owned account (EOA).\\n * This error indicates that the provided address is invalid for certain contract operations that require already created EOA.\\n */\\nerror ErrAddressIsNotCreatedEOA(address addr, bytes32 codehash);\\n/**\\n * @dev Error raised when a bridge operator update operation fails.\\n * @param bridgeOperator The address of the bridge operator that failed to update.\\n */\\nerror ErrBridgeOperatorUpdateFailed(address bridgeOperator);\\n/**\\n * @dev Error thrown when attempting to add a bridge operator that already exists in the contract.\\n * This error indicates that the provided bridge operator address is already registered as a bridge operator in the contract.\\n */\\nerror ErrBridgeOperatorAlreadyExisted(address bridgeOperator);\\n/**\\n * @dev The error indicating an unsupported interface.\\n * @param interfaceId The bytes4 interface identifier that is not supported.\\n * @param addr The address where the unsupported interface was encountered.\\n */\\nerror ErrUnsupportedInterface(bytes4 interfaceId, address addr);\\n/**\\n * @dev Error thrown when the return data from a callback function is invalid.\\n * @param callbackFnSig The signature of the callback function that returned invalid data.\\n * @param register The address of the register where the callback function was invoked.\\n * @param returnData The invalid return data received from the callback function.\\n */\\nerror ErrInvalidReturnData(bytes4 callbackFnSig, address register, bytes returnData);\\n/**\\n * @dev Error of set to non-contract.\\n */\\nerror ErrZeroCodeContract(address addr);\\n/**\\n * @dev Error indicating that arguments are invalid.\\n */\\nerror ErrInvalidArguments(bytes4 msgSig);\\n/**\\n * @dev Error indicating that given address is null when it should not.\\n */\\nerror ErrZeroAddress(bytes4 msgSig);\\n/**\\n * @dev Error indicating that the provided threshold is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that the invalid threshold applies to.\\n */\\nerror ErrInvalidThreshold(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a function can only be called by the contract itself.\\n * @param msgSig The function signature (bytes4) that can only be called by the contract itself.\\n */\\nerror ErrOnlySelfCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n * @param expectedRole The role required to perform the function.\\n */\\nerror ErrUnauthorized(bytes4 msgSig, RoleAccess expectedRole);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n */\\nerror ErrUnauthorizedCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4).\\n * @param expectedContractType The contract type required to perform the function.\\n * @param actual The actual address that called to the function.\\n */\\nerror ErrUnexpectedInternalCall(bytes4 msgSig, ContractType expectedContractType, address actual);\\n\\n/**\\n * @dev Error indicating that an array is empty when it should contain elements.\\n */\\nerror ErrEmptyArray();\\n\\n/**\\n * @dev Error indicating a mismatch in the length of input parameters or arrays for a specific function.\\n * @param msgSig The function signature (bytes4) that has a length mismatch.\\n */\\nerror ErrLengthMismatch(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a proxy call to an external contract has failed.\\n * @param msgSig The function signature (bytes4) of the proxy call that failed.\\n * @param extCallSig The function signature (bytes4) of the external contract call that failed.\\n */\\nerror ErrProxyCallFailed(bytes4 msgSig, bytes4 extCallSig);\\n\\n/**\\n * @dev Error indicating that a function tried to call a precompiled contract that is not allowed.\\n * @param msgSig The function signature (bytes4) that attempted to call a precompiled contract.\\n */\\nerror ErrCallPrecompiled(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a native token transfer has failed.\\n * @param msgSig The function signature (bytes4) of the token transfer that failed.\\n */\\nerror ErrNativeTransferFailed(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that an order is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid order.\\n */\\nerror ErrInvalidOrder(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the chain ID is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid chain ID.\\n * @param actual Current chain ID that executing function.\\n * @param expected Expected chain ID required for the tx to success.\\n */\\nerror ErrInvalidChainId(bytes4 msgSig, uint256 actual, uint256 expected);\\n\\n/**\\n * @dev Error indicating that a vote type is not supported.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an unsupported vote type.\\n */\\nerror ErrUnsupportedVoteType(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the proposal nonce is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid proposal nonce.\\n */\\nerror ErrInvalidProposalNonce(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a voter has already voted.\\n * @param voter The address of the voter who has already voted.\\n */\\nerror ErrAlreadyVoted(address voter);\\n\\n/**\\n * @dev Error indicating that a signature is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid signature.\\n */\\nerror ErrInvalidSignatures(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a relay call has failed.\\n * @param msgSig The function signature (bytes4) of the relay call that failed.\\n */\\nerror ErrRelayFailed(bytes4 msgSig);\\n/**\\n * @dev Error indicating that a vote weight is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid vote weight.\\n */\\nerror ErrInvalidVoteWeight(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a query was made for an outdated bridge operator set.\\n */\\nerror ErrQueryForOutdatedBridgeOperatorSet();\\n\\n/**\\n * @dev Error indicating that a request is invalid.\\n */\\nerror ErrInvalidRequest();\\n\\n/**\\n * @dev Error indicating that a token standard is invalid.\\n */\\nerror ErrInvalidTokenStandard();\\n\\n/**\\n * @dev Error indicating that a token is not supported.\\n */\\nerror ErrUnsupportedToken();\\n\\n/**\\n * @dev Error indicating that a receipt kind is invalid.\\n */\\nerror ErrInvalidReceiptKind();\\n\\n/**\\n * @dev Error indicating that a receipt is invalid.\\n */\\nerror ErrInvalidReceipt();\\n\\n/**\\n * @dev Error indicating that an address is not payable.\\n */\\nerror ErrNonpayableAddress(address);\\n\\n/**\\n * @dev Error indicating that the period is already processed, i.e. scattered reward.\\n */\\nerror ErrPeriodAlreadyProcessed(uint256 requestingPeriod, uint256 latestPeriod);\\n\\n/**\\n * @dev Error thrown when an invalid vote hash is provided.\\n */\\nerror ErrInvalidVoteHash();\\n\\n/**\\n * @dev Error thrown when querying for an empty vote.\\n */\\nerror ErrQueryForEmptyVote();\\n\\n/**\\n * @dev Error thrown when querying for an expired vote.\\n */\\nerror ErrQueryForExpiredVote();\\n\\n/**\\n * @dev Error thrown when querying for a non-existent vote.\\n */\\nerror ErrQueryForNonExistentVote();\\n\\n/**\\n * @dev Error indicating that the method is only called once per block.\\n */\\nerror ErrOncePerBlock();\\n\\n/**\\n * @dev Error of method caller must be coinbase\\n */\\nerror ErrCallerMustBeCoinbase();\\n\\n/**\\n * @dev Error thrown when an invalid proposal is encountered.\\n * @param actual The actual value of the proposal.\\n * @param expected The expected value of the proposal.\\n */\\nerror ErrInvalidProposal(bytes32 actual, bytes32 expected);\\n\\n/**\\n * @dev Error of proposal is not approved for executing.\\n */\\nerror ErrProposalNotApproved();\\n\\n/**\\n * @dev Error of the caller is not the specified executor.\\n */\\nerror ErrInvalidExecutor();\\n\\n/**\\n * @dev Error of the `caller` to relay is not the specified `executor`.\\n */\\nerror ErrNonExecutorCannotRelay(address executor, address caller);\\n\",\"keccak256\":\"0x0d9e2fd98f6b704273faad707ed9eadbd4c79551ee3f902bff5b29213a204679\",\"license\":\"MIT\"},\"src/utils/ContractType.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum ContractType {\\n UNKNOWN, // 0\\n PAUSE_ENFORCER, // 1\\n BRIDGE, // 2\\n BRIDGE_TRACKING, // 3\\n GOVERNANCE_ADMIN, // 4\\n MAINTENANCE, // 5\\n SLASH_INDICATOR, // 6\\n STAKING_VESTING, // 7\\n VALIDATOR, // 8\\n STAKING, // 9\\n RONIN_TRUSTED_ORGANIZATION, // 10\\n BRIDGE_MANAGER, // 11\\n BRIDGE_SLASH, // 12\\n BRIDGE_REWARD, // 13\\n FAST_FINALITY_TRACKING, // 14\\n PROFILE // 15\\n\\n}\\n\",\"keccak256\":\"0xec088aa939cd885dbe84e944942d7ea674e1fff8802c1f2ae5d8e84e4578357d\",\"license\":\"MIT\"},\"src/utils/IdentityGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { AddressArrayUtils } from \\\"../libraries/AddressArrayUtils.sol\\\";\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport { TransparentUpgradeableProxyV2 } from \\\"../extensions/TransparentUpgradeableProxyV2.sol\\\";\\nimport { ErrAddressIsNotCreatedEOA, ErrZeroAddress, ErrOnlySelfCall, ErrZeroCodeContract, ErrUnsupportedInterface } from \\\"./CommonErrors.sol\\\";\\n\\nabstract contract IdentityGuard {\\n using AddressArrayUtils for address[];\\n\\n /// @dev value is equal to keccak256(abi.encode())\\n /// @dev see: https://eips.ethereum.org/EIPS/eip-1052\\n bytes32 internal constant CREATED_ACCOUNT_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\\n\\n /**\\n * @dev Modifier to restrict functions to only be called by this contract.\\n * @dev Reverts if the caller is not this contract.\\n */\\n modifier onlySelfCall() virtual {\\n _requireSelfCall();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to ensure that the elements in the `arr` array are non-duplicates.\\n * It calls the internal `_checkDuplicate` function to perform the duplicate check.\\n *\\n * Requirements:\\n * - The elements in the `arr` array must not contain any duplicates.\\n */\\n modifier nonDuplicate(address[] memory arr) virtual {\\n _requireNonDuplicate(arr);\\n _;\\n }\\n\\n /**\\n * @dev Internal method to check the method caller.\\n * @dev Reverts if the method caller is not this contract.\\n */\\n function _requireSelfCall() internal view virtual {\\n if (msg.sender != address(this)) revert ErrOnlySelfCall(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to check if a contract address has code.\\n * @param addr The address of the contract to check.\\n * @dev Throws an error if the contract address has no code.\\n */\\n function _requireHasCode(address addr) internal view {\\n if (addr.code.length == 0) revert ErrZeroCodeContract(addr);\\n }\\n\\n /**\\n * @dev Checks if an address is zero and reverts if it is.\\n * @param addr The address to check.\\n */\\n function _requireNonZeroAddress(address addr) internal pure {\\n if (addr == address(0)) revert ErrZeroAddress(msg.sig);\\n }\\n\\n /**\\n * @dev Check if arr is empty and revert if it is.\\n * Checks if an array contains any duplicate addresses and reverts if duplicates are found.\\n * @param arr The array of addresses to check.\\n */\\n function _requireNonDuplicate(address[] memory arr) internal pure {\\n if (arr.hasDuplicate()) revert AddressArrayUtils.ErrDuplicated(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to require that the provided address is a created externally owned account (EOA).\\n * This internal function is used to ensure that the provided address is a valid externally owned account (EOA).\\n * It checks the codehash of the address against a predefined constant to confirm that the address is a created EOA.\\n * @notice This method only works with non-state EOA accounts\\n */\\n function _requireCreatedEOA(address addr) internal view {\\n _requireNonZeroAddress(addr);\\n bytes32 codehash = addr.codehash;\\n if (codehash != CREATED_ACCOUNT_HASH) revert ErrAddressIsNotCreatedEOA(addr, codehash);\\n }\\n\\n /**\\n * @dev Internal function to require that the specified contract supports the given interface. This method handle in\\n * both case that the callee is either or not the proxy admin of the caller. If the contract does not support the\\n * interface `interfaceId` or EIP165, a revert with the corresponding error message is triggered.\\n *\\n * @param contractAddr The address of the contract to check for interface support.\\n * @param interfaceId The interface ID to check for support.\\n */\\n function _requireSupportsInterface(address contractAddr, bytes4 interfaceId) internal view {\\n bytes memory supportsInterfaceParams = abi.encodeCall(IERC165.supportsInterface, (interfaceId));\\n (bool success, bytes memory returnOrRevertData) = contractAddr.staticcall(supportsInterfaceParams);\\n if (!success) {\\n (success, returnOrRevertData) = contractAddr.staticcall(abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (supportsInterfaceParams)));\\n if (!success) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n if (!abi.decode(returnOrRevertData, (bool))) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n}\\n\",\"keccak256\":\"0x546ab4c9cdb0e7f8e650f140349225305ba1d0706dcaceeb9180c96aa765da59\",\"license\":\"MIT\"},\"src/utils/RoleAccess.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum RoleAccess {\\n UNKNOWN, // 0\\n ADMIN, // 1\\n COINBASE, // 2\\n GOVERNOR, // 3\\n CANDIDATE_ADMIN, // 4\\n WITHDRAWAL_MIGRATOR, // 5\\n __DEPRECATED_BRIDGE_OPERATOR, // 6\\n BLOCK_PRODUCER, // 7\\n VALIDATOR_CANDIDATE, // 8\\n CONSENSUS, // 9\\n TREASURY // 10\\n\\n}\\n\",\"keccak256\":\"0x671ff40dd874c508c4b3879a580996c7987fc018669256f47151e420a55c0e51\",\"license\":\"MIT\"}},\"version\":1}", + "nonce": 23, + "numDeployments": 1, + "storageLayout": { + "storage": [ + { + "astId": 58190, + "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 58193, + "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 104934, + "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", + "label": "DOMAIN_SEPARATOR", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + }, + { + "astId": 106983, + "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", + "label": "round", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 106991, + "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", + "label": "vote", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_uint256,t_mapping(t_uint256,t_struct(ProposalVote)106921_storage))" + }, + { + "astId": 106993, + "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", + "label": "_proposalExpiryDuration", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 107715, + "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", + "label": "_targetOptionsMap", + "offset": 0, + "slot": "5", + "type": "t_mapping(t_enum(TargetOption)111729,t_address)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_address)dyn_storage": { + "encoding": "dynamic_array", + "label": "address[]", + "numberOfBytes": "32", + "base": "t_address" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_enum(TargetOption)111729": { + "encoding": "inplace", + "label": "enum GlobalProposal.TargetOption", + "numberOfBytes": "1" + }, + "t_enum(VoteStatus)110681": { + "encoding": "inplace", + "label": "enum VoteStatusConsumer.VoteStatus", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_address,t_struct(Signature)110672_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct SignatureConsumer.Signature)", + "numberOfBytes": "32", + "value": "t_struct(Signature)110672_storage" + }, + "t_mapping(t_enum(TargetOption)111729,t_address)": { + "encoding": "mapping", + "key": "t_enum(TargetOption)111729", + "label": "mapping(enum GlobalProposal.TargetOption => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_uint256,t_mapping(t_uint256,t_struct(ProposalVote)106921_storage))": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => mapping(uint256 => struct CoreGovernance.ProposalVote))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint256,t_struct(ProposalVote)106921_storage)" + }, + "t_mapping(t_uint256,t_struct(ProposalVote)106921_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct CoreGovernance.ProposalVote)", + "numberOfBytes": "32", + "value": "t_struct(ProposalVote)106921_storage" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(ProposalVote)106921_storage": { + "encoding": "inplace", + "label": "struct CoreGovernance.ProposalVote", + "numberOfBytes": "288", + "members": [ + { + "astId": 106897, + "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", + "label": "status", + "offset": 0, + "slot": "0", + "type": "t_enum(VoteStatus)110681" + }, + { + "astId": 106899, + "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", + "label": "hash", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + }, + { + "astId": 106901, + "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", + "label": "againstVoteWeight", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 106903, + "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", + "label": "forVoteWeight", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 106906, + "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", + "label": "forVoteds", + "offset": 0, + "slot": "4", + "type": "t_array(t_address)dyn_storage" + }, + { + "astId": 106909, + "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", + "label": "againstVoteds", + "offset": 0, + "slot": "5", + "type": "t_array(t_address)dyn_storage" + }, + { + "astId": 106911, + "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", + "label": "expiryTimestamp", + "offset": 0, + "slot": "6", + "type": "t_uint256" + }, + { + "astId": 106916, + "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", + "label": "sig", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_address,t_struct(Signature)110672_storage)" + }, + { + "astId": 106920, + "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", + "label": "voted", + "offset": 0, + "slot": "8", + "type": "t_mapping(t_address,t_bool)" + } + ] + }, + "t_struct(Signature)110672_storage": { + "encoding": "inplace", + "label": "struct SignatureConsumer.Signature", + "numberOfBytes": "96", + "members": [ + { + "astId": 110667, + "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", + "label": "v", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 110669, + "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", + "label": "r", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + }, + { + "astId": 110671, + "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", + "label": "s", + "offset": 0, + "slot": "2", + "type": "t_bytes32" + } + ] + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + }, + "timestamp": 1713254676, + "userdoc": { + "version": 1, + "kind": "user", + "methods": { + "round(uint256)": { + "notice": "chain id = 0 for global proposal" + } + }, + "errors": { + "ErrBelowMinRequiredGovernors()": [ + { + "notice": "Error indicating that the governors list will go below minimum number of required governor." + } + ], + "ErrGovernorNotFound(address)": [ + { + "notice": "Error indicating that cannot find the querying governor" + } + ], + "ErrGovernorNotMatch(address,address)": [ + { + "notice": "Error indicating that the msg.sender is not match the required governor" + } + ], + "ErrInvalidInput()": [ + { + "notice": "Common invalid input error" + } + ], + "ErrOperatorNotFound(address)": [ + { + "notice": "Error indicating that cannot find the querying operator" + } + ] + } + } +} \ No newline at end of file diff --git a/deployments/sepolia/MainchainBridgeManagerProxy.json b/deployments/sepolia/MainchainBridgeManagerProxy.json new file mode 100644 index 00000000..51a6890f --- /dev/null +++ b/deployments/sepolia/MainchainBridgeManagerProxy.json @@ -0,0 +1,218 @@ +{ + "abi": [ + { + "type": "constructor", + "inputs": [ + { + "name": "_logic", + "type": "address", + "internalType": "address" + }, + { + "name": "admin_", + "type": "address", + "internalType": "address" + }, + { + "name": "_data", + "type": "bytes", + "internalType": "bytes" + } + ], + "stateMutability": "payable" + }, + { + "type": "fallback", + "stateMutability": "payable" + }, + { + "type": "receive", + "stateMutability": "payable" + }, + { + "type": "function", + "name": "admin", + "inputs": [], + "outputs": [ + { + "name": "admin_", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "changeAdmin", + "inputs": [ + { + "name": "newAdmin", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "functionDelegateCall", + "inputs": [ + { + "name": "_data", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [], + "stateMutability": "payable" + }, + { + "type": "function", + "name": "implementation", + "inputs": [], + "outputs": [ + { + "name": "implementation_", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "upgradeTo", + "inputs": [ + { + "name": "newImplementation", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "upgradeToAndCall", + "inputs": [ + { + "name": "newImplementation", + "type": "address", + "internalType": "address" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [], + "stateMutability": "payable" + }, + { + "type": "event", + "name": "AdminChanged", + "inputs": [ + { + "name": "previousAdmin", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "newAdmin", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "BeaconUpgraded", + "inputs": [ + { + "name": "beacon", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Upgraded", + "inputs": [ + { + "name": "implementation", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + } + ], + "address": "0xdbf1c9FB0cb61Ae76901e55c5C04e77d2BE131A1", + "args": "0xf896f0700000000000000000000000000000000000000000000000000000000000000007000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000007e500000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000003a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000002e82d2b56f858f79deef11b160bfc4631873da2b000000000000000000000000bcb61783dd2403fe8cc9b89b27b1a9bb03d040cb000000000000000000000000b266bf53cf7eac4e2065a404598dcb0e15e9462c000000000000000000000000cc5fc5b6c8595f56306da736f6cd02ed9141c84a0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000d24d87ddc1917165435b306aac68d99e0f49a3fa000000000000000000000000b033ba62ec622dc54d0abfe0254e79692147ca26000000000000000000000000087d08e3ba42e64e3948962dd1371f906d1278b900000000000000000000000052ec2e6bbce45afff8955da6410bb13812f4289f00000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e00000000000000000000000061ec0ebf966ae84c414bda715e17cef657e039df", + "ast": "", + "blockNumber": 5709352, + "bytecode": "0x608060405260405162000edd38038062000edd83398101604081905262000026916200041a565b8282828281620000398282600062000053565b506200004790508262000085565b5050505050506200054d565b6200005e83620000f7565b6000825111806200006c5750805b1562000080576200007e838362000139565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f620000c760008051602062000e96833981519152546001600160a01b031690565b604080516001600160a01b03928316815291841660208301520160405180910390a1620000f48162000168565b50565b620001028162000206565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606062000161838360405180606001604052806027815260200162000eb6602791396200029d565b9392505050565b6001600160a01b038116620001d35760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b8060008051602062000e968339815191525b80546001600160a01b0319166001600160a01b039290921691909117905550565b6001600160a01b0381163b620002755760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620001ca565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc620001e5565b60606001600160a01b0384163b620003075760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401620001ca565b600080856001600160a01b031685604051620003249190620004fa565b600060405180830381855af49150503d806000811462000361576040519150601f19603f3d011682016040523d82523d6000602084013e62000366565b606091505b5090925090506200037982828662000383565b9695505050505050565b606083156200039457508162000161565b825115620003a55782518084602001fd5b8160405162461bcd60e51b8152600401620001ca919062000518565b80516001600160a01b0381168114620003d957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000411578181015183820152602001620003f7565b50506000910152565b6000806000606084860312156200043057600080fd5b6200043b84620003c1565b92506200044b60208501620003c1565b60408501519092506001600160401b03808211156200046957600080fd5b818601915086601f8301126200047e57600080fd5b815181811115620004935762000493620003de565b604051601f8201601f19908116603f01168101908382118183101715620004be57620004be620003de565b81604052828152896020848701011115620004d857600080fd5b620004eb836020830160208801620003f4565b80955050505050509250925092565b600082516200050e818460208701620003f4565b9190910192915050565b602081526000825180602084015262000539816040850160208701620003f4565b601f01601f19169190910160400192915050565b610939806200055d6000396000f3fe6080604052600436106100595760003560e01c80633659cfe6146100705780634bb5274a146100905780634f1ef286146100a35780635c60da1b146100b65780638f283970146100e7578063f851a4401461010757610068565b366100685761006661011c565b005b61006661011c565b34801561007c57600080fd5b5061006661008b366004610704565b610136565b61006661009e366004610735565b610173565b6100666100b13660046107e6565b6101b8565b3480156100c257600080fd5b506100cb61021f565b6040516001600160a01b03909116815260200160405180910390f35b3480156100f357600080fd5b50610066610102366004610704565b610250565b34801561011357600080fd5b506100cb610270565b610124610291565b61013461012f610326565b610330565b565b61013e61034f565b6001600160a01b0316330361016b5761016881604051806020016040528060008152506000610382565b50565b61016861011c565b61017b61034f565b6001600160a01b0316330361016b576000610194610326565b9050600080835160208501845af43d6000803e8080156101b3573d6000f35b3d6000fd5b6101c061034f565b6001600160a01b03163303610217576102128383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525060019250610382915050565b505050565b61021261011c565b600061022961034f565b6001600160a01b0316330361024557610240610326565b905090565b61024d61011c565b90565b61025861034f565b6001600160a01b0316330361016b57610168816103ad565b600061027a61034f565b6001600160a01b031633036102455761024061034f565b61029961034f565b6001600160a01b031633036101345760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b6000610240610401565b3660008037600080366000845af43d6000803e8080156101b3573d6000f35b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b61038b83610429565b6000825111806103985750805b15610212576103a78383610469565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103d661034f565b604080516001600160a01b03928316815291841660208301520160405180910390a161016881610495565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610373565b6104328161053e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061048e83836040518060600160405280602781526020016108dd602791396105d2565b9392505050565b6001600160a01b0381166104fa5760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b606482015260840161031d565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b6001600160a01b0381163b6105ab5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161031d565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc61051d565b60606001600160a01b0384163b61063a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161031d565b600080856001600160a01b031685604051610655919061088d565b600060405180830381855af49150503d8060008114610690576040519150601f19603f3d011682016040523d82523d6000602084013e610695565b606091505b50915091506106a58282866106af565b9695505050505050565b606083156106be57508161048e565b8251156106ce5782518084602001fd5b8160405162461bcd60e51b815260040161031d91906108a9565b80356001600160a01b03811681146106ff57600080fd5b919050565b60006020828403121561071657600080fd5b61048e826106e8565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561074757600080fd5b813567ffffffffffffffff8082111561075f57600080fd5b818401915084601f83011261077357600080fd5b8135818111156107855761078561071f565b604051601f8201601f19908116603f011681019083821181831017156107ad576107ad61071f565b816040528281528760208487010111156107c657600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000806000604084860312156107fb57600080fd5b610804846106e8565b9250602084013567ffffffffffffffff8082111561082157600080fd5b818601915086601f83011261083557600080fd5b81358181111561084457600080fd5b87602082850101111561085657600080fd5b6020830194508093505050509250925092565b60005b8381101561088457818101518382015260200161086c565b50506000910152565b6000825161089f818460208701610869565b9190910192915050565b60208152600082518060208401526108c8816040850160208701610869565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220c665d628940e317f0b6d03df17271fb51c4d35c9dbf89cce5e4d9768343c58a864736f6c63430008170033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "chainId": 11155111, + "contractAbsolutePath": "TransparentUpgradeableProxyV2.sol:TransparentUpgradeableProxyV2", + "deployedBytecode": "0x6080604052600436106100595760003560e01c80633659cfe6146100705780634bb5274a146100905780634f1ef286146100a35780635c60da1b146100b65780638f283970146100e7578063f851a4401461010757610068565b366100685761006661011c565b005b61006661011c565b34801561007c57600080fd5b5061006661008b366004610704565b610136565b61006661009e366004610735565b610173565b6100666100b13660046107e6565b6101b8565b3480156100c257600080fd5b506100cb61021f565b6040516001600160a01b03909116815260200160405180910390f35b3480156100f357600080fd5b50610066610102366004610704565b610250565b34801561011357600080fd5b506100cb610270565b610124610291565b61013461012f610326565b610330565b565b61013e61034f565b6001600160a01b0316330361016b5761016881604051806020016040528060008152506000610382565b50565b61016861011c565b61017b61034f565b6001600160a01b0316330361016b576000610194610326565b9050600080835160208501845af43d6000803e8080156101b3573d6000f35b3d6000fd5b6101c061034f565b6001600160a01b03163303610217576102128383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525060019250610382915050565b505050565b61021261011c565b600061022961034f565b6001600160a01b0316330361024557610240610326565b905090565b61024d61011c565b90565b61025861034f565b6001600160a01b0316330361016b57610168816103ad565b600061027a61034f565b6001600160a01b031633036102455761024061034f565b61029961034f565b6001600160a01b031633036101345760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b6000610240610401565b3660008037600080366000845af43d6000803e8080156101b3573d6000f35b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b61038b83610429565b6000825111806103985750805b15610212576103a78383610469565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103d661034f565b604080516001600160a01b03928316815291841660208301520160405180910390a161016881610495565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610373565b6104328161053e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061048e83836040518060600160405280602781526020016108dd602791396105d2565b9392505050565b6001600160a01b0381166104fa5760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b606482015260840161031d565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b6001600160a01b0381163b6105ab5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161031d565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc61051d565b60606001600160a01b0384163b61063a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161031d565b600080856001600160a01b031685604051610655919061088d565b600060405180830381855af49150503d8060008114610690576040519150601f19603f3d011682016040523d82523d6000602084013e610695565b606091505b50915091506106a58282866106af565b9695505050505050565b606083156106be57508161048e565b8251156106ce5782518084602001fd5b8160405162461bcd60e51b815260040161031d91906108a9565b80356001600160a01b03811681146106ff57600080fd5b919050565b60006020828403121561071657600080fd5b61048e826106e8565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561074757600080fd5b813567ffffffffffffffff8082111561075f57600080fd5b818401915084601f83011261077357600080fd5b8135818111156107855761078561071f565b604051601f8201601f19908116603f011681019083821181831017156107ad576107ad61071f565b816040528281528760208487010111156107c657600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000806000604084860312156107fb57600080fd5b610804846106e8565b9250602084013567ffffffffffffffff8082111561082157600080fd5b818601915086601f83011261083557600080fd5b81358181111561084457600080fd5b87602082850101111561085657600080fd5b6020830194508093505050509250925092565b60005b8381101561088457818101518382015260200161086c565b50506000910152565b6000825161089f818460208701610869565b9190910192915050565b60208152600082518060208401526108c8816040850160208701610869565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220c665d628940e317f0b6d03df17271fb51c4d35c9dbf89cce5e4d9768343c58a864736f6c63430008170033", + "deployer": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "devdoc": { + "version": 1, + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "functionDelegateCall(bytes)": { + "details": "Calls a function from the current implementation as specified by `_data`, which should be an encoded function call. Requirements: - Only the admin can call this function. Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider reviewing the encoded data `_data` and the method which is called before using this." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "events": { + "AdminChanged(address,address)": { + "details": "Emitted when the admin account has changed." + }, + "BeaconUpgraded(address)": { + "details": "Emitted when the beacon is upgraded." + }, + "Upgraded(address)": { + "details": "Emitted when the implementation is upgraded." + } + } + }, + "isFoundry": true, + "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"functionDelegateCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"events\":{\"AdminChanged(address,address)\":{\"details\":\"Emitted when the admin account has changed.\"},\"BeaconUpgraded(address)\":{\"details\":\"Emitted when the beacon is upgraded.\"},\"Upgraded(address)\":{\"details\":\"Emitted when the implementation is upgraded.\"}},\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"functionDelegateCall(bytes)\":{\"details\":\"Calls a function from the current implementation as specified by `_data`, which should be an encoded function call. Requirements: - Only the admin can call this function. Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider reviewing the encoded data `_data` and the method which is called before using this.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/extensions/TransparentUpgradeableProxyV2.sol\":\"TransparentUpgradeableProxyV2\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@fdk/=lib/foundry-deployment-kit/script/\",\":@openzeppelin/=lib/openzeppelin-contracts/\",\":@prb/math/=lib/prb-math/\",\":@prb/test/=lib/prb-test/src/\",\":@ronin/contracts/=src/\",\":@ronin/script/=script/\",\":@ronin/test/=test/\",\":contract-libs/=lib/foundry-deployment-kit/lib/contract-libs/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/foundry-deployment-kit/lib/forge-std/src/\",\":foundry-deployment-kit/=lib/foundry-deployment-kit/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/contracts/\",\":prb-math/=lib/prb-math/src/\",\":prb-test/=lib/prb-test/src/\",\":solady/=lib/solady/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0xa6a787e7a901af6511e19aa53e1a00352db215a011d2c7a438d0582dd5da76f9\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"src/extensions/TransparentUpgradeableProxyV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\\\";\\n\\ncontract TransparentUpgradeableProxyV2 is TransparentUpgradeableProxy {\\n constructor(address _logic, address admin_, bytes memory _data) payable TransparentUpgradeableProxy(_logic, admin_, _data) { }\\n\\n /**\\n * @dev Calls a function from the current implementation as specified by `_data`, which should be an encoded function call.\\n *\\n * Requirements:\\n * - Only the admin can call this function.\\n *\\n * Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid\\n * triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider\\n * reviewing the encoded data `_data` and the method which is called before using this.\\n *\\n */\\n function functionDelegateCall(bytes memory _data) public payable ifAdmin {\\n address _addr = _implementation();\\n assembly {\\n let _result := delegatecall(gas(), _addr, add(_data, 32), mload(_data), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n switch _result\\n case 0 { revert(0, returndatasize()) }\\n default { return(0, returndatasize()) }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x45fc7b71d09da99414b977a56e586b3604670d865e5f36f395d5c98bc4ba64af\",\"license\":\"MIT\"}},\"version\":1}", + "nonce": 24, + "numDeployments": 1, + "storageLayout": { + "storage": [], + "types": {} + }, + "timestamp": 1713254676, + "userdoc": { + "version": 1, + "kind": "user" + } +} \ No newline at end of file diff --git a/deployments/sepolia/MainchainGatewayPauseEnforcerLogic.json b/deployments/sepolia/MainchainGatewayPauseEnforcerLogic.json index f5b1c2a0..6a29ede2 100644 --- a/deployments/sepolia/MainchainGatewayPauseEnforcerLogic.json +++ b/deployments/sepolia/MainchainGatewayPauseEnforcerLogic.json @@ -435,15 +435,15 @@ "inputs": [] } ], - "address": "0xC2cb024747e86a05A2d2839Dd02ceb78f939F983", + "address": "0x3C4e17b9056272Ce1b49F6900d8cFD6171a1869d", "args": "0x", "ast": "", - "blockNumber": 5632711, - "bytecode": "0x608060405234801561001057600080fd5b5061001961001e565b6100de565b600254610100900460ff161561008a5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60025460ff90811610156100dc576002805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6111c4806100ed6000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c806391d14854116100a2578063caa6fea411610071578063caa6fea414610240578063d4b8399214610254578063d547741f1461026d578063dcf7bb5c14610280578063f82ec70b1461029357600080fd5b806391d148541461020a578063a217fddf1461021d578063b9f3163b14610225578063ca15c8731461022d57600080fd5b80636833f60d116100e95780636833f60d1461019c57806377a24f36146101a45780637a9ad019146101b75780637d4f7fc9146101cc5780639010d07c146101df57600080fd5b806301ffc9a71461011b578063248a9ca3146101435780632f2ff15d1461017457806336568abe14610189575b600080fd5b61012e610129366004610e11565b6102a6565b60405190151581526020015b60405180910390f35b610166610151366004610e3b565b60009081526020819052604090206001015490565b60405190815260200161013a565b610187610182366004610e79565b6102d1565b005b610187610197366004610e79565b6102fb565b61018761037e565b6101876101b2366004610ebf565b6104da565b61016660008051602061116f83398151915281565b6101876101da366004610fab565b610640565b6101f26101ed366004610fc8565b610663565b6040516001600160a01b03909116815260200161013a565b61012e610218366004610e79565b610682565b610166600081565b6101876106ab565b61016661023b366004610e3b565b610821565b60025461012e90600160b01b900460ff1681565b6002546101f2906201000090046001600160a01b031681565b61018761027b366004610e79565b610838565b61018761028e366004610fab565b61085d565b6101876102a1366004610fab565b610871565b60006001600160e01b03198216635a05180f60e01b14806102cb57506102cb82610894565b92915050565b6000828152602081905260409020600101546102ec816108c9565b6102f683836108d6565b505050565b6001600160a01b03811633146103705760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61037a82826108f8565b5050565b60008051602061116f833981519152610396816108c9565b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af11580156103e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040d9190610fea565b1561042b576040516310067f7560e11b815260040160405180910390fd5b60028054600160b01b60ff60b01b19909116179081905560408051638456cb5960e01b81529051620100009092046001600160a01b031691638456cb599160048082019260009290919082900301818387803b15801561048a57600080fd5b505af115801561049e573d6000803e3d6000fd5b50506040513381527fb8fad2fa0ed7a383e747c309ef2c4391d7b65592a48893e57ccc1fab70791456925060200190505b60405180910390a150565b600254610100900460ff16158080156104fa5750600254600160ff909116105b806105145750303b158015610514575060025460ff166001145b6105775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610367565b6002805460ff19166001179055801561059a576002805461ff0019166101001790555b6105a38461091a565b6105ae600084610972565b60005b82518110156105f3576105eb60008051602061116f8339815191528483815181106105de576105de61100c565b60200260200101516108d6565b6001016105b1565b50801561063a576002805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b600061064b816108c9565b61037a60008051602061116f833981519152836108d6565b600082815260016020526040812061067b908361097c565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008051602061116f8339815191526106c3816108c9565b600254600160b01b900460ff166106ed57604051631b2fd53f60e31b815260040160405180910390fd5b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610740573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107649190610fea565b61078157604051631e87b57b60e31b815260040160405180910390fd5b6002805460ff60b01b19169081905560408051631fa5d41d60e11b81529051620100009092046001600160a01b031691633f4ba83a9160048082019260009290919082900301818387803b1580156107d857600080fd5b505af11580156107ec573d6000803e3d6000fd5b50506040513381527ff5cbf596165cc457b2cd92e8d8450827ee314968160a5696402d75766fc52caf925060200190506104cf565b60008181526001602052604081206102cb90610988565b600082815260208190526040902060010154610853816108c9565b6102f683836108f8565b6000610868816108c9565b61037a8261091a565b600061087c816108c9565b61037a60008051602061116f833981519152836108f8565b60006001600160e01b03198216637965db0b60e01b14806102cb57506301ffc9a760e01b6001600160e01b03198316146102cb565b6108d38133610992565b50565b6108e082826109f6565b60008281526001602052604090206102f69082610a7a565b6109028282610a8f565b60008281526001602052604090206102f69082610af4565b6002805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040519081527f7f8cffd58ac96898bdd25ab64868bd933141d15ad1cd4a0df228fd3fcba2a26d906020016104cf565b61037a82826108d6565b600061067b8383610b09565b60006102cb825490565b61099c8282610682565b61037a576109b4816001600160a01b03166014610b33565b6109bf836020610b33565b6040516020016109d0929190611046565b60408051601f198184030181529082905262461bcd60e51b8252610367916004016110bb565b610a008282610682565b61037a576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610a363390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061067b836001600160a01b038416610ccf565b610a998282610682565b1561037a576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061067b836001600160a01b038416610d1e565b6000826000018281548110610b2057610b2061100c565b9060005260206000200154905092915050565b60606000610b42836002611104565b610b4d90600261111b565b67ffffffffffffffff811115610b6557610b65610ea9565b6040519080825280601f01601f191660200182016040528015610b8f576020820181803683370190505b509050600360fc1b81600081518110610baa57610baa61100c565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610bd957610bd961100c565b60200101906001600160f81b031916908160001a9053506000610bfd846002611104565b610c0890600161111b565b90505b6001811115610c80576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610c3c57610c3c61100c565b1a60f81b828281518110610c5257610c5261100c565b60200101906001600160f81b031916908160001a90535060049490941c93610c798161112e565b9050610c0b565b50831561067b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610367565b6000818152600183016020526040812054610d16575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556102cb565b5060006102cb565b60008181526001830160205260408120548015610e07576000610d42600183611145565b8554909150600090610d5690600190611145565b9050818114610dbb576000866000018281548110610d7657610d7661100c565b9060005260206000200154905080876000018481548110610d9957610d9961100c565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610dcc57610dcc611158565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506102cb565b60009150506102cb565b600060208284031215610e2357600080fd5b81356001600160e01b03198116811461067b57600080fd5b600060208284031215610e4d57600080fd5b5035919050565b6001600160a01b03811681146108d357600080fd5b8035610e7481610e54565b919050565b60008060408385031215610e8c57600080fd5b823591506020830135610e9e81610e54565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600060608486031215610ed457600080fd5b8335610edf81610e54565b9250602084810135610ef081610e54565b9250604085013567ffffffffffffffff80821115610f0d57600080fd5b818701915087601f830112610f2157600080fd5b813581811115610f3357610f33610ea9565b8060051b604051601f19603f83011681018181108582111715610f5857610f58610ea9565b60405291825284820192508381018501918a831115610f7657600080fd5b938501935b82851015610f9b57610f8c85610e69565b84529385019392850192610f7b565b8096505050505050509250925092565b600060208284031215610fbd57600080fd5b813561067b81610e54565b60008060408385031215610fdb57600080fd5b50508035926020909101359150565b600060208284031215610ffc57600080fd5b8151801515811461067b57600080fd5b634e487b7160e01b600052603260045260246000fd5b60005b8381101561103d578181015183820152602001611025565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161107e816017850160208801611022565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516110af816028840160208801611022565b01602801949350505050565b60208152600082518060208401526110da816040850160208701611022565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176102cb576102cb6110ee565b808201808211156102cb576102cb6110ee565b60008161113d5761113d6110ee565b506000190190565b818103818111156102cb576102cb6110ee565b634e487b7160e01b600052603160045260246000fdfe5bea60102f2a7acc9e82b1af0e3bd4069661102bb5dd143a6051cd1980dded1ca264697066735822122024939a448abbecaf74c9f8ef1d3326da17dd252cccddf0ade66be800061b239364736f6c63430008170033", + "blockNumber": 5709352, + "bytecode": "0x608060405234801561001057600080fd5b5061001961001e565b6100de565b600254610100900460ff161561008a5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60025460ff90811610156100dc576002805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6111c4806100ed6000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c806391d14854116100a2578063caa6fea411610071578063caa6fea414610240578063d4b8399214610254578063d547741f1461026d578063dcf7bb5c14610280578063f82ec70b1461029357600080fd5b806391d148541461020a578063a217fddf1461021d578063b9f3163b14610225578063ca15c8731461022d57600080fd5b80636833f60d116100e95780636833f60d1461019c57806377a24f36146101a45780637a9ad019146101b75780637d4f7fc9146101cc5780639010d07c146101df57600080fd5b806301ffc9a71461011b578063248a9ca3146101435780632f2ff15d1461017457806336568abe14610189575b600080fd5b61012e610129366004610e11565b6102a6565b60405190151581526020015b60405180910390f35b610166610151366004610e3b565b60009081526020819052604090206001015490565b60405190815260200161013a565b610187610182366004610e79565b6102d1565b005b610187610197366004610e79565b6102fb565b61018761037e565b6101876101b2366004610ebf565b6104da565b61016660008051602061116f83398151915281565b6101876101da366004610fab565b610640565b6101f26101ed366004610fc8565b610663565b6040516001600160a01b03909116815260200161013a565b61012e610218366004610e79565b610682565b610166600081565b6101876106ab565b61016661023b366004610e3b565b610821565b60025461012e90600160b01b900460ff1681565b6002546101f2906201000090046001600160a01b031681565b61018761027b366004610e79565b610838565b61018761028e366004610fab565b61085d565b6101876102a1366004610fab565b610871565b60006001600160e01b03198216635a05180f60e01b14806102cb57506102cb82610894565b92915050565b6000828152602081905260409020600101546102ec816108c9565b6102f683836108d6565b505050565b6001600160a01b03811633146103705760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61037a82826108f8565b5050565b60008051602061116f833981519152610396816108c9565b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af11580156103e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040d9190610fea565b1561042b576040516310067f7560e11b815260040160405180910390fd5b60028054600160b01b60ff60b01b19909116179081905560408051638456cb5960e01b81529051620100009092046001600160a01b031691638456cb599160048082019260009290919082900301818387803b15801561048a57600080fd5b505af115801561049e573d6000803e3d6000fd5b50506040513381527fb8fad2fa0ed7a383e747c309ef2c4391d7b65592a48893e57ccc1fab70791456925060200190505b60405180910390a150565b600254610100900460ff16158080156104fa5750600254600160ff909116105b806105145750303b158015610514575060025460ff166001145b6105775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610367565b6002805460ff19166001179055801561059a576002805461ff0019166101001790555b6105a38461091a565b6105ae600084610972565b60005b82518110156105f3576105eb60008051602061116f8339815191528483815181106105de576105de61100c565b60200260200101516108d6565b6001016105b1565b50801561063a576002805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b600061064b816108c9565b61037a60008051602061116f833981519152836108d6565b600082815260016020526040812061067b908361097c565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008051602061116f8339815191526106c3816108c9565b600254600160b01b900460ff166106ed57604051631b2fd53f60e31b815260040160405180910390fd5b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610740573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107649190610fea565b61078157604051631e87b57b60e31b815260040160405180910390fd5b6002805460ff60b01b19169081905560408051631fa5d41d60e11b81529051620100009092046001600160a01b031691633f4ba83a9160048082019260009290919082900301818387803b1580156107d857600080fd5b505af11580156107ec573d6000803e3d6000fd5b50506040513381527ff5cbf596165cc457b2cd92e8d8450827ee314968160a5696402d75766fc52caf925060200190506104cf565b60008181526001602052604081206102cb90610988565b600082815260208190526040902060010154610853816108c9565b6102f683836108f8565b6000610868816108c9565b61037a8261091a565b600061087c816108c9565b61037a60008051602061116f833981519152836108f8565b60006001600160e01b03198216637965db0b60e01b14806102cb57506301ffc9a760e01b6001600160e01b03198316146102cb565b6108d38133610992565b50565b6108e082826109f6565b60008281526001602052604090206102f69082610a7a565b6109028282610a8f565b60008281526001602052604090206102f69082610af4565b6002805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040519081527f7f8cffd58ac96898bdd25ab64868bd933141d15ad1cd4a0df228fd3fcba2a26d906020016104cf565b61037a82826108d6565b600061067b8383610b09565b60006102cb825490565b61099c8282610682565b61037a576109b4816001600160a01b03166014610b33565b6109bf836020610b33565b6040516020016109d0929190611046565b60408051601f198184030181529082905262461bcd60e51b8252610367916004016110bb565b610a008282610682565b61037a576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610a363390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061067b836001600160a01b038416610ccf565b610a998282610682565b1561037a576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061067b836001600160a01b038416610d1e565b6000826000018281548110610b2057610b2061100c565b9060005260206000200154905092915050565b60606000610b42836002611104565b610b4d90600261111b565b67ffffffffffffffff811115610b6557610b65610ea9565b6040519080825280601f01601f191660200182016040528015610b8f576020820181803683370190505b509050600360fc1b81600081518110610baa57610baa61100c565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610bd957610bd961100c565b60200101906001600160f81b031916908160001a9053506000610bfd846002611104565b610c0890600161111b565b90505b6001811115610c80576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610c3c57610c3c61100c565b1a60f81b828281518110610c5257610c5261100c565b60200101906001600160f81b031916908160001a90535060049490941c93610c798161112e565b9050610c0b565b50831561067b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610367565b6000818152600183016020526040812054610d16575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556102cb565b5060006102cb565b60008181526001830160205260408120548015610e07576000610d42600183611145565b8554909150600090610d5690600190611145565b9050818114610dbb576000866000018281548110610d7657610d7661100c565b9060005260206000200154905080876000018481548110610d9957610d9961100c565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610dcc57610dcc611158565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506102cb565b60009150506102cb565b600060208284031215610e2357600080fd5b81356001600160e01b03198116811461067b57600080fd5b600060208284031215610e4d57600080fd5b5035919050565b6001600160a01b03811681146108d357600080fd5b8035610e7481610e54565b919050565b60008060408385031215610e8c57600080fd5b823591506020830135610e9e81610e54565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600060608486031215610ed457600080fd5b8335610edf81610e54565b9250602084810135610ef081610e54565b9250604085013567ffffffffffffffff80821115610f0d57600080fd5b818701915087601f830112610f2157600080fd5b813581811115610f3357610f33610ea9565b8060051b604051601f19603f83011681018181108582111715610f5857610f58610ea9565b60405291825284820192508381018501918a831115610f7657600080fd5b938501935b82851015610f9b57610f8c85610e69565b84529385019392850192610f7b565b8096505050505050509250925092565b600060208284031215610fbd57600080fd5b813561067b81610e54565b60008060408385031215610fdb57600080fd5b50508035926020909101359150565b600060208284031215610ffc57600080fd5b8151801515811461067b57600080fd5b634e487b7160e01b600052603260045260246000fd5b60005b8381101561103d578181015183820152602001611025565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161107e816017850160208801611022565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516110af816028840160208801611022565b01602801949350505050565b60208152600082518060208401526110da816040850160208701611022565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176102cb576102cb6110ee565b808201808211156102cb576102cb6110ee565b60008161113d5761113d6110ee565b506000190190565b818103818111156102cb576102cb6110ee565b634e487b7160e01b600052603160045260246000fdfe5bea60102f2a7acc9e82b1af0e3bd4069661102bb5dd143a6051cd1980dded1ca26469706673582212205cd579cff7903082498e437ed3eb21f8623bfa7f518ca2799b5e3497b22a08a864736f6c63430008170033", "chainId": 11155111, "contractAbsolutePath": "PauseEnforcer.sol", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101165760003560e01c806391d14854116100a2578063caa6fea411610071578063caa6fea414610240578063d4b8399214610254578063d547741f1461026d578063dcf7bb5c14610280578063f82ec70b1461029357600080fd5b806391d148541461020a578063a217fddf1461021d578063b9f3163b14610225578063ca15c8731461022d57600080fd5b80636833f60d116100e95780636833f60d1461019c57806377a24f36146101a45780637a9ad019146101b75780637d4f7fc9146101cc5780639010d07c146101df57600080fd5b806301ffc9a71461011b578063248a9ca3146101435780632f2ff15d1461017457806336568abe14610189575b600080fd5b61012e610129366004610e11565b6102a6565b60405190151581526020015b60405180910390f35b610166610151366004610e3b565b60009081526020819052604090206001015490565b60405190815260200161013a565b610187610182366004610e79565b6102d1565b005b610187610197366004610e79565b6102fb565b61018761037e565b6101876101b2366004610ebf565b6104da565b61016660008051602061116f83398151915281565b6101876101da366004610fab565b610640565b6101f26101ed366004610fc8565b610663565b6040516001600160a01b03909116815260200161013a565b61012e610218366004610e79565b610682565b610166600081565b6101876106ab565b61016661023b366004610e3b565b610821565b60025461012e90600160b01b900460ff1681565b6002546101f2906201000090046001600160a01b031681565b61018761027b366004610e79565b610838565b61018761028e366004610fab565b61085d565b6101876102a1366004610fab565b610871565b60006001600160e01b03198216635a05180f60e01b14806102cb57506102cb82610894565b92915050565b6000828152602081905260409020600101546102ec816108c9565b6102f683836108d6565b505050565b6001600160a01b03811633146103705760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61037a82826108f8565b5050565b60008051602061116f833981519152610396816108c9565b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af11580156103e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040d9190610fea565b1561042b576040516310067f7560e11b815260040160405180910390fd5b60028054600160b01b60ff60b01b19909116179081905560408051638456cb5960e01b81529051620100009092046001600160a01b031691638456cb599160048082019260009290919082900301818387803b15801561048a57600080fd5b505af115801561049e573d6000803e3d6000fd5b50506040513381527fb8fad2fa0ed7a383e747c309ef2c4391d7b65592a48893e57ccc1fab70791456925060200190505b60405180910390a150565b600254610100900460ff16158080156104fa5750600254600160ff909116105b806105145750303b158015610514575060025460ff166001145b6105775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610367565b6002805460ff19166001179055801561059a576002805461ff0019166101001790555b6105a38461091a565b6105ae600084610972565b60005b82518110156105f3576105eb60008051602061116f8339815191528483815181106105de576105de61100c565b60200260200101516108d6565b6001016105b1565b50801561063a576002805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b600061064b816108c9565b61037a60008051602061116f833981519152836108d6565b600082815260016020526040812061067b908361097c565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008051602061116f8339815191526106c3816108c9565b600254600160b01b900460ff166106ed57604051631b2fd53f60e31b815260040160405180910390fd5b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610740573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107649190610fea565b61078157604051631e87b57b60e31b815260040160405180910390fd5b6002805460ff60b01b19169081905560408051631fa5d41d60e11b81529051620100009092046001600160a01b031691633f4ba83a9160048082019260009290919082900301818387803b1580156107d857600080fd5b505af11580156107ec573d6000803e3d6000fd5b50506040513381527ff5cbf596165cc457b2cd92e8d8450827ee314968160a5696402d75766fc52caf925060200190506104cf565b60008181526001602052604081206102cb90610988565b600082815260208190526040902060010154610853816108c9565b6102f683836108f8565b6000610868816108c9565b61037a8261091a565b600061087c816108c9565b61037a60008051602061116f833981519152836108f8565b60006001600160e01b03198216637965db0b60e01b14806102cb57506301ffc9a760e01b6001600160e01b03198316146102cb565b6108d38133610992565b50565b6108e082826109f6565b60008281526001602052604090206102f69082610a7a565b6109028282610a8f565b60008281526001602052604090206102f69082610af4565b6002805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040519081527f7f8cffd58ac96898bdd25ab64868bd933141d15ad1cd4a0df228fd3fcba2a26d906020016104cf565b61037a82826108d6565b600061067b8383610b09565b60006102cb825490565b61099c8282610682565b61037a576109b4816001600160a01b03166014610b33565b6109bf836020610b33565b6040516020016109d0929190611046565b60408051601f198184030181529082905262461bcd60e51b8252610367916004016110bb565b610a008282610682565b61037a576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610a363390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061067b836001600160a01b038416610ccf565b610a998282610682565b1561037a576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061067b836001600160a01b038416610d1e565b6000826000018281548110610b2057610b2061100c565b9060005260206000200154905092915050565b60606000610b42836002611104565b610b4d90600261111b565b67ffffffffffffffff811115610b6557610b65610ea9565b6040519080825280601f01601f191660200182016040528015610b8f576020820181803683370190505b509050600360fc1b81600081518110610baa57610baa61100c565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610bd957610bd961100c565b60200101906001600160f81b031916908160001a9053506000610bfd846002611104565b610c0890600161111b565b90505b6001811115610c80576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610c3c57610c3c61100c565b1a60f81b828281518110610c5257610c5261100c565b60200101906001600160f81b031916908160001a90535060049490941c93610c798161112e565b9050610c0b565b50831561067b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610367565b6000818152600183016020526040812054610d16575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556102cb565b5060006102cb565b60008181526001830160205260408120548015610e07576000610d42600183611145565b8554909150600090610d5690600190611145565b9050818114610dbb576000866000018281548110610d7657610d7661100c565b9060005260206000200154905080876000018481548110610d9957610d9961100c565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610dcc57610dcc611158565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506102cb565b60009150506102cb565b600060208284031215610e2357600080fd5b81356001600160e01b03198116811461067b57600080fd5b600060208284031215610e4d57600080fd5b5035919050565b6001600160a01b03811681146108d357600080fd5b8035610e7481610e54565b919050565b60008060408385031215610e8c57600080fd5b823591506020830135610e9e81610e54565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600060608486031215610ed457600080fd5b8335610edf81610e54565b9250602084810135610ef081610e54565b9250604085013567ffffffffffffffff80821115610f0d57600080fd5b818701915087601f830112610f2157600080fd5b813581811115610f3357610f33610ea9565b8060051b604051601f19603f83011681018181108582111715610f5857610f58610ea9565b60405291825284820192508381018501918a831115610f7657600080fd5b938501935b82851015610f9b57610f8c85610e69565b84529385019392850192610f7b565b8096505050505050509250925092565b600060208284031215610fbd57600080fd5b813561067b81610e54565b60008060408385031215610fdb57600080fd5b50508035926020909101359150565b600060208284031215610ffc57600080fd5b8151801515811461067b57600080fd5b634e487b7160e01b600052603260045260246000fd5b60005b8381101561103d578181015183820152602001611025565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161107e816017850160208801611022565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516110af816028840160208801611022565b01602801949350505050565b60208152600082518060208401526110da816040850160208701611022565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176102cb576102cb6110ee565b808201808211156102cb576102cb6110ee565b60008161113d5761113d6110ee565b506000190190565b818103818111156102cb576102cb6110ee565b634e487b7160e01b600052603160045260246000fdfe5bea60102f2a7acc9e82b1af0e3bd4069661102bb5dd143a6051cd1980dded1ca264697066735822122024939a448abbecaf74c9f8ef1d3326da17dd252cccddf0ade66be800061b239364736f6c63430008170033", - "deployer": "0x31762cdd4Aa65CD6f5F09D7a05a56211720A1168", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101165760003560e01c806391d14854116100a2578063caa6fea411610071578063caa6fea414610240578063d4b8399214610254578063d547741f1461026d578063dcf7bb5c14610280578063f82ec70b1461029357600080fd5b806391d148541461020a578063a217fddf1461021d578063b9f3163b14610225578063ca15c8731461022d57600080fd5b80636833f60d116100e95780636833f60d1461019c57806377a24f36146101a45780637a9ad019146101b75780637d4f7fc9146101cc5780639010d07c146101df57600080fd5b806301ffc9a71461011b578063248a9ca3146101435780632f2ff15d1461017457806336568abe14610189575b600080fd5b61012e610129366004610e11565b6102a6565b60405190151581526020015b60405180910390f35b610166610151366004610e3b565b60009081526020819052604090206001015490565b60405190815260200161013a565b610187610182366004610e79565b6102d1565b005b610187610197366004610e79565b6102fb565b61018761037e565b6101876101b2366004610ebf565b6104da565b61016660008051602061116f83398151915281565b6101876101da366004610fab565b610640565b6101f26101ed366004610fc8565b610663565b6040516001600160a01b03909116815260200161013a565b61012e610218366004610e79565b610682565b610166600081565b6101876106ab565b61016661023b366004610e3b565b610821565b60025461012e90600160b01b900460ff1681565b6002546101f2906201000090046001600160a01b031681565b61018761027b366004610e79565b610838565b61018761028e366004610fab565b61085d565b6101876102a1366004610fab565b610871565b60006001600160e01b03198216635a05180f60e01b14806102cb57506102cb82610894565b92915050565b6000828152602081905260409020600101546102ec816108c9565b6102f683836108d6565b505050565b6001600160a01b03811633146103705760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61037a82826108f8565b5050565b60008051602061116f833981519152610396816108c9565b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af11580156103e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040d9190610fea565b1561042b576040516310067f7560e11b815260040160405180910390fd5b60028054600160b01b60ff60b01b19909116179081905560408051638456cb5960e01b81529051620100009092046001600160a01b031691638456cb599160048082019260009290919082900301818387803b15801561048a57600080fd5b505af115801561049e573d6000803e3d6000fd5b50506040513381527fb8fad2fa0ed7a383e747c309ef2c4391d7b65592a48893e57ccc1fab70791456925060200190505b60405180910390a150565b600254610100900460ff16158080156104fa5750600254600160ff909116105b806105145750303b158015610514575060025460ff166001145b6105775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610367565b6002805460ff19166001179055801561059a576002805461ff0019166101001790555b6105a38461091a565b6105ae600084610972565b60005b82518110156105f3576105eb60008051602061116f8339815191528483815181106105de576105de61100c565b60200260200101516108d6565b6001016105b1565b50801561063a576002805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b600061064b816108c9565b61037a60008051602061116f833981519152836108d6565b600082815260016020526040812061067b908361097c565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008051602061116f8339815191526106c3816108c9565b600254600160b01b900460ff166106ed57604051631b2fd53f60e31b815260040160405180910390fd5b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610740573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107649190610fea565b61078157604051631e87b57b60e31b815260040160405180910390fd5b6002805460ff60b01b19169081905560408051631fa5d41d60e11b81529051620100009092046001600160a01b031691633f4ba83a9160048082019260009290919082900301818387803b1580156107d857600080fd5b505af11580156107ec573d6000803e3d6000fd5b50506040513381527ff5cbf596165cc457b2cd92e8d8450827ee314968160a5696402d75766fc52caf925060200190506104cf565b60008181526001602052604081206102cb90610988565b600082815260208190526040902060010154610853816108c9565b6102f683836108f8565b6000610868816108c9565b61037a8261091a565b600061087c816108c9565b61037a60008051602061116f833981519152836108f8565b60006001600160e01b03198216637965db0b60e01b14806102cb57506301ffc9a760e01b6001600160e01b03198316146102cb565b6108d38133610992565b50565b6108e082826109f6565b60008281526001602052604090206102f69082610a7a565b6109028282610a8f565b60008281526001602052604090206102f69082610af4565b6002805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040519081527f7f8cffd58ac96898bdd25ab64868bd933141d15ad1cd4a0df228fd3fcba2a26d906020016104cf565b61037a82826108d6565b600061067b8383610b09565b60006102cb825490565b61099c8282610682565b61037a576109b4816001600160a01b03166014610b33565b6109bf836020610b33565b6040516020016109d0929190611046565b60408051601f198184030181529082905262461bcd60e51b8252610367916004016110bb565b610a008282610682565b61037a576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610a363390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061067b836001600160a01b038416610ccf565b610a998282610682565b1561037a576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061067b836001600160a01b038416610d1e565b6000826000018281548110610b2057610b2061100c565b9060005260206000200154905092915050565b60606000610b42836002611104565b610b4d90600261111b565b67ffffffffffffffff811115610b6557610b65610ea9565b6040519080825280601f01601f191660200182016040528015610b8f576020820181803683370190505b509050600360fc1b81600081518110610baa57610baa61100c565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610bd957610bd961100c565b60200101906001600160f81b031916908160001a9053506000610bfd846002611104565b610c0890600161111b565b90505b6001811115610c80576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610c3c57610c3c61100c565b1a60f81b828281518110610c5257610c5261100c565b60200101906001600160f81b031916908160001a90535060049490941c93610c798161112e565b9050610c0b565b50831561067b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610367565b6000818152600183016020526040812054610d16575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556102cb565b5060006102cb565b60008181526001830160205260408120548015610e07576000610d42600183611145565b8554909150600090610d5690600190611145565b9050818114610dbb576000866000018281548110610d7657610d7661100c565b9060005260206000200154905080876000018481548110610d9957610d9961100c565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610dcc57610dcc611158565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506102cb565b60009150506102cb565b600060208284031215610e2357600080fd5b81356001600160e01b03198116811461067b57600080fd5b600060208284031215610e4d57600080fd5b5035919050565b6001600160a01b03811681146108d357600080fd5b8035610e7481610e54565b919050565b60008060408385031215610e8c57600080fd5b823591506020830135610e9e81610e54565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600060608486031215610ed457600080fd5b8335610edf81610e54565b9250602084810135610ef081610e54565b9250604085013567ffffffffffffffff80821115610f0d57600080fd5b818701915087601f830112610f2157600080fd5b813581811115610f3357610f33610ea9565b8060051b604051601f19603f83011681018181108582111715610f5857610f58610ea9565b60405291825284820192508381018501918a831115610f7657600080fd5b938501935b82851015610f9b57610f8c85610e69565b84529385019392850192610f7b565b8096505050505050509250925092565b600060208284031215610fbd57600080fd5b813561067b81610e54565b60008060408385031215610fdb57600080fd5b50508035926020909101359150565b600060208284031215610ffc57600080fd5b8151801515811461067b57600080fd5b634e487b7160e01b600052603260045260246000fd5b60005b8381101561103d578181015183820152602001611025565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161107e816017850160208801611022565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516110af816028840160208801611022565b01602801949350505050565b60208152600082518060208401526110da816040850160208701611022565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176102cb576102cb6110ee565b808201808211156102cb576102cb6110ee565b60008161113d5761113d6110ee565b506000190190565b818103818111156102cb576102cb6110ee565b634e487b7160e01b600052603160045260246000fdfe5bea60102f2a7acc9e82b1af0e3bd4069661102bb5dd143a6051cd1980dded1ca26469706673582212205cd579cff7903082498e437ed3eb21f8623bfa7f518ca2799b5e3497b22a08a864736f6c63430008170033", + "deployer": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", "devdoc": { "version": 1, "kind": "dev", @@ -533,29 +533,29 @@ } }, "isFoundry": true, - "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ErrNotOnEmergencyPause\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrTargetIsNotOnPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrTargetIsOnPaused\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"EmergencyPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"EmergencyUnpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IPauseTarget\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"TargetChanged\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SENTRY_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPauseTarget\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"changeTarget\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"emergency\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getRoleMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleMemberCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sentry\",\"type\":\"address\"}],\"name\":\"grantSentry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPauseTarget\",\"name\":\"_target\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_admin\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"_sentries\",\"type\":\"address[]\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sentry\",\"type\":\"address\"}],\"name\":\"revokeSentry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"target\",\"outputs\":[{\"internalType\":\"contract IPauseTarget\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"triggerPause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"triggerUnpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"ErrNotOnEmergencyPause()\":[{\"details\":\"Error thrown when the contract is not on emergency pause.\"}],\"ErrTargetIsNotOnPaused()\":[{\"details\":\"Error thrown when the target is not on paused state.\"}],\"ErrTargetIsOnPaused()\":[{\"details\":\"Error thrown when the target is already on paused state.\"}]},\"events\":{\"EmergencyPaused(address)\":{\"details\":\"Emitted when the emergency ppause is triggered by `account`.\"},\"EmergencyUnpaused(address)\":{\"details\":\"Emitted when the emergency unpause is triggered by `account`.\"},\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"RoleAdminChanged(bytes32,bytes32,bytes32)\":{\"details\":\"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this. _Available since v3.1._\"},\"RoleGranted(bytes32,address,address)\":{\"details\":\"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.\"},\"RoleRevoked(bytes32,address,address)\":{\"details\":\"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)\"},\"TargetChanged(address)\":{\"details\":\"Emitted when the target is changed.\"}},\"kind\":\"dev\",\"methods\":{\"changeTarget(address)\":{\"details\":\"Setter for `target`. Requirements: - Only admin can call this method.\"},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"getRoleMember(bytes32,uint256)\":{\"details\":\"Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.\"},\"getRoleMemberCount(bytes32)\":{\"details\":\"Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"grantSentry(address)\":{\"details\":\"Grants the SENTRY_ROLE to the specified address.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"initialize(address,address,address[])\":{\"details\":\"Initializes the contract storage.\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`. May emit a {RoleRevoked} event.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"revokeSentry(address)\":{\"details\":\"Revokes the SENTRY_ROLE from the specified address.\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"},\"triggerPause()\":{\"details\":\"Triggers a pause on the target contract. Requirements: - Only be called by accounts with the SENTRY_ROLE, - The target contract is not already paused.\"},\"triggerUnpause()\":{\"details\":\"Triggers an unpause on the target contract. Requirements: - Only be called by accounts with the SENTRY_ROLE, - The target contract is already paused. - The target contract is paused in emergency mode.\"}},\"stateVariables\":{\"emergency\":{\"details\":\"Indicating whether or not the target contract is paused in emergency mode.\"},\"target\":{\"details\":\"The contract that can be paused or unpaused by the SENTRY_ROLE.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/ronin/gateway/PauseEnforcer.sol\":\"PauseEnforcer\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@openzeppelin/=lib/openzeppelin-contracts/\",\":@prb/math/=lib/prb-math/\",\":@prb/test/=lib/prb-test/src/\",\":@ronin/contracts/=src/\",\":@ronin/script/=script/\",\":@ronin/test/=test/\",\":contract-libs/=lib/foundry-deployment-kit/lib/contract-libs/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":foundry-deployment-kit/=lib/foundry-deployment-kit/script/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/contracts/\",\":prb-math/=lib/prb-math/src/\",\":prb-test/=lib/prb-test/src/\",\":solady/=lib/solady/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/access/AccessControl.sol\":{\"keccak256\":\"0x5b35d8e68aeaccc685239bd9dd79b9ba01a0357930f8a3307ab85511733d9724\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ba8eb2d22f9321bd4660f6617c181d9611ff30a9b089408b8c6e2216d6d5cdc5\",\"dweb:/ipfs/QmTSJvhjHfnUV1j4hsqDv8PmLvGBLRs9gHLjTUXrUJ5Y9q\"]},\"lib/openzeppelin-contracts/contracts/access/AccessControlEnumerable.sol\":{\"keccak256\":\"0x13f5e15f2a0650c0b6aaee2ef19e89eaf4870d6e79662d572a393334c1397247\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://7ee05f28f549a5d6515e152580716b87636ed4bfab9812499a6e3803df88288b\",\"dweb:/ipfs/QmeEnhdwY1t5Y3YU5a4ffzgXuToydH2PNdNxV9W7dEPRQJ\"]},\"lib/openzeppelin-contracts/contracts/access/IAccessControl.sol\":{\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bb2c137c343ef0c4c7ce7b18c1d108afdc9d315a04e48307288d2d05adcbde3a\",\"dweb:/ipfs/QmUxhrAQM3MM3FF5j7AtcXLXguWCJBHJ14BRdVtuoQc8Fh\"]},\"lib/openzeppelin-contracts/contracts/access/IAccessControlEnumerable.sol\":{\"keccak256\":\"0xba4459ab871dfa300f5212c6c30178b63898c03533a1ede28436f11546626676\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://3dcc7b09bfa6e18aab262ca372f4a9b1fc82e294b430706a4e1378cf58e6a276\",\"dweb:/ipfs/QmT8oSAcesdctR15HMLhr2a1HRpXymxdjTfdtfTYJcj2N2\"]},\"lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol\":{\"keccak256\":\"0x2a21b14ff90012878752f230d3ffd5c3405e5938d06c97a7d89c0a64561d0d66\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://3313a8f9bb1f9476857c9050067b31982bf2140b83d84f3bc0cec1f62bbe947f\",\"dweb:/ipfs/Qma17Pk8NRe7aB4UD3jjVxk7nSFaov3eQyv86hcyqkwJRV\"]},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://35c47bece3c03caaa07fab37dd2bb3413bfbca20db7bd9895024390e0a469487\",\"dweb:/ipfs/QmPGWT2x3QHcKxqe6gRmAkdakhbaRgx3DLzcakHz5M4eXG\"]},\"lib/openzeppelin-contracts/contracts/utils/Context.sol\":{\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6df0ddf21ce9f58271bdfaa85cde98b200ef242a05a3f85c2bc10a8294800a92\",\"dweb:/ipfs/QmRK2Y5Yc6BK7tGKkgsgn3aJEQGi5aakeSPZvS65PV8Xp3\"]},\"lib/openzeppelin-contracts/contracts/utils/Strings.sol\":{\"keccak256\":\"0xaf159a8b1923ad2a26d516089bceca9bdeaeacd04be50983ea00ba63070f08a3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6f2cf1c531122bc7ca96b8c8db6a60deae60441e5223065e792553d4849b5638\",\"dweb:/ipfs/QmPBdJmBBABMDCfyDjCbdxgiqRavgiSL88SYPGibgbPas9\"]},\"lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol\":{\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://fb0048dee081f6fffa5f74afc3fb328483c2a30504e94a0ddd2a5114d731ec4d\",\"dweb:/ipfs/QmZptt1nmYoA5SgjwnSgWqgUSDgm4q52Yos3xhnMv3MV43\"]},\"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol\":{\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://be161e54f24e5c6fae81a12db1a8ae87bc5ae1b0ddc805d82a1440a68455088f\",\"dweb:/ipfs/QmP7C3CHdY9urF4dEMb9wmsp1wMxHF6nhA2yQE5SKiPAdy\"]},\"lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol\":{\"keccak256\":\"0x5050943b32b6a8f282573d166b2e9d87ab7eb4dbba4ab6acf36ecb54fe6995e4\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d4831d777a29ebdf9f2caecd70e74b97bff1b70e53622fd0a02aed01e21c8271\",\"dweb:/ipfs/QmUqurVVnCc7XkMxb2k23TVQUtuhHZduJ3hTZarTJrqU24\"]},\"src/interfaces/IPauseTarget.sol\":{\"keccak256\":\"0xc91073e61da572de0087b41018fd30b03661d58e0c5061e7b9d1c9235cd7c1c3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://0800b40eb3f323d0e450ca7e47f1eb68518d0bc71a4143d6026bf5ad8c9814a6\",\"dweb:/ipfs/QmeJS39F9UTNo9cFhbfgiYDNfvuMKMFnM8XHrj9x3iqbjo\"]},\"src/ronin/gateway/PauseEnforcer.sol\":{\"keccak256\":\"0x22412c51c9877e24696d4bf2e0ce86c2cd2a27c6dbd2633e6e9843f720d960e1\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ff67aa9238c6f93a5722607b92fc5c9b4acf634d16acafe078d973784723eba8\",\"dweb:/ipfs/QmcxFuocVK5tnSkDvs7VMBZaFp3YCFLSFzrpNmqG98cCEo\"]}},\"version\":1}", - "nonce": 0, - "numDeployments": 1, + "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ErrNotOnEmergencyPause\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrTargetIsNotOnPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrTargetIsOnPaused\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"EmergencyPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"EmergencyUnpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IPauseTarget\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"TargetChanged\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SENTRY_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPauseTarget\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"changeTarget\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"emergency\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getRoleMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleMemberCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sentry\",\"type\":\"address\"}],\"name\":\"grantSentry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPauseTarget\",\"name\":\"_target\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_admin\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"_sentries\",\"type\":\"address[]\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sentry\",\"type\":\"address\"}],\"name\":\"revokeSentry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"target\",\"outputs\":[{\"internalType\":\"contract IPauseTarget\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"triggerPause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"triggerUnpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"ErrNotOnEmergencyPause()\":[{\"details\":\"Error thrown when the contract is not on emergency pause.\"}],\"ErrTargetIsNotOnPaused()\":[{\"details\":\"Error thrown when the target is not on paused state.\"}],\"ErrTargetIsOnPaused()\":[{\"details\":\"Error thrown when the target is already on paused state.\"}]},\"events\":{\"EmergencyPaused(address)\":{\"details\":\"Emitted when the emergency ppause is triggered by `account`.\"},\"EmergencyUnpaused(address)\":{\"details\":\"Emitted when the emergency unpause is triggered by `account`.\"},\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"RoleAdminChanged(bytes32,bytes32,bytes32)\":{\"details\":\"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this. _Available since v3.1._\"},\"RoleGranted(bytes32,address,address)\":{\"details\":\"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.\"},\"RoleRevoked(bytes32,address,address)\":{\"details\":\"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)\"},\"TargetChanged(address)\":{\"details\":\"Emitted when the target is changed.\"}},\"kind\":\"dev\",\"methods\":{\"changeTarget(address)\":{\"details\":\"Setter for `target`. Requirements: - Only admin can call this method.\"},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"getRoleMember(bytes32,uint256)\":{\"details\":\"Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.\"},\"getRoleMemberCount(bytes32)\":{\"details\":\"Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"grantSentry(address)\":{\"details\":\"Grants the SENTRY_ROLE to the specified address.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"initialize(address,address,address[])\":{\"details\":\"Initializes the contract storage.\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`. May emit a {RoleRevoked} event.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"revokeSentry(address)\":{\"details\":\"Revokes the SENTRY_ROLE from the specified address.\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"},\"triggerPause()\":{\"details\":\"Triggers a pause on the target contract. Requirements: - Only be called by accounts with the SENTRY_ROLE, - The target contract is not already paused.\"},\"triggerUnpause()\":{\"details\":\"Triggers an unpause on the target contract. Requirements: - Only be called by accounts with the SENTRY_ROLE, - The target contract is already paused. - The target contract is paused in emergency mode.\"}},\"stateVariables\":{\"emergency\":{\"details\":\"Indicating whether or not the target contract is paused in emergency mode.\"},\"target\":{\"details\":\"The contract that can be paused or unpaused by the SENTRY_ROLE.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/ronin/gateway/PauseEnforcer.sol\":\"PauseEnforcer\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@fdk/=lib/foundry-deployment-kit/script/\",\":@openzeppelin/=lib/openzeppelin-contracts/\",\":@prb/math/=lib/prb-math/\",\":@prb/test/=lib/prb-test/src/\",\":@ronin/contracts/=src/\",\":@ronin/script/=script/\",\":@ronin/test/=test/\",\":contract-libs/=lib/foundry-deployment-kit/lib/contract-libs/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/foundry-deployment-kit/lib/forge-std/src/\",\":foundry-deployment-kit/=lib/foundry-deployment-kit/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/contracts/\",\":prb-math/=lib/prb-math/src/\",\":prb-test/=lib/prb-test/src/\",\":solady/=lib/solady/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/access/AccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\nimport \\\"../utils/Context.sol\\\";\\nimport \\\"../utils/Strings.sol\\\";\\nimport \\\"../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it.\\n */\\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\\n struct RoleData {\\n mapping(address => bool) members;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with a standardized message including the required role.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n *\\n * _Available since v4.1._\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role);\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\\n return _roles[role].members[account];\\n }\\n\\n /**\\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\\n * Overriding this function changes the behavior of the {onlyRole} modifier.\\n *\\n * Format of the revert message is described in {_checkRole}.\\n *\\n * _Available since v4.6._\\n */\\n function _checkRole(bytes32 role) internal view virtual {\\n _checkRole(role, _msgSender());\\n }\\n\\n /**\\n * @dev Revert with a standard message if `account` is missing `role`.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert(\\n string(\\n abi.encodePacked(\\n \\\"AccessControl: account \\\",\\n Strings.toHexString(uint160(account), 20),\\n \\\" is missing role \\\",\\n Strings.toHexString(uint256(role), 32)\\n )\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function renounceRole(bytes32 role, address account) public virtual override {\\n require(account == _msgSender(), \\\"AccessControl: can only renounce roles for self\\\");\\n\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event. Note that unlike {grantRole}, this function doesn't perform any\\n * checks on the calling account.\\n *\\n * May emit a {RoleGranted} event.\\n *\\n * [WARNING]\\n * ====\\n * This function should only be called from the constructor when setting\\n * up the initial roles for the system.\\n *\\n * Using this function in any other way is effectively circumventing the admin\\n * system imposed by {AccessControl}.\\n * ====\\n *\\n * NOTE: This function is deprecated in favor of {_grantRole}.\\n */\\n function _setupRole(bytes32 role, address account) internal virtual {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual {\\n if (!hasRole(role, account)) {\\n _roles[role].members[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n }\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual {\\n if (hasRole(role, account)) {\\n _roles[role].members[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5b35d8e68aeaccc685239bd9dd79b9ba01a0357930f8a3307ab85511733d9724\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/access/AccessControlEnumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlEnumerable.sol\\\";\\nimport \\\"./AccessControl.sol\\\";\\nimport \\\"../utils/structs/EnumerableSet.sol\\\";\\n\\n/**\\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\\n */\\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {\\n return _roleMembers[role].at(index);\\n }\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {\\n return _roleMembers[role].length();\\n }\\n\\n /**\\n * @dev Overload {_grantRole} to track enumerable memberships\\n */\\n function _grantRole(bytes32 role, address account) internal virtual override {\\n super._grantRole(role, account);\\n _roleMembers[role].add(account);\\n }\\n\\n /**\\n * @dev Overload {_revokeRole} to track enumerable memberships\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual override {\\n super._revokeRole(role, account);\\n _roleMembers[role].remove(account);\\n }\\n}\\n\",\"keccak256\":\"0x13f5e15f2a0650c0b6aaee2ef19e89eaf4870d6e79662d572a393334c1397247\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/access/IAccessControlEnumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\n\\n/**\\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\\n */\\ninterface IAccessControlEnumerable is IAccessControl {\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xba4459ab871dfa300f5212c6c30178b63898c03533a1ede28436f11546626676\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2a21b14ff90012878752f230d3ffd5c3405e5938d06c97a7d89c0a64561d0d66\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _HEX_SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n // Inspired by OraclizeAPI's implementation - MIT licence\\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\\n\\n if (value == 0) {\\n return \\\"0\\\";\\n }\\n uint256 temp = value;\\n uint256 digits;\\n while (temp != 0) {\\n digits++;\\n temp /= 10;\\n }\\n bytes memory buffer = new bytes(digits);\\n while (value != 0) {\\n digits -= 1;\\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\\n value /= 10;\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n if (value == 0) {\\n return \\\"0x00\\\";\\n }\\n uint256 temp = value;\\n uint256 length = 0;\\n while (temp != 0) {\\n length++;\\n temp >>= 8;\\n }\\n return toHexString(value, length);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xaf159a8b1923ad2a26d516089bceca9bdeaeacd04be50983ea00ba63070f08a3\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n *\\n * [WARNING]\\n * ====\\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.\\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\\n *\\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.\\n * ====\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n bytes32 lastValue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastValue;\\n // Update the index for the moved value\\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n return set._values[index];\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function _values(Set storage set) private view returns (bytes32[] memory) {\\n return set._values;\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\\n return _values(set._inner);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(AddressSet storage set) internal view returns (address[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n address[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(UintSet storage set) internal view returns (uint256[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n uint256[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0x5050943b32b6a8f282573d166b2e9d87ab7eb4dbba4ab6acf36ecb54fe6995e4\",\"license\":\"MIT\"},\"src/interfaces/IPauseTarget.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IPauseTarget {\\n function pause() external;\\n\\n function unpause() external;\\n\\n function paused() external returns (bool);\\n}\\n\",\"keccak256\":\"0xc91073e61da572de0087b41018fd30b03661d58e0c5061e7b9d1c9235cd7c1c3\",\"license\":\"MIT\"},\"src/ronin/gateway/PauseEnforcer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/access/AccessControlEnumerable.sol\\\";\\nimport \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport \\\"../../interfaces/IPauseTarget.sol\\\";\\n\\ncontract PauseEnforcer is AccessControlEnumerable, Initializable {\\n /**\\n * @dev Error thrown when the target is already on paused state.\\n */\\n error ErrTargetIsOnPaused();\\n\\n /**\\n * @dev Error thrown when the target is not on paused state.\\n */\\n error ErrTargetIsNotOnPaused();\\n\\n /**\\n * @dev Error thrown when the contract is not on emergency pause.\\n */\\n error ErrNotOnEmergencyPause();\\n\\n bytes32 public constant SENTRY_ROLE = keccak256(\\\"SENTRY_ROLE\\\");\\n\\n /// @dev The contract that can be paused or unpaused by the SENTRY_ROLE.\\n IPauseTarget public target;\\n /// @dev Indicating whether or not the target contract is paused in emergency mode.\\n bool public emergency;\\n\\n /// @dev Emitted when the emergency ppause is triggered by `account`.\\n event EmergencyPaused(address account);\\n /// @dev Emitted when the emergency unpause is triggered by `account`.\\n event EmergencyUnpaused(address account);\\n /// @dev Emitted when the target is changed.\\n event TargetChanged(IPauseTarget target);\\n\\n modifier onEmergency() {\\n if (!emergency) revert ErrNotOnEmergencyPause();\\n\\n _;\\n }\\n\\n modifier targetPaused() {\\n if (!target.paused()) revert ErrTargetIsOnPaused();\\n\\n _;\\n }\\n\\n modifier targetNotPaused() {\\n if (target.paused()) revert ErrTargetIsNotOnPaused();\\n\\n _;\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /**\\n * @dev Initializes the contract storage.\\n */\\n function initialize(IPauseTarget _target, address _admin, address[] memory _sentries) external initializer {\\n _changeTarget(_target);\\n _setupRole(DEFAULT_ADMIN_ROLE, _admin);\\n for (uint _i; _i < _sentries.length;) {\\n _grantRole(SENTRY_ROLE, _sentries[_i]);\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n }\\n\\n /**\\n * @dev Grants the SENTRY_ROLE to the specified address.\\n */\\n function grantSentry(address _sentry) external onlyRole(DEFAULT_ADMIN_ROLE) {\\n _grantRole(SENTRY_ROLE, _sentry);\\n }\\n\\n /**\\n * @dev Revokes the SENTRY_ROLE from the specified address.\\n */\\n function revokeSentry(address _sentry) external onlyRole(DEFAULT_ADMIN_ROLE) {\\n _revokeRole(SENTRY_ROLE, _sentry);\\n }\\n\\n /**\\n * @dev Triggers a pause on the target contract.\\n *\\n * Requirements:\\n * - Only be called by accounts with the SENTRY_ROLE,\\n * - The target contract is not already paused.\\n */\\n function triggerPause() external onlyRole(SENTRY_ROLE) targetNotPaused {\\n emergency = true;\\n target.pause();\\n emit EmergencyPaused(msg.sender);\\n }\\n\\n /**\\n * @dev Triggers an unpause on the target contract.\\n *\\n * Requirements:\\n * - Only be called by accounts with the SENTRY_ROLE,\\n * - The target contract is already paused.\\n * - The target contract is paused in emergency mode.\\n */\\n function triggerUnpause() external onlyRole(SENTRY_ROLE) onEmergency targetPaused {\\n emergency = false;\\n target.unpause();\\n emit EmergencyUnpaused(msg.sender);\\n }\\n\\n /**\\n * @dev Setter for `target`.\\n *\\n * Requirements:\\n * - Only admin can call this method.\\n */\\n function changeTarget(IPauseTarget _target) external onlyRole(DEFAULT_ADMIN_ROLE) {\\n _changeTarget(_target);\\n }\\n\\n /**\\n * @dev Internal helper for setting value to `target`.\\n */\\n function _changeTarget(IPauseTarget _target) internal {\\n target = _target;\\n emit TargetChanged(_target);\\n }\\n}\\n\",\"keccak256\":\"0x4a758f6cc62826d0f513903df7cf9e63a5bbd7420d3f8349595fabea346beb37\",\"license\":\"MIT\"}},\"version\":1}", + "nonce": 27, + "numDeployments": 2, "storageLayout": { "storage": [ { - "astId": 102425, + "astId": 56841, "contract": "src/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", "label": "_roles", "offset": 0, "slot": "0", - "type": "t_mapping(t_bytes32,t_struct(RoleData)102420_storage)" + "type": "t_mapping(t_bytes32,t_struct(RoleData)56836_storage)" }, { - "astId": 102739, + "astId": 57155, "contract": "src/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", "label": "_roleMembers", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(AddressSet)106833_storage)" + "type": "t_mapping(t_bytes32,t_struct(AddressSet)64060_storage)" }, { - "astId": 103525, + "astId": 58190, "contract": "src/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", "label": "_initialized", "offset": 0, @@ -563,7 +563,7 @@ "type": "t_uint8" }, { - "astId": 103528, + "astId": 58193, "contract": "src/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", "label": "_initializing", "offset": 1, @@ -571,15 +571,15 @@ "type": "t_bool" }, { - "astId": 147977, + "astId": 121661, "contract": "src/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", "label": "target", "offset": 2, "slot": "2", - "type": "t_contract(IPauseTarget)138692" + "type": "t_contract(IPauseTarget)110573" }, { - "astId": 147980, + "astId": 121664, "contract": "src/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", "label": "emergency", "offset": 22, @@ -609,7 +609,7 @@ "label": "bytes32", "numberOfBytes": "32" }, - "t_contract(IPauseTarget)138692": { + "t_contract(IPauseTarget)110573": { "encoding": "inplace", "label": "contract IPauseTarget", "numberOfBytes": "20" @@ -621,19 +621,19 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_struct(AddressSet)106833_storage)": { + "t_mapping(t_bytes32,t_struct(AddressSet)64060_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct EnumerableSet.AddressSet)", "numberOfBytes": "32", - "value": "t_struct(AddressSet)106833_storage" + "value": "t_struct(AddressSet)64060_storage" }, - "t_mapping(t_bytes32,t_struct(RoleData)102420_storage)": { + "t_mapping(t_bytes32,t_struct(RoleData)56836_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct AccessControl.RoleData)", "numberOfBytes": "32", - "value": "t_struct(RoleData)102420_storage" + "value": "t_struct(RoleData)56836_storage" }, "t_mapping(t_bytes32,t_uint256)": { "encoding": "mapping", @@ -642,28 +642,28 @@ "numberOfBytes": "32", "value": "t_uint256" }, - "t_struct(AddressSet)106833_storage": { + "t_struct(AddressSet)64060_storage": { "encoding": "inplace", "label": "struct EnumerableSet.AddressSet", "numberOfBytes": "64", "members": [ { - "astId": 106832, + "astId": 64059, "contract": "src/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", "label": "_inner", "offset": 0, "slot": "0", - "type": "t_struct(Set)106532_storage" + "type": "t_struct(Set)63759_storage" } ] }, - "t_struct(RoleData)102420_storage": { + "t_struct(RoleData)56836_storage": { "encoding": "inplace", "label": "struct AccessControl.RoleData", "numberOfBytes": "64", "members": [ { - "astId": 102417, + "astId": 56833, "contract": "src/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", "label": "members", "offset": 0, @@ -671,7 +671,7 @@ "type": "t_mapping(t_address,t_bool)" }, { - "astId": 102419, + "astId": 56835, "contract": "src/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", "label": "adminRole", "offset": 0, @@ -680,13 +680,13 @@ } ] }, - "t_struct(Set)106532_storage": { + "t_struct(Set)63759_storage": { "encoding": "inplace", "label": "struct EnumerableSet.Set", "numberOfBytes": "64", "members": [ { - "astId": 106527, + "astId": 63754, "contract": "src/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", "label": "_values", "offset": 0, @@ -694,7 +694,7 @@ "type": "t_array(t_bytes32)dyn_storage" }, { - "astId": 106531, + "astId": 63758, "contract": "src/ronin/gateway/PauseEnforcer.sol:PauseEnforcer", "label": "_indexes", "offset": 0, @@ -715,7 +715,7 @@ } } }, - "timestamp": 1712300364, + "timestamp": 1713254676, "userdoc": { "version": 1, "kind": "user" diff --git a/deployments/sepolia/MainchainGatewayV3Logic.json b/deployments/sepolia/MainchainGatewayV3Logic.json index a805d2f1..984952fa 100644 --- a/deployments/sepolia/MainchainGatewayV3Logic.json +++ b/deployments/sepolia/MainchainGatewayV3Logic.json @@ -1,5 +1,10 @@ { "abi": [ + { + "type": "constructor", + "inputs": [], + "stateMutability": "nonpayable" + }, { "type": "fallback", "stateMutability": "payable" @@ -247,21 +252,21 @@ "name": "getRoninToken", "inputs": [ { - "name": "_mainchainToken", + "name": "mainchainToken", "type": "address", "internalType": "address" } ], "outputs": [ { - "name": "_token", + "name": "token", "type": "tuple", "internalType": "struct MappedTokenConsumer.MappedToken", "components": [ { "name": "erc", "type": "uint8", - "internalType": "enum Token.Standard" + "internalType": "enum TokenStandard" }, { "name": "tokenAddr", @@ -399,7 +404,7 @@ { "name": "_standards", "type": "uint8[]", - "internalType": "enum Token.Standard[]" + "internalType": "enum TokenStandard[]" } ], "outputs": [], @@ -418,6 +423,26 @@ "outputs": [], "stateMutability": "nonpayable" }, + { + "type": "function", + "name": "initializeV3", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "initializeV4", + "inputs": [ + { + "name": "wethUnwrapper_", + "type": "address", + "internalType": "address payable" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "lastDateSynced", @@ -492,7 +517,7 @@ { "name": "_standards", "type": "uint8[]", - "internalType": "enum Token.Standard[]" + "internalType": "enum TokenStandard[]" } ], "outputs": [], @@ -515,7 +540,7 @@ { "name": "_standards", "type": "uint8[]", - "internalType": "enum Token.Standard[]" + "internalType": "enum TokenStandard[]" }, { "name": "_thresholds", @@ -552,6 +577,137 @@ ], "stateMutability": "view" }, + { + "type": "function", + "name": "onBridgeOperatorsAdded", + "inputs": [ + { + "name": "operators", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "weights", + "type": "uint96[]", + "internalType": "uint96[]" + }, + { + "name": "addeds", + "type": "bool[]", + "internalType": "bool[]" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes4", + "internalType": "bytes4" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "onBridgeOperatorsRemoved", + "inputs": [ + { + "name": "operators", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "removeds", + "type": "bool[]", + "internalType": "bool[]" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes4", + "internalType": "bytes4" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "onERC1155BatchReceived", + "inputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + }, + { + "name": "", + "type": "address", + "internalType": "address" + }, + { + "name": "", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes4", + "internalType": "bytes4" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "onERC1155Received", + "inputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + }, + { + "name": "", + "type": "address", + "internalType": "address" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes4", + "internalType": "bytes4" + } + ], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "pause", @@ -643,12 +799,12 @@ { "name": "info", "type": "tuple", - "internalType": "struct Token.Info", + "internalType": "struct TokenInfo", "components": [ { "name": "erc", "type": "uint8", - "internalType": "enum Token.Standard" + "internalType": "enum TokenStandard" }, { "name": "id", @@ -818,28 +974,17 @@ "name": "setThreshold", "inputs": [ { - "name": "_numerator", + "name": "num", "type": "uint256", "internalType": "uint256" }, { - "name": "_denominator", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "_previousNum", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "_previousDenom", + "name": "denom", "type": "uint256", "internalType": "uint256" } ], + "outputs": [], "stateMutability": "nonpayable" }, { @@ -895,7 +1040,7 @@ { "name": "mainchain", "type": "tuple", - "internalType": "struct Token.Owner", + "internalType": "struct TokenOwner", "components": [ { "name": "addr", @@ -917,7 +1062,7 @@ { "name": "ronin", "type": "tuple", - "internalType": "struct Token.Owner", + "internalType": "struct TokenOwner", "components": [ { "name": "addr", @@ -939,12 +1084,12 @@ { "name": "info", "type": "tuple", - "internalType": "struct Token.Info", + "internalType": "struct TokenInfo", "components": [ { "name": "erc", "type": "uint8", - "internalType": "enum Token.Standard" + "internalType": "enum TokenStandard" }, { "name": "id", @@ -1035,7 +1180,7 @@ "name": "unlockWithdrawal", "inputs": [ { - "name": "_receipt", + "name": "receipt", "type": "tuple", "internalType": "struct Transfer.Receipt", "components": [ @@ -1052,7 +1197,7 @@ { "name": "mainchain", "type": "tuple", - "internalType": "struct Token.Owner", + "internalType": "struct TokenOwner", "components": [ { "name": "addr", @@ -1074,7 +1219,7 @@ { "name": "ronin", "type": "tuple", - "internalType": "struct Token.Owner", + "internalType": "struct TokenOwner", "components": [ { "name": "addr", @@ -1096,12 +1241,12 @@ { "name": "info", "type": "tuple", - "internalType": "struct Token.Info", + "internalType": "struct TokenInfo", "components": [ { "name": "erc", "type": "uint8", - "internalType": "enum Token.Standard" + "internalType": "enum TokenStandard" }, { "name": "id", @@ -1128,6 +1273,19 @@ "outputs": [], "stateMutability": "nonpayable" }, + { + "type": "function", + "name": "wethUnwrapper", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract WethUnwrapper" + } + ], + "stateMutability": "view" + }, { "type": "function", "name": "withdrawalHash", @@ -1246,7 +1404,7 @@ { "name": "mainchain", "type": "tuple", - "internalType": "struct Token.Owner", + "internalType": "struct TokenOwner", "components": [ { "name": "addr", @@ -1268,7 +1426,7 @@ { "name": "ronin", "type": "tuple", - "internalType": "struct Token.Owner", + "internalType": "struct TokenOwner", "components": [ { "name": "addr", @@ -1290,12 +1448,12 @@ { "name": "info", "type": "tuple", - "internalType": "struct Token.Info", + "internalType": "struct TokenInfo", "components": [ { "name": "erc", "type": "uint8", - "internalType": "enum Token.Standard" + "internalType": "enum TokenStandard" }, { "name": "id", @@ -1547,7 +1705,7 @@ "name": "standards", "type": "uint8[]", "indexed": false, - "internalType": "enum Token.Standard[]" + "internalType": "enum TokenStandard[]" } ], "anonymous": false @@ -1613,7 +1771,7 @@ { "name": "mainchain", "type": "tuple", - "internalType": "struct Token.Owner", + "internalType": "struct TokenOwner", "components": [ { "name": "addr", @@ -1635,7 +1793,7 @@ { "name": "ronin", "type": "tuple", - "internalType": "struct Token.Owner", + "internalType": "struct TokenOwner", "components": [ { "name": "addr", @@ -1657,12 +1815,12 @@ { "name": "info", "type": "tuple", - "internalType": "struct Token.Info", + "internalType": "struct TokenInfo", "components": [ { "name": "erc", "type": "uint8", - "internalType": "enum Token.Standard" + "internalType": "enum TokenStandard" }, { "name": "id", @@ -1710,7 +1868,7 @@ { "name": "mainchain", "type": "tuple", - "internalType": "struct Token.Owner", + "internalType": "struct TokenOwner", "components": [ { "name": "addr", @@ -1732,7 +1890,7 @@ { "name": "ronin", "type": "tuple", - "internalType": "struct Token.Owner", + "internalType": "struct TokenOwner", "components": [ { "name": "addr", @@ -1754,12 +1912,12 @@ { "name": "info", "type": "tuple", - "internalType": "struct Token.Info", + "internalType": "struct TokenInfo", "components": [ { "name": "erc", "type": "uint8", - "internalType": "enum Token.Standard" + "internalType": "enum TokenStandard" }, { "name": "id", @@ -1807,7 +1965,7 @@ { "name": "mainchain", "type": "tuple", - "internalType": "struct Token.Owner", + "internalType": "struct TokenOwner", "components": [ { "name": "addr", @@ -1829,7 +1987,7 @@ { "name": "ronin", "type": "tuple", - "internalType": "struct Token.Owner", + "internalType": "struct TokenOwner", "components": [ { "name": "addr", @@ -1851,12 +2009,12 @@ { "name": "info", "type": "tuple", - "internalType": "struct Token.Info", + "internalType": "struct TokenInfo", "components": [ { "name": "erc", "type": "uint8", - "internalType": "enum Token.Standard" + "internalType": "enum TokenStandard" }, { "name": "id", @@ -1899,6 +2057,11 @@ } ] }, + { + "type": "error", + "name": "ErrERC1155MintingFailed", + "inputs": [] + }, { "type": "error", "name": "ErrERC20MintingFailed", @@ -2025,12 +2188,12 @@ { "name": "tokenInfo", "type": "tuple", - "internalType": "struct Token.Info", + "internalType": "struct TokenInfo", "components": [ { "name": "erc", "type": "uint8", - "internalType": "enum Token.Standard" + "internalType": "enum TokenStandard" }, { "name": "id", @@ -2063,12 +2226,12 @@ { "name": "tokenInfo", "type": "tuple", - "internalType": "struct Token.Info", + "internalType": "struct TokenInfo", "components": [ { "name": "erc", "type": "uint8", - "internalType": "enum Token.Standard" + "internalType": "enum TokenStandard" }, { "name": "id", @@ -2115,6 +2278,27 @@ } ] }, + { + "type": "error", + "name": "ErrUnexpectedInternalCall", + "inputs": [ + { + "name": "msgSig", + "type": "bytes4", + "internalType": "bytes4" + }, + { + "name": "expectedContractType", + "type": "uint8", + "internalType": "enum ContractType" + }, + { + "name": "actual", + "type": "address", + "internalType": "address" + } + ] + }, { "type": "error", "name": "ErrUnsupportedStandard", @@ -2137,15 +2321,15 @@ ] } ], - "address": "0x762f3E2221C0DeE575d1Bd43145Bafeebe965ef2", + "address": "0x82f5483623D636BC3deBA8Ae67E1751b6CF2Bad2", "args": "0x", "ast": "", - "blockNumber": 5632711, - "bytecode": "0x608060405234801561001057600080fd5b506000805460ff1916905561470d8061002a6000396000f3fe60806040526004361061031e5760003560e01c8063865e6fd3116101ab578063b1d08a03116100f7578063d55ed10311610095578063de981f1b1161006f578063de981f1b14610999578063dff525e1146109b9578063e400327c146109d9578063e75235b8146109f95761032d565b8063d55ed1031461092c578063d64af2a614610959578063dafae408146109795761032d565b8063ca15c873116100d1578063ca15c873146108a7578063cdb67444146108c7578063d19773d2146108df578063d547741f1461090c5761032d565b8063b1d08a031461082d578063b29757941461085a578063b9c36209146108875761032d565b80639dcc4da311610164578063ab7965661161013e578063ab796566146107aa578063ac78dfe8146107d7578063affed0e0146107f7578063b1a2567e1461080d5761032d565b80639dcc4da314610760578063a217fddf14610795578063a3912ec81461032b5761032d565b8063865e6fd31461068c5780638f34e347146106ac5780639010d07c146106e05780639157921c1461070057806391d148541461072057806393c5678f146107405761032d565b806336568abe1161026a578063504af48c116102235780636932be98116101fd5780636932be98146106155780636c1ce670146106425780637de5dedd146106625780638456cb59146106775761032d565b8063504af48c146105bd57806359122f6b146105d05780635c975abb146105fd5761032d565b806336568abe146105055780633e70838b146105255780633f4ba83a146105455780634b14557e1461055a5780634d0d66731461056d5780634d493f4e1461058d5761032d565b80631d4a7210116102d75780632dfdf0b5116102b15780632dfdf0b5146104a35780632f2ff15d146104b9578063302d12db146104d95780633644e515146104f05761032d565b80631d4a721014610426578063248a9ca31461045357806329b6eca9146104835761032d565b806301ffc9a714610335578063065b3adf1461036a57806317ce2dd4146103a257806317fcb39b146103c65780631a8e55b0146103e65780631b6e7594146104065761032d565b3661032d5761032b610a11565b005b61032b610a11565b34801561034157600080fd5b506103556103503660046138ea565b610a51565b60405190151581526020015b60405180910390f35b34801561037657600080fd5b5060055461038a906001600160a01b031681565b6040516001600160a01b039091168152602001610361565b3480156103ae57600080fd5b506103b860755481565b604051908152602001610361565b3480156103d257600080fd5b5060745461038a906001600160a01b031681565b3480156103f257600080fd5b5061032b610401366004613959565b610a7c565b34801561041257600080fd5b5061032b6104213660046139c5565b610ab8565b34801561043257600080fd5b506103b8610441366004613a7f565b603e6020526000908152604090205481565b34801561045f57600080fd5b506103b861046e366004613a9c565b60009081526072602052604090206001015490565b34801561048f57600080fd5b5061032b61049e366004613a7f565b610af8565b3480156104af57600080fd5b506103b860765481565b3480156104c557600080fd5b5061032b6104d4366004613ab5565b610ba3565b3480156104e557600080fd5b506103b8620f424081565b3480156104fc57600080fd5b506077546103b8565b34801561051157600080fd5b5061032b610520366004613ab5565b610bcd565b34801561053157600080fd5b5061032b610540366004613a7f565b610c4b565b34801561055157600080fd5b5061032b610c75565b61032b610568366004613ae5565b610c85565b34801561057957600080fd5b50610355610588366004613b10565b610ca5565b34801561059957600080fd5b506103556105a8366004613a9c565b607a6020526000908152604090205460ff1681565b61032b6105cb366004613bbb565b610d13565b3480156105dc57600080fd5b506103b86105eb366004613a7f565b603a6020526000908152604090205481565b34801561060957600080fd5b5060005460ff16610355565b34801561062157600080fd5b506103b8610630366004613a9c565b60796020526000908152604090205481565b34801561064e57600080fd5b5061035561065d366004613c96565b610fed565b34801561066e57600080fd5b506103b8611000565b34801561068357600080fd5b5061032b611017565b34801561069857600080fd5b5061032b6106a7366004613cd1565b611027565b3480156106b857600080fd5b506103b87f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e481565b3480156106ec57600080fd5b5061038a6106fb366004613cfd565b611042565b34801561070c57600080fd5b5061032b61071b366004613d1f565b61105a565b34801561072c57600080fd5b5061035561073b366004613ab5565b6112de565b34801561074c57600080fd5b5061032b61075b366004613959565b611309565b34801561076c57600080fd5b5061078061077b366004613cfd565b61133f565b60408051928352602083019190915201610361565b3480156107a157600080fd5b506103b8600081565b3480156107b657600080fd5b506103b86107c5366004613a7f565b603c6020526000908152604090205481565b3480156107e357600080fd5b506103556107f2366004613a9c565b611368565b34801561080357600080fd5b506103b860045481565b34801561081957600080fd5b5061032b610828366004613959565b611394565b34801561083957600080fd5b506103b8610848366004613a7f565b60396020526000908152604090205481565b34801561086657600080fd5b5061087a610875366004613a7f565b6113ca565b6040516103619190613d62565b34801561089357600080fd5b506107806108a2366004613cfd565b61146d565b3480156108b357600080fd5b506103b86108c2366004613a9c565b611482565b3480156108d357600080fd5b50603754603854610780565b3480156108eb57600080fd5b506103b86108fa366004613a7f565b603b6020526000908152604090205481565b34801561091857600080fd5b5061032b610927366004613ab5565b611499565b34801561093857600080fd5b506103b8610947366004613a7f565b603d6020526000908152604090205481565b34801561096557600080fd5b5061032b610974366004613a7f565b6114be565b34801561098557600080fd5b50610355610994366004613a9c565b6114cf565b3480156109a557600080fd5b5061038a6109b4366004613d8e565b6114f3565b3480156109c557600080fd5b5061032b6109d4366004613da9565b611569565b3480156109e557600080fd5b5061032b6109f4366004613959565b6115de565b348015610a0557600080fd5b50600154600254610780565b610a19611614565b6074546001600160a01b03163314610a4f57610a336138a9565b338152604080820151349101528051610a4d90829061165a565b505b565b60006001600160e01b03198216635a05180f60e01b1480610a765750610a76826118bb565b92915050565b610a846118f0565b6000839003610aa6576040516316ee9d3b60e11b815260040160405180910390fd5b610ab28484848461194a565b50505050565b610ac06118f0565b6000859003610ae2576040516316ee9d3b60e11b815260040160405180910390fd5b610af0868686868686611a1f565b505050505050565b607154600290610100900460ff16158015610b1a575060715460ff8083169116105b610b3f5760405162461bcd60e51b8152600401610b3690613e67565b60405180910390fd5b6071805461ffff191660ff831617610100179055610b5e600b83611bb6565b6071805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b600082815260726020526040902060010154610bbe81611c5a565b610bc88383611c64565b505050565b6001600160a01b0381163314610c3d5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610b36565b610c478282611c86565b5050565b610c536118f0565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b610c7d611ca8565b610a4f611d17565b610c8d611614565b610a4d610c9f36839003830183613f54565b3361165a565b6000610caf611614565b610d0b848484808060200260200160405190810160405280939291908181526020016000905b82821015610d0157610cf260608302860136819003810190613fa7565b81526020019060010190610cd5565b5050505050611d69565b949350505050565b607154610100900460ff1615808015610d335750607154600160ff909116105b80610d4d5750303b158015610d4d575060715460ff166001145b610d695760405162461bcd60e51b8152600401610b3690613e67565b6071805460ff191660011790558015610d8c576071805461ff0019166101001790555b610d9760008c6121d3565b6075899055610da58a6121dd565b610e306040517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81527f159f52c1e3a2b6a6aad3950adf713516211484e0516dad685ea662a094b7c43b60208201527fad7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5604082015246606082015230608082015260a0812060775550565b610e3a8887612231565b5050610e4687876122c8565b5050610e50612355565b6000610e5c8680614007565b90501115610f1d57610e85610e718680614007565b610e7e6020890189614007565b8787611a1f565b610eab610e928680614007565b8660005b602002810190610ea69190614007565b6123a2565b610ed1610eb88680614007565b8660015b602002810190610ecc9190614007565b61194a565b610ef7610ede8680614007565b8660025b602002810190610ef29190614007565b612477565b610f1d610f048680614007565b8660035b602002810190610f189190614007565b612588565b60005b610f2d6040870187614007565b9050811015610f9957610f917f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e4610f676040890189614007565b84818110610f7757610f77613ff1565b9050602002016020810190610f8c9190613a7f565b611c64565b600101610f20565b508015610fe0576071805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050505050565b6000610ff9838361265d565b9392505050565b600061101261100d612721565b61278e565b905090565b61101f611ca8565b610a4f6127c4565b61102f6118f0565b61103881612801565b610c478282611bb6565b6000828152607360205260408120610ff99083612837565b7f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e461108481611c5a565b600061109d6110983685900385018561409f565b612843565b90506110b16110983685900385018561409f565b8335600090815260796020526040902054146110e05760405163f4b8742f60e01b815260040160405180910390fd5b82356000908152607a602052604090205460ff166111115760405163147bfe0760e01b815260040160405180910390fd5b82356000908152607a602052604090819020805460ff19169055517fd639511b37b3b002cca6cfe6bca0d833945a5af5a045578a0627fc43b79b26309061115b9083908690614173565b60405180910390a160006111756080850160608601613a7f565b9050600061118b61012086016101008701614200565b600181111561119c5761119c613d3c565b036112635760006111b6368690038601610100870161421d565b6001600160a01b0383166000908152603b60205260409020549091506111e2906101408701359061290d565b604082015260006111fc368790038701610100880161421d565b60408301519091506112139061014088013561424f565b6040820152607454611233908390339086906001600160a01b0316612927565b61125c6112466060880160408901613a7f565b60745483919086906001600160a01b0316612927565b505061129f565b61129f6112766060860160408701613a7f565b60745483906001600160a01b03166112973689900389016101008a0161421d565b929190612927565b7f21e88e956aa3e086f6388e899965cef814688f99ad8bb29b08d396571016372d82856040516112d0929190614173565b60405180910390a150505050565b60009182526072602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6113116118f0565b6000839003611333576040516316ee9d3b60e11b815260040160405180910390fd5b610ab2848484846123a2565b60008061134a6118f0565b61135484846122c8565b9092509050611361612355565b9250929050565b6000611372612721565b60375461137f9190614262565b60385461138c9084614262565b101592915050565b61139c6118f0565b60008390036113be576040516316ee9d3b60e11b815260040160405180910390fd5b610ab284848484612477565b60408051808201909152600080825260208201526001600160a01b0382166000908152607860205260409081902081518083019092528054829060ff16600181111561141857611418613d3c565b600181111561142957611429613d3c565b815290546001600160a01b036101009091048116602092830152908201519192501661146857604051631b79f53b60e21b815260040160405180910390fd5b919050565b6000806114786118f0565b6113548484612231565b6000818152607360205260408120610a7690612c63565b6000828152607260205260409020600101546114b481611c5a565b610bc88383611c86565b6114c66118f0565b610a4d816121dd565b60006114d9612721565b6001546114e69190614262565b60025461138c9084614262565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f81111561152a5761152a613d3c565b60ff1681526020810191909152604001600020546001600160a01b0316905080611468578160405163409140df60e11b8152600401610b369190614279565b6115716118f0565b6000869003611593576040516316ee9d3b60e11b815260040160405180910390fd5b6115a1878787878787611a1f565b6115ae8787836000610e96565b6115bb8787836001610ebc565b6115c88787836002610ee2565b6115d58787836003610f08565b50505050505050565b6115e66118f0565b6000839003611608576040516316ee9d3b60e11b815260040160405180910390fd5b610ab284848484612588565b60005460ff1615610a4f5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610b36565b604080518082018252600080825260208201526074549184015190916001600160a01b03169061168990612c6d565b60208401516001600160a01b031661172a5734846040015160400151146116c35760405163129c2ce160e31b815260040160405180910390fd5b6116cc816113ca565b60408501515190925060018111156116e6576116e6613d3c565b825160018111156116f9576116f9613d3c565b146117165760405162035e2b60ea1b815260040160405180910390fd5b6001600160a01b0381166020850152611838565b34156117495760405163129c2ce160e31b815260040160405180910390fd5b61175684602001516113ca565b604085015151909250600181111561177057611770613d3c565b8251600181111561178357611783613d3c565b146117a05760405162035e2b60ea1b815260040160405180910390fd5b602084015160408501516117b79185903090612ce8565b83602001516001600160a01b0316816001600160a01b031603611838576040848101518101519051632e1a7d4d60e01b815260048101919091526001600160a01b03821690632e1a7d4d90602401600060405180830381600087803b15801561181f57600080fd5b505af1158015611833573d6000803e3d6000fd5b505050505b607680546000918261184983614293565b9190505590506000611870858386602001516075548a612ec990949392919063ffffffff16565b90507fd7b25068d9dc8d00765254cfb7f5070f98d263c8d68931d937c7362fa738048b61189c82612843565b826040516118ab9291906142ce565b60405180910390a1505050505050565b60006001600160e01b03198216637965db0b60e01b1480610a7657506301ffc9a760e01b6001600160e01b0319831614610a76565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610a4f576000356001600160e01b0319166001604051620f948f60ea1b8152600401610b3692919061436c565b828114611978576000356001600160e01b0319166040516306b5667560e21b8152600401610b36919061439a565b60005b838110156119e95782828281811061199557611995613ff1565b90506020020135603a60008787858181106119b2576119b2613ff1565b90506020020160208101906119c79190613a7f565b6001600160a01b0316815260208101919091526040016000205560010161197b565b507f64557254143204d91ba2d95acb9fda1e5fea55f77efd028685765bc1e94dd4b5848484846040516112d094939291906143f8565b8483148015611a2d57508481145b611a58576000356001600160e01b0319166040516306b5667560e21b8152600401610b36919061439a565b60005b85811015611b7c57848482818110611a7557611a75613ff1565b9050602002016020810190611a8a9190613a7f565b60786000898985818110611aa057611aa0613ff1565b9050602002016020810190611ab59190613a7f565b6001600160a01b03908116825260208201929092526040016000208054610100600160a81b0319166101009390921692909202179055828282818110611afd57611afd613ff1565b9050602002016020810190611b129190614200565b60786000898985818110611b2857611b28613ff1565b9050602002016020810190611b3d9190613a7f565b6001600160a01b031681526020810191909152604001600020805460ff191660018381811115611b6f57611b6f613d3c565b0217905550600101611a5b565b507fa4f03cc9c0e0aeb5b71b4ec800702753f65748c2cf3064695ba8e8b46be704448686868686866040516118ab96959493929190614444565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f811115611bec57611bec613d3c565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115611c2d57611c2d613d3c565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b610a4d8133612f9e565b611c6e8282613002565b6000828152607360205260409020610bc89082613088565b611c90828261309d565b6000828152607360205260409020610bc89082613104565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b0316331480611cea57506005546001600160a01b031633145b610a4f576000356001600160e01b0319166001604051620f948f60ea1b8152600401610b3692919061436c565b611d1f613119565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000823561014084013582611d846080870160608801613a7f565b9050611da1611d9c368890038801610100890161421d565b612c6d565b6001611db36040880160208901614200565b6001811115611dc457611dc4613d3c565b14611de25760405163182f3d8760e11b815260040160405180910390fd5b60808601354614611e245760405163092048d160e11b81526000356001600160e01b031916600482015260808701356024820152466044820152606401610b36565b6000611e396108756080890160608a01613a7f565b9050611e4d61012088016101008901614200565b6001811115611e5e57611e5e613d3c565b81516001811115611e7157611e71613d3c565b148015611ea25750611e8960e0880160c08901613a7f565b6001600160a01b031681602001516001600160a01b0316145b611ebf5760405163f4b8742f60e01b815260040160405180910390fd5b60008481526079602052604090205415611eec57604051634f13df6160e01b815260040160405180910390fd5b6001611f0061012089016101008a01614200565b6001811115611f1157611f11613d3c565b1480611f245750611f22828461265d565b155b611f415760405163c51297b760e01b815260040160405180910390fd5b6000611f55611098368a90038a018a61409f565b90506000611f6560775483613162565b90506000611f85611f7e6101208c016101008d01614200565b86886131a3565b60408051606081018252600080825260208201819052918101829052919a50919250819081906000805b8e518110156120aa578e8181518110611fca57611fca613ff1565b6020908102919091018101518051818301516040808401518151600081529586018083528e905260ff9093169085015260608401526080830152935060019060a0016020604051602081039080840390855afa15801561202e573d6000803e3d6000fd5b505050602060405103519450846001600160a01b0316846001600160a01b03161061207a576000356001600160e01b031916604051635d3dcd3160e01b8152600401610b36919061439a565b84935061208685613229565b61209090836144be565b91508682106120a257600195506120aa565b600101611faf565b50846120c957604051639e8f5f6360e01b815260040160405180910390fd5b505050600089815260796020526040902085905550508715612144576000878152607a602052604090819020805460ff19166001179055517f89e52969465b1f1866fc5d46fd62de953962e9cb33552443cd999eba05bd20dc906121309085908d90614173565b60405180910390a150505050505050610a76565b61214e85876132b5565b61218d61216160608c0160408d01613a7f565b86607460009054906101000a90046001600160a01b03168d61010001803603810190611297919061421d565b7f21e88e956aa3e086f6388e899965cef814688f99ad8bb29b08d396571016372d838b6040516121be929190614173565b60405180910390a15050505050505092915050565b610c478282611c64565b607480546001600160a01b0319166001600160a01b0383169081179091556040519081527f9d2334c23be647e994f27a72c5eee42a43d5bdcfe15bb88e939103c2b114cbaf9060200160405180910390a150565b60008082841115612263576000356001600160e01b0319166040516387f6f09560e01b8152600401610b36919061439a565b50506001805460028054858455908490556004805493840190556040805183815260208101839052929391928592879290917f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f891015b60405180910390a49250929050565b600080828411156122fa576000356001600160e01b0319166040516387f6f09560e01b8152600401610b36919061439a565b5050603780546038805492859055839055600480546001810190915560408051838152602081018590529293928592879290917f31312c97b89cc751b832d98fd459b967a2c3eef3b49757d1cf5ebaa12bb6eee191016122b9565b6002546037546123659190614262565b6038546001546123759190614262565b1115610a4f576000356001600160e01b0319166040516387f6f09560e01b8152600401610b36919061439a565b8281146123d0576000356001600160e01b0319166040516306b5667560e21b8152600401610b36919061439a565b60005b83811015612441578282828181106123ed576123ed613ff1565b905060200201356039600087878581811061240a5761240a613ff1565b905060200201602081019061241f9190613a7f565b6001600160a01b031681526020810191909152604001600020556001016123d3565b507f80bc635c452ae67f12f9b6f12ad4daa6dbbc04eeb9ebb87d354ce10c0e210dc0848484846040516112d094939291906143f8565b8281146124a5576000356001600160e01b0319166040516306b5667560e21b8152600401610b36919061439a565b60005b8381101561255257620f42408383838181106124c6576124c6613ff1565b9050602002013511156124ec5760405163572d3bd360e11b815260040160405180910390fd5b8282828181106124fe576124fe613ff1565b90506020020135603b600087878581811061251b5761251b613ff1565b90506020020160208101906125309190613a7f565b6001600160a01b031681526020810191909152604001600020556001016124a8565b507fb05f5de88ae0294ebb6f67c5af2fcbbd593cc6bdfe543e2869794a4c8ce3ea50848484846040516112d094939291906143f8565b8281146125b6576000356001600160e01b0319166040516306b5667560e21b8152600401610b36919061439a565b60005b83811015612627578282828181106125d3576125d3613ff1565b90506020020135603c60008787858181106125f0576125f0613ff1565b90506020020160208101906126059190613a7f565b6001600160a01b031681526020810191909152604001600020556001016125b9565b507fb5d2963614d72181b4df1f993d45b83edf42fa19710f0204217ba1b3e183bb73848484846040516112d094939291906143f8565b6001600160a01b0382166000908152603a6020526040812054821061268457506000610a76565b600061269362015180426144d1565b6001600160a01b0385166000908152603e60205260409020549091508111156126d95750506001600160a01b0382166000908152603c6020526040902054811015610a76565b6001600160a01b0384166000908152603d60205260409020546126fd9084906144be565b6001600160a01b0385166000908152603c602052604090205411159150610a769050565b600061272d600b6114f3565b6001600160a01b03166306aba0e16040518163ffffffff1660e01b8152600401602060405180830381865afa15801561276a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061101291906144f3565b60006002546001600254846001546127a69190614262565b6127b091906144be565b6127ba919061424f565b610a7691906144d1565b6127cc611614565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611d4c3390565b806001600160a01b03163b600003610a4d57604051630bfc64a360e21b81526001600160a01b0382166004820152602401610b36565b6000610ff98383613345565b600080612853836040015161336f565b90506000612864846060015161336f565b905060006128b88560800151604080517f1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d815282516020808301919091528301518183015291015160608201526080902090565b604080517fb9d1fe7c9deeec5dc90a2f47ff1684239519f2545b2228d3d91fb27df3189eea815287516020808301919091529097015190870152606086019390935250608084015260a08301525060c0902090565b6000620f424061291d8385614262565b610ff991906144d1565b6000816001600160a01b0316836001600160a01b0316036129d65760408086015190516001600160a01b0386169180156108fc02916000818181858888f193505050506129d157816001600160a01b031663d0e30db086604001516040518263ffffffff1660e01b81526004016000604051808303818588803b1580156129ad57600080fd5b505af11580156129c1573d6000803e3d6000fd5b50505050506129d18585856133b7565b612c5c565b6000855160018111156129eb576129eb613d3c565b03612b54576040516370a0823160e01b81523060048201526000906001600160a01b038516906370a0823190602401602060405180830381865afa158015612a37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a5b91906144f3565b90508560400151811015612b4357836001600160a01b03166340c10f1930838960400151612a89919061424f565b6040516001600160a01b03909216602483015260448201526064016040516020818303038152906040529060e01b6020820180516001600160e01b038381831617835250505050604051612add9190614530565b6000604051808303816000865af19150503d8060008114612b1a576040519150601f19603f3d011682016040523d82523d6000602084013e612b1f565b606091505b50508092505081612b4357604051632f739fff60e11b815260040160405180910390fd5b612b4e8686866133b7565b50612c5c565b600185516001811115612b6957612b69613d3c565b03612c4357612b7d83858760200151613435565b6129d157602085810151604080516001600160a01b038881166024830152604480830194909452825180830390940184526064909101825292820180516001600160e01b03166340c10f1960e01b1790525191851691612bdd9190614530565b6000604051808303816000865af19150503d8060008114612c1a576040519150601f19603f3d011682016040523d82523d6000602084013e612c1f565b606091505b505080915050806129d15760405163c8e3a09f60e01b815260040160405180910390fd5b6040516361e411a760e11b815260040160405180910390fd5b5050505050565b6000610a76825490565b600081516001811115612c8257612c82613d3c565b148015612c93575060008160400151115b8015612ca157506020810151155b80612ccb5750600181516001811115612cbc57612cbc613d3c565b148015612ccb57506040810151155b610a4d5760405163034992a760e51b815260040160405180910390fd5b600060608186516001811115612d0057612d00613d3c565b03612ddd5760408681015181516001600160a01b038881166024830152878116604483015260648083019390935283518083039093018352608490910183526020820180516001600160e01b03166323b872dd60e01b179052915191851691612d699190614530565b6000604051808303816000865af19150503d8060008114612da6576040519150601f19603f3d011682016040523d82523d6000602084013e612dab565b606091505b509092509050818015612dd6575080511580612dd6575080806020019051810190612dd6919061454c565b9150612ea3565b600186516001811115612df257612df2613d3c565b03612c4357602086810151604080516001600160a01b0389811660248301528881166044830152606480830194909452825180830390940184526084909101825292820180516001600160e01b03166323b872dd60e01b1790525191851691612e5b9190614530565b6000604051808303816000865af19150503d8060008114612e98576040519150601f19603f3d011682016040523d82523d6000602084013e612e9d565b606091505b50909250505b81610af05785858585604051639d2e4c6760e01b8152600401610b36949392919061456e565b612f396040805160a08101825260008082526020808301829052835160608082018652838252818301849052818601849052848601919091528451808201865283815280830184905280860184905281850152845190810185528281529081018290529283015290608082015290565b83815260006020820181905250604080820180516001600160a01b039788169052602080890151825190891690820152905146908301528751606084018051918916909152805195909716940193909352935182015292909201516080820152919050565b612fa882826112de565b610c4757612fc0816001600160a01b031660146134e0565b612fcb8360206134e0565b604051602001612fdc9291906145a4565b60408051601f198184030181529082905262461bcd60e51b8252610b3691600401614619565b61300c82826112de565b610c475760008281526072602090815260408083206001600160a01b03851684529091529020805460ff191660011790556130443390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610ff9836001600160a01b03841661367c565b6130a782826112de565b15610c475760008281526072602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610ff9836001600160a01b0384166136cb565b60005460ff16610a4f5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610b36565b6040805161190160f01b6020808301919091526022820185905260428083018590528351808403909101815260629092019092528051910120600090610ff9565b60008060006131b0612721565b90506131bb8161278e565b925060008660018111156131d1576131d1613d3c565b03613220576001600160a01b0385166000908152603960205260409020548410613201576131fe816137be565b92505b6001600160a01b0385166000908152603a602052604090205484101591505b50935093915050565b6000613235600b6114f3565b60405163901979d560e01b81526001600160a01b038481166004830152919091169063901979d590602401602060405180830381865afa15801561327d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132a1919061464c565b6bffffffffffffffffffffffff1692915050565b60006132c462015180426144d1565b6001600160a01b0384166000908152603e6020526040902054909150811115613313576001600160a01b03929092166000908152603e6020908152604080832094909455603d90529190912055565b6001600160a01b0383166000908152603d60205260408120805484929061333b9084906144be565b9091555050505050565b600082600001828154811061335c5761335c613ff1565b9060005260206000200154905092915050565b604080517f353bdd8d69b9e3185b3972e08b03845c0c14a21a390215302776a7a34b0e8764815282516020808301919091528301518183015291015160608201526080902090565b600080845160018111156133cd576133cd613d3c565b036133e8576133e1828486604001516137d6565b9050613411565b6001845160018111156133fd576133fd613d3c565b03612c43576133e182848660200151613435565b80610ab2578383836040516341bd7d9160e11b8152600401610b369392919061467a565b604080513060248201526001600160a01b038481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b179052915160009286169161349391614530565b6000604051808303816000865af19150503d80600081146134d0576040519150601f19603f3d011682016040523d82523d6000602084013e6134d5565b606091505b509095945050505050565b606060006134ef836002614262565b6134fa9060026144be565b67ffffffffffffffff81111561351257613512613eb5565b6040519080825280601f01601f19166020018201604052801561353c576020820181803683370190505b509050600360fc1b8160008151811061355757613557613ff1565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061358657613586613ff1565b60200101906001600160f81b031916908160001a90535060006135aa846002614262565b6135b59060016144be565b90505b600181111561362d576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106135e9576135e9613ff1565b1a60f81b8282815181106135ff576135ff613ff1565b60200101906001600160f81b031916908160001a90535060049490941c93613626816146aa565b90506135b8565b508315610ff95760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610b36565b60008181526001830160205260408120546136c357508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610a76565b506000610a76565b600081815260018301602052604081205480156137b45760006136ef60018361424f565b85549091506000906137039060019061424f565b905081811461376857600086600001828154811061372357613723613ff1565b906000526020600020015490508087600001848154811061374657613746613ff1565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613779576137796146c1565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610a76565b6000915050610a76565b60006038546001603854846037546127a69190614262565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1790529151600092606092908716916138339190614530565b6000604051808303816000865af19150503d8060008114613870576040519150601f19603f3d011682016040523d82523d6000602084013e613875565b606091505b5090925090508180156138a05750805115806138a05750808060200190518101906138a0919061454c565b95945050505050565b60408051606081018252600080825260208201529081016138e56040805160608101909152806000815260200160008152602001600081525090565b905290565b6000602082840312156138fc57600080fd5b81356001600160e01b031981168114610ff957600080fd5b60008083601f84011261392657600080fd5b50813567ffffffffffffffff81111561393e57600080fd5b6020830191508360208260051b850101111561136157600080fd5b6000806000806040858703121561396f57600080fd5b843567ffffffffffffffff8082111561398757600080fd5b61399388838901613914565b909650945060208701359150808211156139ac57600080fd5b506139b987828801613914565b95989497509550505050565b600080600080600080606087890312156139de57600080fd5b863567ffffffffffffffff808211156139f657600080fd5b613a028a838b01613914565b90985096506020890135915080821115613a1b57600080fd5b613a278a838b01613914565b90965094506040890135915080821115613a4057600080fd5b50613a4d89828a01613914565b979a9699509497509295939492505050565b6001600160a01b0381168114610a4d57600080fd5b803561146881613a5f565b600060208284031215613a9157600080fd5b8135610ff981613a5f565b600060208284031215613aae57600080fd5b5035919050565b60008060408385031215613ac857600080fd5b823591506020830135613ada81613a5f565b809150509250929050565b600060a08284031215613af757600080fd5b50919050565b60006101608284031215613af757600080fd5b60008060006101808486031215613b2657600080fd5b613b308585613afd565b925061016084013567ffffffffffffffff80821115613b4e57600080fd5b818601915086601f830112613b6257600080fd5b813581811115613b7157600080fd5b876020606083028501011115613b8657600080fd5b6020830194508093505050509250925092565b8060608101831015610a7657600080fd5b8060808101831015610a7657600080fd5b6000806000806000806000806000806101208b8d031215613bdb57600080fd5b613be48b613a74565b9950613bf260208c01613a74565b985060408b0135975060608b0135965060808b0135955060a08b0135945060c08b013567ffffffffffffffff80821115613c2b57600080fd5b613c378e838f01613b99565b955060e08d0135915080821115613c4d57600080fd5b613c598e838f01613baa565b94506101008d0135915080821115613c7057600080fd5b50613c7d8d828e01613914565b915080935050809150509295989b9194979a5092959850565b60008060408385031215613ca957600080fd5b8235613cb481613a5f565b946020939093013593505050565b80356010811061146857600080fd5b60008060408385031215613ce457600080fd5b613ced83613cc2565b91506020830135613ada81613a5f565b60008060408385031215613d1057600080fd5b50508035926020909101359150565b60006101608284031215613d3257600080fd5b610ff98383613afd565b634e487b7160e01b600052602160045260246000fd5b60028110610a4d57610a4d613d3c565b81516040820190613d7281613d52565b82526020928301516001600160a01b0316929091019190915290565b600060208284031215613da057600080fd5b610ff982613cc2565b60008060008060008060006080888a031215613dc457600080fd5b873567ffffffffffffffff80821115613ddc57600080fd5b613de88b838c01613914565b909950975060208a0135915080821115613e0157600080fd5b613e0d8b838c01613914565b909750955060408a0135915080821115613e2657600080fd5b613e328b838c01613914565b909550935060608a0135915080821115613e4b57600080fd5b50613e588a828b01613baa565b91505092959891949750929550565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715613efc57634e487b7160e01b600052604160045260246000fd5b60405290565b60028110610a4d57600080fd5b600060608284031215613f2157600080fd5b613f29613ecb565b90508135613f3681613f02565b80825250602082013560208201526040820135604082015292915050565b600060a08284031215613f6657600080fd5b613f6e613ecb565b8235613f7981613a5f565b81526020830135613f8981613a5f565b6020820152613f9b8460408501613f0f565b60408201529392505050565b600060608284031215613fb957600080fd5b613fc1613ecb565b823560ff81168114613fd257600080fd5b8152602083810135908201526040928301359281019290925250919050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261401e57600080fd5b83018035915067ffffffffffffffff82111561403957600080fd5b6020019150600581901b360382131561136157600080fd5b60006060828403121561406357600080fd5b61406b613ecb565b9050813561407881613a5f565b8152602082013561408881613a5f565b806020830152506040820135604082015292915050565b600061016082840312156140b257600080fd5b60405160a0810181811067ffffffffffffffff821117156140e357634e487b7160e01b600052604160045260246000fd5b6040528235815260208301356140f881613f02565b602082015261410a8460408501614051565b604082015261411c8460a08501614051565b606082015261412f846101008501613f0f565b60808201529392505050565b803561414681613a5f565b6001600160a01b03908116835260208201359061416282613a5f565b166020830152604090810135910152565b60006101808201905083825282356020830152602083013561419481613f02565b61419d81613d52565b806040840152506141b4606083016040850161413b565b6141c460c0830160a0850161413b565b6101206101008401356141d681613f02565b6141df81613d52565b81840152830135610140808401919091529092013561016090910152919050565b60006020828403121561421257600080fd5b8135610ff981613f02565b60006060828403121561422f57600080fd5b610ff98383613f0f565b634e487b7160e01b600052601160045260246000fd5b81810381811115610a7657610a76614239565b8082028115828204841417610a7657610a76614239565b602081016010831061428d5761428d613d3c565b91905290565b6000600182016142a5576142a5614239565b5060010190565b80516142b781613d52565b825260208181015190830152604090810151910152565b6000610180820190508382528251602083015260208301516142ef81613d52565b6040838101919091528381015180516001600160a01b03908116606086015260208201511660808501529081015160a084015250606083015180516001600160a01b0390811660c085015260208201511660e084015260408101516101008401525060808301516143646101208401826142ac565b509392505050565b6001600160e01b03198316815260408101600b831061438d5761438d613d3c565b8260208301529392505050565b6001600160e01b031991909116815260200190565b8183526000602080850194508260005b858110156143ed5781356143d281613a5f565b6001600160a01b0316875295820195908201906001016143bf565b509495945050505050565b60408152600061440c6040830186886143af565b82810360208401528381526001600160fb1b0384111561442b57600080fd5b8360051b80866020840137016020019695505050505050565b60608152600061445860608301888a6143af565b6020838203602085015261446d82888a6143af565b848103604086015285815286925060200160005b868110156144af57833561449481613f02565b61449d81613d52565b82529282019290820190600101614481565b509a9950505050505050505050565b80820180821115610a7657610a76614239565b6000826144ee57634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561450557600080fd5b5051919050565b60005b8381101561452757818101518382015260200161450f565b50506000910152565b6000825161454281846020870161450c565b9190910192915050565b60006020828403121561455e57600080fd5b81518015158114610ff957600080fd5b60c0810161457c82876142ac565b6001600160a01b0394851660608301529284166080820152921660a090920191909152919050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516145dc81601785016020880161450c565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161460d81602884016020880161450c565b01602801949350505050565b602081526000825180602084015261463881604085016020870161450c565b601f01601f19169190910160400192915050565b60006020828403121561465e57600080fd5b81516bffffffffffffffffffffffff81168114610ff957600080fd5b60a0810161468882866142ac565b6001600160a01b03938416606083015291909216608090920191909152919050565b6000816146b9576146b9614239565b506000190190565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220ec8cc7f89d632f5b6c36d2cdb75ab664383134c4e4a6f2157e2624267b4eadfe64736f6c63430008170033", + "blockNumber": 5709352, + "bytecode": "0x60806040523480156200001157600080fd5b506000805460ff19169055620000266200002c565b620000ee565b607154610100900460ff1615620000995760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60715460ff9081161015620000ec576071805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61556180620000fe6000396000f3fe60806040526004361061039b5760003560e01c80638f34e347116101dc578063b9c3620911610102578063d55ed103116100a0578063dff525e11161006f578063dff525e114610b04578063e400327c14610b24578063e75235b814610b44578063f23a6e6114610b5c576103aa565b8063d55ed10314610a77578063d64af2a614610aa4578063dafae40814610ac4578063de981f1b14610ae4576103aa565b8063ca15c873116100dc578063ca15c873146109f2578063cdb6744414610a12578063d19773d214610a2a578063d547741f14610a57576103aa565b8063b9c3620914610986578063bc197c81146109a6578063c48549de146109d2576103aa565b8063a217fddf1161017a578063affed0e011610149578063affed0e0146108f6578063b1a2567e1461090c578063b1d08a031461092c578063b297579414610959576103aa565b8063a217fddf14610894578063a3912ec8146103a8578063ab796566146108a9578063ac78dfe8146108d6576103aa565b80639157921c116101b65780639157921c146107ff57806391d148541461081f57806393c5678f1461083f5780639dcc4da31461085f576103aa565b80638f34e3471461077e5780638f851d8a146107b25780639010d07c146107df576103aa565b806338e454b1116102c1578063504af48c1161025f5780636c1ce6701161022e5780636c1ce670146107145780637de5dedd146107345780638456cb5914610749578063865e6fd31461075e576103aa565b8063504af48c1461068f57806359122f6b146106a25780635c975abb146106cf5780636932be98146106e7576103aa565b80634b14557e1161029b5780634b14557e1461060c5780634d0d66731461061f5780634d493f4e1461063f5780634f4247a11461066f576103aa565b806338e454b1146105c25780633e70838b146105d75780633f4ba83a146105f7576103aa565b80631d4a7210116103395780632f2ff15d116103085780632f2ff15d14610556578063302d12db146105765780633644e5151461058d57806336568abe146105a2576103aa565b80631d4a7210146104c3578063248a9ca3146104f057806329b6eca9146105205780632dfdf0b514610540576103aa565b806317ce2dd41161037557806317ce2dd41461043f57806317fcb39b146104635780631a8e55b0146104835780631b6e7594146104a3576103aa565b806301ffc9a7146103b2578063065b3adf146103e7578063110a83081461041f576103aa565b366103aa576103a8610b88565b005b6103a8610b88565b3480156103be57600080fd5b506103d26103cd36600461416e565b610bbc565b60405190151581526020015b60405180910390f35b3480156103f357600080fd5b50600554610407906001600160a01b031681565b6040516001600160a01b0390911681526020016103de565b34801561042b57600080fd5b506103a861043a3660046141ad565b610c01565b34801561044b57600080fd5b5061045560755481565b6040519081526020016103de565b34801561046f57600080fd5b50607454610407906001600160a01b031681565b34801561048f57600080fd5b506103a861049e36600461420e565b610ca6565b3480156104af57600080fd5b506103a86104be366004614279565b610ce2565b3480156104cf57600080fd5b506104556104de3660046141ad565b603e6020526000908152604090205481565b3480156104fc57600080fd5b5061045561050b36600461431d565b60009081526072602052604090206001015490565b34801561052c57600080fd5b506103a861053b3660046141ad565b610d22565b34801561054c57600080fd5b5061045560765481565b34801561056257600080fd5b506103a8610571366004614336565b610dab565b34801561058257600080fd5b50610455620f424081565b34801561059957600080fd5b50607754610455565b3480156105ae57600080fd5b506103a86105bd366004614336565b610dd5565b3480156105ce57600080fd5b506103a8610e53565b3480156105e357600080fd5b506103a86105f23660046141ad565b611030565b34801561060357600080fd5b506103a861105a565b6103a861061a366004614366565b61106a565b34801561062b57600080fd5b506103d261063a366004614391565b61108d565b34801561064b57600080fd5b506103d261065a36600461431d565b607a6020526000908152604090205460ff1681565b34801561067b57600080fd5b50607f54610407906001600160a01b031681565b6103a861069d36600461443b565b6110fd565b3480156106ae57600080fd5b506104556106bd3660046141ad565b603a6020526000908152604090205481565b3480156106db57600080fd5b5060005460ff166103d2565b3480156106f357600080fd5b5061045561070236600461431d565b60796020526000908152604090205481565b34801561072057600080fd5b506103d261072f366004614515565b6113c3565b34801561074057600080fd5b506104556113cf565b34801561075557600080fd5b506103a86113f0565b34801561076a57600080fd5b506103a8610779366004614550565b611400565b34801561078a57600080fd5b506104557f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e481565b3480156107be57600080fd5b506107d26107cd36600461461b565b61141b565b6040516103de9190614712565b3480156107eb57600080fd5b506104076107fa366004614727565b61159d565b34801561080b57600080fd5b506103a861081a366004614749565b6115b5565b34801561082b57600080fd5b506103d261083a366004614336565b611839565b34801561084b57600080fd5b506103a861085a36600461420e565b611864565b34801561086b57600080fd5b5061087f61087a366004614727565b61189a565b604080519283526020830191909152016103de565b3480156108a057600080fd5b50610455600081565b3480156108b557600080fd5b506104556108c43660046141ad565b603c6020526000908152604090205481565b3480156108e257600080fd5b506103d26108f136600461431d565b6118c3565b34801561090257600080fd5b5061045560045481565b34801561091857600080fd5b506103a861092736600461420e565b6118f9565b34801561093857600080fd5b506104556109473660046141ad565b60396020526000908152604090205481565b34801561096557600080fd5b506109796109743660046141ad565b61192f565b6040516103de9190614790565b34801561099257600080fd5b506103a86109a1366004614727565b6119d2565b3480156109b257600080fd5b506107d26109c1366004614893565b63bc197c8160e01b95945050505050565b3480156109de57600080fd5b506107d26109ed36600461420e565b6119ec565b3480156109fe57600080fd5b50610455610a0d36600461431d565b611b80565b348015610a1e57600080fd5b5060375460385461087f565b348015610a3657600080fd5b50610455610a453660046141ad565b603b6020526000908152604090205481565b348015610a6357600080fd5b506103a8610a72366004614336565b611b97565b348015610a8357600080fd5b50610455610a923660046141ad565b603d6020526000908152604090205481565b348015610ab057600080fd5b506103a8610abf3660046141ad565b611bbc565b348015610ad057600080fd5b506103d2610adf36600461431d565b611bcd565b348015610af057600080fd5b50610407610aff366004614940565b611bfb565b348015610b1057600080fd5b506103a8610b1f36600461495b565b611c71565b348015610b3057600080fd5b506103a8610b3f36600461420e565b611ce6565b348015610b5057600080fd5b5060015460025461087f565b348015610b6857600080fd5b506107d2610b77366004614a18565b63f23a6e6160e01b95945050505050565b6074546001600160a01b0316331480610bab5750607f546001600160a01b031633145b15610bb257565b610bba611d1c565b565b60006001600160e01b031982166246560160e51b1480610bec57506001600160e01b031982166312c0151560e21b145b80610bfb5750610bfb82611d46565b92915050565b607154600490610100900460ff16158015610c23575060715460ff8083169116105b610c485760405162461bcd60e51b8152600401610c3f90614a80565b60405180910390fd5b60718054607f80546001600160a01b0319166001600160a01b03861617905561ff001961010060ff851661ffff199093168317171690915560405190815260008051602061550c833981519152906020015b60405180910390a15050565b610cae611d6b565b6000839003610cd0576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484611dc5565b50505050565b610cea611d6b565b6000859003610d0c576040516316ee9d3b60e11b815260040160405180910390fd5b610d1a868686868686611e9a565b505050505050565b607154600290610100900460ff16158015610d44575060715460ff8083169116105b610d605760405162461bcd60e51b8152600401610c3f90614a80565b6071805461ffff191660ff831617610100179055610d7f600b83612042565b6071805461ff001916905560405160ff8216815260008051602061550c83398151915290602001610c9a565b600082815260726020526040902060010154610dc6816120e6565b610dd083836120f0565b505050565b6001600160a01b0381163314610e455760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610c3f565b610e4f8282612112565b5050565b607154600390610100900460ff16158015610e75575060715460ff8083169116105b610e915760405162461bcd60e51b8152600401610c3f90614a80565b6071805461ffff191660ff8316176101001790556000610eb1600b611bfb565b9050600080826001600160a01b031663c441c4a86040518163ffffffff1660e01b8152600401600060405180830381865afa158015610ef4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f1c9190810190614b4b565b92509250506000805b8351811015610fd957828181518110610f4057610f40614c31565b6020026020010151607e6000868481518110610f5e57610f5e614c31565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154816001600160601b0302191690836001600160601b03160217905550828181518110610fbc57610fbc614c31565b602002602001015182610fcf9190614c5d565b9150600101610f25565b50607d80546001600160601b0319166001600160601b039290921691909117905550506071805461ff00191690555060405160ff8216815260008051602061550c833981519152906020015b60405180910390a150565b611038611d6b565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b611062612134565b610bba6121a3565b6110726121f5565b61108a61108436839003830183614ccd565b3361223b565b50565b60006110976121f5565b6110f3848484808060200260200160405190810160405280939291908181526020016000905b828210156110e9576110da60608302860136819003810190614d20565b815260200190600101906110bd565b5050505050612516565b90505b9392505050565b607154610100900460ff161580801561111d5750607154600160ff909116105b806111375750303b158015611137575060715460ff166001145b6111535760405162461bcd60e51b8152600401610c3f90614a80565b6071805460ff191660011790558015611176576071805461ff0019166101001790555b61118160008c6129aa565b607589905561118f8a6129b4565b61121a6040517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81527f159f52c1e3a2b6a6aad3950adf713516211484e0516dad685ea662a094b7c43b60208201527fad7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5604082015246606082015230608082015260a0812060775550565b6112248887612a02565b61122e8787612a92565b5050611238612b29565b60006112448680614d6a565b905011156113055761126d6112598680614d6a565b6112666020890189614d6a565b8787611e9a565b61129361127a8680614d6a565b8660005b60200281019061128e9190614d6a565b612b76565b6112b96112a08680614d6a565b8660015b6020028101906112b49190614d6a565b611dc5565b6112df6112c68680614d6a565b8660025b6020028101906112da9190614d6a565b612c4b565b6113056112ec8680614d6a565b8660035b6020028101906113009190614d6a565b612d5c565b60005b6113156040870187614d6a565b9050811015611381576113797f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e461134f6040890189614d6a565b8481811061135f5761135f614c31565b905060200201602081019061137491906141ad565b6120f0565b600101611308565b5080156113b6576071805461ff00191690556040516001815260008051602061550c8339815191529060200160405180910390a15b5050505050505050505050565b60006110f68383612e31565b60006113eb6113e6607d546001600160601b031690565b612efc565b905090565b6113f8612134565b610bba612f32565b611408611d6b565b61141181612f6f565b610e4f8282612042565b6000600b61142881612fa5565b825186908114158061143a5750808514155b15611466576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b8060000361147e57506347c28ec560e11b9150611593565b60005b818110156115865784818151811061149b5761149b614c31565b60200260200101511561157e578686828181106114ba576114ba614c31565b90506020020160208101906114cf9190614db3565b607d80546001600160601b031981166001600160601b03918216939093011691909117905586868281811061150657611506614c31565b905060200201602081019061151b9190614db3565b607e60008b8b8581811061153157611531614c31565b905060200201602081019061154691906141ad565b6001600160a01b03168152602081019190915260400160002080546001600160601b0319166001600160601b03929092169190911790555b600101611481565b506347c28ec560e11b9250505b5095945050505050565b60008281526073602052604081206110f69083612ff1565b7f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e46115df816120e6565b60006115f86115f336859003850185614e2d565b612ffd565b905061160c6115f336859003850185614e2d565b83356000908152607960205260409020541461163b5760405163f4b8742f60e01b815260040160405180910390fd5b82356000908152607a602052604090205460ff1661166c5760405163147bfe0760e01b815260040160405180910390fd5b82356000908152607a602052604090819020805460ff19169055517fd639511b37b3b002cca6cfe6bca0d833945a5af5a045578a0627fc43b79b2630906116b69083908690614f00565b60405180910390a160006116d060808501606086016141ad565b905060006116e661012086016101008701614f86565b60028111156116f7576116f7614766565b036117be5760006117113686900386016101008701614fa1565b6001600160a01b0383166000908152603b602052604090205490915061173d90610140870135906130c7565b604082015260006117573687900387016101008801614fa1565b604083015190915061176e90610140880135614fbd565b604082015260745461178e908390339086906001600160a01b03166130e1565b6117b76117a160608801604089016141ad565b60745483919086906001600160a01b03166130e1565b50506117fa565b6117fa6117d160608601604087016141ad565b60745483906001600160a01b03166117f23689900389016101008a01614fa1565b9291906130e1565b7f21e88e956aa3e086f6388e899965cef814688f99ad8bb29b08d396571016372d828560405161182b929190614f00565b60405180910390a150505050565b60009182526072602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61186c611d6b565b600083900361188e576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484612b76565b6000806118a5611d6b565b6118af8484612a92565b90925090506118bc612b29565b9250929050565b60006118d7607d546001600160601b031690565b6037546118e49190614fd0565b6038546118f19084614fd0565b101592915050565b611901611d6b565b6000839003611923576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484612c4b565b60408051808201909152600080825260208201526001600160a01b0382166000908152607860205260409081902081518083019092528054829060ff16600281111561197d5761197d614766565b600281111561198e5761198e614766565b815290546001600160a01b03610100909104811660209283015290820151919250166119cd57604051631b79f53b60e21b815260040160405180910390fd5b919050565b6119da611d6b565b6119e48282612a02565b610e4f612b29565b6000600b6119f981612fa5565b84838114611a28576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b80600003611a405750636242a4ef60e11b9150611b77565b6000805b82811015611b2757868682818110611a5e57611a5e614c31565b9050602002016020810190611a739190614fe7565b15611b1f57607e60008a8a84818110611a8e57611a8e614c31565b9050602002016020810190611aa391906141ad565b6001600160a01b0316815260208101919091526040016000908120546001600160601b03169290920191607e908a8a84818110611ae257611ae2614c31565b9050602002016020810190611af791906141ad565b6001600160a01b03168152602081019190915260400160002080546001600160601b03191690555b600101611a44565b50607d8054829190600090611b469084906001600160601b0316615004565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555063c48549de60e01b935050505b50949350505050565b6000818152607360205260408120610bfb90613313565b600082815260726020526040902060010154611bb2816120e6565b610dd08383612112565b611bc4611d6b565b61108a816129b4565b6000611be1607d546001600160601b031690565b600154611bee9190614fd0565b6002546118f19084614fd0565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115611c3257611c32614766565b60ff1681526020810191909152604001600020546001600160a01b03169050806119cd578160405163409140df60e11b8152600401610c3f9190615034565b611c79611d6b565b6000869003611c9b576040516316ee9d3b60e11b815260040160405180910390fd5b611ca9878787878787611e9a565b611cb6878783600061127e565b611cc387878360016112a4565b611cd087878360026112ca565b611cdd87878360036112f0565b50505050505050565b611cee611d6b565b6000839003611d10576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484612d5c565b611d246121f5565b611d2c61412d565b33815260408082015134910152805161108a90829061223b565b60006001600160e01b03198216630271189760e51b1480610bfb5750610bfb8261331d565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610bba576000356001600160e01b0319166001604051620f948f60ea1b8152600401610c3f929190615042565b828114611df3576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015611e6457828282818110611e1057611e10614c31565b90506020020135603a6000878785818110611e2d57611e2d614c31565b9050602002016020810190611e4291906141ad565b6001600160a01b03168152602081019190915260400160002055600101611df6565b507f64557254143204d91ba2d95acb9fda1e5fea55f77efd028685765bc1e94dd4b58484848460405161182b94939291906150b9565b8483148015611ea857508481145b611ed3576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b85811015611ff857848482818110611ef057611ef0614c31565b9050602002016020810190611f0591906141ad565b60786000898985818110611f1b57611f1b614c31565b9050602002016020810190611f3091906141ad565b6001600160a01b03908116825260208201929092526040016000208054610100600160a81b0319166101009390921692909202179055828282818110611f7857611f78614c31565b9050602002016020810190611f8d9190614f86565b60786000898985818110611fa357611fa3614c31565b9050602002016020810190611fb891906141ad565b6001600160a01b031681526020810191909152604001600020805460ff19166001836002811115611feb57611feb614766565b0217905550600101611ed6565b507fa4f03cc9c0e0aeb5b71b4ec800702753f65748c2cf3064695ba8e8b46be7044486868686868660405161203296959493929190615105565b60405180910390a1505050505050565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f81111561207857612078614766565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f8111156120b9576120b9614766565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b61108a8133613342565b6120fa82826133a6565b6000828152607360205260409020610dd0908261342c565b61211c8282613441565b6000828152607360205260409020610dd090826134a8565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031633148061217657506005546001600160a01b031633145b610bba576000356001600160e01b0319166001604051620f948f60ea1b8152600401610c3f929190615042565b6121ab6134bd565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60005460ff1615610bba5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610c3f565b604080518082018252600080825260208201526074549184015190916001600160a01b03169061226a90613506565b60208401516001600160a01b031661230b5734846040015160400151146122a45760405163129c2ce160e31b815260040160405180910390fd5b6122ad8161192f565b60408501515190925060028111156122c7576122c7614766565b825160028111156122da576122da614766565b146122f75760405162035e2b60ea1b815260040160405180910390fd5b6001600160a01b03811660208501526124a3565b341561232a5760405163129c2ce160e31b815260040160405180910390fd5b612337846020015161192f565b604085015151909250600281111561235157612351614766565b8251600281111561236457612364614766565b146123815760405162035e2b60ea1b815260040160405180910390fd5b6020840151604085015161239691859061354a565b83602001516001600160a01b0316816001600160a01b0316036124a357607454607f54604086810151810151905163095ea7b360e01b81526001600160a01b039283166004820152602481019190915291169063095ea7b3906044016020604051808303816000875af1158015612411573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124359190615176565b50607f546040808601518101519051636f074d1f60e11b81526001600160a01b039092169163de0e9a3e916124709160040190815260200190565b600060405180830381600087803b15801561248a57600080fd5b505af115801561249e573d6000803e3d6000fd5b505050505b60768054600091826124b483615193565b91905055905060006124db858386602001516075548a6136c390949392919063ffffffff16565b90507fd7b25068d9dc8d00765254cfb7f5070f98d263c8d68931d937c7362fa738048b61250782612ffd565b826040516120329291906151cc565b600082356101408401358261253160808701606088016141ad565b905061254e6125493688900388016101008901614fa1565b613506565b60016125606040880160208901615268565b600181111561257157612571614766565b1461258f5760405163182f3d8760e11b815260040160405180910390fd5b608086013546146125d15760405163092048d160e11b81526000356001600160e01b031916600482015260808701356024820152466044820152606401610c3f565b60006125e66109746080890160608a016141ad565b90506125fa61012088016101008901614f86565b600281111561260b5761260b614766565b8151600281111561261e5761261e614766565b14801561264f575061263660e0880160c089016141ad565b6001600160a01b031681602001516001600160a01b0316145b8015612660575060755460e0880135145b61267d5760405163f4b8742f60e01b815260040160405180910390fd5b600084815260796020526040902054156126aa57604051634f13df6160e01b815260040160405180910390fd5b60016126be61012089016101008a01614f86565b60028111156126cf576126cf614766565b14806126e257506126e08284612e31565b155b6126ff5760405163c51297b760e01b815260040160405180910390fd5b60006127136115f3368a90038a018a614e2d565b9050600061272360775483613798565b9050600061274361273c6101208c016101008d01614f86565b86886137d9565b60408051606081018252600080825260208201819052918101829052919a50919250819081906000805b8e51811015612881578e818151811061278857612788614c31565b6020908102919091018101518051818301516040808401518151600081529586018083528e905260ff9093169085015260608401526080830152935060019060a0016020604051602081039080840390855afa1580156127ec573d6000803e3d6000fd5b505050602060405103519450846001600160a01b0316846001600160a01b031610612838576000356001600160e01b031916604051635d3dcd3160e01b8152600401610c3f9190614712565b6001600160a01b0385166000908152607e60205260409020548594506001600160601b03166128679083615283565b91508682106128795760019550612881565b60010161276d565b50846128a057604051639e8f5f6360e01b815260040160405180910390fd5b50505060008981526079602052604090208590555050871561291b576000878152607a602052604090819020805460ff19166001179055517f89e52969465b1f1866fc5d46fd62de953962e9cb33552443cd999eba05bd20dc906129079085908d90614f00565b60405180910390a150505050505050610bfb565b6129258587613869565b61296461293860608c0160408d016141ad565b86607460009054906101000a90046001600160a01b03168d610100018036038101906117f29190614fa1565b7f21e88e956aa3e086f6388e899965cef814688f99ad8bb29b08d396571016372d838b604051612995929190614f00565b60405180910390a15050505050505092915050565b610e4f82826120f0565b607480546001600160a01b0319166001600160a01b0383169081179091556040519081527f9d2334c23be647e994f27a72c5eee42a43d5bdcfe15bb88e939103c2b114cbaf90602001611025565b80821115612a31576000356001600160e01b0319166040516387f6f09560e01b8152600401610c3f9190614712565b6001805460028054858455908490556004805493840190556040805183815260208101839052929391928592879290917f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a450505050565b60008082841115612ac4576000356001600160e01b0319166040516387f6f09560e01b8152600401610c3f9190614712565b5050603780546038805492859055839055600480546001810190915560408051838152602081018590529293928592879290917f31312c97b89cc751b832d98fd459b967a2c3eef3b49757d1cf5ebaa12bb6eee1910160405180910390a49250929050565b600254603754612b399190614fd0565b603854600154612b499190614fd0565b1115610bba576000356001600160e01b0319166040516387f6f09560e01b8152600401610c3f9190614712565b828114612ba4576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015612c1557828282818110612bc157612bc1614c31565b9050602002013560396000878785818110612bde57612bde614c31565b9050602002016020810190612bf391906141ad565b6001600160a01b03168152602081019190915260400160002055600101612ba7565b507f80bc635c452ae67f12f9b6f12ad4daa6dbbc04eeb9ebb87d354ce10c0e210dc08484848460405161182b94939291906150b9565b828114612c79576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015612d2657620f4240838383818110612c9a57612c9a614c31565b905060200201351115612cc05760405163572d3bd360e11b815260040160405180910390fd5b828282818110612cd257612cd2614c31565b90506020020135603b6000878785818110612cef57612cef614c31565b9050602002016020810190612d0491906141ad565b6001600160a01b03168152602081019190915260400160002055600101612c7c565b507fb05f5de88ae0294ebb6f67c5af2fcbbd593cc6bdfe543e2869794a4c8ce3ea508484848460405161182b94939291906150b9565b828114612d8a576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015612dfb57828282818110612da757612da7614c31565b90506020020135603c6000878785818110612dc457612dc4614c31565b9050602002016020810190612dd991906141ad565b6001600160a01b03168152602081019190915260400160002055600101612d8d565b507fb5d2963614d72181b4df1f993d45b83edf42fa19710f0204217ba1b3e183bb738484848460405161182b94939291906150b9565b6001600160a01b0382166000908152603a60205260408120548210612e5857506000610bfb565b6000612e676201518042615296565b6001600160a01b0385166000908152603e6020526040902054909150811115612ead5750506001600160a01b0382166000908152603c6020526040902054811015610bfb565b6001600160a01b0384166000908152603d6020526040902054612ed1908490615283565b6001600160a01b0385166000908152603c602052604090205411159150610bfb9050565b5092915050565b6000600254600160025484600154612f149190614fd0565b612f1e9190615283565b612f289190614fbd565b610bfb9190615296565b612f3a6121f5565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586121d83390565b806001600160a01b03163b60000361108a57604051630bfc64a360e21b81526001600160a01b0382166004820152602401610c3f565b612fae81611bfb565b6001600160a01b0316336001600160a01b03161461108a576000356001600160e01b03191681336040516320e0f98d60e21b8152600401610c3f939291906152b8565b60006110f683836138f9565b60008061300d8360400151613923565b9050600061301e8460600151613923565b905060006130728560800151604080517f1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d815282516020808301919091528301518183015291015160608201526080902090565b604080517fb9d1fe7c9deeec5dc90a2f47ff1684239519f2545b2228d3d91fb27df3189eea815287516020808301919091529097015190870152606086019390935250608084015260a08301525060c0902090565b6000620f42406130d78385614fd0565b6110f69190615296565b806001600160a01b0316826001600160a01b03160361318e5760408085015190516001600160a01b0385169180156108fc02916000818181858888f1935050505061318957806001600160a01b031663d0e30db085604001516040518263ffffffff1660e01b81526004016000604051808303818588803b15801561316557600080fd5b505af1158015613179573d6000803e3d6000fd5b505050505061318984848461396b565b610cdc565b6000845160028111156131a3576131a3614766565b03613269576040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156131ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061321391906152ef565b905084604001518110156132585761323b83308388604001516132369190614fbd565b6139ea565b61325857604051632f739fff60e11b815260040160405180910390fd5b61326385858561396b565b50610cdc565b60018451600281111561327e5761327e614766565b036132af5761329282848660200151613a8f565b6131895760405163c8e3a09f60e01b815260040160405180910390fd5b6002845160028111156132c4576132c4614766565b036132fa576132dd828486602001518760400151613ab6565b613189576040516334b471a760e21b815260040160405180910390fd5b6040516361e411a760e11b815260040160405180910390fd5b6000610bfb825490565b60006001600160e01b03198216635a05180f60e01b1480610bfb5750610bfb82613ae3565b61334c8282611839565b610e4f57613364816001600160a01b03166014613b18565b61336f836020613b18565b60405160200161338092919061532c565b60408051601f198184030181529082905262461bcd60e51b8252610c3f916004016153cd565b6133b08282611839565b610e4f5760008281526072602090815260408083206001600160a01b03851684529091529020805460ff191660011790556133e83390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006110f6836001600160a01b038416613cb3565b61344b8282611839565b15610e4f5760008281526072602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006110f6836001600160a01b038416613d02565b60005460ff16610bba5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610c3f565b61350f81613df5565b8061351e575061351e81613e2c565b8061352d575061352d81613e54565b61108a5760405163034992a760e51b815260040160405180910390fd5b60006060818551600281111561356257613562614766565b0361363d5760408581015181516001600160a01b03878116602483015230604483015260648083019390935283518083039093018352608490910183526020820180516001600160e01b03166323b872dd60e01b1790529151918516916135c991906153e0565b6000604051808303816000865af19150503d8060008114613606576040519150601f19603f3d011682016040523d82523d6000602084013e61360b565b606091505b5090925090508180156136365750805115806136365750808060200190518101906136369190615176565b9150613696565b60018551600281111561365257613652614766565b03613667576136368385308860200151613e7d565b60028551600281111561367c5761367c614766565b036132fa5761363683853088602001518960400151613f2b565b816136bc5784843085604051639d2e4c6760e01b8152600401610c3f94939291906153fc565b5050505050565b6137336040805160a08101825260008082526020808301829052835160608082018652838252818301849052818601849052848601919091528451808201865283815280830184905280860184905281850152845190810185528281529081018290529283015290608082015290565b83815260006020820181905250604080820180516001600160a01b039788169052602080890151825190891690820152905146908301528751606084018051918916909152805195909716940193909352935182015292909201516080820152919050565b6040805161190160f01b60208083019190915260228201859052604280830185905283518084039091018152606290920190925280519101206000906110f6565b60008060006137f0607d546001600160601b031690565b90506137fb81612efc565b9250600086600281111561381157613811614766565b03613860576001600160a01b03851660009081526039602052604090205484106138415761383e81613fdf565b92505b6001600160a01b0385166000908152603a602052604090205484101591505b50935093915050565b60006138786201518042615296565b6001600160a01b0384166000908152603e60205260409020549091508111156138c7576001600160a01b03929092166000908152603e6020908152604080832094909455603d90529190912055565b6001600160a01b0383166000908152603d6020526040812080548492906138ef908490615283565b9091555050505050565b600082600001828154811061391057613910614c31565b9060005260206000200154905092915050565b604080517f353bdd8d69b9e3185b3972e08b03845c0c14a21a390215302776a7a34b0e8764815282516020808301919091528301518183015291015160608201526080902090565b6000808451600281111561398157613981614766565b0361399c5761399582848660400151613ff7565b90506139c6565b6001845160028111156139b1576139b1614766565b036132fa576139958230858760200151613e7d565b80610cdc578383836040516341bd7d9160e11b8152600401610c3f93929190615432565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b03166340c10f1960e01b1790529151600092861691613a42916153e0565b6000604051808303816000865af19150503d8060008114613a7f576040519150601f19603f3d011682016040523d82523d6000602084013e613a84565b606091505b509095945050505050565b6000613a9d84308585613e7d565b9050806110f657613aaf8484846139ea565b90506110f6565b6000613ac58530868686613f2b565b905080613adb57613ad8858585856140ca565b90505b949350505050565b60006001600160e01b03198216637965db0b60e01b1480610bfb57506301ffc9a760e01b6001600160e01b0319831614610bfb565b60606000613b27836002614fd0565b613b32906002615283565b6001600160401b03811115613b4957613b4961457c565b6040519080825280601f01601f191660200182016040528015613b73576020820181803683370190505b509050600360fc1b81600081518110613b8e57613b8e614c31565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613bbd57613bbd614c31565b60200101906001600160f81b031916908160001a9053506000613be1846002614fd0565b613bec906001615283565b90505b6001811115613c64576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613c2057613c20614c31565b1a60f81b828281518110613c3657613c36614c31565b60200101906001600160f81b031916908160001a90535060049490941c93613c5d81615462565b9050613bef565b5083156110f65760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c3f565b6000818152600183016020526040812054613cfa57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610bfb565b506000610bfb565b60008181526001830160205260408120548015613deb576000613d26600183614fbd565b8554909150600090613d3a90600190614fbd565b9050818114613d9f576000866000018281548110613d5a57613d5a614c31565b9060005260206000200154905080876000018481548110613d7d57613d7d614c31565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613db057613db0615479565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610bfb565b6000915050610bfb565b60008082516002811115613e0b57613e0b614766565b148015613e1c575060008260400151115b8015610bfb575050602001511590565b6000600182516002811115613e4357613e43614766565b148015610bfb575050604001511590565b6000600282516002811115613e6b57613e6b614766565b148015610bfb57505060400151151590565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b1790529151600092871691613edd916153e0565b6000604051808303816000865af19150503d8060008114613f1a576040519150601f19603f3d011682016040523d82523d6000602084013e613f1f565b606091505b50909695505050505050565b604080516000808252602082019092526001600160a01b03871690613f5b9087908790879087906044810161548f565b60408051601f198184030181529181526020820180516001600160e01b0316637921219560e11b17905251613f9091906153e0565b6000604051808303816000865af19150503d8060008114613fcd576040519150601f19603f3d011682016040523d82523d6000602084013e613fd2565b606091505b5090979650505050505050565b6000603854600160385484603754612f149190614fd0565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000926060929087169161405491906153e0565b6000604051808303816000865af19150503d8060008114614091576040519150601f19603f3d011682016040523d82523d6000602084013e614096565b606091505b5090925090508180156140c15750805115806140c15750808060200190518101906140c19190615176565b95945050505050565b604080516000808252602082019092526001600160a01b038616906140f890869086908690604481016154d4565b60408051601f198184030181529181526020820180516001600160e01b031663731133e960e01b17905251613edd91906153e0565b60408051606081018252600080825260208201529081016141696040805160608101909152806000815260200160008152602001600081525090565b905290565b60006020828403121561418057600080fd5b81356001600160e01b0319811681146110f657600080fd5b6001600160a01b038116811461108a57600080fd5b6000602082840312156141bf57600080fd5b81356110f681614198565b60008083601f8401126141dc57600080fd5b5081356001600160401b038111156141f357600080fd5b6020830191508360208260051b85010111156118bc57600080fd5b6000806000806040858703121561422457600080fd5b84356001600160401b038082111561423b57600080fd5b614247888389016141ca565b9096509450602087013591508082111561426057600080fd5b5061426d878288016141ca565b95989497509550505050565b6000806000806000806060878903121561429257600080fd5b86356001600160401b03808211156142a957600080fd5b6142b58a838b016141ca565b909850965060208901359150808211156142ce57600080fd5b6142da8a838b016141ca565b909650945060408901359150808211156142f357600080fd5b5061430089828a016141ca565b979a9699509497509295939492505050565b80356119cd81614198565b60006020828403121561432f57600080fd5b5035919050565b6000806040838503121561434957600080fd5b82359150602083013561435b81614198565b809150509250929050565b600060a0828403121561437857600080fd5b50919050565b6000610160828403121561437857600080fd5b600080600061018084860312156143a757600080fd5b6143b1858561437e565b92506101608401356001600160401b03808211156143ce57600080fd5b818601915086601f8301126143e257600080fd5b8135818111156143f157600080fd5b87602060608302850101111561440657600080fd5b6020830194508093505050509250925092565b8060608101831015610bfb57600080fd5b8060808101831015610bfb57600080fd5b6000806000806000806000806000806101208b8d03121561445b57600080fd5b6144648b614312565b995061447260208c01614312565b985060408b0135975060608b0135965060808b0135955060a08b0135945060c08b01356001600160401b03808211156144aa57600080fd5b6144b68e838f01614419565b955060e08d01359150808211156144cc57600080fd5b6144d88e838f0161442a565b94506101008d01359150808211156144ef57600080fd5b506144fc8d828e016141ca565b915080935050809150509295989b9194979a5092959850565b6000806040838503121561452857600080fd5b823561453381614198565b946020939093013593505050565b8035601081106119cd57600080fd5b6000806040838503121561456357600080fd5b61456c83614541565b9150602083013561435b81614198565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b03811182821017156145b4576145b461457c565b60405290565b604051601f8201601f191681016001600160401b03811182821017156145e2576145e261457c565b604052919050565b60006001600160401b038211156146035761460361457c565b5060051b60200190565b801515811461108a57600080fd5b60008060008060006060868803121561463357600080fd5b85356001600160401b038082111561464a57600080fd5b61465689838a016141ca565b909750955060209150878201358181111561467057600080fd5b61467c8a828b016141ca565b90965094505060408801358181111561469457600080fd5b88019050601f810189136146a757600080fd5b80356146ba6146b5826145ea565b6145ba565b81815260059190911b8201830190838101908b8311156146d957600080fd5b928401925b828410156147005783356146f18161460d565b825292840192908401906146de565b80955050505050509295509295909350565b6001600160e01b031991909116815260200190565b6000806040838503121561473a57600080fd5b50508035926020909101359150565b6000610160828403121561475c57600080fd5b6110f6838361437e565b634e487b7160e01b600052602160045260246000fd5b6003811061478c5761478c614766565b9052565b60006040820190506147a382845161477c565b6020928301516001600160a01b0316919092015290565b600082601f8301126147cb57600080fd5b813560206147db6146b5836145ea565b8083825260208201915060208460051b8701019350868411156147fd57600080fd5b602086015b848110156148195780358352918301918301614802565b509695505050505050565b600082601f83011261483557600080fd5b81356001600160401b0381111561484e5761484e61457c565b614861601f8201601f19166020016145ba565b81815284602083860101111561487657600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a086880312156148ab57600080fd5b85356148b681614198565b945060208601356148c681614198565b935060408601356001600160401b03808211156148e257600080fd5b6148ee89838a016147ba565b9450606088013591508082111561490457600080fd5b61491089838a016147ba565b9350608088013591508082111561492657600080fd5b5061493388828901614824565b9150509295509295909350565b60006020828403121561495257600080fd5b6110f682614541565b60008060008060008060006080888a03121561497657600080fd5b87356001600160401b038082111561498d57600080fd5b6149998b838c016141ca565b909950975060208a01359150808211156149b257600080fd5b6149be8b838c016141ca565b909750955060408a01359150808211156149d757600080fd5b6149e38b838c016141ca565b909550935060608a01359150808211156149fc57600080fd5b50614a098a828b0161442a565b91505092959891949750929550565b600080600080600060a08688031215614a3057600080fd5b8535614a3b81614198565b94506020860135614a4b81614198565b9350604086013592506060860135915060808601356001600160401b03811115614a7457600080fd5b61493388828901614824565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b600082601f830112614adf57600080fd5b81516020614aef6146b5836145ea565b8083825260208201915060208460051b870101935086841115614b1157600080fd5b602086015b84811015614819578051614b2981614198565b8352918301918301614b16565b6001600160601b038116811461108a57600080fd5b600080600060608486031215614b6057600080fd5b83516001600160401b0380821115614b7757600080fd5b614b8387838801614ace565b9450602091508186015181811115614b9a57600080fd5b614ba688828901614ace565b945050604086015181811115614bbb57600080fd5b86019050601f81018713614bce57600080fd5b8051614bdc6146b5826145ea565b81815260059190911b82018301908381019089831115614bfb57600080fd5b928401925b82841015614c22578351614c1381614b36565b82529284019290840190614c00565b80955050505050509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6001600160601b03818116838216019080821115612ef557612ef5614c47565b8035600381106119cd57600080fd5b600060608284031215614c9e57600080fd5b614ca6614592565b9050614cb182614c7d565b8152602082013560208201526040820135604082015292915050565b600060a08284031215614cdf57600080fd5b614ce7614592565b8235614cf281614198565b81526020830135614d0281614198565b6020820152614d148460408501614c8c565b60408201529392505050565b600060608284031215614d3257600080fd5b614d3a614592565b823560ff81168114614d4b57600080fd5b8152602083810135908201526040928301359281019290925250919050565b6000808335601e19843603018112614d8157600080fd5b8301803591506001600160401b03821115614d9b57600080fd5b6020019150600581901b36038213156118bc57600080fd5b600060208284031215614dc557600080fd5b81356110f681614b36565b8035600281106119cd57600080fd5b600060608284031215614df157600080fd5b614df9614592565b90508135614e0681614198565b81526020820135614e1681614198565b806020830152506040820135604082015292915050565b60006101608284031215614e4057600080fd5b60405160a081018181106001600160401b0382111715614e6257614e6261457c565b60405282358152614e7560208401614dd0565b6020820152614e878460408501614ddf565b6040820152614e998460a08501614ddf565b6060820152614eac846101008501614c8c565b60808201529392505050565b6002811061478c5761478c614766565b8035614ed381614198565b6001600160a01b039081168352602082013590614eef82614198565b166020830152604090810135910152565b60006101808201905083825282356020830152614f1f60208401614dd0565b614f2c6040840182614eb8565b50614f3d6060830160408501614ec8565b614f4d60c0830160a08501614ec8565b610120614f68818401614f636101008701614c7d565b61477c565b61014081850135818501528085013561016085015250509392505050565b600060208284031215614f9857600080fd5b6110f682614c7d565b600060608284031215614fb357600080fd5b6110f68383614c8c565b81810381811115610bfb57610bfb614c47565b8082028115828204841417610bfb57610bfb614c47565b600060208284031215614ff957600080fd5b81356110f68161460d565b6001600160601b03828116828216039080821115612ef557612ef5614c47565b6010811061478c5761478c614766565b60208101610bfb8284615024565b6001600160e01b03198316815260408101600b831061506357615063614766565b8260208301529392505050565b8183526000602080850194508260005b858110156150ae57813561509381614198565b6001600160a01b031687529582019590820190600101615080565b509495945050505050565b6040815260006150cd604083018688615070565b82810360208401528381526001600160fb1b038411156150ec57600080fd5b8360051b80866020840137016020019695505050505050565b60608152600061511960608301888a615070565b6020838203602085015261512e82888a615070565b848103604086015285815286925060200160005b868110156151675761515782614f6386614c7d565b9282019290820190600101615142565b509a9950505050505050505050565b60006020828403121561518857600080fd5b81516110f68161460d565b6000600182016151a5576151a5614c47565b5060010190565b6151b782825161477c565b60208181015190830152604090810151910152565b6000610180820190508382528251602083015260208301516151f16040840182614eb8565b5060408381015180516001600160a01b03908116606086015260208201511660808501529081015160a084015250606083015180516001600160a01b0390811660c085015260208201511660e084015260408101516101008401525060808301516152606101208401826151ac565b509392505050565b60006020828403121561527a57600080fd5b6110f682614dd0565b80820180821115610bfb57610bfb614c47565b6000826152b357634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031984168152606081016152d66020830185615024565b6001600160a01b03929092166040919091015292915050565b60006020828403121561530157600080fd5b5051919050565b60005b8381101561532357818101518382015260200161530b565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615364816017850160208801615308565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615395816028840160208801615308565b01602801949350505050565b600081518084526153b9816020860160208601615308565b601f01601f19169290920160200192915050565b6020815260006110f660208301846153a1565b600082516153f2818460208701615308565b9190910192915050565b60c0810161540a82876151ac565b6001600160a01b0394851660608301529284166080820152921660a090920191909152919050565b60a0810161544082866151ac565b6001600160a01b03938416606083015291909216608090920191909152919050565b60008161547157615471614c47565b506000190190565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906154c9908301846153a1565b979650505050505050565b60018060a01b038516815283602082015282604082015260806060820152600061550160808301846153a1565b969550505050505056fe7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498a264697066735822122039bdd676fa56a806e2f91eb197d0a444b13ff0899114d328ae5983c28d58606164736f6c63430008170033", "chainId": 11155111, "contractAbsolutePath": "MainchainGatewayV3.sol", - "deployedBytecode": "0x60806040526004361061031e5760003560e01c8063865e6fd3116101ab578063b1d08a03116100f7578063d55ed10311610095578063de981f1b1161006f578063de981f1b14610999578063dff525e1146109b9578063e400327c146109d9578063e75235b8146109f95761032d565b8063d55ed1031461092c578063d64af2a614610959578063dafae408146109795761032d565b8063ca15c873116100d1578063ca15c873146108a7578063cdb67444146108c7578063d19773d2146108df578063d547741f1461090c5761032d565b8063b1d08a031461082d578063b29757941461085a578063b9c36209146108875761032d565b80639dcc4da311610164578063ab7965661161013e578063ab796566146107aa578063ac78dfe8146107d7578063affed0e0146107f7578063b1a2567e1461080d5761032d565b80639dcc4da314610760578063a217fddf14610795578063a3912ec81461032b5761032d565b8063865e6fd31461068c5780638f34e347146106ac5780639010d07c146106e05780639157921c1461070057806391d148541461072057806393c5678f146107405761032d565b806336568abe1161026a578063504af48c116102235780636932be98116101fd5780636932be98146106155780636c1ce670146106425780637de5dedd146106625780638456cb59146106775761032d565b8063504af48c146105bd57806359122f6b146105d05780635c975abb146105fd5761032d565b806336568abe146105055780633e70838b146105255780633f4ba83a146105455780634b14557e1461055a5780634d0d66731461056d5780634d493f4e1461058d5761032d565b80631d4a7210116102d75780632dfdf0b5116102b15780632dfdf0b5146104a35780632f2ff15d146104b9578063302d12db146104d95780633644e515146104f05761032d565b80631d4a721014610426578063248a9ca31461045357806329b6eca9146104835761032d565b806301ffc9a714610335578063065b3adf1461036a57806317ce2dd4146103a257806317fcb39b146103c65780631a8e55b0146103e65780631b6e7594146104065761032d565b3661032d5761032b610a11565b005b61032b610a11565b34801561034157600080fd5b506103556103503660046138ea565b610a51565b60405190151581526020015b60405180910390f35b34801561037657600080fd5b5060055461038a906001600160a01b031681565b6040516001600160a01b039091168152602001610361565b3480156103ae57600080fd5b506103b860755481565b604051908152602001610361565b3480156103d257600080fd5b5060745461038a906001600160a01b031681565b3480156103f257600080fd5b5061032b610401366004613959565b610a7c565b34801561041257600080fd5b5061032b6104213660046139c5565b610ab8565b34801561043257600080fd5b506103b8610441366004613a7f565b603e6020526000908152604090205481565b34801561045f57600080fd5b506103b861046e366004613a9c565b60009081526072602052604090206001015490565b34801561048f57600080fd5b5061032b61049e366004613a7f565b610af8565b3480156104af57600080fd5b506103b860765481565b3480156104c557600080fd5b5061032b6104d4366004613ab5565b610ba3565b3480156104e557600080fd5b506103b8620f424081565b3480156104fc57600080fd5b506077546103b8565b34801561051157600080fd5b5061032b610520366004613ab5565b610bcd565b34801561053157600080fd5b5061032b610540366004613a7f565b610c4b565b34801561055157600080fd5b5061032b610c75565b61032b610568366004613ae5565b610c85565b34801561057957600080fd5b50610355610588366004613b10565b610ca5565b34801561059957600080fd5b506103556105a8366004613a9c565b607a6020526000908152604090205460ff1681565b61032b6105cb366004613bbb565b610d13565b3480156105dc57600080fd5b506103b86105eb366004613a7f565b603a6020526000908152604090205481565b34801561060957600080fd5b5060005460ff16610355565b34801561062157600080fd5b506103b8610630366004613a9c565b60796020526000908152604090205481565b34801561064e57600080fd5b5061035561065d366004613c96565b610fed565b34801561066e57600080fd5b506103b8611000565b34801561068357600080fd5b5061032b611017565b34801561069857600080fd5b5061032b6106a7366004613cd1565b611027565b3480156106b857600080fd5b506103b87f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e481565b3480156106ec57600080fd5b5061038a6106fb366004613cfd565b611042565b34801561070c57600080fd5b5061032b61071b366004613d1f565b61105a565b34801561072c57600080fd5b5061035561073b366004613ab5565b6112de565b34801561074c57600080fd5b5061032b61075b366004613959565b611309565b34801561076c57600080fd5b5061078061077b366004613cfd565b61133f565b60408051928352602083019190915201610361565b3480156107a157600080fd5b506103b8600081565b3480156107b657600080fd5b506103b86107c5366004613a7f565b603c6020526000908152604090205481565b3480156107e357600080fd5b506103556107f2366004613a9c565b611368565b34801561080357600080fd5b506103b860045481565b34801561081957600080fd5b5061032b610828366004613959565b611394565b34801561083957600080fd5b506103b8610848366004613a7f565b60396020526000908152604090205481565b34801561086657600080fd5b5061087a610875366004613a7f565b6113ca565b6040516103619190613d62565b34801561089357600080fd5b506107806108a2366004613cfd565b61146d565b3480156108b357600080fd5b506103b86108c2366004613a9c565b611482565b3480156108d357600080fd5b50603754603854610780565b3480156108eb57600080fd5b506103b86108fa366004613a7f565b603b6020526000908152604090205481565b34801561091857600080fd5b5061032b610927366004613ab5565b611499565b34801561093857600080fd5b506103b8610947366004613a7f565b603d6020526000908152604090205481565b34801561096557600080fd5b5061032b610974366004613a7f565b6114be565b34801561098557600080fd5b50610355610994366004613a9c565b6114cf565b3480156109a557600080fd5b5061038a6109b4366004613d8e565b6114f3565b3480156109c557600080fd5b5061032b6109d4366004613da9565b611569565b3480156109e557600080fd5b5061032b6109f4366004613959565b6115de565b348015610a0557600080fd5b50600154600254610780565b610a19611614565b6074546001600160a01b03163314610a4f57610a336138a9565b338152604080820151349101528051610a4d90829061165a565b505b565b60006001600160e01b03198216635a05180f60e01b1480610a765750610a76826118bb565b92915050565b610a846118f0565b6000839003610aa6576040516316ee9d3b60e11b815260040160405180910390fd5b610ab28484848461194a565b50505050565b610ac06118f0565b6000859003610ae2576040516316ee9d3b60e11b815260040160405180910390fd5b610af0868686868686611a1f565b505050505050565b607154600290610100900460ff16158015610b1a575060715460ff8083169116105b610b3f5760405162461bcd60e51b8152600401610b3690613e67565b60405180910390fd5b6071805461ffff191660ff831617610100179055610b5e600b83611bb6565b6071805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b600082815260726020526040902060010154610bbe81611c5a565b610bc88383611c64565b505050565b6001600160a01b0381163314610c3d5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610b36565b610c478282611c86565b5050565b610c536118f0565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b610c7d611ca8565b610a4f611d17565b610c8d611614565b610a4d610c9f36839003830183613f54565b3361165a565b6000610caf611614565b610d0b848484808060200260200160405190810160405280939291908181526020016000905b82821015610d0157610cf260608302860136819003810190613fa7565b81526020019060010190610cd5565b5050505050611d69565b949350505050565b607154610100900460ff1615808015610d335750607154600160ff909116105b80610d4d5750303b158015610d4d575060715460ff166001145b610d695760405162461bcd60e51b8152600401610b3690613e67565b6071805460ff191660011790558015610d8c576071805461ff0019166101001790555b610d9760008c6121d3565b6075899055610da58a6121dd565b610e306040517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81527f159f52c1e3a2b6a6aad3950adf713516211484e0516dad685ea662a094b7c43b60208201527fad7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5604082015246606082015230608082015260a0812060775550565b610e3a8887612231565b5050610e4687876122c8565b5050610e50612355565b6000610e5c8680614007565b90501115610f1d57610e85610e718680614007565b610e7e6020890189614007565b8787611a1f565b610eab610e928680614007565b8660005b602002810190610ea69190614007565b6123a2565b610ed1610eb88680614007565b8660015b602002810190610ecc9190614007565b61194a565b610ef7610ede8680614007565b8660025b602002810190610ef29190614007565b612477565b610f1d610f048680614007565b8660035b602002810190610f189190614007565b612588565b60005b610f2d6040870187614007565b9050811015610f9957610f917f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e4610f676040890189614007565b84818110610f7757610f77613ff1565b9050602002016020810190610f8c9190613a7f565b611c64565b600101610f20565b508015610fe0576071805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050505050565b6000610ff9838361265d565b9392505050565b600061101261100d612721565b61278e565b905090565b61101f611ca8565b610a4f6127c4565b61102f6118f0565b61103881612801565b610c478282611bb6565b6000828152607360205260408120610ff99083612837565b7f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e461108481611c5a565b600061109d6110983685900385018561409f565b612843565b90506110b16110983685900385018561409f565b8335600090815260796020526040902054146110e05760405163f4b8742f60e01b815260040160405180910390fd5b82356000908152607a602052604090205460ff166111115760405163147bfe0760e01b815260040160405180910390fd5b82356000908152607a602052604090819020805460ff19169055517fd639511b37b3b002cca6cfe6bca0d833945a5af5a045578a0627fc43b79b26309061115b9083908690614173565b60405180910390a160006111756080850160608601613a7f565b9050600061118b61012086016101008701614200565b600181111561119c5761119c613d3c565b036112635760006111b6368690038601610100870161421d565b6001600160a01b0383166000908152603b60205260409020549091506111e2906101408701359061290d565b604082015260006111fc368790038701610100880161421d565b60408301519091506112139061014088013561424f565b6040820152607454611233908390339086906001600160a01b0316612927565b61125c6112466060880160408901613a7f565b60745483919086906001600160a01b0316612927565b505061129f565b61129f6112766060860160408701613a7f565b60745483906001600160a01b03166112973689900389016101008a0161421d565b929190612927565b7f21e88e956aa3e086f6388e899965cef814688f99ad8bb29b08d396571016372d82856040516112d0929190614173565b60405180910390a150505050565b60009182526072602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6113116118f0565b6000839003611333576040516316ee9d3b60e11b815260040160405180910390fd5b610ab2848484846123a2565b60008061134a6118f0565b61135484846122c8565b9092509050611361612355565b9250929050565b6000611372612721565b60375461137f9190614262565b60385461138c9084614262565b101592915050565b61139c6118f0565b60008390036113be576040516316ee9d3b60e11b815260040160405180910390fd5b610ab284848484612477565b60408051808201909152600080825260208201526001600160a01b0382166000908152607860205260409081902081518083019092528054829060ff16600181111561141857611418613d3c565b600181111561142957611429613d3c565b815290546001600160a01b036101009091048116602092830152908201519192501661146857604051631b79f53b60e21b815260040160405180910390fd5b919050565b6000806114786118f0565b6113548484612231565b6000818152607360205260408120610a7690612c63565b6000828152607260205260409020600101546114b481611c5a565b610bc88383611c86565b6114c66118f0565b610a4d816121dd565b60006114d9612721565b6001546114e69190614262565b60025461138c9084614262565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f81111561152a5761152a613d3c565b60ff1681526020810191909152604001600020546001600160a01b0316905080611468578160405163409140df60e11b8152600401610b369190614279565b6115716118f0565b6000869003611593576040516316ee9d3b60e11b815260040160405180910390fd5b6115a1878787878787611a1f565b6115ae8787836000610e96565b6115bb8787836001610ebc565b6115c88787836002610ee2565b6115d58787836003610f08565b50505050505050565b6115e66118f0565b6000839003611608576040516316ee9d3b60e11b815260040160405180910390fd5b610ab284848484612588565b60005460ff1615610a4f5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610b36565b604080518082018252600080825260208201526074549184015190916001600160a01b03169061168990612c6d565b60208401516001600160a01b031661172a5734846040015160400151146116c35760405163129c2ce160e31b815260040160405180910390fd5b6116cc816113ca565b60408501515190925060018111156116e6576116e6613d3c565b825160018111156116f9576116f9613d3c565b146117165760405162035e2b60ea1b815260040160405180910390fd5b6001600160a01b0381166020850152611838565b34156117495760405163129c2ce160e31b815260040160405180910390fd5b61175684602001516113ca565b604085015151909250600181111561177057611770613d3c565b8251600181111561178357611783613d3c565b146117a05760405162035e2b60ea1b815260040160405180910390fd5b602084015160408501516117b79185903090612ce8565b83602001516001600160a01b0316816001600160a01b031603611838576040848101518101519051632e1a7d4d60e01b815260048101919091526001600160a01b03821690632e1a7d4d90602401600060405180830381600087803b15801561181f57600080fd5b505af1158015611833573d6000803e3d6000fd5b505050505b607680546000918261184983614293565b9190505590506000611870858386602001516075548a612ec990949392919063ffffffff16565b90507fd7b25068d9dc8d00765254cfb7f5070f98d263c8d68931d937c7362fa738048b61189c82612843565b826040516118ab9291906142ce565b60405180910390a1505050505050565b60006001600160e01b03198216637965db0b60e01b1480610a7657506301ffc9a760e01b6001600160e01b0319831614610a76565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610a4f576000356001600160e01b0319166001604051620f948f60ea1b8152600401610b3692919061436c565b828114611978576000356001600160e01b0319166040516306b5667560e21b8152600401610b36919061439a565b60005b838110156119e95782828281811061199557611995613ff1565b90506020020135603a60008787858181106119b2576119b2613ff1565b90506020020160208101906119c79190613a7f565b6001600160a01b0316815260208101919091526040016000205560010161197b565b507f64557254143204d91ba2d95acb9fda1e5fea55f77efd028685765bc1e94dd4b5848484846040516112d094939291906143f8565b8483148015611a2d57508481145b611a58576000356001600160e01b0319166040516306b5667560e21b8152600401610b36919061439a565b60005b85811015611b7c57848482818110611a7557611a75613ff1565b9050602002016020810190611a8a9190613a7f565b60786000898985818110611aa057611aa0613ff1565b9050602002016020810190611ab59190613a7f565b6001600160a01b03908116825260208201929092526040016000208054610100600160a81b0319166101009390921692909202179055828282818110611afd57611afd613ff1565b9050602002016020810190611b129190614200565b60786000898985818110611b2857611b28613ff1565b9050602002016020810190611b3d9190613a7f565b6001600160a01b031681526020810191909152604001600020805460ff191660018381811115611b6f57611b6f613d3c565b0217905550600101611a5b565b507fa4f03cc9c0e0aeb5b71b4ec800702753f65748c2cf3064695ba8e8b46be704448686868686866040516118ab96959493929190614444565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f811115611bec57611bec613d3c565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115611c2d57611c2d613d3c565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b610a4d8133612f9e565b611c6e8282613002565b6000828152607360205260409020610bc89082613088565b611c90828261309d565b6000828152607360205260409020610bc89082613104565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b0316331480611cea57506005546001600160a01b031633145b610a4f576000356001600160e01b0319166001604051620f948f60ea1b8152600401610b3692919061436c565b611d1f613119565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000823561014084013582611d846080870160608801613a7f565b9050611da1611d9c368890038801610100890161421d565b612c6d565b6001611db36040880160208901614200565b6001811115611dc457611dc4613d3c565b14611de25760405163182f3d8760e11b815260040160405180910390fd5b60808601354614611e245760405163092048d160e11b81526000356001600160e01b031916600482015260808701356024820152466044820152606401610b36565b6000611e396108756080890160608a01613a7f565b9050611e4d61012088016101008901614200565b6001811115611e5e57611e5e613d3c565b81516001811115611e7157611e71613d3c565b148015611ea25750611e8960e0880160c08901613a7f565b6001600160a01b031681602001516001600160a01b0316145b611ebf5760405163f4b8742f60e01b815260040160405180910390fd5b60008481526079602052604090205415611eec57604051634f13df6160e01b815260040160405180910390fd5b6001611f0061012089016101008a01614200565b6001811115611f1157611f11613d3c565b1480611f245750611f22828461265d565b155b611f415760405163c51297b760e01b815260040160405180910390fd5b6000611f55611098368a90038a018a61409f565b90506000611f6560775483613162565b90506000611f85611f7e6101208c016101008d01614200565b86886131a3565b60408051606081018252600080825260208201819052918101829052919a50919250819081906000805b8e518110156120aa578e8181518110611fca57611fca613ff1565b6020908102919091018101518051818301516040808401518151600081529586018083528e905260ff9093169085015260608401526080830152935060019060a0016020604051602081039080840390855afa15801561202e573d6000803e3d6000fd5b505050602060405103519450846001600160a01b0316846001600160a01b03161061207a576000356001600160e01b031916604051635d3dcd3160e01b8152600401610b36919061439a565b84935061208685613229565b61209090836144be565b91508682106120a257600195506120aa565b600101611faf565b50846120c957604051639e8f5f6360e01b815260040160405180910390fd5b505050600089815260796020526040902085905550508715612144576000878152607a602052604090819020805460ff19166001179055517f89e52969465b1f1866fc5d46fd62de953962e9cb33552443cd999eba05bd20dc906121309085908d90614173565b60405180910390a150505050505050610a76565b61214e85876132b5565b61218d61216160608c0160408d01613a7f565b86607460009054906101000a90046001600160a01b03168d61010001803603810190611297919061421d565b7f21e88e956aa3e086f6388e899965cef814688f99ad8bb29b08d396571016372d838b6040516121be929190614173565b60405180910390a15050505050505092915050565b610c478282611c64565b607480546001600160a01b0319166001600160a01b0383169081179091556040519081527f9d2334c23be647e994f27a72c5eee42a43d5bdcfe15bb88e939103c2b114cbaf9060200160405180910390a150565b60008082841115612263576000356001600160e01b0319166040516387f6f09560e01b8152600401610b36919061439a565b50506001805460028054858455908490556004805493840190556040805183815260208101839052929391928592879290917f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f891015b60405180910390a49250929050565b600080828411156122fa576000356001600160e01b0319166040516387f6f09560e01b8152600401610b36919061439a565b5050603780546038805492859055839055600480546001810190915560408051838152602081018590529293928592879290917f31312c97b89cc751b832d98fd459b967a2c3eef3b49757d1cf5ebaa12bb6eee191016122b9565b6002546037546123659190614262565b6038546001546123759190614262565b1115610a4f576000356001600160e01b0319166040516387f6f09560e01b8152600401610b36919061439a565b8281146123d0576000356001600160e01b0319166040516306b5667560e21b8152600401610b36919061439a565b60005b83811015612441578282828181106123ed576123ed613ff1565b905060200201356039600087878581811061240a5761240a613ff1565b905060200201602081019061241f9190613a7f565b6001600160a01b031681526020810191909152604001600020556001016123d3565b507f80bc635c452ae67f12f9b6f12ad4daa6dbbc04eeb9ebb87d354ce10c0e210dc0848484846040516112d094939291906143f8565b8281146124a5576000356001600160e01b0319166040516306b5667560e21b8152600401610b36919061439a565b60005b8381101561255257620f42408383838181106124c6576124c6613ff1565b9050602002013511156124ec5760405163572d3bd360e11b815260040160405180910390fd5b8282828181106124fe576124fe613ff1565b90506020020135603b600087878581811061251b5761251b613ff1565b90506020020160208101906125309190613a7f565b6001600160a01b031681526020810191909152604001600020556001016124a8565b507fb05f5de88ae0294ebb6f67c5af2fcbbd593cc6bdfe543e2869794a4c8ce3ea50848484846040516112d094939291906143f8565b8281146125b6576000356001600160e01b0319166040516306b5667560e21b8152600401610b36919061439a565b60005b83811015612627578282828181106125d3576125d3613ff1565b90506020020135603c60008787858181106125f0576125f0613ff1565b90506020020160208101906126059190613a7f565b6001600160a01b031681526020810191909152604001600020556001016125b9565b507fb5d2963614d72181b4df1f993d45b83edf42fa19710f0204217ba1b3e183bb73848484846040516112d094939291906143f8565b6001600160a01b0382166000908152603a6020526040812054821061268457506000610a76565b600061269362015180426144d1565b6001600160a01b0385166000908152603e60205260409020549091508111156126d95750506001600160a01b0382166000908152603c6020526040902054811015610a76565b6001600160a01b0384166000908152603d60205260409020546126fd9084906144be565b6001600160a01b0385166000908152603c602052604090205411159150610a769050565b600061272d600b6114f3565b6001600160a01b03166306aba0e16040518163ffffffff1660e01b8152600401602060405180830381865afa15801561276a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061101291906144f3565b60006002546001600254846001546127a69190614262565b6127b091906144be565b6127ba919061424f565b610a7691906144d1565b6127cc611614565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611d4c3390565b806001600160a01b03163b600003610a4d57604051630bfc64a360e21b81526001600160a01b0382166004820152602401610b36565b6000610ff98383613345565b600080612853836040015161336f565b90506000612864846060015161336f565b905060006128b88560800151604080517f1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d815282516020808301919091528301518183015291015160608201526080902090565b604080517fb9d1fe7c9deeec5dc90a2f47ff1684239519f2545b2228d3d91fb27df3189eea815287516020808301919091529097015190870152606086019390935250608084015260a08301525060c0902090565b6000620f424061291d8385614262565b610ff991906144d1565b6000816001600160a01b0316836001600160a01b0316036129d65760408086015190516001600160a01b0386169180156108fc02916000818181858888f193505050506129d157816001600160a01b031663d0e30db086604001516040518263ffffffff1660e01b81526004016000604051808303818588803b1580156129ad57600080fd5b505af11580156129c1573d6000803e3d6000fd5b50505050506129d18585856133b7565b612c5c565b6000855160018111156129eb576129eb613d3c565b03612b54576040516370a0823160e01b81523060048201526000906001600160a01b038516906370a0823190602401602060405180830381865afa158015612a37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a5b91906144f3565b90508560400151811015612b4357836001600160a01b03166340c10f1930838960400151612a89919061424f565b6040516001600160a01b03909216602483015260448201526064016040516020818303038152906040529060e01b6020820180516001600160e01b038381831617835250505050604051612add9190614530565b6000604051808303816000865af19150503d8060008114612b1a576040519150601f19603f3d011682016040523d82523d6000602084013e612b1f565b606091505b50508092505081612b4357604051632f739fff60e11b815260040160405180910390fd5b612b4e8686866133b7565b50612c5c565b600185516001811115612b6957612b69613d3c565b03612c4357612b7d83858760200151613435565b6129d157602085810151604080516001600160a01b038881166024830152604480830194909452825180830390940184526064909101825292820180516001600160e01b03166340c10f1960e01b1790525191851691612bdd9190614530565b6000604051808303816000865af19150503d8060008114612c1a576040519150601f19603f3d011682016040523d82523d6000602084013e612c1f565b606091505b505080915050806129d15760405163c8e3a09f60e01b815260040160405180910390fd5b6040516361e411a760e11b815260040160405180910390fd5b5050505050565b6000610a76825490565b600081516001811115612c8257612c82613d3c565b148015612c93575060008160400151115b8015612ca157506020810151155b80612ccb5750600181516001811115612cbc57612cbc613d3c565b148015612ccb57506040810151155b610a4d5760405163034992a760e51b815260040160405180910390fd5b600060608186516001811115612d0057612d00613d3c565b03612ddd5760408681015181516001600160a01b038881166024830152878116604483015260648083019390935283518083039093018352608490910183526020820180516001600160e01b03166323b872dd60e01b179052915191851691612d699190614530565b6000604051808303816000865af19150503d8060008114612da6576040519150601f19603f3d011682016040523d82523d6000602084013e612dab565b606091505b509092509050818015612dd6575080511580612dd6575080806020019051810190612dd6919061454c565b9150612ea3565b600186516001811115612df257612df2613d3c565b03612c4357602086810151604080516001600160a01b0389811660248301528881166044830152606480830194909452825180830390940184526084909101825292820180516001600160e01b03166323b872dd60e01b1790525191851691612e5b9190614530565b6000604051808303816000865af19150503d8060008114612e98576040519150601f19603f3d011682016040523d82523d6000602084013e612e9d565b606091505b50909250505b81610af05785858585604051639d2e4c6760e01b8152600401610b36949392919061456e565b612f396040805160a08101825260008082526020808301829052835160608082018652838252818301849052818601849052848601919091528451808201865283815280830184905280860184905281850152845190810185528281529081018290529283015290608082015290565b83815260006020820181905250604080820180516001600160a01b039788169052602080890151825190891690820152905146908301528751606084018051918916909152805195909716940193909352935182015292909201516080820152919050565b612fa882826112de565b610c4757612fc0816001600160a01b031660146134e0565b612fcb8360206134e0565b604051602001612fdc9291906145a4565b60408051601f198184030181529082905262461bcd60e51b8252610b3691600401614619565b61300c82826112de565b610c475760008281526072602090815260408083206001600160a01b03851684529091529020805460ff191660011790556130443390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610ff9836001600160a01b03841661367c565b6130a782826112de565b15610c475760008281526072602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610ff9836001600160a01b0384166136cb565b60005460ff16610a4f5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610b36565b6040805161190160f01b6020808301919091526022820185905260428083018590528351808403909101815260629092019092528051910120600090610ff9565b60008060006131b0612721565b90506131bb8161278e565b925060008660018111156131d1576131d1613d3c565b03613220576001600160a01b0385166000908152603960205260409020548410613201576131fe816137be565b92505b6001600160a01b0385166000908152603a602052604090205484101591505b50935093915050565b6000613235600b6114f3565b60405163901979d560e01b81526001600160a01b038481166004830152919091169063901979d590602401602060405180830381865afa15801561327d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132a1919061464c565b6bffffffffffffffffffffffff1692915050565b60006132c462015180426144d1565b6001600160a01b0384166000908152603e6020526040902054909150811115613313576001600160a01b03929092166000908152603e6020908152604080832094909455603d90529190912055565b6001600160a01b0383166000908152603d60205260408120805484929061333b9084906144be565b9091555050505050565b600082600001828154811061335c5761335c613ff1565b9060005260206000200154905092915050565b604080517f353bdd8d69b9e3185b3972e08b03845c0c14a21a390215302776a7a34b0e8764815282516020808301919091528301518183015291015160608201526080902090565b600080845160018111156133cd576133cd613d3c565b036133e8576133e1828486604001516137d6565b9050613411565b6001845160018111156133fd576133fd613d3c565b03612c43576133e182848660200151613435565b80610ab2578383836040516341bd7d9160e11b8152600401610b369392919061467a565b604080513060248201526001600160a01b038481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b179052915160009286169161349391614530565b6000604051808303816000865af19150503d80600081146134d0576040519150601f19603f3d011682016040523d82523d6000602084013e6134d5565b606091505b509095945050505050565b606060006134ef836002614262565b6134fa9060026144be565b67ffffffffffffffff81111561351257613512613eb5565b6040519080825280601f01601f19166020018201604052801561353c576020820181803683370190505b509050600360fc1b8160008151811061355757613557613ff1565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061358657613586613ff1565b60200101906001600160f81b031916908160001a90535060006135aa846002614262565b6135b59060016144be565b90505b600181111561362d576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106135e9576135e9613ff1565b1a60f81b8282815181106135ff576135ff613ff1565b60200101906001600160f81b031916908160001a90535060049490941c93613626816146aa565b90506135b8565b508315610ff95760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610b36565b60008181526001830160205260408120546136c357508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610a76565b506000610a76565b600081815260018301602052604081205480156137b45760006136ef60018361424f565b85549091506000906137039060019061424f565b905081811461376857600086600001828154811061372357613723613ff1565b906000526020600020015490508087600001848154811061374657613746613ff1565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613779576137796146c1565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610a76565b6000915050610a76565b60006038546001603854846037546127a69190614262565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1790529151600092606092908716916138339190614530565b6000604051808303816000865af19150503d8060008114613870576040519150601f19603f3d011682016040523d82523d6000602084013e613875565b606091505b5090925090508180156138a05750805115806138a05750808060200190518101906138a0919061454c565b95945050505050565b60408051606081018252600080825260208201529081016138e56040805160608101909152806000815260200160008152602001600081525090565b905290565b6000602082840312156138fc57600080fd5b81356001600160e01b031981168114610ff957600080fd5b60008083601f84011261392657600080fd5b50813567ffffffffffffffff81111561393e57600080fd5b6020830191508360208260051b850101111561136157600080fd5b6000806000806040858703121561396f57600080fd5b843567ffffffffffffffff8082111561398757600080fd5b61399388838901613914565b909650945060208701359150808211156139ac57600080fd5b506139b987828801613914565b95989497509550505050565b600080600080600080606087890312156139de57600080fd5b863567ffffffffffffffff808211156139f657600080fd5b613a028a838b01613914565b90985096506020890135915080821115613a1b57600080fd5b613a278a838b01613914565b90965094506040890135915080821115613a4057600080fd5b50613a4d89828a01613914565b979a9699509497509295939492505050565b6001600160a01b0381168114610a4d57600080fd5b803561146881613a5f565b600060208284031215613a9157600080fd5b8135610ff981613a5f565b600060208284031215613aae57600080fd5b5035919050565b60008060408385031215613ac857600080fd5b823591506020830135613ada81613a5f565b809150509250929050565b600060a08284031215613af757600080fd5b50919050565b60006101608284031215613af757600080fd5b60008060006101808486031215613b2657600080fd5b613b308585613afd565b925061016084013567ffffffffffffffff80821115613b4e57600080fd5b818601915086601f830112613b6257600080fd5b813581811115613b7157600080fd5b876020606083028501011115613b8657600080fd5b6020830194508093505050509250925092565b8060608101831015610a7657600080fd5b8060808101831015610a7657600080fd5b6000806000806000806000806000806101208b8d031215613bdb57600080fd5b613be48b613a74565b9950613bf260208c01613a74565b985060408b0135975060608b0135965060808b0135955060a08b0135945060c08b013567ffffffffffffffff80821115613c2b57600080fd5b613c378e838f01613b99565b955060e08d0135915080821115613c4d57600080fd5b613c598e838f01613baa565b94506101008d0135915080821115613c7057600080fd5b50613c7d8d828e01613914565b915080935050809150509295989b9194979a5092959850565b60008060408385031215613ca957600080fd5b8235613cb481613a5f565b946020939093013593505050565b80356010811061146857600080fd5b60008060408385031215613ce457600080fd5b613ced83613cc2565b91506020830135613ada81613a5f565b60008060408385031215613d1057600080fd5b50508035926020909101359150565b60006101608284031215613d3257600080fd5b610ff98383613afd565b634e487b7160e01b600052602160045260246000fd5b60028110610a4d57610a4d613d3c565b81516040820190613d7281613d52565b82526020928301516001600160a01b0316929091019190915290565b600060208284031215613da057600080fd5b610ff982613cc2565b60008060008060008060006080888a031215613dc457600080fd5b873567ffffffffffffffff80821115613ddc57600080fd5b613de88b838c01613914565b909950975060208a0135915080821115613e0157600080fd5b613e0d8b838c01613914565b909750955060408a0135915080821115613e2657600080fd5b613e328b838c01613914565b909550935060608a0135915080821115613e4b57600080fd5b50613e588a828b01613baa565b91505092959891949750929550565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715613efc57634e487b7160e01b600052604160045260246000fd5b60405290565b60028110610a4d57600080fd5b600060608284031215613f2157600080fd5b613f29613ecb565b90508135613f3681613f02565b80825250602082013560208201526040820135604082015292915050565b600060a08284031215613f6657600080fd5b613f6e613ecb565b8235613f7981613a5f565b81526020830135613f8981613a5f565b6020820152613f9b8460408501613f0f565b60408201529392505050565b600060608284031215613fb957600080fd5b613fc1613ecb565b823560ff81168114613fd257600080fd5b8152602083810135908201526040928301359281019290925250919050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261401e57600080fd5b83018035915067ffffffffffffffff82111561403957600080fd5b6020019150600581901b360382131561136157600080fd5b60006060828403121561406357600080fd5b61406b613ecb565b9050813561407881613a5f565b8152602082013561408881613a5f565b806020830152506040820135604082015292915050565b600061016082840312156140b257600080fd5b60405160a0810181811067ffffffffffffffff821117156140e357634e487b7160e01b600052604160045260246000fd5b6040528235815260208301356140f881613f02565b602082015261410a8460408501614051565b604082015261411c8460a08501614051565b606082015261412f846101008501613f0f565b60808201529392505050565b803561414681613a5f565b6001600160a01b03908116835260208201359061416282613a5f565b166020830152604090810135910152565b60006101808201905083825282356020830152602083013561419481613f02565b61419d81613d52565b806040840152506141b4606083016040850161413b565b6141c460c0830160a0850161413b565b6101206101008401356141d681613f02565b6141df81613d52565b81840152830135610140808401919091529092013561016090910152919050565b60006020828403121561421257600080fd5b8135610ff981613f02565b60006060828403121561422f57600080fd5b610ff98383613f0f565b634e487b7160e01b600052601160045260246000fd5b81810381811115610a7657610a76614239565b8082028115828204841417610a7657610a76614239565b602081016010831061428d5761428d613d3c565b91905290565b6000600182016142a5576142a5614239565b5060010190565b80516142b781613d52565b825260208181015190830152604090810151910152565b6000610180820190508382528251602083015260208301516142ef81613d52565b6040838101919091528381015180516001600160a01b03908116606086015260208201511660808501529081015160a084015250606083015180516001600160a01b0390811660c085015260208201511660e084015260408101516101008401525060808301516143646101208401826142ac565b509392505050565b6001600160e01b03198316815260408101600b831061438d5761438d613d3c565b8260208301529392505050565b6001600160e01b031991909116815260200190565b8183526000602080850194508260005b858110156143ed5781356143d281613a5f565b6001600160a01b0316875295820195908201906001016143bf565b509495945050505050565b60408152600061440c6040830186886143af565b82810360208401528381526001600160fb1b0384111561442b57600080fd5b8360051b80866020840137016020019695505050505050565b60608152600061445860608301888a6143af565b6020838203602085015261446d82888a6143af565b848103604086015285815286925060200160005b868110156144af57833561449481613f02565b61449d81613d52565b82529282019290820190600101614481565b509a9950505050505050505050565b80820180821115610a7657610a76614239565b6000826144ee57634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561450557600080fd5b5051919050565b60005b8381101561452757818101518382015260200161450f565b50506000910152565b6000825161454281846020870161450c565b9190910192915050565b60006020828403121561455e57600080fd5b81518015158114610ff957600080fd5b60c0810161457c82876142ac565b6001600160a01b0394851660608301529284166080820152921660a090920191909152919050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516145dc81601785016020880161450c565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161460d81602884016020880161450c565b01602801949350505050565b602081526000825180602084015261463881604085016020870161450c565b601f01601f19169190910160400192915050565b60006020828403121561465e57600080fd5b81516bffffffffffffffffffffffff81168114610ff957600080fd5b60a0810161468882866142ac565b6001600160a01b03938416606083015291909216608090920191909152919050565b6000816146b9576146b9614239565b506000190190565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220ec8cc7f89d632f5b6c36d2cdb75ab664383134c4e4a6f2157e2624267b4eadfe64736f6c63430008170033", - "deployer": "0x31762cdd4Aa65CD6f5F09D7a05a56211720A1168", + "deployedBytecode": "0x60806040526004361061039b5760003560e01c80638f34e347116101dc578063b9c3620911610102578063d55ed103116100a0578063dff525e11161006f578063dff525e114610b04578063e400327c14610b24578063e75235b814610b44578063f23a6e6114610b5c576103aa565b8063d55ed10314610a77578063d64af2a614610aa4578063dafae40814610ac4578063de981f1b14610ae4576103aa565b8063ca15c873116100dc578063ca15c873146109f2578063cdb6744414610a12578063d19773d214610a2a578063d547741f14610a57576103aa565b8063b9c3620914610986578063bc197c81146109a6578063c48549de146109d2576103aa565b8063a217fddf1161017a578063affed0e011610149578063affed0e0146108f6578063b1a2567e1461090c578063b1d08a031461092c578063b297579414610959576103aa565b8063a217fddf14610894578063a3912ec8146103a8578063ab796566146108a9578063ac78dfe8146108d6576103aa565b80639157921c116101b65780639157921c146107ff57806391d148541461081f57806393c5678f1461083f5780639dcc4da31461085f576103aa565b80638f34e3471461077e5780638f851d8a146107b25780639010d07c146107df576103aa565b806338e454b1116102c1578063504af48c1161025f5780636c1ce6701161022e5780636c1ce670146107145780637de5dedd146107345780638456cb5914610749578063865e6fd31461075e576103aa565b8063504af48c1461068f57806359122f6b146106a25780635c975abb146106cf5780636932be98146106e7576103aa565b80634b14557e1161029b5780634b14557e1461060c5780634d0d66731461061f5780634d493f4e1461063f5780634f4247a11461066f576103aa565b806338e454b1146105c25780633e70838b146105d75780633f4ba83a146105f7576103aa565b80631d4a7210116103395780632f2ff15d116103085780632f2ff15d14610556578063302d12db146105765780633644e5151461058d57806336568abe146105a2576103aa565b80631d4a7210146104c3578063248a9ca3146104f057806329b6eca9146105205780632dfdf0b514610540576103aa565b806317ce2dd41161037557806317ce2dd41461043f57806317fcb39b146104635780631a8e55b0146104835780631b6e7594146104a3576103aa565b806301ffc9a7146103b2578063065b3adf146103e7578063110a83081461041f576103aa565b366103aa576103a8610b88565b005b6103a8610b88565b3480156103be57600080fd5b506103d26103cd36600461416e565b610bbc565b60405190151581526020015b60405180910390f35b3480156103f357600080fd5b50600554610407906001600160a01b031681565b6040516001600160a01b0390911681526020016103de565b34801561042b57600080fd5b506103a861043a3660046141ad565b610c01565b34801561044b57600080fd5b5061045560755481565b6040519081526020016103de565b34801561046f57600080fd5b50607454610407906001600160a01b031681565b34801561048f57600080fd5b506103a861049e36600461420e565b610ca6565b3480156104af57600080fd5b506103a86104be366004614279565b610ce2565b3480156104cf57600080fd5b506104556104de3660046141ad565b603e6020526000908152604090205481565b3480156104fc57600080fd5b5061045561050b36600461431d565b60009081526072602052604090206001015490565b34801561052c57600080fd5b506103a861053b3660046141ad565b610d22565b34801561054c57600080fd5b5061045560765481565b34801561056257600080fd5b506103a8610571366004614336565b610dab565b34801561058257600080fd5b50610455620f424081565b34801561059957600080fd5b50607754610455565b3480156105ae57600080fd5b506103a86105bd366004614336565b610dd5565b3480156105ce57600080fd5b506103a8610e53565b3480156105e357600080fd5b506103a86105f23660046141ad565b611030565b34801561060357600080fd5b506103a861105a565b6103a861061a366004614366565b61106a565b34801561062b57600080fd5b506103d261063a366004614391565b61108d565b34801561064b57600080fd5b506103d261065a36600461431d565b607a6020526000908152604090205460ff1681565b34801561067b57600080fd5b50607f54610407906001600160a01b031681565b6103a861069d36600461443b565b6110fd565b3480156106ae57600080fd5b506104556106bd3660046141ad565b603a6020526000908152604090205481565b3480156106db57600080fd5b5060005460ff166103d2565b3480156106f357600080fd5b5061045561070236600461431d565b60796020526000908152604090205481565b34801561072057600080fd5b506103d261072f366004614515565b6113c3565b34801561074057600080fd5b506104556113cf565b34801561075557600080fd5b506103a86113f0565b34801561076a57600080fd5b506103a8610779366004614550565b611400565b34801561078a57600080fd5b506104557f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e481565b3480156107be57600080fd5b506107d26107cd36600461461b565b61141b565b6040516103de9190614712565b3480156107eb57600080fd5b506104076107fa366004614727565b61159d565b34801561080b57600080fd5b506103a861081a366004614749565b6115b5565b34801561082b57600080fd5b506103d261083a366004614336565b611839565b34801561084b57600080fd5b506103a861085a36600461420e565b611864565b34801561086b57600080fd5b5061087f61087a366004614727565b61189a565b604080519283526020830191909152016103de565b3480156108a057600080fd5b50610455600081565b3480156108b557600080fd5b506104556108c43660046141ad565b603c6020526000908152604090205481565b3480156108e257600080fd5b506103d26108f136600461431d565b6118c3565b34801561090257600080fd5b5061045560045481565b34801561091857600080fd5b506103a861092736600461420e565b6118f9565b34801561093857600080fd5b506104556109473660046141ad565b60396020526000908152604090205481565b34801561096557600080fd5b506109796109743660046141ad565b61192f565b6040516103de9190614790565b34801561099257600080fd5b506103a86109a1366004614727565b6119d2565b3480156109b257600080fd5b506107d26109c1366004614893565b63bc197c8160e01b95945050505050565b3480156109de57600080fd5b506107d26109ed36600461420e565b6119ec565b3480156109fe57600080fd5b50610455610a0d36600461431d565b611b80565b348015610a1e57600080fd5b5060375460385461087f565b348015610a3657600080fd5b50610455610a453660046141ad565b603b6020526000908152604090205481565b348015610a6357600080fd5b506103a8610a72366004614336565b611b97565b348015610a8357600080fd5b50610455610a923660046141ad565b603d6020526000908152604090205481565b348015610ab057600080fd5b506103a8610abf3660046141ad565b611bbc565b348015610ad057600080fd5b506103d2610adf36600461431d565b611bcd565b348015610af057600080fd5b50610407610aff366004614940565b611bfb565b348015610b1057600080fd5b506103a8610b1f36600461495b565b611c71565b348015610b3057600080fd5b506103a8610b3f36600461420e565b611ce6565b348015610b5057600080fd5b5060015460025461087f565b348015610b6857600080fd5b506107d2610b77366004614a18565b63f23a6e6160e01b95945050505050565b6074546001600160a01b0316331480610bab5750607f546001600160a01b031633145b15610bb257565b610bba611d1c565b565b60006001600160e01b031982166246560160e51b1480610bec57506001600160e01b031982166312c0151560e21b145b80610bfb5750610bfb82611d46565b92915050565b607154600490610100900460ff16158015610c23575060715460ff8083169116105b610c485760405162461bcd60e51b8152600401610c3f90614a80565b60405180910390fd5b60718054607f80546001600160a01b0319166001600160a01b03861617905561ff001961010060ff851661ffff199093168317171690915560405190815260008051602061550c833981519152906020015b60405180910390a15050565b610cae611d6b565b6000839003610cd0576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484611dc5565b50505050565b610cea611d6b565b6000859003610d0c576040516316ee9d3b60e11b815260040160405180910390fd5b610d1a868686868686611e9a565b505050505050565b607154600290610100900460ff16158015610d44575060715460ff8083169116105b610d605760405162461bcd60e51b8152600401610c3f90614a80565b6071805461ffff191660ff831617610100179055610d7f600b83612042565b6071805461ff001916905560405160ff8216815260008051602061550c83398151915290602001610c9a565b600082815260726020526040902060010154610dc6816120e6565b610dd083836120f0565b505050565b6001600160a01b0381163314610e455760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610c3f565b610e4f8282612112565b5050565b607154600390610100900460ff16158015610e75575060715460ff8083169116105b610e915760405162461bcd60e51b8152600401610c3f90614a80565b6071805461ffff191660ff8316176101001790556000610eb1600b611bfb565b9050600080826001600160a01b031663c441c4a86040518163ffffffff1660e01b8152600401600060405180830381865afa158015610ef4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f1c9190810190614b4b565b92509250506000805b8351811015610fd957828181518110610f4057610f40614c31565b6020026020010151607e6000868481518110610f5e57610f5e614c31565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154816001600160601b0302191690836001600160601b03160217905550828181518110610fbc57610fbc614c31565b602002602001015182610fcf9190614c5d565b9150600101610f25565b50607d80546001600160601b0319166001600160601b039290921691909117905550506071805461ff00191690555060405160ff8216815260008051602061550c833981519152906020015b60405180910390a150565b611038611d6b565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b611062612134565b610bba6121a3565b6110726121f5565b61108a61108436839003830183614ccd565b3361223b565b50565b60006110976121f5565b6110f3848484808060200260200160405190810160405280939291908181526020016000905b828210156110e9576110da60608302860136819003810190614d20565b815260200190600101906110bd565b5050505050612516565b90505b9392505050565b607154610100900460ff161580801561111d5750607154600160ff909116105b806111375750303b158015611137575060715460ff166001145b6111535760405162461bcd60e51b8152600401610c3f90614a80565b6071805460ff191660011790558015611176576071805461ff0019166101001790555b61118160008c6129aa565b607589905561118f8a6129b4565b61121a6040517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81527f159f52c1e3a2b6a6aad3950adf713516211484e0516dad685ea662a094b7c43b60208201527fad7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5604082015246606082015230608082015260a0812060775550565b6112248887612a02565b61122e8787612a92565b5050611238612b29565b60006112448680614d6a565b905011156113055761126d6112598680614d6a565b6112666020890189614d6a565b8787611e9a565b61129361127a8680614d6a565b8660005b60200281019061128e9190614d6a565b612b76565b6112b96112a08680614d6a565b8660015b6020028101906112b49190614d6a565b611dc5565b6112df6112c68680614d6a565b8660025b6020028101906112da9190614d6a565b612c4b565b6113056112ec8680614d6a565b8660035b6020028101906113009190614d6a565b612d5c565b60005b6113156040870187614d6a565b9050811015611381576113797f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e461134f6040890189614d6a565b8481811061135f5761135f614c31565b905060200201602081019061137491906141ad565b6120f0565b600101611308565b5080156113b6576071805461ff00191690556040516001815260008051602061550c8339815191529060200160405180910390a15b5050505050505050505050565b60006110f68383612e31565b60006113eb6113e6607d546001600160601b031690565b612efc565b905090565b6113f8612134565b610bba612f32565b611408611d6b565b61141181612f6f565b610e4f8282612042565b6000600b61142881612fa5565b825186908114158061143a5750808514155b15611466576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b8060000361147e57506347c28ec560e11b9150611593565b60005b818110156115865784818151811061149b5761149b614c31565b60200260200101511561157e578686828181106114ba576114ba614c31565b90506020020160208101906114cf9190614db3565b607d80546001600160601b031981166001600160601b03918216939093011691909117905586868281811061150657611506614c31565b905060200201602081019061151b9190614db3565b607e60008b8b8581811061153157611531614c31565b905060200201602081019061154691906141ad565b6001600160a01b03168152602081019190915260400160002080546001600160601b0319166001600160601b03929092169190911790555b600101611481565b506347c28ec560e11b9250505b5095945050505050565b60008281526073602052604081206110f69083612ff1565b7f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e46115df816120e6565b60006115f86115f336859003850185614e2d565b612ffd565b905061160c6115f336859003850185614e2d565b83356000908152607960205260409020541461163b5760405163f4b8742f60e01b815260040160405180910390fd5b82356000908152607a602052604090205460ff1661166c5760405163147bfe0760e01b815260040160405180910390fd5b82356000908152607a602052604090819020805460ff19169055517fd639511b37b3b002cca6cfe6bca0d833945a5af5a045578a0627fc43b79b2630906116b69083908690614f00565b60405180910390a160006116d060808501606086016141ad565b905060006116e661012086016101008701614f86565b60028111156116f7576116f7614766565b036117be5760006117113686900386016101008701614fa1565b6001600160a01b0383166000908152603b602052604090205490915061173d90610140870135906130c7565b604082015260006117573687900387016101008801614fa1565b604083015190915061176e90610140880135614fbd565b604082015260745461178e908390339086906001600160a01b03166130e1565b6117b76117a160608801604089016141ad565b60745483919086906001600160a01b03166130e1565b50506117fa565b6117fa6117d160608601604087016141ad565b60745483906001600160a01b03166117f23689900389016101008a01614fa1565b9291906130e1565b7f21e88e956aa3e086f6388e899965cef814688f99ad8bb29b08d396571016372d828560405161182b929190614f00565b60405180910390a150505050565b60009182526072602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61186c611d6b565b600083900361188e576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484612b76565b6000806118a5611d6b565b6118af8484612a92565b90925090506118bc612b29565b9250929050565b60006118d7607d546001600160601b031690565b6037546118e49190614fd0565b6038546118f19084614fd0565b101592915050565b611901611d6b565b6000839003611923576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484612c4b565b60408051808201909152600080825260208201526001600160a01b0382166000908152607860205260409081902081518083019092528054829060ff16600281111561197d5761197d614766565b600281111561198e5761198e614766565b815290546001600160a01b03610100909104811660209283015290820151919250166119cd57604051631b79f53b60e21b815260040160405180910390fd5b919050565b6119da611d6b565b6119e48282612a02565b610e4f612b29565b6000600b6119f981612fa5565b84838114611a28576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b80600003611a405750636242a4ef60e11b9150611b77565b6000805b82811015611b2757868682818110611a5e57611a5e614c31565b9050602002016020810190611a739190614fe7565b15611b1f57607e60008a8a84818110611a8e57611a8e614c31565b9050602002016020810190611aa391906141ad565b6001600160a01b0316815260208101919091526040016000908120546001600160601b03169290920191607e908a8a84818110611ae257611ae2614c31565b9050602002016020810190611af791906141ad565b6001600160a01b03168152602081019190915260400160002080546001600160601b03191690555b600101611a44565b50607d8054829190600090611b469084906001600160601b0316615004565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555063c48549de60e01b935050505b50949350505050565b6000818152607360205260408120610bfb90613313565b600082815260726020526040902060010154611bb2816120e6565b610dd08383612112565b611bc4611d6b565b61108a816129b4565b6000611be1607d546001600160601b031690565b600154611bee9190614fd0565b6002546118f19084614fd0565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115611c3257611c32614766565b60ff1681526020810191909152604001600020546001600160a01b03169050806119cd578160405163409140df60e11b8152600401610c3f9190615034565b611c79611d6b565b6000869003611c9b576040516316ee9d3b60e11b815260040160405180910390fd5b611ca9878787878787611e9a565b611cb6878783600061127e565b611cc387878360016112a4565b611cd087878360026112ca565b611cdd87878360036112f0565b50505050505050565b611cee611d6b565b6000839003611d10576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484612d5c565b611d246121f5565b611d2c61412d565b33815260408082015134910152805161108a90829061223b565b60006001600160e01b03198216630271189760e51b1480610bfb5750610bfb8261331d565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610bba576000356001600160e01b0319166001604051620f948f60ea1b8152600401610c3f929190615042565b828114611df3576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015611e6457828282818110611e1057611e10614c31565b90506020020135603a6000878785818110611e2d57611e2d614c31565b9050602002016020810190611e4291906141ad565b6001600160a01b03168152602081019190915260400160002055600101611df6565b507f64557254143204d91ba2d95acb9fda1e5fea55f77efd028685765bc1e94dd4b58484848460405161182b94939291906150b9565b8483148015611ea857508481145b611ed3576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b85811015611ff857848482818110611ef057611ef0614c31565b9050602002016020810190611f0591906141ad565b60786000898985818110611f1b57611f1b614c31565b9050602002016020810190611f3091906141ad565b6001600160a01b03908116825260208201929092526040016000208054610100600160a81b0319166101009390921692909202179055828282818110611f7857611f78614c31565b9050602002016020810190611f8d9190614f86565b60786000898985818110611fa357611fa3614c31565b9050602002016020810190611fb891906141ad565b6001600160a01b031681526020810191909152604001600020805460ff19166001836002811115611feb57611feb614766565b0217905550600101611ed6565b507fa4f03cc9c0e0aeb5b71b4ec800702753f65748c2cf3064695ba8e8b46be7044486868686868660405161203296959493929190615105565b60405180910390a1505050505050565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f81111561207857612078614766565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f8111156120b9576120b9614766565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b61108a8133613342565b6120fa82826133a6565b6000828152607360205260409020610dd0908261342c565b61211c8282613441565b6000828152607360205260409020610dd090826134a8565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031633148061217657506005546001600160a01b031633145b610bba576000356001600160e01b0319166001604051620f948f60ea1b8152600401610c3f929190615042565b6121ab6134bd565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60005460ff1615610bba5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610c3f565b604080518082018252600080825260208201526074549184015190916001600160a01b03169061226a90613506565b60208401516001600160a01b031661230b5734846040015160400151146122a45760405163129c2ce160e31b815260040160405180910390fd5b6122ad8161192f565b60408501515190925060028111156122c7576122c7614766565b825160028111156122da576122da614766565b146122f75760405162035e2b60ea1b815260040160405180910390fd5b6001600160a01b03811660208501526124a3565b341561232a5760405163129c2ce160e31b815260040160405180910390fd5b612337846020015161192f565b604085015151909250600281111561235157612351614766565b8251600281111561236457612364614766565b146123815760405162035e2b60ea1b815260040160405180910390fd5b6020840151604085015161239691859061354a565b83602001516001600160a01b0316816001600160a01b0316036124a357607454607f54604086810151810151905163095ea7b360e01b81526001600160a01b039283166004820152602481019190915291169063095ea7b3906044016020604051808303816000875af1158015612411573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124359190615176565b50607f546040808601518101519051636f074d1f60e11b81526001600160a01b039092169163de0e9a3e916124709160040190815260200190565b600060405180830381600087803b15801561248a57600080fd5b505af115801561249e573d6000803e3d6000fd5b505050505b60768054600091826124b483615193565b91905055905060006124db858386602001516075548a6136c390949392919063ffffffff16565b90507fd7b25068d9dc8d00765254cfb7f5070f98d263c8d68931d937c7362fa738048b61250782612ffd565b826040516120329291906151cc565b600082356101408401358261253160808701606088016141ad565b905061254e6125493688900388016101008901614fa1565b613506565b60016125606040880160208901615268565b600181111561257157612571614766565b1461258f5760405163182f3d8760e11b815260040160405180910390fd5b608086013546146125d15760405163092048d160e11b81526000356001600160e01b031916600482015260808701356024820152466044820152606401610c3f565b60006125e66109746080890160608a016141ad565b90506125fa61012088016101008901614f86565b600281111561260b5761260b614766565b8151600281111561261e5761261e614766565b14801561264f575061263660e0880160c089016141ad565b6001600160a01b031681602001516001600160a01b0316145b8015612660575060755460e0880135145b61267d5760405163f4b8742f60e01b815260040160405180910390fd5b600084815260796020526040902054156126aa57604051634f13df6160e01b815260040160405180910390fd5b60016126be61012089016101008a01614f86565b60028111156126cf576126cf614766565b14806126e257506126e08284612e31565b155b6126ff5760405163c51297b760e01b815260040160405180910390fd5b60006127136115f3368a90038a018a614e2d565b9050600061272360775483613798565b9050600061274361273c6101208c016101008d01614f86565b86886137d9565b60408051606081018252600080825260208201819052918101829052919a50919250819081906000805b8e51811015612881578e818151811061278857612788614c31565b6020908102919091018101518051818301516040808401518151600081529586018083528e905260ff9093169085015260608401526080830152935060019060a0016020604051602081039080840390855afa1580156127ec573d6000803e3d6000fd5b505050602060405103519450846001600160a01b0316846001600160a01b031610612838576000356001600160e01b031916604051635d3dcd3160e01b8152600401610c3f9190614712565b6001600160a01b0385166000908152607e60205260409020548594506001600160601b03166128679083615283565b91508682106128795760019550612881565b60010161276d565b50846128a057604051639e8f5f6360e01b815260040160405180910390fd5b50505060008981526079602052604090208590555050871561291b576000878152607a602052604090819020805460ff19166001179055517f89e52969465b1f1866fc5d46fd62de953962e9cb33552443cd999eba05bd20dc906129079085908d90614f00565b60405180910390a150505050505050610bfb565b6129258587613869565b61296461293860608c0160408d016141ad565b86607460009054906101000a90046001600160a01b03168d610100018036038101906117f29190614fa1565b7f21e88e956aa3e086f6388e899965cef814688f99ad8bb29b08d396571016372d838b604051612995929190614f00565b60405180910390a15050505050505092915050565b610e4f82826120f0565b607480546001600160a01b0319166001600160a01b0383169081179091556040519081527f9d2334c23be647e994f27a72c5eee42a43d5bdcfe15bb88e939103c2b114cbaf90602001611025565b80821115612a31576000356001600160e01b0319166040516387f6f09560e01b8152600401610c3f9190614712565b6001805460028054858455908490556004805493840190556040805183815260208101839052929391928592879290917f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a450505050565b60008082841115612ac4576000356001600160e01b0319166040516387f6f09560e01b8152600401610c3f9190614712565b5050603780546038805492859055839055600480546001810190915560408051838152602081018590529293928592879290917f31312c97b89cc751b832d98fd459b967a2c3eef3b49757d1cf5ebaa12bb6eee1910160405180910390a49250929050565b600254603754612b399190614fd0565b603854600154612b499190614fd0565b1115610bba576000356001600160e01b0319166040516387f6f09560e01b8152600401610c3f9190614712565b828114612ba4576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015612c1557828282818110612bc157612bc1614c31565b9050602002013560396000878785818110612bde57612bde614c31565b9050602002016020810190612bf391906141ad565b6001600160a01b03168152602081019190915260400160002055600101612ba7565b507f80bc635c452ae67f12f9b6f12ad4daa6dbbc04eeb9ebb87d354ce10c0e210dc08484848460405161182b94939291906150b9565b828114612c79576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015612d2657620f4240838383818110612c9a57612c9a614c31565b905060200201351115612cc05760405163572d3bd360e11b815260040160405180910390fd5b828282818110612cd257612cd2614c31565b90506020020135603b6000878785818110612cef57612cef614c31565b9050602002016020810190612d0491906141ad565b6001600160a01b03168152602081019190915260400160002055600101612c7c565b507fb05f5de88ae0294ebb6f67c5af2fcbbd593cc6bdfe543e2869794a4c8ce3ea508484848460405161182b94939291906150b9565b828114612d8a576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015612dfb57828282818110612da757612da7614c31565b90506020020135603c6000878785818110612dc457612dc4614c31565b9050602002016020810190612dd991906141ad565b6001600160a01b03168152602081019190915260400160002055600101612d8d565b507fb5d2963614d72181b4df1f993d45b83edf42fa19710f0204217ba1b3e183bb738484848460405161182b94939291906150b9565b6001600160a01b0382166000908152603a60205260408120548210612e5857506000610bfb565b6000612e676201518042615296565b6001600160a01b0385166000908152603e6020526040902054909150811115612ead5750506001600160a01b0382166000908152603c6020526040902054811015610bfb565b6001600160a01b0384166000908152603d6020526040902054612ed1908490615283565b6001600160a01b0385166000908152603c602052604090205411159150610bfb9050565b5092915050565b6000600254600160025484600154612f149190614fd0565b612f1e9190615283565b612f289190614fbd565b610bfb9190615296565b612f3a6121f5565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586121d83390565b806001600160a01b03163b60000361108a57604051630bfc64a360e21b81526001600160a01b0382166004820152602401610c3f565b612fae81611bfb565b6001600160a01b0316336001600160a01b03161461108a576000356001600160e01b03191681336040516320e0f98d60e21b8152600401610c3f939291906152b8565b60006110f683836138f9565b60008061300d8360400151613923565b9050600061301e8460600151613923565b905060006130728560800151604080517f1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d815282516020808301919091528301518183015291015160608201526080902090565b604080517fb9d1fe7c9deeec5dc90a2f47ff1684239519f2545b2228d3d91fb27df3189eea815287516020808301919091529097015190870152606086019390935250608084015260a08301525060c0902090565b6000620f42406130d78385614fd0565b6110f69190615296565b806001600160a01b0316826001600160a01b03160361318e5760408085015190516001600160a01b0385169180156108fc02916000818181858888f1935050505061318957806001600160a01b031663d0e30db085604001516040518263ffffffff1660e01b81526004016000604051808303818588803b15801561316557600080fd5b505af1158015613179573d6000803e3d6000fd5b505050505061318984848461396b565b610cdc565b6000845160028111156131a3576131a3614766565b03613269576040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156131ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061321391906152ef565b905084604001518110156132585761323b83308388604001516132369190614fbd565b6139ea565b61325857604051632f739fff60e11b815260040160405180910390fd5b61326385858561396b565b50610cdc565b60018451600281111561327e5761327e614766565b036132af5761329282848660200151613a8f565b6131895760405163c8e3a09f60e01b815260040160405180910390fd5b6002845160028111156132c4576132c4614766565b036132fa576132dd828486602001518760400151613ab6565b613189576040516334b471a760e21b815260040160405180910390fd5b6040516361e411a760e11b815260040160405180910390fd5b6000610bfb825490565b60006001600160e01b03198216635a05180f60e01b1480610bfb5750610bfb82613ae3565b61334c8282611839565b610e4f57613364816001600160a01b03166014613b18565b61336f836020613b18565b60405160200161338092919061532c565b60408051601f198184030181529082905262461bcd60e51b8252610c3f916004016153cd565b6133b08282611839565b610e4f5760008281526072602090815260408083206001600160a01b03851684529091529020805460ff191660011790556133e83390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006110f6836001600160a01b038416613cb3565b61344b8282611839565b15610e4f5760008281526072602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006110f6836001600160a01b038416613d02565b60005460ff16610bba5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610c3f565b61350f81613df5565b8061351e575061351e81613e2c565b8061352d575061352d81613e54565b61108a5760405163034992a760e51b815260040160405180910390fd5b60006060818551600281111561356257613562614766565b0361363d5760408581015181516001600160a01b03878116602483015230604483015260648083019390935283518083039093018352608490910183526020820180516001600160e01b03166323b872dd60e01b1790529151918516916135c991906153e0565b6000604051808303816000865af19150503d8060008114613606576040519150601f19603f3d011682016040523d82523d6000602084013e61360b565b606091505b5090925090508180156136365750805115806136365750808060200190518101906136369190615176565b9150613696565b60018551600281111561365257613652614766565b03613667576136368385308860200151613e7d565b60028551600281111561367c5761367c614766565b036132fa5761363683853088602001518960400151613f2b565b816136bc5784843085604051639d2e4c6760e01b8152600401610c3f94939291906153fc565b5050505050565b6137336040805160a08101825260008082526020808301829052835160608082018652838252818301849052818601849052848601919091528451808201865283815280830184905280860184905281850152845190810185528281529081018290529283015290608082015290565b83815260006020820181905250604080820180516001600160a01b039788169052602080890151825190891690820152905146908301528751606084018051918916909152805195909716940193909352935182015292909201516080820152919050565b6040805161190160f01b60208083019190915260228201859052604280830185905283518084039091018152606290920190925280519101206000906110f6565b60008060006137f0607d546001600160601b031690565b90506137fb81612efc565b9250600086600281111561381157613811614766565b03613860576001600160a01b03851660009081526039602052604090205484106138415761383e81613fdf565b92505b6001600160a01b0385166000908152603a602052604090205484101591505b50935093915050565b60006138786201518042615296565b6001600160a01b0384166000908152603e60205260409020549091508111156138c7576001600160a01b03929092166000908152603e6020908152604080832094909455603d90529190912055565b6001600160a01b0383166000908152603d6020526040812080548492906138ef908490615283565b9091555050505050565b600082600001828154811061391057613910614c31565b9060005260206000200154905092915050565b604080517f353bdd8d69b9e3185b3972e08b03845c0c14a21a390215302776a7a34b0e8764815282516020808301919091528301518183015291015160608201526080902090565b6000808451600281111561398157613981614766565b0361399c5761399582848660400151613ff7565b90506139c6565b6001845160028111156139b1576139b1614766565b036132fa576139958230858760200151613e7d565b80610cdc578383836040516341bd7d9160e11b8152600401610c3f93929190615432565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b03166340c10f1960e01b1790529151600092861691613a42916153e0565b6000604051808303816000865af19150503d8060008114613a7f576040519150601f19603f3d011682016040523d82523d6000602084013e613a84565b606091505b509095945050505050565b6000613a9d84308585613e7d565b9050806110f657613aaf8484846139ea565b90506110f6565b6000613ac58530868686613f2b565b905080613adb57613ad8858585856140ca565b90505b949350505050565b60006001600160e01b03198216637965db0b60e01b1480610bfb57506301ffc9a760e01b6001600160e01b0319831614610bfb565b60606000613b27836002614fd0565b613b32906002615283565b6001600160401b03811115613b4957613b4961457c565b6040519080825280601f01601f191660200182016040528015613b73576020820181803683370190505b509050600360fc1b81600081518110613b8e57613b8e614c31565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613bbd57613bbd614c31565b60200101906001600160f81b031916908160001a9053506000613be1846002614fd0565b613bec906001615283565b90505b6001811115613c64576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613c2057613c20614c31565b1a60f81b828281518110613c3657613c36614c31565b60200101906001600160f81b031916908160001a90535060049490941c93613c5d81615462565b9050613bef565b5083156110f65760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c3f565b6000818152600183016020526040812054613cfa57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610bfb565b506000610bfb565b60008181526001830160205260408120548015613deb576000613d26600183614fbd565b8554909150600090613d3a90600190614fbd565b9050818114613d9f576000866000018281548110613d5a57613d5a614c31565b9060005260206000200154905080876000018481548110613d7d57613d7d614c31565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613db057613db0615479565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610bfb565b6000915050610bfb565b60008082516002811115613e0b57613e0b614766565b148015613e1c575060008260400151115b8015610bfb575050602001511590565b6000600182516002811115613e4357613e43614766565b148015610bfb575050604001511590565b6000600282516002811115613e6b57613e6b614766565b148015610bfb57505060400151151590565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b1790529151600092871691613edd916153e0565b6000604051808303816000865af19150503d8060008114613f1a576040519150601f19603f3d011682016040523d82523d6000602084013e613f1f565b606091505b50909695505050505050565b604080516000808252602082019092526001600160a01b03871690613f5b9087908790879087906044810161548f565b60408051601f198184030181529181526020820180516001600160e01b0316637921219560e11b17905251613f9091906153e0565b6000604051808303816000865af19150503d8060008114613fcd576040519150601f19603f3d011682016040523d82523d6000602084013e613fd2565b606091505b5090979650505050505050565b6000603854600160385484603754612f149190614fd0565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000926060929087169161405491906153e0565b6000604051808303816000865af19150503d8060008114614091576040519150601f19603f3d011682016040523d82523d6000602084013e614096565b606091505b5090925090508180156140c15750805115806140c15750808060200190518101906140c19190615176565b95945050505050565b604080516000808252602082019092526001600160a01b038616906140f890869086908690604481016154d4565b60408051601f198184030181529181526020820180516001600160e01b031663731133e960e01b17905251613edd91906153e0565b60408051606081018252600080825260208201529081016141696040805160608101909152806000815260200160008152602001600081525090565b905290565b60006020828403121561418057600080fd5b81356001600160e01b0319811681146110f657600080fd5b6001600160a01b038116811461108a57600080fd5b6000602082840312156141bf57600080fd5b81356110f681614198565b60008083601f8401126141dc57600080fd5b5081356001600160401b038111156141f357600080fd5b6020830191508360208260051b85010111156118bc57600080fd5b6000806000806040858703121561422457600080fd5b84356001600160401b038082111561423b57600080fd5b614247888389016141ca565b9096509450602087013591508082111561426057600080fd5b5061426d878288016141ca565b95989497509550505050565b6000806000806000806060878903121561429257600080fd5b86356001600160401b03808211156142a957600080fd5b6142b58a838b016141ca565b909850965060208901359150808211156142ce57600080fd5b6142da8a838b016141ca565b909650945060408901359150808211156142f357600080fd5b5061430089828a016141ca565b979a9699509497509295939492505050565b80356119cd81614198565b60006020828403121561432f57600080fd5b5035919050565b6000806040838503121561434957600080fd5b82359150602083013561435b81614198565b809150509250929050565b600060a0828403121561437857600080fd5b50919050565b6000610160828403121561437857600080fd5b600080600061018084860312156143a757600080fd5b6143b1858561437e565b92506101608401356001600160401b03808211156143ce57600080fd5b818601915086601f8301126143e257600080fd5b8135818111156143f157600080fd5b87602060608302850101111561440657600080fd5b6020830194508093505050509250925092565b8060608101831015610bfb57600080fd5b8060808101831015610bfb57600080fd5b6000806000806000806000806000806101208b8d03121561445b57600080fd5b6144648b614312565b995061447260208c01614312565b985060408b0135975060608b0135965060808b0135955060a08b0135945060c08b01356001600160401b03808211156144aa57600080fd5b6144b68e838f01614419565b955060e08d01359150808211156144cc57600080fd5b6144d88e838f0161442a565b94506101008d01359150808211156144ef57600080fd5b506144fc8d828e016141ca565b915080935050809150509295989b9194979a5092959850565b6000806040838503121561452857600080fd5b823561453381614198565b946020939093013593505050565b8035601081106119cd57600080fd5b6000806040838503121561456357600080fd5b61456c83614541565b9150602083013561435b81614198565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b03811182821017156145b4576145b461457c565b60405290565b604051601f8201601f191681016001600160401b03811182821017156145e2576145e261457c565b604052919050565b60006001600160401b038211156146035761460361457c565b5060051b60200190565b801515811461108a57600080fd5b60008060008060006060868803121561463357600080fd5b85356001600160401b038082111561464a57600080fd5b61465689838a016141ca565b909750955060209150878201358181111561467057600080fd5b61467c8a828b016141ca565b90965094505060408801358181111561469457600080fd5b88019050601f810189136146a757600080fd5b80356146ba6146b5826145ea565b6145ba565b81815260059190911b8201830190838101908b8311156146d957600080fd5b928401925b828410156147005783356146f18161460d565b825292840192908401906146de565b80955050505050509295509295909350565b6001600160e01b031991909116815260200190565b6000806040838503121561473a57600080fd5b50508035926020909101359150565b6000610160828403121561475c57600080fd5b6110f6838361437e565b634e487b7160e01b600052602160045260246000fd5b6003811061478c5761478c614766565b9052565b60006040820190506147a382845161477c565b6020928301516001600160a01b0316919092015290565b600082601f8301126147cb57600080fd5b813560206147db6146b5836145ea565b8083825260208201915060208460051b8701019350868411156147fd57600080fd5b602086015b848110156148195780358352918301918301614802565b509695505050505050565b600082601f83011261483557600080fd5b81356001600160401b0381111561484e5761484e61457c565b614861601f8201601f19166020016145ba565b81815284602083860101111561487657600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a086880312156148ab57600080fd5b85356148b681614198565b945060208601356148c681614198565b935060408601356001600160401b03808211156148e257600080fd5b6148ee89838a016147ba565b9450606088013591508082111561490457600080fd5b61491089838a016147ba565b9350608088013591508082111561492657600080fd5b5061493388828901614824565b9150509295509295909350565b60006020828403121561495257600080fd5b6110f682614541565b60008060008060008060006080888a03121561497657600080fd5b87356001600160401b038082111561498d57600080fd5b6149998b838c016141ca565b909950975060208a01359150808211156149b257600080fd5b6149be8b838c016141ca565b909750955060408a01359150808211156149d757600080fd5b6149e38b838c016141ca565b909550935060608a01359150808211156149fc57600080fd5b50614a098a828b0161442a565b91505092959891949750929550565b600080600080600060a08688031215614a3057600080fd5b8535614a3b81614198565b94506020860135614a4b81614198565b9350604086013592506060860135915060808601356001600160401b03811115614a7457600080fd5b61493388828901614824565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b600082601f830112614adf57600080fd5b81516020614aef6146b5836145ea565b8083825260208201915060208460051b870101935086841115614b1157600080fd5b602086015b84811015614819578051614b2981614198565b8352918301918301614b16565b6001600160601b038116811461108a57600080fd5b600080600060608486031215614b6057600080fd5b83516001600160401b0380821115614b7757600080fd5b614b8387838801614ace565b9450602091508186015181811115614b9a57600080fd5b614ba688828901614ace565b945050604086015181811115614bbb57600080fd5b86019050601f81018713614bce57600080fd5b8051614bdc6146b5826145ea565b81815260059190911b82018301908381019089831115614bfb57600080fd5b928401925b82841015614c22578351614c1381614b36565b82529284019290840190614c00565b80955050505050509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6001600160601b03818116838216019080821115612ef557612ef5614c47565b8035600381106119cd57600080fd5b600060608284031215614c9e57600080fd5b614ca6614592565b9050614cb182614c7d565b8152602082013560208201526040820135604082015292915050565b600060a08284031215614cdf57600080fd5b614ce7614592565b8235614cf281614198565b81526020830135614d0281614198565b6020820152614d148460408501614c8c565b60408201529392505050565b600060608284031215614d3257600080fd5b614d3a614592565b823560ff81168114614d4b57600080fd5b8152602083810135908201526040928301359281019290925250919050565b6000808335601e19843603018112614d8157600080fd5b8301803591506001600160401b03821115614d9b57600080fd5b6020019150600581901b36038213156118bc57600080fd5b600060208284031215614dc557600080fd5b81356110f681614b36565b8035600281106119cd57600080fd5b600060608284031215614df157600080fd5b614df9614592565b90508135614e0681614198565b81526020820135614e1681614198565b806020830152506040820135604082015292915050565b60006101608284031215614e4057600080fd5b60405160a081018181106001600160401b0382111715614e6257614e6261457c565b60405282358152614e7560208401614dd0565b6020820152614e878460408501614ddf565b6040820152614e998460a08501614ddf565b6060820152614eac846101008501614c8c565b60808201529392505050565b6002811061478c5761478c614766565b8035614ed381614198565b6001600160a01b039081168352602082013590614eef82614198565b166020830152604090810135910152565b60006101808201905083825282356020830152614f1f60208401614dd0565b614f2c6040840182614eb8565b50614f3d6060830160408501614ec8565b614f4d60c0830160a08501614ec8565b610120614f68818401614f636101008701614c7d565b61477c565b61014081850135818501528085013561016085015250509392505050565b600060208284031215614f9857600080fd5b6110f682614c7d565b600060608284031215614fb357600080fd5b6110f68383614c8c565b81810381811115610bfb57610bfb614c47565b8082028115828204841417610bfb57610bfb614c47565b600060208284031215614ff957600080fd5b81356110f68161460d565b6001600160601b03828116828216039080821115612ef557612ef5614c47565b6010811061478c5761478c614766565b60208101610bfb8284615024565b6001600160e01b03198316815260408101600b831061506357615063614766565b8260208301529392505050565b8183526000602080850194508260005b858110156150ae57813561509381614198565b6001600160a01b031687529582019590820190600101615080565b509495945050505050565b6040815260006150cd604083018688615070565b82810360208401528381526001600160fb1b038411156150ec57600080fd5b8360051b80866020840137016020019695505050505050565b60608152600061511960608301888a615070565b6020838203602085015261512e82888a615070565b848103604086015285815286925060200160005b868110156151675761515782614f6386614c7d565b9282019290820190600101615142565b509a9950505050505050505050565b60006020828403121561518857600080fd5b81516110f68161460d565b6000600182016151a5576151a5614c47565b5060010190565b6151b782825161477c565b60208181015190830152604090810151910152565b6000610180820190508382528251602083015260208301516151f16040840182614eb8565b5060408381015180516001600160a01b03908116606086015260208201511660808501529081015160a084015250606083015180516001600160a01b0390811660c085015260208201511660e084015260408101516101008401525060808301516152606101208401826151ac565b509392505050565b60006020828403121561527a57600080fd5b6110f682614dd0565b80820180821115610bfb57610bfb614c47565b6000826152b357634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031984168152606081016152d66020830185615024565b6001600160a01b03929092166040919091015292915050565b60006020828403121561530157600080fd5b5051919050565b60005b8381101561532357818101518382015260200161530b565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615364816017850160208801615308565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615395816028840160208801615308565b01602801949350505050565b600081518084526153b9816020860160208601615308565b601f01601f19169290920160200192915050565b6020815260006110f660208301846153a1565b600082516153f2818460208701615308565b9190910192915050565b60c0810161540a82876151ac565b6001600160a01b0394851660608301529284166080820152921660a090920191909152919050565b60a0810161544082866151ac565b6001600160a01b03938416606083015291909216608090920191909152919050565b60008161547157615471614c47565b506000190190565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906154c9908301846153a1565b979650505050505050565b60018060a01b038516815283602082015282604082015260806060820152600061550160808301846153a1565b969550505050505056fe7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498a264697066735822122039bdd676fa56a806e2f91eb197d0a444b13ff0899114d328ae5983c28d58606164736f6c63430008170033", + "deployer": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", "devdoc": { "version": 1, "kind": "dev", @@ -2204,6 +2388,26 @@ "minimumVoteWeight()": { "details": "Returns the minimum vote weight to pass the threshold." }, + "onBridgeOperatorsAdded(address[],uint96[],bool[])": { + "details": "Handles the event when bridge operators are added.", + "params": { + "addeds": "The corresponding boolean values indicating whether the operators were added or not.", + "bridgeOperators": "The addresses of the bridge operators." + }, + "returns": { + "_0": "The selector of the function being called." + } + }, + "onBridgeOperatorsRemoved(address[],bool[])": { + "details": "Handles the event when bridge operators are removed.", + "params": { + "bridgeOperators": "The addresses of the bridge operators.", + "removeds": "The corresponding boolean values indicating whether the operators were removed or not." + }, + "returns": { + "_0": "The selector of the function being called." + } + }, "pause()": { "details": "Triggers paused state." }, @@ -2259,9 +2463,6 @@ "submitWithdrawal((uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)),(uint8,bytes32,bytes32)[])": { "details": "Withdraws based on the receipt and the validator signatures. Returns whether the withdrawal is locked. Emits the `Withdrew` once the assets are released." }, - "supportsInterface(bytes4)": { - "details": "See {IERC165-supportsInterface}." - }, "unlockWithdrawal((uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))": { "details": "Approves a specific withdrawal. Requirements: - The method caller is a validator. Emits the `Withdrew` once the assets are released." }, @@ -2334,6 +2535,11 @@ "details": "Error of invalid role." } ], + "ErrERC1155MintingFailed()": [ + { + "details": "Error indicating that the mint of ERC1155 tokens has failed." + } + ], "ErrERC20MintingFailed()": [ { "details": "Error indicating that the minting of ERC20 tokens has failed." @@ -2445,7 +2651,7 @@ ], "ErrTokenCouldNotTransferFrom((uint8,uint256,uint256),address,address,address)": [ { - "details": "Error indicating that the `transferFrom` has failed.", + "details": "Error indicating that the `handleAssetIn` has failed.", "params": { "from": "Owner of the token value.", "to": "Receiver of the token value.", @@ -2463,6 +2669,16 @@ } } ], + "ErrUnexpectedInternalCall(bytes4,uint8,address)": [ + { + "details": "Error indicating that the caller is unauthorized to perform a specific function.", + "params": { + "actual": "The actual address that called to the function.", + "expectedContractType": "The contract type required to perform the function.", + "msgSig": "The function signature (bytes4)." + } + } + ], "ErrUnsupportedStandard()": [ { "details": "Error indicating that an unsupported standard is encountered." @@ -2481,13 +2697,13 @@ } }, "isFoundry": true, - "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"ErrContractTypeNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrERC20MintingFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrERC721MintingFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrEmptyArray\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"}],\"name\":\"ErrInvalidChainId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidInfo\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidOrder\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidPercentage\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidReceipt\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidReceiptKind\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidRequest\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidThreshold\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidTokenStandard\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrLengthMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrQueryForApprovedWithdrawal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrQueryForInsufficientVoteWeight\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrQueryForProcessedWithdrawal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrReachedDailyWithdrawalLimit\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"enum Token.Standard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct Token.Info\",\"name\":\"tokenInfo\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"ErrTokenCouldNotTransfer\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"enum Token.Standard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct Token.Info\",\"name\":\"tokenInfo\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"ErrTokenCouldNotTransferFrom\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum RoleAccess\",\"name\":\"expectedRole\",\"type\":\"uint8\"}],\"name\":\"ErrUnauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrUnsupportedStandard\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrUnsupportedToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrZeroCodeContract\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ContractUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"limits\",\"type\":\"uint256[]\"}],\"name\":\"DailyWithdrawalLimitsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"receiptHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct Token.Owner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct Token.Owner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum Token.Standard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct Token.Info\",\"name\":\"info\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"struct Transfer.Receipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"DepositRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"thresholds\",\"type\":\"uint256[]\"}],\"name\":\"HighTierThresholdsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"numerator\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"denominator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousNumerator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousDenominator\",\"type\":\"uint256\"}],\"name\":\"HighTierVoteWeightThresholdUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"thresholds\",\"type\":\"uint256[]\"}],\"name\":\"LockedThresholdsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"numerator\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"denominator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousNumerator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousDenominator\",\"type\":\"uint256\"}],\"name\":\"ThresholdUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"mainchainTokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"roninTokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"enum Token.Standard[]\",\"name\":\"standards\",\"type\":\"uint8[]\"}],\"name\":\"TokenMapped\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"percentages\",\"type\":\"uint256[]\"}],\"name\":\"UnlockFeePercentagesUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"receiptHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct Token.Owner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct Token.Owner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum Token.Standard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct Token.Info\",\"name\":\"info\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"struct Transfer.Receipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"WithdrawalLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"receiptHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct Token.Owner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct Token.Owner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum Token.Standard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct Token.Info\",\"name\":\"info\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"struct Transfer.Receipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"WithdrawalUnlocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"receiptHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct Token.Owner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct Token.Owner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum Token.Standard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct Token.Info\",\"name\":\"info\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"struct Transfer.Receipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"Withdrew\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IWETH\",\"name\":\"weth\",\"type\":\"address\"}],\"name\":\"WrappedNativeTokenContractUpdated\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WITHDRAWAL_UNLOCKER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_MAX_PERCENTAGE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_voteWeight\",\"type\":\"uint256\"}],\"name\":\"checkHighTierVoteWeightThreshold\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_voteWeight\",\"type\":\"uint256\"}],\"name\":\"checkThreshold\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"dailyWithdrawalLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"emergencyPauser\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"getContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"contract_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getHighTierVoteWeightThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getRoleMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleMemberCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_mainchainToken\",\"type\":\"address\"}],\"name\":\"getRoninToken\",\"outputs\":[{\"components\":[{\"internalType\":\"enum Token.Standard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"}],\"internalType\":\"struct MappedTokenConsumer.MappedToken\",\"name\":\"_token\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"num_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"highTierThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_roleSetter\",\"type\":\"address\"},{\"internalType\":\"contract IWETH\",\"name\":\"_wrappedToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_roninChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_numerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_highTierVWNumerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_denominator\",\"type\":\"uint256\"},{\"internalType\":\"address[][3]\",\"name\":\"_addresses\",\"type\":\"address[][3]\"},{\"internalType\":\"uint256[][4]\",\"name\":\"_thresholds\",\"type\":\"uint256[][4]\"},{\"internalType\":\"enum Token.Standard[]\",\"name\":\"_standards\",\"type\":\"uint8[]\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeManagerContract\",\"type\":\"address\"}],\"name\":\"initializeV2\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"lastDateSynced\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"lastSyncedWithdrawal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"lockedThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_mainchainTokens\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"_roninTokens\",\"type\":\"address[]\"},{\"internalType\":\"enum Token.Standard[]\",\"name\":\"_standards\",\"type\":\"uint8[]\"}],\"name\":\"mapTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_mainchainTokens\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"_roninTokens\",\"type\":\"address[]\"},{\"internalType\":\"enum Token.Standard[]\",\"name\":\"_standards\",\"type\":\"uint8[]\"},{\"internalType\":\"uint256[][4]\",\"name\":\"_thresholds\",\"type\":\"uint256[][4]\"}],\"name\":\"mapTokensAndThresholds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minimumVoteWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_quantity\",\"type\":\"uint256\"}],\"name\":\"reachedWithdrawalLimit\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"receiveEther\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipientAddr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"enum Token.Standard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct Token.Info\",\"name\":\"info\",\"type\":\"tuple\"}],\"internalType\":\"struct Transfer.Request\",\"name\":\"_request\",\"type\":\"tuple\"}],\"name\":\"requestDepositFor\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"roninChainId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_tokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_limits\",\"type\":\"uint256[]\"}],\"name\":\"setDailyWithdrawalLimits\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"setEmergencyPauser\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_tokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_thresholds\",\"type\":\"uint256[]\"}],\"name\":\"setHighTierThresholds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_numerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_denominator\",\"type\":\"uint256\"}],\"name\":\"setHighTierVoteWeightThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_previousNum\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_previousDenom\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_tokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_thresholds\",\"type\":\"uint256[]\"}],\"name\":\"setLockedThresholds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_numerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_denominator\",\"type\":\"uint256\"}],\"name\":\"setThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_previousNum\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_previousDenom\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_tokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_percentages\",\"type\":\"uint256[]\"}],\"name\":\"setUnlockFeePercentages\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IWETH\",\"name\":\"_wrappedToken\",\"type\":\"address\"}],\"name\":\"setWrappedNativeTokenContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct Token.Owner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct Token.Owner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum Token.Standard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct Token.Info\",\"name\":\"info\",\"type\":\"tuple\"}],\"internalType\":\"struct Transfer.Receipt\",\"name\":\"_receipt\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"_signatures\",\"type\":\"tuple[]\"}],\"name\":\"submitWithdrawal\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"_locked\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"unlockFeePercentages\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct Token.Owner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct Token.Owner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum Token.Standard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct Token.Info\",\"name\":\"info\",\"type\":\"tuple\"}],\"internalType\":\"struct Transfer.Receipt\",\"name\":\"_receipt\",\"type\":\"tuple\"}],\"name\":\"unlockWithdrawal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"withdrawalHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"withdrawalLocked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"wrappedNativeToken\",\"outputs\":[{\"internalType\":\"contract IWETH\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"errors\":{\"ErrContractTypeNotFound(uint8)\":[{\"details\":\"Error of invalid role.\"}],\"ErrERC20MintingFailed()\":[{\"details\":\"Error indicating that the minting of ERC20 tokens has failed.\"}],\"ErrERC721MintingFailed()\":[{\"details\":\"Error indicating that the minting of ERC721 tokens has failed.\"}],\"ErrEmptyArray()\":[{\"details\":\"Error indicating that an array is empty when it should contain elements.\"}],\"ErrInvalidChainId(bytes4,uint256,uint256)\":[{\"details\":\"Error indicating that the chain ID is invalid.\",\"params\":{\"actual\":\"Current chain ID that executing function.\",\"expected\":\"Expected chain ID required for the tx to success.\",\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid chain ID.\"}}],\"ErrInvalidInfo()\":[{\"details\":\"Error indicating that the provided information is invalid.\"}],\"ErrInvalidOrder(bytes4)\":[{\"details\":\"Error indicating that an order is invalid.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid order.\"}}],\"ErrInvalidPercentage()\":[{\"details\":\"Error of invalid percentage.\"}],\"ErrInvalidReceipt()\":[{\"details\":\"Error indicating that a receipt is invalid.\"}],\"ErrInvalidReceiptKind()\":[{\"details\":\"Error indicating that a receipt kind is invalid.\"}],\"ErrInvalidRequest()\":[{\"details\":\"Error indicating that a request is invalid.\"}],\"ErrInvalidThreshold(bytes4)\":[{\"details\":\"Error indicating that the provided threshold is invalid for a specific function signature.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that the invalid threshold applies to.\"}}],\"ErrInvalidTokenStandard()\":[{\"details\":\"Error indicating that a token standard is invalid.\"}],\"ErrLengthMismatch(bytes4)\":[{\"details\":\"Error indicating a mismatch in the length of input parameters or arrays for a specific function.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that has a length mismatch.\"}}],\"ErrQueryForApprovedWithdrawal()\":[{\"details\":\"Error indicating that a query was made for an approved withdrawal.\"}],\"ErrQueryForInsufficientVoteWeight()\":[{\"details\":\"Error indicating that a query was made for insufficient vote weight.\"}],\"ErrQueryForProcessedWithdrawal()\":[{\"details\":\"Error indicating that a query was made for a processed withdrawal.\"}],\"ErrReachedDailyWithdrawalLimit()\":[{\"details\":\"Error indicating that the daily withdrawal limit has been reached.\"}],\"ErrTokenCouldNotTransfer((uint8,uint256,uint256),address,address)\":[{\"details\":\"Error indicating that the `transfer` has failed.\",\"params\":{\"to\":\"Receiver of the token value.\",\"token\":\"Address of the token.\",\"tokenInfo\":\"Info of the token including ERC standard, id or quantity.\"}}],\"ErrTokenCouldNotTransferFrom((uint8,uint256,uint256),address,address,address)\":[{\"details\":\"Error indicating that the `transferFrom` has failed.\",\"params\":{\"from\":\"Owner of the token value.\",\"to\":\"Receiver of the token value.\",\"token\":\"Address of the token.\",\"tokenInfo\":\"Info of the token including ERC standard, id or quantity.\"}}],\"ErrUnauthorized(bytes4,uint8)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"expectedRole\":\"The role required to perform the function.\",\"msgSig\":\"The function signature (bytes4) that the caller is unauthorized to perform.\"}}],\"ErrUnsupportedStandard()\":[{\"details\":\"Error indicating that an unsupported standard is encountered.\"}],\"ErrUnsupportedToken()\":[{\"details\":\"Error indicating that a token is not supported.\"}],\"ErrZeroCodeContract(address)\":[{\"details\":\"Error of set to non-contract.\"}]},\"events\":{\"ContractUpdated(uint8,address)\":{\"details\":\"Emitted when a contract is updated.\"},\"DailyWithdrawalLimitsUpdated(address[],uint256[])\":{\"details\":\"Emitted when the daily limit thresholds are updated\"},\"DepositRequested(bytes32,(uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Emitted when the deposit is requested\"},\"HighTierThresholdsUpdated(address[],uint256[])\":{\"details\":\"Emitted when the thresholds for high-tier withdrawals that requires high-tier vote weights are updated\"},\"HighTierVoteWeightThresholdUpdated(uint256,uint256,uint256,uint256,uint256)\":{\"details\":\"Emitted when the high-tier vote weight threshold is updated\"},\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"LockedThresholdsUpdated(address[],uint256[])\":{\"details\":\"Emitted when the thresholds for locked withdrawals are updated\"},\"Paused(address)\":{\"details\":\"Emitted when the pause is triggered by `account`.\"},\"RoleAdminChanged(bytes32,bytes32,bytes32)\":{\"details\":\"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this. _Available since v3.1._\"},\"RoleGranted(bytes32,address,address)\":{\"details\":\"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.\"},\"RoleRevoked(bytes32,address,address)\":{\"details\":\"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)\"},\"ThresholdUpdated(uint256,uint256,uint256,uint256,uint256)\":{\"details\":\"Emitted when the threshold is updated\"},\"TokenMapped(address[],address[],uint8[])\":{\"details\":\"Emitted when the tokens are mapped\"},\"UnlockFeePercentagesUpdated(address[],uint256[])\":{\"details\":\"Emitted when the fee percentages to unlock withdraw are updated\"},\"Unpaused(address)\":{\"details\":\"Emitted when the pause is lifted by `account`.\"},\"WithdrawalLocked(bytes32,(uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Emitted when the withdrawal is locked\"},\"WithdrawalUnlocked(bytes32,(uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Emitted when the withdrawal is unlocked\"},\"Withdrew(bytes32,(uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Emitted when the assets are withdrawn\"},\"WrappedNativeTokenContractUpdated(address)\":{\"details\":\"Emitted when the wrapped native token contract is updated\"}},\"kind\":\"dev\",\"methods\":{\"DOMAIN_SEPARATOR()\":{\"details\":\"Returns the domain seperator.\"},\"checkHighTierVoteWeightThreshold(uint256)\":{\"details\":\"Checks whether the `_voteWeight` passes the high-tier vote weight threshold.\"},\"checkThreshold(uint256)\":{\"details\":\"Checks whether the `_voteWeight` passes the threshold.\"},\"getContract(uint8)\":{\"details\":\"Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.\",\"params\":{\"contractType\":\"The role of the contract to retrieve.\"},\"returns\":{\"contract_\":\"The address of the contract with the specified role.\"}},\"getHighTierVoteWeightThreshold()\":{\"details\":\"Returns the high-tier vote weight threshold.\"},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"getRoleMember(bytes32,uint256)\":{\"details\":\"Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.\"},\"getRoleMemberCount(bytes32)\":{\"details\":\"Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.\"},\"getRoninToken(address)\":{\"details\":\"Returns token address on Ronin network. Note: Reverts for unsupported token.\"},\"getThreshold()\":{\"details\":\"Returns the threshold.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"initialize(address,address,uint256,uint256,uint256,uint256,address[][3],uint256[][4],uint8[])\":{\"details\":\"Initializes contract storage.\"},\"mapTokens(address[],address[],uint8[])\":{\"details\":\"Maps mainchain tokens to Ronin network. Requirement: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `TokenMapped` event.\"},\"mapTokensAndThresholds(address[],address[],uint8[],uint256[][4])\":{\"details\":\"Maps mainchain tokens to Ronin network and sets thresholds. Requirement: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `TokenMapped` event.\"},\"minimumVoteWeight()\":{\"details\":\"Returns the minimum vote weight to pass the threshold.\"},\"pause()\":{\"details\":\"Triggers paused state.\"},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"reachedWithdrawalLimit(address,uint256)\":{\"details\":\"Checks whether the withdrawal reaches the limitation.\"},\"receiveEther()\":{\"details\":\"Receives ether without doing anything. Use this function to topup native token.\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`. May emit a {RoleRevoked} event.\"},\"requestDepositFor((address,address,(uint8,uint256,uint256)))\":{\"details\":\"Locks the assets and request deposit.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"setContract(uint8,address)\":{\"details\":\"Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.\",\"params\":{\"addr\":\"The address of the contract to set.\",\"contractType\":\"The role of the contract to set.\"}},\"setDailyWithdrawalLimits(address[],uint256[])\":{\"details\":\"Sets daily limit amounts for the withdrawals. Requirements: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `DailyWithdrawalLimitsUpdated` event.\"},\"setEmergencyPauser(address)\":{\"details\":\"Grant emergency pauser role for `_addr`.\"},\"setHighTierThresholds(address[],uint256[])\":{\"details\":\"Sets the thresholds for high-tier withdrawals that requires high-tier vote weights. Requirements: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `HighTierThresholdsUpdated` event.\"},\"setHighTierVoteWeightThreshold(uint256,uint256)\":{\"details\":\"Sets high-tier vote weight threshold and returns the old one. Requirements: - The method caller is admin. - The high-tier vote weight threshold must equal to or larger than the normal threshold. Emits the `HighTierVoteWeightThresholdUpdated` event.\"},\"setLockedThresholds(address[],uint256[])\":{\"details\":\"Sets the amount thresholds to lock withdrawal. Requirements: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `LockedThresholdsUpdated` event.\"},\"setThreshold(uint256,uint256)\":{\"details\":\"Override `GatewayV3-setThreshold`. Requirements: - The high-tier vote weight threshold must equal to or larger than the normal threshold.\"},\"setUnlockFeePercentages(address[],uint256[])\":{\"details\":\"Sets fee percentages to unlock withdrawal. Requirements: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `UnlockFeePercentagesUpdated` event.\"},\"setWrappedNativeTokenContract(address)\":{\"details\":\"Sets the wrapped native token contract. Requirements: - The method caller is admin. Emits the `WrappedNativeTokenContractUpdated` event.\"},\"submitWithdrawal((uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)),(uint8,bytes32,bytes32)[])\":{\"details\":\"Withdraws based on the receipt and the validator signatures. Returns whether the withdrawal is locked. Emits the `Withdrew` once the assets are released.\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"},\"unlockWithdrawal((uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Approves a specific withdrawal. Requirements: - The method caller is a validator. Emits the `Withdrew` once the assets are released.\"},\"unpause()\":{\"details\":\"Triggers unpaused state.\"}},\"stateVariables\":{\"WITHDRAWAL_UNLOCKER_ROLE\":{\"details\":\"Withdrawal unlocker role hash\"},\"______deprecatedBridgeOperatorAddedBlock\":{\"custom:deprecated\":\"Previously `_bridgeOperatorAddedBlock` (mapping(address => uint256))\"},\"______deprecatedBridgeOperators\":{\"custom:deprecated\":\"Previously `_bridgeOperators` (uint256[])\"},\"_domainSeparator\":{\"details\":\"Domain seperator\"},\"_roninToken\":{\"details\":\"Mapping from mainchain token => token address on Ronin network\"},\"depositCount\":{\"details\":\"Total deposit\"},\"roninChainId\":{\"details\":\"Ronin network id\"},\"withdrawalHash\":{\"details\":\"Mapping from withdrawal id => withdrawal hash\"},\"withdrawalLocked\":{\"details\":\"Mapping from withdrawal id => locked\"},\"wrappedNativeToken\":{\"details\":\"Wrapped native token address\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"unlockFeePercentages(address)\":{\"notice\":\"Values 0-1,000,000 map to 0%-100%\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/mainchain/MainchainGatewayV3.sol\":\"MainchainGatewayV3\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@openzeppelin/=lib/openzeppelin-contracts/\",\":@prb/math/=lib/prb-math/\",\":@prb/test/=lib/prb-test/src/\",\":@ronin/contracts/=src/\",\":@ronin/script/=script/\",\":@ronin/test/=test/\",\":contract-libs/=lib/foundry-deployment-kit/lib/contract-libs/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":foundry-deployment-kit/=lib/foundry-deployment-kit/script/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/contracts/\",\":prb-math/=lib/prb-math/src/\",\":prb-test/=lib/prb-test/src/\",\":solady/=lib/solady/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/access/AccessControl.sol\":{\"keccak256\":\"0x5b35d8e68aeaccc685239bd9dd79b9ba01a0357930f8a3307ab85511733d9724\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ba8eb2d22f9321bd4660f6617c181d9611ff30a9b089408b8c6e2216d6d5cdc5\",\"dweb:/ipfs/QmTSJvhjHfnUV1j4hsqDv8PmLvGBLRs9gHLjTUXrUJ5Y9q\"]},\"lib/openzeppelin-contracts/contracts/access/AccessControlEnumerable.sol\":{\"keccak256\":\"0x13f5e15f2a0650c0b6aaee2ef19e89eaf4870d6e79662d572a393334c1397247\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://7ee05f28f549a5d6515e152580716b87636ed4bfab9812499a6e3803df88288b\",\"dweb:/ipfs/QmeEnhdwY1t5Y3YU5a4ffzgXuToydH2PNdNxV9W7dEPRQJ\"]},\"lib/openzeppelin-contracts/contracts/access/IAccessControl.sol\":{\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bb2c137c343ef0c4c7ce7b18c1d108afdc9d315a04e48307288d2d05adcbde3a\",\"dweb:/ipfs/QmUxhrAQM3MM3FF5j7AtcXLXguWCJBHJ14BRdVtuoQc8Fh\"]},\"lib/openzeppelin-contracts/contracts/access/IAccessControlEnumerable.sol\":{\"keccak256\":\"0xba4459ab871dfa300f5212c6c30178b63898c03533a1ede28436f11546626676\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://3dcc7b09bfa6e18aab262ca372f4a9b1fc82e294b430706a4e1378cf58e6a276\",\"dweb:/ipfs/QmT8oSAcesdctR15HMLhr2a1HRpXymxdjTfdtfTYJcj2N2\"]},\"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol\":{\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://383fb7b8181016ac5ccf07bc9cdb7c1b5045ea36e2cc4df52bcbf20396fc7688\",\"dweb:/ipfs/QmYJ7Cg4WmE3rR8KGQxjUCXFfTH6TcwZ2Z1f6tPrq7jHFr\"]},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://96b6d77a20bebd4eb06b801d3d020c7e82be13bd535cb0d0a6b7181c51dab5d5\",\"dweb:/ipfs/QmPUR9Cv9jNFdQX6PtBfaBW1ZCnKwiu65R2VD5kbdanDyn\"]},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://89c2a0f70157c13845be5cb49b078a6374fee3a78fa950052a3af26190255da8\",\"dweb:/ipfs/QmUcvMEQH1oMM2pUyMuDiBUKdvvnTz1NRB8bmPHrVq8725\"]},\"lib/openzeppelin-contracts/contracts/proxy/Proxy.sol\":{\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8831721b6f4cc26534d190f9f1631c3f59c9ff38efdd911f85e0882b8e360472\",\"dweb:/ipfs/QmQZnLErZNStirSQ13ZNWQgvEYUtGE5tXYwn4QUPaVUfPN\"]},\"lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol\":{\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ada1e030c0231db8d143b44ce92b4d1158eedb087880cad6d8cc7bd7ebe7b354\",\"dweb:/ipfs/QmWZ2NHZweRpz1U9GF6R1h65ri76dnX7fNxLBeM2t5N5Ce\"]},\"lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"keccak256\":\"0xa6a787e7a901af6511e19aa53e1a00352db215a011d2c7a438d0582dd5da76f9\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a6c4477d480bac20d681ade0e712b77ad828acf530a1d5c0abc5fb78068a05a1\",\"dweb:/ipfs/QmdBqsK8CcUceTeWzhHwFDEvKMoHimwtV96Lbim7ZBtCb8\"]},\"lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol\":{\"keccak256\":\"0x2a21b14ff90012878752f230d3ffd5c3405e5938d06c97a7d89c0a64561d0d66\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://3313a8f9bb1f9476857c9050067b31982bf2140b83d84f3bc0cec1f62bbe947f\",\"dweb:/ipfs/Qma17Pk8NRe7aB4UD3jjVxk7nSFaov3eQyv86hcyqkwJRV\"]},\"lib/openzeppelin-contracts/contracts/security/Pausable.sol\":{\"keccak256\":\"0x0849d93b16c9940beb286a7864ed02724b248b93e0d80ef6355af5ef15c64773\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://4ddabb16009cd17eaca3143feadf450ac13e72919ebe2ca50e00f61cb78bc004\",\"dweb:/ipfs/QmSPwPxX7d6TTWakN5jy5wsaGkS1y9TW8fuhGSraMkLk2B\"]},\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5a7d5b1ef5d8d5889ad2ed89d8619c09383b80b72ab226e0fe7bde1636481e34\",\"dweb:/ipfs/QmebXWgtEfumQGBdVeM6c71McLixYXQP5Bk6kKXuoY4Bmr\"]},\"lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol\":{\"keccak256\":\"0xed6a749c5373af398105ce6ee3ac4763aa450ea7285d268c85d9eeca809cdb1f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://20a97f891d06f0fe91560ea1a142aaa26fdd22bed1b51606b7d48f670deeb50f\",\"dweb:/ipfs/QmTbCtZKChpaX5H2iRiTDMcSz29GSLCpTCDgJpcMR4wg8x\"]},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://35c47bece3c03caaa07fab37dd2bb3413bfbca20db7bd9895024390e0a469487\",\"dweb:/ipfs/QmPGWT2x3QHcKxqe6gRmAkdakhbaRgx3DLzcakHz5M4eXG\"]},\"lib/openzeppelin-contracts/contracts/utils/Context.sol\":{\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6df0ddf21ce9f58271bdfaa85cde98b200ef242a05a3f85c2bc10a8294800a92\",\"dweb:/ipfs/QmRK2Y5Yc6BK7tGKkgsgn3aJEQGi5aakeSPZvS65PV8Xp3\"]},\"lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol\":{\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://39e096c60a6eb1c6a257122d515496bd92d0c6a693a8f07acb6aa4b1263e95d4\",\"dweb:/ipfs/QmPs5trJBacCiSkezP6tpevapuRYWNY6mqSFzsMCJj7e6B\"]},\"lib/openzeppelin-contracts/contracts/utils/Strings.sol\":{\"keccak256\":\"0xaf159a8b1923ad2a26d516089bceca9bdeaeacd04be50983ea00ba63070f08a3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6f2cf1c531122bc7ca96b8c8db6a60deae60441e5223065e792553d4849b5638\",\"dweb:/ipfs/QmPBdJmBBABMDCfyDjCbdxgiqRavgiSL88SYPGibgbPas9\"]},\"lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol\":{\"keccak256\":\"0xdb7f5c28fc61cda0bd8ab60ce288e206b791643bcd3ba464a70cbec18895a2f5\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bf52bdf22a33263f5ca6227a35faeac3b81e7d2c692fbcc6a079d488710c5900\",\"dweb:/ipfs/QmcmsjkP4yq3UhiJbvyzwufaY2EKh1zhHaRK8ATag2cpD2\"]},\"lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol\":{\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://fb0048dee081f6fffa5f74afc3fb328483c2a30504e94a0ddd2a5114d731ec4d\",\"dweb:/ipfs/QmZptt1nmYoA5SgjwnSgWqgUSDgm4q52Yos3xhnMv3MV43\"]},\"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol\":{\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://be161e54f24e5c6fae81a12db1a8ae87bc5ae1b0ddc805d82a1440a68455088f\",\"dweb:/ipfs/QmP7C3CHdY9urF4dEMb9wmsp1wMxHF6nhA2yQE5SKiPAdy\"]},\"lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol\":{\"keccak256\":\"0x5050943b32b6a8f282573d166b2e9d87ab7eb4dbba4ab6acf36ecb54fe6995e4\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d4831d777a29ebdf9f2caecd70e74b97bff1b70e53622fd0a02aed01e21c8271\",\"dweb:/ipfs/QmUqurVVnCc7XkMxb2k23TVQUtuhHZduJ3hTZarTJrqU24\"]},\"src/extensions/GatewayV3.sol\":{\"keccak256\":\"0xfcb8d4fa4358387c477a40da4d8a5108c298f23333c4161ce939c1b27a09ffde\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://7c29d478e6cc8a5a36a6986ba2a8bd39cea69c9171488cf0a8f8043fd5c3622a\",\"dweb:/ipfs/QmXUn3Y2AXDca9VAGzvWoYK6kV9NMXJ7Dh4DMf1LUPJgGn\"]},\"src/extensions/TransparentUpgradeableProxyV2.sol\":{\"keccak256\":\"0x6609392ea7d3174439b5715100bee82528fe6e4aff28927d48c27db8475e88c5\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://370c93bc1e962fcf8eab41d217d901716769f05c51a2cb25aae12abc84e871da\",\"dweb:/ipfs/QmQYL5QrJmXCdi5UN9K7imt1iPm9ydZQm6ifShpt451afd\"]},\"src/extensions/WithdrawalLimitation.sol\":{\"keccak256\":\"0xb574848e6c3fa2ceeb7f5e907bc76dc096ef577315dbf78452f9640bd92d8a32\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://0bf1b3bd2046f7b5faa55da45b80ab972135d931b31c5a54c66415707089bbc6\",\"dweb:/ipfs/QmRDLTzXTG2UnSv8zqLfiPak3Ayx8U256Thytr8NKaNiC8\"]},\"src/extensions/collections/HasContracts.sol\":{\"keccak256\":\"0x9e1dceb68827adfb8c8184662f29ab5fe14e292a632878150e3b0b6c61bc1dce\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b8903232a7a609b250a1ff2e9522a2366979652145af74637f9c0089916e3da3\",\"dweb:/ipfs/QmVoxZamJEhjYhr9RKVSAKGzakgqmFLfZXhZcDGor7DZe5\"]},\"src/extensions/collections/HasProxyAdmin.sol\":{\"keccak256\":\"0x0916021d04ea0c93c54978dc2fd46575fd2bd867369fbf9ce49f316939ddaf25\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2e220c59eb50b4e206d0a126f8cd2f7f2aa6865f56a0b4b091149e6928bf97b8\",\"dweb:/ipfs/QmRBk5hhn1w2MghZ8pRfaU1CvgRAZN7nZvxySSPDvkVuGp\"]},\"src/interfaces/IMainchainGatewayV3.sol\":{\"keccak256\":\"0xa82b8172f40ec733e5a03b019a8a7d597af284779c872c620ecc91a28af55461\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://cb6989a96dea2d796752c6c8d9a54e6551b158a21c5d22702abd5d9fa715d4c4\",\"dweb:/ipfs/Qmd1mMZz7H3WtJ4ckKRjfc98opazaKhnq6WDnKD3e4U9yJ\"]},\"src/interfaces/IQuorum.sol\":{\"keccak256\":\"0x6b7920b04a73a0e1ff7404aa1a3b5fc738fc0b6154839480f666fd69b55123f0\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a8c81134e4632e1240aead39fd5393b376a4be53668caf2a390f511f3c6d422d\",\"dweb:/ipfs/QmWPaQPP1WkpdPjLhK7wFXsih8HWs6kRQqjX5zGLu6McGH\"]},\"src/interfaces/IWETH.sol\":{\"keccak256\":\"0x8acead2ae4364dee80c9bc76d52cc04d3763105e1743728e67d237f816155142\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://7c90c7fa5b39a2ca17297cd3548a2d9763c7ab1c2873d8c202c3633f7be98d7b\",\"dweb:/ipfs/QmUPRnUXTrJRR7aogvDrfgjzj9haHfcmMqksoTDxC3ZbgQ\"]},\"src/interfaces/bridge/IBridgeManager.sol\":{\"keccak256\":\"0x9339ce2f14bc1e4d0e368a351506ff5735bcbc0a2e41aa633149198bbed76a60\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c234bc4f4faa82434fcfeab5b50af61b7027a75f3f773b70b542860d10607574\",\"dweb:/ipfs/QmYPcxU5UMEEoxQphF8KA6P7jCRuGAXRjvoiu3McYfuxER\"]},\"src/interfaces/bridge/IBridgeManagerCallback.sol\":{\"keccak256\":\"0xfd6868a1041577a463b6c96713edcb18063dc817154d09710abfd5783e4629ee\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://acaccf9b0280ec924dfdd641d122da9c0d6944c6bcf55019682ab5f7a925ab32\",\"dweb:/ipfs/QmR4ta1PNirxkJEiSqJVfEo9CRxQjvdfKZMGzf84nekZos\"]},\"src/interfaces/bridge/events/IBridgeManagerEvents.sol\":{\"keccak256\":\"0x217fff41c4a9ca72d142c5a2120bb1b5e67bf5bf5aa0f6128450116aebc07b8d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c34d339fa8e240c62ea8da11b4fe8745fbe5b6091dbcd40505160ae952f33e16\",\"dweb:/ipfs/QmR6CBz9VAvCSTR7uS3R4yocptsHPz3aodqdDEwSc2xZaE\"]},\"src/interfaces/collections/IHasContracts.sol\":{\"keccak256\":\"0x99d8213d857e30d367155abd15dc42730afdfbbac3a22dfb3b95ffea2083a92e\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://03390ff29b496e244faf4eab55565712f0aea5fecdcb915e3c5866ef29d5686d\",\"dweb:/ipfs/QmdGpXn3VSxfNvjFBxfho7rc41JTq5m6bonrfmpzShhRVs\"]},\"src/interfaces/consumers/MappedTokenConsumer.sol\":{\"keccak256\":\"0xfa220e968221af9b789e6c1dc4133631e90600c4a2bd63b7f01e96cb01f13e9b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://29643ec9bc5ac71e1500bd752585bff52e58ec42da4e892a9f01e7be5bf1fbf7\",\"dweb:/ipfs/QmetcnBNnvrUVonAKawF9mS3JzeDwAsBdp4tG3kC2qwoMA\"]},\"src/interfaces/consumers/SignatureConsumer.sol\":{\"keccak256\":\"0xd370e350722067097dec1a5c31bda6e47e83417fa5c3288293bb910028cd136b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ba168a64188bbbecbac288295bd9d5ce6dc215f876b144271428a6f91cba792a\",\"dweb:/ipfs/QmX3bM7QUo2xHxsXetU9RtXG11sKktvrdGovSJfxPEy5QN\"]},\"src/libraries/AddressArrayUtils.sol\":{\"keccak256\":\"0xaf760162653a85d6e1b24df4d33c74076f778470112f421a02050fb981242001\",\"license\":\"UNLICENSED\",\"urls\":[\"bzz-raw://3a413f290b8e81540bc6feb739bcfbacf56419b2e657bbce5be43826569b4406\",\"dweb:/ipfs/QmWRjGLBXs7WK92oPm51QpjxMYGuMTBx85Pv7QcGbUZE72\"]},\"src/libraries/Token.sol\":{\"keccak256\":\"0x8d11e48d878ba37ea2ca7395dceaa5591bb9ba2d4e5fdac1565760456e104991\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9d5cc02a0ba8d1bb1e757321ce6b4a2a3100dfd9ba2b7d2eb1510017c80b0cb0\",\"dweb:/ipfs/QmUzXg9R4v9Er3CYeNeL3ZCouPxCe9pJP6mCmZ8RVXFHsP\"]},\"src/libraries/Transfer.sol\":{\"keccak256\":\"0xe73e11942bcae9034abc2058e9976a583e3518bdfeefa863e97cb6e51edf4522\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ccacabe19f50e8a76618eda6c8296f2f732a7c67fcbb925c8d66657f5c53703e\",\"dweb:/ipfs/QmXc6cdqnaApGPrPk34hqfzQ3aDan3rTacPezqmChgLMvd\"]},\"src/mainchain/MainchainGatewayV3.sol\":{\"keccak256\":\"0x6d9923fbf928b82fcf10506e5637fe851e87db9a6d9cbc4297c8e2d9ac1f11d5\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://00dd9001904b7cc0196c7035972db0d5b38ec77e804bd8cd58b620b2cc23b153\",\"dweb:/ipfs/QmSMkGX4MRryJ3Lsf6NiuG5SZrV2L5T8DqgQFRQmLwgi8R\"]},\"src/utils/CommonErrors.sol\":{\"keccak256\":\"0x22942c8fea2d1ca863ac1f9c1662d714b8ac0856684e36f8aaf19508648c1053\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d7e47ff198edb68a65d65938c67f860c041a4b7f64cff5b101a333869096044b\",\"dweb:/ipfs/QmTFwEY7jPiUSKc3GvYDY7qHqXJzUYCmSjoVrcgFhi8gZz\"]},\"src/utils/ContractType.sol\":{\"keccak256\":\"0x7f547a44265f4c4b03d8971f7fc5eaa2e6064ea8cd509c1b761108f9800dab68\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://130e3f8353d9f34098fbf2867c3bf812a5184904d0113d55c5c820eb64f2547b\",\"dweb:/ipfs/QmeFSUbPi8fyG1W7kKegFRtCqALjQBXQyVvQ4sjpi6SWH3\"]},\"src/utils/IdentityGuard.sol\":{\"keccak256\":\"0x2d0dfcef3636945bc1785c1fa5a05f5203c79cbb81b2eee92a3ac6a2378c2ce5\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5e4cedc10e50bfaacdc732eab78768b5e0abbc8336eeaffa15de2a7be90de504\",\"dweb:/ipfs/QmR17AgM71NkH5ZeLpmaRMzPyXAKyhafoK2TZUnLw2z3Mv\"]},\"src/utils/RoleAccess.sol\":{\"keccak256\":\"0x7da4631824b53be17e246102ad59458f91f2395710561ac9bface18d35fb2502\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://070d8254ea4d6fde54ae02e121bb84bdb63a3c5a8513d2d364ad5038f6a95493\",\"dweb:/ipfs/QmfXpp3t8XcGFXewoVRmoQMKJb9vPo95Kj4vsGfNBf7gSH\"]}},\"version\":1}", - "nonce": 2, - "numDeployments": 1, + "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"ErrContractTypeNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrERC1155MintingFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrERC20MintingFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrERC721MintingFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrEmptyArray\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"}],\"name\":\"ErrInvalidChainId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidInfo\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidOrder\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidPercentage\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidReceipt\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidReceiptKind\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidRequest\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidThreshold\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidTokenStandard\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrLengthMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrQueryForApprovedWithdrawal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrQueryForInsufficientVoteWeight\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrQueryForProcessedWithdrawal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrReachedDailyWithdrawalLimit\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"tokenInfo\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"ErrTokenCouldNotTransfer\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"tokenInfo\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"ErrTokenCouldNotTransferFrom\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum RoleAccess\",\"name\":\"expectedRole\",\"type\":\"uint8\"}],\"name\":\"ErrUnauthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum ContractType\",\"name\":\"expectedContractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"actual\",\"type\":\"address\"}],\"name\":\"ErrUnexpectedInternalCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrUnsupportedStandard\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrUnsupportedToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrZeroCodeContract\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ContractUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"limits\",\"type\":\"uint256[]\"}],\"name\":\"DailyWithdrawalLimitsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"receiptHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"struct Transfer.Receipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"DepositRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"thresholds\",\"type\":\"uint256[]\"}],\"name\":\"HighTierThresholdsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"numerator\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"denominator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousNumerator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousDenominator\",\"type\":\"uint256\"}],\"name\":\"HighTierVoteWeightThresholdUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"thresholds\",\"type\":\"uint256[]\"}],\"name\":\"LockedThresholdsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"numerator\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"denominator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousNumerator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousDenominator\",\"type\":\"uint256\"}],\"name\":\"ThresholdUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"mainchainTokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"roninTokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"enum TokenStandard[]\",\"name\":\"standards\",\"type\":\"uint8[]\"}],\"name\":\"TokenMapped\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"percentages\",\"type\":\"uint256[]\"}],\"name\":\"UnlockFeePercentagesUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"receiptHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"struct Transfer.Receipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"WithdrawalLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"receiptHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"struct Transfer.Receipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"WithdrawalUnlocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"receiptHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"struct Transfer.Receipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"Withdrew\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IWETH\",\"name\":\"weth\",\"type\":\"address\"}],\"name\":\"WrappedNativeTokenContractUpdated\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WITHDRAWAL_UNLOCKER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_MAX_PERCENTAGE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_voteWeight\",\"type\":\"uint256\"}],\"name\":\"checkHighTierVoteWeightThreshold\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_voteWeight\",\"type\":\"uint256\"}],\"name\":\"checkThreshold\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"dailyWithdrawalLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"emergencyPauser\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"getContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"contract_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getHighTierVoteWeightThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getRoleMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleMemberCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"mainchainToken\",\"type\":\"address\"}],\"name\":\"getRoninToken\",\"outputs\":[{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"}],\"internalType\":\"struct MappedTokenConsumer.MappedToken\",\"name\":\"token\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"num_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"highTierThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_roleSetter\",\"type\":\"address\"},{\"internalType\":\"contract IWETH\",\"name\":\"_wrappedToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_roninChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_numerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_highTierVWNumerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_denominator\",\"type\":\"uint256\"},{\"internalType\":\"address[][3]\",\"name\":\"_addresses\",\"type\":\"address[][3]\"},{\"internalType\":\"uint256[][4]\",\"name\":\"_thresholds\",\"type\":\"uint256[][4]\"},{\"internalType\":\"enum TokenStandard[]\",\"name\":\"_standards\",\"type\":\"uint8[]\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeManagerContract\",\"type\":\"address\"}],\"name\":\"initializeV2\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initializeV3\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"wethUnwrapper_\",\"type\":\"address\"}],\"name\":\"initializeV4\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"lastDateSynced\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"lastSyncedWithdrawal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"lockedThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_mainchainTokens\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"_roninTokens\",\"type\":\"address[]\"},{\"internalType\":\"enum TokenStandard[]\",\"name\":\"_standards\",\"type\":\"uint8[]\"}],\"name\":\"mapTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_mainchainTokens\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"_roninTokens\",\"type\":\"address[]\"},{\"internalType\":\"enum TokenStandard[]\",\"name\":\"_standards\",\"type\":\"uint8[]\"},{\"internalType\":\"uint256[][4]\",\"name\":\"_thresholds\",\"type\":\"uint256[][4]\"}],\"name\":\"mapTokensAndThresholds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minimumVoteWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"operators\",\"type\":\"address[]\"},{\"internalType\":\"uint96[]\",\"name\":\"weights\",\"type\":\"uint96[]\"},{\"internalType\":\"bool[]\",\"name\":\"addeds\",\"type\":\"bool[]\"}],\"name\":\"onBridgeOperatorsAdded\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"operators\",\"type\":\"address[]\"},{\"internalType\":\"bool[]\",\"name\":\"removeds\",\"type\":\"bool[]\"}],\"name\":\"onBridgeOperatorsRemoved\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155BatchReceived\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_quantity\",\"type\":\"uint256\"}],\"name\":\"reachedWithdrawalLimit\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"receiveEther\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipientAddr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"internalType\":\"struct Transfer.Request\",\"name\":\"_request\",\"type\":\"tuple\"}],\"name\":\"requestDepositFor\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"roninChainId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_tokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_limits\",\"type\":\"uint256[]\"}],\"name\":\"setDailyWithdrawalLimits\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"setEmergencyPauser\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_tokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_thresholds\",\"type\":\"uint256[]\"}],\"name\":\"setHighTierThresholds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_numerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_denominator\",\"type\":\"uint256\"}],\"name\":\"setHighTierVoteWeightThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_previousNum\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_previousDenom\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_tokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_thresholds\",\"type\":\"uint256[]\"}],\"name\":\"setLockedThresholds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom\",\"type\":\"uint256\"}],\"name\":\"setThreshold\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_tokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_percentages\",\"type\":\"uint256[]\"}],\"name\":\"setUnlockFeePercentages\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IWETH\",\"name\":\"_wrappedToken\",\"type\":\"address\"}],\"name\":\"setWrappedNativeTokenContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"internalType\":\"struct Transfer.Receipt\",\"name\":\"_receipt\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"_signatures\",\"type\":\"tuple[]\"}],\"name\":\"submitWithdrawal\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"_locked\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"unlockFeePercentages\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"internalType\":\"struct Transfer.Receipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"unlockWithdrawal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"wethUnwrapper\",\"outputs\":[{\"internalType\":\"contract WethUnwrapper\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"withdrawalHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"withdrawalLocked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"wrappedNativeToken\",\"outputs\":[{\"internalType\":\"contract IWETH\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"errors\":{\"ErrContractTypeNotFound(uint8)\":[{\"details\":\"Error of invalid role.\"}],\"ErrERC1155MintingFailed()\":[{\"details\":\"Error indicating that the mint of ERC1155 tokens has failed.\"}],\"ErrERC20MintingFailed()\":[{\"details\":\"Error indicating that the minting of ERC20 tokens has failed.\"}],\"ErrERC721MintingFailed()\":[{\"details\":\"Error indicating that the minting of ERC721 tokens has failed.\"}],\"ErrEmptyArray()\":[{\"details\":\"Error indicating that an array is empty when it should contain elements.\"}],\"ErrInvalidChainId(bytes4,uint256,uint256)\":[{\"details\":\"Error indicating that the chain ID is invalid.\",\"params\":{\"actual\":\"Current chain ID that executing function.\",\"expected\":\"Expected chain ID required for the tx to success.\",\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid chain ID.\"}}],\"ErrInvalidInfo()\":[{\"details\":\"Error indicating that the provided information is invalid.\"}],\"ErrInvalidOrder(bytes4)\":[{\"details\":\"Error indicating that an order is invalid.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid order.\"}}],\"ErrInvalidPercentage()\":[{\"details\":\"Error of invalid percentage.\"}],\"ErrInvalidReceipt()\":[{\"details\":\"Error indicating that a receipt is invalid.\"}],\"ErrInvalidReceiptKind()\":[{\"details\":\"Error indicating that a receipt kind is invalid.\"}],\"ErrInvalidRequest()\":[{\"details\":\"Error indicating that a request is invalid.\"}],\"ErrInvalidThreshold(bytes4)\":[{\"details\":\"Error indicating that the provided threshold is invalid for a specific function signature.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that the invalid threshold applies to.\"}}],\"ErrInvalidTokenStandard()\":[{\"details\":\"Error indicating that a token standard is invalid.\"}],\"ErrLengthMismatch(bytes4)\":[{\"details\":\"Error indicating a mismatch in the length of input parameters or arrays for a specific function.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that has a length mismatch.\"}}],\"ErrQueryForApprovedWithdrawal()\":[{\"details\":\"Error indicating that a query was made for an approved withdrawal.\"}],\"ErrQueryForInsufficientVoteWeight()\":[{\"details\":\"Error indicating that a query was made for insufficient vote weight.\"}],\"ErrQueryForProcessedWithdrawal()\":[{\"details\":\"Error indicating that a query was made for a processed withdrawal.\"}],\"ErrReachedDailyWithdrawalLimit()\":[{\"details\":\"Error indicating that the daily withdrawal limit has been reached.\"}],\"ErrTokenCouldNotTransfer((uint8,uint256,uint256),address,address)\":[{\"details\":\"Error indicating that the `transfer` has failed.\",\"params\":{\"to\":\"Receiver of the token value.\",\"token\":\"Address of the token.\",\"tokenInfo\":\"Info of the token including ERC standard, id or quantity.\"}}],\"ErrTokenCouldNotTransferFrom((uint8,uint256,uint256),address,address,address)\":[{\"details\":\"Error indicating that the `handleAssetIn` has failed.\",\"params\":{\"from\":\"Owner of the token value.\",\"to\":\"Receiver of the token value.\",\"token\":\"Address of the token.\",\"tokenInfo\":\"Info of the token including ERC standard, id or quantity.\"}}],\"ErrUnauthorized(bytes4,uint8)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"expectedRole\":\"The role required to perform the function.\",\"msgSig\":\"The function signature (bytes4) that the caller is unauthorized to perform.\"}}],\"ErrUnexpectedInternalCall(bytes4,uint8,address)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"actual\":\"The actual address that called to the function.\",\"expectedContractType\":\"The contract type required to perform the function.\",\"msgSig\":\"The function signature (bytes4).\"}}],\"ErrUnsupportedStandard()\":[{\"details\":\"Error indicating that an unsupported standard is encountered.\"}],\"ErrUnsupportedToken()\":[{\"details\":\"Error indicating that a token is not supported.\"}],\"ErrZeroCodeContract(address)\":[{\"details\":\"Error of set to non-contract.\"}]},\"events\":{\"ContractUpdated(uint8,address)\":{\"details\":\"Emitted when a contract is updated.\"},\"DailyWithdrawalLimitsUpdated(address[],uint256[])\":{\"details\":\"Emitted when the daily limit thresholds are updated\"},\"DepositRequested(bytes32,(uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Emitted when the deposit is requested\"},\"HighTierThresholdsUpdated(address[],uint256[])\":{\"details\":\"Emitted when the thresholds for high-tier withdrawals that requires high-tier vote weights are updated\"},\"HighTierVoteWeightThresholdUpdated(uint256,uint256,uint256,uint256,uint256)\":{\"details\":\"Emitted when the high-tier vote weight threshold is updated\"},\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"LockedThresholdsUpdated(address[],uint256[])\":{\"details\":\"Emitted when the thresholds for locked withdrawals are updated\"},\"Paused(address)\":{\"details\":\"Emitted when the pause is triggered by `account`.\"},\"RoleAdminChanged(bytes32,bytes32,bytes32)\":{\"details\":\"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this. _Available since v3.1._\"},\"RoleGranted(bytes32,address,address)\":{\"details\":\"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.\"},\"RoleRevoked(bytes32,address,address)\":{\"details\":\"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)\"},\"ThresholdUpdated(uint256,uint256,uint256,uint256,uint256)\":{\"details\":\"Emitted when the threshold is updated\"},\"TokenMapped(address[],address[],uint8[])\":{\"details\":\"Emitted when the tokens are mapped\"},\"UnlockFeePercentagesUpdated(address[],uint256[])\":{\"details\":\"Emitted when the fee percentages to unlock withdraw are updated\"},\"Unpaused(address)\":{\"details\":\"Emitted when the pause is lifted by `account`.\"},\"WithdrawalLocked(bytes32,(uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Emitted when the withdrawal is locked\"},\"WithdrawalUnlocked(bytes32,(uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Emitted when the withdrawal is unlocked\"},\"Withdrew(bytes32,(uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Emitted when the assets are withdrawn\"},\"WrappedNativeTokenContractUpdated(address)\":{\"details\":\"Emitted when the wrapped native token contract is updated\"}},\"kind\":\"dev\",\"methods\":{\"DOMAIN_SEPARATOR()\":{\"details\":\"Returns the domain seperator.\"},\"checkHighTierVoteWeightThreshold(uint256)\":{\"details\":\"Checks whether the `_voteWeight` passes the high-tier vote weight threshold.\"},\"checkThreshold(uint256)\":{\"details\":\"Checks whether the `_voteWeight` passes the threshold.\"},\"getContract(uint8)\":{\"details\":\"Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.\",\"params\":{\"contractType\":\"The role of the contract to retrieve.\"},\"returns\":{\"contract_\":\"The address of the contract with the specified role.\"}},\"getHighTierVoteWeightThreshold()\":{\"details\":\"Returns the high-tier vote weight threshold.\"},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"getRoleMember(bytes32,uint256)\":{\"details\":\"Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.\"},\"getRoleMemberCount(bytes32)\":{\"details\":\"Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.\"},\"getRoninToken(address)\":{\"details\":\"Returns token address on Ronin network. Note: Reverts for unsupported token.\"},\"getThreshold()\":{\"details\":\"Returns the threshold.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"initialize(address,address,uint256,uint256,uint256,uint256,address[][3],uint256[][4],uint8[])\":{\"details\":\"Initializes contract storage.\"},\"mapTokens(address[],address[],uint8[])\":{\"details\":\"Maps mainchain tokens to Ronin network. Requirement: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `TokenMapped` event.\"},\"mapTokensAndThresholds(address[],address[],uint8[],uint256[][4])\":{\"details\":\"Maps mainchain tokens to Ronin network and sets thresholds. Requirement: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `TokenMapped` event.\"},\"minimumVoteWeight()\":{\"details\":\"Returns the minimum vote weight to pass the threshold.\"},\"onBridgeOperatorsAdded(address[],uint96[],bool[])\":{\"details\":\"Handles the event when bridge operators are added.\",\"params\":{\"addeds\":\"The corresponding boolean values indicating whether the operators were added or not.\",\"bridgeOperators\":\"The addresses of the bridge operators.\"},\"returns\":{\"_0\":\"The selector of the function being called.\"}},\"onBridgeOperatorsRemoved(address[],bool[])\":{\"details\":\"Handles the event when bridge operators are removed.\",\"params\":{\"bridgeOperators\":\"The addresses of the bridge operators.\",\"removeds\":\"The corresponding boolean values indicating whether the operators were removed or not.\"},\"returns\":{\"_0\":\"The selector of the function being called.\"}},\"pause()\":{\"details\":\"Triggers paused state.\"},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"reachedWithdrawalLimit(address,uint256)\":{\"details\":\"Checks whether the withdrawal reaches the limitation.\"},\"receiveEther()\":{\"details\":\"Receives ether without doing anything. Use this function to topup native token.\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`. May emit a {RoleRevoked} event.\"},\"requestDepositFor((address,address,(uint8,uint256,uint256)))\":{\"details\":\"Locks the assets and request deposit.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"setContract(uint8,address)\":{\"details\":\"Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.\",\"params\":{\"addr\":\"The address of the contract to set.\",\"contractType\":\"The role of the contract to set.\"}},\"setDailyWithdrawalLimits(address[],uint256[])\":{\"details\":\"Sets daily limit amounts for the withdrawals. Requirements: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `DailyWithdrawalLimitsUpdated` event.\"},\"setEmergencyPauser(address)\":{\"details\":\"Grant emergency pauser role for `_addr`.\"},\"setHighTierThresholds(address[],uint256[])\":{\"details\":\"Sets the thresholds for high-tier withdrawals that requires high-tier vote weights. Requirements: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `HighTierThresholdsUpdated` event.\"},\"setHighTierVoteWeightThreshold(uint256,uint256)\":{\"details\":\"Sets high-tier vote weight threshold and returns the old one. Requirements: - The method caller is admin. - The high-tier vote weight threshold must equal to or larger than the normal threshold. Emits the `HighTierVoteWeightThresholdUpdated` event.\"},\"setLockedThresholds(address[],uint256[])\":{\"details\":\"Sets the amount thresholds to lock withdrawal. Requirements: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `LockedThresholdsUpdated` event.\"},\"setThreshold(uint256,uint256)\":{\"details\":\"Override `GatewayV3-setThreshold`. Requirements: - The high-tier vote weight threshold must equal to or larger than the normal threshold.\"},\"setUnlockFeePercentages(address[],uint256[])\":{\"details\":\"Sets fee percentages to unlock withdrawal. Requirements: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `UnlockFeePercentagesUpdated` event.\"},\"setWrappedNativeTokenContract(address)\":{\"details\":\"Sets the wrapped native token contract. Requirements: - The method caller is admin. Emits the `WrappedNativeTokenContractUpdated` event.\"},\"submitWithdrawal((uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)),(uint8,bytes32,bytes32)[])\":{\"details\":\"Withdraws based on the receipt and the validator signatures. Returns whether the withdrawal is locked. Emits the `Withdrew` once the assets are released.\"},\"unlockWithdrawal((uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Approves a specific withdrawal. Requirements: - The method caller is a validator. Emits the `Withdrew` once the assets are released.\"},\"unpause()\":{\"details\":\"Triggers unpaused state.\"}},\"stateVariables\":{\"WITHDRAWAL_UNLOCKER_ROLE\":{\"details\":\"Withdrawal unlocker role hash\"},\"______deprecatedBridgeOperatorAddedBlock\":{\"custom:deprecated\":\"Previously `_bridgeOperatorAddedBlock` (mapping(address => uint256))\"},\"______deprecatedBridgeOperators\":{\"custom:deprecated\":\"Previously `_bridgeOperators` (uint256[])\"},\"_domainSeparator\":{\"details\":\"Domain separator\"},\"_roninToken\":{\"details\":\"Mapping from mainchain token => token address on Ronin network\"},\"depositCount\":{\"details\":\"Total deposit\"},\"roninChainId\":{\"details\":\"Ronin network id\"},\"withdrawalHash\":{\"details\":\"Mapping from withdrawal id => withdrawal hash\"},\"withdrawalLocked\":{\"details\":\"Mapping from withdrawal id => locked\"},\"wrappedNativeToken\":{\"details\":\"Wrapped native token address\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"unlockFeePercentages(address)\":{\"notice\":\"Values 0-1,000,000 map to 0%-100%\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/mainchain/MainchainGatewayV3.sol\":\"MainchainGatewayV3\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@fdk/=lib/foundry-deployment-kit/script/\",\":@openzeppelin/=lib/openzeppelin-contracts/\",\":@prb/math/=lib/prb-math/\",\":@prb/test/=lib/prb-test/src/\",\":@ronin/contracts/=src/\",\":@ronin/script/=script/\",\":@ronin/test/=test/\",\":contract-libs/=lib/foundry-deployment-kit/lib/contract-libs/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/foundry-deployment-kit/lib/forge-std/src/\",\":foundry-deployment-kit/=lib/foundry-deployment-kit/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/contracts/\",\":prb-math/=lib/prb-math/src/\",\":prb-test/=lib/prb-test/src/\",\":solady/=lib/solady/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/access/AccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\nimport \\\"../utils/Context.sol\\\";\\nimport \\\"../utils/Strings.sol\\\";\\nimport \\\"../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it.\\n */\\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\\n struct RoleData {\\n mapping(address => bool) members;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with a standardized message including the required role.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n *\\n * _Available since v4.1._\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role);\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\\n return _roles[role].members[account];\\n }\\n\\n /**\\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\\n * Overriding this function changes the behavior of the {onlyRole} modifier.\\n *\\n * Format of the revert message is described in {_checkRole}.\\n *\\n * _Available since v4.6._\\n */\\n function _checkRole(bytes32 role) internal view virtual {\\n _checkRole(role, _msgSender());\\n }\\n\\n /**\\n * @dev Revert with a standard message if `account` is missing `role`.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert(\\n string(\\n abi.encodePacked(\\n \\\"AccessControl: account \\\",\\n Strings.toHexString(uint160(account), 20),\\n \\\" is missing role \\\",\\n Strings.toHexString(uint256(role), 32)\\n )\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function renounceRole(bytes32 role, address account) public virtual override {\\n require(account == _msgSender(), \\\"AccessControl: can only renounce roles for self\\\");\\n\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event. Note that unlike {grantRole}, this function doesn't perform any\\n * checks on the calling account.\\n *\\n * May emit a {RoleGranted} event.\\n *\\n * [WARNING]\\n * ====\\n * This function should only be called from the constructor when setting\\n * up the initial roles for the system.\\n *\\n * Using this function in any other way is effectively circumventing the admin\\n * system imposed by {AccessControl}.\\n * ====\\n *\\n * NOTE: This function is deprecated in favor of {_grantRole}.\\n */\\n function _setupRole(bytes32 role, address account) internal virtual {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual {\\n if (!hasRole(role, account)) {\\n _roles[role].members[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n }\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual {\\n if (hasRole(role, account)) {\\n _roles[role].members[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5b35d8e68aeaccc685239bd9dd79b9ba01a0357930f8a3307ab85511733d9724\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/access/AccessControlEnumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlEnumerable.sol\\\";\\nimport \\\"./AccessControl.sol\\\";\\nimport \\\"../utils/structs/EnumerableSet.sol\\\";\\n\\n/**\\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\\n */\\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {\\n return _roleMembers[role].at(index);\\n }\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {\\n return _roleMembers[role].length();\\n }\\n\\n /**\\n * @dev Overload {_grantRole} to track enumerable memberships\\n */\\n function _grantRole(bytes32 role, address account) internal virtual override {\\n super._grantRole(role, account);\\n _roleMembers[role].add(account);\\n }\\n\\n /**\\n * @dev Overload {_revokeRole} to track enumerable memberships\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual override {\\n super._revokeRole(role, account);\\n _roleMembers[role].remove(account);\\n }\\n}\\n\",\"keccak256\":\"0x13f5e15f2a0650c0b6aaee2ef19e89eaf4870d6e79662d572a393334c1397247\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/access/IAccessControlEnumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\n\\n/**\\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\\n */\\ninterface IAccessControlEnumerable is IAccessControl {\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xba4459ab871dfa300f5212c6c30178b63898c03533a1ede28436f11546626676\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0xa6a787e7a901af6511e19aa53e1a00352db215a011d2c7a438d0582dd5da76f9\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2a21b14ff90012878752f230d3ffd5c3405e5938d06c97a7d89c0a64561d0d66\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/security/Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract Pausable is Context {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n constructor() {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n _requireNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n _requirePaused();\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Throws if the contract is paused.\\n */\\n function _requireNotPaused() internal view virtual {\\n require(!paused(), \\\"Pausable: paused\\\");\\n }\\n\\n /**\\n * @dev Throws if the contract is not paused.\\n */\\n function _requirePaused() internal view virtual {\\n require(paused(), \\\"Pausable: not paused\\\");\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n}\\n\",\"keccak256\":\"0x0849d93b16c9940beb286a7864ed02724b248b93e0d80ef6355af5ef15c64773\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/security/ReentrancyGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuard {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n constructor() {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n // On the first call to nonReentrant, _notEntered will be true\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n}\\n\",\"keccak256\":\"0x0e9621f60b2faabe65549f7ed0f24e8853a45c1b7990d47e8160e523683f3935\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/ERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/ERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC1155.sol\\\";\\nimport \\\"./IERC1155Receiver.sol\\\";\\nimport \\\"./extensions/IERC1155MetadataURI.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\nimport \\\"../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the basic standard multi-token.\\n * See https://eips.ethereum.org/EIPS/eip-1155\\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\\n *\\n * _Available since v3.1._\\n */\\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\\n using Address for address;\\n\\n // Mapping from token ID to account balances\\n mapping(uint256 => mapping(address => uint256)) private _balances;\\n\\n // Mapping from account to operator approvals\\n mapping(address => mapping(address => bool)) private _operatorApprovals;\\n\\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\\n string private _uri;\\n\\n /**\\n * @dev See {_setURI}.\\n */\\n constructor(string memory uri_) {\\n _setURI(uri_);\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return\\n interfaceId == type(IERC1155).interfaceId ||\\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC1155MetadataURI-uri}.\\n *\\n * This implementation returns the same URI for *all* token types. It relies\\n * on the token type ID substitution mechanism\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\\n *\\n * Clients calling this function must replace the `\\\\{id\\\\}` substring with the\\n * actual token type ID.\\n */\\n function uri(uint256) public view virtual override returns (string memory) {\\n return _uri;\\n }\\n\\n /**\\n * @dev See {IERC1155-balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\\n require(account != address(0), \\\"ERC1155: address zero is not a valid owner\\\");\\n return _balances[id][account];\\n }\\n\\n /**\\n * @dev See {IERC1155-balanceOfBatch}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\\n public\\n view\\n virtual\\n override\\n returns (uint256[] memory)\\n {\\n require(accounts.length == ids.length, \\\"ERC1155: accounts and ids length mismatch\\\");\\n\\n uint256[] memory batchBalances = new uint256[](accounts.length);\\n\\n for (uint256 i = 0; i < accounts.length; ++i) {\\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\\n }\\n\\n return batchBalances;\\n }\\n\\n /**\\n * @dev See {IERC1155-setApprovalForAll}.\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual override {\\n _setApprovalForAll(_msgSender(), operator, approved);\\n }\\n\\n /**\\n * @dev See {IERC1155-isApprovedForAll}.\\n */\\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\\n return _operatorApprovals[account][operator];\\n }\\n\\n /**\\n * @dev See {IERC1155-safeTransferFrom}.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) public virtual override {\\n require(\\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\\n \\\"ERC1155: caller is not token owner nor approved\\\"\\n );\\n _safeTransferFrom(from, to, id, amount, data);\\n }\\n\\n /**\\n * @dev See {IERC1155-safeBatchTransferFrom}.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) public virtual override {\\n require(\\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\\n \\\"ERC1155: caller is not token owner nor approved\\\"\\n );\\n _safeBatchTransferFrom(from, to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function _safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: transfer to the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: insufficient balance for transfer\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n _balances[id][to] += amount;\\n\\n emit TransferSingle(operator, from, to, id, amount);\\n\\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function _safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n require(to != address(0), \\\"ERC1155: transfer to the zero address\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n for (uint256 i = 0; i < ids.length; ++i) {\\n uint256 id = ids[i];\\n uint256 amount = amounts[i];\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: insufficient balance for transfer\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n _balances[id][to] += amount;\\n }\\n\\n emit TransferBatch(operator, from, to, ids, amounts);\\n\\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Sets a new URI for all token types, by relying on the token type ID\\n * substitution mechanism\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\\n *\\n * By this mechanism, any occurrence of the `\\\\{id\\\\}` substring in either the\\n * URI or any of the amounts in the JSON file at said URI will be replaced by\\n * clients with the token type ID.\\n *\\n * For example, the `https://token-cdn-domain/\\\\{id\\\\}.json` URI would be\\n * interpreted by clients as\\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\\n * for token type ID 0x4cce0.\\n *\\n * See {uri}.\\n *\\n * Because these URIs cannot be meaningfully represented by the {URI} event,\\n * this function emits no events.\\n */\\n function _setURI(string memory newuri) internal virtual {\\n _uri = newuri;\\n }\\n\\n /**\\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function _mint(\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: mint to the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _balances[id][to] += amount;\\n emit TransferSingle(operator, address(0), to, id, amount);\\n\\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function _mintBatch(\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: mint to the zero address\\\");\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n for (uint256 i = 0; i < ids.length; i++) {\\n _balances[ids[i]][to] += amounts[i];\\n }\\n\\n emit TransferBatch(operator, address(0), to, ids, amounts);\\n\\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens of token type `id` from `from`\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `from` must have at least `amount` tokens of token type `id`.\\n */\\n function _burn(\\n address from,\\n uint256 id,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC1155: burn from the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n\\n emit TransferSingle(operator, from, address(0), id, amount);\\n\\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n */\\n function _burnBatch(\\n address from,\\n uint256[] memory ids,\\n uint256[] memory amounts\\n ) internal virtual {\\n require(from != address(0), \\\"ERC1155: burn from the zero address\\\");\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n\\n for (uint256 i = 0; i < ids.length; i++) {\\n uint256 id = ids[i];\\n uint256 amount = amounts[i];\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n }\\n\\n emit TransferBatch(operator, from, address(0), ids, amounts);\\n\\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n }\\n\\n /**\\n * @dev Approve `operator` to operate on all of `owner` tokens\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function _setApprovalForAll(\\n address owner,\\n address operator,\\n bool approved\\n ) internal virtual {\\n require(owner != operator, \\\"ERC1155: setting approval status for self\\\");\\n _operatorApprovals[owner][operator] = approved;\\n emit ApprovalForAll(owner, operator, approved);\\n }\\n\\n /**\\n * @dev Hook that is called before any token transfer. This includes minting\\n * and burning, as well as batched variants.\\n *\\n * The same hook is called on both single and batched variants. For single\\n * transfers, the length of the `ids` and `amounts` arrays will be 1.\\n *\\n * Calling conditions (for each `id` and `amount` pair):\\n *\\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * of token type `id` will be transferred to `to`.\\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\\n * for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\\n * will be burned.\\n * - `from` and `to` are never both zero.\\n * - `ids` and `amounts` have the same, non-zero length.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any token transfer. This includes minting\\n * and burning, as well as batched variants.\\n *\\n * The same hook is called on both single and batched variants. For single\\n * transfers, the length of the `id` and `amount` arrays will be 1.\\n *\\n * Calling conditions (for each `id` and `amount` pair):\\n *\\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * of token type `id` will be transferred to `to`.\\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\\n * for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\\n * will be burned.\\n * - `from` and `to` are never both zero.\\n * - `ids` and `amounts` have the same, non-zero length.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {}\\n\\n function _doSafeTransferAcceptanceCheck(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) private {\\n if (to.isContract()) {\\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\\n if (response != IERC1155Receiver.onERC1155Received.selector) {\\n revert(\\\"ERC1155: ERC1155Receiver rejected tokens\\\");\\n }\\n } catch Error(string memory reason) {\\n revert(reason);\\n } catch {\\n revert(\\\"ERC1155: transfer to non ERC1155Receiver implementer\\\");\\n }\\n }\\n }\\n\\n function _doSafeBatchTransferAcceptanceCheck(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) private {\\n if (to.isContract()) {\\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\\n bytes4 response\\n ) {\\n if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\\n revert(\\\"ERC1155: ERC1155Receiver rejected tokens\\\");\\n }\\n } catch Error(string memory reason) {\\n revert(reason);\\n } catch {\\n revert(\\\"ERC1155: transfer to non ERC1155Receiver implementer\\\");\\n }\\n }\\n }\\n\\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\\n uint256[] memory array = new uint256[](1);\\n array[0] = element;\\n\\n return array;\\n }\\n}\\n\",\"keccak256\":\"0x447a21c87433c0f11252912313a96f3454629ef88cca7a4eefbb283b3ec409f9\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155 is IERC165 {\\n /**\\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\\n */\\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\\n\\n /**\\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\\n * transfers.\\n */\\n event TransferBatch(\\n address indexed operator,\\n address indexed from,\\n address indexed to,\\n uint256[] ids,\\n uint256[] values\\n );\\n\\n /**\\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\\n * `approved`.\\n */\\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\\n\\n /**\\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\\n *\\n * If an {URI} event was emitted for `id`, the standard\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\\n * returned by {IERC1155MetadataURI-uri}.\\n */\\n event URI(string value, uint256 indexed id);\\n\\n /**\\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\\n external\\n view\\n returns (uint256[] memory);\\n\\n /**\\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\\n *\\n * Emits an {ApprovalForAll} event.\\n *\\n * Requirements:\\n *\\n * - `operator` cannot be the caller.\\n */\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n /**\\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\\n *\\n * See {setApprovalForAll}.\\n */\\n function isApprovedForAll(address account, address operator) external view returns (bool);\\n\\n /**\\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] calldata ids,\\n uint256[] calldata amounts,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x6392f2cfe3a5ee802227fe7a2dfd47096d881aec89bddd214b35c5b46d3cd941\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev _Available since v3.1._\\n */\\ninterface IERC1155Receiver is IERC165 {\\n /**\\n * @dev Handles the receipt of a single ERC1155 token type. This function is\\n * called at the end of a `safeTransferFrom` after the balance has been updated.\\n *\\n * NOTE: To accept the transfer, this must return\\n * `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))`\\n * (i.e. 0xf23a6e61, or its own function selector).\\n *\\n * @param operator The address which initiated the transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param id The ID of the token being transferred\\n * @param value The amount of tokens being transferred\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155Received(\\n address operator,\\n address from,\\n uint256 id,\\n uint256 value,\\n bytes calldata data\\n ) external returns (bytes4);\\n\\n /**\\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\\n * is called at the end of a `safeBatchTransferFrom` after the balances have\\n * been updated.\\n *\\n * NOTE: To accept the transfer(s), this must return\\n * `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))`\\n * (i.e. 0xbc197c81, or its own function selector).\\n *\\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155BatchReceived(\\n address operator,\\n address from,\\n uint256[] calldata ids,\\n uint256[] calldata values,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xeb373f1fdc7b755c6a750123a9b9e3a8a02c1470042fd6505d875000a80bde0b\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/ERC1155Burnable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/extensions/ERC1155Burnable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1155.sol\\\";\\n\\n/**\\n * @dev Extension of {ERC1155} that allows token holders to destroy both their\\n * own tokens and those that they have been approved to use.\\n *\\n * _Available since v3.1._\\n */\\nabstract contract ERC1155Burnable is ERC1155 {\\n function burn(\\n address account,\\n uint256 id,\\n uint256 value\\n ) public virtual {\\n require(\\n account == _msgSender() || isApprovedForAll(account, _msgSender()),\\n \\\"ERC1155: caller is not token owner nor approved\\\"\\n );\\n\\n _burn(account, id, value);\\n }\\n\\n function burnBatch(\\n address account,\\n uint256[] memory ids,\\n uint256[] memory values\\n ) public virtual {\\n require(\\n account == _msgSender() || isApprovedForAll(account, _msgSender()),\\n \\\"ERC1155: caller is not token owner nor approved\\\"\\n );\\n\\n _burnBatch(account, ids, values);\\n }\\n}\\n\",\"keccak256\":\"0xb11d1ade7146ac3da122e1f387ea82b0bd385d50823946c3f967dbffef3e9f4f\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/ERC1155Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1155.sol\\\";\\nimport \\\"../../../security/Pausable.sol\\\";\\n\\n/**\\n * @dev ERC1155 token with pausable token transfers, minting and burning.\\n *\\n * Useful for scenarios such as preventing trades until the end of an evaluation\\n * period, or having an emergency switch for freezing all token transfers in the\\n * event of a large bug.\\n *\\n * _Available since v3.1._\\n */\\nabstract contract ERC1155Pausable is ERC1155, Pausable {\\n /**\\n * @dev See {ERC1155-_beforeTokenTransfer}.\\n *\\n * Requirements:\\n *\\n * - the contract must not be paused.\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual override {\\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n require(!paused(), \\\"ERC1155Pausable: token transfer while paused\\\");\\n }\\n}\\n\",\"keccak256\":\"0xdad22b949de979bb2ad9001c044b2aeaacf8a25e3de09ed6f022a9469f936d5b\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC1155.sol\\\";\\n\\n/**\\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155MetadataURI is IERC1155 {\\n /**\\n * @dev Returns the URI for token type `id`.\\n *\\n * If the `\\\\{id\\\\}` substring is present in the URI, it must be replaced by\\n * clients with the actual token type ID.\\n */\\n function uri(uint256 id) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xa66d18b9a85458d28fc3304717964502ae36f7f8a2ff35bc83f6f85d74b03574\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/presets/ERC1155PresetMinterPauser.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/presets/ERC1155PresetMinterPauser.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1155.sol\\\";\\nimport \\\"../extensions/ERC1155Burnable.sol\\\";\\nimport \\\"../extensions/ERC1155Pausable.sol\\\";\\nimport \\\"../../../access/AccessControlEnumerable.sol\\\";\\nimport \\\"../../../utils/Context.sol\\\";\\n\\n/**\\n * @dev {ERC1155} token, including:\\n *\\n * - ability for holders to burn (destroy) their tokens\\n * - a minter role that allows for token minting (creation)\\n * - a pauser role that allows to stop all token transfers\\n *\\n * This contract uses {AccessControl} to lock permissioned functions using the\\n * different roles - head to its documentation for details.\\n *\\n * The account that deploys the contract will be granted the minter and pauser\\n * roles, as well as the default admin role, which will let it grant both minter\\n * and pauser roles to other accounts.\\n *\\n * _Deprecated in favor of https://wizard.openzeppelin.com/[Contracts Wizard]._\\n */\\ncontract ERC1155PresetMinterPauser is Context, AccessControlEnumerable, ERC1155Burnable, ERC1155Pausable {\\n bytes32 public constant MINTER_ROLE = keccak256(\\\"MINTER_ROLE\\\");\\n bytes32 public constant PAUSER_ROLE = keccak256(\\\"PAUSER_ROLE\\\");\\n\\n /**\\n * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE`, and `PAUSER_ROLE` to the account that\\n * deploys the contract.\\n */\\n constructor(string memory uri) ERC1155(uri) {\\n _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());\\n\\n _setupRole(MINTER_ROLE, _msgSender());\\n _setupRole(PAUSER_ROLE, _msgSender());\\n }\\n\\n /**\\n * @dev Creates `amount` new tokens for `to`, of token type `id`.\\n *\\n * See {ERC1155-_mint}.\\n *\\n * Requirements:\\n *\\n * - the caller must have the `MINTER_ROLE`.\\n */\\n function mint(\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) public virtual {\\n require(hasRole(MINTER_ROLE, _msgSender()), \\\"ERC1155PresetMinterPauser: must have minter role to mint\\\");\\n\\n _mint(to, id, amount, data);\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] variant of {mint}.\\n */\\n function mintBatch(\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) public virtual {\\n require(hasRole(MINTER_ROLE, _msgSender()), \\\"ERC1155PresetMinterPauser: must have minter role to mint\\\");\\n\\n _mintBatch(to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Pauses all token transfers.\\n *\\n * See {ERC1155Pausable} and {Pausable-_pause}.\\n *\\n * Requirements:\\n *\\n * - the caller must have the `PAUSER_ROLE`.\\n */\\n function pause() public virtual {\\n require(hasRole(PAUSER_ROLE, _msgSender()), \\\"ERC1155PresetMinterPauser: must have pauser role to pause\\\");\\n _pause();\\n }\\n\\n /**\\n * @dev Unpauses all token transfers.\\n *\\n * See {ERC1155Pausable} and {Pausable-_unpause}.\\n *\\n * Requirements:\\n *\\n * - the caller must have the `PAUSER_ROLE`.\\n */\\n function unpause() public virtual {\\n require(hasRole(PAUSER_ROLE, _msgSender()), \\\"ERC1155PresetMinterPauser: must have pauser role to unpause\\\");\\n _unpause();\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId)\\n public\\n view\\n virtual\\n override(AccessControlEnumerable, ERC1155)\\n returns (bool)\\n {\\n return super.supportsInterface(interfaceId);\\n }\\n\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual override(ERC1155, ERC1155Pausable) {\\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n }\\n}\\n\",\"keccak256\":\"0x775e248004d21e0666740534a732daa9f17ceeee660ded876829e98a3a62b657\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/utils/ERC1155Holder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ERC1155Receiver.sol\\\";\\n\\n/**\\n * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens.\\n *\\n * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be\\n * stuck.\\n *\\n * @dev _Available since v3.1._\\n */\\ncontract ERC1155Holder is ERC1155Receiver {\\n function onERC1155Received(\\n address,\\n address,\\n uint256,\\n uint256,\\n bytes memory\\n ) public virtual override returns (bytes4) {\\n return this.onERC1155Received.selector;\\n }\\n\\n function onERC1155BatchReceived(\\n address,\\n address,\\n uint256[] memory,\\n uint256[] memory,\\n bytes memory\\n ) public virtual override returns (bytes4) {\\n return this.onERC1155BatchReceived.selector;\\n }\\n}\\n\",\"keccak256\":\"0x2e024ca51ce5abe16c0d34e6992a1104f356e2244eb4ccbec970435e8b3405e3\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/utils/ERC1155Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC1155Receiver.sol\\\";\\nimport \\\"../../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev _Available since v3.1._\\n */\\nabstract contract ERC1155Receiver is ERC165, IERC1155Receiver {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);\\n }\\n}\\n\",\"keccak256\":\"0x3dd5e1a66a56f30302108a1da97d677a42b1daa60e503696b2bcbbf3e4c95bcb\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC721 compliant contract.\\n */\\ninterface IERC721 is IERC165 {\\n /**\\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\\n */\\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\\n */\\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\\n\\n /**\\n * @dev Returns the number of tokens in ``owner``'s account.\\n */\\n function balanceOf(address owner) external view returns (uint256 balance);\\n\\n /**\\n * @dev Returns the owner of the `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function ownerOf(uint256 tokenId) external view returns (address owner);\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) external;\\n\\n /**\\n * @dev Transfers `tokenId` token from `from` to `to`.\\n *\\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) external;\\n\\n /**\\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\\n * The approval is cleared when the token is transferred.\\n *\\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\\n *\\n * Requirements:\\n *\\n * - The caller must own the token or be an approved operator.\\n * - `tokenId` must exist.\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Approve or remove `operator` as an operator for the caller.\\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\\n *\\n * Requirements:\\n *\\n * - The `operator` cannot be the caller.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function setApprovalForAll(address operator, bool _approved) external;\\n\\n /**\\n * @dev Returns the account approved for `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function getApproved(uint256 tokenId) external view returns (address operator);\\n\\n /**\\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\\n *\\n * See {setApprovalForAll}\\n */\\n function isApprovedForAll(address owner, address operator) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xed6a749c5373af398105ce6ee3ac4763aa450ea7285d268c85d9eeca809cdb1f\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _HEX_SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n // Inspired by OraclizeAPI's implementation - MIT licence\\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\\n\\n if (value == 0) {\\n return \\\"0\\\";\\n }\\n uint256 temp = value;\\n uint256 digits;\\n while (temp != 0) {\\n digits++;\\n temp /= 10;\\n }\\n bytes memory buffer = new bytes(digits);\\n while (value != 0) {\\n digits -= 1;\\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\\n value /= 10;\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n if (value == 0) {\\n return \\\"0x00\\\";\\n }\\n uint256 temp = value;\\n uint256 length = 0;\\n while (temp != 0) {\\n length++;\\n temp >>= 8;\\n }\\n return toHexString(value, length);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xaf159a8b1923ad2a26d516089bceca9bdeaeacd04be50983ea00ba63070f08a3\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.3) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSA {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n } else if (error == RecoverError.InvalidSignatureV) {\\n revert(\\\"ECDSA: invalid signature 'v' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n if (v != 27 && v != 28) {\\n return (address(0), RecoverError.InvalidSignatureV);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", Strings.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0xdb7f5c28fc61cda0bd8ab60ce288e206b791643bcd3ba464a70cbec18895a2f5\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n *\\n * [WARNING]\\n * ====\\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.\\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\\n *\\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.\\n * ====\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n bytes32 lastValue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastValue;\\n // Update the index for the moved value\\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n return set._values[index];\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function _values(Set storage set) private view returns (bytes32[] memory) {\\n return set._values;\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\\n return _values(set._inner);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(AddressSet storage set) internal view returns (address[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n address[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(UintSet storage set) internal view returns (uint256[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n uint256[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0x5050943b32b6a8f282573d166b2e9d87ab7eb4dbba4ab6acf36ecb54fe6995e4\",\"license\":\"MIT\"},\"src/extensions/GatewayV3.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/security/Pausable.sol\\\";\\nimport \\\"../interfaces/IQuorum.sol\\\";\\nimport \\\"./collections/HasProxyAdmin.sol\\\";\\n\\nabstract contract GatewayV3 is HasProxyAdmin, Pausable, IQuorum {\\n uint256 internal _num;\\n uint256 internal _denom;\\n\\n address private ______deprecated;\\n uint256 public nonce;\\n\\n address public emergencyPauser;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n */\\n uint256[49] private ______gap;\\n\\n /**\\n * @dev Grant emergency pauser role for `_addr`.\\n */\\n function setEmergencyPauser(address _addr) external onlyProxyAdmin {\\n emergencyPauser = _addr;\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function getThreshold() external view virtual returns (uint256 num_, uint256 denom_) {\\n return (_num, _denom);\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function checkThreshold(uint256 _voteWeight) external view virtual returns (bool) {\\n return _voteWeight * _denom >= _num * _getTotalWeight();\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function setThreshold(uint256 _numerator, uint256 _denominator) external virtual onlyProxyAdmin {\\n return _setThreshold(_numerator, _denominator);\\n }\\n\\n /**\\n * @dev Triggers paused state.\\n */\\n function pause() external {\\n _requireAuth();\\n _pause();\\n }\\n\\n /**\\n * @dev Triggers unpaused state.\\n */\\n function unpause() external {\\n _requireAuth();\\n _unpause();\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function minimumVoteWeight() public view virtual returns (uint256) {\\n return _minimumVoteWeight(_getTotalWeight());\\n }\\n\\n /**\\n * @dev Sets threshold and returns the old one.\\n *\\n * Emits the `ThresholdUpdated` event.\\n *\\n */\\n function _setThreshold(uint256 num, uint256 denom) internal virtual {\\n if (num > denom) revert ErrInvalidThreshold(msg.sig);\\n uint256 prevNum = _num;\\n uint256 prevDenom = _denom;\\n _num = num;\\n _denom = denom;\\n unchecked {\\n emit ThresholdUpdated(nonce++, num, denom, prevNum, prevDenom);\\n }\\n }\\n\\n /**\\n * @dev Returns minimum vote weight.\\n */\\n function _minimumVoteWeight(uint256 _totalWeight) internal view virtual returns (uint256) {\\n return (_num * _totalWeight + _denom - 1) / _denom;\\n }\\n\\n /**\\n * @dev Internal method to check method caller.\\n *\\n * Requirements:\\n *\\n * - The method caller must be admin or pauser.\\n *\\n */\\n function _requireAuth() private view {\\n if (!(msg.sender == _getProxyAdmin() || msg.sender == emergencyPauser)) {\\n revert ErrUnauthorized(msg.sig, RoleAccess.ADMIN);\\n }\\n }\\n\\n /**\\n * @dev Returns the total weight.\\n */\\n function _getTotalWeight() internal view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0x010a0021a377e4b23a4f56269b9c6e3e3fc2684897928ff9b9da1b47c3f07baf\",\"license\":\"MIT\"},\"src/extensions/TransparentUpgradeableProxyV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\\\";\\n\\ncontract TransparentUpgradeableProxyV2 is TransparentUpgradeableProxy {\\n constructor(address _logic, address admin_, bytes memory _data) payable TransparentUpgradeableProxy(_logic, admin_, _data) { }\\n\\n /**\\n * @dev Calls a function from the current implementation as specified by `_data`, which should be an encoded function call.\\n *\\n * Requirements:\\n * - Only the admin can call this function.\\n *\\n * Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid\\n * triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider\\n * reviewing the encoded data `_data` and the method which is called before using this.\\n *\\n */\\n function functionDelegateCall(bytes memory _data) public payable ifAdmin {\\n address _addr = _implementation();\\n assembly {\\n let _result := delegatecall(gas(), _addr, add(_data, 32), mload(_data), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n switch _result\\n case 0 { revert(0, returndatasize()) }\\n default { return(0, returndatasize()) }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x45fc7b71d09da99414b977a56e586b3604670d865e5f36f395d5c98bc4ba64af\",\"license\":\"MIT\"},\"src/extensions/WethUnwrapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/security/ReentrancyGuard.sol\\\";\\nimport \\\"../interfaces/IWETH.sol\\\";\\n\\ncontract WethUnwrapper is ReentrancyGuard {\\n IWETH public immutable weth;\\n\\n error ErrCannotTransferFrom();\\n error ErrNotWrappedContract();\\n error ErrExternalCallFailed(address sender, bytes4 sig);\\n\\n constructor(address weth_) {\\n if (address(weth_).code.length == 0) revert ErrNotWrappedContract();\\n weth = IWETH(weth_);\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n receive() external payable {\\n _fallback();\\n }\\n\\n function unwrap(uint256 amount) external nonReentrant {\\n _deductWrappedAndWithdraw(amount);\\n _sendNativeTo(payable(msg.sender), amount);\\n }\\n\\n function unwrapTo(uint256 amount, address payable to) external nonReentrant {\\n _deductWrappedAndWithdraw(amount);\\n _sendNativeTo(payable(to), amount);\\n }\\n\\n function _deductWrappedAndWithdraw(uint256 amount) internal {\\n (bool success,) = address(weth).call(abi.encodeCall(IWETH.transferFrom, (msg.sender, address(this), amount)));\\n if (!success) revert ErrCannotTransferFrom();\\n\\n weth.withdraw(amount);\\n }\\n\\n function _sendNativeTo(address payable to, uint256 val) internal {\\n (bool success,) = to.call{ value: val }(\\\"\\\");\\n if (!success) {\\n revert ErrExternalCallFailed(to, msg.sig);\\n }\\n }\\n\\n function _fallback() internal view {\\n if (msg.sender != address(weth)) revert ErrNotWrappedContract();\\n }\\n}\\n\",\"keccak256\":\"0x5f7b72d9ed8944724d2f228358d565a61ea345cba1883e5424fb801bebc758ff\",\"license\":\"MIT\"},\"src/extensions/WithdrawalLimitation.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./GatewayV3.sol\\\";\\n\\nabstract contract WithdrawalLimitation is GatewayV3 {\\n /// @dev Error of invalid percentage.\\n error ErrInvalidPercentage();\\n\\n /// @dev Emitted when the high-tier vote weight threshold is updated\\n event HighTierVoteWeightThresholdUpdated(\\n uint256 indexed nonce, uint256 indexed numerator, uint256 indexed denominator, uint256 previousNumerator, uint256 previousDenominator\\n );\\n /// @dev Emitted when the thresholds for high-tier withdrawals that requires high-tier vote weights are updated\\n event HighTierThresholdsUpdated(address[] tokens, uint256[] thresholds);\\n /// @dev Emitted when the thresholds for locked withdrawals are updated\\n event LockedThresholdsUpdated(address[] tokens, uint256[] thresholds);\\n /// @dev Emitted when the fee percentages to unlock withdraw are updated\\n event UnlockFeePercentagesUpdated(address[] tokens, uint256[] percentages);\\n /// @dev Emitted when the daily limit thresholds are updated\\n event DailyWithdrawalLimitsUpdated(address[] tokens, uint256[] limits);\\n\\n uint256 public constant _MAX_PERCENTAGE = 1_000_000;\\n\\n uint256 internal _highTierVWNum;\\n uint256 internal _highTierVWDenom;\\n\\n /// @dev Mapping from mainchain token => the amount thresholds for high-tier withdrawals that requires high-tier vote weights\\n mapping(address => uint256) public highTierThreshold;\\n /// @dev Mapping from mainchain token => the amount thresholds to lock withdrawal\\n mapping(address => uint256) public lockedThreshold;\\n /// @dev Mapping from mainchain token => unlock fee percentages for unlocker\\n /// @notice Values 0-1,000,000 map to 0%-100%\\n mapping(address => uint256) public unlockFeePercentages;\\n /// @dev Mapping from mainchain token => daily limit amount for withdrawal\\n mapping(address => uint256) public dailyWithdrawalLimit;\\n /// @dev Mapping from token address => today withdrawal amount\\n mapping(address => uint256) public lastSyncedWithdrawal;\\n /// @dev Mapping from token address => last date synced to record the `lastSyncedWithdrawal`\\n mapping(address => uint256) public lastDateSynced;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n */\\n uint256[50] private ______gap;\\n\\n /**\\n * @dev Override `GatewayV3-setThreshold`.\\n *\\n * Requirements:\\n * - The high-tier vote weight threshold must equal to or larger than the normal threshold.\\n *\\n */\\n function setThreshold(uint256 num, uint256 denom) external virtual override onlyProxyAdmin {\\n _setThreshold(num, denom);\\n _verifyThresholds();\\n }\\n\\n /**\\n * @dev Returns the high-tier vote weight threshold.\\n */\\n function getHighTierVoteWeightThreshold() external view virtual returns (uint256, uint256) {\\n return (_highTierVWNum, _highTierVWDenom);\\n }\\n\\n /**\\n * @dev Checks whether the `_voteWeight` passes the high-tier vote weight threshold.\\n */\\n function checkHighTierVoteWeightThreshold(uint256 _voteWeight) external view virtual returns (bool) {\\n return _voteWeight * _highTierVWDenom >= _highTierVWNum * _getTotalWeight();\\n }\\n\\n /**\\n * @dev Sets high-tier vote weight threshold and returns the old one.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n * - The high-tier vote weight threshold must equal to or larger than the normal threshold.\\n *\\n * Emits the `HighTierVoteWeightThresholdUpdated` event.\\n *\\n */\\n function setHighTierVoteWeightThreshold(\\n uint256 _numerator,\\n uint256 _denominator\\n ) external virtual onlyProxyAdmin returns (uint256 _previousNum, uint256 _previousDenom) {\\n (_previousNum, _previousDenom) = _setHighTierVoteWeightThreshold(_numerator, _denominator);\\n _verifyThresholds();\\n }\\n\\n /**\\n * @dev Sets the thresholds for high-tier withdrawals that requires high-tier vote weights.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n * - The arrays have the same length and its length larger than 0.\\n *\\n * Emits the `HighTierThresholdsUpdated` event.\\n *\\n */\\n function setHighTierThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) external virtual onlyProxyAdmin {\\n if (_tokens.length == 0) revert ErrEmptyArray();\\n _setHighTierThresholds(_tokens, _thresholds);\\n }\\n\\n /**\\n * @dev Sets the amount thresholds to lock withdrawal.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n * - The arrays have the same length and its length larger than 0.\\n *\\n * Emits the `LockedThresholdsUpdated` event.\\n *\\n */\\n function setLockedThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) external virtual onlyProxyAdmin {\\n if (_tokens.length == 0) revert ErrEmptyArray();\\n _setLockedThresholds(_tokens, _thresholds);\\n }\\n\\n /**\\n * @dev Sets fee percentages to unlock withdrawal.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n * - The arrays have the same length and its length larger than 0.\\n *\\n * Emits the `UnlockFeePercentagesUpdated` event.\\n *\\n */\\n function setUnlockFeePercentages(address[] calldata _tokens, uint256[] calldata _percentages) external virtual onlyProxyAdmin {\\n if (_tokens.length == 0) revert ErrEmptyArray();\\n _setUnlockFeePercentages(_tokens, _percentages);\\n }\\n\\n /**\\n * @dev Sets daily limit amounts for the withdrawals.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n * - The arrays have the same length and its length larger than 0.\\n *\\n * Emits the `DailyWithdrawalLimitsUpdated` event.\\n *\\n */\\n function setDailyWithdrawalLimits(address[] calldata _tokens, uint256[] calldata _limits) external virtual onlyProxyAdmin {\\n if (_tokens.length == 0) revert ErrEmptyArray();\\n _setDailyWithdrawalLimits(_tokens, _limits);\\n }\\n\\n /**\\n * @dev Checks whether the withdrawal reaches the limitation.\\n */\\n function reachedWithdrawalLimit(address _token, uint256 _quantity) external view virtual returns (bool) {\\n return _reachedWithdrawalLimit(_token, _quantity);\\n }\\n\\n /**\\n * @dev Sets high-tier vote weight threshold and returns the old one.\\n *\\n * Emits the `HighTierVoteWeightThresholdUpdated` event.\\n *\\n */\\n function _setHighTierVoteWeightThreshold(uint256 _numerator, uint256 _denominator) internal returns (uint256 _previousNum, uint256 _previousDenom) {\\n if (_numerator > _denominator) revert ErrInvalidThreshold(msg.sig);\\n\\n _previousNum = _highTierVWNum;\\n _previousDenom = _highTierVWDenom;\\n _highTierVWNum = _numerator;\\n _highTierVWDenom = _denominator;\\n\\n unchecked {\\n emit HighTierVoteWeightThresholdUpdated(nonce++, _numerator, _denominator, _previousNum, _previousDenom);\\n }\\n }\\n\\n /**\\n * @dev Sets the thresholds for high-tier withdrawals that requires high-tier vote weights.\\n *\\n * Requirements:\\n * - The array lengths are equal.\\n *\\n * Emits the `HighTierThresholdsUpdated` event.\\n *\\n */\\n function _setHighTierThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) internal virtual {\\n if (_tokens.length != _thresholds.length) revert ErrLengthMismatch(msg.sig);\\n\\n for (uint256 _i; _i < _tokens.length;) {\\n highTierThreshold[_tokens[_i]] = _thresholds[_i];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n emit HighTierThresholdsUpdated(_tokens, _thresholds);\\n }\\n\\n /**\\n * @dev Sets the amount thresholds to lock withdrawal.\\n *\\n * Requirements:\\n * - The array lengths are equal.\\n *\\n * Emits the `LockedThresholdsUpdated` event.\\n *\\n */\\n function _setLockedThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) internal virtual {\\n if (_tokens.length != _thresholds.length) revert ErrLengthMismatch(msg.sig);\\n\\n for (uint256 _i; _i < _tokens.length;) {\\n lockedThreshold[_tokens[_i]] = _thresholds[_i];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n emit LockedThresholdsUpdated(_tokens, _thresholds);\\n }\\n\\n /**\\n * @dev Sets fee percentages to unlock withdrawal.\\n *\\n * Requirements:\\n * - The array lengths are equal.\\n * - The percentage is equal to or less than 100_000.\\n *\\n * Emits the `UnlockFeePercentagesUpdated` event.\\n *\\n */\\n function _setUnlockFeePercentages(address[] calldata _tokens, uint256[] calldata _percentages) internal virtual {\\n if (_tokens.length != _percentages.length) revert ErrLengthMismatch(msg.sig);\\n\\n for (uint256 _i; _i < _tokens.length;) {\\n if (_percentages[_i] > _MAX_PERCENTAGE) revert ErrInvalidPercentage();\\n\\n unlockFeePercentages[_tokens[_i]] = _percentages[_i];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n emit UnlockFeePercentagesUpdated(_tokens, _percentages);\\n }\\n\\n /**\\n * @dev Sets daily limit amounts for the withdrawals.\\n *\\n * Requirements:\\n * - The array lengths are equal.\\n *\\n * Emits the `DailyWithdrawalLimitsUpdated` event.\\n *\\n */\\n function _setDailyWithdrawalLimits(address[] calldata _tokens, uint256[] calldata _limits) internal virtual {\\n if (_tokens.length != _limits.length) revert ErrLengthMismatch(msg.sig);\\n\\n for (uint256 _i; _i < _tokens.length;) {\\n dailyWithdrawalLimit[_tokens[_i]] = _limits[_i];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n emit DailyWithdrawalLimitsUpdated(_tokens, _limits);\\n }\\n\\n /**\\n * @dev Checks whether the withdrawal reaches the daily limitation.\\n *\\n * Requirements:\\n * - The daily withdrawal threshold should not apply for locked withdrawals.\\n *\\n */\\n function _reachedWithdrawalLimit(address _token, uint256 _quantity) internal view virtual returns (bool) {\\n if (_lockedWithdrawalRequest(_token, _quantity)) {\\n return false;\\n }\\n\\n uint256 _currentDate = block.timestamp / 1 days;\\n if (_currentDate > lastDateSynced[_token]) {\\n return dailyWithdrawalLimit[_token] <= _quantity;\\n } else {\\n return dailyWithdrawalLimit[_token] <= lastSyncedWithdrawal[_token] + _quantity;\\n }\\n }\\n\\n /**\\n * @dev Record withdrawal token.\\n */\\n function _recordWithdrawal(address _token, uint256 _quantity) internal virtual {\\n uint256 _currentDate = block.timestamp / 1 days;\\n if (_currentDate > lastDateSynced[_token]) {\\n lastDateSynced[_token] = _currentDate;\\n lastSyncedWithdrawal[_token] = _quantity;\\n } else {\\n lastSyncedWithdrawal[_token] += _quantity;\\n }\\n }\\n\\n /**\\n * @dev Returns whether the withdrawal request is locked or not.\\n */\\n function _lockedWithdrawalRequest(address _token, uint256 _quantity) internal view virtual returns (bool) {\\n return lockedThreshold[_token] <= _quantity;\\n }\\n\\n /**\\n * @dev Computes fee percentage.\\n */\\n function _computeFeePercentage(uint256 _amount, uint256 _percentage) internal view virtual returns (uint256) {\\n return (_amount * _percentage) / _MAX_PERCENTAGE;\\n }\\n\\n /**\\n * @dev Returns high-tier vote weight.\\n */\\n function _highTierVoteWeight(uint256 _totalWeight) internal view virtual returns (uint256) {\\n return (_highTierVWNum * _totalWeight + _highTierVWDenom - 1) / _highTierVWDenom;\\n }\\n\\n /**\\n * @dev Validates whether the high-tier vote weight threshold is larger than the normal threshold.\\n */\\n function _verifyThresholds() internal view {\\n if (_num * _highTierVWDenom > _highTierVWNum * _denom) revert ErrInvalidThreshold(msg.sig);\\n }\\n}\\n\",\"keccak256\":\"0x4b7d559d4b1f53239b8690776318db8d63f578f72fb269d8024570aa70c2c2a6\",\"license\":\"MIT\"},\"src/extensions/collections/HasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { HasProxyAdmin } from \\\"./HasProxyAdmin.sol\\\";\\nimport \\\"../../interfaces/collections/IHasContracts.sol\\\";\\nimport { IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\nimport { ErrUnexpectedInternalCall } from \\\"../../utils/CommonErrors.sol\\\";\\n\\n/**\\n * @title HasContracts\\n * @dev A contract that provides functionality to manage multiple contracts with different roles.\\n */\\nabstract contract HasContracts is HasProxyAdmin, IHasContracts, IdentityGuard {\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.collections.HasContracts.slot\\\") - 1\\n bytes32 private constant _STORAGE_SLOT = 0xdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb;\\n\\n /**\\n * @dev Modifier to restrict access to functions only to contracts with a specific role.\\n * @param contractType The contract type that allowed to call\\n */\\n modifier onlyContract(ContractType contractType) virtual {\\n _requireContract(contractType);\\n _;\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function setContract(ContractType contractType, address addr) external virtual onlyProxyAdmin {\\n _requireHasCode(addr);\\n _setContract(contractType, addr);\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function getContract(ContractType contractType) public view returns (address contract_) {\\n contract_ = _getContractMap()[uint8(contractType)];\\n if (contract_ == address(0)) revert ErrContractTypeNotFound(contractType);\\n }\\n\\n /**\\n * @dev Internal function to set the address of a contract with a specific role.\\n * @param contractType The contract type of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function _setContract(ContractType contractType, address addr) internal virtual {\\n _getContractMap()[uint8(contractType)] = addr;\\n emit ContractUpdated(contractType, addr);\\n }\\n\\n /**\\n * @dev Internal function to access the mapping of contract addresses with roles.\\n * @return contracts_ The mapping of contract addresses with roles.\\n */\\n function _getContractMap() private pure returns (mapping(uint8 => address) storage contracts_) {\\n assembly {\\n contracts_.slot := _STORAGE_SLOT\\n }\\n }\\n\\n /**\\n * @dev Internal function to check if the calling contract has a specific role.\\n * @param contractType The contract type that the calling contract must have.\\n * @dev Throws an error if the calling contract does not have the specified role.\\n */\\n function _requireContract(ContractType contractType) private view {\\n if (msg.sender != getContract(contractType)) {\\n revert ErrUnexpectedInternalCall(msg.sig, contractType, msg.sender);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7dbefa31230e6e4bd319f02d94893cbfd07ee12a0e016f5fadc57660df01891\",\"license\":\"MIT\"},\"src/extensions/collections/HasProxyAdmin.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/StorageSlot.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\n\\nabstract contract HasProxyAdmin {\\n // bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n modifier onlyProxyAdmin() {\\n _requireProxyAdmin();\\n _;\\n }\\n\\n /**\\n * @dev Returns proxy admin.\\n */\\n function _getProxyAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n function _requireProxyAdmin() internal view {\\n if (msg.sender != _getProxyAdmin()) revert ErrUnauthorized(msg.sig, RoleAccess.ADMIN);\\n }\\n}\\n\",\"keccak256\":\"0xad3db02c99a960b60151f2ad45eed46073d14fe1ed861f496c7aeefacbbc528e\",\"license\":\"MIT\"},\"src/interfaces/IMainchainGatewayV3.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IWETH.sol\\\";\\nimport \\\"./consumers/SignatureConsumer.sol\\\";\\nimport \\\"./consumers/MappedTokenConsumer.sol\\\";\\nimport \\\"../libraries/Transfer.sol\\\";\\n\\ninterface IMainchainGatewayV3 is SignatureConsumer, MappedTokenConsumer {\\n /**\\n * @dev Error indicating that a query was made for an approved withdrawal.\\n */\\n error ErrQueryForApprovedWithdrawal();\\n\\n /**\\n * @dev Error indicating that the daily withdrawal limit has been reached.\\n */\\n error ErrReachedDailyWithdrawalLimit();\\n\\n /**\\n * @dev Error indicating that a query was made for a processed withdrawal.\\n */\\n error ErrQueryForProcessedWithdrawal();\\n\\n /**\\n * @dev Error indicating that a query was made for insufficient vote weight.\\n */\\n error ErrQueryForInsufficientVoteWeight();\\n\\n /// @dev Emitted when the deposit is requested\\n event DepositRequested(bytes32 receiptHash, Transfer.Receipt receipt);\\n /// @dev Emitted when the assets are withdrawn\\n event Withdrew(bytes32 receiptHash, Transfer.Receipt receipt);\\n /// @dev Emitted when the tokens are mapped\\n event TokenMapped(address[] mainchainTokens, address[] roninTokens, TokenStandard[] standards);\\n /// @dev Emitted when the wrapped native token contract is updated\\n event WrappedNativeTokenContractUpdated(IWETH weth);\\n /// @dev Emitted when the withdrawal is locked\\n event WithdrawalLocked(bytes32 receiptHash, Transfer.Receipt receipt);\\n /// @dev Emitted when the withdrawal is unlocked\\n event WithdrawalUnlocked(bytes32 receiptHash, Transfer.Receipt receipt);\\n\\n /**\\n * @dev Returns the domain seperator.\\n */\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n\\n /**\\n * @dev Returns deposit count.\\n */\\n function depositCount() external view returns (uint256);\\n\\n /**\\n * @dev Sets the wrapped native token contract.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `WrappedNativeTokenContractUpdated` event.\\n *\\n */\\n function setWrappedNativeTokenContract(IWETH _wrappedToken) external;\\n\\n /**\\n * @dev Returns whether the withdrawal is locked.\\n */\\n function withdrawalLocked(uint256 withdrawalId) external view returns (bool);\\n\\n /**\\n * @dev Returns the withdrawal hash.\\n */\\n function withdrawalHash(uint256 withdrawalId) external view returns (bytes32);\\n\\n /**\\n * @dev Locks the assets and request deposit.\\n */\\n function requestDepositFor(Transfer.Request calldata _request) external payable;\\n\\n /**\\n * @dev Withdraws based on the receipt and the validator signatures.\\n * Returns whether the withdrawal is locked.\\n *\\n * Emits the `Withdrew` once the assets are released.\\n *\\n */\\n function submitWithdrawal(Transfer.Receipt memory _receipt, Signature[] memory _signatures) external returns (bool _locked);\\n\\n /**\\n * @dev Approves a specific withdrawal.\\n *\\n * Requirements:\\n * - The method caller is a validator.\\n *\\n * Emits the `Withdrew` once the assets are released.\\n *\\n */\\n function unlockWithdrawal(Transfer.Receipt calldata _receipt) external;\\n\\n /**\\n * @dev Maps mainchain tokens to Ronin network.\\n *\\n * Requirement:\\n * - The method caller is admin.\\n * - The arrays have the same length and its length larger than 0.\\n *\\n * Emits the `TokenMapped` event.\\n *\\n */\\n function mapTokens(address[] calldata _mainchainTokens, address[] calldata _roninTokens, TokenStandard[] calldata _standards) external;\\n\\n /**\\n * @dev Maps mainchain tokens to Ronin network and sets thresholds.\\n *\\n * Requirement:\\n * - The method caller is admin.\\n * - The arrays have the same length and its length larger than 0.\\n *\\n * Emits the `TokenMapped` event.\\n *\\n */\\n function mapTokensAndThresholds(\\n address[] calldata _mainchainTokens,\\n address[] calldata _roninTokens,\\n TokenStandard[] calldata _standards,\\n uint256[][4] calldata _thresholds\\n ) external;\\n\\n /**\\n * @dev Returns token address on Ronin network.\\n * Note: Reverts for unsupported token.\\n */\\n function getRoninToken(address _mainchainToken) external view returns (MappedToken memory _token);\\n}\\n\",\"keccak256\":\"0x2d4f53a65e76e903040f5f4dbe5aea53367d61243c60efdc8402ff184bd50a87\",\"license\":\"MIT\"},\"src/interfaces/IQuorum.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IQuorum {\\n /// @dev Emitted when the threshold is updated\\n event ThresholdUpdated(uint256 indexed nonce, uint256 indexed numerator, uint256 indexed denominator, uint256 previousNumerator, uint256 previousDenominator);\\n\\n /**\\n * @dev Returns the threshold.\\n */\\n function getThreshold() external view returns (uint256 _num, uint256 _denom);\\n\\n /**\\n * @dev Checks whether the `_voteWeight` passes the threshold.\\n */\\n function checkThreshold(uint256 _voteWeight) external view returns (bool);\\n\\n /**\\n * @dev Returns the minimum vote weight to pass the threshold.\\n */\\n function minimumVoteWeight() external view returns (uint256);\\n\\n /**\\n * @dev Sets the threshold.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `ThresholdUpdated` event.\\n *\\n */\\n function setThreshold(uint256 numerator, uint256 denominator) external;\\n}\\n\",\"keccak256\":\"0xc924e9480f59acc9bc8c033f05d3be9451de5cee0c224d76d4542fa5b67fa10f\",\"license\":\"MIT\"},\"src/interfaces/IWETH.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IWETH {\\n event Transfer(address indexed src, address indexed dst, uint wad);\\n\\n function deposit() external payable;\\n\\n function transfer(address dst, uint wad) external returns (bool);\\n\\n function approve(address guy, uint wad) external returns (bool);\\n\\n function transferFrom(address src, address dst, uint wad) external returns (bool);\\n\\n function withdraw(uint256 _wad) external;\\n\\n function balanceOf(address) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x000700e2b9c1985d53bb1cdba435f0f3d7b48e76e596e7dbbdfec1da47131415\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IBridgeManagerEvents } from \\\"./events/IBridgeManagerEvents.sol\\\";\\n\\n/**\\n * @title IBridgeManager\\n * @dev The interface for managing bridge operators.\\n */\\ninterface IBridgeManager is IBridgeManagerEvents {\\n /// @notice Error indicating that cannot find the querying operator\\n error ErrOperatorNotFound(address operator);\\n /// @notice Error indicating that cannot find the querying governor\\n error ErrGovernorNotFound(address governor);\\n /// @notice Error indicating that the msg.sender is not match the required governor\\n error ErrGovernorNotMatch(address required, address sender);\\n /// @notice Error indicating that the governors list will go below minimum number of required governor.\\n error ErrBelowMinRequiredGovernors();\\n /// @notice Common invalid input error\\n error ErrInvalidInput();\\n\\n /**\\n * @dev The domain separator used for computing hash digests in the contract.\\n */\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n\\n /**\\n * @dev Returns the total number of bridge operators.\\n * @return The total number of bridge operators.\\n */\\n function totalBridgeOperator() external view returns (uint256);\\n\\n /**\\n * @dev Checks if the given address is a bridge operator.\\n * @param addr The address to check.\\n * @return A boolean indicating whether the address is a bridge operator.\\n */\\n function isBridgeOperator(address addr) external view returns (bool);\\n\\n /**\\n * @dev Retrieves the full information of all registered bridge operators.\\n *\\n * This external function allows external callers to obtain the full information of all the registered bridge operators.\\n * The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.\\n *\\n * @return governors An array of addresses representing the governors of each bridge operator.\\n * @return bridgeOperators An array of addresses representing the registered bridge operators.\\n * @return weights An array of uint256 values representing the vote weights of each bridge operator.\\n *\\n * Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator.\\n *\\n * Example Usage:\\n * ```\\n * (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos();\\n * for (uint256 i = 0; i < bridgeOperators.length; i++) {\\n * // Access individual information for each bridge operator.\\n * address governor = governors[i];\\n * address bridgeOperator = bridgeOperators[i];\\n * uint256 weight = weights[i];\\n * // ... (Process or use the information as required) ...\\n * }\\n * ```\\n *\\n */\\n function getFullBridgeOperatorInfos() external view returns (address[] memory governors, address[] memory bridgeOperators, uint96[] memory weights);\\n\\n /**\\n * @dev Returns total weights of the governor list.\\n */\\n function sumGovernorsWeight(address[] calldata governors) external view returns (uint256 sum);\\n\\n /**\\n * @dev Returns total weights.\\n */\\n function getTotalWeight() external view returns (uint256);\\n\\n /**\\n * @dev Returns an array of all bridge operators.\\n * @return An array containing the addresses of all bridge operators.\\n */\\n function getBridgeOperators() external view returns (address[] memory);\\n\\n /**\\n * @dev Returns the corresponding `operator` of a `governor`.\\n */\\n function getOperatorOf(address governor) external view returns (address operator);\\n\\n /**\\n * @dev Returns the corresponding `governor` of a `operator`.\\n */\\n function getGovernorOf(address operator) external view returns (address governor);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific governor.\\n * @param governor The address of the governor to get the vote weight for.\\n * @return voteWeight The vote weight of the specified governor.\\n */\\n function getGovernorWeight(address governor) external view returns (uint96);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific bridge operator.\\n * @param bridgeOperator The address of the bridge operator to get the vote weight for.\\n * @return weight The vote weight of the specified bridge operator.\\n */\\n function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint96 weight);\\n\\n /**\\n * @dev Returns the weights of a list of governor addresses.\\n */\\n function getGovernorWeights(address[] calldata governors) external view returns (uint96[] memory weights);\\n\\n /**\\n * @dev Returns an array of all governors.\\n * @return An array containing the addresses of all governors.\\n */\\n function getGovernors() external view returns (address[] memory);\\n\\n /**\\n * @dev Adds multiple bridge operators.\\n * @param governors An array of addresses of hot/cold wallets for bridge operator to update their node address.\\n * @param bridgeOperators An array of addresses representing the bridge operators to add.\\n */\\n function addBridgeOperators(uint96[] calldata voteWeights, address[] calldata governors, address[] calldata bridgeOperators) external;\\n\\n /**\\n * @dev Removes multiple bridge operators.\\n * @param bridgeOperators An array of addresses representing the bridge operators to remove.\\n */\\n function removeBridgeOperators(address[] calldata bridgeOperators) external;\\n\\n /**\\n * @dev Self-call to update the minimum required governor.\\n * @param min The minimum number, this must not less than 3.\\n */\\n function setMinRequiredGovernor(uint min) external;\\n}\\n\",\"keccak256\":\"0xefc46318a240371031e77ef3c355e2c18432e4479145378de6782277f9b44923\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManagerCallback.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @title IBridgeManagerCallback\\n * @dev Interface for the callback functions to be implemented by the Bridge Manager contract.\\n */\\ninterface IBridgeManagerCallback is IERC165 {\\n /**\\n * @dev Handles the event when bridge operators are added.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @param addeds The corresponding boolean values indicating whether the operators were added or not.\\n * @return selector The selector of the function being called.\\n */\\n function onBridgeOperatorsAdded(address[] memory bridgeOperators, uint96[] calldata weights, bool[] memory addeds) external returns (bytes4 selector);\\n\\n /**\\n * @dev Handles the event when bridge operators are removed.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @param removeds The corresponding boolean values indicating whether the operators were removed or not.\\n * @return selector The selector of the function being called.\\n */\\n function onBridgeOperatorsRemoved(address[] memory bridgeOperators, bool[] memory removeds) external returns (bytes4 selector);\\n}\\n\",\"keccak256\":\"0x6c8ce7e2478e28c5ed5e6f5d8305a77d6d5f9125a47adfb77632940b9a0f3625\",\"license\":\"MIT\"},\"src/interfaces/bridge/events/IBridgeManagerEvents.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeManagerEvents {\\n /**\\n * @dev Emitted when new bridge operators are added.\\n */\\n event BridgeOperatorsAdded(bool[] statuses, uint96[] voteWeights, address[] governors, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is failed to add.\\n */\\n event BridgeOperatorAddingFailed(address indexed operator);\\n\\n /**\\n * @dev Emitted when bridge operators are removed.\\n */\\n event BridgeOperatorsRemoved(bool[] statuses, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is failed to remove.\\n */\\n event BridgeOperatorRemovingFailed(address indexed operator);\\n\\n /**\\n * @dev Emitted when a bridge operator is updated.\\n */\\n event BridgeOperatorUpdated(address indexed governor, address indexed fromBridgeOperator, address indexed toBridgeOperator);\\n\\n /**\\n * @dev Emitted when the minimum number of required governors is updated.\\n */\\n event MinRequiredGovernorUpdated(uint min);\\n}\\n\",\"keccak256\":\"0x38bc3709c98a7c08fb9b6fa3e07a725903dcb0bd07de8a828bac6c3bcf7d997d\",\"license\":\"MIT\"},\"src/interfaces/collections/IHasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport { ContractType } from \\\"../../utils/ContractType.sol\\\";\\n\\ninterface IHasContracts {\\n /// @dev Error of invalid role.\\n error ErrContractTypeNotFound(ContractType contractType);\\n\\n /// @dev Emitted when a contract is updated.\\n event ContractUpdated(ContractType indexed contractType, address indexed addr);\\n\\n /**\\n * @dev Returns the address of a contract with a specific role.\\n * Throws an error if no contract is set for the specified role.\\n *\\n * @param contractType The role of the contract to retrieve.\\n * @return contract_ The address of the contract with the specified role.\\n */\\n function getContract(ContractType contractType) external view returns (address contract_);\\n\\n /**\\n * @dev Sets the address of a contract with a specific role.\\n * Emits the event {ContractUpdated}.\\n * @param contractType The role of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function setContract(ContractType contractType, address addr) external;\\n}\\n\",\"keccak256\":\"0x99d8213d857e30d367155abd15dc42730afdfbbac3a22dfb3b95ffea2083a92e\",\"license\":\"MIT\"},\"src/interfaces/consumers/MappedTokenConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../libraries/LibTokenInfo.sol\\\";\\n\\ninterface MappedTokenConsumer {\\n struct MappedToken {\\n TokenStandard erc;\\n address tokenAddr;\\n }\\n}\\n\",\"keccak256\":\"0xc53dcba9dc7d950ab6561149f76b45617ddbce5037e4c86ea00b976018bbfde1\",\"license\":\"MIT\"},\"src/interfaces/consumers/SignatureConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface SignatureConsumer {\\n struct Signature {\\n uint8 v;\\n bytes32 r;\\n bytes32 s;\\n }\\n}\\n\",\"keccak256\":\"0xd370e350722067097dec1a5c31bda6e47e83417fa5c3288293bb910028cd136b\",\"license\":\"MIT\"},\"src/libraries/AddressArrayUtils.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\nlibrary AddressArrayUtils {\\n /**\\n * @dev Error thrown when a duplicated element is detected in an array.\\n * @param msgSig The function signature that invoke the error.\\n */\\n error ErrDuplicated(bytes4 msgSig);\\n\\n /**\\n * @dev Returns whether or not there's a duplicate. Runs in O(n^2).\\n * @param A Array to search\\n * @return Returns true if duplicate, false otherwise\\n */\\n function hasDuplicate(address[] memory A) internal pure returns (bool) {\\n if (A.length == 0) {\\n return false;\\n }\\n unchecked {\\n for (uint256 i = 0; i < A.length - 1; i++) {\\n for (uint256 j = i + 1; j < A.length; j++) {\\n if (A[i] == A[j]) {\\n return true;\\n }\\n }\\n }\\n }\\n return false;\\n }\\n\\n /**\\n * @dev Returns whether two arrays of addresses are equal or not.\\n */\\n function isEqual(address[] memory _this, address[] memory _other) internal pure returns (bool yes_) {\\n // Hashing two arrays and compare their hash\\n assembly {\\n let _thisHash := keccak256(add(_this, 32), mul(mload(_this), 32))\\n let _otherHash := keccak256(add(_other, 32), mul(mload(_other), 32))\\n yes_ := eq(_thisHash, _otherHash)\\n }\\n }\\n\\n /**\\n * @dev Return the concatenated array from a and b.\\n */\\n function extend(address[] memory a, address[] memory b) internal pure returns (address[] memory c) {\\n uint256 lengthA = a.length;\\n uint256 lengthB = b.length;\\n unchecked {\\n c = new address[](lengthA + lengthB);\\n }\\n uint256 i;\\n for (; i < lengthA;) {\\n c[i] = a[i];\\n unchecked {\\n ++i;\\n }\\n }\\n for (uint256 j; j < lengthB;) {\\n c[i] = b[j];\\n unchecked {\\n ++i;\\n ++j;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce5d578861167da47a965c8a0e1592b808aad6eb79ccb1873bf2e2280ddb85ee\",\"license\":\"UNLICENSED\"},\"src/libraries/LibTokenInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/IERC721.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC1155/presets/ERC1155PresetMinterPauser.sol\\\";\\nimport \\\"../interfaces/IWETH.sol\\\";\\n\\nenum TokenStandard {\\n ERC20,\\n ERC721,\\n ERC1155\\n}\\n\\nstruct TokenInfo {\\n TokenStandard erc;\\n // For ERC20: the id must be 0 and the quantity is larger than 0.\\n // For ERC721: the quantity must be 0.\\n uint256 id;\\n uint256 quantity;\\n}\\n\\n/**\\n * @dev Error indicating that the `transfer` has failed.\\n * @param tokenInfo Info of the token including ERC standard, id or quantity.\\n * @param to Receiver of the token value.\\n * @param token Address of the token.\\n */\\nerror ErrTokenCouldNotTransfer(TokenInfo tokenInfo, address to, address token);\\n\\n/**\\n * @dev Error indicating that the `handleAssetIn` has failed.\\n * @param tokenInfo Info of the token including ERC standard, id or quantity.\\n * @param from Owner of the token value.\\n * @param to Receiver of the token value.\\n * @param token Address of the token.\\n */\\nerror ErrTokenCouldNotTransferFrom(TokenInfo tokenInfo, address from, address to, address token);\\n\\n/// @dev Error indicating that the provided information is invalid.\\nerror ErrInvalidInfo();\\n\\n/// @dev Error indicating that the minting of ERC20 tokens has failed.\\nerror ErrERC20MintingFailed();\\n\\n/// @dev Error indicating that the minting of ERC721 tokens has failed.\\nerror ErrERC721MintingFailed();\\n\\n/// @dev Error indicating that the transfer of ERC1155 tokens has failed.\\nerror ErrERC1155TransferFailed();\\n\\n/// @dev Error indicating that the mint of ERC1155 tokens has failed.\\nerror ErrERC1155MintingFailed();\\n\\n/// @dev Error indicating that an unsupported standard is encountered.\\nerror ErrUnsupportedStandard();\\n\\nlibrary LibTokenInfo {\\n /**\\n *\\n * HASH\\n *\\n */\\n\\n // keccak256(\\\"TokenInfo(uint8 erc,uint256 id,uint256 quantity)\\\");\\n bytes32 public constant INFO_TYPE_HASH_SINGLE = 0x1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d;\\n\\n /**\\n * @dev Returns token info struct hash.\\n */\\n function hash(TokenInfo memory self) internal pure returns (bytes32 digest) {\\n // keccak256(abi.encode(INFO_TYPE_HASH_SINGLE, info.erc, info.id, info.quantity))\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n mstore(ptr, INFO_TYPE_HASH_SINGLE)\\n mstore(add(ptr, 0x20), mload(self)) // info.erc\\n mstore(add(ptr, 0x40), mload(add(self, 0x20))) // info.id\\n mstore(add(ptr, 0x60), mload(add(self, 0x40))) // info.quantity\\n digest := keccak256(ptr, 0x80)\\n }\\n }\\n\\n /**\\n *\\n * VALIDATE\\n *\\n */\\n\\n /**\\n * @dev Validates the token info.\\n */\\n function validate(TokenInfo memory self) internal pure {\\n if (!(_checkERC20(self) || _checkERC721(self) || _checkERC1155(self))) {\\n revert ErrInvalidInfo();\\n }\\n }\\n\\n function _checkERC20(TokenInfo memory self) private pure returns (bool) {\\n return (self.erc == TokenStandard.ERC20 && self.quantity > 0 && self.id == 0);\\n }\\n\\n function _checkERC721(TokenInfo memory self) private pure returns (bool) {\\n return (self.erc == TokenStandard.ERC721 && self.quantity == 0);\\n }\\n\\n function _checkERC1155(TokenInfo memory self) private pure returns (bool res) {\\n // Only validate the quantity, because id of ERC-1155 can be 0.\\n return (self.erc == TokenStandard.ERC1155 && self.quantity > 0);\\n }\\n\\n /**\\n *\\n * TRANSFER IN/OUT METHOD\\n *\\n */\\n\\n /**\\n * @dev Transfer asset in.\\n *\\n * Requirements:\\n * - The `_from` address must approve for the contract using this library.\\n *\\n */\\n function handleAssetIn(TokenInfo memory self, address from, address token) internal {\\n bool success;\\n bytes memory data;\\n if (self.erc == TokenStandard.ERC20) {\\n (success, data) = token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, address(this), self.quantity));\\n success = success && (data.length == 0 || abi.decode(data, (bool)));\\n } else if (self.erc == TokenStandard.ERC721) {\\n success = _tryTransferFromERC721(token, from, address(this), self.id);\\n } else if (self.erc == TokenStandard.ERC1155) {\\n success = _tryTransferFromERC1155(token, from, address(this), self.id, self.quantity);\\n } else {\\n revert ErrUnsupportedStandard();\\n }\\n\\n if (!success) revert ErrTokenCouldNotTransferFrom(self, from, address(this), token);\\n }\\n\\n /**\\n * @dev Tries transfer assets out, or mint the assets if cannot transfer.\\n *\\n * @notice Prioritizes transfer native token if the token is wrapped.\\n *\\n */\\n function handleAssetOut(TokenInfo memory self, address payable to, address token, IWETH wrappedNativeToken) internal {\\n if (token == address(wrappedNativeToken)) {\\n // Try sending the native token before transferring the wrapped token\\n if (!to.send(self.quantity)) {\\n wrappedNativeToken.deposit{ value: self.quantity }();\\n _transferTokenOut(self, to, token);\\n }\\n\\n return;\\n }\\n\\n if (self.erc == TokenStandard.ERC20) {\\n uint256 balance = IERC20(token).balanceOf(address(this));\\n if (balance < self.quantity) {\\n if (!_tryMintERC20(token, address(this), self.quantity - balance)) revert ErrERC20MintingFailed();\\n }\\n\\n _transferTokenOut(self, to, token);\\n return;\\n }\\n\\n if (self.erc == TokenStandard.ERC721) {\\n if (!_tryTransferOutOrMintERC721(token, to, self.id)) {\\n revert ErrERC721MintingFailed();\\n }\\n return;\\n }\\n\\n if (self.erc == TokenStandard.ERC1155) {\\n if (!_tryTransferOutOrMintERC1155(token, to, self.id, self.quantity)) {\\n revert ErrERC1155MintingFailed();\\n }\\n return;\\n }\\n\\n revert ErrUnsupportedStandard();\\n }\\n\\n /**\\n *\\n * TRANSFER HELPERS\\n *\\n */\\n\\n /**\\n * @dev Transfer assets from current address to `_to` address.\\n */\\n function _transferTokenOut(TokenInfo memory self, address to, address token) private {\\n bool success;\\n if (self.erc == TokenStandard.ERC20) {\\n success = _tryTransferERC20(token, to, self.quantity);\\n } else if (self.erc == TokenStandard.ERC721) {\\n success = _tryTransferFromERC721(token, address(this), to, self.id);\\n } else {\\n revert ErrUnsupportedStandard();\\n }\\n\\n if (!success) revert ErrTokenCouldNotTransfer(self, to, token);\\n }\\n\\n /**\\n * TRANSFER ERC-20\\n */\\n\\n /**\\n * @dev Transfers ERC20 token and returns the result.\\n */\\n function _tryTransferERC20(address token, address to, uint256 quantity) private returns (bool success) {\\n bytes memory data;\\n (success, data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, quantity));\\n success = success && (data.length == 0 || abi.decode(data, (bool)));\\n }\\n\\n /**\\n * @dev Mints ERC20 token and returns the result.\\n */\\n function _tryMintERC20(address token, address to, uint256 quantity) private returns (bool success) {\\n // bytes4(keccak256(\\\"mint(address,uint256)\\\"))\\n (success,) = token.call(abi.encodeWithSelector(0x40c10f19, to, quantity));\\n }\\n\\n /**\\n * TRANSFER ERC-721\\n */\\n\\n /**\\n * @dev Transfers the ERC721 token out. If the transfer failed, mints the ERC721.\\n * @return success Returns `false` if both transfer and mint are failed.\\n */\\n function _tryTransferOutOrMintERC721(address token, address to, uint256 id) private returns (bool success) {\\n success = _tryTransferFromERC721(token, address(this), to, id);\\n if (!success) {\\n return _tryMintERC721(token, to, id);\\n }\\n }\\n\\n /**\\n * @dev Transfers ERC721 token and returns the result.\\n */\\n function _tryTransferFromERC721(address token, address from, address to, uint256 id) private returns (bool success) {\\n (success,) = token.call(abi.encodeWithSelector(IERC721.transferFrom.selector, from, to, id));\\n }\\n\\n /**\\n * @dev Mints ERC721 token and returns the result.\\n */\\n function _tryMintERC721(address token, address to, uint256 id) private returns (bool success) {\\n // bytes4(keccak256(\\\"mint(address,uint256)\\\"))\\n (success,) = token.call(abi.encodeWithSelector(0x40c10f19, to, id));\\n }\\n\\n /**\\n * TRANSFER ERC-1155\\n */\\n\\n /**\\n * @dev Transfers the ERC1155 token out. If the transfer failed, mints the ERC11555.\\n * @return success Returns `false` if both transfer and mint are failed.\\n */\\n function _tryTransferOutOrMintERC1155(address token, address to, uint256 id, uint256 amount) private returns (bool success) {\\n success = _tryTransferFromERC1155(token, address(this), to, id, amount);\\n if (!success) {\\n return _tryMintERC1155(token, to, id, amount);\\n }\\n }\\n\\n /**\\n * @dev Transfers ERC1155 token and returns the result.\\n */\\n function _tryTransferFromERC1155(address token, address from, address to, uint256 id, uint256 amount) private returns (bool success) {\\n (success,) = token.call(abi.encodeCall(IERC1155.safeTransferFrom, (from, to, id, amount, new bytes(0))));\\n }\\n\\n /**\\n * @dev Mints ERC1155 token and returns the result.\\n */\\n function _tryMintERC1155(address token, address to, uint256 id, uint256 amount) private returns (bool success) {\\n (success,) = token.call(abi.encodeCall(ERC1155PresetMinterPauser.mint, (to, id, amount, new bytes(0))));\\n }\\n}\\n\",\"keccak256\":\"0x56b413a42c6c39a51dc1737e735d1623b89ecdf00bacd960f70b3f18ccaa6de2\",\"license\":\"MIT\"},\"src/libraries/LibTokenOwner.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nstruct TokenOwner {\\n address addr;\\n address tokenAddr;\\n uint256 chainId;\\n}\\n\\nlibrary LibTokenOwner {\\n // keccak256(\\\"TokenOwner(address addr,address tokenAddr,uint256 chainId)\\\");\\n bytes32 public constant OWNER_TYPE_HASH = 0x353bdd8d69b9e3185b3972e08b03845c0c14a21a390215302776a7a34b0e8764;\\n\\n /**\\n * @dev Returns ownership struct hash.\\n */\\n function hash(TokenOwner memory owner) internal pure returns (bytes32 digest) {\\n // keccak256(abi.encode(OWNER_TYPE_HASH, owner.addr, owner.tokenAddr, owner.chainId))\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n mstore(ptr, OWNER_TYPE_HASH)\\n mstore(add(ptr, 0x20), mload(owner)) // owner.addr\\n mstore(add(ptr, 0x40), mload(add(owner, 0x20))) // owner.tokenAddr\\n mstore(add(ptr, 0x60), mload(add(owner, 0x40))) // owner.chainId\\n digest := keccak256(ptr, 0x80)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb104fd02056a3ed52bf06c202e87b748200320682871b1801985050587ec2d51\",\"license\":\"MIT\"},\"src/libraries/Transfer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./LibTokenInfo.sol\\\";\\nimport \\\"./LibTokenOwner.sol\\\";\\n\\nlibrary Transfer {\\n using ECDSA for bytes32;\\n using LibTokenOwner for TokenOwner;\\n using LibTokenInfo for TokenInfo;\\n\\n enum Kind {\\n Deposit,\\n Withdrawal\\n }\\n\\n struct Request {\\n // For deposit request: Recipient address on Ronin network\\n // For withdrawal request: Recipient address on mainchain network\\n address recipientAddr;\\n // Token address to deposit/withdraw\\n // Value 0: native token\\n address tokenAddr;\\n TokenInfo info;\\n }\\n\\n /**\\n * @dev Converts the transfer request into the deposit receipt.\\n */\\n function into_deposit_receipt(\\n Request memory _request,\\n address _requester,\\n uint256 _id,\\n address _roninTokenAddr,\\n uint256 _roninChainId\\n ) internal view returns (Receipt memory _receipt) {\\n _receipt.id = _id;\\n _receipt.kind = Kind.Deposit;\\n _receipt.mainchain.addr = _requester;\\n _receipt.mainchain.tokenAddr = _request.tokenAddr;\\n _receipt.mainchain.chainId = block.chainid;\\n _receipt.ronin.addr = _request.recipientAddr;\\n _receipt.ronin.tokenAddr = _roninTokenAddr;\\n _receipt.ronin.chainId = _roninChainId;\\n _receipt.info = _request.info;\\n }\\n\\n /**\\n * @dev Converts the transfer request into the withdrawal receipt.\\n */\\n function into_withdrawal_receipt(\\n Request memory _request,\\n address _requester,\\n uint256 _id,\\n address _mainchainTokenAddr,\\n uint256 _mainchainId\\n ) internal view returns (Receipt memory _receipt) {\\n _receipt.id = _id;\\n _receipt.kind = Kind.Withdrawal;\\n _receipt.ronin.addr = _requester;\\n _receipt.ronin.tokenAddr = _request.tokenAddr;\\n _receipt.ronin.chainId = block.chainid;\\n _receipt.mainchain.addr = _request.recipientAddr;\\n _receipt.mainchain.tokenAddr = _mainchainTokenAddr;\\n _receipt.mainchain.chainId = _mainchainId;\\n _receipt.info = _request.info;\\n }\\n\\n struct Receipt {\\n uint256 id;\\n Kind kind;\\n TokenOwner mainchain;\\n TokenOwner ronin;\\n TokenInfo info;\\n }\\n\\n // keccak256(\\\"Receipt(uint256 id,uint8 kind,TokenOwner mainchain,TokenOwner ronin,TokenInfo info)TokenInfo(uint8 erc,uint256 id,uint256 quantity)TokenOwner(address addr,address tokenAddr,uint256 chainId)\\\");\\n bytes32 public constant TYPE_HASH = 0xb9d1fe7c9deeec5dc90a2f47ff1684239519f2545b2228d3d91fb27df3189eea;\\n\\n /**\\n * @dev Returns token info struct hash.\\n */\\n function hash(Receipt memory _receipt) internal pure returns (bytes32 digest) {\\n bytes32 hashedReceiptMainchain = _receipt.mainchain.hash();\\n bytes32 hashedReceiptRonin = _receipt.ronin.hash();\\n bytes32 hashedReceiptInfo = _receipt.info.hash();\\n\\n /*\\n * return\\n * keccak256(\\n * abi.encode(\\n * TYPE_HASH,\\n * _receipt.id,\\n * _receipt.kind,\\n * Token.hash(_receipt.mainchain),\\n * Token.hash(_receipt.ronin),\\n * Token.hash(_receipt.info)\\n * )\\n * );\\n */\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, TYPE_HASH)\\n mstore(add(ptr, 0x20), mload(_receipt)) // _receipt.id\\n mstore(add(ptr, 0x40), mload(add(_receipt, 0x20))) // _receipt.kind\\n mstore(add(ptr, 0x60), hashedReceiptMainchain)\\n mstore(add(ptr, 0x80), hashedReceiptRonin)\\n mstore(add(ptr, 0xa0), hashedReceiptInfo)\\n digest := keccak256(ptr, 0xc0)\\n }\\n }\\n\\n /**\\n * @dev Returns the receipt digest.\\n */\\n function receiptDigest(bytes32 _domainSeparator, bytes32 _receiptHash) internal pure returns (bytes32) {\\n return _domainSeparator.toTypedDataHash(_receiptHash);\\n }\\n}\\n\",\"keccak256\":\"0x652c72f4e9aeffed1be05759c84c538a416d2c264deef9af4c53de0a1ad04ee4\",\"license\":\"MIT\"},\"src/mainchain/MainchainGatewayV3.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.23;\\n\\nimport \\\"@openzeppelin/contracts/access/AccessControlEnumerable.sol\\\";\\nimport \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol\\\";\\nimport { IBridgeManager } from \\\"../interfaces/bridge/IBridgeManager.sol\\\";\\nimport { IBridgeManagerCallback } from \\\"../interfaces/bridge/IBridgeManagerCallback.sol\\\";\\nimport { HasContracts, ContractType } from \\\"../extensions/collections/HasContracts.sol\\\";\\nimport \\\"../extensions/WethUnwrapper.sol\\\";\\nimport \\\"../extensions/WithdrawalLimitation.sol\\\";\\nimport \\\"../libraries/Transfer.sol\\\";\\nimport \\\"../interfaces/IMainchainGatewayV3.sol\\\";\\n\\ncontract MainchainGatewayV3 is\\n WithdrawalLimitation,\\n Initializable,\\n AccessControlEnumerable,\\n ERC1155Holder,\\n IMainchainGatewayV3,\\n HasContracts,\\n IBridgeManagerCallback\\n{\\n using LibTokenInfo for TokenInfo;\\n using Transfer for Transfer.Request;\\n using Transfer for Transfer.Receipt;\\n\\n /// @dev Withdrawal unlocker role hash\\n bytes32 public constant WITHDRAWAL_UNLOCKER_ROLE = keccak256(\\\"WITHDRAWAL_UNLOCKER_ROLE\\\");\\n\\n /// @dev Wrapped native token address\\n IWETH public wrappedNativeToken;\\n /// @dev Ronin network id\\n uint256 public roninChainId;\\n /// @dev Total deposit\\n uint256 public depositCount;\\n /// @dev Domain separator\\n bytes32 internal _domainSeparator;\\n /// @dev Mapping from mainchain token => token address on Ronin network\\n mapping(address => MappedToken) internal _roninToken;\\n /// @dev Mapping from withdrawal id => withdrawal hash\\n mapping(uint256 => bytes32) public withdrawalHash;\\n /// @dev Mapping from withdrawal id => locked\\n mapping(uint256 => bool) public withdrawalLocked;\\n\\n /// @custom:deprecated Previously `_bridgeOperatorAddedBlock` (mapping(address => uint256))\\n uint256 private ______deprecatedBridgeOperatorAddedBlock;\\n /// @custom:deprecated Previously `_bridgeOperators` (uint256[])\\n uint256 private ______deprecatedBridgeOperators;\\n\\n uint96 private _totalOperatorWeight;\\n mapping(address operator => uint96 weight) private _operatorWeight;\\n WethUnwrapper public wethUnwrapper;\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n receive() external payable {\\n _fallback();\\n }\\n\\n /**\\n * @dev Initializes contract storage.\\n */\\n function initialize(\\n address _roleSetter,\\n IWETH _wrappedToken,\\n uint256 _roninChainId,\\n uint256 _numerator,\\n uint256 _highTierVWNumerator,\\n uint256 _denominator,\\n // _addresses[0]: mainchainTokens\\n // _addresses[1]: roninTokens\\n // _addresses[2]: withdrawalUnlockers\\n address[][3] calldata _addresses,\\n // _thresholds[0]: highTierThreshold\\n // _thresholds[1]: lockedThreshold\\n // _thresholds[2]: unlockFeePercentages\\n // _thresholds[3]: dailyWithdrawalLimit\\n uint256[][4] calldata _thresholds,\\n TokenStandard[] calldata _standards\\n ) external payable virtual initializer {\\n _setupRole(DEFAULT_ADMIN_ROLE, _roleSetter);\\n roninChainId = _roninChainId;\\n\\n _setWrappedNativeTokenContract(_wrappedToken);\\n _updateDomainSeparator();\\n _setThreshold(_numerator, _denominator);\\n _setHighTierVoteWeightThreshold(_highTierVWNumerator, _denominator);\\n _verifyThresholds();\\n\\n if (_addresses[0].length > 0) {\\n // Map mainchain tokens to ronin tokens\\n _mapTokens(_addresses[0], _addresses[1], _standards);\\n // Sets thresholds based on the mainchain tokens\\n _setHighTierThresholds(_addresses[0], _thresholds[0]);\\n _setLockedThresholds(_addresses[0], _thresholds[1]);\\n _setUnlockFeePercentages(_addresses[0], _thresholds[2]);\\n _setDailyWithdrawalLimits(_addresses[0], _thresholds[3]);\\n }\\n\\n // Grant role for withdrawal unlocker\\n for (uint256 i; i < _addresses[2].length; i++) {\\n _grantRole(WITHDRAWAL_UNLOCKER_ROLE, _addresses[2][i]);\\n }\\n }\\n\\n function initializeV2(address bridgeManagerContract) external reinitializer(2) {\\n _setContract(ContractType.BRIDGE_MANAGER, bridgeManagerContract);\\n }\\n\\n function initializeV3() external reinitializer(3) {\\n IBridgeManager mainchainBridgeManager = IBridgeManager(getContract(ContractType.BRIDGE_MANAGER));\\n (, address[] memory operators, uint96[] memory weights) = mainchainBridgeManager.getFullBridgeOperatorInfos();\\n\\n uint96 totalWeight;\\n for (uint i; i < operators.length; i++) {\\n _operatorWeight[operators[i]] = weights[i];\\n totalWeight += weights[i];\\n }\\n _totalOperatorWeight = totalWeight;\\n }\\n\\n function initializeV4(address payable wethUnwrapper_) external reinitializer(4) {\\n wethUnwrapper = WethUnwrapper(wethUnwrapper_);\\n }\\n\\n /**\\n * @dev Receives ether without doing anything. Use this function to topup native token.\\n */\\n function receiveEther() external payable { }\\n\\n /**\\n * @inheritdoc IMainchainGatewayV3\\n */\\n function DOMAIN_SEPARATOR() external view virtual returns (bytes32) {\\n return _domainSeparator;\\n }\\n\\n /**\\n * @inheritdoc IMainchainGatewayV3\\n */\\n function setWrappedNativeTokenContract(IWETH _wrappedToken) external virtual onlyProxyAdmin {\\n _setWrappedNativeTokenContract(_wrappedToken);\\n }\\n\\n /**\\n * @inheritdoc IMainchainGatewayV3\\n */\\n function requestDepositFor(Transfer.Request calldata _request) external payable virtual whenNotPaused {\\n _requestDepositFor(_request, msg.sender);\\n }\\n\\n /**\\n * @inheritdoc IMainchainGatewayV3\\n */\\n function submitWithdrawal(Transfer.Receipt calldata _receipt, Signature[] calldata _signatures) external virtual whenNotPaused returns (bool _locked) {\\n return _submitWithdrawal(_receipt, _signatures);\\n }\\n\\n /**\\n * @inheritdoc IMainchainGatewayV3\\n */\\n function unlockWithdrawal(Transfer.Receipt calldata receipt) external onlyRole(WITHDRAWAL_UNLOCKER_ROLE) {\\n bytes32 _receiptHash = receipt.hash();\\n if (withdrawalHash[receipt.id] != receipt.hash()) {\\n revert ErrInvalidReceipt();\\n }\\n if (!withdrawalLocked[receipt.id]) {\\n revert ErrQueryForApprovedWithdrawal();\\n }\\n delete withdrawalLocked[receipt.id];\\n emit WithdrawalUnlocked(_receiptHash, receipt);\\n\\n address token = receipt.mainchain.tokenAddr;\\n if (receipt.info.erc == TokenStandard.ERC20) {\\n TokenInfo memory feeInfo = receipt.info;\\n feeInfo.quantity = _computeFeePercentage(receipt.info.quantity, unlockFeePercentages[token]);\\n TokenInfo memory withdrawInfo = receipt.info;\\n withdrawInfo.quantity = receipt.info.quantity - feeInfo.quantity;\\n\\n feeInfo.handleAssetOut(payable(msg.sender), token, wrappedNativeToken);\\n withdrawInfo.handleAssetOut(payable(receipt.mainchain.addr), token, wrappedNativeToken);\\n } else {\\n receipt.info.handleAssetOut(payable(receipt.mainchain.addr), token, wrappedNativeToken);\\n }\\n\\n emit Withdrew(_receiptHash, receipt);\\n }\\n\\n /**\\n * @inheritdoc IMainchainGatewayV3\\n */\\n function mapTokens(address[] calldata _mainchainTokens, address[] calldata _roninTokens, TokenStandard[] calldata _standards) external virtual onlyProxyAdmin {\\n if (_mainchainTokens.length == 0) revert ErrEmptyArray();\\n _mapTokens(_mainchainTokens, _roninTokens, _standards);\\n }\\n\\n /**\\n * @inheritdoc IMainchainGatewayV3\\n */\\n function mapTokensAndThresholds(\\n address[] calldata _mainchainTokens,\\n address[] calldata _roninTokens,\\n TokenStandard[] calldata _standards,\\n // _thresholds[0]: highTierThreshold\\n // _thresholds[1]: lockedThreshold\\n // _thresholds[2]: unlockFeePercentages\\n // _thresholds[3]: dailyWithdrawalLimit\\n uint256[][4] calldata _thresholds\\n ) external virtual onlyProxyAdmin {\\n if (_mainchainTokens.length == 0) revert ErrEmptyArray();\\n _mapTokens(_mainchainTokens, _roninTokens, _standards);\\n _setHighTierThresholds(_mainchainTokens, _thresholds[0]);\\n _setLockedThresholds(_mainchainTokens, _thresholds[1]);\\n _setUnlockFeePercentages(_mainchainTokens, _thresholds[2]);\\n _setDailyWithdrawalLimits(_mainchainTokens, _thresholds[3]);\\n }\\n\\n /**\\n * @inheritdoc IMainchainGatewayV3\\n */\\n function getRoninToken(address mainchainToken) public view returns (MappedToken memory token) {\\n token = _roninToken[mainchainToken];\\n if (token.tokenAddr == address(0)) revert ErrUnsupportedToken();\\n }\\n\\n /**\\n * @dev Maps mainchain tokens to Ronin network.\\n *\\n * Requirement:\\n * - The arrays have the same length.\\n *\\n * Emits the `TokenMapped` event.\\n *\\n */\\n function _mapTokens(address[] calldata mainchainTokens, address[] calldata roninTokens, TokenStandard[] calldata standards) internal virtual {\\n if (!(mainchainTokens.length == roninTokens.length && mainchainTokens.length == standards.length)) revert ErrLengthMismatch(msg.sig);\\n\\n for (uint256 i; i < mainchainTokens.length; ++i) {\\n _roninToken[mainchainTokens[i]].tokenAddr = roninTokens[i];\\n _roninToken[mainchainTokens[i]].erc = standards[i];\\n }\\n\\n emit TokenMapped(mainchainTokens, roninTokens, standards);\\n }\\n\\n /**\\n * @dev Submits withdrawal receipt.\\n *\\n * Requirements:\\n * - The receipt kind is withdrawal.\\n * - The receipt is to withdraw on this chain.\\n * - The receipt is not used to withdraw before.\\n * - The withdrawal is not reached the limit threshold.\\n * - The signer weight total is larger than or equal to the minimum threshold.\\n * - The signature signers are in order.\\n *\\n * Emits the `Withdrew` once the assets are released.\\n *\\n */\\n function _submitWithdrawal(Transfer.Receipt calldata receipt, Signature[] memory signatures) internal virtual returns (bool locked) {\\n uint256 id = receipt.id;\\n uint256 quantity = receipt.info.quantity;\\n address tokenAddr = receipt.mainchain.tokenAddr;\\n\\n receipt.info.validate();\\n if (receipt.kind != Transfer.Kind.Withdrawal) revert ErrInvalidReceiptKind();\\n\\n if (receipt.mainchain.chainId != block.chainid) {\\n revert ErrInvalidChainId(msg.sig, receipt.mainchain.chainId, block.chainid);\\n }\\n\\n MappedToken memory token = getRoninToken(receipt.mainchain.tokenAddr);\\n\\n if (!(token.erc == receipt.info.erc && token.tokenAddr == receipt.ronin.tokenAddr && receipt.ronin.chainId == roninChainId)) {\\n revert ErrInvalidReceipt();\\n }\\n\\n if (withdrawalHash[id] != 0) revert ErrQueryForProcessedWithdrawal();\\n\\n if (!(receipt.info.erc == TokenStandard.ERC721 || !_reachedWithdrawalLimit(tokenAddr, quantity))) {\\n revert ErrReachedDailyWithdrawalLimit();\\n }\\n\\n bytes32 receiptHash = receipt.hash();\\n bytes32 receiptDigest = Transfer.receiptDigest(_domainSeparator, receiptHash);\\n\\n uint256 minimumWeight;\\n (minimumWeight, locked) = _computeMinVoteWeight(receipt.info.erc, tokenAddr, quantity);\\n\\n {\\n bool passed;\\n address signer;\\n address lastSigner;\\n Signature memory sig;\\n uint256 weight;\\n for (uint256 i; i < signatures.length; i++) {\\n sig = signatures[i];\\n signer = ecrecover(receiptDigest, sig.v, sig.r, sig.s);\\n if (lastSigner >= signer) revert ErrInvalidOrder(msg.sig);\\n\\n lastSigner = signer;\\n\\n weight += _getWeight(signer);\\n if (weight >= minimumWeight) {\\n passed = true;\\n break;\\n }\\n }\\n\\n if (!passed) revert ErrQueryForInsufficientVoteWeight();\\n withdrawalHash[id] = receiptHash;\\n }\\n\\n if (locked) {\\n withdrawalLocked[id] = true;\\n emit WithdrawalLocked(receiptHash, receipt);\\n return locked;\\n }\\n\\n _recordWithdrawal(tokenAddr, quantity);\\n receipt.info.handleAssetOut(payable(receipt.mainchain.addr), tokenAddr, wrappedNativeToken);\\n emit Withdrew(receiptHash, receipt);\\n }\\n\\n /**\\n * @dev Requests deposit made by `_requester` address.\\n *\\n * Requirements:\\n * - The token info is valid.\\n * - The `msg.value` is 0 while depositing ERC20 token.\\n * - The `msg.value` is equal to deposit quantity while depositing native token.\\n *\\n * Emits the `DepositRequested` event.\\n *\\n */\\n function _requestDepositFor(Transfer.Request memory _request, address _requester) internal virtual {\\n MappedToken memory _token;\\n address _roninWeth = address(wrappedNativeToken);\\n\\n _request.info.validate();\\n if (_request.tokenAddr == address(0)) {\\n if (_request.info.quantity != msg.value) revert ErrInvalidRequest();\\n\\n _token = getRoninToken(_roninWeth);\\n if (_token.erc != _request.info.erc) revert ErrInvalidTokenStandard();\\n\\n _request.tokenAddr = _roninWeth;\\n } else {\\n if (msg.value != 0) revert ErrInvalidRequest();\\n\\n _token = getRoninToken(_request.tokenAddr);\\n if (_token.erc != _request.info.erc) revert ErrInvalidTokenStandard();\\n\\n _request.info.handleAssetIn(_requester, _request.tokenAddr);\\n // Withdraw if token is WETH\\n // The withdraw of WETH must go via `WethUnwrapper`, because `WETH.withdraw` only sends 2300 gas, which is insufficient when recipient is a proxy.\\n if (_roninWeth == _request.tokenAddr) {\\n wrappedNativeToken.approve(address(wethUnwrapper), _request.info.quantity);\\n wethUnwrapper.unwrap(_request.info.quantity);\\n }\\n }\\n\\n uint256 _depositId = depositCount++;\\n Transfer.Receipt memory _receipt = _request.into_deposit_receipt(_requester, _depositId, _token.tokenAddr, roninChainId);\\n\\n emit DepositRequested(_receipt.hash(), _receipt);\\n }\\n\\n /**\\n * @dev Returns the minimum vote weight for the token.\\n */\\n function _computeMinVoteWeight(TokenStandard _erc, address _token, uint256 _quantity) internal virtual returns (uint256 _weight, bool _locked) {\\n uint256 _totalWeight = _getTotalWeight();\\n _weight = _minimumVoteWeight(_totalWeight);\\n if (_erc == TokenStandard.ERC20) {\\n if (highTierThreshold[_token] <= _quantity) {\\n _weight = _highTierVoteWeight(_totalWeight);\\n }\\n _locked = _lockedWithdrawalRequest(_token, _quantity);\\n }\\n }\\n\\n /**\\n * @dev Update domain seperator.\\n */\\n function _updateDomainSeparator() internal {\\n /*\\n * _domainSeparator = keccak256(\\n * abi.encode(\\n * keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"),\\n * keccak256(\\\"MainchainGatewayV2\\\"),\\n * keccak256(\\\"2\\\"),\\n * block.chainid,\\n * address(this)\\n * )\\n * );\\n */\\n assembly {\\n let ptr := mload(0x40)\\n // keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\")\\n mstore(ptr, 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f)\\n // keccak256(\\\"MainchainGatewayV2\\\")\\n mstore(add(ptr, 0x20), 0x159f52c1e3a2b6a6aad3950adf713516211484e0516dad685ea662a094b7c43b)\\n // keccak256(\\\"2\\\")\\n mstore(add(ptr, 0x40), 0xad7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5)\\n mstore(add(ptr, 0x60), chainid())\\n mstore(add(ptr, 0x80), address())\\n sstore(_domainSeparator.slot, keccak256(ptr, 0xa0))\\n }\\n }\\n\\n /**\\n * @dev Sets the WETH contract.\\n *\\n * Emits the `WrappedNativeTokenContractUpdated` event.\\n *\\n */\\n function _setWrappedNativeTokenContract(IWETH _wrapedToken) internal {\\n wrappedNativeToken = _wrapedToken;\\n emit WrappedNativeTokenContractUpdated(_wrapedToken);\\n }\\n\\n /**\\n * @dev Receives ETH from WETH or creates deposit request if sender is not WETH or WETHUnwrapper.\\n */\\n function _fallback() internal virtual {\\n if (msg.sender == address(wrappedNativeToken) || msg.sender == address(wethUnwrapper)) {\\n return;\\n }\\n\\n _createDepositOnFallback();\\n }\\n\\n /**\\n * @dev Creates deposit request.\\n */\\n function _createDepositOnFallback() internal virtual whenNotPaused {\\n Transfer.Request memory _request;\\n _request.recipientAddr = msg.sender;\\n _request.info.quantity = msg.value;\\n _requestDepositFor(_request, _request.recipientAddr);\\n }\\n\\n /**\\n * @inheritdoc GatewayV3\\n */\\n function _getTotalWeight() internal view override returns (uint256) {\\n return _totalOperatorWeight;\\n }\\n\\n /**\\n * @dev Returns the weight of an address.\\n */\\n function _getWeight(address addr) internal view returns (uint256) {\\n return _operatorWeight[addr];\\n }\\n\\n ///////////////////////////////////////////////\\n // CALLBACKS\\n ///////////////////////////////////////////////\\n\\n /**\\n * @inheritdoc IBridgeManagerCallback\\n */\\n function onBridgeOperatorsAdded(\\n address[] calldata operators,\\n uint96[] calldata weights,\\n bool[] memory addeds\\n ) external onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) {\\n uint256 length = operators.length;\\n if (length != addeds.length || length != weights.length) revert ErrLengthMismatch(msg.sig);\\n if (length == 0) {\\n return IBridgeManagerCallback.onBridgeOperatorsAdded.selector;\\n }\\n\\n for (uint256 i; i < length; ++i) {\\n unchecked {\\n if (addeds[i]) {\\n _totalOperatorWeight += weights[i];\\n _operatorWeight[operators[i]] = weights[i];\\n }\\n }\\n }\\n\\n return IBridgeManagerCallback.onBridgeOperatorsAdded.selector;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallback\\n */\\n function onBridgeOperatorsRemoved(address[] calldata operators, bool[] calldata removeds) external onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) {\\n uint length = operators.length;\\n if (length != removeds.length) revert ErrLengthMismatch(msg.sig);\\n if (length == 0) {\\n return IBridgeManagerCallback.onBridgeOperatorsRemoved.selector;\\n }\\n\\n uint96 totalRemovingWeight;\\n for (uint i; i < length; ++i) {\\n unchecked {\\n if (removeds[i]) {\\n totalRemovingWeight += _operatorWeight[operators[i]];\\n delete _operatorWeight[operators[i]];\\n }\\n }\\n }\\n\\n _totalOperatorWeight -= totalRemovingWeight;\\n\\n return IBridgeManagerCallback.onBridgeOperatorsRemoved.selector;\\n }\\n\\n function supportsInterface(bytes4 interfaceId) public view override(AccessControlEnumerable, IERC165, ERC1155Receiver) returns (bool) {\\n return interfaceId == type(IMainchainGatewayV3).interfaceId || interfaceId == type(IBridgeManagerCallback).interfaceId || super.supportsInterface(interfaceId);\\n }\\n}\\n\",\"keccak256\":\"0xec96f442086b449ebfd100c3bee1c866e816fea34a443a4b43a0dd7b85751595\",\"license\":\"MIT\"},\"src/utils/CommonErrors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ContractType } from \\\"./ContractType.sol\\\";\\nimport { RoleAccess } from \\\"./RoleAccess.sol\\\";\\n\\nerror ErrSyncTooFarPeriod(uint256 period, uint256 latestRewardedPeriod);\\n/**\\n * @dev Error thrown when an address is expected to be an already created externally owned account (EOA).\\n * This error indicates that the provided address is invalid for certain contract operations that require already created EOA.\\n */\\nerror ErrAddressIsNotCreatedEOA(address addr, bytes32 codehash);\\n/**\\n * @dev Error raised when a bridge operator update operation fails.\\n * @param bridgeOperator The address of the bridge operator that failed to update.\\n */\\nerror ErrBridgeOperatorUpdateFailed(address bridgeOperator);\\n/**\\n * @dev Error thrown when attempting to add a bridge operator that already exists in the contract.\\n * This error indicates that the provided bridge operator address is already registered as a bridge operator in the contract.\\n */\\nerror ErrBridgeOperatorAlreadyExisted(address bridgeOperator);\\n/**\\n * @dev The error indicating an unsupported interface.\\n * @param interfaceId The bytes4 interface identifier that is not supported.\\n * @param addr The address where the unsupported interface was encountered.\\n */\\nerror ErrUnsupportedInterface(bytes4 interfaceId, address addr);\\n/**\\n * @dev Error thrown when the return data from a callback function is invalid.\\n * @param callbackFnSig The signature of the callback function that returned invalid data.\\n * @param register The address of the register where the callback function was invoked.\\n * @param returnData The invalid return data received from the callback function.\\n */\\nerror ErrInvalidReturnData(bytes4 callbackFnSig, address register, bytes returnData);\\n/**\\n * @dev Error of set to non-contract.\\n */\\nerror ErrZeroCodeContract(address addr);\\n/**\\n * @dev Error indicating that arguments are invalid.\\n */\\nerror ErrInvalidArguments(bytes4 msgSig);\\n/**\\n * @dev Error indicating that given address is null when it should not.\\n */\\nerror ErrZeroAddress(bytes4 msgSig);\\n/**\\n * @dev Error indicating that the provided threshold is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that the invalid threshold applies to.\\n */\\nerror ErrInvalidThreshold(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a function can only be called by the contract itself.\\n * @param msgSig The function signature (bytes4) that can only be called by the contract itself.\\n */\\nerror ErrOnlySelfCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n * @param expectedRole The role required to perform the function.\\n */\\nerror ErrUnauthorized(bytes4 msgSig, RoleAccess expectedRole);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n */\\nerror ErrUnauthorizedCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4).\\n * @param expectedContractType The contract type required to perform the function.\\n * @param actual The actual address that called to the function.\\n */\\nerror ErrUnexpectedInternalCall(bytes4 msgSig, ContractType expectedContractType, address actual);\\n\\n/**\\n * @dev Error indicating that an array is empty when it should contain elements.\\n */\\nerror ErrEmptyArray();\\n\\n/**\\n * @dev Error indicating a mismatch in the length of input parameters or arrays for a specific function.\\n * @param msgSig The function signature (bytes4) that has a length mismatch.\\n */\\nerror ErrLengthMismatch(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a proxy call to an external contract has failed.\\n * @param msgSig The function signature (bytes4) of the proxy call that failed.\\n * @param extCallSig The function signature (bytes4) of the external contract call that failed.\\n */\\nerror ErrProxyCallFailed(bytes4 msgSig, bytes4 extCallSig);\\n\\n/**\\n * @dev Error indicating that a function tried to call a precompiled contract that is not allowed.\\n * @param msgSig The function signature (bytes4) that attempted to call a precompiled contract.\\n */\\nerror ErrCallPrecompiled(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a native token transfer has failed.\\n * @param msgSig The function signature (bytes4) of the token transfer that failed.\\n */\\nerror ErrNativeTransferFailed(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that an order is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid order.\\n */\\nerror ErrInvalidOrder(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the chain ID is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid chain ID.\\n * @param actual Current chain ID that executing function.\\n * @param expected Expected chain ID required for the tx to success.\\n */\\nerror ErrInvalidChainId(bytes4 msgSig, uint256 actual, uint256 expected);\\n\\n/**\\n * @dev Error indicating that a vote type is not supported.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an unsupported vote type.\\n */\\nerror ErrUnsupportedVoteType(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the proposal nonce is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid proposal nonce.\\n */\\nerror ErrInvalidProposalNonce(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a voter has already voted.\\n * @param voter The address of the voter who has already voted.\\n */\\nerror ErrAlreadyVoted(address voter);\\n\\n/**\\n * @dev Error indicating that a signature is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid signature.\\n */\\nerror ErrInvalidSignatures(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a relay call has failed.\\n * @param msgSig The function signature (bytes4) of the relay call that failed.\\n */\\nerror ErrRelayFailed(bytes4 msgSig);\\n/**\\n * @dev Error indicating that a vote weight is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid vote weight.\\n */\\nerror ErrInvalidVoteWeight(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a query was made for an outdated bridge operator set.\\n */\\nerror ErrQueryForOutdatedBridgeOperatorSet();\\n\\n/**\\n * @dev Error indicating that a request is invalid.\\n */\\nerror ErrInvalidRequest();\\n\\n/**\\n * @dev Error indicating that a token standard is invalid.\\n */\\nerror ErrInvalidTokenStandard();\\n\\n/**\\n * @dev Error indicating that a token is not supported.\\n */\\nerror ErrUnsupportedToken();\\n\\n/**\\n * @dev Error indicating that a receipt kind is invalid.\\n */\\nerror ErrInvalidReceiptKind();\\n\\n/**\\n * @dev Error indicating that a receipt is invalid.\\n */\\nerror ErrInvalidReceipt();\\n\\n/**\\n * @dev Error indicating that an address is not payable.\\n */\\nerror ErrNonpayableAddress(address);\\n\\n/**\\n * @dev Error indicating that the period is already processed, i.e. scattered reward.\\n */\\nerror ErrPeriodAlreadyProcessed(uint256 requestingPeriod, uint256 latestPeriod);\\n\\n/**\\n * @dev Error thrown when an invalid vote hash is provided.\\n */\\nerror ErrInvalidVoteHash();\\n\\n/**\\n * @dev Error thrown when querying for an empty vote.\\n */\\nerror ErrQueryForEmptyVote();\\n\\n/**\\n * @dev Error thrown when querying for an expired vote.\\n */\\nerror ErrQueryForExpiredVote();\\n\\n/**\\n * @dev Error thrown when querying for a non-existent vote.\\n */\\nerror ErrQueryForNonExistentVote();\\n\\n/**\\n * @dev Error indicating that the method is only called once per block.\\n */\\nerror ErrOncePerBlock();\\n\\n/**\\n * @dev Error of method caller must be coinbase\\n */\\nerror ErrCallerMustBeCoinbase();\\n\\n/**\\n * @dev Error thrown when an invalid proposal is encountered.\\n * @param actual The actual value of the proposal.\\n * @param expected The expected value of the proposal.\\n */\\nerror ErrInvalidProposal(bytes32 actual, bytes32 expected);\\n\\n/**\\n * @dev Error of proposal is not approved for executing.\\n */\\nerror ErrProposalNotApproved();\\n\\n/**\\n * @dev Error of the caller is not the specified executor.\\n */\\nerror ErrInvalidExecutor();\\n\\n/**\\n * @dev Error of the `caller` to relay is not the specified `executor`.\\n */\\nerror ErrNonExecutorCannotRelay(address executor, address caller);\\n\",\"keccak256\":\"0x0d9e2fd98f6b704273faad707ed9eadbd4c79551ee3f902bff5b29213a204679\",\"license\":\"MIT\"},\"src/utils/ContractType.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum ContractType {\\n UNKNOWN, // 0\\n PAUSE_ENFORCER, // 1\\n BRIDGE, // 2\\n BRIDGE_TRACKING, // 3\\n GOVERNANCE_ADMIN, // 4\\n MAINTENANCE, // 5\\n SLASH_INDICATOR, // 6\\n STAKING_VESTING, // 7\\n VALIDATOR, // 8\\n STAKING, // 9\\n RONIN_TRUSTED_ORGANIZATION, // 10\\n BRIDGE_MANAGER, // 11\\n BRIDGE_SLASH, // 12\\n BRIDGE_REWARD, // 13\\n FAST_FINALITY_TRACKING, // 14\\n PROFILE // 15\\n\\n}\\n\",\"keccak256\":\"0xec088aa939cd885dbe84e944942d7ea674e1fff8802c1f2ae5d8e84e4578357d\",\"license\":\"MIT\"},\"src/utils/IdentityGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { AddressArrayUtils } from \\\"../libraries/AddressArrayUtils.sol\\\";\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport { TransparentUpgradeableProxyV2 } from \\\"../extensions/TransparentUpgradeableProxyV2.sol\\\";\\nimport { ErrAddressIsNotCreatedEOA, ErrZeroAddress, ErrOnlySelfCall, ErrZeroCodeContract, ErrUnsupportedInterface } from \\\"./CommonErrors.sol\\\";\\n\\nabstract contract IdentityGuard {\\n using AddressArrayUtils for address[];\\n\\n /// @dev value is equal to keccak256(abi.encode())\\n /// @dev see: https://eips.ethereum.org/EIPS/eip-1052\\n bytes32 internal constant CREATED_ACCOUNT_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\\n\\n /**\\n * @dev Modifier to restrict functions to only be called by this contract.\\n * @dev Reverts if the caller is not this contract.\\n */\\n modifier onlySelfCall() virtual {\\n _requireSelfCall();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to ensure that the elements in the `arr` array are non-duplicates.\\n * It calls the internal `_checkDuplicate` function to perform the duplicate check.\\n *\\n * Requirements:\\n * - The elements in the `arr` array must not contain any duplicates.\\n */\\n modifier nonDuplicate(address[] memory arr) virtual {\\n _requireNonDuplicate(arr);\\n _;\\n }\\n\\n /**\\n * @dev Internal method to check the method caller.\\n * @dev Reverts if the method caller is not this contract.\\n */\\n function _requireSelfCall() internal view virtual {\\n if (msg.sender != address(this)) revert ErrOnlySelfCall(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to check if a contract address has code.\\n * @param addr The address of the contract to check.\\n * @dev Throws an error if the contract address has no code.\\n */\\n function _requireHasCode(address addr) internal view {\\n if (addr.code.length == 0) revert ErrZeroCodeContract(addr);\\n }\\n\\n /**\\n * @dev Checks if an address is zero and reverts if it is.\\n * @param addr The address to check.\\n */\\n function _requireNonZeroAddress(address addr) internal pure {\\n if (addr == address(0)) revert ErrZeroAddress(msg.sig);\\n }\\n\\n /**\\n * @dev Check if arr is empty and revert if it is.\\n * Checks if an array contains any duplicate addresses and reverts if duplicates are found.\\n * @param arr The array of addresses to check.\\n */\\n function _requireNonDuplicate(address[] memory arr) internal pure {\\n if (arr.hasDuplicate()) revert AddressArrayUtils.ErrDuplicated(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to require that the provided address is a created externally owned account (EOA).\\n * This internal function is used to ensure that the provided address is a valid externally owned account (EOA).\\n * It checks the codehash of the address against a predefined constant to confirm that the address is a created EOA.\\n * @notice This method only works with non-state EOA accounts\\n */\\n function _requireCreatedEOA(address addr) internal view {\\n _requireNonZeroAddress(addr);\\n bytes32 codehash = addr.codehash;\\n if (codehash != CREATED_ACCOUNT_HASH) revert ErrAddressIsNotCreatedEOA(addr, codehash);\\n }\\n\\n /**\\n * @dev Internal function to require that the specified contract supports the given interface. This method handle in\\n * both case that the callee is either or not the proxy admin of the caller. If the contract does not support the\\n * interface `interfaceId` or EIP165, a revert with the corresponding error message is triggered.\\n *\\n * @param contractAddr The address of the contract to check for interface support.\\n * @param interfaceId The interface ID to check for support.\\n */\\n function _requireSupportsInterface(address contractAddr, bytes4 interfaceId) internal view {\\n bytes memory supportsInterfaceParams = abi.encodeCall(IERC165.supportsInterface, (interfaceId));\\n (bool success, bytes memory returnOrRevertData) = contractAddr.staticcall(supportsInterfaceParams);\\n if (!success) {\\n (success, returnOrRevertData) = contractAddr.staticcall(abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (supportsInterfaceParams)));\\n if (!success) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n if (!abi.decode(returnOrRevertData, (bool))) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n}\\n\",\"keccak256\":\"0x546ab4c9cdb0e7f8e650f140349225305ba1d0706dcaceeb9180c96aa765da59\",\"license\":\"MIT\"},\"src/utils/RoleAccess.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum RoleAccess {\\n UNKNOWN, // 0\\n ADMIN, // 1\\n COINBASE, // 2\\n GOVERNOR, // 3\\n CANDIDATE_ADMIN, // 4\\n WITHDRAWAL_MIGRATOR, // 5\\n __DEPRECATED_BRIDGE_OPERATOR, // 6\\n BLOCK_PRODUCER, // 7\\n VALIDATOR_CANDIDATE, // 8\\n CONSENSUS, // 9\\n TREASURY // 10\\n\\n}\\n\",\"keccak256\":\"0x671ff40dd874c508c4b3879a580996c7987fc018669256f47151e420a55c0e51\",\"license\":\"MIT\"}},\"version\":1}", + "nonce": 28, + "numDeployments": 2, "storageLayout": { "storage": [ { - "astId": 103687, + "astId": 58352, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "_paused", "offset": 0, @@ -2495,7 +2711,7 @@ "type": "t_bool" }, { - "astId": 132559, + "astId": 103479, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "_num", "offset": 0, @@ -2503,7 +2719,7 @@ "type": "t_uint256" }, { - "astId": 132561, + "astId": 103481, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "_denom", "offset": 0, @@ -2511,7 +2727,7 @@ "type": "t_uint256" }, { - "astId": 132563, + "astId": 103483, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "______deprecated", "offset": 0, @@ -2519,7 +2735,7 @@ "type": "t_address" }, { - "astId": 132565, + "astId": 103485, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "nonce", "offset": 0, @@ -2527,7 +2743,7 @@ "type": "t_uint256" }, { - "astId": 132567, + "astId": 103487, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "emergencyPauser", "offset": 0, @@ -2535,7 +2751,7 @@ "type": "t_address" }, { - "astId": 132572, + "astId": 103492, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "______gap", "offset": 0, @@ -2543,7 +2759,7 @@ "type": "t_array(t_uint256)49_storage" }, { - "astId": 133120, + "astId": 104214, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "_highTierVWNum", "offset": 0, @@ -2551,7 +2767,7 @@ "type": "t_uint256" }, { - "astId": 133122, + "astId": 104216, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "_highTierVWDenom", "offset": 0, @@ -2559,7 +2775,7 @@ "type": "t_uint256" }, { - "astId": 133127, + "astId": 104221, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "highTierThreshold", "offset": 0, @@ -2567,7 +2783,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 133132, + "astId": 104226, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "lockedThreshold", "offset": 0, @@ -2575,7 +2791,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 133137, + "astId": 104231, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "unlockFeePercentages", "offset": 0, @@ -2583,7 +2799,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 133142, + "astId": 104236, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "dailyWithdrawalLimit", "offset": 0, @@ -2591,7 +2807,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 133147, + "astId": 104241, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "lastSyncedWithdrawal", "offset": 0, @@ -2599,7 +2815,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 133152, + "astId": 104246, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "lastDateSynced", "offset": 0, @@ -2607,7 +2823,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 133157, + "astId": 104251, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "______gap", "offset": 0, @@ -2615,7 +2831,7 @@ "type": "t_array(t_uint256)50_storage" }, { - "astId": 103525, + "astId": 58190, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "_initialized", "offset": 0, @@ -2623,7 +2839,7 @@ "type": "t_uint8" }, { - "astId": 103528, + "astId": 58193, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "_initializing", "offset": 1, @@ -2631,31 +2847,31 @@ "type": "t_bool" }, { - "astId": 102425, + "astId": 56841, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "_roles", "offset": 0, "slot": "114", - "type": "t_mapping(t_bytes32,t_struct(RoleData)102420_storage)" + "type": "t_mapping(t_bytes32,t_struct(RoleData)56836_storage)" }, { - "astId": 102739, + "astId": 57155, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "_roleMembers", "offset": 0, "slot": "115", - "type": "t_mapping(t_bytes32,t_struct(AddressSet)106833_storage)" + "type": "t_mapping(t_bytes32,t_struct(AddressSet)63339_storage)" }, { - "astId": 142559, + "astId": 114774, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "wrappedNativeToken", "offset": 0, "slot": "116", - "type": "t_contract(IWETH)138987" + "type": "t_contract(IWETH)109972" }, { - "astId": 142562, + "astId": 114777, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "roninChainId", "offset": 0, @@ -2663,7 +2879,7 @@ "type": "t_uint256" }, { - "astId": 142565, + "astId": 114780, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "depositCount", "offset": 0, @@ -2671,7 +2887,7 @@ "type": "t_uint256" }, { - "astId": 142568, + "astId": 114783, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "_domainSeparator", "offset": 0, @@ -2679,15 +2895,15 @@ "type": "t_bytes32" }, { - "astId": 142574, + "astId": 114789, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "_roninToken", "offset": 0, "slot": "120", - "type": "t_mapping(t_address,t_struct(MappedToken)139639_storage)" + "type": "t_mapping(t_address,t_struct(MappedToken)110662_storage)" }, { - "astId": 142579, + "astId": 114794, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "withdrawalHash", "offset": 0, @@ -2695,7 +2911,7 @@ "type": "t_mapping(t_uint256,t_bytes32)" }, { - "astId": 142584, + "astId": 114799, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "withdrawalLocked", "offset": 0, @@ -2703,7 +2919,7 @@ "type": "t_mapping(t_uint256,t_bool)" }, { - "astId": 142587, + "astId": 114802, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "______deprecatedBridgeOperatorAddedBlock", "offset": 0, @@ -2711,12 +2927,36 @@ "type": "t_uint256" }, { - "astId": 142590, + "astId": 114805, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "______deprecatedBridgeOperators", "offset": 0, "slot": "124", "type": "t_uint256" + }, + { + "astId": 114807, + "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", + "label": "_totalOperatorWeight", + "offset": 0, + "slot": "125", + "type": "t_uint96" + }, + { + "astId": 114811, + "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", + "label": "_operatorWeight", + "offset": 0, + "slot": "126", + "type": "t_mapping(t_address,t_uint96)" + }, + { + "astId": 114814, + "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", + "label": "wethUnwrapper", + "offset": 0, + "slot": "127", + "type": "t_contract(WethUnwrapper)104152" } ], "types": { @@ -2753,14 +2993,19 @@ "label": "bytes32", "numberOfBytes": "32" }, - "t_contract(IWETH)138987": { + "t_contract(IWETH)109972": { "encoding": "inplace", "label": "contract IWETH", "numberOfBytes": "20" }, - "t_enum(Standard)141582": { + "t_contract(WethUnwrapper)104152": { + "encoding": "inplace", + "label": "contract WethUnwrapper", + "numberOfBytes": "20" + }, + "t_enum(TokenStandard)112266": { "encoding": "inplace", - "label": "enum Token.Standard", + "label": "enum TokenStandard", "numberOfBytes": "1" }, "t_mapping(t_address,t_bool)": { @@ -2770,12 +3015,12 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_address,t_struct(MappedToken)139639_storage)": { + "t_mapping(t_address,t_struct(MappedToken)110662_storage)": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => struct MappedTokenConsumer.MappedToken)", "numberOfBytes": "32", - "value": "t_struct(MappedToken)139639_storage" + "value": "t_struct(MappedToken)110662_storage" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -2784,19 +3029,26 @@ "numberOfBytes": "32", "value": "t_uint256" }, - "t_mapping(t_bytes32,t_struct(AddressSet)106833_storage)": { + "t_mapping(t_address,t_uint96)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint96)", + "numberOfBytes": "32", + "value": "t_uint96" + }, + "t_mapping(t_bytes32,t_struct(AddressSet)63339_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct EnumerableSet.AddressSet)", "numberOfBytes": "32", - "value": "t_struct(AddressSet)106833_storage" + "value": "t_struct(AddressSet)63339_storage" }, - "t_mapping(t_bytes32,t_struct(RoleData)102420_storage)": { + "t_mapping(t_bytes32,t_struct(RoleData)56836_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct AccessControl.RoleData)", "numberOfBytes": "32", - "value": "t_struct(RoleData)102420_storage" + "value": "t_struct(RoleData)56836_storage" }, "t_mapping(t_bytes32,t_uint256)": { "encoding": "mapping", @@ -2819,36 +3071,36 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_struct(AddressSet)106833_storage": { + "t_struct(AddressSet)63339_storage": { "encoding": "inplace", "label": "struct EnumerableSet.AddressSet", "numberOfBytes": "64", "members": [ { - "astId": 106832, + "astId": 63338, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "_inner", "offset": 0, "slot": "0", - "type": "t_struct(Set)106532_storage" + "type": "t_struct(Set)63038_storage" } ] }, - "t_struct(MappedToken)139639_storage": { + "t_struct(MappedToken)110662_storage": { "encoding": "inplace", "label": "struct MappedTokenConsumer.MappedToken", "numberOfBytes": "32", "members": [ { - "astId": 139636, + "astId": 110659, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "erc", "offset": 0, "slot": "0", - "type": "t_enum(Standard)141582" + "type": "t_enum(TokenStandard)112266" }, { - "astId": 139638, + "astId": 110661, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "tokenAddr", "offset": 1, @@ -2857,13 +3109,13 @@ } ] }, - "t_struct(RoleData)102420_storage": { + "t_struct(RoleData)56836_storage": { "encoding": "inplace", "label": "struct AccessControl.RoleData", "numberOfBytes": "64", "members": [ { - "astId": 102417, + "astId": 56833, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "members", "offset": 0, @@ -2871,7 +3123,7 @@ "type": "t_mapping(t_address,t_bool)" }, { - "astId": 102419, + "astId": 56835, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "adminRole", "offset": 0, @@ -2880,13 +3132,13 @@ } ] }, - "t_struct(Set)106532_storage": { + "t_struct(Set)63038_storage": { "encoding": "inplace", "label": "struct EnumerableSet.Set", "numberOfBytes": "64", "members": [ { - "astId": 106527, + "astId": 63033, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "_values", "offset": 0, @@ -2894,7 +3146,7 @@ "type": "t_array(t_bytes32)dyn_storage" }, { - "astId": 106531, + "astId": 63037, "contract": "src/mainchain/MainchainGatewayV3.sol:MainchainGatewayV3", "label": "_indexes", "offset": 0, @@ -2912,10 +3164,15 @@ "encoding": "inplace", "label": "uint8", "numberOfBytes": "1" + }, + "t_uint96": { + "encoding": "inplace", + "label": "uint96", + "numberOfBytes": "12" } } }, - "timestamp": 1712300364, + "timestamp": 1713254676, "userdoc": { "version": 1, "kind": "user", diff --git a/deployments/sepolia/WethUnwrapper.json b/deployments/sepolia/WethUnwrapper.json new file mode 100644 index 00000000..e4f5d0ed --- /dev/null +++ b/deployments/sepolia/WethUnwrapper.json @@ -0,0 +1,134 @@ +{ + "abi": [ + { + "type": "constructor", + "inputs": [ + { + "name": "weth_", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "fallback", + "stateMutability": "payable" + }, + { + "type": "receive", + "stateMutability": "payable" + }, + { + "type": "function", + "name": "unwrap", + "inputs": [ + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "unwrapTo", + "inputs": [ + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "to", + "type": "address", + "internalType": "address payable" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "weth", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IWETH" + } + ], + "stateMutability": "view" + }, + { + "type": "error", + "name": "ErrCannotTransferFrom", + "inputs": [] + }, + { + "type": "error", + "name": "ErrExternalCallFailed", + "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address" + }, + { + "name": "sig", + "type": "bytes4", + "internalType": "bytes4" + } + ] + }, + { + "type": "error", + "name": "ErrNotWrappedContract", + "inputs": [] + } + ], + "address": "0x1050f2E63177b5eD18f3E88D000DB3a600d664e3", + "args": "0x0000000000000000000000001aa1bc6baefcf09d6fd0139b828b5e764d050f08", + "ast": "", + "blockNumber": 5709352, + "bytecode": "0x60a060405234801561001057600080fd5b5060405161059138038061059183398101604081905261002f91610071565b600160009081556001600160a01b0382163b90036100605760405163155634d360e31b815260040160405180910390fd5b6001600160a01b03166080526100a1565b60006020828403121561008357600080fd5b81516001600160a01b038116811461009a57600080fd5b9392505050565b6080516104c26100cf6000396000818160610152818160ea01528181610237015261030a01526104c26000f3fe6080604052600436106100385760003560e01c80633fc8cef31461004f5780635dbd60591461009f578063de0e9a3e146100bf57610047565b36610047576100456100df565b005b6100456100df565b34801561005b57600080fd5b506100837f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b3480156100ab57600080fd5b506100456100ba366004610408565b61012a565b3480156100cb57600080fd5b506100456100da366004610444565b6101a2565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146101285760405163155634d360e31b815260040160405180910390fd5b565b6002600054036101815760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b600260005561018f82610214565b6101998183610372565b50506001600055565b6002600054036101f45760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610178565b600260005561020281610214565b61020c3382610372565b506001600055565b604051336024820152306044820152606481018290526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b17905251610290919061045d565b6000604051808303816000865af19150503d80600081146102cd576040519150601f19603f3d011682016040523d82523d6000602084013e6102d2565b606091505b50509050806102f4576040516302805e0360e11b815260040160405180910390fd5b604051632e1a7d4d60e01b8152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561035657600080fd5b505af115801561036a573d6000803e3d6000fd5b505050505050565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146103bf576040519150601f19603f3d011682016040523d82523d6000602084013e6103c4565b606091505b50509050806104035760405163094b984760e21b81526001600160a01b03841660048201526001600160e01b0319600035166024820152604401610178565b505050565b6000806040838503121561041b57600080fd5b8235915060208301356001600160a01b038116811461043957600080fd5b809150509250929050565b60006020828403121561045657600080fd5b5035919050565b6000825160005b8181101561047e5760208186018101518583015201610464565b50600092019182525091905056fea2646970667358221220aaebf21164f6d2f08d44be8bf09fb75965583264b715eb60df75d1b1d0f7cb9e64736f6c63430008170033", + "chainId": 11155111, + "contractAbsolutePath": "WethUnwrapper.sol", + "deployedBytecode": "0x6080604052600436106100385760003560e01c80633fc8cef31461004f5780635dbd60591461009f578063de0e9a3e146100bf57610047565b36610047576100456100df565b005b6100456100df565b34801561005b57600080fd5b506100837f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b3480156100ab57600080fd5b506100456100ba366004610408565b61012a565b3480156100cb57600080fd5b506100456100da366004610444565b6101a2565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146101285760405163155634d360e31b815260040160405180910390fd5b565b6002600054036101815760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b600260005561018f82610214565b6101998183610372565b50506001600055565b6002600054036101f45760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610178565b600260005561020281610214565b61020c3382610372565b506001600055565b604051336024820152306044820152606481018290526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b17905251610290919061045d565b6000604051808303816000865af19150503d80600081146102cd576040519150601f19603f3d011682016040523d82523d6000602084013e6102d2565b606091505b50509050806102f4576040516302805e0360e11b815260040160405180910390fd5b604051632e1a7d4d60e01b8152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561035657600080fd5b505af115801561036a573d6000803e3d6000fd5b505050505050565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146103bf576040519150601f19603f3d011682016040523d82523d6000602084013e6103c4565b606091505b50509050806104035760405163094b984760e21b81526001600160a01b03841660048201526001600160e01b0319600035166024820152604401610178565b505050565b6000806040838503121561041b57600080fd5b8235915060208301356001600160a01b038116811461043957600080fd5b809150509250929050565b60006020828403121561045657600080fd5b5035919050565b6000825160005b8181101561047e5760208186018101518583015201610464565b50600092019182525091905056fea2646970667358221220aaebf21164f6d2f08d44be8bf09fb75965583264b715eb60df75d1b1d0f7cb9e64736f6c63430008170033", + "deployer": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "devdoc": { + "version": 1, + "kind": "dev" + }, + "isFoundry": true, + "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"weth_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ErrCannotTransferFrom\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes4\",\"name\":\"sig\",\"type\":\"bytes4\"}],\"name\":\"ErrExternalCallFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrNotWrappedContract\",\"type\":\"error\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"unwrap\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address payable\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"unwrapTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"weth\",\"outputs\":[{\"internalType\":\"contract IWETH\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/extensions/WethUnwrapper.sol\":\"WethUnwrapper\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@fdk/=lib/foundry-deployment-kit/script/\",\":@openzeppelin/=lib/openzeppelin-contracts/\",\":@prb/math/=lib/prb-math/\",\":@prb/test/=lib/prb-test/src/\",\":@ronin/contracts/=src/\",\":@ronin/script/=script/\",\":@ronin/test/=test/\",\":contract-libs/=lib/foundry-deployment-kit/lib/contract-libs/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/foundry-deployment-kit/lib/forge-std/src/\",\":foundry-deployment-kit/=lib/foundry-deployment-kit/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/contracts/\",\":prb-math/=lib/prb-math/src/\",\":prb-test/=lib/prb-test/src/\",\":solady/=lib/solady/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/security/ReentrancyGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuard {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n constructor() {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n // On the first call to nonReentrant, _notEntered will be true\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n}\\n\",\"keccak256\":\"0x0e9621f60b2faabe65549f7ed0f24e8853a45c1b7990d47e8160e523683f3935\",\"license\":\"MIT\"},\"src/extensions/WethUnwrapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/security/ReentrancyGuard.sol\\\";\\nimport \\\"../interfaces/IWETH.sol\\\";\\n\\ncontract WethUnwrapper is ReentrancyGuard {\\n IWETH public immutable weth;\\n\\n error ErrCannotTransferFrom();\\n error ErrNotWrappedContract();\\n error ErrExternalCallFailed(address sender, bytes4 sig);\\n\\n constructor(address weth_) {\\n if (address(weth_).code.length == 0) revert ErrNotWrappedContract();\\n weth = IWETH(weth_);\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n receive() external payable {\\n _fallback();\\n }\\n\\n function unwrap(uint256 amount) external nonReentrant {\\n _deductWrappedAndWithdraw(amount);\\n _sendNativeTo(payable(msg.sender), amount);\\n }\\n\\n function unwrapTo(uint256 amount, address payable to) external nonReentrant {\\n _deductWrappedAndWithdraw(amount);\\n _sendNativeTo(payable(to), amount);\\n }\\n\\n function _deductWrappedAndWithdraw(uint256 amount) internal {\\n (bool success,) = address(weth).call(abi.encodeCall(IWETH.transferFrom, (msg.sender, address(this), amount)));\\n if (!success) revert ErrCannotTransferFrom();\\n\\n weth.withdraw(amount);\\n }\\n\\n function _sendNativeTo(address payable to, uint256 val) internal {\\n (bool success,) = to.call{ value: val }(\\\"\\\");\\n if (!success) {\\n revert ErrExternalCallFailed(to, msg.sig);\\n }\\n }\\n\\n function _fallback() internal view {\\n if (msg.sender != address(weth)) revert ErrNotWrappedContract();\\n }\\n}\\n\",\"keccak256\":\"0x5f7b72d9ed8944724d2f228358d565a61ea345cba1883e5424fb801bebc758ff\",\"license\":\"MIT\"},\"src/interfaces/IWETH.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IWETH {\\n event Transfer(address indexed src, address indexed dst, uint wad);\\n\\n function deposit() external payable;\\n\\n function transfer(address dst, uint wad) external returns (bool);\\n\\n function approve(address guy, uint wad) external returns (bool);\\n\\n function transferFrom(address src, address dst, uint wad) external returns (bool);\\n\\n function withdraw(uint256 _wad) external;\\n\\n function balanceOf(address) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x000700e2b9c1985d53bb1cdba435f0f3d7b48e76e596e7dbbdfec1da47131415\",\"license\":\"MIT\"}},\"version\":1}", + "nonce": 26, + "numDeployments": 1, + "storageLayout": { + "storage": [ + { + "astId": 58453, + "contract": "src/extensions/WethUnwrapper.sol:WethUnwrapper", + "label": "_status", + "offset": 0, + "slot": "0", + "type": "t_uint256" + } + ], + "types": { + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + }, + "timestamp": 1713254676, + "userdoc": { + "version": 1, + "kind": "user" + } +} \ No newline at end of file From cf565adcbcc0860f3adb942ef201fedb0f386935 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 16 Apr 2024 15:12:02 +0700 Subject: [PATCH 175/180] chore: add broadcast log --- .../2021/run-1713240478.json | 112 +++ .../2021/run-1713240671.json | 118 +++ .../2021/run-1713240678.json | 452 ++++++++++ .../2021/run-1713246801.json | 235 ++++++ .../2021/run-1713250237.json | 316 +++++++ .../2021/run-1713251065.json | 348 ++++++++ .../2021/run-1713252455.json | 776 ++++++++++++++++++ .../11155111/run-1713254298.json | 260 ++++++ .../11155111/run-1713254978.json | 738 +++++++++++++++++ 9 files changed, 3355 insertions(+) create mode 100644 broadcast/20240411-p1-deploy-ronin-bridge-manager.s.sol/2021/run-1713240478.json create mode 100644 broadcast/20240411-p1-deploy-ronin-bridge-manager.s.sol/2021/run-1713240671.json create mode 100644 broadcast/20240411-p1-deploy-ronin-bridge-manager.s.sol/2021/run-1713240678.json create mode 100644 broadcast/20240411-p2-upgrade-bridge-ronin-chain.s.sol/2021/run-1713246801.json create mode 100644 broadcast/20240411-p2-upgrade-bridge-ronin-chain.s.sol/2021/run-1713250237.json create mode 100644 broadcast/20240411-p2-upgrade-bridge-ronin-chain.s.sol/2021/run-1713251065.json create mode 100644 broadcast/20240411-p2-upgrade-bridge-ronin-chain.s.sol/2021/run-1713252455.json create mode 100644 broadcast/20240411-p3-upgrade-bridge-main-chain.s.sol/11155111/run-1713254298.json create mode 100644 broadcast/20240411-p3-upgrade-bridge-main-chain.s.sol/11155111/run-1713254978.json diff --git a/broadcast/20240411-p1-deploy-ronin-bridge-manager.s.sol/2021/run-1713240478.json b/broadcast/20240411-p1-deploy-ronin-bridge-manager.s.sol/2021/run-1713240478.json new file mode 100644 index 00000000..2d026e0a --- /dev/null +++ b/broadcast/20240411-p1-deploy-ronin-bridge-manager.s.sol/2021/run-1713240478.json @@ -0,0 +1,112 @@ +{ + "transactions": [ + { + "hash": null, + "transactionType": "CREATE", + "contractName": "RoninBridgeManagerConstructor", + "contractAddress": "0x2e8006C2Af701925915417D29c47b6D16e3C8cc8", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x637700", + "value": "0x0", + "data": "0x60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61398280620000f46000396000f3fe608060405234801561001057600080fd5b50600436106101965760003560e01c806301a5f43f1461019b57806306aba0e1146101b05780630a44fa43146101cb5780630f7c3189146101de5780631c905e39146101f35780631f425338146102155780632c5e6520146102285780632d6d7d731461024b57806334d5f37b1461025e57806335da81211461027e5780633644e515146102915780637d4c1d781461029a5780637de5dedd146102ad5780637f7fe058146102b5578063800eaab3146102d5578063828fc1a1146102e8578063865e6fd3146102fb578063901979d51461030e5780639b19dbfd14610339578063a64a838014610341578063aee1767f14610354578063b384abef14610367578063b405aaf2146103c2578063b9c36209146103d5578063bc4e068f146103e8578063c441c4a8146103fb578063cc7e6b3b14610412578063d0a50db014610432578063d78392f81461043a578063dafae4081461044d578063de981f1b14610460578063e75235b814610473578063e9c0349814610490578063f80b5352146104a3575b600080fd5b6101ae6101a9366004612d91565b6104ab565b005b6101b861055a565b6040519081526020015b60405180910390f35b6101b86101d9366004612e2a565b610569565b6101e66105ee565b6040516101c29190612eb0565b610206610201366004612ec3565b610600565b6040516101c293929190612efb565b6101ae610223366004612e2a565b61061c565b61023b610236366004612fce565b6106bb565b60405190151581526020016101c2565b6101e6610259366004612e2a565b6106c8565b6101b861026c366004613003565b60026020526000908152604090205481565b6101ae61028c366004612e2a565b61070f565b6101b860015481565b6101ae6102a83660046131dd565b610757565b6101b8610893565b6102c86102c3366004613317565b6108e9565b6040516101c29190613332565b6101ae6102e3366004613346565b61095c565b61023b6102f63660046133a9565b610994565b6101ae6103093660046133e4565b6109a2565b61032161031c366004613317565b6109bd565b6040516001600160601b0390911681526020016101c2565b6101e66109f3565b6101ae61034f366004613003565b610a5e565b6102c8610362366004613317565b610a72565b6103b1610375366004612ec3565b600360208181526000938452604080852090915291835291208054600182015460028301549383015460069093015460ff909216939092909185565b6040516101c295949392919061340e565b61023b6103d0366004613317565b610a84565b6101ae6103e3366004612ec3565b610abc565b6102066103f6366004613003565b610ace565b610403610aeb565b6040516101c29392919061347d565b610425610420366004612e2a565b610bc5565b6040516101c291906134c0565b6101b8610c03565b610321610448366004613317565b610c16565b61023b61045b366004613003565b610c21565b6102c861046e3660046134d3565b610c5d565b61047b610cbf565b604080519283526020830191909152016101c2565b6101ae61049e366004612e2a565b610ce1565b6101e6610d2a565b6104b3610d8d565b61055186868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808a0282810182019093528982529093508992508891829185019084908082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250610de992505050565b50505050505050565b600061056461114b565b905090565b60008282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506105aa925083915061115e9050565b6105e684848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061119392505050565b949350505050565b60606105646105fb611218565b61123c565b606080606061060f8585611250565b9250925092509250925092565b610624610d8d565b818180806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610663925083915061115e9050565b600061066d611218565b905060005b838110156106b4576106ab85858381811061068f5761068f6134ee565b90506020020160208101906106a49190613317565b8390611639565b50600101610672565b5050505050565b60006105e684848461164e565b606061070683838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250611684915050565b90505b92915050565b610717610d8d565b6107538282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506117d792505050565b5050565b600054610100900460ff16158080156107775750600054600160ff909116105b806107915750303b158015610791575060005460ff166001145b6107f95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff19166001179055801561081c576000805461ff0019166101001790555b61082589611892565b61082f83836118c2565b61083f8c8c8c8b8b8b8b8b6118f3565b8015610885576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050505050565b60008061089e611944565b90506000806108ab610cbf565b91509150806001828560040154856108c3919061351a565b6108cd9190613531565b6108d79190613544565b6108e19190613557565b935050505090565b60008060006108ff6108f9611944565b85611968565b9150915081610923578360405163141e2e1f60e11b81526004016107f09190613332565b61092b611944565b600101818154811061093f5761093f6134ee565b6000918252602090912001546001600160a01b0316949350505050565b33301461098a576000356001600160e01b0319166040516307337e1960e41b81526004016107f09190613579565b61075382826119cd565b60006107066000848461164e565b6109aa610d8d565b6109b381611a76565b6107538282611aa3565b6000806109c8611944565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b031690565b60606109fd611944565b600101805480602002602001604051908101604052809291908181526020018280548015610a5457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610a36575b5050505050905090565b610a66610d8d565b610a6f81611b2e565b50565b6000610a7d82611b9b565b5092915050565b600080610a8f611944565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b0316151590565b610ac4610d8d565b6107538282611c12565b6060806060610ade600085611250565b9250925092509193909250565b60608060606000610afa611944565b805460408051602080840282018101909252828152929350839190830182828015610b4e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b30575b5050505050935080600101805480602002602001604051908101604052809291908181526020018280548015610bad57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b8f575b50505050509250610bbd84611cc4565b915050909192565b6060610706838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611cc492505050565b6000610c0d611944565b60010154919050565b600061070982611db0565b600080610c2c611de5565b9050610c3661114b565b8160010154610c45919061351a565b6002820154610c54908561351a565b10159392505050565b6000610c67611e09565b600083600f811115610c7b57610c7b612ee5565b60ff1681526020810191909152604001600020546001600160a01b0316905080610cba578160405163409140df60e11b81526004016107f0919061358e565b919050565b6000806000610ccc611de5565b90508060010154816002015492509250509091565b610ce9610d8d565b610d25828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611e2d92505050565b505050565b6060610d34611944565b805460408051602080840282018101909252828152929190830182828015610a54576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610a36575050505050905090565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610de7576000356001600160e01b0319166001604051620f948f60ea1b81526004016107f09291906135a8565b565b6060610df58383612213565b610dfe8161115e565b6000610e08611944565b845187519192509081148015610e1e5750855181145b610e49576000356001600160e01b0319166040516306b5667560e21b81526004016107f09190613579565b806001600160401b03811115610e6157610e6161301c565b604051908082528060200260200182016040528015610e8a578160200160208202803683370190505b50935080600003610e9c575050611143565b60008060008060005b858110156110af578a8181518110610ebf57610ebf6134ee565b60200260200101519450898181518110610edb57610edb6134ee565b602002602001015193508b8181518110610ef757610ef76134ee565b60200260200101519250610f0a8561231d565b610f138461231d565b826001600160601b0316600003610f4b576000356001600160e01b031916604051637f11b8a360e11b81526004016107f09190613579565b6001600160a01b03808616600081815260038a01602090815260408083205494891683528083205460028d0190925280832054938352909120546001600160601b039384169391821692610fa39290811691166135d6565b610fad91906135d6565b610fb791906135d6565b6001600160601b0316600014898281518110610fd557610fd56134ee565b602002602001019015159081151581525050888181518110610ff957610ff96134ee565b6020026020010151156110a7578654600181810189556000898152602080822090930180546001600160a01b03808b166001600160a01b0319928316811790935591835260028c018552604080842080546001600160601b038b166001600160601b03199182168117909255868f018054978801815586528786209096018054948c1694909316841790925591835260038c0190945290208054909116821790556110a49083613531565b91505b600101610ea5565b50808660040160008282546110c49190613531565b90915550506040516110ff906347c28ec560e11b906110eb908c908f908d90602001613629565b604051602081830303815290604052612352565b7f897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b78888c8c8c6040516111349493929190613662565b60405180910390a15050505050505b509392505050565b6000611155611944565b60040154905090565b6111678161237f565b15610a6f576000356001600160e01b031916604051630d697db160e11b81526004016107f09190613579565b60008161119f8161115e565b60006111a9611944565b905060005b8451811015611210578160020160008683815181106111cf576111cf6134ee565b6020908102919091018101516001600160a01b0316825281019190915260400160002054611206906001600160601b031685613531565b93506001016111ae565b505050919050565b7f5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd97624090565b606060006112498361241e565b9392505050565b600082815260036020908152604080832084845290915281206004810154600582015460609384938493909290916112888284613531565b9050806001600160401b038111156112a2576112a261301c565b6040519080825280602002602001820160405280156112cb578160200160208202803683370190505b509550806001600160401b038111156112e6576112e661301c565b60405190808252806020026020018201604052801561133157816020015b60408051606081018252600080825260208083018290529282015282526000199092019101816113045790505b509450806001600160401b0381111561134c5761134c61301c565b604051908082528060200260200182016040528015611375578160200160208202803683370190505b50965060005b838110156114ca576000878281518110611397576113976134ee565b602002602001019060018111156113b0576113b0612ee5565b908160018111156113c3576113c3612ee5565b90525060008a81526003602090815260408083208c8452909152812060048701805460079092019291849081106113fc576113fc6134ee565b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815460ff1681526001820154938101939093526002015490820152865187908390811061145a5761145a6134ee565b602002602001018190525084600401818154811061147a5761147a6134ee565b9060005260206000200160009054906101000a90046001600160a01b03168882815181106114aa576114aa6134ee565b6001600160a01b039092166020928302919091019091015260010161137b565b5060005b8281101561162d576001876114e38684613531565b815181106114f3576114f36134ee565b6020026020010190600181111561150c5761150c612ee5565b9081600181111561151f5761151f612ee5565b90525060008a81526003602090815260408083208c845290915281206005870180546007909201929184908110611558576115586134ee565b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815460ff1681526001820154938101939093526002015490820152866115ad8684613531565b815181106115bd576115bd6134ee565b60200260200101819052508460050181815481106115dd576115dd6134ee565b6000918252602090912001546001600160a01b0316886115fd8684613531565b8151811061160d5761160d6134ee565b6001600160a01b03909216602092830291909101909101526001016114ce565b50505050509250925092565b6000610706836001600160a01b03841661247a565b600083815260036020908152604080832085845282528083206001600160a01b038516845260080190915281205460ff166105e6565b606082516001600160401b0381111561169f5761169f61301c565b6040519080825280602002602001820160405280156116c8578160200160208202803683370190505b50905060005b8351811015610a7d57600560008583815181106116ed576116ed6134ee565b6020026020010151600581111561170657611706612ee5565b600581111561171757611717612ee5565b815260200190815260200160002060009054906101000a90046001600160a01b031682828151811061174b5761174b6134ee565b60200260200101906001600160a01b031690816001600160a01b0316815250508280156117a3575060006001600160a01b0316828281518110611790576117906134ee565b60200260200101516001600160a01b0316145b156117cf576000356001600160e01b03191660405163053265f160e01b81526004016107f09190613579565b6001016116ce565b806117e18161115e565b60006117eb611218565b905060008060005b855181101561188a5785818151811061180e5761180e6134ee565b6020026020010151925061182183611a76565b611832836312c0151560e21b61256d565b61183c8484612700565b604080516001600160a01b038616815282151560208201529193507fb85c58eeff9fe423669ae0841666f4c8499e8731b8275eb462e4fa1720ec420e910160405180910390a16001016117f3565b505050505050565b600054610100900460ff166118b95760405162461bcd60e51b81526004016107f0906136ba565b610a6f81612715565b600054610100900460ff166118e95760405162461bcd60e51b81526004016107f0906136ba565b6107538282612745565b600054610100900460ff1661191a5760405162461bcd60e51b81526004016107f0906136ba565b6119248888612777565b61192d846127b8565b61193a86868585856127e8565b5050505050505050565b7fc648703095712c0419b6431ae642c061f0a105ac2d7c3d9604061ef4ebc3830090565b60008060005b84548110156119bb57848181548110611989576119896134ee565b6000918252602090912001546001600160a01b03908116908516036119b3576001925090506119c6565b60010161196e565b506000600019915091505b9250929050565b60005b8251811015610d2557306001600160a01b03168282815181106119f5576119f56134ee565b60200260200101516001600160a01b031603611a32576000356001600160e01b03191660405163053265f160e01b81526004016107f09190613579565b611a6e838281518110611a4757611a476134ee565b6020026020010151838381518110611a6157611a616134ee565b6020026020010151612912565b6001016119d0565b806001600160a01b03163b600003610a6f5780604051630bfc64a360e21b81526004016107f09190613332565b80611aac611e09565b600084600f811115611ac057611ac0612ee5565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115611b0157611b01612ee5565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b6003811015611b50576040516305f4dee960e31b815260040160405180910390fd5b6000611b5a611944565b600581018390556040518381529091507f22d5bb5059ffe2949a098666fc198587200c8118483074120d3ca7050c7753f19060200160405180910390a15050565b600080600080611bb5611bac611944565b60010186611968565b9150915081611bd957846040516326527e1760e01b81526004016107f09190613332565b611be1611944565b805482908110611bf357611bf36134ee565b6000918252602090912001546001600160a01b03169590945092505050565b80821180611c21575060018111155b15611c4d576000356001600160e01b0319166040516387f6f09560e01b81526004016107f09190613579565b6000611c57611de5565b6001810180546002830180549287905585905582549293509184908690856000611c8083613705565b9091555060408051868152602081018690527f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a45050505050565b60606000611cd0611944565b905082516001600160401b03811115611ceb57611ceb61301c565b604051908082528060200260200182016040528015611d14578160200160208202803683370190505b50915060005b8351811015611da957816002016000858381518110611d3b57611d3b6134ee565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160601b0316838281518110611d8957611d896134ee565b6001600160601b0390921660209283029190910190910152600101611d1a565b5050919050565b6000611dba611944565b6001600160a01b0390921660009081526002929092016020525060409020546001600160601b031690565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f0090565b7fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb90565b606081611e398161115e565b6000611e43611944565b8451909150806001600160401b03811115611e6057611e6061301c565b604051908082528060200260200182016040528015611e89578160200160208202803683370190505b50935080600003611e9b57505061220d565b60058201548254611ead908390613544565b1015611ecc5760405163b2e765cb60e01b815260040160405180910390fd5b60008060008060005b8581101561219357898181518110611eef57611eef6134ee565b60200260200101519350611f0284611b9b565b9095509150611f108561231d565b611f198461231d565b6001600160a01b03851660009081526002880160205260409020546001600160601b031615801590611f6d57506001600160a01b03841660009081526003880160205260409020546001600160601b031615155b898281518110611f7f57611f7f6134ee565b602002602001019015159081151581525050888181518110611fa357611fa36134ee565b60200260200101511561218b576001600160a01b038516600090815260028801602052604081205488546001600160601b039091169190611fe690600190613544565b9050886000018181548110611ffd57611ffd6134ee565b60009182526020909120015489546001600160a01b03909116908a9086908110612029576120296134ee565b600091825260209091200180546001600160a01b0319166001600160a01b039290921691909117905588548990806120635761206361371e565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038916825260028b0190526040902080546001600160601b0319169055600189018054829081106120c3576120c36134ee565b60009182526020909120015460018a0180546001600160a01b0390921691869081106120f1576120f16134ee565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550886001018054806121325761213261371e565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038816825260038b0190526040902080546001600160601b03191690556121868286613531565b945050505b600101611ed5565b50818660040160008282546121a89190613544565b90915550506040516121cd90636242a4ef60e11b906110eb908c908c90602001613734565b7fdf3dcd7987202f64648f3acdbf12401e3a2bb23e77e19f99826b5475cbb86369888a6040516121fe929190613762565b60405180910390a15050505050505b50919050565b81518151606091908082016001600160401b038111156122355761223561301c565b60405190808252806020026020018201604052801561225e578160200160208202803683370190505b50925060005b828110156122b85785818151811061227e5761227e6134ee565b6020026020010151848281518110612298576122986134ee565b6001600160a01b0390921660209283029190910190910152600101612264565b60005b82811015612313578581815181106122d5576122d56134ee565b60200260200101518583815181106122ef576122ef6134ee565b6001600160a01b0390921660209283029190910190910152600191820191016122bb565b5050505092915050565b6001600160a01b038116610a6f576000356001600160e01b03191660405163104c66df60e31b81526004016107f09190613579565b61235c82826129a5565b610753573382826040516319b5fdcb60e31b81526004016107f0939291906137d7565b6000815160000361239257506000919050565b60005b600183510381101561241557600181015b835181101561240c578381815181106123c1576123c16134ee565b60200260200101516001600160a01b03168483815181106123e4576123e46134ee565b60200260200101516001600160a01b031603612404575060019392505050565b6001016123a6565b50600101612395565b50600092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561246e57602002820191906000526020600020905b81548152602001906001019080831161245a575b50505050509050919050565b6000818152600183016020526040812054801561256357600061249e600183613544565b85549091506000906124b290600190613544565b90508181146125175760008660000182815481106124d2576124d26134ee565b90600052602060002001549050808760000184815481106124f5576124f56134ee565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806125285761252861371e565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610709565b6000915050610709565b6000816040516024016125809190613579565b60408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b1790525190915060009081906001600160a01b038616906125c990859061380b565b600060405180830381855afa9150503d8060008114612604576040519150601f19603f3d011682016040523d82523d6000602084013e612609565b606091505b5091509150816126cb57846001600160a01b03168360405160240161262e9190613827565b60408051601f198184030181529181526020820180516001600160e01b03166325da93a560e11b17905251612663919061380b565b600060405180830381855afa9150503d806000811461269e576040519150601f19603f3d011682016040523d82523d6000602084013e6126a3565b606091505b509092509050816126cb57838560405163069d427960e11b81526004016107f092919061383a565b808060200190518101906126df919061385d565b6106b457838560405163069d427960e11b81526004016107f092919061383a565b6000610706836001600160a01b038416612ccb565b600054610100900460ff1661273c5760405162461bcd60e51b81526004016107f0906136ba565b610a6f81612d1a565b600054610100900460ff1661276c5760405162461bcd60e51b81526004016107f0906136ba565b61098a600030612912565b600054610100900460ff1661279e5760405162461bcd60e51b81526004016107f0906136ba565b60006127a8611de5565b600181559050610d258383611c12565b600054610100900460ff166127df5760405162461bcd60e51b81526004016107f0906136ba565b610a6f816117d7565b600054610100900460ff1661280f5760405162461bcd60e51b81526004016107f0906136ba565b61281a600285611aa3565b604080516020808201839052600e60608301526d212924a223a2afa6a0a720a3a2a960911b6080808401919091528284018990528351808403909101815260a0830184528051908201207f599a80fcaa47b95e2323ab4d34d34e0cc9feda4b843edafcc30c7bdf60ea15bf60c08401527fe4d2346818310a10fac5a6d073d3dce255578caf4aa81ddcbcc7c2b98405eef060e08401527f2a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4de61010084015261012080840191909152835180840390910181526101409092019092528051910120600155612907818385610de9565b506106b46003611b2e565b806005600084600581111561292957612929612ee5565b600581111561293a5761293a612ee5565b8152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600581111561297857612978612ee5565b6040517f356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d90600090a35050565b600160006129b46105fb611218565b805190915060008190036129c9575050610709565b6000816001600160401b038111156129e3576129e361301c565b604051908082528060200260200182016040528015612a0c578160200160208202803683370190505b5090506000826001600160401b03811115612a2957612a2961301c565b604051908082528060200260200182016040528015612a5c57816020015b6060815260200190600190039081612a475790505b50905060008787604051602001612a7492919061387f565b6040516020818303038152906040529050600081604051602401612a989190613827565b60408051601f198184030181529190526020810180516001600160e01b03166325da93a560e11b179052905060005b85811015612c8157868181518110612ae157612ae16134ee565b60200260200101516001600160a01b031683604051612b00919061380b565b6000604051808303816000865af19150503d8060008114612b3d576040519150601f19603f3d011682016040523d82523d6000602084013e612b42565b606091505b50868381518110612b5557612b556134ee565b60200260200101868481518110612b6e57612b6e6134ee565b6020026020010182905282151515158152505050848181518110612b9457612b946134ee565b6020026020010151612c7957868181518110612bb257612bb26134ee565b60200260200101516001600160a01b031682604051612bd1919061380b565b6000604051808303816000865af19150503d8060008114612c0e576040519150601f19603f3d011682016040523d82523d6000602084013e612c13565b606091505b50868381518110612c2657612c266134ee565b60200260200101868481518110612c3f57612c3f6134ee565b6020026020010182905282151515158152505050878015612c765750848181518110612c6d57612c6d6134ee565b60200260200101515b97505b600101612ac7565b507fc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b6382878686604051612cb794939291906138b0565b60405180910390a150505050505092915050565b6000818152600183016020526040812054612d1257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610709565b506000610709565b600481905560405181907fe5cd1c123a8cf63fa1b7229678db61fe8ae99dbbd27889370b6667c8cae97da190600090a250565b60008083601f840112612d5f57600080fd5b5081356001600160401b03811115612d7657600080fd5b6020830191508360208260051b85010111156119c657600080fd5b60008060008060008060608789031215612daa57600080fd5b86356001600160401b0380821115612dc157600080fd5b612dcd8a838b01612d4d565b90985096506020890135915080821115612de657600080fd5b612df28a838b01612d4d565b90965094506040890135915080821115612e0b57600080fd5b50612e1889828a01612d4d565b979a9699509497509295939492505050565b60008060208385031215612e3d57600080fd5b82356001600160401b03811115612e5357600080fd5b612e5f85828601612d4d565b90969095509350505050565b60008151808452602080850194506020840160005b83811015612ea55781516001600160a01b031687529582019590820190600101612e80565b509495945050505050565b6020815260006107066020830184612e6b565b60008060408385031215612ed657600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60006060808352612f0f6060840187612e6b565b83810360208581019190915286518083528782019282019060005b81811015612f5657845160028110612f4457612f44612ee5565b83529383019391830191600101612f2a565b50506040925085810360408701528087518083528383019150838901925060005b81811015612fa7578351805160ff1684528581015186850152860151868401529284019291860191600101612f77565b50909a9950505050505050505050565b80356001600160a01b0381168114610cba57600080fd5b600080600060608486031215612fe357600080fd5b8335925060208401359150612ffa60408501612fb7565b90509250925092565b60006020828403121561301557600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561305a5761305a61301c565b604052919050565b60006001600160401b0382111561307b5761307b61301c565b5060051b60200190565b600082601f83011261309657600080fd5b813560206130ab6130a683613062565b613032565b8083825260208201915060208460051b8701019350868411156130cd57600080fd5b602086015b848110156130f0576130e381612fb7565b83529183019183016130d2565b509695505050505050565b600082601f83011261310c57600080fd5b8135602061311c6130a683613062565b8083825260208201915060208460051b87010193508684111561313e57600080fd5b602086015b848110156130f05780356001600160601b03811681146131635760008081fd5b8352918301918301613143565b600082601f83011261318157600080fd5b813560206131916130a683613062565b8083825260208201915060208460051b8701019350868411156131b357600080fd5b602086015b848110156130f0578035600681106131d05760008081fd5b83529183019183016131b8565b60008060008060008060008060008060006101608c8e0312156131ff57600080fd5b8b359a5060208c0135995060408c0135985060608c0135975061322460808d01612fb7565b96506001600160401b0360a08d013581101561323f57600080fd5b61324f8e60a08f01358f01613085565b96508060c08e0135111561326257600080fd5b6132728e60c08f01358f01613085565b95508060e08e0135111561328557600080fd5b6132958e60e08f01358f01613085565b9450806101008e013511156132a957600080fd5b6132ba8e6101008f01358f016130fb565b9350806101208e013511156132ce57600080fd5b6132df8e6101208f01358f01613170565b9250806101408e013511156132f357600080fd5b506133058d6101408e01358e01613085565b90509295989b509295989b9093969950565b60006020828403121561332957600080fd5b61070682612fb7565b6001600160a01b0391909116815260200190565b6000806040838503121561335957600080fd5b82356001600160401b038082111561337057600080fd5b61337c86838701613170565b9350602085013591508082111561339257600080fd5b5061339f85828601613085565b9150509250929050565b600080604083850312156133bc57600080fd5b823591506133cc60208401612fb7565b90509250929050565b803560108110610cba57600080fd5b600080604083850312156133f757600080fd5b613400836133d5565b91506133cc60208401612fb7565b60a081016005871061342257613422612ee5565b95815260208101949094526040840192909252606083015260809091015290565b60008151808452602080850194506020840160005b83811015612ea55781516001600160601b031687529582019590820190600101613458565b6060815260006134906060830186612e6b565b82810360208401526134a28186612e6b565b905082810360408401526134b68185613443565b9695505050505050565b6020815260006107066020830184613443565b6000602082840312156134e557600080fd5b610706826133d5565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761070957610709613504565b8082018082111561070957610709613504565b8181038181111561070957610709613504565b60008261357457634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031991909116815260200190565b60208101601083106135a2576135a2612ee5565b91905290565b6001600160e01b03198316815260408101600b83106135c9576135c9612ee5565b8260208301529392505050565b6001600160601b03818116838216019080821115610a7d57610a7d613504565b60008151808452602080850194506020840160005b83811015612ea557815115158752958201959082019060010161360b565b60608152600061363c6060830186612e6b565b828103602084015261364e8186613443565b905082810360408401526134b681856135f6565b60808152600061367560808301876135f6565b82810360208401526136878187613443565b9050828103604084015261369b8186612e6b565b905082810360608401526136af8185612e6b565b979650505050505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60006001820161371757613717613504565b5060010190565b634e487b7160e01b600052603160045260246000fd5b6040815260006137476040830185612e6b565b828103602084015261375981856135f6565b95945050505050565b60408152600061377560408301856135f6565b82810360208401526137598185612e6b565b60005b838110156137a257818101518382015260200161378a565b50506000910152565b600081518084526137c3816020860160208601613787565b601f01601f19169290920160200192915050565b6001600160a01b03841681526001600160e01b031983166020820152606060408201819052600090613759908301846137ab565b6000825161381d818460208701613787565b9190910192915050565b60208152600061070660208301846137ab565b6001600160e01b03199290921682526001600160a01b0316602082015260400190565b60006020828403121561386f57600080fd5b8151801515811461124957600080fd5b6001600160e01b03198316815281516000906138a2816004850160208701613787565b919091016004019392505050565b6080815260006138c360808301876137ab565b6020838203818501526138d68288612e6b565b915083820360408501526138ea82876135f6565b915083820360608501528185518084528284019150828160051b85010183880160005b8381101561393b57601f198784030185526139298383516137ab565b9486019492509085019060010161390d565b50909b9a505050505050505050505056fea2646970667358221220d83003b43962afe3120b34eb387ecaaf4912a01d9c682ac0fb953cf65d90b77c64736f6c63430008170033", + "nonce": "0x2f121" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CREATE", + "contractName": "TransparentUpgradeableProxyV2", + "contractAddress": "0xD05A72c0A593983Aa8336C997736e2172E745fF1", + "function": null, + "arguments": [ + "0x2e8006C2Af701925915417D29c47b6D16e3C8cc8", + "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "0x7d4c1d780000000000000000000000000000000000000000000000000000000000000007000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000007e50000000000000000000000000000000000000000000000000000000000127500000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca00000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000003600000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000002e82d2b56f858f79deef11b160bfc4631873da2b000000000000000000000000bcb61783dd2403fe8cc9b89b27b1a9bb03d040cb000000000000000000000000b266bf53cf7eac4e2065a404598dcb0e15e9462c000000000000000000000000cc5fc5b6c8595f56306da736f6cd02ed9141c84a0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000d24d87ddc1917165435b306aac68d99e0f49a3fa000000000000000000000000b033ba62ec622dc54d0abfe0254e79692147ca26000000000000000000000000087d08e3ba42e64e3948962dd1371f906d1278b900000000000000000000000052ec2e6bbce45afff8955da6410bb13812f4289f000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000005000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab95" + ], + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x2b7868", + "value": "0x0", + "data": "0x608060405260405162000eed38038062000eed833981016040819052620000269162000429565b8282828281620000398282600062000053565b506200004790508262000085565b5050505050506200055c565b6200005e83620000f7565b6000825111806200006c5750805b1562000080576200007e838362000139565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f620000c760008051602062000ea6833981519152546001600160a01b031690565b604080516001600160a01b03928316815291841660208301520160405180910390a1620000f48162000168565b50565b620001028162000206565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606062000161838360405180606001604052806027815260200162000ec6602791396200029d565b9392505050565b6001600160a01b038116620001d35760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b8060008051602062000ea68339815191525b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002118162000383565b620002755760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620001ca565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc620001e5565b6060620002aa8462000383565b620003075760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401620001ca565b600080856001600160a01b03168560405162000324919062000509565b600060405180830381855af49150503d806000811462000361576040519150601f19603f3d011682016040523d82523d6000602084013e62000366565b606091505b5090925090506200037982828662000392565b9695505050505050565b6001600160a01b03163b151590565b60608315620003a357508162000161565b825115620003b45782518084602001fd5b8160405162461bcd60e51b8152600401620001ca919062000527565b80516001600160a01b0381168114620003e857600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200042057818101518382015260200162000406565b50506000910152565b6000806000606084860312156200043f57600080fd5b6200044a84620003d0565b92506200045a60208501620003d0565b60408501519092506001600160401b03808211156200047857600080fd5b818601915086601f8301126200048d57600080fd5b815181811115620004a257620004a2620003ed565b604051601f8201601f19908116603f01168101908382118183101715620004cd57620004cd620003ed565b81604052828152896020848701011115620004e757600080fd5b620004fa83602083016020880162000403565b80955050505050509250925092565b600082516200051d81846020870162000403565b9190910192915050565b60208152600082518060208401526200054881604085016020870162000403565b601f01601f19169190910160400192915050565b61093a806200056c6000396000f3fe6080604052600436106100595760003560e01c80633659cfe6146100705780634bb5274a146100905780634f1ef286146100a35780635c60da1b146100b65780638f283970146100e7578063f851a4401461010757610068565b366100685761006661011c565b005b61006661011c565b34801561007c57600080fd5b5061006661008b3660046106c7565b610136565b61006661009e3660046106f8565b610173565b6100666100b13660046107a8565b6101b8565b3480156100c257600080fd5b506100cb61021f565b6040516001600160a01b03909116815260200160405180910390f35b3480156100f357600080fd5b506100666101023660046106c7565b610250565b34801561011357600080fd5b506100cb610270565b610124610291565b61013461012f610326565b610330565b565b61013e61034f565b6001600160a01b0316330361016b5761016881604051806020016040528060008152506000610370565b50565b61016861011c565b61017b61034f565b6001600160a01b0316330361016b576000610194610326565b9050600080835160208501845af43d6000803e8080156101b3573d6000f35b3d6000fd5b6101c061034f565b6001600160a01b03163303610217576102128383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525060019250610370915050565b505050565b61021261011c565b600061022961034f565b6001600160a01b0316330361024557610240610326565b905090565b61024d61011c565b90565b61025861034f565b6001600160a01b0316330361016b576101688161039b565b600061027a61034f565b6001600160a01b031633036102455761024061034f565b61029961034f565b6001600160a01b031633036101345760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006102406103ef565b3660008037600080366000845af43d6000803e8080156101b3573d6000f35b600060008051602061089e8339815191525b546001600160a01b0316919050565b61037983610405565b6000825111806103865750805b15610212576103958383610445565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103c461034f565b604080516001600160a01b03928316815291841660208301520160405180910390a161016881610471565b60006000805160206108be833981519152610361565b61040e81610508565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061046a83836040518060600160405280602781526020016108de60279139610588565b9392505050565b6001600160a01b0381166104d65760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b606482015260840161031d565b8060008051602061089e8339815191525b80546001600160a01b0319166001600160a01b039290921691909117905550565b61051181610663565b6105735760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161031d565b806000805160206108be8339815191526104e7565b606061059384610663565b6105ee5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161031d565b600080856001600160a01b031685604051610609919061084e565b600060405180830381855af49150503d8060008114610644576040519150601f19603f3d011682016040523d82523d6000602084013e610649565b606091505b5091509150610659828286610672565b9695505050505050565b6001600160a01b03163b151590565b6060831561068157508161046a565b8251156106915782518084602001fd5b8160405162461bcd60e51b815260040161031d919061086a565b80356001600160a01b03811681146106c257600080fd5b919050565b6000602082840312156106d957600080fd5b61046a826106ab565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561070a57600080fd5b81356001600160401b038082111561072157600080fd5b818401915084601f83011261073557600080fd5b813581811115610747576107476106e2565b604051601f8201601f19908116603f0116810190838211818310171561076f5761076f6106e2565b8160405282815287602084870101111561078857600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000806000604084860312156107bd57600080fd5b6107c6846106ab565b925060208401356001600160401b03808211156107e257600080fd5b818601915086601f8301126107f657600080fd5b81358181111561080557600080fd5b87602082850101111561081757600080fd5b6020830194508093505050509250925092565b60005b8381101561084557818101518382015260200161082d565b50506000910152565b6000825161086081846020870161082a565b9190910192915050565b602081526000825180602084015261088981604085016020870161082a565b601f01601f1916919091016040019291505056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212205d5db908d6bad5bfc298cb89bc49c38963bb1499be9336506651cff965fb333264736f6c63430008170033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c65640000000000000000000000002e8006c2af701925915417d29c47b6d16e3c8cc8000000000000000000000000968d0cd7343f711216817e617d3f92a23dc91c07000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000004e47d4c1d780000000000000000000000000000000000000000000000000000000000000007000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000007e50000000000000000000000000000000000000000000000000000000000127500000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca00000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000003600000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000002e82d2b56f858f79deef11b160bfc4631873da2b000000000000000000000000bcb61783dd2403fe8cc9b89b27b1a9bb03d040cb000000000000000000000000b266bf53cf7eac4e2065a404598dcb0e15e9462c000000000000000000000000cc5fc5b6c8595f56306da736f6cd02ed9141c84a0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000d24d87ddc1917165435b306aac68d99e0f49a3fa000000000000000000000000b033ba62ec622dc54d0abfe0254e79692147ca26000000000000000000000000087d08e3ba42e64e3948962dd1371f906d1278b900000000000000000000000052ec2e6bbce45afff8955da6410bb13812f4289f000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000005000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab9500000000000000000000000000000000000000000000000000000000", + "nonce": "0x2f122" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CREATE", + "contractName": "RoninBridgeManager", + "contractAddress": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0xa304fa", + "value": "0x0", + "data": "0x60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b615f2b80620000f46000396000f3fe608060405234801561001057600080fd5b506004361061020f5760003560e01c806301a5f43f1461021457806306aba0e1146102295780630a44fa43146102445780630f7c31891461025757806315702f051461026c5780631c905e391461027f5780631f425338146102a15780632c5e6520146102b45780632d6d7d73146102d757806334d5f37b146102ea57806335da81211461030a5780633644e5151461031d5780636a61b16c146103265780637de5dedd146103395780637f7fe05814610341578063800eaab314610361578063828fc1a114610374578063865e6fd31461038757806386ccbf121461039a578063901979d5146103ad57806390264e59146103d85780639570abab146103eb57806397d6ae16146103fe5780639a7d3382146104115780639b19dbfd14610424578063a54f8a091461042c578063a64a83801461043f578063aee1767f14610452578063b384abef14610465578063b405aaf2146104c0578063b5d6e110146104d3578063b9c36209146104e6578063bc4e068f146104f9578063bc96180b1461050c578063bc9e0a5514610514578063c441c4a814610527578063cc7e6b3b1461053e578063d0a50db01461055e578063d78392f814610566578063dafae40814610579578063dd1f89141461058c578063de981f1b1461059f578063e75235b8146105b2578063e9c03498146105c8578063f80b5352146105db575b600080fd5b61022761022236600461497a565b6105e3565b005b610231610692565b6040519081526020015b60405180910390f35b610231610252366004614a13565b6106a1565b61025f610726565b60405161023b9190614aa6565b61022761027a366004614ad0565b610738565b61029261028d366004614bbe565b610842565b60405161023b93929190614c0a565b6102276102af366004614a13565b61085e565b6102c76102c2366004614cbd565b6108fd565b604051901515815260200161023b565b61025f6102e5366004614a13565b61090a565b6102316102f8366004614cf2565b60026020526000908152604090205481565b610227610318366004614a13565b610951565b61023160015481565b610227610334366004614d1e565b610999565b6102316109ae565b61035461034f366004614d52565b610a04565b60405161023b9190614d6d565b61022761036f366004614f18565b610a80565b6102c7610382366004614f7b565b610ab8565b610227610395366004614fb6565b610ac6565b6102276103a8366004615024565b610ae1565b6103c06103bb366004614d52565b610aee565b6040516001600160601b03909116815260200161023b565b6102276103e63660046150ca565b610b24565b6102276103f9366004615105565b610b43565b61022761040c366004615024565b610bda565b61022761041f366004614bbe565b610bf1565b61025f610c3e565b61022761043a3660046151f4565b610ca9565b61022761044d366004614cf2565b610cc5565b610354610460366004614d52565b610cd6565b6104af610473366004614bbe565b600360208181526000938452604080852090915291835291208054600182015460028301549383015460069093015460ff909216939092909185565b60405161023b959493929190615238565b6102c76104ce366004614d52565b610ce8565b6102276104e13660046150ca565b610d20565b6102276104f4366004614bbe565b610d2d565b610292610507366004614cf2565b610d3f565b600454610231565b61022761052236600461526d565b610d5c565b61052f610dbb565b60405161023b939291906152db565b61055161054c366004614a13565b610e95565b60405161023b9190615314565b610231610ed3565b6103c0610574366004614d52565b610ee6565b6102c7610587366004614cf2565b610ef1565b61022761059a366004615327565b610f2d565b6103546105ad366004615419565b61103a565b6105ba61109c565b60405161023b929190615434565b6102276105d6366004614a13565b6110be565b61025f611107565b6105eb61116a565b61068986868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808a02828101820190935289825290935089925088918291850190849080828437600092019190915250506040805160208089028281018201909352888252909350889250879182918501908490808284376000920191909152506111c692505050565b50505050505050565b600061069c611528565b905090565b60008282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506106e2925083915061153b9050565b61071e84848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061157092505050565b949350505050565b606061069c6107336115f5565b611619565b6107413361162d565b6108346040518061010001604052806107598e61166f565b81526020018d81526020018c81526020018b6001600160a01b031681526020018a8a808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050908252506040805160208a810282810182019093528a82529283019290918b918b9182918501908490808284376000920191909152505050908252506020016107f4868861550d565b815260200184848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050509152503361171f565b505050505050505050505050565b6060806060610851858561181e565b9250925092509250925092565b61086661116a565b8181808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506108a5925083915061153b9050565b60006108af6115f5565b905060005b838110156108f6576108ed8585838181106108d1576108d161551a565b90506020020160208101906108e69190614d52565b8390611bf5565b506001016108b4565b5050505050565b600061071e848484611c0a565b606061094883838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250611c2d915050565b90505b92915050565b61095961116a565b610995828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611d8092505050565b5050565b6109ab6109a5826155af565b33611e33565b50565b6000806109b9611eff565b90506000806109c661109c565b91509150806001828560040154856109de91906156ab565b6109e891906156c2565b6109f291906156d5565b6109fc91906156e8565b935050505090565b6000806000610a1a610a14611eff565b85611f23565b9150915081610a47578360405163141e2e1f60e11b8152600401610a3e9190614d6d565b60405180910390fd5b610a4f611eff565b6001018181548110610a6357610a6361551a565b6000918252602090912001546001600160a01b0316949350505050565b333014610aae576000356001600160e01b0319166040516307337e1960e41b8152600401610a3e919061570a565b6109958282611f88565b600061094860008484611c0a565b610ace61116a565b610ad781612031565b610995828261205e565b6108f685858585856120e9565b600080610af9611eff565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b031690565b610b2d3361162d565b610b3b858585858533612182565b505050505050565b610b4c3361162d565b610bce8a89898c8a8a80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610b9392508b91508c905061550d565b8888808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152503392506121c1915050565b50505050505050505050565b610be33361162d565b6108f685858585853361231b565b600082815260036020908152604080832084845290915281206001810154909103610c2f5760405163713b099760e11b815260040160405180910390fd5b610c388161233a565b50505050565b6060610c48611eff565b600101805480602002602001604051908101604052809291908181526020018280548015610c9f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610c81575b5050505050905090565b610cb23361162d565b61099533610cbf846155af565b8361254f565b610ccd61116a565b6109ab8161264f565b6000610ce1826126bc565b5092915050565b600080610cf3611eff565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b0316151590565b6108f68585858585612733565b610d3561116a565b61099582826127e9565b6060806060610d4f60008561181e565b9250925092509193909250565b6109ab6109a5610dac610d72606085018561571f565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525060019250611c2d915050565b610db584615768565b9061289b565b60608060606000610dca611eff565b805460408051602080840282018101909252828152929350839190830182828015610e1e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610e00575b5050505050935080600101805480602002602001604051908101604052809291908181526020018280548015610e7d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610e5f575b50505050509250610e8d846129a1565b915050909192565b60606109488383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506129a192505050565b6000610edd611eff565b60010154919050565b600061094b82612a86565b600080610efc612abb565b9050610f06611528565b8160010154610f1591906156ab565b6002820154610f2490856156ab565b10159392505050565b610f363361162d565b6000604051806101000160405280610f4d4661166f565b81526020014681526020018d81526020018c6001600160a01b031681526020018b8b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050908252506040805160208b810282810182019093528b82529283019290918c918c918291850190849080828437600092019190915250505090825250602001610fe8878961550d565b81526020018585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050915250905061102e813361171f565b5061083433828461254f565b6000611044612adf565b600083600f81111561105857611058614be0565b60ff1681526020810191909152604001600020546001600160a01b0316905080611097578160405163409140df60e11b8152600401610a3e9190615843565b919050565b60008060006110a9612abb565b90508060010154816002015492509250509091565b6110c661116a565b611102828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612b0392505050565b505050565b6060611111611eff565b805460408051602080840282018101909252828152929190830182828015610c9f576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610c81575050505050905090565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031633146111c4576000356001600160e01b0319166001604051620f948f60ea1b8152600401610a3e92919061585d565b565b60606111d28383612ee9565b6111db8161153b565b60006111e5611eff565b8451875191925090811480156111fb5750855181145b611226576000356001600160e01b0319166040516306b5667560e21b8152600401610a3e919061570a565b806001600160401b0381111561123e5761123e614d81565b604051908082528060200260200182016040528015611267578160200160208202803683370190505b50935080600003611279575050611520565b60008060008060005b8581101561148c578a818151811061129c5761129c61551a565b602002602001015194508981815181106112b8576112b861551a565b602002602001015193508b81815181106112d4576112d461551a565b602002602001015192506112e785612ff3565b6112f084612ff3565b826001600160601b0316600003611328576000356001600160e01b031916604051637f11b8a360e11b8152600401610a3e919061570a565b6001600160a01b03808616600081815260038a01602090815260408083205494891683528083205460028d0190925280832054938352909120546001600160601b03938416939182169261138092908116911661588b565b61138a919061588b565b611394919061588b565b6001600160601b03166000148982815181106113b2576113b261551a565b6020026020010190151590811515815250508881815181106113d6576113d661551a565b602002602001015115611484578654600181810189556000898152602080822090930180546001600160a01b03808b166001600160a01b0319928316811790935591835260028c018552604080842080546001600160601b038b166001600160601b03199182168117909255868f018054978801815586528786209096018054948c1694909316841790925591835260038c01909452902080549091168217905561148190836156c2565b91505b600101611282565b50808660040160008282546114a191906156c2565b90915550506040516114dc906347c28ec560e11b906114c8908c908f908d906020016158de565b604051602081830303815290604052613028565b7f897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b78888c8c8c6040516115119493929190615917565b60405180910390a15050505050505b509392505050565b6000611532611eff565b60040154905090565b61154481613055565b156109ab576000356001600160e01b031916604051630d697db160e11b8152600401610a3e919061570a565b60008161157c8161153b565b6000611586611eff565b905060005b84518110156115ed578160020160008683815181106115ac576115ac61551a565b6020908102919091018101516001600160a01b03168252810191909152604001600020546115e3906001600160601b0316856156c2565b935060010161158b565b505050919050565b7f5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd97624090565b60606000611626836130f4565b9392505050565b61163681612a86565b6001600160601b03166000036109ab576000356001600160e01b0319166003604051620f948f60ea1b8152600401610a3e92919061585d565b6000818152600260205260408120549081900361169e5750600090815260026020526040902060019081905590565b60008281526003602090815260408083208484529091528120906116c18261233a565b905080611718576000825460ff1660048111156116e0576116e0614be0565b036116fe5760405163757a436360e01b815260040160405180910390fd5b600084815260026020526040902080546001019081905592505b5050919050565b602082015160009080820361175a576000356001600160e01b03191660004660405163092048d160e11b8152600401610a3e93929190615964565b600454611768908590613150565b6000611773856131f1565b905061177e8261166f565b600083815260036020908152604080832084845290915290819020908701519194506117ab91839061333b565b845183146117da576000356001600160e01b03191660405163d4cec26960e01b8152600401610a3e919061570a565b8083837fd1221ffb98610024a29755d7db3c71692310f43a7cfcce7ee488a8c7e9e0bfa4888860405161180e929190615aff565b60405180910390a4505092915050565b6000828152600360209081526040808320848452909152812060048101546005820154606093849384939092909161185682846156c2565b9050806001600160401b0381111561187057611870614d81565b604051908082528060200260200182016040528015611899578160200160208202803683370190505b509550806001600160401b038111156118b4576118b4614d81565b6040519080825280602002602001820160405280156118ed57816020015b6118da614896565b8152602001906001900390816118d25790505b509450806001600160401b0381111561190857611908614d81565b604051908082528060200260200182016040528015611931578160200160208202803683370190505b50965060005b83811015611a865760008782815181106119535761195361551a565b6020026020010190600181111561196c5761196c614be0565b9081600181111561197f5761197f614be0565b90525060008a81526003602090815260408083208c8452909152812060048701805460079092019291849081106119b8576119b861551a565b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815460ff16815260018201549381019390935260020154908201528651879083908110611a1657611a1661551a565b6020026020010181905250846004018181548110611a3657611a3661551a565b9060005260206000200160009054906101000a90046001600160a01b0316888281518110611a6657611a6661551a565b6001600160a01b0390921660209283029190910190910152600101611937565b5060005b82811015611be957600187611a9f86846156c2565b81518110611aaf57611aaf61551a565b60200260200101906001811115611ac857611ac8614be0565b90816001811115611adb57611adb614be0565b90525060008a81526003602090815260408083208c845290915281206005870180546007909201929184908110611b1457611b1461551a565b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815460ff168152600182015493810193909352600201549082015286611b6986846156c2565b81518110611b7957611b7961551a565b6020026020010181905250846005018181548110611b9957611b9961551a565b6000918252602090912001546001600160a01b031688611bb986846156c2565b81518110611bc957611bc961551a565b6001600160a01b0390921660209283029190910190910152600101611a8a565b50505050509250925092565b6000610948836001600160a01b03841661334b565b6000838152600360209081526040808320858452909152812061071e908361343e565b606082516001600160401b03811115611c4857611c48614d81565b604051908082528060200260200182016040528015611c71578160200160208202803683370190505b50905060005b8351811015610ce15760056000858381518110611c9657611c9661551a565b60200260200101516005811115611caf57611caf614be0565b6005811115611cc057611cc0614be0565b815260200190815260200160002060009054906101000a90046001600160a01b0316828281518110611cf457611cf461551a565b60200260200101906001600160a01b031690816001600160a01b031681525050828015611d4c575060006001600160a01b0316828281518110611d3957611d3961551a565b60200260200101516001600160a01b0316145b15611d78576000356001600160e01b03191660405163053265f160e01b8152600401610a3e919061570a565b600101611c77565b80611d8a8161153b565b6000611d946115f5565b905060008060005b8551811015610b3b57858181518110611db757611db761551a565b60200260200101519250611dca83612031565b611ddb836312c0151560e21b613460565b611de584846135f3565b604080516001600160a01b038616815282151560208201529193507fb85c58eeff9fe423669ae0841666f4c8499e8731b8275eb462e4fa1720ec420e910160405180910390a1600101611d9c565b6000611e3e836131f1565b602080850151600090815260038252604080822087518352909252206001810154919250908214611e89576001810154604051632bee7fdb60e21b8152610a3e918491600401615434565b6001815460ff166004811115611ea157611ea1614be0565b14611ebf57604051632c2f3bdf60e01b815260040160405180910390fd5b83606001516001600160a01b0316836001600160a01b031614611ef55760405163e61090ab60e01b815260040160405180910390fd5b610c388185613608565b7fc648703095712c0419b6431ae642c061f0a105ac2d7c3d9604061ef4ebc3830090565b60008060005b8454811015611f7657848181548110611f4457611f4461551a565b6000918252602090912001546001600160a01b0390811690851603611f6e57600192509050611f81565b600101611f29565b506000600019915091505b9250929050565b60005b825181101561110257306001600160a01b0316828281518110611fb057611fb061551a565b60200260200101516001600160a01b031603611fed576000356001600160e01b03191660405163053265f160e01b8152600401610a3e919061570a565b6120298382815181106120025761200261551a565b602002602001015183838151811061201c5761201c61551a565b6020026020010151613675565b600101611f8b565b806001600160a01b03163b6000036109ab5780604051630bfc64a360e21b8152600401610a3e9190614d6d565b80612067612adf565b600084600f81111561207b5761207b614be0565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f8111156120bc576120bc614be0565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b60006120fc6120f7876155af565b6131f1565b60208088013560009081526003825260408082208a3583529092522060010154909150811461216157602080870135600090815260038252604080822089358352909252819020600101549051632bee7fdb60e21b8152610a3e918391600401615434565b610b3b61216d876155af565b8686868661217d6120f78d6155af565b613708565b61218a6148b6565b61219c61219688615768565b836139d1565b90506121b7818787878761217d6121b28e615768565b613abe565b9695505050505050565b60006121cd600061166f565b905060006040518060e001604052808381526020018b8152602001886001600160a01b031681526020018a8a80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093855250505060208083018a905260408084018a9052606090930188905282518c820281810183019094528c8152939450909261228d92612286928e918e9182919085019084908082843760009201919091525060019250611c2d915050565b839061289b565b90506122a46004548261315090919063ffffffff16565b60006122af826131f1565b6000858152600080516020615ed6833981519152602052604090209091506122d890828e61333b565b8084600080516020615eb6833981519152846122f387613abe565b878a6040516123059493929190615b6a565b60405180910390a3505050505050505050505050565b61232d612327876155af565b8261171f565b50610b3b61216d876155af565b600080825460ff16600481111561235357612353614be0565b148015612364575042826006015411155b905080156110975760018201546040517f58f98006a7f2f253f8ae8f8b7cec9008ca05359633561cd7c22f3005682d4a5590600090a260005b6004830154811015612450578260080160008460040183815481106123c4576123c461551a565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff19169055600484018054600786019291908490811061240d5761240d61551a565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff1916815560018181018390556002909101919091550161239d565b5060005b60058301548110156125075782600801600084600501838154811061247b5761247b61551a565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff1916905560058401805460078601929190849081106124c4576124c461551a565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff19168155600181810183905560029091019190915501612454565b50815460ff191682556000600183018190556002830181905560038301819055612535906004840190614904565b612543600583016000614904565b60006006830155919050565b4682602001511461258857602082015160405163092048d160e11b8152610a3e916001600160e01b031960003516914690600401615964565b6000612593836131f1565b602080850151600090815260038252604080822087518352909252206001015490915081146125f857602080840151600090815260038252604080822086518352909252819020600101549051632bee7fdb60e21b8152610a3e918391600401615434565b6000612602613bfd565b905060008161260f613c07565b61261991906156d5565b6126249060016156c2565b905061262e614896565b612645868685858b866126408e613c11565b613c2b565b5050505050505050565b6003811015612671576040516305f4dee960e31b815260040160405180910390fd5b600061267b611eff565b600581018390556040518381529091507f22d5bb5059ffe2949a098666fc198587200c8118483074120d3ca7050c7753f19060200160405180910390a15050565b6000806000806126d66126cd611eff565b60010186611f23565b91509150816126fa57846040516326527e1760e01b8152600401610a3e9190614d6d565b612702611eff565b8054829081106127145761271461551a565b6000918252602090912001546001600160a01b03169590945092505050565b6000612751612748610d72606089018961571f565b610db588615768565b9050600061275e826131f1565b60008080526003602090815284518252600080516020615ed68339815191529052604090206001015490915081146127d55760008080526003602090815283518252600080516020615ed68339815191529052604090819020600101549051632bee7fdb60e21b8152610a3e918391600401615434565b610689828787878761217d6121b28e615768565b808211806127f8575060018111155b15612824576000356001600160e01b0319166040516387f6f09560e01b8152600401610a3e919061570a565b600061282e612abb565b600181018054600283018054928790558590558254929350918490869085600061285783615c23565b919050557f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8858560405161288c929190615434565b60405180910390a45050505050565b6128a36148b6565b8251815260006020808301919091528301516040808301919091528301516001600160a01b0316606080830191909152830151516001600160401b038111156128ee576128ee614d81565b604051908082528060200260200182016040528015612917578160200160208202803683370190505b5060808083019190915283015160a08083019190915283015160c08083019190915283015160e082015260005b836060015151811015610ce1578281815181106129635761296361551a565b6020026020010151826080015182815181106129815761298161551a565b6001600160a01b0390921660209283029190910190910152600101612944565b606060006129ad611eff565b905082516001600160401b038111156129c8576129c8614d81565b6040519080825280602002602001820160405280156129f1578160200160208202803683370190505b50915060005b835181101561171857816002016000858381518110612a1857612a1861551a565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160601b0316838281518110612a6657612a6661551a565b6001600160601b03909216602092830291909101909101526001016129f7565b6000612a90611eff565b6001600160a01b0390921660009081526002929092016020525060409020546001600160601b031690565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f0090565b7fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb90565b606081612b0f8161153b565b6000612b19611eff565b8451909150806001600160401b03811115612b3657612b36614d81565b604051908082528060200260200182016040528015612b5f578160200160208202803683370190505b50935080600003612b71575050612ee3565b60058201548254612b839083906156d5565b1015612ba25760405163b2e765cb60e01b815260040160405180910390fd5b60008060008060005b85811015612e6957898181518110612bc557612bc561551a565b60200260200101519350612bd8846126bc565b9095509150612be685612ff3565b612bef84612ff3565b6001600160a01b03851660009081526002880160205260409020546001600160601b031615801590612c4357506001600160a01b03841660009081526003880160205260409020546001600160601b031615155b898281518110612c5557612c5561551a565b602002602001019015159081151581525050888181518110612c7957612c7961551a565b602002602001015115612e61576001600160a01b038516600090815260028801602052604081205488546001600160601b039091169190612cbc906001906156d5565b9050886000018181548110612cd357612cd361551a565b60009182526020909120015489546001600160a01b03909116908a9086908110612cff57612cff61551a565b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790558854899080612d3957612d39615c3c565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038916825260028b0190526040902080546001600160601b031916905560018901805482908110612d9957612d9961551a565b60009182526020909120015460018a0180546001600160a01b039092169186908110612dc757612dc761551a565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555088600101805480612e0857612e08615c3c565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038816825260038b0190526040902080546001600160601b0319169055612e5c82866156c2565b945050505b600101612bab565b5081866004016000828254612e7e91906156d5565b9091555050604051612ea390636242a4ef60e11b906114c8908c908c90602001615c52565b7fdf3dcd7987202f64648f3acdbf12401e3a2bb23e77e19f99826b5475cbb86369888a604051612ed4929190615c77565b60405180910390a15050505050505b50919050565b81518151606091908082016001600160401b03811115612f0b57612f0b614d81565b604051908082528060200260200182016040528015612f34578160200160208202803683370190505b50925060005b82811015612f8e57858181518110612f5457612f5461551a565b6020026020010151848281518110612f6e57612f6e61551a565b6001600160a01b0390921660209283029190910190910152600101612f3a565b60005b82811015612fe957858181518110612fab57612fab61551a565b6020026020010151858381518110612fc557612fc561551a565b6001600160a01b039092166020928302919091019091015260019182019101612f91565b5050505092915050565b6001600160a01b0381166109ab576000356001600160e01b03191660405163104c66df60e31b8152600401610a3e919061570a565b6130328282613f6b565b610995573382826040516319b5fdcb60e31b8152600401610a3e93929190615c9c565b6000815160000361306857506000919050565b60005b60018351038110156130eb57600181015b83518110156130e2578381815181106130975761309761551a565b60200260200101516001600160a01b03168483815181106130ba576130ba61551a565b60200260200101516001600160a01b0316036130da575060019392505050565b60010161307c565b5060010161306b565b50600092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561314457602002820191906000526020600020905b815481526020019060010190808311613130575b50505050509050919050565b600082608001515111801561316e57508160a0015151826080015151145b801561318357508160c0015151826080015151145b801561319857508160e0015151826080015151145b6131c3576000356001600160e01b0319166040516306b5667560e21b8152600401610a3e919061570a565b6131cd81426156c2565b826040015111156109955760405163ad89be9d60e01b815260040160405180910390fd5b60a0810151608082015160c083015151600092919083906001600160401b0381111561321f5761321f614d81565b604051908082528060200260200182016040528015613248578160200160208202803683370190505b5060e086015190915060005b82518110156132a7578660c0015181815181106132735761327361551a565b6020026020010151805190602001208382815181106132945761329461551a565b6020908102919091010152600101613254565b50604080517f1b59eeec7c321899dc1e7a5b3d876c9a445dffc6d2f96ba842d7489908fdee1281528751602080830191909152808901518284015291880151606080830191909152909701516080880152835181029381019390932060a0870152835183029383019390932060c0860152805182029082012060e08501528151810291012061010083015250610120902090565b6001830191909155600690910155565b6000818152600183016020526040812054801561343457600061336f6001836156d5565b8554909150600090613383906001906156d5565b90508181146133e85760008660000182815481106133a3576133a361551a565b90600052602060002001549050808760000184815481106133c6576133c661551a565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806133f9576133f9615c3c565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061094b565b600091505061094b565b6001600160a01b03166000908152600891909101602052604090205460ff1690565b600081604051602401613473919061570a565b60408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b1790525190915060009081906001600160a01b038616906134bc908590615cd0565b600060405180830381855afa9150503d80600081146134f7576040519150601f19603f3d011682016040523d82523d6000602084013e6134fc565b606091505b5091509150816135be57846001600160a01b0316836040516024016135219190615cec565b60408051601f198184030181529181526020820180516001600160e01b03166325da93a560e11b179052516135569190615cd0565b600060405180830381855afa9150503d8060008114613591576040519150601f19603f3d011682016040523d82523d6000602084013e613596565b606091505b509092509050816135be57838560405163069d427960e11b8152600401610a3e929190615cff565b808060200190518101906135d29190615d22565b6108f657838560405163069d427960e11b8152600401610a3e929190615cff565b6000610948836001600160a01b038416614291565b613611816142e0565b1561099557815460ff1916600217825560008061362d836142fa565b9150915083600101547fe134987599ae266ec90edeff1b26125b287dbb57b10822649432d1bb26537fba8383604051613667929190615d44565b60405180910390a250505050565b806005600084600581111561368c5761368c614be0565b600581111561369d5761369d614be0565b8152602081019190915260400160002080546001600160a01b0319166001600160a01b0392831617905581168260058111156136db576136db614be0565b6040517f356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d90600090a35050565b831580159061371657508382145b613741576000356001600160e01b0319166040516306b5667560e21b8152600401610a3e919061570a565b600061379a61374f60015490565b61375a8460006145a1565b60405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b905060006137b56137aa60015490565b61375a8560016145a1565b905060006137c1613bfd565b90506000816137ce613c07565b6137d891906156d5565b6137e39060016156c2565b90506000805b87811015610834573660008a8a848181106138065761380661551a565b606002919091019250600090508d8d858181106138255761382561551a565b905060200201602081019061383a9190615d69565b600181111561384b5761384b614be0565b0361387757613870886138616020850185615d95565b846020013585604001356145da565b90506138ee565b60018d8d8581811061388b5761388b61551a565b90506020020160208101906138a09190615d69565b60018111156138b1576138b1614be0565b036138c757613870876138616020850185615d95565b6000356001600160e01b031916604051630612418f60e11b8152600401610a3e919061570a565b806001600160a01b0316846001600160a01b03161061392e576000356001600160e01b031916604051635d3dcd3160e01b8152600401610a3e919061570a565b809350600061393c82613c11565b90508060000361396d576000356001600160e01b03191660405163726b3acb60e01b8152600401610a3e919061570a565b6139b08f8f8f878181106139835761398361551a565b90506020020160208101906139989190615d69565b8989866139aa368a90038a018a615db0565b87613c2b565b156139c357505050505050505050610b3b565b8360010193505050506137e9565b6139d96148b6565b6139f26139eb84606001516001611c2d565b849061289b565b9050613a096004548261315090919063ffffffff16565b6000613a14826131f1565b90506000613a22600061166f565b6000818152600080516020615ed68339815191526020908152604090912090870151919250613a5291849061333b565b82518114613a81576000356001600160e01b03191660405163d4cec26960e01b8152600401610a3e919061570a565b8181600080516020615eb683398151915285613a9c89613abe565b8989604051613aae9493929190615b6a565b60405180910390a3505092915050565b6080810151606082015160a083015151600092919083906001600160401b03811115613aec57613aec614d81565b604051908082528060200260200182016040528015613b15578160200160208202803683370190505b5060c086015190915060005b8251811015613b74578660a001518181518110613b4057613b4061551a565b602002602001015180519060200120838281518110613b6157613b6161551a565b6020908102919091010152600101613b21565b50604080517fde480f0c53a3651c08fbab1dffbc45fe574f31188827fe52cb9035da9fe57e4a8152875160208083019190915280890151828401529790910151606082015283518702938701939093206080840152835186029386019390932060a0830152805185029085012060c082015281518402919093012060e083015250610100902090565b600061069c6109ae565b600061069c610692565b6000613c1c82612a86565b6001600160601b031692915050565b60208088015188516000828152600384526040808220838352909452928320613c538161233a565b15613c645760019350505050613f60565b6020808c01516000908152600290915260409020548214613ca6576000356001600160e01b03191660405163d4cec26960e01b8152600401610a3e919061570a565b6000815460ff166004811115613cbe57613cbe614be0565b14613cdc576040516322de95ff60e21b815260040160405180910390fd5b613ce6818861343e565b15613d06578660405163025fd59560e41b8152600401610a3e9190614d6d565b6001600160a01b03871660009081526008820160209081526040909120805460ff19166001179055860151151580613d415750604086015115155b80613d4f5750855160ff1615155b15613d96576001600160a01b03871660009081526007820160209081526040918290208851815460ff191660ff909116178155908801516001820155908701516002909101555b866001600160a01b031681600101547f1203f9e81c814a35f5f4cc24087b2a24c6fb7986a9f1406b68a9484882c93a238c88604051613dd6929190615e10565b60405180910390a3600080808c6001811115613df457613df4614be0565b03613e49576004830180546001810182556000918252602082200180546001600160a01b0319166001600160a01b038c16179055600384018054899290613e3c9084906156c2565b9250508190559150613eae565b60018c6001811115613e5d57613e5d614be0565b036138c7576005830180546001810182556000918252602082200180546001600160a01b0319166001600160a01b038c16179055600284018054899290613ea59084906156c2565b92505081905590505b8a8210613f1457825460ff19166001908117845580840154604051919750907f5c819725ea53655a3b898f3df59b66489761935454e9212ca1e5ebd759953d0b90600090a260608d01516001600160a01b0316613f0f57613f0f838e613608565b613f5a565b898110613f5a57825460ff19166003178355600180840154604051919750907f55295d4ce992922fa2e5ffbf3a3dcdb367de0a15e125ace083456017fd22060f90600090a25b50505050505b979650505050505050565b60016000613f7a6107336115f5565b80519091506000819003613f8f57505061094b565b6000816001600160401b03811115613fa957613fa9614d81565b604051908082528060200260200182016040528015613fd2578160200160208202803683370190505b5090506000826001600160401b03811115613fef57613fef614d81565b60405190808252806020026020018201604052801561402257816020015b606081526020019060019003908161400d5790505b5090506000878760405160200161403a929190615e1e565b604051602081830303815290604052905060008160405160240161405e9190615cec565b60408051601f198184030181529190526020810180516001600160e01b03166325da93a560e11b179052905060005b85811015614247578681815181106140a7576140a761551a565b60200260200101516001600160a01b0316836040516140c69190615cd0565b6000604051808303816000865af19150503d8060008114614103576040519150601f19603f3d011682016040523d82523d6000602084013e614108565b606091505b5086838151811061411b5761411b61551a565b602002602001018684815181106141345761413461551a565b602002602001018290528215151515815250505084818151811061415a5761415a61551a565b602002602001015161423f578681815181106141785761417861551a565b60200260200101516001600160a01b0316826040516141979190615cd0565b6000604051808303816000865af19150503d80600081146141d4576040519150601f19603f3d011682016040523d82523d6000602084013e6141d9565b606091505b508683815181106141ec576141ec61551a565b602002602001018684815181106142055761420561551a565b602002602001018290528215151515815250505087801561423c57508481815181106142335761423361551a565b60200260200101515b97505b60010161408d565b507fc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b638287868660405161427d9493929190615e4f565b60405180910390a150505050505092915050565b60008181526001830160205260408120546142d85750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561094b565b50600061094b565b600081602001516000148061094b57505060200151461490565b606080614306836142e0565b61433857602083015160405163092048d160e11b8152610a3e916001600160e01b031960003516914690600401615964565b8260800151516001600160401b0381111561435557614355614d81565b60405190808252806020026020018201604052801561437e578160200160208202803683370190505b5091508260800151516001600160401b0381111561439e5761439e614d81565b6040519080825280602002602001820160405280156143d157816020015b60608152602001906001900390816143bc5790505b50905060005b83608001515181101561459b578360e0015181815181106143fa576143fa61551a565b60200260200101515a1161442d57614411846131f1565b6040516307aec4ab60e21b8152600401610a3e91815260200190565b836080015181815181106144435761444361551a565b60200260200101516001600160a01b03168460a00151828151811061446a5761446a61551a565b60200260200101518560e0015183815181106144885761448861551a565b6020026020010151908660c0015184815181106144a7576144a761551a565b60200260200101516040516144bc9190615cd0565b600060405180830381858888f193505050503d80600081146144fa576040519150601f19603f3d011682016040523d82523d6000602084013e6144ff565b606091505b508483815181106145125761451261551a565b6020026020010184848151811061452b5761452b61551a565b60200260200101829052821515151581525050508281815181106145515761455161551a565b602002602001015161459357808282815181106145705761457061551a565b60200260200101516040516376df417560e11b8152600401610a3e929190615e9c565b6001016143d7565b50915091565b604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b60008060006145eb87878787614602565b915091506145f8816146e5565b5095945050505050565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b0383111561462f57506000905060036146dc565b8460ff16601b1415801561464757508460ff16601c14155b1561465857506000905060046146dc565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156146ac573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166146d5576000600192509250506146dc565b9150600090505b94509492505050565b60008160048111156146f9576146f9614be0565b036147015750565b600181600481111561471557614715614be0565b0361475d5760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b6044820152606401610a3e565b600281600481111561477157614771614be0565b036147be5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610a3e565b60038160048111156147d2576147d2614be0565b0361482a5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610a3e565b600481600481111561483e5761483e614be0565b036109ab5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610a3e565b604080516060810182526000808252602082018190529181019190915290565b60405180610100016040528060008152602001600081526020016000815260200160006001600160a01b03168152602001606081526020016060815260200160608152602001606081525090565b50805460008255906000526020600020908101906109ab91905b80821115614932576000815560010161491e565b5090565b60008083601f84011261494857600080fd5b5081356001600160401b0381111561495f57600080fd5b6020830191508360208260051b8501011115611f8157600080fd5b6000806000806000806060878903121561499357600080fd5b86356001600160401b03808211156149aa57600080fd5b6149b68a838b01614936565b909850965060208901359150808211156149cf57600080fd5b6149db8a838b01614936565b909650945060408901359150808211156149f457600080fd5b50614a0189828a01614936565b979a9699509497509295939492505050565b60008060208385031215614a2657600080fd5b82356001600160401b03811115614a3c57600080fd5b614a4885828601614936565b90969095509350505050565b6001600160a01b03169052565b60008151808452602080850194506020840160005b83811015614a9b5781516001600160a01b031687529582019590820190600101614a76565b509495945050505050565b6020815260006109486020830184614a61565b80356001600160a01b038116811461109757600080fd5b600080600080600080600080600080600060e08c8e031215614af157600080fd5b8b359a5060208c01359950614b0860408d01614ab9565b98506001600160401b0360608d0135811015614b2357600080fd5b614b338e60608f01358f01614936565b909950975060808d0135811015614b4957600080fd5b614b598e60808f01358f01614936565b909750955060a08d0135811015614b6f57600080fd5b614b7f8e60a08f01358f01614936565b909550935060c08d0135811015614b9557600080fd5b50614ba68d60c08e01358e01614936565b81935080925050509295989b509295989b9093969950565b60008060408385031215614bd157600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60028110614c0657614c06614be0565b9052565b60006060808352614c1e6060840187614a61565b83810360208581019190915286518083528782019282019060005b81811015614c5c57614c4c838651614bf6565b9383019391830191600101614c39565b50506040925085810360408701528087518083528383019150838901925060005b81811015614cad578351805160ff1684528581015186850152860151868401529284019291860191600101614c7d565b50909a9950505050505050505050565b600080600060608486031215614cd257600080fd5b8335925060208401359150614ce960408501614ab9565b90509250925092565b600060208284031215614d0457600080fd5b5035919050565b60006101008284031215612ee357600080fd5b600060208284031215614d3057600080fd5b81356001600160401b03811115614d4657600080fd5b61071e84828501614d0b565b600060208284031215614d6457600080fd5b61094882614ab9565b6001600160a01b0391909116815260200190565b634e487b7160e01b600052604160045260246000fd5b60405161010081016001600160401b0381118282101715614dba57614dba614d81565b60405290565b60405160e081016001600160401b0381118282101715614dba57614dba614d81565b604051601f8201601f191681016001600160401b0381118282101715614e0a57614e0a614d81565b604052919050565b60006001600160401b03821115614e2b57614e2b614d81565b5060051b60200190565b600082601f830112614e4657600080fd5b81356020614e5b614e5683614e12565b614de2565b8083825260208201915060208460051b870101935086841115614e7d57600080fd5b602086015b84811015614ea757803560068110614e9a5760008081fd5b8352918301918301614e82565b509695505050505050565b600082601f830112614ec357600080fd5b81356020614ed3614e5683614e12565b8083825260208201915060208460051b870101935086841115614ef557600080fd5b602086015b84811015614ea757614f0b81614ab9565b8352918301918301614efa565b60008060408385031215614f2b57600080fd5b82356001600160401b0380821115614f4257600080fd5b614f4e86838701614e35565b93506020850135915080821115614f6457600080fd5b50614f7185828601614eb2565b9150509250929050565b60008060408385031215614f8e57600080fd5b82359150614f9e60208401614ab9565b90509250929050565b80356010811061109757600080fd5b60008060408385031215614fc957600080fd5b614fd283614fa7565b9150614f9e60208401614ab9565b60008083601f840112614ff257600080fd5b5081356001600160401b0381111561500957600080fd5b602083019150836020606083028501011115611f8157600080fd5b60008060008060006060868803121561503c57600080fd5b85356001600160401b038082111561505357600080fd5b61505f89838a01614d0b565b9650602088013591508082111561507557600080fd5b61508189838a01614936565b9096509450604088013591508082111561509a57600080fd5b506150a788828901614fe0565b969995985093965092949392505050565b600060e08284031215612ee357600080fd5b6000806000806000606086880312156150e257600080fd5b85356001600160401b03808211156150f957600080fd5b61505f89838a016150b8565b60008060008060008060008060008060c08b8d03121561512457600080fd5b8a35995061513460208c01614ab9565b985060408b01356001600160401b038082111561515057600080fd5b61515c8e838f01614936565b909a50985060608d013591508082111561517557600080fd5b6151818e838f01614936565b909850965060808d013591508082111561519a57600080fd5b6151a68e838f01614936565b909650945060a08d01359150808211156151bf57600080fd5b506151cc8d828e01614936565b915080935050809150509295989b9194979a5092959850565b80356002811061109757600080fd5b6000806040838503121561520757600080fd5b82356001600160401b0381111561521d57600080fd5b61522985828601614d0b565b925050614f9e602084016151e5565b60a081016005871061524c5761524c614be0565b95815260208101949094526040840192909252606083015260809091015290565b60006020828403121561527f57600080fd5b81356001600160401b0381111561529557600080fd5b61071e848285016150b8565b60008151808452602080850194506020840160005b83811015614a9b5781516001600160601b0316875295820195908201906001016152b6565b6060815260006152ee6060830186614a61565b82810360208401526153008186614a61565b905082810360408401526121b781856152a1565b60208152600061094860208301846152a1565b600080600080600080600080600080600060e08c8e03121561534857600080fd5b8b359a5061535860208d01614ab9565b99506001600160401b0360408d013581101561537357600080fd5b6153838e60408f01358f01614936565b909a50985060608d013581101561539957600080fd5b6153a98e60608f01358f01614936565b909850965060808d01358110156153bf57600080fd5b6153cf8e60808f01358f01614936565b909650945060a08d01358110156153e557600080fd5b506153f68d60a08e01358e01614936565b909350915061540760c08d016151e5565b90509295989b509295989b9093969950565b60006020828403121561542b57600080fd5b61094882614fa7565b918252602082015260400190565b6000615450614e5684614e12565b8381529050602080820190600585901b84018681111561546f57600080fd5b845b818110156155025780356001600160401b03808211156154915760008081fd5b8188019150601f8a818401126154a75760008081fd5b8235828111156154b9576154b9614d81565b6154ca818301601f19168801614de2565b92508083528b878286010111156154e357600091508182fd5b8087850188850137600090830187015250855250928201928201615471565b505050509392505050565b6000610948368484615442565b634e487b7160e01b600052603260045260246000fd5b600082601f83011261554157600080fd5b81356020615551614e5683614e12565b8083825260208201915060208460051b87010193508684111561557357600080fd5b602086015b84811015614ea75780358352918301918301615578565b600082601f8301126155a057600080fd5b61094883833560208501615442565b600061010082360312156155c257600080fd5b6155ca614d97565b8235815260208301356020820152604083013560408201526155ee60608401614ab9565b606082015260808301356001600160401b038082111561560d57600080fd5b61561936838701614eb2565b608084015260a085013591508082111561563257600080fd5b61563e36838701615530565b60a084015260c085013591508082111561565757600080fd5b6156633683870161558f565b60c084015260e085013591508082111561567c57600080fd5b5061568936828601615530565b60e08301525092915050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761094b5761094b615695565b8082018082111561094b5761094b615695565b8181038181111561094b5761094b615695565b60008261570557634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031991909116815260200190565b6000808335601e1984360301811261573657600080fd5b8301803591506001600160401b0382111561575057600080fd5b6020019150600581901b3603821315611f8157600080fd5b600060e0823603121561577a57600080fd5b615782614dc0565b823581526020830135602082015261579c60408401614ab9565b604082015260608301356001600160401b03808211156157bb57600080fd5b6157c736838701614e35565b606084015260808501359150808211156157e057600080fd5b6157ec36838701615530565b608084015260a085013591508082111561580557600080fd5b6158113683870161558f565b60a084015260c085013591508082111561582a57600080fd5b5061583736828601615530565b60c08301525092915050565b602081016010831061585757615857614be0565b91905290565b6001600160e01b03198316815260408101600b831061587e5761587e614be0565b8260208301529392505050565b6001600160601b03818116838216019080821115610ce157610ce1615695565b60008151808452602080850194506020840160005b83811015614a9b5781511515875295820195908201906001016158c0565b6060815260006158f16060830186614a61565b828103602084015261590381866152a1565b905082810360408401526121b781856158ab565b60808152600061592a60808301876158ab565b828103602084015261593c81876152a1565b905082810360408401526159508186614a61565b90508281036060840152613f608185614a61565b6001600160e01b03199390931683526020830191909152604082015260600190565b60008151808452602080850194506020840160005b83811015614a9b5781518752958201959082019060010161599b565b60005b838110156159d25781810151838201526020016159ba565b50506000910152565b600081518084526159f38160208601602086016159b7565b601f01601f19169290920160200192915050565b60008282518085526020808601955060208260051b8401016020860160005b84811015615a5457601f19868403018952615a428383516159db565b98840198925090830190600101615a26565b5090979650505050505050565b60006101008251845260208301516020850152604083015160408501526060830151615a906060860182614a54565b506080830151816080860152615aa882860182614a61565b91505060a083015184820360a0860152615ac28282615986565b91505060c083015184820360c0860152615adc8282615a07565b91505060e083015184820360e0860152615af68282615986565b95945050505050565b604081526000615b126040830185615a61565b905060018060a01b03831660208301529392505050565b60008151808452602080850194506020840160005b83811015614a9b57815160068110615b5857615b58614be0565b87529582019590820190600101615b3e565b608081526000615b7d6080830187615a61565b8560208401528281036040840152845181526020850151602082015260018060a01b036040860151166040820152606085015160e06060830152615bc460e0830182615b29565b905060808601518282036080840152615bdd8282615986565b91505060a086015182820360a0840152615bf78282615a07565b91505060c086015182820360c0840152615c118282615986565b9350505050615af66060830184614a54565b600060018201615c3557615c35615695565b5060010190565b634e487b7160e01b600052603160045260246000fd5b604081526000615c656040830185614a61565b8281036020840152615af681856158ab565b604081526000615c8a60408301856158ab565b8281036020840152615af68185614a61565b6001600160a01b03841681526001600160e01b031983166020820152606060408201819052600090615af6908301846159db565b60008251615ce28184602087016159b7565b9190910192915050565b60208152600061094860208301846159db565b6001600160e01b03199290921682526001600160a01b0316602082015260400190565b600060208284031215615d3457600080fd5b8151801515811461162657600080fd5b604081526000615d5760408301856158ab565b8281036020840152615af68185615a07565b600060208284031215615d7b57600080fd5b610948826151e5565b803560ff8116811461109757600080fd5b600060208284031215615da757600080fd5b61094882615d84565b600060608284031215615dc257600080fd5b604051606081016001600160401b0381118282101715615de457615de4614d81565b604052615df083615d84565b815260208301356020820152604083013560408201528091505092915050565b6040810161587e8285614bf6565b6001600160e01b0319831681528151600090615e418160048501602087016159b7565b919091016004019392505050565b608081526000615e6260808301876159db565b8281036020840152615e748187614a61565b90508281036040840152615e8881866158ab565b90508281036060840152613f608185615a07565b82815260406020820152600061071e60408301846159db56fee5af2d3fb7bcab8f865476bc675bf1bbb8b5a749c827ee1cd215dc9c2b8f92d73617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92effa2646970667358221220fbc7cf0cc42a480ef3d40d76fe731fb7fad911d9e6f97db06cb768d5fde5e16d64736f6c63430008170033", + "nonce": "0x2f123" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CALL", + "contractName": "src/extensions/TransparentUpgradeableProxyV2.sol:TransparentUpgradeableProxyV2", + "contractAddress": "0xD05A72c0A593983Aa8336C997736e2172E745fF1", + "function": "upgradeTo(address)", + "arguments": [ + "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF" + ], + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "to": "0xd05a72c0a593983aa8336c997736e2172e745ff1", + "gas": "0xfea6", + "value": "0x0", + "data": "0x3659cfe60000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf", + "nonce": "0x2f124" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CALL", + "contractName": "src/extensions/TransparentUpgradeableProxyV2.sol:TransparentUpgradeableProxyV2", + "contractAddress": "0xD05A72c0A593983Aa8336C997736e2172E745fF1", + "function": "changeAdmin(address)", + "arguments": [ + "0xb0507f2f22697022eCb25963a00D3D076dAc5753" + ], + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "to": "0xd05a72c0a593983aa8336c997736e2172e745ff1", + "gas": "0x10116", + "value": "0x0", + "data": "0x8f283970000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac5753", + "nonce": "0x2f125" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1713240478, + "chain": 2021, + "multi": false, + "commit": "6964a97" +} \ No newline at end of file diff --git a/broadcast/20240411-p1-deploy-ronin-bridge-manager.s.sol/2021/run-1713240671.json b/broadcast/20240411-p1-deploy-ronin-bridge-manager.s.sol/2021/run-1713240671.json new file mode 100644 index 00000000..c9be81eb --- /dev/null +++ b/broadcast/20240411-p1-deploy-ronin-bridge-manager.s.sol/2021/run-1713240671.json @@ -0,0 +1,118 @@ +{ + "transactions": [ + { + "hash": "0x32330f2782488f77d3a5754841fe7628ae853c71cc9be98bc58221d40d6b7022", + "transactionType": "CREATE", + "contractName": "RoninBridgeManagerConstructor", + "contractAddress": "0xD05A72c0A593983Aa8336C997736e2172E745fF1", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x637700", + "value": "0x0", + "data": "0x60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61398280620000f46000396000f3fe608060405234801561001057600080fd5b50600436106101965760003560e01c806301a5f43f1461019b57806306aba0e1146101b05780630a44fa43146101cb5780630f7c3189146101de5780631c905e39146101f35780631f425338146102155780632c5e6520146102285780632d6d7d731461024b57806334d5f37b1461025e57806335da81211461027e5780633644e515146102915780637d4c1d781461029a5780637de5dedd146102ad5780637f7fe058146102b5578063800eaab3146102d5578063828fc1a1146102e8578063865e6fd3146102fb578063901979d51461030e5780639b19dbfd14610339578063a64a838014610341578063aee1767f14610354578063b384abef14610367578063b405aaf2146103c2578063b9c36209146103d5578063bc4e068f146103e8578063c441c4a8146103fb578063cc7e6b3b14610412578063d0a50db014610432578063d78392f81461043a578063dafae4081461044d578063de981f1b14610460578063e75235b814610473578063e9c0349814610490578063f80b5352146104a3575b600080fd5b6101ae6101a9366004612d91565b6104ab565b005b6101b861055a565b6040519081526020015b60405180910390f35b6101b86101d9366004612e2a565b610569565b6101e66105ee565b6040516101c29190612eb0565b610206610201366004612ec3565b610600565b6040516101c293929190612efb565b6101ae610223366004612e2a565b61061c565b61023b610236366004612fce565b6106bb565b60405190151581526020016101c2565b6101e6610259366004612e2a565b6106c8565b6101b861026c366004613003565b60026020526000908152604090205481565b6101ae61028c366004612e2a565b61070f565b6101b860015481565b6101ae6102a83660046131dd565b610757565b6101b8610893565b6102c86102c3366004613317565b6108e9565b6040516101c29190613332565b6101ae6102e3366004613346565b61095c565b61023b6102f63660046133a9565b610994565b6101ae6103093660046133e4565b6109a2565b61032161031c366004613317565b6109bd565b6040516001600160601b0390911681526020016101c2565b6101e66109f3565b6101ae61034f366004613003565b610a5e565b6102c8610362366004613317565b610a72565b6103b1610375366004612ec3565b600360208181526000938452604080852090915291835291208054600182015460028301549383015460069093015460ff909216939092909185565b6040516101c295949392919061340e565b61023b6103d0366004613317565b610a84565b6101ae6103e3366004612ec3565b610abc565b6102066103f6366004613003565b610ace565b610403610aeb565b6040516101c29392919061347d565b610425610420366004612e2a565b610bc5565b6040516101c291906134c0565b6101b8610c03565b610321610448366004613317565b610c16565b61023b61045b366004613003565b610c21565b6102c861046e3660046134d3565b610c5d565b61047b610cbf565b604080519283526020830191909152016101c2565b6101ae61049e366004612e2a565b610ce1565b6101e6610d2a565b6104b3610d8d565b61055186868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808a0282810182019093528982529093508992508891829185019084908082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250610de992505050565b50505050505050565b600061056461114b565b905090565b60008282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506105aa925083915061115e9050565b6105e684848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061119392505050565b949350505050565b60606105646105fb611218565b61123c565b606080606061060f8585611250565b9250925092509250925092565b610624610d8d565b818180806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610663925083915061115e9050565b600061066d611218565b905060005b838110156106b4576106ab85858381811061068f5761068f6134ee565b90506020020160208101906106a49190613317565b8390611639565b50600101610672565b5050505050565b60006105e684848461164e565b606061070683838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250611684915050565b90505b92915050565b610717610d8d565b6107538282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506117d792505050565b5050565b600054610100900460ff16158080156107775750600054600160ff909116105b806107915750303b158015610791575060005460ff166001145b6107f95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff19166001179055801561081c576000805461ff0019166101001790555b61082589611892565b61082f83836118c2565b61083f8c8c8c8b8b8b8b8b6118f3565b8015610885576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050505050565b60008061089e611944565b90506000806108ab610cbf565b91509150806001828560040154856108c3919061351a565b6108cd9190613531565b6108d79190613544565b6108e19190613557565b935050505090565b60008060006108ff6108f9611944565b85611968565b9150915081610923578360405163141e2e1f60e11b81526004016107f09190613332565b61092b611944565b600101818154811061093f5761093f6134ee565b6000918252602090912001546001600160a01b0316949350505050565b33301461098a576000356001600160e01b0319166040516307337e1960e41b81526004016107f09190613579565b61075382826119cd565b60006107066000848461164e565b6109aa610d8d565b6109b381611a76565b6107538282611aa3565b6000806109c8611944565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b031690565b60606109fd611944565b600101805480602002602001604051908101604052809291908181526020018280548015610a5457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610a36575b5050505050905090565b610a66610d8d565b610a6f81611b2e565b50565b6000610a7d82611b9b565b5092915050565b600080610a8f611944565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b0316151590565b610ac4610d8d565b6107538282611c12565b6060806060610ade600085611250565b9250925092509193909250565b60608060606000610afa611944565b805460408051602080840282018101909252828152929350839190830182828015610b4e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b30575b5050505050935080600101805480602002602001604051908101604052809291908181526020018280548015610bad57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b8f575b50505050509250610bbd84611cc4565b915050909192565b6060610706838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611cc492505050565b6000610c0d611944565b60010154919050565b600061070982611db0565b600080610c2c611de5565b9050610c3661114b565b8160010154610c45919061351a565b6002820154610c54908561351a565b10159392505050565b6000610c67611e09565b600083600f811115610c7b57610c7b612ee5565b60ff1681526020810191909152604001600020546001600160a01b0316905080610cba578160405163409140df60e11b81526004016107f0919061358e565b919050565b6000806000610ccc611de5565b90508060010154816002015492509250509091565b610ce9610d8d565b610d25828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611e2d92505050565b505050565b6060610d34611944565b805460408051602080840282018101909252828152929190830182828015610a54576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610a36575050505050905090565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610de7576000356001600160e01b0319166001604051620f948f60ea1b81526004016107f09291906135a8565b565b6060610df58383612213565b610dfe8161115e565b6000610e08611944565b845187519192509081148015610e1e5750855181145b610e49576000356001600160e01b0319166040516306b5667560e21b81526004016107f09190613579565b806001600160401b03811115610e6157610e6161301c565b604051908082528060200260200182016040528015610e8a578160200160208202803683370190505b50935080600003610e9c575050611143565b60008060008060005b858110156110af578a8181518110610ebf57610ebf6134ee565b60200260200101519450898181518110610edb57610edb6134ee565b602002602001015193508b8181518110610ef757610ef76134ee565b60200260200101519250610f0a8561231d565b610f138461231d565b826001600160601b0316600003610f4b576000356001600160e01b031916604051637f11b8a360e11b81526004016107f09190613579565b6001600160a01b03808616600081815260038a01602090815260408083205494891683528083205460028d0190925280832054938352909120546001600160601b039384169391821692610fa39290811691166135d6565b610fad91906135d6565b610fb791906135d6565b6001600160601b0316600014898281518110610fd557610fd56134ee565b602002602001019015159081151581525050888181518110610ff957610ff96134ee565b6020026020010151156110a7578654600181810189556000898152602080822090930180546001600160a01b03808b166001600160a01b0319928316811790935591835260028c018552604080842080546001600160601b038b166001600160601b03199182168117909255868f018054978801815586528786209096018054948c1694909316841790925591835260038c0190945290208054909116821790556110a49083613531565b91505b600101610ea5565b50808660040160008282546110c49190613531565b90915550506040516110ff906347c28ec560e11b906110eb908c908f908d90602001613629565b604051602081830303815290604052612352565b7f897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b78888c8c8c6040516111349493929190613662565b60405180910390a15050505050505b509392505050565b6000611155611944565b60040154905090565b6111678161237f565b15610a6f576000356001600160e01b031916604051630d697db160e11b81526004016107f09190613579565b60008161119f8161115e565b60006111a9611944565b905060005b8451811015611210578160020160008683815181106111cf576111cf6134ee565b6020908102919091018101516001600160a01b0316825281019190915260400160002054611206906001600160601b031685613531565b93506001016111ae565b505050919050565b7f5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd97624090565b606060006112498361241e565b9392505050565b600082815260036020908152604080832084845290915281206004810154600582015460609384938493909290916112888284613531565b9050806001600160401b038111156112a2576112a261301c565b6040519080825280602002602001820160405280156112cb578160200160208202803683370190505b509550806001600160401b038111156112e6576112e661301c565b60405190808252806020026020018201604052801561133157816020015b60408051606081018252600080825260208083018290529282015282526000199092019101816113045790505b509450806001600160401b0381111561134c5761134c61301c565b604051908082528060200260200182016040528015611375578160200160208202803683370190505b50965060005b838110156114ca576000878281518110611397576113976134ee565b602002602001019060018111156113b0576113b0612ee5565b908160018111156113c3576113c3612ee5565b90525060008a81526003602090815260408083208c8452909152812060048701805460079092019291849081106113fc576113fc6134ee565b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815460ff1681526001820154938101939093526002015490820152865187908390811061145a5761145a6134ee565b602002602001018190525084600401818154811061147a5761147a6134ee565b9060005260206000200160009054906101000a90046001600160a01b03168882815181106114aa576114aa6134ee565b6001600160a01b039092166020928302919091019091015260010161137b565b5060005b8281101561162d576001876114e38684613531565b815181106114f3576114f36134ee565b6020026020010190600181111561150c5761150c612ee5565b9081600181111561151f5761151f612ee5565b90525060008a81526003602090815260408083208c845290915281206005870180546007909201929184908110611558576115586134ee565b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815460ff1681526001820154938101939093526002015490820152866115ad8684613531565b815181106115bd576115bd6134ee565b60200260200101819052508460050181815481106115dd576115dd6134ee565b6000918252602090912001546001600160a01b0316886115fd8684613531565b8151811061160d5761160d6134ee565b6001600160a01b03909216602092830291909101909101526001016114ce565b50505050509250925092565b6000610706836001600160a01b03841661247a565b600083815260036020908152604080832085845282528083206001600160a01b038516845260080190915281205460ff166105e6565b606082516001600160401b0381111561169f5761169f61301c565b6040519080825280602002602001820160405280156116c8578160200160208202803683370190505b50905060005b8351811015610a7d57600560008583815181106116ed576116ed6134ee565b6020026020010151600581111561170657611706612ee5565b600581111561171757611717612ee5565b815260200190815260200160002060009054906101000a90046001600160a01b031682828151811061174b5761174b6134ee565b60200260200101906001600160a01b031690816001600160a01b0316815250508280156117a3575060006001600160a01b0316828281518110611790576117906134ee565b60200260200101516001600160a01b0316145b156117cf576000356001600160e01b03191660405163053265f160e01b81526004016107f09190613579565b6001016116ce565b806117e18161115e565b60006117eb611218565b905060008060005b855181101561188a5785818151811061180e5761180e6134ee565b6020026020010151925061182183611a76565b611832836312c0151560e21b61256d565b61183c8484612700565b604080516001600160a01b038616815282151560208201529193507fb85c58eeff9fe423669ae0841666f4c8499e8731b8275eb462e4fa1720ec420e910160405180910390a16001016117f3565b505050505050565b600054610100900460ff166118b95760405162461bcd60e51b81526004016107f0906136ba565b610a6f81612715565b600054610100900460ff166118e95760405162461bcd60e51b81526004016107f0906136ba565b6107538282612745565b600054610100900460ff1661191a5760405162461bcd60e51b81526004016107f0906136ba565b6119248888612777565b61192d846127b8565b61193a86868585856127e8565b5050505050505050565b7fc648703095712c0419b6431ae642c061f0a105ac2d7c3d9604061ef4ebc3830090565b60008060005b84548110156119bb57848181548110611989576119896134ee565b6000918252602090912001546001600160a01b03908116908516036119b3576001925090506119c6565b60010161196e565b506000600019915091505b9250929050565b60005b8251811015610d2557306001600160a01b03168282815181106119f5576119f56134ee565b60200260200101516001600160a01b031603611a32576000356001600160e01b03191660405163053265f160e01b81526004016107f09190613579565b611a6e838281518110611a4757611a476134ee565b6020026020010151838381518110611a6157611a616134ee565b6020026020010151612912565b6001016119d0565b806001600160a01b03163b600003610a6f5780604051630bfc64a360e21b81526004016107f09190613332565b80611aac611e09565b600084600f811115611ac057611ac0612ee5565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115611b0157611b01612ee5565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b6003811015611b50576040516305f4dee960e31b815260040160405180910390fd5b6000611b5a611944565b600581018390556040518381529091507f22d5bb5059ffe2949a098666fc198587200c8118483074120d3ca7050c7753f19060200160405180910390a15050565b600080600080611bb5611bac611944565b60010186611968565b9150915081611bd957846040516326527e1760e01b81526004016107f09190613332565b611be1611944565b805482908110611bf357611bf36134ee565b6000918252602090912001546001600160a01b03169590945092505050565b80821180611c21575060018111155b15611c4d576000356001600160e01b0319166040516387f6f09560e01b81526004016107f09190613579565b6000611c57611de5565b6001810180546002830180549287905585905582549293509184908690856000611c8083613705565b9091555060408051868152602081018690527f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a45050505050565b60606000611cd0611944565b905082516001600160401b03811115611ceb57611ceb61301c565b604051908082528060200260200182016040528015611d14578160200160208202803683370190505b50915060005b8351811015611da957816002016000858381518110611d3b57611d3b6134ee565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160601b0316838281518110611d8957611d896134ee565b6001600160601b0390921660209283029190910190910152600101611d1a565b5050919050565b6000611dba611944565b6001600160a01b0390921660009081526002929092016020525060409020546001600160601b031690565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f0090565b7fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb90565b606081611e398161115e565b6000611e43611944565b8451909150806001600160401b03811115611e6057611e6061301c565b604051908082528060200260200182016040528015611e89578160200160208202803683370190505b50935080600003611e9b57505061220d565b60058201548254611ead908390613544565b1015611ecc5760405163b2e765cb60e01b815260040160405180910390fd5b60008060008060005b8581101561219357898181518110611eef57611eef6134ee565b60200260200101519350611f0284611b9b565b9095509150611f108561231d565b611f198461231d565b6001600160a01b03851660009081526002880160205260409020546001600160601b031615801590611f6d57506001600160a01b03841660009081526003880160205260409020546001600160601b031615155b898281518110611f7f57611f7f6134ee565b602002602001019015159081151581525050888181518110611fa357611fa36134ee565b60200260200101511561218b576001600160a01b038516600090815260028801602052604081205488546001600160601b039091169190611fe690600190613544565b9050886000018181548110611ffd57611ffd6134ee565b60009182526020909120015489546001600160a01b03909116908a9086908110612029576120296134ee565b600091825260209091200180546001600160a01b0319166001600160a01b039290921691909117905588548990806120635761206361371e565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038916825260028b0190526040902080546001600160601b0319169055600189018054829081106120c3576120c36134ee565b60009182526020909120015460018a0180546001600160a01b0390921691869081106120f1576120f16134ee565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550886001018054806121325761213261371e565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038816825260038b0190526040902080546001600160601b03191690556121868286613531565b945050505b600101611ed5565b50818660040160008282546121a89190613544565b90915550506040516121cd90636242a4ef60e11b906110eb908c908c90602001613734565b7fdf3dcd7987202f64648f3acdbf12401e3a2bb23e77e19f99826b5475cbb86369888a6040516121fe929190613762565b60405180910390a15050505050505b50919050565b81518151606091908082016001600160401b038111156122355761223561301c565b60405190808252806020026020018201604052801561225e578160200160208202803683370190505b50925060005b828110156122b85785818151811061227e5761227e6134ee565b6020026020010151848281518110612298576122986134ee565b6001600160a01b0390921660209283029190910190910152600101612264565b60005b82811015612313578581815181106122d5576122d56134ee565b60200260200101518583815181106122ef576122ef6134ee565b6001600160a01b0390921660209283029190910190910152600191820191016122bb565b5050505092915050565b6001600160a01b038116610a6f576000356001600160e01b03191660405163104c66df60e31b81526004016107f09190613579565b61235c82826129a5565b610753573382826040516319b5fdcb60e31b81526004016107f0939291906137d7565b6000815160000361239257506000919050565b60005b600183510381101561241557600181015b835181101561240c578381815181106123c1576123c16134ee565b60200260200101516001600160a01b03168483815181106123e4576123e46134ee565b60200260200101516001600160a01b031603612404575060019392505050565b6001016123a6565b50600101612395565b50600092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561246e57602002820191906000526020600020905b81548152602001906001019080831161245a575b50505050509050919050565b6000818152600183016020526040812054801561256357600061249e600183613544565b85549091506000906124b290600190613544565b90508181146125175760008660000182815481106124d2576124d26134ee565b90600052602060002001549050808760000184815481106124f5576124f56134ee565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806125285761252861371e565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610709565b6000915050610709565b6000816040516024016125809190613579565b60408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b1790525190915060009081906001600160a01b038616906125c990859061380b565b600060405180830381855afa9150503d8060008114612604576040519150601f19603f3d011682016040523d82523d6000602084013e612609565b606091505b5091509150816126cb57846001600160a01b03168360405160240161262e9190613827565b60408051601f198184030181529181526020820180516001600160e01b03166325da93a560e11b17905251612663919061380b565b600060405180830381855afa9150503d806000811461269e576040519150601f19603f3d011682016040523d82523d6000602084013e6126a3565b606091505b509092509050816126cb57838560405163069d427960e11b81526004016107f092919061383a565b808060200190518101906126df919061385d565b6106b457838560405163069d427960e11b81526004016107f092919061383a565b6000610706836001600160a01b038416612ccb565b600054610100900460ff1661273c5760405162461bcd60e51b81526004016107f0906136ba565b610a6f81612d1a565b600054610100900460ff1661276c5760405162461bcd60e51b81526004016107f0906136ba565b61098a600030612912565b600054610100900460ff1661279e5760405162461bcd60e51b81526004016107f0906136ba565b60006127a8611de5565b600181559050610d258383611c12565b600054610100900460ff166127df5760405162461bcd60e51b81526004016107f0906136ba565b610a6f816117d7565b600054610100900460ff1661280f5760405162461bcd60e51b81526004016107f0906136ba565b61281a600285611aa3565b604080516020808201839052600e60608301526d212924a223a2afa6a0a720a3a2a960911b6080808401919091528284018990528351808403909101815260a0830184528051908201207f599a80fcaa47b95e2323ab4d34d34e0cc9feda4b843edafcc30c7bdf60ea15bf60c08401527fe4d2346818310a10fac5a6d073d3dce255578caf4aa81ddcbcc7c2b98405eef060e08401527f2a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4de61010084015261012080840191909152835180840390910181526101409092019092528051910120600155612907818385610de9565b506106b46003611b2e565b806005600084600581111561292957612929612ee5565b600581111561293a5761293a612ee5565b8152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600581111561297857612978612ee5565b6040517f356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d90600090a35050565b600160006129b46105fb611218565b805190915060008190036129c9575050610709565b6000816001600160401b038111156129e3576129e361301c565b604051908082528060200260200182016040528015612a0c578160200160208202803683370190505b5090506000826001600160401b03811115612a2957612a2961301c565b604051908082528060200260200182016040528015612a5c57816020015b6060815260200190600190039081612a475790505b50905060008787604051602001612a7492919061387f565b6040516020818303038152906040529050600081604051602401612a989190613827565b60408051601f198184030181529190526020810180516001600160e01b03166325da93a560e11b179052905060005b85811015612c8157868181518110612ae157612ae16134ee565b60200260200101516001600160a01b031683604051612b00919061380b565b6000604051808303816000865af19150503d8060008114612b3d576040519150601f19603f3d011682016040523d82523d6000602084013e612b42565b606091505b50868381518110612b5557612b556134ee565b60200260200101868481518110612b6e57612b6e6134ee565b6020026020010182905282151515158152505050848181518110612b9457612b946134ee565b6020026020010151612c7957868181518110612bb257612bb26134ee565b60200260200101516001600160a01b031682604051612bd1919061380b565b6000604051808303816000865af19150503d8060008114612c0e576040519150601f19603f3d011682016040523d82523d6000602084013e612c13565b606091505b50868381518110612c2657612c266134ee565b60200260200101868481518110612c3f57612c3f6134ee565b6020026020010182905282151515158152505050878015612c765750848181518110612c6d57612c6d6134ee565b60200260200101515b97505b600101612ac7565b507fc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b6382878686604051612cb794939291906138b0565b60405180910390a150505050505092915050565b6000818152600183016020526040812054612d1257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610709565b506000610709565b600481905560405181907fe5cd1c123a8cf63fa1b7229678db61fe8ae99dbbd27889370b6667c8cae97da190600090a250565b60008083601f840112612d5f57600080fd5b5081356001600160401b03811115612d7657600080fd5b6020830191508360208260051b85010111156119c657600080fd5b60008060008060008060608789031215612daa57600080fd5b86356001600160401b0380821115612dc157600080fd5b612dcd8a838b01612d4d565b90985096506020890135915080821115612de657600080fd5b612df28a838b01612d4d565b90965094506040890135915080821115612e0b57600080fd5b50612e1889828a01612d4d565b979a9699509497509295939492505050565b60008060208385031215612e3d57600080fd5b82356001600160401b03811115612e5357600080fd5b612e5f85828601612d4d565b90969095509350505050565b60008151808452602080850194506020840160005b83811015612ea55781516001600160a01b031687529582019590820190600101612e80565b509495945050505050565b6020815260006107066020830184612e6b565b60008060408385031215612ed657600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60006060808352612f0f6060840187612e6b565b83810360208581019190915286518083528782019282019060005b81811015612f5657845160028110612f4457612f44612ee5565b83529383019391830191600101612f2a565b50506040925085810360408701528087518083528383019150838901925060005b81811015612fa7578351805160ff1684528581015186850152860151868401529284019291860191600101612f77565b50909a9950505050505050505050565b80356001600160a01b0381168114610cba57600080fd5b600080600060608486031215612fe357600080fd5b8335925060208401359150612ffa60408501612fb7565b90509250925092565b60006020828403121561301557600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561305a5761305a61301c565b604052919050565b60006001600160401b0382111561307b5761307b61301c565b5060051b60200190565b600082601f83011261309657600080fd5b813560206130ab6130a683613062565b613032565b8083825260208201915060208460051b8701019350868411156130cd57600080fd5b602086015b848110156130f0576130e381612fb7565b83529183019183016130d2565b509695505050505050565b600082601f83011261310c57600080fd5b8135602061311c6130a683613062565b8083825260208201915060208460051b87010193508684111561313e57600080fd5b602086015b848110156130f05780356001600160601b03811681146131635760008081fd5b8352918301918301613143565b600082601f83011261318157600080fd5b813560206131916130a683613062565b8083825260208201915060208460051b8701019350868411156131b357600080fd5b602086015b848110156130f0578035600681106131d05760008081fd5b83529183019183016131b8565b60008060008060008060008060008060006101608c8e0312156131ff57600080fd5b8b359a5060208c0135995060408c0135985060608c0135975061322460808d01612fb7565b96506001600160401b0360a08d013581101561323f57600080fd5b61324f8e60a08f01358f01613085565b96508060c08e0135111561326257600080fd5b6132728e60c08f01358f01613085565b95508060e08e0135111561328557600080fd5b6132958e60e08f01358f01613085565b9450806101008e013511156132a957600080fd5b6132ba8e6101008f01358f016130fb565b9350806101208e013511156132ce57600080fd5b6132df8e6101208f01358f01613170565b9250806101408e013511156132f357600080fd5b506133058d6101408e01358e01613085565b90509295989b509295989b9093969950565b60006020828403121561332957600080fd5b61070682612fb7565b6001600160a01b0391909116815260200190565b6000806040838503121561335957600080fd5b82356001600160401b038082111561337057600080fd5b61337c86838701613170565b9350602085013591508082111561339257600080fd5b5061339f85828601613085565b9150509250929050565b600080604083850312156133bc57600080fd5b823591506133cc60208401612fb7565b90509250929050565b803560108110610cba57600080fd5b600080604083850312156133f757600080fd5b613400836133d5565b91506133cc60208401612fb7565b60a081016005871061342257613422612ee5565b95815260208101949094526040840192909252606083015260809091015290565b60008151808452602080850194506020840160005b83811015612ea55781516001600160601b031687529582019590820190600101613458565b6060815260006134906060830186612e6b565b82810360208401526134a28186612e6b565b905082810360408401526134b68185613443565b9695505050505050565b6020815260006107066020830184613443565b6000602082840312156134e557600080fd5b610706826133d5565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761070957610709613504565b8082018082111561070957610709613504565b8181038181111561070957610709613504565b60008261357457634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031991909116815260200190565b60208101601083106135a2576135a2612ee5565b91905290565b6001600160e01b03198316815260408101600b83106135c9576135c9612ee5565b8260208301529392505050565b6001600160601b03818116838216019080821115610a7d57610a7d613504565b60008151808452602080850194506020840160005b83811015612ea557815115158752958201959082019060010161360b565b60608152600061363c6060830186612e6b565b828103602084015261364e8186613443565b905082810360408401526134b681856135f6565b60808152600061367560808301876135f6565b82810360208401526136878187613443565b9050828103604084015261369b8186612e6b565b905082810360608401526136af8185612e6b565b979650505050505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60006001820161371757613717613504565b5060010190565b634e487b7160e01b600052603160045260246000fd5b6040815260006137476040830185612e6b565b828103602084015261375981856135f6565b95945050505050565b60408152600061377560408301856135f6565b82810360208401526137598185612e6b565b60005b838110156137a257818101518382015260200161378a565b50506000910152565b600081518084526137c3816020860160208601613787565b601f01601f19169290920160200192915050565b6001600160a01b03841681526001600160e01b031983166020820152606060408201819052600090613759908301846137ab565b6000825161381d818460208701613787565b9190910192915050565b60208152600061070660208301846137ab565b6001600160e01b03199290921682526001600160a01b0316602082015260400190565b60006020828403121561386f57600080fd5b8151801515811461124957600080fd5b6001600160e01b03198316815281516000906138a2816004850160208701613787565b919091016004019392505050565b6080815260006138c360808301876137ab565b6020838203818501526138d68288612e6b565b915083820360408501526138ea82876135f6565b915083820360608501528185518084528284019150828160051b85010183880160005b8381101561393b57601f198784030185526139298383516137ab565b9486019492509085019060010161390d565b50909b9a505050505050505050505056fea2646970667358221220d83003b43962afe3120b34eb387ecaaf4912a01d9c682ac0fb953cf65d90b77c64736f6c63430008170033", + "nonce": "0x2f122" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x11b14dd94c5c6b85e8581a63e247176240a6fcb8da8df2570508475c2550ec34", + "transactionType": "CREATE", + "contractName": "TransparentUpgradeableProxyV2", + "contractAddress": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "function": null, + "arguments": [ + "0xD05A72c0A593983Aa8336C997736e2172E745fF1", + "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "0x7d4c1d780000000000000000000000000000000000000000000000000000000000000007000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000007e50000000000000000000000000000000000000000000000000000000000127500000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca00000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000003600000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000002e82d2b56f858f79deef11b160bfc4631873da2b000000000000000000000000bcb61783dd2403fe8cc9b89b27b1a9bb03d040cb000000000000000000000000b266bf53cf7eac4e2065a404598dcb0e15e9462c000000000000000000000000cc5fc5b6c8595f56306da736f6cd02ed9141c84a0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000d24d87ddc1917165435b306aac68d99e0f49a3fa000000000000000000000000b033ba62ec622dc54d0abfe0254e79692147ca26000000000000000000000000087d08e3ba42e64e3948962dd1371f906d1278b900000000000000000000000052ec2e6bbce45afff8955da6410bb13812f4289f000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000005000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab95" + ], + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x2b7868", + "value": "0x0", + "data": "0x608060405260405162000eed38038062000eed833981016040819052620000269162000429565b8282828281620000398282600062000053565b506200004790508262000085565b5050505050506200055c565b6200005e83620000f7565b6000825111806200006c5750805b1562000080576200007e838362000139565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f620000c760008051602062000ea6833981519152546001600160a01b031690565b604080516001600160a01b03928316815291841660208301520160405180910390a1620000f48162000168565b50565b620001028162000206565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606062000161838360405180606001604052806027815260200162000ec6602791396200029d565b9392505050565b6001600160a01b038116620001d35760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b8060008051602062000ea68339815191525b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002118162000383565b620002755760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620001ca565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc620001e5565b6060620002aa8462000383565b620003075760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401620001ca565b600080856001600160a01b03168560405162000324919062000509565b600060405180830381855af49150503d806000811462000361576040519150601f19603f3d011682016040523d82523d6000602084013e62000366565b606091505b5090925090506200037982828662000392565b9695505050505050565b6001600160a01b03163b151590565b60608315620003a357508162000161565b825115620003b45782518084602001fd5b8160405162461bcd60e51b8152600401620001ca919062000527565b80516001600160a01b0381168114620003e857600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200042057818101518382015260200162000406565b50506000910152565b6000806000606084860312156200043f57600080fd5b6200044a84620003d0565b92506200045a60208501620003d0565b60408501519092506001600160401b03808211156200047857600080fd5b818601915086601f8301126200048d57600080fd5b815181811115620004a257620004a2620003ed565b604051601f8201601f19908116603f01168101908382118183101715620004cd57620004cd620003ed565b81604052828152896020848701011115620004e757600080fd5b620004fa83602083016020880162000403565b80955050505050509250925092565b600082516200051d81846020870162000403565b9190910192915050565b60208152600082518060208401526200054881604085016020870162000403565b601f01601f19169190910160400192915050565b61093a806200056c6000396000f3fe6080604052600436106100595760003560e01c80633659cfe6146100705780634bb5274a146100905780634f1ef286146100a35780635c60da1b146100b65780638f283970146100e7578063f851a4401461010757610068565b366100685761006661011c565b005b61006661011c565b34801561007c57600080fd5b5061006661008b3660046106c7565b610136565b61006661009e3660046106f8565b610173565b6100666100b13660046107a8565b6101b8565b3480156100c257600080fd5b506100cb61021f565b6040516001600160a01b03909116815260200160405180910390f35b3480156100f357600080fd5b506100666101023660046106c7565b610250565b34801561011357600080fd5b506100cb610270565b610124610291565b61013461012f610326565b610330565b565b61013e61034f565b6001600160a01b0316330361016b5761016881604051806020016040528060008152506000610370565b50565b61016861011c565b61017b61034f565b6001600160a01b0316330361016b576000610194610326565b9050600080835160208501845af43d6000803e8080156101b3573d6000f35b3d6000fd5b6101c061034f565b6001600160a01b03163303610217576102128383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525060019250610370915050565b505050565b61021261011c565b600061022961034f565b6001600160a01b0316330361024557610240610326565b905090565b61024d61011c565b90565b61025861034f565b6001600160a01b0316330361016b576101688161039b565b600061027a61034f565b6001600160a01b031633036102455761024061034f565b61029961034f565b6001600160a01b031633036101345760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006102406103ef565b3660008037600080366000845af43d6000803e8080156101b3573d6000f35b600060008051602061089e8339815191525b546001600160a01b0316919050565b61037983610405565b6000825111806103865750805b15610212576103958383610445565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103c461034f565b604080516001600160a01b03928316815291841660208301520160405180910390a161016881610471565b60006000805160206108be833981519152610361565b61040e81610508565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061046a83836040518060600160405280602781526020016108de60279139610588565b9392505050565b6001600160a01b0381166104d65760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b606482015260840161031d565b8060008051602061089e8339815191525b80546001600160a01b0319166001600160a01b039290921691909117905550565b61051181610663565b6105735760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161031d565b806000805160206108be8339815191526104e7565b606061059384610663565b6105ee5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161031d565b600080856001600160a01b031685604051610609919061084e565b600060405180830381855af49150503d8060008114610644576040519150601f19603f3d011682016040523d82523d6000602084013e610649565b606091505b5091509150610659828286610672565b9695505050505050565b6001600160a01b03163b151590565b6060831561068157508161046a565b8251156106915782518084602001fd5b8160405162461bcd60e51b815260040161031d919061086a565b80356001600160a01b03811681146106c257600080fd5b919050565b6000602082840312156106d957600080fd5b61046a826106ab565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561070a57600080fd5b81356001600160401b038082111561072157600080fd5b818401915084601f83011261073557600080fd5b813581811115610747576107476106e2565b604051601f8201601f19908116603f0116810190838211818310171561076f5761076f6106e2565b8160405282815287602084870101111561078857600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000806000604084860312156107bd57600080fd5b6107c6846106ab565b925060208401356001600160401b03808211156107e257600080fd5b818601915086601f8301126107f657600080fd5b81358181111561080557600080fd5b87602082850101111561081757600080fd5b6020830194508093505050509250925092565b60005b8381101561084557818101518382015260200161082d565b50506000910152565b6000825161086081846020870161082a565b9190910192915050565b602081526000825180602084015261088981604085016020870161082a565b601f01601f1916919091016040019291505056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212205d5db908d6bad5bfc298cb89bc49c38963bb1499be9336506651cff965fb333264736f6c63430008170033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564000000000000000000000000d05a72c0a593983aa8336c997736e2172e745ff1000000000000000000000000968d0cd7343f711216817e617d3f92a23dc91c07000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000004e47d4c1d780000000000000000000000000000000000000000000000000000000000000007000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000007e50000000000000000000000000000000000000000000000000000000000127500000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca00000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000003600000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000002e82d2b56f858f79deef11b160bfc4631873da2b000000000000000000000000bcb61783dd2403fe8cc9b89b27b1a9bb03d040cb000000000000000000000000b266bf53cf7eac4e2065a404598dcb0e15e9462c000000000000000000000000cc5fc5b6c8595f56306da736f6cd02ed9141c84a0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000d24d87ddc1917165435b306aac68d99e0f49a3fa000000000000000000000000b033ba62ec622dc54d0abfe0254e79692147ca26000000000000000000000000087d08e3ba42e64e3948962dd1371f906d1278b900000000000000000000000052ec2e6bbce45afff8955da6410bb13812f4289f000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000005000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab9500000000000000000000000000000000000000000000000000000000", + "nonce": "0x2f123" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0xfcd1ca2649e9cba542fd73c3fd0856b6199140862c65eac401c3ebff94085064", + "transactionType": "CREATE", + "contractName": "RoninBridgeManager", + "contractAddress": "0x64D21e91c2Cb367D2972E0bC377CFEa4e55F3685", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0xa304fa", + "value": "0x0", + "data": "0x60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b615f2b80620000f46000396000f3fe608060405234801561001057600080fd5b506004361061020f5760003560e01c806301a5f43f1461021457806306aba0e1146102295780630a44fa43146102445780630f7c31891461025757806315702f051461026c5780631c905e391461027f5780631f425338146102a15780632c5e6520146102b45780632d6d7d73146102d757806334d5f37b146102ea57806335da81211461030a5780633644e5151461031d5780636a61b16c146103265780637de5dedd146103395780637f7fe05814610341578063800eaab314610361578063828fc1a114610374578063865e6fd31461038757806386ccbf121461039a578063901979d5146103ad57806390264e59146103d85780639570abab146103eb57806397d6ae16146103fe5780639a7d3382146104115780639b19dbfd14610424578063a54f8a091461042c578063a64a83801461043f578063aee1767f14610452578063b384abef14610465578063b405aaf2146104c0578063b5d6e110146104d3578063b9c36209146104e6578063bc4e068f146104f9578063bc96180b1461050c578063bc9e0a5514610514578063c441c4a814610527578063cc7e6b3b1461053e578063d0a50db01461055e578063d78392f814610566578063dafae40814610579578063dd1f89141461058c578063de981f1b1461059f578063e75235b8146105b2578063e9c03498146105c8578063f80b5352146105db575b600080fd5b61022761022236600461497a565b6105e3565b005b610231610692565b6040519081526020015b60405180910390f35b610231610252366004614a13565b6106a1565b61025f610726565b60405161023b9190614aa6565b61022761027a366004614ad0565b610738565b61029261028d366004614bbe565b610842565b60405161023b93929190614c0a565b6102276102af366004614a13565b61085e565b6102c76102c2366004614cbd565b6108fd565b604051901515815260200161023b565b61025f6102e5366004614a13565b61090a565b6102316102f8366004614cf2565b60026020526000908152604090205481565b610227610318366004614a13565b610951565b61023160015481565b610227610334366004614d1e565b610999565b6102316109ae565b61035461034f366004614d52565b610a04565b60405161023b9190614d6d565b61022761036f366004614f18565b610a80565b6102c7610382366004614f7b565b610ab8565b610227610395366004614fb6565b610ac6565b6102276103a8366004615024565b610ae1565b6103c06103bb366004614d52565b610aee565b6040516001600160601b03909116815260200161023b565b6102276103e63660046150ca565b610b24565b6102276103f9366004615105565b610b43565b61022761040c366004615024565b610bda565b61022761041f366004614bbe565b610bf1565b61025f610c3e565b61022761043a3660046151f4565b610ca9565b61022761044d366004614cf2565b610cc5565b610354610460366004614d52565b610cd6565b6104af610473366004614bbe565b600360208181526000938452604080852090915291835291208054600182015460028301549383015460069093015460ff909216939092909185565b60405161023b959493929190615238565b6102c76104ce366004614d52565b610ce8565b6102276104e13660046150ca565b610d20565b6102276104f4366004614bbe565b610d2d565b610292610507366004614cf2565b610d3f565b600454610231565b61022761052236600461526d565b610d5c565b61052f610dbb565b60405161023b939291906152db565b61055161054c366004614a13565b610e95565b60405161023b9190615314565b610231610ed3565b6103c0610574366004614d52565b610ee6565b6102c7610587366004614cf2565b610ef1565b61022761059a366004615327565b610f2d565b6103546105ad366004615419565b61103a565b6105ba61109c565b60405161023b929190615434565b6102276105d6366004614a13565b6110be565b61025f611107565b6105eb61116a565b61068986868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808a02828101820190935289825290935089925088918291850190849080828437600092019190915250506040805160208089028281018201909352888252909350889250879182918501908490808284376000920191909152506111c692505050565b50505050505050565b600061069c611528565b905090565b60008282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506106e2925083915061153b9050565b61071e84848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061157092505050565b949350505050565b606061069c6107336115f5565b611619565b6107413361162d565b6108346040518061010001604052806107598e61166f565b81526020018d81526020018c81526020018b6001600160a01b031681526020018a8a808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050908252506040805160208a810282810182019093528a82529283019290918b918b9182918501908490808284376000920191909152505050908252506020016107f4868861550d565b815260200184848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050509152503361171f565b505050505050505050505050565b6060806060610851858561181e565b9250925092509250925092565b61086661116a565b8181808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506108a5925083915061153b9050565b60006108af6115f5565b905060005b838110156108f6576108ed8585838181106108d1576108d161551a565b90506020020160208101906108e69190614d52565b8390611bf5565b506001016108b4565b5050505050565b600061071e848484611c0a565b606061094883838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250611c2d915050565b90505b92915050565b61095961116a565b610995828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611d8092505050565b5050565b6109ab6109a5826155af565b33611e33565b50565b6000806109b9611eff565b90506000806109c661109c565b91509150806001828560040154856109de91906156ab565b6109e891906156c2565b6109f291906156d5565b6109fc91906156e8565b935050505090565b6000806000610a1a610a14611eff565b85611f23565b9150915081610a47578360405163141e2e1f60e11b8152600401610a3e9190614d6d565b60405180910390fd5b610a4f611eff565b6001018181548110610a6357610a6361551a565b6000918252602090912001546001600160a01b0316949350505050565b333014610aae576000356001600160e01b0319166040516307337e1960e41b8152600401610a3e919061570a565b6109958282611f88565b600061094860008484611c0a565b610ace61116a565b610ad781612031565b610995828261205e565b6108f685858585856120e9565b600080610af9611eff565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b031690565b610b2d3361162d565b610b3b858585858533612182565b505050505050565b610b4c3361162d565b610bce8a89898c8a8a80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610b9392508b91508c905061550d565b8888808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152503392506121c1915050565b50505050505050505050565b610be33361162d565b6108f685858585853361231b565b600082815260036020908152604080832084845290915281206001810154909103610c2f5760405163713b099760e11b815260040160405180910390fd5b610c388161233a565b50505050565b6060610c48611eff565b600101805480602002602001604051908101604052809291908181526020018280548015610c9f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610c81575b5050505050905090565b610cb23361162d565b61099533610cbf846155af565b8361254f565b610ccd61116a565b6109ab8161264f565b6000610ce1826126bc565b5092915050565b600080610cf3611eff565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b0316151590565b6108f68585858585612733565b610d3561116a565b61099582826127e9565b6060806060610d4f60008561181e565b9250925092509193909250565b6109ab6109a5610dac610d72606085018561571f565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525060019250611c2d915050565b610db584615768565b9061289b565b60608060606000610dca611eff565b805460408051602080840282018101909252828152929350839190830182828015610e1e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610e00575b5050505050935080600101805480602002602001604051908101604052809291908181526020018280548015610e7d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610e5f575b50505050509250610e8d846129a1565b915050909192565b60606109488383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506129a192505050565b6000610edd611eff565b60010154919050565b600061094b82612a86565b600080610efc612abb565b9050610f06611528565b8160010154610f1591906156ab565b6002820154610f2490856156ab565b10159392505050565b610f363361162d565b6000604051806101000160405280610f4d4661166f565b81526020014681526020018d81526020018c6001600160a01b031681526020018b8b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050908252506040805160208b810282810182019093528b82529283019290918c918c918291850190849080828437600092019190915250505090825250602001610fe8878961550d565b81526020018585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050915250905061102e813361171f565b5061083433828461254f565b6000611044612adf565b600083600f81111561105857611058614be0565b60ff1681526020810191909152604001600020546001600160a01b0316905080611097578160405163409140df60e11b8152600401610a3e9190615843565b919050565b60008060006110a9612abb565b90508060010154816002015492509250509091565b6110c661116a565b611102828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612b0392505050565b505050565b6060611111611eff565b805460408051602080840282018101909252828152929190830182828015610c9f576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610c81575050505050905090565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031633146111c4576000356001600160e01b0319166001604051620f948f60ea1b8152600401610a3e92919061585d565b565b60606111d28383612ee9565b6111db8161153b565b60006111e5611eff565b8451875191925090811480156111fb5750855181145b611226576000356001600160e01b0319166040516306b5667560e21b8152600401610a3e919061570a565b806001600160401b0381111561123e5761123e614d81565b604051908082528060200260200182016040528015611267578160200160208202803683370190505b50935080600003611279575050611520565b60008060008060005b8581101561148c578a818151811061129c5761129c61551a565b602002602001015194508981815181106112b8576112b861551a565b602002602001015193508b81815181106112d4576112d461551a565b602002602001015192506112e785612ff3565b6112f084612ff3565b826001600160601b0316600003611328576000356001600160e01b031916604051637f11b8a360e11b8152600401610a3e919061570a565b6001600160a01b03808616600081815260038a01602090815260408083205494891683528083205460028d0190925280832054938352909120546001600160601b03938416939182169261138092908116911661588b565b61138a919061588b565b611394919061588b565b6001600160601b03166000148982815181106113b2576113b261551a565b6020026020010190151590811515815250508881815181106113d6576113d661551a565b602002602001015115611484578654600181810189556000898152602080822090930180546001600160a01b03808b166001600160a01b0319928316811790935591835260028c018552604080842080546001600160601b038b166001600160601b03199182168117909255868f018054978801815586528786209096018054948c1694909316841790925591835260038c01909452902080549091168217905561148190836156c2565b91505b600101611282565b50808660040160008282546114a191906156c2565b90915550506040516114dc906347c28ec560e11b906114c8908c908f908d906020016158de565b604051602081830303815290604052613028565b7f897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b78888c8c8c6040516115119493929190615917565b60405180910390a15050505050505b509392505050565b6000611532611eff565b60040154905090565b61154481613055565b156109ab576000356001600160e01b031916604051630d697db160e11b8152600401610a3e919061570a565b60008161157c8161153b565b6000611586611eff565b905060005b84518110156115ed578160020160008683815181106115ac576115ac61551a565b6020908102919091018101516001600160a01b03168252810191909152604001600020546115e3906001600160601b0316856156c2565b935060010161158b565b505050919050565b7f5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd97624090565b60606000611626836130f4565b9392505050565b61163681612a86565b6001600160601b03166000036109ab576000356001600160e01b0319166003604051620f948f60ea1b8152600401610a3e92919061585d565b6000818152600260205260408120549081900361169e5750600090815260026020526040902060019081905590565b60008281526003602090815260408083208484529091528120906116c18261233a565b905080611718576000825460ff1660048111156116e0576116e0614be0565b036116fe5760405163757a436360e01b815260040160405180910390fd5b600084815260026020526040902080546001019081905592505b5050919050565b602082015160009080820361175a576000356001600160e01b03191660004660405163092048d160e11b8152600401610a3e93929190615964565b600454611768908590613150565b6000611773856131f1565b905061177e8261166f565b600083815260036020908152604080832084845290915290819020908701519194506117ab91839061333b565b845183146117da576000356001600160e01b03191660405163d4cec26960e01b8152600401610a3e919061570a565b8083837fd1221ffb98610024a29755d7db3c71692310f43a7cfcce7ee488a8c7e9e0bfa4888860405161180e929190615aff565b60405180910390a4505092915050565b6000828152600360209081526040808320848452909152812060048101546005820154606093849384939092909161185682846156c2565b9050806001600160401b0381111561187057611870614d81565b604051908082528060200260200182016040528015611899578160200160208202803683370190505b509550806001600160401b038111156118b4576118b4614d81565b6040519080825280602002602001820160405280156118ed57816020015b6118da614896565b8152602001906001900390816118d25790505b509450806001600160401b0381111561190857611908614d81565b604051908082528060200260200182016040528015611931578160200160208202803683370190505b50965060005b83811015611a865760008782815181106119535761195361551a565b6020026020010190600181111561196c5761196c614be0565b9081600181111561197f5761197f614be0565b90525060008a81526003602090815260408083208c8452909152812060048701805460079092019291849081106119b8576119b861551a565b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815460ff16815260018201549381019390935260020154908201528651879083908110611a1657611a1661551a565b6020026020010181905250846004018181548110611a3657611a3661551a565b9060005260206000200160009054906101000a90046001600160a01b0316888281518110611a6657611a6661551a565b6001600160a01b0390921660209283029190910190910152600101611937565b5060005b82811015611be957600187611a9f86846156c2565b81518110611aaf57611aaf61551a565b60200260200101906001811115611ac857611ac8614be0565b90816001811115611adb57611adb614be0565b90525060008a81526003602090815260408083208c845290915281206005870180546007909201929184908110611b1457611b1461551a565b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815460ff168152600182015493810193909352600201549082015286611b6986846156c2565b81518110611b7957611b7961551a565b6020026020010181905250846005018181548110611b9957611b9961551a565b6000918252602090912001546001600160a01b031688611bb986846156c2565b81518110611bc957611bc961551a565b6001600160a01b0390921660209283029190910190910152600101611a8a565b50505050509250925092565b6000610948836001600160a01b03841661334b565b6000838152600360209081526040808320858452909152812061071e908361343e565b606082516001600160401b03811115611c4857611c48614d81565b604051908082528060200260200182016040528015611c71578160200160208202803683370190505b50905060005b8351811015610ce15760056000858381518110611c9657611c9661551a565b60200260200101516005811115611caf57611caf614be0565b6005811115611cc057611cc0614be0565b815260200190815260200160002060009054906101000a90046001600160a01b0316828281518110611cf457611cf461551a565b60200260200101906001600160a01b031690816001600160a01b031681525050828015611d4c575060006001600160a01b0316828281518110611d3957611d3961551a565b60200260200101516001600160a01b0316145b15611d78576000356001600160e01b03191660405163053265f160e01b8152600401610a3e919061570a565b600101611c77565b80611d8a8161153b565b6000611d946115f5565b905060008060005b8551811015610b3b57858181518110611db757611db761551a565b60200260200101519250611dca83612031565b611ddb836312c0151560e21b613460565b611de584846135f3565b604080516001600160a01b038616815282151560208201529193507fb85c58eeff9fe423669ae0841666f4c8499e8731b8275eb462e4fa1720ec420e910160405180910390a1600101611d9c565b6000611e3e836131f1565b602080850151600090815260038252604080822087518352909252206001810154919250908214611e89576001810154604051632bee7fdb60e21b8152610a3e918491600401615434565b6001815460ff166004811115611ea157611ea1614be0565b14611ebf57604051632c2f3bdf60e01b815260040160405180910390fd5b83606001516001600160a01b0316836001600160a01b031614611ef55760405163e61090ab60e01b815260040160405180910390fd5b610c388185613608565b7fc648703095712c0419b6431ae642c061f0a105ac2d7c3d9604061ef4ebc3830090565b60008060005b8454811015611f7657848181548110611f4457611f4461551a565b6000918252602090912001546001600160a01b0390811690851603611f6e57600192509050611f81565b600101611f29565b506000600019915091505b9250929050565b60005b825181101561110257306001600160a01b0316828281518110611fb057611fb061551a565b60200260200101516001600160a01b031603611fed576000356001600160e01b03191660405163053265f160e01b8152600401610a3e919061570a565b6120298382815181106120025761200261551a565b602002602001015183838151811061201c5761201c61551a565b6020026020010151613675565b600101611f8b565b806001600160a01b03163b6000036109ab5780604051630bfc64a360e21b8152600401610a3e9190614d6d565b80612067612adf565b600084600f81111561207b5761207b614be0565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f8111156120bc576120bc614be0565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b60006120fc6120f7876155af565b6131f1565b60208088013560009081526003825260408082208a3583529092522060010154909150811461216157602080870135600090815260038252604080822089358352909252819020600101549051632bee7fdb60e21b8152610a3e918391600401615434565b610b3b61216d876155af565b8686868661217d6120f78d6155af565b613708565b61218a6148b6565b61219c61219688615768565b836139d1565b90506121b7818787878761217d6121b28e615768565b613abe565b9695505050505050565b60006121cd600061166f565b905060006040518060e001604052808381526020018b8152602001886001600160a01b031681526020018a8a80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093855250505060208083018a905260408084018a9052606090930188905282518c820281810183019094528c8152939450909261228d92612286928e918e9182919085019084908082843760009201919091525060019250611c2d915050565b839061289b565b90506122a46004548261315090919063ffffffff16565b60006122af826131f1565b6000858152600080516020615ed6833981519152602052604090209091506122d890828e61333b565b8084600080516020615eb6833981519152846122f387613abe565b878a6040516123059493929190615b6a565b60405180910390a3505050505050505050505050565b61232d612327876155af565b8261171f565b50610b3b61216d876155af565b600080825460ff16600481111561235357612353614be0565b148015612364575042826006015411155b905080156110975760018201546040517f58f98006a7f2f253f8ae8f8b7cec9008ca05359633561cd7c22f3005682d4a5590600090a260005b6004830154811015612450578260080160008460040183815481106123c4576123c461551a565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff19169055600484018054600786019291908490811061240d5761240d61551a565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff1916815560018181018390556002909101919091550161239d565b5060005b60058301548110156125075782600801600084600501838154811061247b5761247b61551a565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff1916905560058401805460078601929190849081106124c4576124c461551a565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff19168155600181810183905560029091019190915501612454565b50815460ff191682556000600183018190556002830181905560038301819055612535906004840190614904565b612543600583016000614904565b60006006830155919050565b4682602001511461258857602082015160405163092048d160e11b8152610a3e916001600160e01b031960003516914690600401615964565b6000612593836131f1565b602080850151600090815260038252604080822087518352909252206001015490915081146125f857602080840151600090815260038252604080822086518352909252819020600101549051632bee7fdb60e21b8152610a3e918391600401615434565b6000612602613bfd565b905060008161260f613c07565b61261991906156d5565b6126249060016156c2565b905061262e614896565b612645868685858b866126408e613c11565b613c2b565b5050505050505050565b6003811015612671576040516305f4dee960e31b815260040160405180910390fd5b600061267b611eff565b600581018390556040518381529091507f22d5bb5059ffe2949a098666fc198587200c8118483074120d3ca7050c7753f19060200160405180910390a15050565b6000806000806126d66126cd611eff565b60010186611f23565b91509150816126fa57846040516326527e1760e01b8152600401610a3e9190614d6d565b612702611eff565b8054829081106127145761271461551a565b6000918252602090912001546001600160a01b03169590945092505050565b6000612751612748610d72606089018961571f565b610db588615768565b9050600061275e826131f1565b60008080526003602090815284518252600080516020615ed68339815191529052604090206001015490915081146127d55760008080526003602090815283518252600080516020615ed68339815191529052604090819020600101549051632bee7fdb60e21b8152610a3e918391600401615434565b610689828787878761217d6121b28e615768565b808211806127f8575060018111155b15612824576000356001600160e01b0319166040516387f6f09560e01b8152600401610a3e919061570a565b600061282e612abb565b600181018054600283018054928790558590558254929350918490869085600061285783615c23565b919050557f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8858560405161288c929190615434565b60405180910390a45050505050565b6128a36148b6565b8251815260006020808301919091528301516040808301919091528301516001600160a01b0316606080830191909152830151516001600160401b038111156128ee576128ee614d81565b604051908082528060200260200182016040528015612917578160200160208202803683370190505b5060808083019190915283015160a08083019190915283015160c08083019190915283015160e082015260005b836060015151811015610ce1578281815181106129635761296361551a565b6020026020010151826080015182815181106129815761298161551a565b6001600160a01b0390921660209283029190910190910152600101612944565b606060006129ad611eff565b905082516001600160401b038111156129c8576129c8614d81565b6040519080825280602002602001820160405280156129f1578160200160208202803683370190505b50915060005b835181101561171857816002016000858381518110612a1857612a1861551a565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160601b0316838281518110612a6657612a6661551a565b6001600160601b03909216602092830291909101909101526001016129f7565b6000612a90611eff565b6001600160a01b0390921660009081526002929092016020525060409020546001600160601b031690565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f0090565b7fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb90565b606081612b0f8161153b565b6000612b19611eff565b8451909150806001600160401b03811115612b3657612b36614d81565b604051908082528060200260200182016040528015612b5f578160200160208202803683370190505b50935080600003612b71575050612ee3565b60058201548254612b839083906156d5565b1015612ba25760405163b2e765cb60e01b815260040160405180910390fd5b60008060008060005b85811015612e6957898181518110612bc557612bc561551a565b60200260200101519350612bd8846126bc565b9095509150612be685612ff3565b612bef84612ff3565b6001600160a01b03851660009081526002880160205260409020546001600160601b031615801590612c4357506001600160a01b03841660009081526003880160205260409020546001600160601b031615155b898281518110612c5557612c5561551a565b602002602001019015159081151581525050888181518110612c7957612c7961551a565b602002602001015115612e61576001600160a01b038516600090815260028801602052604081205488546001600160601b039091169190612cbc906001906156d5565b9050886000018181548110612cd357612cd361551a565b60009182526020909120015489546001600160a01b03909116908a9086908110612cff57612cff61551a565b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790558854899080612d3957612d39615c3c565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038916825260028b0190526040902080546001600160601b031916905560018901805482908110612d9957612d9961551a565b60009182526020909120015460018a0180546001600160a01b039092169186908110612dc757612dc761551a565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555088600101805480612e0857612e08615c3c565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038816825260038b0190526040902080546001600160601b0319169055612e5c82866156c2565b945050505b600101612bab565b5081866004016000828254612e7e91906156d5565b9091555050604051612ea390636242a4ef60e11b906114c8908c908c90602001615c52565b7fdf3dcd7987202f64648f3acdbf12401e3a2bb23e77e19f99826b5475cbb86369888a604051612ed4929190615c77565b60405180910390a15050505050505b50919050565b81518151606091908082016001600160401b03811115612f0b57612f0b614d81565b604051908082528060200260200182016040528015612f34578160200160208202803683370190505b50925060005b82811015612f8e57858181518110612f5457612f5461551a565b6020026020010151848281518110612f6e57612f6e61551a565b6001600160a01b0390921660209283029190910190910152600101612f3a565b60005b82811015612fe957858181518110612fab57612fab61551a565b6020026020010151858381518110612fc557612fc561551a565b6001600160a01b039092166020928302919091019091015260019182019101612f91565b5050505092915050565b6001600160a01b0381166109ab576000356001600160e01b03191660405163104c66df60e31b8152600401610a3e919061570a565b6130328282613f6b565b610995573382826040516319b5fdcb60e31b8152600401610a3e93929190615c9c565b6000815160000361306857506000919050565b60005b60018351038110156130eb57600181015b83518110156130e2578381815181106130975761309761551a565b60200260200101516001600160a01b03168483815181106130ba576130ba61551a565b60200260200101516001600160a01b0316036130da575060019392505050565b60010161307c565b5060010161306b565b50600092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561314457602002820191906000526020600020905b815481526020019060010190808311613130575b50505050509050919050565b600082608001515111801561316e57508160a0015151826080015151145b801561318357508160c0015151826080015151145b801561319857508160e0015151826080015151145b6131c3576000356001600160e01b0319166040516306b5667560e21b8152600401610a3e919061570a565b6131cd81426156c2565b826040015111156109955760405163ad89be9d60e01b815260040160405180910390fd5b60a0810151608082015160c083015151600092919083906001600160401b0381111561321f5761321f614d81565b604051908082528060200260200182016040528015613248578160200160208202803683370190505b5060e086015190915060005b82518110156132a7578660c0015181815181106132735761327361551a565b6020026020010151805190602001208382815181106132945761329461551a565b6020908102919091010152600101613254565b50604080517f1b59eeec7c321899dc1e7a5b3d876c9a445dffc6d2f96ba842d7489908fdee1281528751602080830191909152808901518284015291880151606080830191909152909701516080880152835181029381019390932060a0870152835183029383019390932060c0860152805182029082012060e08501528151810291012061010083015250610120902090565b6001830191909155600690910155565b6000818152600183016020526040812054801561343457600061336f6001836156d5565b8554909150600090613383906001906156d5565b90508181146133e85760008660000182815481106133a3576133a361551a565b90600052602060002001549050808760000184815481106133c6576133c661551a565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806133f9576133f9615c3c565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061094b565b600091505061094b565b6001600160a01b03166000908152600891909101602052604090205460ff1690565b600081604051602401613473919061570a565b60408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b1790525190915060009081906001600160a01b038616906134bc908590615cd0565b600060405180830381855afa9150503d80600081146134f7576040519150601f19603f3d011682016040523d82523d6000602084013e6134fc565b606091505b5091509150816135be57846001600160a01b0316836040516024016135219190615cec565b60408051601f198184030181529181526020820180516001600160e01b03166325da93a560e11b179052516135569190615cd0565b600060405180830381855afa9150503d8060008114613591576040519150601f19603f3d011682016040523d82523d6000602084013e613596565b606091505b509092509050816135be57838560405163069d427960e11b8152600401610a3e929190615cff565b808060200190518101906135d29190615d22565b6108f657838560405163069d427960e11b8152600401610a3e929190615cff565b6000610948836001600160a01b038416614291565b613611816142e0565b1561099557815460ff1916600217825560008061362d836142fa565b9150915083600101547fe134987599ae266ec90edeff1b26125b287dbb57b10822649432d1bb26537fba8383604051613667929190615d44565b60405180910390a250505050565b806005600084600581111561368c5761368c614be0565b600581111561369d5761369d614be0565b8152602081019190915260400160002080546001600160a01b0319166001600160a01b0392831617905581168260058111156136db576136db614be0565b6040517f356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d90600090a35050565b831580159061371657508382145b613741576000356001600160e01b0319166040516306b5667560e21b8152600401610a3e919061570a565b600061379a61374f60015490565b61375a8460006145a1565b60405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b905060006137b56137aa60015490565b61375a8560016145a1565b905060006137c1613bfd565b90506000816137ce613c07565b6137d891906156d5565b6137e39060016156c2565b90506000805b87811015610834573660008a8a848181106138065761380661551a565b606002919091019250600090508d8d858181106138255761382561551a565b905060200201602081019061383a9190615d69565b600181111561384b5761384b614be0565b0361387757613870886138616020850185615d95565b846020013585604001356145da565b90506138ee565b60018d8d8581811061388b5761388b61551a565b90506020020160208101906138a09190615d69565b60018111156138b1576138b1614be0565b036138c757613870876138616020850185615d95565b6000356001600160e01b031916604051630612418f60e11b8152600401610a3e919061570a565b806001600160a01b0316846001600160a01b03161061392e576000356001600160e01b031916604051635d3dcd3160e01b8152600401610a3e919061570a565b809350600061393c82613c11565b90508060000361396d576000356001600160e01b03191660405163726b3acb60e01b8152600401610a3e919061570a565b6139b08f8f8f878181106139835761398361551a565b90506020020160208101906139989190615d69565b8989866139aa368a90038a018a615db0565b87613c2b565b156139c357505050505050505050610b3b565b8360010193505050506137e9565b6139d96148b6565b6139f26139eb84606001516001611c2d565b849061289b565b9050613a096004548261315090919063ffffffff16565b6000613a14826131f1565b90506000613a22600061166f565b6000818152600080516020615ed68339815191526020908152604090912090870151919250613a5291849061333b565b82518114613a81576000356001600160e01b03191660405163d4cec26960e01b8152600401610a3e919061570a565b8181600080516020615eb683398151915285613a9c89613abe565b8989604051613aae9493929190615b6a565b60405180910390a3505092915050565b6080810151606082015160a083015151600092919083906001600160401b03811115613aec57613aec614d81565b604051908082528060200260200182016040528015613b15578160200160208202803683370190505b5060c086015190915060005b8251811015613b74578660a001518181518110613b4057613b4061551a565b602002602001015180519060200120838281518110613b6157613b6161551a565b6020908102919091010152600101613b21565b50604080517fde480f0c53a3651c08fbab1dffbc45fe574f31188827fe52cb9035da9fe57e4a8152875160208083019190915280890151828401529790910151606082015283518702938701939093206080840152835186029386019390932060a0830152805185029085012060c082015281518402919093012060e083015250610100902090565b600061069c6109ae565b600061069c610692565b6000613c1c82612a86565b6001600160601b031692915050565b60208088015188516000828152600384526040808220838352909452928320613c538161233a565b15613c645760019350505050613f60565b6020808c01516000908152600290915260409020548214613ca6576000356001600160e01b03191660405163d4cec26960e01b8152600401610a3e919061570a565b6000815460ff166004811115613cbe57613cbe614be0565b14613cdc576040516322de95ff60e21b815260040160405180910390fd5b613ce6818861343e565b15613d06578660405163025fd59560e41b8152600401610a3e9190614d6d565b6001600160a01b03871660009081526008820160209081526040909120805460ff19166001179055860151151580613d415750604086015115155b80613d4f5750855160ff1615155b15613d96576001600160a01b03871660009081526007820160209081526040918290208851815460ff191660ff909116178155908801516001820155908701516002909101555b866001600160a01b031681600101547f1203f9e81c814a35f5f4cc24087b2a24c6fb7986a9f1406b68a9484882c93a238c88604051613dd6929190615e10565b60405180910390a3600080808c6001811115613df457613df4614be0565b03613e49576004830180546001810182556000918252602082200180546001600160a01b0319166001600160a01b038c16179055600384018054899290613e3c9084906156c2565b9250508190559150613eae565b60018c6001811115613e5d57613e5d614be0565b036138c7576005830180546001810182556000918252602082200180546001600160a01b0319166001600160a01b038c16179055600284018054899290613ea59084906156c2565b92505081905590505b8a8210613f1457825460ff19166001908117845580840154604051919750907f5c819725ea53655a3b898f3df59b66489761935454e9212ca1e5ebd759953d0b90600090a260608d01516001600160a01b0316613f0f57613f0f838e613608565b613f5a565b898110613f5a57825460ff19166003178355600180840154604051919750907f55295d4ce992922fa2e5ffbf3a3dcdb367de0a15e125ace083456017fd22060f90600090a25b50505050505b979650505050505050565b60016000613f7a6107336115f5565b80519091506000819003613f8f57505061094b565b6000816001600160401b03811115613fa957613fa9614d81565b604051908082528060200260200182016040528015613fd2578160200160208202803683370190505b5090506000826001600160401b03811115613fef57613fef614d81565b60405190808252806020026020018201604052801561402257816020015b606081526020019060019003908161400d5790505b5090506000878760405160200161403a929190615e1e565b604051602081830303815290604052905060008160405160240161405e9190615cec565b60408051601f198184030181529190526020810180516001600160e01b03166325da93a560e11b179052905060005b85811015614247578681815181106140a7576140a761551a565b60200260200101516001600160a01b0316836040516140c69190615cd0565b6000604051808303816000865af19150503d8060008114614103576040519150601f19603f3d011682016040523d82523d6000602084013e614108565b606091505b5086838151811061411b5761411b61551a565b602002602001018684815181106141345761413461551a565b602002602001018290528215151515815250505084818151811061415a5761415a61551a565b602002602001015161423f578681815181106141785761417861551a565b60200260200101516001600160a01b0316826040516141979190615cd0565b6000604051808303816000865af19150503d80600081146141d4576040519150601f19603f3d011682016040523d82523d6000602084013e6141d9565b606091505b508683815181106141ec576141ec61551a565b602002602001018684815181106142055761420561551a565b602002602001018290528215151515815250505087801561423c57508481815181106142335761423361551a565b60200260200101515b97505b60010161408d565b507fc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b638287868660405161427d9493929190615e4f565b60405180910390a150505050505092915050565b60008181526001830160205260408120546142d85750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561094b565b50600061094b565b600081602001516000148061094b57505060200151461490565b606080614306836142e0565b61433857602083015160405163092048d160e11b8152610a3e916001600160e01b031960003516914690600401615964565b8260800151516001600160401b0381111561435557614355614d81565b60405190808252806020026020018201604052801561437e578160200160208202803683370190505b5091508260800151516001600160401b0381111561439e5761439e614d81565b6040519080825280602002602001820160405280156143d157816020015b60608152602001906001900390816143bc5790505b50905060005b83608001515181101561459b578360e0015181815181106143fa576143fa61551a565b60200260200101515a1161442d57614411846131f1565b6040516307aec4ab60e21b8152600401610a3e91815260200190565b836080015181815181106144435761444361551a565b60200260200101516001600160a01b03168460a00151828151811061446a5761446a61551a565b60200260200101518560e0015183815181106144885761448861551a565b6020026020010151908660c0015184815181106144a7576144a761551a565b60200260200101516040516144bc9190615cd0565b600060405180830381858888f193505050503d80600081146144fa576040519150601f19603f3d011682016040523d82523d6000602084013e6144ff565b606091505b508483815181106145125761451261551a565b6020026020010184848151811061452b5761452b61551a565b60200260200101829052821515151581525050508281815181106145515761455161551a565b602002602001015161459357808282815181106145705761457061551a565b60200260200101516040516376df417560e11b8152600401610a3e929190615e9c565b6001016143d7565b50915091565b604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b60008060006145eb87878787614602565b915091506145f8816146e5565b5095945050505050565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b0383111561462f57506000905060036146dc565b8460ff16601b1415801561464757508460ff16601c14155b1561465857506000905060046146dc565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156146ac573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166146d5576000600192509250506146dc565b9150600090505b94509492505050565b60008160048111156146f9576146f9614be0565b036147015750565b600181600481111561471557614715614be0565b0361475d5760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b6044820152606401610a3e565b600281600481111561477157614771614be0565b036147be5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610a3e565b60038160048111156147d2576147d2614be0565b0361482a5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610a3e565b600481600481111561483e5761483e614be0565b036109ab5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610a3e565b604080516060810182526000808252602082018190529181019190915290565b60405180610100016040528060008152602001600081526020016000815260200160006001600160a01b03168152602001606081526020016060815260200160608152602001606081525090565b50805460008255906000526020600020908101906109ab91905b80821115614932576000815560010161491e565b5090565b60008083601f84011261494857600080fd5b5081356001600160401b0381111561495f57600080fd5b6020830191508360208260051b8501011115611f8157600080fd5b6000806000806000806060878903121561499357600080fd5b86356001600160401b03808211156149aa57600080fd5b6149b68a838b01614936565b909850965060208901359150808211156149cf57600080fd5b6149db8a838b01614936565b909650945060408901359150808211156149f457600080fd5b50614a0189828a01614936565b979a9699509497509295939492505050565b60008060208385031215614a2657600080fd5b82356001600160401b03811115614a3c57600080fd5b614a4885828601614936565b90969095509350505050565b6001600160a01b03169052565b60008151808452602080850194506020840160005b83811015614a9b5781516001600160a01b031687529582019590820190600101614a76565b509495945050505050565b6020815260006109486020830184614a61565b80356001600160a01b038116811461109757600080fd5b600080600080600080600080600080600060e08c8e031215614af157600080fd5b8b359a5060208c01359950614b0860408d01614ab9565b98506001600160401b0360608d0135811015614b2357600080fd5b614b338e60608f01358f01614936565b909950975060808d0135811015614b4957600080fd5b614b598e60808f01358f01614936565b909750955060a08d0135811015614b6f57600080fd5b614b7f8e60a08f01358f01614936565b909550935060c08d0135811015614b9557600080fd5b50614ba68d60c08e01358e01614936565b81935080925050509295989b509295989b9093969950565b60008060408385031215614bd157600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60028110614c0657614c06614be0565b9052565b60006060808352614c1e6060840187614a61565b83810360208581019190915286518083528782019282019060005b81811015614c5c57614c4c838651614bf6565b9383019391830191600101614c39565b50506040925085810360408701528087518083528383019150838901925060005b81811015614cad578351805160ff1684528581015186850152860151868401529284019291860191600101614c7d565b50909a9950505050505050505050565b600080600060608486031215614cd257600080fd5b8335925060208401359150614ce960408501614ab9565b90509250925092565b600060208284031215614d0457600080fd5b5035919050565b60006101008284031215612ee357600080fd5b600060208284031215614d3057600080fd5b81356001600160401b03811115614d4657600080fd5b61071e84828501614d0b565b600060208284031215614d6457600080fd5b61094882614ab9565b6001600160a01b0391909116815260200190565b634e487b7160e01b600052604160045260246000fd5b60405161010081016001600160401b0381118282101715614dba57614dba614d81565b60405290565b60405160e081016001600160401b0381118282101715614dba57614dba614d81565b604051601f8201601f191681016001600160401b0381118282101715614e0a57614e0a614d81565b604052919050565b60006001600160401b03821115614e2b57614e2b614d81565b5060051b60200190565b600082601f830112614e4657600080fd5b81356020614e5b614e5683614e12565b614de2565b8083825260208201915060208460051b870101935086841115614e7d57600080fd5b602086015b84811015614ea757803560068110614e9a5760008081fd5b8352918301918301614e82565b509695505050505050565b600082601f830112614ec357600080fd5b81356020614ed3614e5683614e12565b8083825260208201915060208460051b870101935086841115614ef557600080fd5b602086015b84811015614ea757614f0b81614ab9565b8352918301918301614efa565b60008060408385031215614f2b57600080fd5b82356001600160401b0380821115614f4257600080fd5b614f4e86838701614e35565b93506020850135915080821115614f6457600080fd5b50614f7185828601614eb2565b9150509250929050565b60008060408385031215614f8e57600080fd5b82359150614f9e60208401614ab9565b90509250929050565b80356010811061109757600080fd5b60008060408385031215614fc957600080fd5b614fd283614fa7565b9150614f9e60208401614ab9565b60008083601f840112614ff257600080fd5b5081356001600160401b0381111561500957600080fd5b602083019150836020606083028501011115611f8157600080fd5b60008060008060006060868803121561503c57600080fd5b85356001600160401b038082111561505357600080fd5b61505f89838a01614d0b565b9650602088013591508082111561507557600080fd5b61508189838a01614936565b9096509450604088013591508082111561509a57600080fd5b506150a788828901614fe0565b969995985093965092949392505050565b600060e08284031215612ee357600080fd5b6000806000806000606086880312156150e257600080fd5b85356001600160401b03808211156150f957600080fd5b61505f89838a016150b8565b60008060008060008060008060008060c08b8d03121561512457600080fd5b8a35995061513460208c01614ab9565b985060408b01356001600160401b038082111561515057600080fd5b61515c8e838f01614936565b909a50985060608d013591508082111561517557600080fd5b6151818e838f01614936565b909850965060808d013591508082111561519a57600080fd5b6151a68e838f01614936565b909650945060a08d01359150808211156151bf57600080fd5b506151cc8d828e01614936565b915080935050809150509295989b9194979a5092959850565b80356002811061109757600080fd5b6000806040838503121561520757600080fd5b82356001600160401b0381111561521d57600080fd5b61522985828601614d0b565b925050614f9e602084016151e5565b60a081016005871061524c5761524c614be0565b95815260208101949094526040840192909252606083015260809091015290565b60006020828403121561527f57600080fd5b81356001600160401b0381111561529557600080fd5b61071e848285016150b8565b60008151808452602080850194506020840160005b83811015614a9b5781516001600160601b0316875295820195908201906001016152b6565b6060815260006152ee6060830186614a61565b82810360208401526153008186614a61565b905082810360408401526121b781856152a1565b60208152600061094860208301846152a1565b600080600080600080600080600080600060e08c8e03121561534857600080fd5b8b359a5061535860208d01614ab9565b99506001600160401b0360408d013581101561537357600080fd5b6153838e60408f01358f01614936565b909a50985060608d013581101561539957600080fd5b6153a98e60608f01358f01614936565b909850965060808d01358110156153bf57600080fd5b6153cf8e60808f01358f01614936565b909650945060a08d01358110156153e557600080fd5b506153f68d60a08e01358e01614936565b909350915061540760c08d016151e5565b90509295989b509295989b9093969950565b60006020828403121561542b57600080fd5b61094882614fa7565b918252602082015260400190565b6000615450614e5684614e12565b8381529050602080820190600585901b84018681111561546f57600080fd5b845b818110156155025780356001600160401b03808211156154915760008081fd5b8188019150601f8a818401126154a75760008081fd5b8235828111156154b9576154b9614d81565b6154ca818301601f19168801614de2565b92508083528b878286010111156154e357600091508182fd5b8087850188850137600090830187015250855250928201928201615471565b505050509392505050565b6000610948368484615442565b634e487b7160e01b600052603260045260246000fd5b600082601f83011261554157600080fd5b81356020615551614e5683614e12565b8083825260208201915060208460051b87010193508684111561557357600080fd5b602086015b84811015614ea75780358352918301918301615578565b600082601f8301126155a057600080fd5b61094883833560208501615442565b600061010082360312156155c257600080fd5b6155ca614d97565b8235815260208301356020820152604083013560408201526155ee60608401614ab9565b606082015260808301356001600160401b038082111561560d57600080fd5b61561936838701614eb2565b608084015260a085013591508082111561563257600080fd5b61563e36838701615530565b60a084015260c085013591508082111561565757600080fd5b6156633683870161558f565b60c084015260e085013591508082111561567c57600080fd5b5061568936828601615530565b60e08301525092915050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761094b5761094b615695565b8082018082111561094b5761094b615695565b8181038181111561094b5761094b615695565b60008261570557634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031991909116815260200190565b6000808335601e1984360301811261573657600080fd5b8301803591506001600160401b0382111561575057600080fd5b6020019150600581901b3603821315611f8157600080fd5b600060e0823603121561577a57600080fd5b615782614dc0565b823581526020830135602082015261579c60408401614ab9565b604082015260608301356001600160401b03808211156157bb57600080fd5b6157c736838701614e35565b606084015260808501359150808211156157e057600080fd5b6157ec36838701615530565b608084015260a085013591508082111561580557600080fd5b6158113683870161558f565b60a084015260c085013591508082111561582a57600080fd5b5061583736828601615530565b60c08301525092915050565b602081016010831061585757615857614be0565b91905290565b6001600160e01b03198316815260408101600b831061587e5761587e614be0565b8260208301529392505050565b6001600160601b03818116838216019080821115610ce157610ce1615695565b60008151808452602080850194506020840160005b83811015614a9b5781511515875295820195908201906001016158c0565b6060815260006158f16060830186614a61565b828103602084015261590381866152a1565b905082810360408401526121b781856158ab565b60808152600061592a60808301876158ab565b828103602084015261593c81876152a1565b905082810360408401526159508186614a61565b90508281036060840152613f608185614a61565b6001600160e01b03199390931683526020830191909152604082015260600190565b60008151808452602080850194506020840160005b83811015614a9b5781518752958201959082019060010161599b565b60005b838110156159d25781810151838201526020016159ba565b50506000910152565b600081518084526159f38160208601602086016159b7565b601f01601f19169290920160200192915050565b60008282518085526020808601955060208260051b8401016020860160005b84811015615a5457601f19868403018952615a428383516159db565b98840198925090830190600101615a26565b5090979650505050505050565b60006101008251845260208301516020850152604083015160408501526060830151615a906060860182614a54565b506080830151816080860152615aa882860182614a61565b91505060a083015184820360a0860152615ac28282615986565b91505060c083015184820360c0860152615adc8282615a07565b91505060e083015184820360e0860152615af68282615986565b95945050505050565b604081526000615b126040830185615a61565b905060018060a01b03831660208301529392505050565b60008151808452602080850194506020840160005b83811015614a9b57815160068110615b5857615b58614be0565b87529582019590820190600101615b3e565b608081526000615b7d6080830187615a61565b8560208401528281036040840152845181526020850151602082015260018060a01b036040860151166040820152606085015160e06060830152615bc460e0830182615b29565b905060808601518282036080840152615bdd8282615986565b91505060a086015182820360a0840152615bf78282615a07565b91505060c086015182820360c0840152615c118282615986565b9350505050615af66060830184614a54565b600060018201615c3557615c35615695565b5060010190565b634e487b7160e01b600052603160045260246000fd5b604081526000615c656040830185614a61565b8281036020840152615af681856158ab565b604081526000615c8a60408301856158ab565b8281036020840152615af68185614a61565b6001600160a01b03841681526001600160e01b031983166020820152606060408201819052600090615af6908301846159db565b60008251615ce28184602087016159b7565b9190910192915050565b60208152600061094860208301846159db565b6001600160e01b03199290921682526001600160a01b0316602082015260400190565b600060208284031215615d3457600080fd5b8151801515811461162657600080fd5b604081526000615d5760408301856158ab565b8281036020840152615af68185615a07565b600060208284031215615d7b57600080fd5b610948826151e5565b803560ff8116811461109757600080fd5b600060208284031215615da757600080fd5b61094882615d84565b600060608284031215615dc257600080fd5b604051606081016001600160401b0381118282101715615de457615de4614d81565b604052615df083615d84565b815260208301356020820152604083013560408201528091505092915050565b6040810161587e8285614bf6565b6001600160e01b0319831681528151600090615e418160048501602087016159b7565b919091016004019392505050565b608081526000615e6260808301876159db565b8281036020840152615e748187614a61565b90508281036040840152615e8881866158ab565b90508281036060840152613f608185615a07565b82815260406020820152600061071e60408301846159db56fee5af2d3fb7bcab8f865476bc675bf1bbb8b5a749c827ee1cd215dc9c2b8f92d73617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92effa2646970667358221220fbc7cf0cc42a480ef3d40d76fe731fb7fad911d9e6f97db06cb768d5fde5e16d64736f6c63430008170033", + "nonce": "0x2f124" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0xde41c353b4f859829031e40fc82bce8c9840397c53e4f17719d19e593e437a6b", + "transactionType": "CALL", + "contractName": "src/extensions/TransparentUpgradeableProxyV2.sol:TransparentUpgradeableProxyV2", + "contractAddress": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "function": "upgradeTo(address)", + "arguments": [ + "0x64D21e91c2Cb367D2972E0bC377CFEa4e55F3685" + ], + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "to": "0x8aaad4782890eb879a0fc132a6adf9e5ee708faf", + "gas": "0xfea6", + "value": "0x0", + "data": "0x3659cfe600000000000000000000000064d21e91c2cb367d2972e0bc377cfea4e55f3685", + "nonce": "0x2f125" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0xf7f521794a007a3a637834e4dce3dd3787aed00a8886cb87364af4845bf321eb", + "transactionType": "CALL", + "contractName": "src/extensions/TransparentUpgradeableProxyV2.sol:TransparentUpgradeableProxyV2", + "contractAddress": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "function": "changeAdmin(address)", + "arguments": [ + "0xb0507f2f22697022eCb25963a00D3D076dAc5753" + ], + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "to": "0x8aaad4782890eb879a0fc132a6adf9e5ee708faf", + "gas": "0x10116", + "value": "0x0", + "data": "0x8f283970000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac5753", + "nonce": "0x2f126" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [], + "libraries": [], + "pending": [ + "0x32330f2782488f77d3a5754841fe7628ae853c71cc9be98bc58221d40d6b7022", + "0x11b14dd94c5c6b85e8581a63e247176240a6fcb8da8df2570508475c2550ec34", + "0xfcd1ca2649e9cba542fd73c3fd0856b6199140862c65eac401c3ebff94085064", + "0xde41c353b4f859829031e40fc82bce8c9840397c53e4f17719d19e593e437a6b", + "0xf7f521794a007a3a637834e4dce3dd3787aed00a8886cb87364af4845bf321eb" + ], + "returns": {}, + "timestamp": 1713240671, + "chain": 2021, + "multi": false, + "commit": "6964a97" +} \ No newline at end of file diff --git a/broadcast/20240411-p1-deploy-ronin-bridge-manager.s.sol/2021/run-1713240678.json b/broadcast/20240411-p1-deploy-ronin-bridge-manager.s.sol/2021/run-1713240678.json new file mode 100644 index 00000000..bc4a54f5 --- /dev/null +++ b/broadcast/20240411-p1-deploy-ronin-bridge-manager.s.sol/2021/run-1713240678.json @@ -0,0 +1,452 @@ +{ + "transactions": [ + { + "hash": "0x32330f2782488f77d3a5754841fe7628ae853c71cc9be98bc58221d40d6b7022", + "transactionType": "CREATE", + "contractName": "RoninBridgeManagerConstructor", + "contractAddress": "0xD05A72c0A593983Aa8336C997736e2172E745fF1", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x637700", + "value": "0x0", + "data": "0x60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61398280620000f46000396000f3fe608060405234801561001057600080fd5b50600436106101965760003560e01c806301a5f43f1461019b57806306aba0e1146101b05780630a44fa43146101cb5780630f7c3189146101de5780631c905e39146101f35780631f425338146102155780632c5e6520146102285780632d6d7d731461024b57806334d5f37b1461025e57806335da81211461027e5780633644e515146102915780637d4c1d781461029a5780637de5dedd146102ad5780637f7fe058146102b5578063800eaab3146102d5578063828fc1a1146102e8578063865e6fd3146102fb578063901979d51461030e5780639b19dbfd14610339578063a64a838014610341578063aee1767f14610354578063b384abef14610367578063b405aaf2146103c2578063b9c36209146103d5578063bc4e068f146103e8578063c441c4a8146103fb578063cc7e6b3b14610412578063d0a50db014610432578063d78392f81461043a578063dafae4081461044d578063de981f1b14610460578063e75235b814610473578063e9c0349814610490578063f80b5352146104a3575b600080fd5b6101ae6101a9366004612d91565b6104ab565b005b6101b861055a565b6040519081526020015b60405180910390f35b6101b86101d9366004612e2a565b610569565b6101e66105ee565b6040516101c29190612eb0565b610206610201366004612ec3565b610600565b6040516101c293929190612efb565b6101ae610223366004612e2a565b61061c565b61023b610236366004612fce565b6106bb565b60405190151581526020016101c2565b6101e6610259366004612e2a565b6106c8565b6101b861026c366004613003565b60026020526000908152604090205481565b6101ae61028c366004612e2a565b61070f565b6101b860015481565b6101ae6102a83660046131dd565b610757565b6101b8610893565b6102c86102c3366004613317565b6108e9565b6040516101c29190613332565b6101ae6102e3366004613346565b61095c565b61023b6102f63660046133a9565b610994565b6101ae6103093660046133e4565b6109a2565b61032161031c366004613317565b6109bd565b6040516001600160601b0390911681526020016101c2565b6101e66109f3565b6101ae61034f366004613003565b610a5e565b6102c8610362366004613317565b610a72565b6103b1610375366004612ec3565b600360208181526000938452604080852090915291835291208054600182015460028301549383015460069093015460ff909216939092909185565b6040516101c295949392919061340e565b61023b6103d0366004613317565b610a84565b6101ae6103e3366004612ec3565b610abc565b6102066103f6366004613003565b610ace565b610403610aeb565b6040516101c29392919061347d565b610425610420366004612e2a565b610bc5565b6040516101c291906134c0565b6101b8610c03565b610321610448366004613317565b610c16565b61023b61045b366004613003565b610c21565b6102c861046e3660046134d3565b610c5d565b61047b610cbf565b604080519283526020830191909152016101c2565b6101ae61049e366004612e2a565b610ce1565b6101e6610d2a565b6104b3610d8d565b61055186868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808a0282810182019093528982529093508992508891829185019084908082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250610de992505050565b50505050505050565b600061056461114b565b905090565b60008282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506105aa925083915061115e9050565b6105e684848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061119392505050565b949350505050565b60606105646105fb611218565b61123c565b606080606061060f8585611250565b9250925092509250925092565b610624610d8d565b818180806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610663925083915061115e9050565b600061066d611218565b905060005b838110156106b4576106ab85858381811061068f5761068f6134ee565b90506020020160208101906106a49190613317565b8390611639565b50600101610672565b5050505050565b60006105e684848461164e565b606061070683838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250611684915050565b90505b92915050565b610717610d8d565b6107538282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506117d792505050565b5050565b600054610100900460ff16158080156107775750600054600160ff909116105b806107915750303b158015610791575060005460ff166001145b6107f95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff19166001179055801561081c576000805461ff0019166101001790555b61082589611892565b61082f83836118c2565b61083f8c8c8c8b8b8b8b8b6118f3565b8015610885576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050505050565b60008061089e611944565b90506000806108ab610cbf565b91509150806001828560040154856108c3919061351a565b6108cd9190613531565b6108d79190613544565b6108e19190613557565b935050505090565b60008060006108ff6108f9611944565b85611968565b9150915081610923578360405163141e2e1f60e11b81526004016107f09190613332565b61092b611944565b600101818154811061093f5761093f6134ee565b6000918252602090912001546001600160a01b0316949350505050565b33301461098a576000356001600160e01b0319166040516307337e1960e41b81526004016107f09190613579565b61075382826119cd565b60006107066000848461164e565b6109aa610d8d565b6109b381611a76565b6107538282611aa3565b6000806109c8611944565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b031690565b60606109fd611944565b600101805480602002602001604051908101604052809291908181526020018280548015610a5457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610a36575b5050505050905090565b610a66610d8d565b610a6f81611b2e565b50565b6000610a7d82611b9b565b5092915050565b600080610a8f611944565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b0316151590565b610ac4610d8d565b6107538282611c12565b6060806060610ade600085611250565b9250925092509193909250565b60608060606000610afa611944565b805460408051602080840282018101909252828152929350839190830182828015610b4e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b30575b5050505050935080600101805480602002602001604051908101604052809291908181526020018280548015610bad57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b8f575b50505050509250610bbd84611cc4565b915050909192565b6060610706838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611cc492505050565b6000610c0d611944565b60010154919050565b600061070982611db0565b600080610c2c611de5565b9050610c3661114b565b8160010154610c45919061351a565b6002820154610c54908561351a565b10159392505050565b6000610c67611e09565b600083600f811115610c7b57610c7b612ee5565b60ff1681526020810191909152604001600020546001600160a01b0316905080610cba578160405163409140df60e11b81526004016107f0919061358e565b919050565b6000806000610ccc611de5565b90508060010154816002015492509250509091565b610ce9610d8d565b610d25828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611e2d92505050565b505050565b6060610d34611944565b805460408051602080840282018101909252828152929190830182828015610a54576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610a36575050505050905090565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610de7576000356001600160e01b0319166001604051620f948f60ea1b81526004016107f09291906135a8565b565b6060610df58383612213565b610dfe8161115e565b6000610e08611944565b845187519192509081148015610e1e5750855181145b610e49576000356001600160e01b0319166040516306b5667560e21b81526004016107f09190613579565b806001600160401b03811115610e6157610e6161301c565b604051908082528060200260200182016040528015610e8a578160200160208202803683370190505b50935080600003610e9c575050611143565b60008060008060005b858110156110af578a8181518110610ebf57610ebf6134ee565b60200260200101519450898181518110610edb57610edb6134ee565b602002602001015193508b8181518110610ef757610ef76134ee565b60200260200101519250610f0a8561231d565b610f138461231d565b826001600160601b0316600003610f4b576000356001600160e01b031916604051637f11b8a360e11b81526004016107f09190613579565b6001600160a01b03808616600081815260038a01602090815260408083205494891683528083205460028d0190925280832054938352909120546001600160601b039384169391821692610fa39290811691166135d6565b610fad91906135d6565b610fb791906135d6565b6001600160601b0316600014898281518110610fd557610fd56134ee565b602002602001019015159081151581525050888181518110610ff957610ff96134ee565b6020026020010151156110a7578654600181810189556000898152602080822090930180546001600160a01b03808b166001600160a01b0319928316811790935591835260028c018552604080842080546001600160601b038b166001600160601b03199182168117909255868f018054978801815586528786209096018054948c1694909316841790925591835260038c0190945290208054909116821790556110a49083613531565b91505b600101610ea5565b50808660040160008282546110c49190613531565b90915550506040516110ff906347c28ec560e11b906110eb908c908f908d90602001613629565b604051602081830303815290604052612352565b7f897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b78888c8c8c6040516111349493929190613662565b60405180910390a15050505050505b509392505050565b6000611155611944565b60040154905090565b6111678161237f565b15610a6f576000356001600160e01b031916604051630d697db160e11b81526004016107f09190613579565b60008161119f8161115e565b60006111a9611944565b905060005b8451811015611210578160020160008683815181106111cf576111cf6134ee565b6020908102919091018101516001600160a01b0316825281019190915260400160002054611206906001600160601b031685613531565b93506001016111ae565b505050919050565b7f5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd97624090565b606060006112498361241e565b9392505050565b600082815260036020908152604080832084845290915281206004810154600582015460609384938493909290916112888284613531565b9050806001600160401b038111156112a2576112a261301c565b6040519080825280602002602001820160405280156112cb578160200160208202803683370190505b509550806001600160401b038111156112e6576112e661301c565b60405190808252806020026020018201604052801561133157816020015b60408051606081018252600080825260208083018290529282015282526000199092019101816113045790505b509450806001600160401b0381111561134c5761134c61301c565b604051908082528060200260200182016040528015611375578160200160208202803683370190505b50965060005b838110156114ca576000878281518110611397576113976134ee565b602002602001019060018111156113b0576113b0612ee5565b908160018111156113c3576113c3612ee5565b90525060008a81526003602090815260408083208c8452909152812060048701805460079092019291849081106113fc576113fc6134ee565b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815460ff1681526001820154938101939093526002015490820152865187908390811061145a5761145a6134ee565b602002602001018190525084600401818154811061147a5761147a6134ee565b9060005260206000200160009054906101000a90046001600160a01b03168882815181106114aa576114aa6134ee565b6001600160a01b039092166020928302919091019091015260010161137b565b5060005b8281101561162d576001876114e38684613531565b815181106114f3576114f36134ee565b6020026020010190600181111561150c5761150c612ee5565b9081600181111561151f5761151f612ee5565b90525060008a81526003602090815260408083208c845290915281206005870180546007909201929184908110611558576115586134ee565b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815460ff1681526001820154938101939093526002015490820152866115ad8684613531565b815181106115bd576115bd6134ee565b60200260200101819052508460050181815481106115dd576115dd6134ee565b6000918252602090912001546001600160a01b0316886115fd8684613531565b8151811061160d5761160d6134ee565b6001600160a01b03909216602092830291909101909101526001016114ce565b50505050509250925092565b6000610706836001600160a01b03841661247a565b600083815260036020908152604080832085845282528083206001600160a01b038516845260080190915281205460ff166105e6565b606082516001600160401b0381111561169f5761169f61301c565b6040519080825280602002602001820160405280156116c8578160200160208202803683370190505b50905060005b8351811015610a7d57600560008583815181106116ed576116ed6134ee565b6020026020010151600581111561170657611706612ee5565b600581111561171757611717612ee5565b815260200190815260200160002060009054906101000a90046001600160a01b031682828151811061174b5761174b6134ee565b60200260200101906001600160a01b031690816001600160a01b0316815250508280156117a3575060006001600160a01b0316828281518110611790576117906134ee565b60200260200101516001600160a01b0316145b156117cf576000356001600160e01b03191660405163053265f160e01b81526004016107f09190613579565b6001016116ce565b806117e18161115e565b60006117eb611218565b905060008060005b855181101561188a5785818151811061180e5761180e6134ee565b6020026020010151925061182183611a76565b611832836312c0151560e21b61256d565b61183c8484612700565b604080516001600160a01b038616815282151560208201529193507fb85c58eeff9fe423669ae0841666f4c8499e8731b8275eb462e4fa1720ec420e910160405180910390a16001016117f3565b505050505050565b600054610100900460ff166118b95760405162461bcd60e51b81526004016107f0906136ba565b610a6f81612715565b600054610100900460ff166118e95760405162461bcd60e51b81526004016107f0906136ba565b6107538282612745565b600054610100900460ff1661191a5760405162461bcd60e51b81526004016107f0906136ba565b6119248888612777565b61192d846127b8565b61193a86868585856127e8565b5050505050505050565b7fc648703095712c0419b6431ae642c061f0a105ac2d7c3d9604061ef4ebc3830090565b60008060005b84548110156119bb57848181548110611989576119896134ee565b6000918252602090912001546001600160a01b03908116908516036119b3576001925090506119c6565b60010161196e565b506000600019915091505b9250929050565b60005b8251811015610d2557306001600160a01b03168282815181106119f5576119f56134ee565b60200260200101516001600160a01b031603611a32576000356001600160e01b03191660405163053265f160e01b81526004016107f09190613579565b611a6e838281518110611a4757611a476134ee565b6020026020010151838381518110611a6157611a616134ee565b6020026020010151612912565b6001016119d0565b806001600160a01b03163b600003610a6f5780604051630bfc64a360e21b81526004016107f09190613332565b80611aac611e09565b600084600f811115611ac057611ac0612ee5565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115611b0157611b01612ee5565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b6003811015611b50576040516305f4dee960e31b815260040160405180910390fd5b6000611b5a611944565b600581018390556040518381529091507f22d5bb5059ffe2949a098666fc198587200c8118483074120d3ca7050c7753f19060200160405180910390a15050565b600080600080611bb5611bac611944565b60010186611968565b9150915081611bd957846040516326527e1760e01b81526004016107f09190613332565b611be1611944565b805482908110611bf357611bf36134ee565b6000918252602090912001546001600160a01b03169590945092505050565b80821180611c21575060018111155b15611c4d576000356001600160e01b0319166040516387f6f09560e01b81526004016107f09190613579565b6000611c57611de5565b6001810180546002830180549287905585905582549293509184908690856000611c8083613705565b9091555060408051868152602081018690527f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a45050505050565b60606000611cd0611944565b905082516001600160401b03811115611ceb57611ceb61301c565b604051908082528060200260200182016040528015611d14578160200160208202803683370190505b50915060005b8351811015611da957816002016000858381518110611d3b57611d3b6134ee565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160601b0316838281518110611d8957611d896134ee565b6001600160601b0390921660209283029190910190910152600101611d1a565b5050919050565b6000611dba611944565b6001600160a01b0390921660009081526002929092016020525060409020546001600160601b031690565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f0090565b7fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb90565b606081611e398161115e565b6000611e43611944565b8451909150806001600160401b03811115611e6057611e6061301c565b604051908082528060200260200182016040528015611e89578160200160208202803683370190505b50935080600003611e9b57505061220d565b60058201548254611ead908390613544565b1015611ecc5760405163b2e765cb60e01b815260040160405180910390fd5b60008060008060005b8581101561219357898181518110611eef57611eef6134ee565b60200260200101519350611f0284611b9b565b9095509150611f108561231d565b611f198461231d565b6001600160a01b03851660009081526002880160205260409020546001600160601b031615801590611f6d57506001600160a01b03841660009081526003880160205260409020546001600160601b031615155b898281518110611f7f57611f7f6134ee565b602002602001019015159081151581525050888181518110611fa357611fa36134ee565b60200260200101511561218b576001600160a01b038516600090815260028801602052604081205488546001600160601b039091169190611fe690600190613544565b9050886000018181548110611ffd57611ffd6134ee565b60009182526020909120015489546001600160a01b03909116908a9086908110612029576120296134ee565b600091825260209091200180546001600160a01b0319166001600160a01b039290921691909117905588548990806120635761206361371e565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038916825260028b0190526040902080546001600160601b0319169055600189018054829081106120c3576120c36134ee565b60009182526020909120015460018a0180546001600160a01b0390921691869081106120f1576120f16134ee565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550886001018054806121325761213261371e565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038816825260038b0190526040902080546001600160601b03191690556121868286613531565b945050505b600101611ed5565b50818660040160008282546121a89190613544565b90915550506040516121cd90636242a4ef60e11b906110eb908c908c90602001613734565b7fdf3dcd7987202f64648f3acdbf12401e3a2bb23e77e19f99826b5475cbb86369888a6040516121fe929190613762565b60405180910390a15050505050505b50919050565b81518151606091908082016001600160401b038111156122355761223561301c565b60405190808252806020026020018201604052801561225e578160200160208202803683370190505b50925060005b828110156122b85785818151811061227e5761227e6134ee565b6020026020010151848281518110612298576122986134ee565b6001600160a01b0390921660209283029190910190910152600101612264565b60005b82811015612313578581815181106122d5576122d56134ee565b60200260200101518583815181106122ef576122ef6134ee565b6001600160a01b0390921660209283029190910190910152600191820191016122bb565b5050505092915050565b6001600160a01b038116610a6f576000356001600160e01b03191660405163104c66df60e31b81526004016107f09190613579565b61235c82826129a5565b610753573382826040516319b5fdcb60e31b81526004016107f0939291906137d7565b6000815160000361239257506000919050565b60005b600183510381101561241557600181015b835181101561240c578381815181106123c1576123c16134ee565b60200260200101516001600160a01b03168483815181106123e4576123e46134ee565b60200260200101516001600160a01b031603612404575060019392505050565b6001016123a6565b50600101612395565b50600092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561246e57602002820191906000526020600020905b81548152602001906001019080831161245a575b50505050509050919050565b6000818152600183016020526040812054801561256357600061249e600183613544565b85549091506000906124b290600190613544565b90508181146125175760008660000182815481106124d2576124d26134ee565b90600052602060002001549050808760000184815481106124f5576124f56134ee565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806125285761252861371e565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610709565b6000915050610709565b6000816040516024016125809190613579565b60408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b1790525190915060009081906001600160a01b038616906125c990859061380b565b600060405180830381855afa9150503d8060008114612604576040519150601f19603f3d011682016040523d82523d6000602084013e612609565b606091505b5091509150816126cb57846001600160a01b03168360405160240161262e9190613827565b60408051601f198184030181529181526020820180516001600160e01b03166325da93a560e11b17905251612663919061380b565b600060405180830381855afa9150503d806000811461269e576040519150601f19603f3d011682016040523d82523d6000602084013e6126a3565b606091505b509092509050816126cb57838560405163069d427960e11b81526004016107f092919061383a565b808060200190518101906126df919061385d565b6106b457838560405163069d427960e11b81526004016107f092919061383a565b6000610706836001600160a01b038416612ccb565b600054610100900460ff1661273c5760405162461bcd60e51b81526004016107f0906136ba565b610a6f81612d1a565b600054610100900460ff1661276c5760405162461bcd60e51b81526004016107f0906136ba565b61098a600030612912565b600054610100900460ff1661279e5760405162461bcd60e51b81526004016107f0906136ba565b60006127a8611de5565b600181559050610d258383611c12565b600054610100900460ff166127df5760405162461bcd60e51b81526004016107f0906136ba565b610a6f816117d7565b600054610100900460ff1661280f5760405162461bcd60e51b81526004016107f0906136ba565b61281a600285611aa3565b604080516020808201839052600e60608301526d212924a223a2afa6a0a720a3a2a960911b6080808401919091528284018990528351808403909101815260a0830184528051908201207f599a80fcaa47b95e2323ab4d34d34e0cc9feda4b843edafcc30c7bdf60ea15bf60c08401527fe4d2346818310a10fac5a6d073d3dce255578caf4aa81ddcbcc7c2b98405eef060e08401527f2a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4de61010084015261012080840191909152835180840390910181526101409092019092528051910120600155612907818385610de9565b506106b46003611b2e565b806005600084600581111561292957612929612ee5565b600581111561293a5761293a612ee5565b8152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600581111561297857612978612ee5565b6040517f356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d90600090a35050565b600160006129b46105fb611218565b805190915060008190036129c9575050610709565b6000816001600160401b038111156129e3576129e361301c565b604051908082528060200260200182016040528015612a0c578160200160208202803683370190505b5090506000826001600160401b03811115612a2957612a2961301c565b604051908082528060200260200182016040528015612a5c57816020015b6060815260200190600190039081612a475790505b50905060008787604051602001612a7492919061387f565b6040516020818303038152906040529050600081604051602401612a989190613827565b60408051601f198184030181529190526020810180516001600160e01b03166325da93a560e11b179052905060005b85811015612c8157868181518110612ae157612ae16134ee565b60200260200101516001600160a01b031683604051612b00919061380b565b6000604051808303816000865af19150503d8060008114612b3d576040519150601f19603f3d011682016040523d82523d6000602084013e612b42565b606091505b50868381518110612b5557612b556134ee565b60200260200101868481518110612b6e57612b6e6134ee565b6020026020010182905282151515158152505050848181518110612b9457612b946134ee565b6020026020010151612c7957868181518110612bb257612bb26134ee565b60200260200101516001600160a01b031682604051612bd1919061380b565b6000604051808303816000865af19150503d8060008114612c0e576040519150601f19603f3d011682016040523d82523d6000602084013e612c13565b606091505b50868381518110612c2657612c266134ee565b60200260200101868481518110612c3f57612c3f6134ee565b6020026020010182905282151515158152505050878015612c765750848181518110612c6d57612c6d6134ee565b60200260200101515b97505b600101612ac7565b507fc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b6382878686604051612cb794939291906138b0565b60405180910390a150505050505092915050565b6000818152600183016020526040812054612d1257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610709565b506000610709565b600481905560405181907fe5cd1c123a8cf63fa1b7229678db61fe8ae99dbbd27889370b6667c8cae97da190600090a250565b60008083601f840112612d5f57600080fd5b5081356001600160401b03811115612d7657600080fd5b6020830191508360208260051b85010111156119c657600080fd5b60008060008060008060608789031215612daa57600080fd5b86356001600160401b0380821115612dc157600080fd5b612dcd8a838b01612d4d565b90985096506020890135915080821115612de657600080fd5b612df28a838b01612d4d565b90965094506040890135915080821115612e0b57600080fd5b50612e1889828a01612d4d565b979a9699509497509295939492505050565b60008060208385031215612e3d57600080fd5b82356001600160401b03811115612e5357600080fd5b612e5f85828601612d4d565b90969095509350505050565b60008151808452602080850194506020840160005b83811015612ea55781516001600160a01b031687529582019590820190600101612e80565b509495945050505050565b6020815260006107066020830184612e6b565b60008060408385031215612ed657600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60006060808352612f0f6060840187612e6b565b83810360208581019190915286518083528782019282019060005b81811015612f5657845160028110612f4457612f44612ee5565b83529383019391830191600101612f2a565b50506040925085810360408701528087518083528383019150838901925060005b81811015612fa7578351805160ff1684528581015186850152860151868401529284019291860191600101612f77565b50909a9950505050505050505050565b80356001600160a01b0381168114610cba57600080fd5b600080600060608486031215612fe357600080fd5b8335925060208401359150612ffa60408501612fb7565b90509250925092565b60006020828403121561301557600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561305a5761305a61301c565b604052919050565b60006001600160401b0382111561307b5761307b61301c565b5060051b60200190565b600082601f83011261309657600080fd5b813560206130ab6130a683613062565b613032565b8083825260208201915060208460051b8701019350868411156130cd57600080fd5b602086015b848110156130f0576130e381612fb7565b83529183019183016130d2565b509695505050505050565b600082601f83011261310c57600080fd5b8135602061311c6130a683613062565b8083825260208201915060208460051b87010193508684111561313e57600080fd5b602086015b848110156130f05780356001600160601b03811681146131635760008081fd5b8352918301918301613143565b600082601f83011261318157600080fd5b813560206131916130a683613062565b8083825260208201915060208460051b8701019350868411156131b357600080fd5b602086015b848110156130f0578035600681106131d05760008081fd5b83529183019183016131b8565b60008060008060008060008060008060006101608c8e0312156131ff57600080fd5b8b359a5060208c0135995060408c0135985060608c0135975061322460808d01612fb7565b96506001600160401b0360a08d013581101561323f57600080fd5b61324f8e60a08f01358f01613085565b96508060c08e0135111561326257600080fd5b6132728e60c08f01358f01613085565b95508060e08e0135111561328557600080fd5b6132958e60e08f01358f01613085565b9450806101008e013511156132a957600080fd5b6132ba8e6101008f01358f016130fb565b9350806101208e013511156132ce57600080fd5b6132df8e6101208f01358f01613170565b9250806101408e013511156132f357600080fd5b506133058d6101408e01358e01613085565b90509295989b509295989b9093969950565b60006020828403121561332957600080fd5b61070682612fb7565b6001600160a01b0391909116815260200190565b6000806040838503121561335957600080fd5b82356001600160401b038082111561337057600080fd5b61337c86838701613170565b9350602085013591508082111561339257600080fd5b5061339f85828601613085565b9150509250929050565b600080604083850312156133bc57600080fd5b823591506133cc60208401612fb7565b90509250929050565b803560108110610cba57600080fd5b600080604083850312156133f757600080fd5b613400836133d5565b91506133cc60208401612fb7565b60a081016005871061342257613422612ee5565b95815260208101949094526040840192909252606083015260809091015290565b60008151808452602080850194506020840160005b83811015612ea55781516001600160601b031687529582019590820190600101613458565b6060815260006134906060830186612e6b565b82810360208401526134a28186612e6b565b905082810360408401526134b68185613443565b9695505050505050565b6020815260006107066020830184613443565b6000602082840312156134e557600080fd5b610706826133d5565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761070957610709613504565b8082018082111561070957610709613504565b8181038181111561070957610709613504565b60008261357457634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031991909116815260200190565b60208101601083106135a2576135a2612ee5565b91905290565b6001600160e01b03198316815260408101600b83106135c9576135c9612ee5565b8260208301529392505050565b6001600160601b03818116838216019080821115610a7d57610a7d613504565b60008151808452602080850194506020840160005b83811015612ea557815115158752958201959082019060010161360b565b60608152600061363c6060830186612e6b565b828103602084015261364e8186613443565b905082810360408401526134b681856135f6565b60808152600061367560808301876135f6565b82810360208401526136878187613443565b9050828103604084015261369b8186612e6b565b905082810360608401526136af8185612e6b565b979650505050505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60006001820161371757613717613504565b5060010190565b634e487b7160e01b600052603160045260246000fd5b6040815260006137476040830185612e6b565b828103602084015261375981856135f6565b95945050505050565b60408152600061377560408301856135f6565b82810360208401526137598185612e6b565b60005b838110156137a257818101518382015260200161378a565b50506000910152565b600081518084526137c3816020860160208601613787565b601f01601f19169290920160200192915050565b6001600160a01b03841681526001600160e01b031983166020820152606060408201819052600090613759908301846137ab565b6000825161381d818460208701613787565b9190910192915050565b60208152600061070660208301846137ab565b6001600160e01b03199290921682526001600160a01b0316602082015260400190565b60006020828403121561386f57600080fd5b8151801515811461124957600080fd5b6001600160e01b03198316815281516000906138a2816004850160208701613787565b919091016004019392505050565b6080815260006138c360808301876137ab565b6020838203818501526138d68288612e6b565b915083820360408501526138ea82876135f6565b915083820360608501528185518084528284019150828160051b85010183880160005b8381101561393b57601f198784030185526139298383516137ab565b9486019492509085019060010161390d565b50909b9a505050505050505050505056fea2646970667358221220d83003b43962afe3120b34eb387ecaaf4912a01d9c682ac0fb953cf65d90b77c64736f6c63430008170033", + "nonce": "0x2f122" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x11b14dd94c5c6b85e8581a63e247176240a6fcb8da8df2570508475c2550ec34", + "transactionType": "CREATE", + "contractName": "TransparentUpgradeableProxyV2", + "contractAddress": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "function": null, + "arguments": [ + "0xD05A72c0A593983Aa8336C997736e2172E745fF1", + "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "0x7d4c1d780000000000000000000000000000000000000000000000000000000000000007000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000007e50000000000000000000000000000000000000000000000000000000000127500000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca00000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000003600000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000002e82d2b56f858f79deef11b160bfc4631873da2b000000000000000000000000bcb61783dd2403fe8cc9b89b27b1a9bb03d040cb000000000000000000000000b266bf53cf7eac4e2065a404598dcb0e15e9462c000000000000000000000000cc5fc5b6c8595f56306da736f6cd02ed9141c84a0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000d24d87ddc1917165435b306aac68d99e0f49a3fa000000000000000000000000b033ba62ec622dc54d0abfe0254e79692147ca26000000000000000000000000087d08e3ba42e64e3948962dd1371f906d1278b900000000000000000000000052ec2e6bbce45afff8955da6410bb13812f4289f000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000005000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab95" + ], + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x2b7868", + "value": "0x0", + "data": "0x608060405260405162000eed38038062000eed833981016040819052620000269162000429565b8282828281620000398282600062000053565b506200004790508262000085565b5050505050506200055c565b6200005e83620000f7565b6000825111806200006c5750805b1562000080576200007e838362000139565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f620000c760008051602062000ea6833981519152546001600160a01b031690565b604080516001600160a01b03928316815291841660208301520160405180910390a1620000f48162000168565b50565b620001028162000206565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606062000161838360405180606001604052806027815260200162000ec6602791396200029d565b9392505050565b6001600160a01b038116620001d35760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b8060008051602062000ea68339815191525b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002118162000383565b620002755760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620001ca565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc620001e5565b6060620002aa8462000383565b620003075760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401620001ca565b600080856001600160a01b03168560405162000324919062000509565b600060405180830381855af49150503d806000811462000361576040519150601f19603f3d011682016040523d82523d6000602084013e62000366565b606091505b5090925090506200037982828662000392565b9695505050505050565b6001600160a01b03163b151590565b60608315620003a357508162000161565b825115620003b45782518084602001fd5b8160405162461bcd60e51b8152600401620001ca919062000527565b80516001600160a01b0381168114620003e857600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200042057818101518382015260200162000406565b50506000910152565b6000806000606084860312156200043f57600080fd5b6200044a84620003d0565b92506200045a60208501620003d0565b60408501519092506001600160401b03808211156200047857600080fd5b818601915086601f8301126200048d57600080fd5b815181811115620004a257620004a2620003ed565b604051601f8201601f19908116603f01168101908382118183101715620004cd57620004cd620003ed565b81604052828152896020848701011115620004e757600080fd5b620004fa83602083016020880162000403565b80955050505050509250925092565b600082516200051d81846020870162000403565b9190910192915050565b60208152600082518060208401526200054881604085016020870162000403565b601f01601f19169190910160400192915050565b61093a806200056c6000396000f3fe6080604052600436106100595760003560e01c80633659cfe6146100705780634bb5274a146100905780634f1ef286146100a35780635c60da1b146100b65780638f283970146100e7578063f851a4401461010757610068565b366100685761006661011c565b005b61006661011c565b34801561007c57600080fd5b5061006661008b3660046106c7565b610136565b61006661009e3660046106f8565b610173565b6100666100b13660046107a8565b6101b8565b3480156100c257600080fd5b506100cb61021f565b6040516001600160a01b03909116815260200160405180910390f35b3480156100f357600080fd5b506100666101023660046106c7565b610250565b34801561011357600080fd5b506100cb610270565b610124610291565b61013461012f610326565b610330565b565b61013e61034f565b6001600160a01b0316330361016b5761016881604051806020016040528060008152506000610370565b50565b61016861011c565b61017b61034f565b6001600160a01b0316330361016b576000610194610326565b9050600080835160208501845af43d6000803e8080156101b3573d6000f35b3d6000fd5b6101c061034f565b6001600160a01b03163303610217576102128383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525060019250610370915050565b505050565b61021261011c565b600061022961034f565b6001600160a01b0316330361024557610240610326565b905090565b61024d61011c565b90565b61025861034f565b6001600160a01b0316330361016b576101688161039b565b600061027a61034f565b6001600160a01b031633036102455761024061034f565b61029961034f565b6001600160a01b031633036101345760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006102406103ef565b3660008037600080366000845af43d6000803e8080156101b3573d6000f35b600060008051602061089e8339815191525b546001600160a01b0316919050565b61037983610405565b6000825111806103865750805b15610212576103958383610445565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103c461034f565b604080516001600160a01b03928316815291841660208301520160405180910390a161016881610471565b60006000805160206108be833981519152610361565b61040e81610508565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061046a83836040518060600160405280602781526020016108de60279139610588565b9392505050565b6001600160a01b0381166104d65760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b606482015260840161031d565b8060008051602061089e8339815191525b80546001600160a01b0319166001600160a01b039290921691909117905550565b61051181610663565b6105735760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161031d565b806000805160206108be8339815191526104e7565b606061059384610663565b6105ee5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161031d565b600080856001600160a01b031685604051610609919061084e565b600060405180830381855af49150503d8060008114610644576040519150601f19603f3d011682016040523d82523d6000602084013e610649565b606091505b5091509150610659828286610672565b9695505050505050565b6001600160a01b03163b151590565b6060831561068157508161046a565b8251156106915782518084602001fd5b8160405162461bcd60e51b815260040161031d919061086a565b80356001600160a01b03811681146106c257600080fd5b919050565b6000602082840312156106d957600080fd5b61046a826106ab565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561070a57600080fd5b81356001600160401b038082111561072157600080fd5b818401915084601f83011261073557600080fd5b813581811115610747576107476106e2565b604051601f8201601f19908116603f0116810190838211818310171561076f5761076f6106e2565b8160405282815287602084870101111561078857600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000806000604084860312156107bd57600080fd5b6107c6846106ab565b925060208401356001600160401b03808211156107e257600080fd5b818601915086601f8301126107f657600080fd5b81358181111561080557600080fd5b87602082850101111561081757600080fd5b6020830194508093505050509250925092565b60005b8381101561084557818101518382015260200161082d565b50506000910152565b6000825161086081846020870161082a565b9190910192915050565b602081526000825180602084015261088981604085016020870161082a565b601f01601f1916919091016040019291505056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212205d5db908d6bad5bfc298cb89bc49c38963bb1499be9336506651cff965fb333264736f6c63430008170033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564000000000000000000000000d05a72c0a593983aa8336c997736e2172e745ff1000000000000000000000000968d0cd7343f711216817e617d3f92a23dc91c07000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000004e47d4c1d780000000000000000000000000000000000000000000000000000000000000007000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000007e50000000000000000000000000000000000000000000000000000000000127500000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca00000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000003600000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000002e82d2b56f858f79deef11b160bfc4631873da2b000000000000000000000000bcb61783dd2403fe8cc9b89b27b1a9bb03d040cb000000000000000000000000b266bf53cf7eac4e2065a404598dcb0e15e9462c000000000000000000000000cc5fc5b6c8595f56306da736f6cd02ed9141c84a0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000d24d87ddc1917165435b306aac68d99e0f49a3fa000000000000000000000000b033ba62ec622dc54d0abfe0254e79692147ca26000000000000000000000000087d08e3ba42e64e3948962dd1371f906d1278b900000000000000000000000052ec2e6bbce45afff8955da6410bb13812f4289f000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000005000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab9500000000000000000000000000000000000000000000000000000000", + "nonce": "0x2f123" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0xfcd1ca2649e9cba542fd73c3fd0856b6199140862c65eac401c3ebff94085064", + "transactionType": "CREATE", + "contractName": "RoninBridgeManager", + "contractAddress": "0x64D21e91c2Cb367D2972E0bC377CFEa4e55F3685", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0xa304fa", + "value": "0x0", + "data": "0x60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b615f2b80620000f46000396000f3fe608060405234801561001057600080fd5b506004361061020f5760003560e01c806301a5f43f1461021457806306aba0e1146102295780630a44fa43146102445780630f7c31891461025757806315702f051461026c5780631c905e391461027f5780631f425338146102a15780632c5e6520146102b45780632d6d7d73146102d757806334d5f37b146102ea57806335da81211461030a5780633644e5151461031d5780636a61b16c146103265780637de5dedd146103395780637f7fe05814610341578063800eaab314610361578063828fc1a114610374578063865e6fd31461038757806386ccbf121461039a578063901979d5146103ad57806390264e59146103d85780639570abab146103eb57806397d6ae16146103fe5780639a7d3382146104115780639b19dbfd14610424578063a54f8a091461042c578063a64a83801461043f578063aee1767f14610452578063b384abef14610465578063b405aaf2146104c0578063b5d6e110146104d3578063b9c36209146104e6578063bc4e068f146104f9578063bc96180b1461050c578063bc9e0a5514610514578063c441c4a814610527578063cc7e6b3b1461053e578063d0a50db01461055e578063d78392f814610566578063dafae40814610579578063dd1f89141461058c578063de981f1b1461059f578063e75235b8146105b2578063e9c03498146105c8578063f80b5352146105db575b600080fd5b61022761022236600461497a565b6105e3565b005b610231610692565b6040519081526020015b60405180910390f35b610231610252366004614a13565b6106a1565b61025f610726565b60405161023b9190614aa6565b61022761027a366004614ad0565b610738565b61029261028d366004614bbe565b610842565b60405161023b93929190614c0a565b6102276102af366004614a13565b61085e565b6102c76102c2366004614cbd565b6108fd565b604051901515815260200161023b565b61025f6102e5366004614a13565b61090a565b6102316102f8366004614cf2565b60026020526000908152604090205481565b610227610318366004614a13565b610951565b61023160015481565b610227610334366004614d1e565b610999565b6102316109ae565b61035461034f366004614d52565b610a04565b60405161023b9190614d6d565b61022761036f366004614f18565b610a80565b6102c7610382366004614f7b565b610ab8565b610227610395366004614fb6565b610ac6565b6102276103a8366004615024565b610ae1565b6103c06103bb366004614d52565b610aee565b6040516001600160601b03909116815260200161023b565b6102276103e63660046150ca565b610b24565b6102276103f9366004615105565b610b43565b61022761040c366004615024565b610bda565b61022761041f366004614bbe565b610bf1565b61025f610c3e565b61022761043a3660046151f4565b610ca9565b61022761044d366004614cf2565b610cc5565b610354610460366004614d52565b610cd6565b6104af610473366004614bbe565b600360208181526000938452604080852090915291835291208054600182015460028301549383015460069093015460ff909216939092909185565b60405161023b959493929190615238565b6102c76104ce366004614d52565b610ce8565b6102276104e13660046150ca565b610d20565b6102276104f4366004614bbe565b610d2d565b610292610507366004614cf2565b610d3f565b600454610231565b61022761052236600461526d565b610d5c565b61052f610dbb565b60405161023b939291906152db565b61055161054c366004614a13565b610e95565b60405161023b9190615314565b610231610ed3565b6103c0610574366004614d52565b610ee6565b6102c7610587366004614cf2565b610ef1565b61022761059a366004615327565b610f2d565b6103546105ad366004615419565b61103a565b6105ba61109c565b60405161023b929190615434565b6102276105d6366004614a13565b6110be565b61025f611107565b6105eb61116a565b61068986868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808a02828101820190935289825290935089925088918291850190849080828437600092019190915250506040805160208089028281018201909352888252909350889250879182918501908490808284376000920191909152506111c692505050565b50505050505050565b600061069c611528565b905090565b60008282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506106e2925083915061153b9050565b61071e84848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061157092505050565b949350505050565b606061069c6107336115f5565b611619565b6107413361162d565b6108346040518061010001604052806107598e61166f565b81526020018d81526020018c81526020018b6001600160a01b031681526020018a8a808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050908252506040805160208a810282810182019093528a82529283019290918b918b9182918501908490808284376000920191909152505050908252506020016107f4868861550d565b815260200184848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050509152503361171f565b505050505050505050505050565b6060806060610851858561181e565b9250925092509250925092565b61086661116a565b8181808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506108a5925083915061153b9050565b60006108af6115f5565b905060005b838110156108f6576108ed8585838181106108d1576108d161551a565b90506020020160208101906108e69190614d52565b8390611bf5565b506001016108b4565b5050505050565b600061071e848484611c0a565b606061094883838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250611c2d915050565b90505b92915050565b61095961116a565b610995828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611d8092505050565b5050565b6109ab6109a5826155af565b33611e33565b50565b6000806109b9611eff565b90506000806109c661109c565b91509150806001828560040154856109de91906156ab565b6109e891906156c2565b6109f291906156d5565b6109fc91906156e8565b935050505090565b6000806000610a1a610a14611eff565b85611f23565b9150915081610a47578360405163141e2e1f60e11b8152600401610a3e9190614d6d565b60405180910390fd5b610a4f611eff565b6001018181548110610a6357610a6361551a565b6000918252602090912001546001600160a01b0316949350505050565b333014610aae576000356001600160e01b0319166040516307337e1960e41b8152600401610a3e919061570a565b6109958282611f88565b600061094860008484611c0a565b610ace61116a565b610ad781612031565b610995828261205e565b6108f685858585856120e9565b600080610af9611eff565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b031690565b610b2d3361162d565b610b3b858585858533612182565b505050505050565b610b4c3361162d565b610bce8a89898c8a8a80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610b9392508b91508c905061550d565b8888808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152503392506121c1915050565b50505050505050505050565b610be33361162d565b6108f685858585853361231b565b600082815260036020908152604080832084845290915281206001810154909103610c2f5760405163713b099760e11b815260040160405180910390fd5b610c388161233a565b50505050565b6060610c48611eff565b600101805480602002602001604051908101604052809291908181526020018280548015610c9f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610c81575b5050505050905090565b610cb23361162d565b61099533610cbf846155af565b8361254f565b610ccd61116a565b6109ab8161264f565b6000610ce1826126bc565b5092915050565b600080610cf3611eff565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b0316151590565b6108f68585858585612733565b610d3561116a565b61099582826127e9565b6060806060610d4f60008561181e565b9250925092509193909250565b6109ab6109a5610dac610d72606085018561571f565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525060019250611c2d915050565b610db584615768565b9061289b565b60608060606000610dca611eff565b805460408051602080840282018101909252828152929350839190830182828015610e1e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610e00575b5050505050935080600101805480602002602001604051908101604052809291908181526020018280548015610e7d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610e5f575b50505050509250610e8d846129a1565b915050909192565b60606109488383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506129a192505050565b6000610edd611eff565b60010154919050565b600061094b82612a86565b600080610efc612abb565b9050610f06611528565b8160010154610f1591906156ab565b6002820154610f2490856156ab565b10159392505050565b610f363361162d565b6000604051806101000160405280610f4d4661166f565b81526020014681526020018d81526020018c6001600160a01b031681526020018b8b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050908252506040805160208b810282810182019093528b82529283019290918c918c918291850190849080828437600092019190915250505090825250602001610fe8878961550d565b81526020018585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050915250905061102e813361171f565b5061083433828461254f565b6000611044612adf565b600083600f81111561105857611058614be0565b60ff1681526020810191909152604001600020546001600160a01b0316905080611097578160405163409140df60e11b8152600401610a3e9190615843565b919050565b60008060006110a9612abb565b90508060010154816002015492509250509091565b6110c661116a565b611102828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612b0392505050565b505050565b6060611111611eff565b805460408051602080840282018101909252828152929190830182828015610c9f576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610c81575050505050905090565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031633146111c4576000356001600160e01b0319166001604051620f948f60ea1b8152600401610a3e92919061585d565b565b60606111d28383612ee9565b6111db8161153b565b60006111e5611eff565b8451875191925090811480156111fb5750855181145b611226576000356001600160e01b0319166040516306b5667560e21b8152600401610a3e919061570a565b806001600160401b0381111561123e5761123e614d81565b604051908082528060200260200182016040528015611267578160200160208202803683370190505b50935080600003611279575050611520565b60008060008060005b8581101561148c578a818151811061129c5761129c61551a565b602002602001015194508981815181106112b8576112b861551a565b602002602001015193508b81815181106112d4576112d461551a565b602002602001015192506112e785612ff3565b6112f084612ff3565b826001600160601b0316600003611328576000356001600160e01b031916604051637f11b8a360e11b8152600401610a3e919061570a565b6001600160a01b03808616600081815260038a01602090815260408083205494891683528083205460028d0190925280832054938352909120546001600160601b03938416939182169261138092908116911661588b565b61138a919061588b565b611394919061588b565b6001600160601b03166000148982815181106113b2576113b261551a565b6020026020010190151590811515815250508881815181106113d6576113d661551a565b602002602001015115611484578654600181810189556000898152602080822090930180546001600160a01b03808b166001600160a01b0319928316811790935591835260028c018552604080842080546001600160601b038b166001600160601b03199182168117909255868f018054978801815586528786209096018054948c1694909316841790925591835260038c01909452902080549091168217905561148190836156c2565b91505b600101611282565b50808660040160008282546114a191906156c2565b90915550506040516114dc906347c28ec560e11b906114c8908c908f908d906020016158de565b604051602081830303815290604052613028565b7f897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b78888c8c8c6040516115119493929190615917565b60405180910390a15050505050505b509392505050565b6000611532611eff565b60040154905090565b61154481613055565b156109ab576000356001600160e01b031916604051630d697db160e11b8152600401610a3e919061570a565b60008161157c8161153b565b6000611586611eff565b905060005b84518110156115ed578160020160008683815181106115ac576115ac61551a565b6020908102919091018101516001600160a01b03168252810191909152604001600020546115e3906001600160601b0316856156c2565b935060010161158b565b505050919050565b7f5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd97624090565b60606000611626836130f4565b9392505050565b61163681612a86565b6001600160601b03166000036109ab576000356001600160e01b0319166003604051620f948f60ea1b8152600401610a3e92919061585d565b6000818152600260205260408120549081900361169e5750600090815260026020526040902060019081905590565b60008281526003602090815260408083208484529091528120906116c18261233a565b905080611718576000825460ff1660048111156116e0576116e0614be0565b036116fe5760405163757a436360e01b815260040160405180910390fd5b600084815260026020526040902080546001019081905592505b5050919050565b602082015160009080820361175a576000356001600160e01b03191660004660405163092048d160e11b8152600401610a3e93929190615964565b600454611768908590613150565b6000611773856131f1565b905061177e8261166f565b600083815260036020908152604080832084845290915290819020908701519194506117ab91839061333b565b845183146117da576000356001600160e01b03191660405163d4cec26960e01b8152600401610a3e919061570a565b8083837fd1221ffb98610024a29755d7db3c71692310f43a7cfcce7ee488a8c7e9e0bfa4888860405161180e929190615aff565b60405180910390a4505092915050565b6000828152600360209081526040808320848452909152812060048101546005820154606093849384939092909161185682846156c2565b9050806001600160401b0381111561187057611870614d81565b604051908082528060200260200182016040528015611899578160200160208202803683370190505b509550806001600160401b038111156118b4576118b4614d81565b6040519080825280602002602001820160405280156118ed57816020015b6118da614896565b8152602001906001900390816118d25790505b509450806001600160401b0381111561190857611908614d81565b604051908082528060200260200182016040528015611931578160200160208202803683370190505b50965060005b83811015611a865760008782815181106119535761195361551a565b6020026020010190600181111561196c5761196c614be0565b9081600181111561197f5761197f614be0565b90525060008a81526003602090815260408083208c8452909152812060048701805460079092019291849081106119b8576119b861551a565b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815460ff16815260018201549381019390935260020154908201528651879083908110611a1657611a1661551a565b6020026020010181905250846004018181548110611a3657611a3661551a565b9060005260206000200160009054906101000a90046001600160a01b0316888281518110611a6657611a6661551a565b6001600160a01b0390921660209283029190910190910152600101611937565b5060005b82811015611be957600187611a9f86846156c2565b81518110611aaf57611aaf61551a565b60200260200101906001811115611ac857611ac8614be0565b90816001811115611adb57611adb614be0565b90525060008a81526003602090815260408083208c845290915281206005870180546007909201929184908110611b1457611b1461551a565b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815460ff168152600182015493810193909352600201549082015286611b6986846156c2565b81518110611b7957611b7961551a565b6020026020010181905250846005018181548110611b9957611b9961551a565b6000918252602090912001546001600160a01b031688611bb986846156c2565b81518110611bc957611bc961551a565b6001600160a01b0390921660209283029190910190910152600101611a8a565b50505050509250925092565b6000610948836001600160a01b03841661334b565b6000838152600360209081526040808320858452909152812061071e908361343e565b606082516001600160401b03811115611c4857611c48614d81565b604051908082528060200260200182016040528015611c71578160200160208202803683370190505b50905060005b8351811015610ce15760056000858381518110611c9657611c9661551a565b60200260200101516005811115611caf57611caf614be0565b6005811115611cc057611cc0614be0565b815260200190815260200160002060009054906101000a90046001600160a01b0316828281518110611cf457611cf461551a565b60200260200101906001600160a01b031690816001600160a01b031681525050828015611d4c575060006001600160a01b0316828281518110611d3957611d3961551a565b60200260200101516001600160a01b0316145b15611d78576000356001600160e01b03191660405163053265f160e01b8152600401610a3e919061570a565b600101611c77565b80611d8a8161153b565b6000611d946115f5565b905060008060005b8551811015610b3b57858181518110611db757611db761551a565b60200260200101519250611dca83612031565b611ddb836312c0151560e21b613460565b611de584846135f3565b604080516001600160a01b038616815282151560208201529193507fb85c58eeff9fe423669ae0841666f4c8499e8731b8275eb462e4fa1720ec420e910160405180910390a1600101611d9c565b6000611e3e836131f1565b602080850151600090815260038252604080822087518352909252206001810154919250908214611e89576001810154604051632bee7fdb60e21b8152610a3e918491600401615434565b6001815460ff166004811115611ea157611ea1614be0565b14611ebf57604051632c2f3bdf60e01b815260040160405180910390fd5b83606001516001600160a01b0316836001600160a01b031614611ef55760405163e61090ab60e01b815260040160405180910390fd5b610c388185613608565b7fc648703095712c0419b6431ae642c061f0a105ac2d7c3d9604061ef4ebc3830090565b60008060005b8454811015611f7657848181548110611f4457611f4461551a565b6000918252602090912001546001600160a01b0390811690851603611f6e57600192509050611f81565b600101611f29565b506000600019915091505b9250929050565b60005b825181101561110257306001600160a01b0316828281518110611fb057611fb061551a565b60200260200101516001600160a01b031603611fed576000356001600160e01b03191660405163053265f160e01b8152600401610a3e919061570a565b6120298382815181106120025761200261551a565b602002602001015183838151811061201c5761201c61551a565b6020026020010151613675565b600101611f8b565b806001600160a01b03163b6000036109ab5780604051630bfc64a360e21b8152600401610a3e9190614d6d565b80612067612adf565b600084600f81111561207b5761207b614be0565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f8111156120bc576120bc614be0565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b60006120fc6120f7876155af565b6131f1565b60208088013560009081526003825260408082208a3583529092522060010154909150811461216157602080870135600090815260038252604080822089358352909252819020600101549051632bee7fdb60e21b8152610a3e918391600401615434565b610b3b61216d876155af565b8686868661217d6120f78d6155af565b613708565b61218a6148b6565b61219c61219688615768565b836139d1565b90506121b7818787878761217d6121b28e615768565b613abe565b9695505050505050565b60006121cd600061166f565b905060006040518060e001604052808381526020018b8152602001886001600160a01b031681526020018a8a80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093855250505060208083018a905260408084018a9052606090930188905282518c820281810183019094528c8152939450909261228d92612286928e918e9182919085019084908082843760009201919091525060019250611c2d915050565b839061289b565b90506122a46004548261315090919063ffffffff16565b60006122af826131f1565b6000858152600080516020615ed6833981519152602052604090209091506122d890828e61333b565b8084600080516020615eb6833981519152846122f387613abe565b878a6040516123059493929190615b6a565b60405180910390a3505050505050505050505050565b61232d612327876155af565b8261171f565b50610b3b61216d876155af565b600080825460ff16600481111561235357612353614be0565b148015612364575042826006015411155b905080156110975760018201546040517f58f98006a7f2f253f8ae8f8b7cec9008ca05359633561cd7c22f3005682d4a5590600090a260005b6004830154811015612450578260080160008460040183815481106123c4576123c461551a565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff19169055600484018054600786019291908490811061240d5761240d61551a565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff1916815560018181018390556002909101919091550161239d565b5060005b60058301548110156125075782600801600084600501838154811061247b5761247b61551a565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff1916905560058401805460078601929190849081106124c4576124c461551a565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff19168155600181810183905560029091019190915501612454565b50815460ff191682556000600183018190556002830181905560038301819055612535906004840190614904565b612543600583016000614904565b60006006830155919050565b4682602001511461258857602082015160405163092048d160e11b8152610a3e916001600160e01b031960003516914690600401615964565b6000612593836131f1565b602080850151600090815260038252604080822087518352909252206001015490915081146125f857602080840151600090815260038252604080822086518352909252819020600101549051632bee7fdb60e21b8152610a3e918391600401615434565b6000612602613bfd565b905060008161260f613c07565b61261991906156d5565b6126249060016156c2565b905061262e614896565b612645868685858b866126408e613c11565b613c2b565b5050505050505050565b6003811015612671576040516305f4dee960e31b815260040160405180910390fd5b600061267b611eff565b600581018390556040518381529091507f22d5bb5059ffe2949a098666fc198587200c8118483074120d3ca7050c7753f19060200160405180910390a15050565b6000806000806126d66126cd611eff565b60010186611f23565b91509150816126fa57846040516326527e1760e01b8152600401610a3e9190614d6d565b612702611eff565b8054829081106127145761271461551a565b6000918252602090912001546001600160a01b03169590945092505050565b6000612751612748610d72606089018961571f565b610db588615768565b9050600061275e826131f1565b60008080526003602090815284518252600080516020615ed68339815191529052604090206001015490915081146127d55760008080526003602090815283518252600080516020615ed68339815191529052604090819020600101549051632bee7fdb60e21b8152610a3e918391600401615434565b610689828787878761217d6121b28e615768565b808211806127f8575060018111155b15612824576000356001600160e01b0319166040516387f6f09560e01b8152600401610a3e919061570a565b600061282e612abb565b600181018054600283018054928790558590558254929350918490869085600061285783615c23565b919050557f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8858560405161288c929190615434565b60405180910390a45050505050565b6128a36148b6565b8251815260006020808301919091528301516040808301919091528301516001600160a01b0316606080830191909152830151516001600160401b038111156128ee576128ee614d81565b604051908082528060200260200182016040528015612917578160200160208202803683370190505b5060808083019190915283015160a08083019190915283015160c08083019190915283015160e082015260005b836060015151811015610ce1578281815181106129635761296361551a565b6020026020010151826080015182815181106129815761298161551a565b6001600160a01b0390921660209283029190910190910152600101612944565b606060006129ad611eff565b905082516001600160401b038111156129c8576129c8614d81565b6040519080825280602002602001820160405280156129f1578160200160208202803683370190505b50915060005b835181101561171857816002016000858381518110612a1857612a1861551a565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160601b0316838281518110612a6657612a6661551a565b6001600160601b03909216602092830291909101909101526001016129f7565b6000612a90611eff565b6001600160a01b0390921660009081526002929092016020525060409020546001600160601b031690565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f0090565b7fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb90565b606081612b0f8161153b565b6000612b19611eff565b8451909150806001600160401b03811115612b3657612b36614d81565b604051908082528060200260200182016040528015612b5f578160200160208202803683370190505b50935080600003612b71575050612ee3565b60058201548254612b839083906156d5565b1015612ba25760405163b2e765cb60e01b815260040160405180910390fd5b60008060008060005b85811015612e6957898181518110612bc557612bc561551a565b60200260200101519350612bd8846126bc565b9095509150612be685612ff3565b612bef84612ff3565b6001600160a01b03851660009081526002880160205260409020546001600160601b031615801590612c4357506001600160a01b03841660009081526003880160205260409020546001600160601b031615155b898281518110612c5557612c5561551a565b602002602001019015159081151581525050888181518110612c7957612c7961551a565b602002602001015115612e61576001600160a01b038516600090815260028801602052604081205488546001600160601b039091169190612cbc906001906156d5565b9050886000018181548110612cd357612cd361551a565b60009182526020909120015489546001600160a01b03909116908a9086908110612cff57612cff61551a565b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790558854899080612d3957612d39615c3c565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038916825260028b0190526040902080546001600160601b031916905560018901805482908110612d9957612d9961551a565b60009182526020909120015460018a0180546001600160a01b039092169186908110612dc757612dc761551a565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555088600101805480612e0857612e08615c3c565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038816825260038b0190526040902080546001600160601b0319169055612e5c82866156c2565b945050505b600101612bab565b5081866004016000828254612e7e91906156d5565b9091555050604051612ea390636242a4ef60e11b906114c8908c908c90602001615c52565b7fdf3dcd7987202f64648f3acdbf12401e3a2bb23e77e19f99826b5475cbb86369888a604051612ed4929190615c77565b60405180910390a15050505050505b50919050565b81518151606091908082016001600160401b03811115612f0b57612f0b614d81565b604051908082528060200260200182016040528015612f34578160200160208202803683370190505b50925060005b82811015612f8e57858181518110612f5457612f5461551a565b6020026020010151848281518110612f6e57612f6e61551a565b6001600160a01b0390921660209283029190910190910152600101612f3a565b60005b82811015612fe957858181518110612fab57612fab61551a565b6020026020010151858381518110612fc557612fc561551a565b6001600160a01b039092166020928302919091019091015260019182019101612f91565b5050505092915050565b6001600160a01b0381166109ab576000356001600160e01b03191660405163104c66df60e31b8152600401610a3e919061570a565b6130328282613f6b565b610995573382826040516319b5fdcb60e31b8152600401610a3e93929190615c9c565b6000815160000361306857506000919050565b60005b60018351038110156130eb57600181015b83518110156130e2578381815181106130975761309761551a565b60200260200101516001600160a01b03168483815181106130ba576130ba61551a565b60200260200101516001600160a01b0316036130da575060019392505050565b60010161307c565b5060010161306b565b50600092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561314457602002820191906000526020600020905b815481526020019060010190808311613130575b50505050509050919050565b600082608001515111801561316e57508160a0015151826080015151145b801561318357508160c0015151826080015151145b801561319857508160e0015151826080015151145b6131c3576000356001600160e01b0319166040516306b5667560e21b8152600401610a3e919061570a565b6131cd81426156c2565b826040015111156109955760405163ad89be9d60e01b815260040160405180910390fd5b60a0810151608082015160c083015151600092919083906001600160401b0381111561321f5761321f614d81565b604051908082528060200260200182016040528015613248578160200160208202803683370190505b5060e086015190915060005b82518110156132a7578660c0015181815181106132735761327361551a565b6020026020010151805190602001208382815181106132945761329461551a565b6020908102919091010152600101613254565b50604080517f1b59eeec7c321899dc1e7a5b3d876c9a445dffc6d2f96ba842d7489908fdee1281528751602080830191909152808901518284015291880151606080830191909152909701516080880152835181029381019390932060a0870152835183029383019390932060c0860152805182029082012060e08501528151810291012061010083015250610120902090565b6001830191909155600690910155565b6000818152600183016020526040812054801561343457600061336f6001836156d5565b8554909150600090613383906001906156d5565b90508181146133e85760008660000182815481106133a3576133a361551a565b90600052602060002001549050808760000184815481106133c6576133c661551a565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806133f9576133f9615c3c565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061094b565b600091505061094b565b6001600160a01b03166000908152600891909101602052604090205460ff1690565b600081604051602401613473919061570a565b60408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b1790525190915060009081906001600160a01b038616906134bc908590615cd0565b600060405180830381855afa9150503d80600081146134f7576040519150601f19603f3d011682016040523d82523d6000602084013e6134fc565b606091505b5091509150816135be57846001600160a01b0316836040516024016135219190615cec565b60408051601f198184030181529181526020820180516001600160e01b03166325da93a560e11b179052516135569190615cd0565b600060405180830381855afa9150503d8060008114613591576040519150601f19603f3d011682016040523d82523d6000602084013e613596565b606091505b509092509050816135be57838560405163069d427960e11b8152600401610a3e929190615cff565b808060200190518101906135d29190615d22565b6108f657838560405163069d427960e11b8152600401610a3e929190615cff565b6000610948836001600160a01b038416614291565b613611816142e0565b1561099557815460ff1916600217825560008061362d836142fa565b9150915083600101547fe134987599ae266ec90edeff1b26125b287dbb57b10822649432d1bb26537fba8383604051613667929190615d44565b60405180910390a250505050565b806005600084600581111561368c5761368c614be0565b600581111561369d5761369d614be0565b8152602081019190915260400160002080546001600160a01b0319166001600160a01b0392831617905581168260058111156136db576136db614be0565b6040517f356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d90600090a35050565b831580159061371657508382145b613741576000356001600160e01b0319166040516306b5667560e21b8152600401610a3e919061570a565b600061379a61374f60015490565b61375a8460006145a1565b60405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b905060006137b56137aa60015490565b61375a8560016145a1565b905060006137c1613bfd565b90506000816137ce613c07565b6137d891906156d5565b6137e39060016156c2565b90506000805b87811015610834573660008a8a848181106138065761380661551a565b606002919091019250600090508d8d858181106138255761382561551a565b905060200201602081019061383a9190615d69565b600181111561384b5761384b614be0565b0361387757613870886138616020850185615d95565b846020013585604001356145da565b90506138ee565b60018d8d8581811061388b5761388b61551a565b90506020020160208101906138a09190615d69565b60018111156138b1576138b1614be0565b036138c757613870876138616020850185615d95565b6000356001600160e01b031916604051630612418f60e11b8152600401610a3e919061570a565b806001600160a01b0316846001600160a01b03161061392e576000356001600160e01b031916604051635d3dcd3160e01b8152600401610a3e919061570a565b809350600061393c82613c11565b90508060000361396d576000356001600160e01b03191660405163726b3acb60e01b8152600401610a3e919061570a565b6139b08f8f8f878181106139835761398361551a565b90506020020160208101906139989190615d69565b8989866139aa368a90038a018a615db0565b87613c2b565b156139c357505050505050505050610b3b565b8360010193505050506137e9565b6139d96148b6565b6139f26139eb84606001516001611c2d565b849061289b565b9050613a096004548261315090919063ffffffff16565b6000613a14826131f1565b90506000613a22600061166f565b6000818152600080516020615ed68339815191526020908152604090912090870151919250613a5291849061333b565b82518114613a81576000356001600160e01b03191660405163d4cec26960e01b8152600401610a3e919061570a565b8181600080516020615eb683398151915285613a9c89613abe565b8989604051613aae9493929190615b6a565b60405180910390a3505092915050565b6080810151606082015160a083015151600092919083906001600160401b03811115613aec57613aec614d81565b604051908082528060200260200182016040528015613b15578160200160208202803683370190505b5060c086015190915060005b8251811015613b74578660a001518181518110613b4057613b4061551a565b602002602001015180519060200120838281518110613b6157613b6161551a565b6020908102919091010152600101613b21565b50604080517fde480f0c53a3651c08fbab1dffbc45fe574f31188827fe52cb9035da9fe57e4a8152875160208083019190915280890151828401529790910151606082015283518702938701939093206080840152835186029386019390932060a0830152805185029085012060c082015281518402919093012060e083015250610100902090565b600061069c6109ae565b600061069c610692565b6000613c1c82612a86565b6001600160601b031692915050565b60208088015188516000828152600384526040808220838352909452928320613c538161233a565b15613c645760019350505050613f60565b6020808c01516000908152600290915260409020548214613ca6576000356001600160e01b03191660405163d4cec26960e01b8152600401610a3e919061570a565b6000815460ff166004811115613cbe57613cbe614be0565b14613cdc576040516322de95ff60e21b815260040160405180910390fd5b613ce6818861343e565b15613d06578660405163025fd59560e41b8152600401610a3e9190614d6d565b6001600160a01b03871660009081526008820160209081526040909120805460ff19166001179055860151151580613d415750604086015115155b80613d4f5750855160ff1615155b15613d96576001600160a01b03871660009081526007820160209081526040918290208851815460ff191660ff909116178155908801516001820155908701516002909101555b866001600160a01b031681600101547f1203f9e81c814a35f5f4cc24087b2a24c6fb7986a9f1406b68a9484882c93a238c88604051613dd6929190615e10565b60405180910390a3600080808c6001811115613df457613df4614be0565b03613e49576004830180546001810182556000918252602082200180546001600160a01b0319166001600160a01b038c16179055600384018054899290613e3c9084906156c2565b9250508190559150613eae565b60018c6001811115613e5d57613e5d614be0565b036138c7576005830180546001810182556000918252602082200180546001600160a01b0319166001600160a01b038c16179055600284018054899290613ea59084906156c2565b92505081905590505b8a8210613f1457825460ff19166001908117845580840154604051919750907f5c819725ea53655a3b898f3df59b66489761935454e9212ca1e5ebd759953d0b90600090a260608d01516001600160a01b0316613f0f57613f0f838e613608565b613f5a565b898110613f5a57825460ff19166003178355600180840154604051919750907f55295d4ce992922fa2e5ffbf3a3dcdb367de0a15e125ace083456017fd22060f90600090a25b50505050505b979650505050505050565b60016000613f7a6107336115f5565b80519091506000819003613f8f57505061094b565b6000816001600160401b03811115613fa957613fa9614d81565b604051908082528060200260200182016040528015613fd2578160200160208202803683370190505b5090506000826001600160401b03811115613fef57613fef614d81565b60405190808252806020026020018201604052801561402257816020015b606081526020019060019003908161400d5790505b5090506000878760405160200161403a929190615e1e565b604051602081830303815290604052905060008160405160240161405e9190615cec565b60408051601f198184030181529190526020810180516001600160e01b03166325da93a560e11b179052905060005b85811015614247578681815181106140a7576140a761551a565b60200260200101516001600160a01b0316836040516140c69190615cd0565b6000604051808303816000865af19150503d8060008114614103576040519150601f19603f3d011682016040523d82523d6000602084013e614108565b606091505b5086838151811061411b5761411b61551a565b602002602001018684815181106141345761413461551a565b602002602001018290528215151515815250505084818151811061415a5761415a61551a565b602002602001015161423f578681815181106141785761417861551a565b60200260200101516001600160a01b0316826040516141979190615cd0565b6000604051808303816000865af19150503d80600081146141d4576040519150601f19603f3d011682016040523d82523d6000602084013e6141d9565b606091505b508683815181106141ec576141ec61551a565b602002602001018684815181106142055761420561551a565b602002602001018290528215151515815250505087801561423c57508481815181106142335761423361551a565b60200260200101515b97505b60010161408d565b507fc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b638287868660405161427d9493929190615e4f565b60405180910390a150505050505092915050565b60008181526001830160205260408120546142d85750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561094b565b50600061094b565b600081602001516000148061094b57505060200151461490565b606080614306836142e0565b61433857602083015160405163092048d160e11b8152610a3e916001600160e01b031960003516914690600401615964565b8260800151516001600160401b0381111561435557614355614d81565b60405190808252806020026020018201604052801561437e578160200160208202803683370190505b5091508260800151516001600160401b0381111561439e5761439e614d81565b6040519080825280602002602001820160405280156143d157816020015b60608152602001906001900390816143bc5790505b50905060005b83608001515181101561459b578360e0015181815181106143fa576143fa61551a565b60200260200101515a1161442d57614411846131f1565b6040516307aec4ab60e21b8152600401610a3e91815260200190565b836080015181815181106144435761444361551a565b60200260200101516001600160a01b03168460a00151828151811061446a5761446a61551a565b60200260200101518560e0015183815181106144885761448861551a565b6020026020010151908660c0015184815181106144a7576144a761551a565b60200260200101516040516144bc9190615cd0565b600060405180830381858888f193505050503d80600081146144fa576040519150601f19603f3d011682016040523d82523d6000602084013e6144ff565b606091505b508483815181106145125761451261551a565b6020026020010184848151811061452b5761452b61551a565b60200260200101829052821515151581525050508281815181106145515761455161551a565b602002602001015161459357808282815181106145705761457061551a565b60200260200101516040516376df417560e11b8152600401610a3e929190615e9c565b6001016143d7565b50915091565b604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b60008060006145eb87878787614602565b915091506145f8816146e5565b5095945050505050565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b0383111561462f57506000905060036146dc565b8460ff16601b1415801561464757508460ff16601c14155b1561465857506000905060046146dc565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156146ac573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166146d5576000600192509250506146dc565b9150600090505b94509492505050565b60008160048111156146f9576146f9614be0565b036147015750565b600181600481111561471557614715614be0565b0361475d5760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b6044820152606401610a3e565b600281600481111561477157614771614be0565b036147be5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610a3e565b60038160048111156147d2576147d2614be0565b0361482a5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610a3e565b600481600481111561483e5761483e614be0565b036109ab5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610a3e565b604080516060810182526000808252602082018190529181019190915290565b60405180610100016040528060008152602001600081526020016000815260200160006001600160a01b03168152602001606081526020016060815260200160608152602001606081525090565b50805460008255906000526020600020908101906109ab91905b80821115614932576000815560010161491e565b5090565b60008083601f84011261494857600080fd5b5081356001600160401b0381111561495f57600080fd5b6020830191508360208260051b8501011115611f8157600080fd5b6000806000806000806060878903121561499357600080fd5b86356001600160401b03808211156149aa57600080fd5b6149b68a838b01614936565b909850965060208901359150808211156149cf57600080fd5b6149db8a838b01614936565b909650945060408901359150808211156149f457600080fd5b50614a0189828a01614936565b979a9699509497509295939492505050565b60008060208385031215614a2657600080fd5b82356001600160401b03811115614a3c57600080fd5b614a4885828601614936565b90969095509350505050565b6001600160a01b03169052565b60008151808452602080850194506020840160005b83811015614a9b5781516001600160a01b031687529582019590820190600101614a76565b509495945050505050565b6020815260006109486020830184614a61565b80356001600160a01b038116811461109757600080fd5b600080600080600080600080600080600060e08c8e031215614af157600080fd5b8b359a5060208c01359950614b0860408d01614ab9565b98506001600160401b0360608d0135811015614b2357600080fd5b614b338e60608f01358f01614936565b909950975060808d0135811015614b4957600080fd5b614b598e60808f01358f01614936565b909750955060a08d0135811015614b6f57600080fd5b614b7f8e60a08f01358f01614936565b909550935060c08d0135811015614b9557600080fd5b50614ba68d60c08e01358e01614936565b81935080925050509295989b509295989b9093969950565b60008060408385031215614bd157600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60028110614c0657614c06614be0565b9052565b60006060808352614c1e6060840187614a61565b83810360208581019190915286518083528782019282019060005b81811015614c5c57614c4c838651614bf6565b9383019391830191600101614c39565b50506040925085810360408701528087518083528383019150838901925060005b81811015614cad578351805160ff1684528581015186850152860151868401529284019291860191600101614c7d565b50909a9950505050505050505050565b600080600060608486031215614cd257600080fd5b8335925060208401359150614ce960408501614ab9565b90509250925092565b600060208284031215614d0457600080fd5b5035919050565b60006101008284031215612ee357600080fd5b600060208284031215614d3057600080fd5b81356001600160401b03811115614d4657600080fd5b61071e84828501614d0b565b600060208284031215614d6457600080fd5b61094882614ab9565b6001600160a01b0391909116815260200190565b634e487b7160e01b600052604160045260246000fd5b60405161010081016001600160401b0381118282101715614dba57614dba614d81565b60405290565b60405160e081016001600160401b0381118282101715614dba57614dba614d81565b604051601f8201601f191681016001600160401b0381118282101715614e0a57614e0a614d81565b604052919050565b60006001600160401b03821115614e2b57614e2b614d81565b5060051b60200190565b600082601f830112614e4657600080fd5b81356020614e5b614e5683614e12565b614de2565b8083825260208201915060208460051b870101935086841115614e7d57600080fd5b602086015b84811015614ea757803560068110614e9a5760008081fd5b8352918301918301614e82565b509695505050505050565b600082601f830112614ec357600080fd5b81356020614ed3614e5683614e12565b8083825260208201915060208460051b870101935086841115614ef557600080fd5b602086015b84811015614ea757614f0b81614ab9565b8352918301918301614efa565b60008060408385031215614f2b57600080fd5b82356001600160401b0380821115614f4257600080fd5b614f4e86838701614e35565b93506020850135915080821115614f6457600080fd5b50614f7185828601614eb2565b9150509250929050565b60008060408385031215614f8e57600080fd5b82359150614f9e60208401614ab9565b90509250929050565b80356010811061109757600080fd5b60008060408385031215614fc957600080fd5b614fd283614fa7565b9150614f9e60208401614ab9565b60008083601f840112614ff257600080fd5b5081356001600160401b0381111561500957600080fd5b602083019150836020606083028501011115611f8157600080fd5b60008060008060006060868803121561503c57600080fd5b85356001600160401b038082111561505357600080fd5b61505f89838a01614d0b565b9650602088013591508082111561507557600080fd5b61508189838a01614936565b9096509450604088013591508082111561509a57600080fd5b506150a788828901614fe0565b969995985093965092949392505050565b600060e08284031215612ee357600080fd5b6000806000806000606086880312156150e257600080fd5b85356001600160401b03808211156150f957600080fd5b61505f89838a016150b8565b60008060008060008060008060008060c08b8d03121561512457600080fd5b8a35995061513460208c01614ab9565b985060408b01356001600160401b038082111561515057600080fd5b61515c8e838f01614936565b909a50985060608d013591508082111561517557600080fd5b6151818e838f01614936565b909850965060808d013591508082111561519a57600080fd5b6151a68e838f01614936565b909650945060a08d01359150808211156151bf57600080fd5b506151cc8d828e01614936565b915080935050809150509295989b9194979a5092959850565b80356002811061109757600080fd5b6000806040838503121561520757600080fd5b82356001600160401b0381111561521d57600080fd5b61522985828601614d0b565b925050614f9e602084016151e5565b60a081016005871061524c5761524c614be0565b95815260208101949094526040840192909252606083015260809091015290565b60006020828403121561527f57600080fd5b81356001600160401b0381111561529557600080fd5b61071e848285016150b8565b60008151808452602080850194506020840160005b83811015614a9b5781516001600160601b0316875295820195908201906001016152b6565b6060815260006152ee6060830186614a61565b82810360208401526153008186614a61565b905082810360408401526121b781856152a1565b60208152600061094860208301846152a1565b600080600080600080600080600080600060e08c8e03121561534857600080fd5b8b359a5061535860208d01614ab9565b99506001600160401b0360408d013581101561537357600080fd5b6153838e60408f01358f01614936565b909a50985060608d013581101561539957600080fd5b6153a98e60608f01358f01614936565b909850965060808d01358110156153bf57600080fd5b6153cf8e60808f01358f01614936565b909650945060a08d01358110156153e557600080fd5b506153f68d60a08e01358e01614936565b909350915061540760c08d016151e5565b90509295989b509295989b9093969950565b60006020828403121561542b57600080fd5b61094882614fa7565b918252602082015260400190565b6000615450614e5684614e12565b8381529050602080820190600585901b84018681111561546f57600080fd5b845b818110156155025780356001600160401b03808211156154915760008081fd5b8188019150601f8a818401126154a75760008081fd5b8235828111156154b9576154b9614d81565b6154ca818301601f19168801614de2565b92508083528b878286010111156154e357600091508182fd5b8087850188850137600090830187015250855250928201928201615471565b505050509392505050565b6000610948368484615442565b634e487b7160e01b600052603260045260246000fd5b600082601f83011261554157600080fd5b81356020615551614e5683614e12565b8083825260208201915060208460051b87010193508684111561557357600080fd5b602086015b84811015614ea75780358352918301918301615578565b600082601f8301126155a057600080fd5b61094883833560208501615442565b600061010082360312156155c257600080fd5b6155ca614d97565b8235815260208301356020820152604083013560408201526155ee60608401614ab9565b606082015260808301356001600160401b038082111561560d57600080fd5b61561936838701614eb2565b608084015260a085013591508082111561563257600080fd5b61563e36838701615530565b60a084015260c085013591508082111561565757600080fd5b6156633683870161558f565b60c084015260e085013591508082111561567c57600080fd5b5061568936828601615530565b60e08301525092915050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761094b5761094b615695565b8082018082111561094b5761094b615695565b8181038181111561094b5761094b615695565b60008261570557634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031991909116815260200190565b6000808335601e1984360301811261573657600080fd5b8301803591506001600160401b0382111561575057600080fd5b6020019150600581901b3603821315611f8157600080fd5b600060e0823603121561577a57600080fd5b615782614dc0565b823581526020830135602082015261579c60408401614ab9565b604082015260608301356001600160401b03808211156157bb57600080fd5b6157c736838701614e35565b606084015260808501359150808211156157e057600080fd5b6157ec36838701615530565b608084015260a085013591508082111561580557600080fd5b6158113683870161558f565b60a084015260c085013591508082111561582a57600080fd5b5061583736828601615530565b60c08301525092915050565b602081016010831061585757615857614be0565b91905290565b6001600160e01b03198316815260408101600b831061587e5761587e614be0565b8260208301529392505050565b6001600160601b03818116838216019080821115610ce157610ce1615695565b60008151808452602080850194506020840160005b83811015614a9b5781511515875295820195908201906001016158c0565b6060815260006158f16060830186614a61565b828103602084015261590381866152a1565b905082810360408401526121b781856158ab565b60808152600061592a60808301876158ab565b828103602084015261593c81876152a1565b905082810360408401526159508186614a61565b90508281036060840152613f608185614a61565b6001600160e01b03199390931683526020830191909152604082015260600190565b60008151808452602080850194506020840160005b83811015614a9b5781518752958201959082019060010161599b565b60005b838110156159d25781810151838201526020016159ba565b50506000910152565b600081518084526159f38160208601602086016159b7565b601f01601f19169290920160200192915050565b60008282518085526020808601955060208260051b8401016020860160005b84811015615a5457601f19868403018952615a428383516159db565b98840198925090830190600101615a26565b5090979650505050505050565b60006101008251845260208301516020850152604083015160408501526060830151615a906060860182614a54565b506080830151816080860152615aa882860182614a61565b91505060a083015184820360a0860152615ac28282615986565b91505060c083015184820360c0860152615adc8282615a07565b91505060e083015184820360e0860152615af68282615986565b95945050505050565b604081526000615b126040830185615a61565b905060018060a01b03831660208301529392505050565b60008151808452602080850194506020840160005b83811015614a9b57815160068110615b5857615b58614be0565b87529582019590820190600101615b3e565b608081526000615b7d6080830187615a61565b8560208401528281036040840152845181526020850151602082015260018060a01b036040860151166040820152606085015160e06060830152615bc460e0830182615b29565b905060808601518282036080840152615bdd8282615986565b91505060a086015182820360a0840152615bf78282615a07565b91505060c086015182820360c0840152615c118282615986565b9350505050615af66060830184614a54565b600060018201615c3557615c35615695565b5060010190565b634e487b7160e01b600052603160045260246000fd5b604081526000615c656040830185614a61565b8281036020840152615af681856158ab565b604081526000615c8a60408301856158ab565b8281036020840152615af68185614a61565b6001600160a01b03841681526001600160e01b031983166020820152606060408201819052600090615af6908301846159db565b60008251615ce28184602087016159b7565b9190910192915050565b60208152600061094860208301846159db565b6001600160e01b03199290921682526001600160a01b0316602082015260400190565b600060208284031215615d3457600080fd5b8151801515811461162657600080fd5b604081526000615d5760408301856158ab565b8281036020840152615af68185615a07565b600060208284031215615d7b57600080fd5b610948826151e5565b803560ff8116811461109757600080fd5b600060208284031215615da757600080fd5b61094882615d84565b600060608284031215615dc257600080fd5b604051606081016001600160401b0381118282101715615de457615de4614d81565b604052615df083615d84565b815260208301356020820152604083013560408201528091505092915050565b6040810161587e8285614bf6565b6001600160e01b0319831681528151600090615e418160048501602087016159b7565b919091016004019392505050565b608081526000615e6260808301876159db565b8281036020840152615e748187614a61565b90508281036040840152615e8881866158ab565b90508281036060840152613f608185615a07565b82815260406020820152600061071e60408301846159db56fee5af2d3fb7bcab8f865476bc675bf1bbb8b5a749c827ee1cd215dc9c2b8f92d73617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92effa2646970667358221220fbc7cf0cc42a480ef3d40d76fe731fb7fad911d9e6f97db06cb768d5fde5e16d64736f6c63430008170033", + "nonce": "0x2f124" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0xde41c353b4f859829031e40fc82bce8c9840397c53e4f17719d19e593e437a6b", + "transactionType": "CALL", + "contractName": "src/extensions/TransparentUpgradeableProxyV2.sol:TransparentUpgradeableProxyV2", + "contractAddress": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "function": "upgradeTo(address)", + "arguments": [ + "0x64D21e91c2Cb367D2972E0bC377CFEa4e55F3685" + ], + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "to": "0x8aaad4782890eb879a0fc132a6adf9e5ee708faf", + "gas": "0xfea6", + "value": "0x0", + "data": "0x3659cfe600000000000000000000000064d21e91c2cb367d2972e0bc377cfea4e55f3685", + "nonce": "0x2f125" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0xf7f521794a007a3a637834e4dce3dd3787aed00a8886cb87364af4845bf321eb", + "transactionType": "CALL", + "contractName": "src/extensions/TransparentUpgradeableProxyV2.sol:TransparentUpgradeableProxyV2", + "contractAddress": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "function": "changeAdmin(address)", + "arguments": [ + "0xb0507f2f22697022eCb25963a00D3D076dAc5753" + ], + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "to": "0x8aaad4782890eb879a0fc132a6adf9e5ee708faf", + "gas": "0x10116", + "value": "0x0", + "data": "0x8f283970000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac5753", + "nonce": "0x2f126" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "transactionHash": "0x32330f2782488f77d3a5754841fe7628ae853c71cc9be98bc58221d40d6b7022", + "transactionIndex": "0x0", + "blockHash": "0xec41684d188fc85b4e84ad12639ad74925898929e6c1d019a50d5a3f0044a96e", + "blockNumber": "0x19489e8", + "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "to": null, + "cumulativeGasUsed": "0x31bb80", + "gasUsed": "0x31bb80", + "contractAddress": "0xD05A72c0A593983Aa8336C997736e2172E745fF1", + "logs": [ + { + "address": "0xD05A72c0A593983Aa8336C997736e2172E745fF1", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "blockHash": "0xec41684d188fc85b4e84ad12639ad74925898929e6c1d019a50d5a3f0044a96e", + "blockNumber": "0x19489e8", + "transactionHash": "0x32330f2782488f77d3a5754841fe7628ae853c71cc9be98bc58221d40d6b7022", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000002000000000000000000000000000000000000000000000001000000000000000000", + "type": "0x0", + "effectiveGasPrice": "0x4a817c800" + }, + { + "transactionHash": "0x11b14dd94c5c6b85e8581a63e247176240a6fcb8da8df2570508475c2550ec34", + "transactionIndex": "0x1", + "blockHash": "0xec41684d188fc85b4e84ad12639ad74925898929e6c1d019a50d5a3f0044a96e", + "blockNumber": "0x19489e8", + "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "to": null, + "cumulativeGasUsed": "0x4777b4", + "gasUsed": "0x15bc34", + "contractAddress": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "logs": [ + { + "address": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000d05a72c0a593983aa8336c997736e2172e745ff1" + ], + "data": "0x", + "blockHash": "0xec41684d188fc85b4e84ad12639ad74925898929e6c1d019a50d5a3f0044a96e", + "blockNumber": "0x19489e8", + "transactionHash": "0x11b14dd94c5c6b85e8581a63e247176240a6fcb8da8df2570508475c2550ec34", + "transactionIndex": "0x1", + "logIndex": "0x1", + "removed": false + }, + { + "address": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "topics": [ + "0xe5cd1c123a8cf63fa1b7229678db61fe8ae99dbbd27889370b6667c8cae97da1", + "0x0000000000000000000000000000000000000000000000000000000000127500" + ], + "data": "0x", + "blockHash": "0xec41684d188fc85b4e84ad12639ad74925898929e6c1d019a50d5a3f0044a96e", + "blockNumber": "0x19489e8", + "transactionHash": "0x11b14dd94c5c6b85e8581a63e247176240a6fcb8da8df2570508475c2550ec34", + "transactionIndex": "0x1", + "logIndex": "0x2", + "removed": false + }, + { + "address": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "topics": [ + "0x356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf" + ], + "data": "0x", + "blockHash": "0xec41684d188fc85b4e84ad12639ad74925898929e6c1d019a50d5a3f0044a96e", + "blockNumber": "0x19489e8", + "transactionHash": "0x11b14dd94c5c6b85e8581a63e247176240a6fcb8da8df2570508475c2550ec34", + "transactionIndex": "0x1", + "logIndex": "0x3", + "removed": false + }, + { + "address": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "topics": [ + "0x356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca" + ], + "data": "0x", + "blockHash": "0xec41684d188fc85b4e84ad12639ad74925898929e6c1d019a50d5a3f0044a96e", + "blockNumber": "0x19489e8", + "transactionHash": "0x11b14dd94c5c6b85e8581a63e247176240a6fcb8da8df2570508475c2550ec34", + "transactionIndex": "0x1", + "logIndex": "0x4", + "removed": false + }, + { + "address": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "topics": [ + "0x356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d", + "0x0000000000000000000000000000000000000000000000000000000000000002", + "0x0000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d95" + ], + "data": "0x", + "blockHash": "0xec41684d188fc85b4e84ad12639ad74925898929e6c1d019a50d5a3f0044a96e", + "blockNumber": "0x19489e8", + "transactionHash": "0x11b14dd94c5c6b85e8581a63e247176240a6fcb8da8df2570508475c2550ec34", + "transactionIndex": "0x1", + "logIndex": "0x5", + "removed": false + }, + { + "address": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "topics": [ + "0x356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d", + "0x0000000000000000000000000000000000000000000000000000000000000003", + "0x0000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb" + ], + "data": "0x", + "blockHash": "0xec41684d188fc85b4e84ad12639ad74925898929e6c1d019a50d5a3f0044a96e", + "blockNumber": "0x19489e8", + "transactionHash": "0x11b14dd94c5c6b85e8581a63e247176240a6fcb8da8df2570508475c2550ec34", + "transactionIndex": "0x1", + "logIndex": "0x6", + "removed": false + }, + { + "address": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "topics": [ + "0x356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d", + "0x0000000000000000000000000000000000000000000000000000000000000004", + "0x000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea" + ], + "data": "0x", + "blockHash": "0xec41684d188fc85b4e84ad12639ad74925898929e6c1d019a50d5a3f0044a96e", + "blockNumber": "0x19489e8", + "transactionHash": "0x11b14dd94c5c6b85e8581a63e247176240a6fcb8da8df2570508475c2550ec34", + "transactionIndex": "0x1", + "logIndex": "0x7", + "removed": false + }, + { + "address": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "topics": [ + "0x356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d", + "0x0000000000000000000000000000000000000000000000000000000000000005", + "0x0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab95" + ], + "data": "0x", + "blockHash": "0xec41684d188fc85b4e84ad12639ad74925898929e6c1d019a50d5a3f0044a96e", + "blockNumber": "0x19489e8", + "transactionHash": "0x11b14dd94c5c6b85e8581a63e247176240a6fcb8da8df2570508475c2550ec34", + "transactionIndex": "0x1", + "logIndex": "0x8", + "removed": false + }, + { + "address": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "topics": [ + "0x976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000007", + "0x000000000000000000000000000000000000000000000000000000000000000a" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xec41684d188fc85b4e84ad12639ad74925898929e6c1d019a50d5a3f0044a96e", + "blockNumber": "0x19489e8", + "transactionHash": "0x11b14dd94c5c6b85e8581a63e247176240a6fcb8da8df2570508475c2550ec34", + "transactionIndex": "0x1", + "logIndex": "0x9", + "removed": false + }, + { + "address": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "topics": [ + "0x865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c59", + "0x0000000000000000000000000000000000000000000000000000000000000002", + "0x000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca" + ], + "data": "0x", + "blockHash": "0xec41684d188fc85b4e84ad12639ad74925898929e6c1d019a50d5a3f0044a96e", + "blockNumber": "0x19489e8", + "transactionHash": "0x11b14dd94c5c6b85e8581a63e247176240a6fcb8da8df2570508475c2550ec34", + "transactionIndex": "0x1", + "logIndex": "0xa", + "removed": false + }, + { + "address": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "topics": [ + "0x897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b78" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000004000000000000000000000000d24d87ddc1917165435b306aac68d99e0f49a3fa000000000000000000000000b033ba62ec622dc54d0abfe0254e79692147ca26000000000000000000000000087d08e3ba42e64e3948962dd1371f906d1278b900000000000000000000000052ec2e6bbce45afff8955da6410bb13812f4289f00000000000000000000000000000000000000000000000000000000000000040000000000000000000000002e82d2b56f858f79deef11b160bfc4631873da2b000000000000000000000000bcb61783dd2403fe8cc9b89b27b1a9bb03d040cb000000000000000000000000b266bf53cf7eac4e2065a404598dcb0e15e9462c000000000000000000000000cc5fc5b6c8595f56306da736f6cd02ed9141c84a", + "blockHash": "0xec41684d188fc85b4e84ad12639ad74925898929e6c1d019a50d5a3f0044a96e", + "blockNumber": "0x19489e8", + "transactionHash": "0x11b14dd94c5c6b85e8581a63e247176240a6fcb8da8df2570508475c2550ec34", + "transactionIndex": "0x1", + "logIndex": "0xb", + "removed": false + }, + { + "address": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "topics": [ + "0x22d5bb5059ffe2949a098666fc198587200c8118483074120d3ca7050c7753f1" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000003", + "blockHash": "0xec41684d188fc85b4e84ad12639ad74925898929e6c1d019a50d5a3f0044a96e", + "blockNumber": "0x19489e8", + "transactionHash": "0x11b14dd94c5c6b85e8581a63e247176240a6fcb8da8df2570508475c2550ec34", + "transactionIndex": "0x1", + "logIndex": "0xc", + "removed": false + }, + { + "address": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "blockHash": "0xec41684d188fc85b4e84ad12639ad74925898929e6c1d019a50d5a3f0044a96e", + "blockNumber": "0x19489e8", + "transactionHash": "0x11b14dd94c5c6b85e8581a63e247176240a6fcb8da8df2570508475c2550ec34", + "transactionIndex": "0x1", + "logIndex": "0xd", + "removed": false + }, + { + "address": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000968d0cd7343f711216817e617d3f92a23dc91c07", + "blockHash": "0xec41684d188fc85b4e84ad12639ad74925898929e6c1d019a50d5a3f0044a96e", + "blockNumber": "0x19489e8", + "transactionHash": "0x11b14dd94c5c6b85e8581a63e247176240a6fcb8da8df2570508475c2550ec34", + "transactionIndex": "0x1", + "logIndex": "0xe", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x04020000000001000000000000000000400080000020200000100000000000000000500000000000100000000000000000001400061000010020010000240000000030000000800000000000000002000000000000040000000400000000000008000100020080000040000000000840000000800000000000000080000000001000000000000000010000000000105000000800000080000000000400800000020000000000001000010100000400002000000008800000002008000000400000004060000080000000000000040000000000808400001000000100000160000018020000002008000000000000000000000000008000000000080020001000", + "type": "0x0", + "effectiveGasPrice": "0x4a817c800" + }, + { + "transactionHash": "0xfcd1ca2649e9cba542fd73c3fd0856b6199140862c65eac401c3ebff94085064", + "transactionIndex": "0x2", + "blockHash": "0xec41684d188fc85b4e84ad12639ad74925898929e6c1d019a50d5a3f0044a96e", + "blockNumber": "0x19489e8", + "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "to": null, + "cumulativeGasUsed": "0x98fa31", + "gasUsed": "0x51827d", + "contractAddress": "0x64D21e91c2Cb367D2972E0bC377CFEa4e55F3685", + "logs": [ + { + "address": "0x64D21e91c2Cb367D2972E0bC377CFEa4e55F3685", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "blockHash": "0xec41684d188fc85b4e84ad12639ad74925898929e6c1d019a50d5a3f0044a96e", + "blockNumber": "0x19489e8", + "transactionHash": "0xfcd1ca2649e9cba542fd73c3fd0856b6199140862c65eac401c3ebff94085064", + "transactionIndex": "0x2", + "logIndex": "0xf", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000400080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x0", + "effectiveGasPrice": "0x4a817c800" + }, + { + "transactionHash": "0xde41c353b4f859829031e40fc82bce8c9840397c53e4f17719d19e593e437a6b", + "transactionIndex": "0x3", + "blockHash": "0xec41684d188fc85b4e84ad12639ad74925898929e6c1d019a50d5a3f0044a96e", + "blockNumber": "0x19489e8", + "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "to": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "cumulativeGasUsed": "0x997207", + "gasUsed": "0x77d6", + "contractAddress": null, + "logs": [ + { + "address": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x00000000000000000000000064d21e91c2cb367d2972e0bc377cfea4e55f3685" + ], + "data": "0x", + "blockHash": "0xec41684d188fc85b4e84ad12639ad74925898929e6c1d019a50d5a3f0044a96e", + "blockNumber": "0x19489e8", + "transactionHash": "0xde41c353b4f859829031e40fc82bce8c9840397c53e4f17719d19e593e437a6b", + "transactionIndex": "0x3", + "logIndex": "0x10", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000020000000000010000000000000000000000000000000000000002000000000000000000000000000000000000000000000080000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000082000000000", + "type": "0x0", + "effectiveGasPrice": "0x4a817c800" + }, + { + "transactionHash": "0xf7f521794a007a3a637834e4dce3dd3787aed00a8886cb87364af4845bf321eb", + "transactionIndex": "0x4", + "blockHash": "0xec41684d188fc85b4e84ad12639ad74925898929e6c1d019a50d5a3f0044a96e", + "blockNumber": "0x19489e8", + "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "to": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "cumulativeGasUsed": "0x99eb03", + "gasUsed": "0x78fc", + "contractAddress": null, + "logs": [ + { + "address": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000968d0cd7343f711216817e617d3f92a23dc91c07000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac5753", + "blockHash": "0xec41684d188fc85b4e84ad12639ad74925898929e6c1d019a50d5a3f0044a96e", + "blockNumber": "0x19489e8", + "transactionHash": "0xf7f521794a007a3a637834e4dce3dd3787aed00a8886cb87364af4845bf321eb", + "transactionIndex": "0x4", + "logIndex": "0x11", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000080000000000", + "type": "0x0", + "effectiveGasPrice": "0x4a817c800" + } + ], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1713240678, + "chain": 2021, + "multi": false, + "commit": "6964a97" +} \ No newline at end of file diff --git a/broadcast/20240411-p2-upgrade-bridge-ronin-chain.s.sol/2021/run-1713246801.json b/broadcast/20240411-p2-upgrade-bridge-ronin-chain.s.sol/2021/run-1713246801.json new file mode 100644 index 00000000..75d76e9b --- /dev/null +++ b/broadcast/20240411-p2-upgrade-bridge-ronin-chain.s.sol/2021/run-1713246801.json @@ -0,0 +1,235 @@ +{ + "transactions": [ + { + "hash": null, + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x53Ea388CB72081A3a397114a43741e7987815896", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x52ec2e6bbce45afff8955da6410bb13812f4289f", + "to": "0x53ea388cb72081a3a397114a43741e7987815896", + "gas": "0x77916", + "value": "0x0", + "data": "0x663ac01100000000000000000000000000000000000000000000000000000000663074ca00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab95000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000248f283970000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac575300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x47" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x53Ea388CB72081A3a397114a43741e7987815896", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x087d08e3ba42e64e3948962dd1371f906d1278b9", + "to": "0x53ea388cb72081a3a397114a43741e7987815896", + "gas": "0x467e6", + "value": "0x0", + "data": "0xa8a0e32c00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002d00000000000000000000000000000000000000000000000000000000000007e500000000000000000000000000000000000000000000000000000000663074ca00000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000010000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab95000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000248f283970000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac575300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x59" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x53Ea388CB72081A3a397114a43741e7987815896", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x06f8af58f656b507918d91b0b6f8b89bfcc556f9", + "to": "0x53ea388cb72081a3a397114a43741e7987815896", + "gas": "0x467e6", + "value": "0x0", + "data": "0xa8a0e32c00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002d00000000000000000000000000000000000000000000000000000000000007e500000000000000000000000000000000000000000000000000000000663074ca00000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000010000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab95000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000248f283970000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac575300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x0" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x53Ea388CB72081A3a397114a43741e7987815896", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0xe1100401454b5f850b09f3b92ce7f071c5f1cef4", + "to": "0x53ea388cb72081a3a397114a43741e7987815896", + "gas": "0x5cd02", + "value": "0x0", + "data": "0xa8a0e32c00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002d00000000000000000000000000000000000000000000000000000000000007e500000000000000000000000000000000000000000000000000000000663074ca00000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000010000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab95000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000248f283970000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac575300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x0" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CREATE", + "contractName": "BridgeReward", + "contractAddress": "0x836D911C7de3edfc953030B9ABc4b2B18B2db8b9", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x2b9610", + "value": "0x0", + "data": "0x60a060405230608052610010610015565b6100d5565b600054610100900460ff16156100815760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156100d3576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6080516118666100f06000396000610bc701526118666000f3fe6080604052600436106100dd5760003560e01c80638f7c34a21161007f578063ad43663e11610059578063ad43663e14610261578063b77f2a4014610276578063de981f1b14610296578063f5dbc4ee146102ce57600080fd5b80638f7c34a21461021957806395b6ef0c1461022e578063a6bd67881461024157600080fd5b80633b154455116100bb5780633b154455146101c757806359f778df146101dc5780635cd8a76b146101e4578063865e6fd3146101f957600080fd5b806306032d74146100e257806333b3ea6c1461018257806334087952146101a4575b600080fd5b3480156100ee57600080fd5b506101626100fd366004611335565b604080518082018252600080825260209182018190526001600160a01b039390931683527f518cfd198acbffe95e740cfce1af28a3f7de51f0d784893d3d72c5cc59d7062a815291819020815180830190925280548252600101549181019190915290565b604080518251815260209283015192810192909252015b60405180910390f35b34801561018e57600080fd5b506101a261019d366004611352565b6102e3565b005b3480156101b057600080fd5b506101b9610399565b604051908152602001610179565b3480156101d357600080fd5b506101a26103c8565b6101a26104bb565b3480156101f057600080fd5b506101a26104c5565b34801561020557600080fd5b506101a261021436600461137a565b610593565b34801561022557600080fd5b506101b96105ae565b6101a261023c3660046113b1565b6105c6565b34801561024d57600080fd5b506101a261025c366004611352565b6106e9565b34801561026d57600080fd5b506101b96106fd565b34801561028257600080fd5b506101a2610291366004611352565b610727565b3480156102a257600080fd5b506102b66102b136600461142a565b61073d565b6040516001600160a01b039091168152602001610179565b3480156102da57600080fd5b506101b96107b8565b6102ec336107e2565b61031c57604051638f47e7e360e01b81526001600160e01b03196000351660048201526024015b60405180910390fd5b6000610328600861073d565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610365573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103899190611445565b90506103958183610860565b5050565b60006103c37f3663384f6436b31a97d9c9a02f64ab8b73ead575c5b6224fa0800a6bd57f62f45490565b905090565b60046103d381610acd565b6000196103de6105ae565b146104205760405162461bcd60e51b815260206004820152601260248201527130b63932b0b23c9034b734ba103932b8101960711b6044820152606401610313565b6104ac600161042f600861073d565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa15801561046c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104909190611445565b61049a9190611474565b60008051602061181183398151915255565b6104b860046000610b19565b50565b6104c3610bbd565b565b600054600290610100900460ff161580156104e7575060005460ff8083169116105b6105035760405162461bcd60e51b815260040161031390611487565b6000805461ffff191660ff8316176101001790556105417faf260ffaff563b9407c1c5fe4aec2be8632142d158c44bb0ce4d471cb4883b8c60059055565b61054e60016104906105ae565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150565b61059b610c9e565b6105a481610cf8565b6103958282610b19565b60006103c36000805160206118118339815191525490565b600054610100900460ff16158080156105e65750600054600160ff909116105b806106005750303b158015610600575060005460ff166001145b61061c5760405162461bcd60e51b815260040161031390611487565b6000805460ff19166001179055801561063f576000805461ff0019166101001790555b61064a600b88610b19565b610655600387610b19565b610660600c86610b19565b61066b600885610b19565b610676600484610b19565b6000196000805160206118118339815191525561069282610d2e565b61069a610bbd565b80156106e0576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b600b6106f481610acd565b61039582610d2e565b60006103c37f90f7d557245e5dd9485f463e58974fa7cdc93c0abbd0a1afebb8f9640ec739105490565b600361073281610acd565b610395826000610860565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115610774576107746114d5565b60ff1681526020810191909152604001600020546001600160a01b03169050806107b3578160405163409140df60e11b815260040161031391906114ff565b919050565b60006103c37f9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c645490565b60006107ee600b61073d565b604051635a02d57960e11b81526001600160a01b038481166004830152919091169063b405aaf290602401602060405180830381865afa158015610836573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085a919061150d565b92915050565b600061086a6105ae565b9050816000036108cc5760008184111561089757600161088a8386611474565b6108949190611474565b90505b6108c8816108c37faf260ffaff563b9407c1c5fe4aec2be8632142d158c44bb0ce4d471cb4883b8c5490565b610d87565b9250505b6108d7838383610d9f565b60006108e3600b61073d565b6001600160a01b0316639b19dbfd6040518163ffffffff1660e01b8152600401600060405180830381865afa158015610920573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610948919081019061159a565b90506000610956600361073d565b905060005b84811015610ac55761096c84611639565b9350610abd83836001600160a01b031663f67e815287876040518363ffffffff1660e01b81526004016109a0929190611697565b600060405180830381865afa1580156109bd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109e591908101906116b0565b60405163692f6a6360e11b8152600481018890526001600160a01b0386169063d25ed4c690602401602060405180830381865afa158015610a2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4e9190611445565b604051637153af9b60e11b8152600481018990526001600160a01b0387169063e2a75f3690602401602060405180830381865afa158015610a93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab79190611445565b88610e33565b60010161095b565b505050505050565b610ad68161073d565b6001600160a01b0316336001600160a01b0316146104b8576000356001600160e01b03191681336040516320e0f98d60e21b815260040161031393929190611736565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f811115610b4f57610b4f6114d5565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115610b9057610b906114d5565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610c1457604051638f47e7e360e01b81526001600160e01b0319600035166004820152602401610313565b337f7ae161a1f0ef2537f5ff1957021a50412e72abdc6a941a77d99361e91e7f3c3d610c5e7f9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c645490565b604080519182523460208301520160405180910390a26104b87f9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c6434610f8a565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031633146104c3576000356001600160e01b0319166001604051620f948f60ea1b815260040161031392919061176d565b806001600160a01b03163b6000036104b857604051630bfc64a360e21b81526001600160a01b0382166004820152602401610313565b610d577f90f7d557245e5dd9485f463e58974fa7cdc93c0abbd0a1afebb8f9640ec73910829055565b6040518181527f9b40b647582311cc8f5f7d27e7ce206d126605d1625b8299b7edaeefd869ef2590602001610588565b6000818310610d965781610d98565b825b9392505050565b81600003610dc05760405163799ffe0d60e01b815260040160405180910390fd5b610dcb81600161179b565b8311610df45760405163425a5b1f60e01b81526004810184905260248101829052604401610313565b610dfe828261179b565b8311610e2e57604051630931302b60e31b8152600481018490526024810182905260448101839052606401610313565b505050565b845184518114610e64576040516306b5667560e21b81526001600160e01b0319600035166004820152602401610313565b6000610e6e6106fd565b90506000610e7b88610fa1565b90506000610e8a87878a61101f565b90506000806000805b87811015610f3957610edc8589898f8581518110610eb357610eb36117ae565b60200260200101518f8e8c8881518110610ecf57610ecf6117ae565b6020026020010151611072565b80945081955050506000610f0b8a8f8481518110610efc57610efc6117ae565b60200260200101518787611093565b90508380610f17575080155b610f215784610f24565b60005b610f2e908461179b565b925050600101610e93565b50610f647f3663384f6436b31a97d9c9a02f64ab8b73ead575c5b6224fa0800a6bd57f62f482610f8a565b50610f7c600080516020611811833981519152899055565b505050505050505050505050565b600061085a83610f9a85856111f9565b9250829055565b6060610fad600c61073d565b6001600160a01b0316635311153b836040518263ffffffff1660e01b8152600401610fd891906117c4565b6000604051808303816000875af1158015610ff7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261085a91908101906116b0565b60008061102d858585611218565b90508061105e576040517f64ba7143ea5a17abea37667aa9ae137e3afba5033c5f504770c02829c128189c90600090a15b801580611069575084155b95945050505050565b6000828210156110858989898989611295565b915097509795505050505050565b6001600160a01b03831660009081527f518cfd198acbffe95e740cfce1af28a3f7de51f0d784893d3d72c5cc59d7062a60205260408120821561113857838160010160008282546110e4919061179b565b9091555050604080516001600160a01b03871681526020810186905287917fb3d061c3ef3991b0d4b09f4c8b551d137c3d1e014cf5326462d3d1f6a8dfb9c291015b60405180910390a260009150506111f1565b611144858560006112c0565b156111b0578381600001600082825461115d919061179b565b9091555050604080516001600160a01b03871681526020810186905287917fbab0baccb39371d4d5206b519fe58d21cae9cdd63a1d1b5146ecdf405fd93152910160405180910390a260019150506111f1565b604080516001600160a01b03871681526020810186905287917f74b217634c5a7790ce69770c5e35019970453d4da3973769e7d6cdb7ce6816a19101611126565b949350505050565b815481018181101561085a57634e487b7160005260116020526024601cfd5b8051600190600090815b8181101561127d578585828151811061123d5761123d6117ae565b60200260200101511115611254576000935061127d565b848181518110611266576112666117ae565b602002602001015183019250806001019050611222565b5082801561128b5750858211155b9695505050505050565b6000856112b657816112a784866117d7565b6112b191906117ee565b61128b565b61128b85856117ee565b6000836001600160a01b0316838390604051600060405180830381858888f193505050503d8060008114611310576040519150601f19603f3d011682016040523d82523d6000602084013e611315565b606091505b509095945050505050565b6001600160a01b03811681146104b857600080fd5b60006020828403121561134757600080fd5b8135610d9881611320565b60006020828403121561136457600080fd5b5035919050565b8035601081106107b357600080fd5b6000806040838503121561138d57600080fd5b6113968361136b565b915060208301356113a681611320565b809150509250929050565b60008060008060008060c087890312156113ca57600080fd5b86356113d581611320565b955060208701356113e581611320565b945060408701356113f581611320565b9350606087013561140581611320565b9250608087013561141581611320565b8092505060a087013590509295509295509295565b60006020828403121561143c57600080fd5b610d988261136b565b60006020828403121561145757600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561085a5761085a61145e565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b601081106114fb576114fb6114d5565b9052565b6020810161085a82846114eb565b60006020828403121561151f57600080fd5b81518015158114610d9857600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561156e5761156e61152f565b604052919050565b600067ffffffffffffffff8211156115905761159061152f565b5060051b60200190565b600060208083850312156115ad57600080fd5b825167ffffffffffffffff8111156115c457600080fd5b8301601f810185136115d557600080fd5b80516115e86115e382611576565b611545565b81815260059190911b8201830190838101908783111561160757600080fd5b928401925b8284101561162e57835161161f81611320565b8252928401929084019061160c565b979650505050505050565b60006001820161164b5761164b61145e565b5060010190565b60008151808452602080850194506020840160005b8381101561168c5781516001600160a01b031687529582019590820190600101611667565b509495945050505050565b8281526040602082015260006111f16040830184611652565b600060208083850312156116c357600080fd5b825167ffffffffffffffff8111156116da57600080fd5b8301601f810185136116eb57600080fd5b80516116f96115e382611576565b81815260059190911b8201830190838101908783111561171857600080fd5b928401925b8284101561162e5783518252928401929084019061171d565b6001600160e01b0319841681526060810161175460208301856114eb565b6001600160a01b03929092166040919091015292915050565b6001600160e01b03198316815260408101600b831061178e5761178e6114d5565b8260208301529392505050565b8082018082111561085a5761085a61145e565b634e487b7160e01b600052603260045260246000fd5b602081526000610d986020830184611652565b808202811582820484141761085a5761085a61145e565b60008261180b57634e487b7160e01b600052601260045260246000fd5b50049056fe2417f25874c1cdc139a787dd21df976d40d767090442b3a2496917ecfc93b619a2646970667358221220cd237faf10660b4bf88f4dcc843cf0b3d4cce585ad7f99199ed3924ea16b8dfd64736f6c63430008170033", + "nonce": "0x2f127" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CREATE", + "contractName": "BridgeSlash", + "contractAddress": "0x7bEB0f3fC4002C4542015cFa9023dEE1A9EC9400", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x26b9de", + "value": "0x0", + "data": "0x608060405261000c610011565b6100d1565b600054610100900460ff161561007d5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156100cf576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b611583806100e06000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80639c2f445911610097578063de981f1b11610066578063de981f1b146101fd578063f8c8765e14610228578063f9f608731461023b578063fbb2f1941461024357600080fd5b80639c2f4459146101d2578063c48549de146101da578063d1e1f2f8146101ed578063ddc3f7f6146101f557600080fd5b80635311153b116100d35780635311153b1461016a5780636dda44081461017d578063865e6fd3146101935780638f851d8a146101a657600080fd5b806301ffc9a7146101055780631288810a1461012d5780633b1544551461014d5780634dca592514610157575b600080fd5b610118610113366004610eb7565b610263565b60405190151581526020015b60405180910390f35b61014061013b366004610f2d565b61029a565b6040516101249190610f6f565b610155610382565b005b6101556101653660046110a4565b610462565b610140610178366004610f2d565b6106f9565b610185600181565b604051908152602001610124565b6101556101a136600461118e565b6107d2565b6101b96101b43660046111c1565b6107f1565b6040516001600160e01b03199091168152602001610124565b610185603281565b6101b96101e83660046112ba565b610970565b610185600581565b610185601e81565b61021061020b366004611326565b61098f565b6040516001600160a01b039091168152602001610124565b610155610236366004611341565b610a0a565b610140610b49565b610256610251366004611395565b610b58565b60405161012491906113cd565b60006001600160e01b031982166312c0151560e21b148061029457506001600160e01b031982166301ffc9a760e01b145b92915050565b6060818067ffffffffffffffff8111156102b6576102b6610fb3565b6040519080825280602002602001820160405280156102df578160200160208202803683370190505b50915060008051602061152e83398151915260005b8281101561037957816000878784818110610311576103116113e7565b905060200201602081019061032691906113fd565b6001600160a01b031681526020810191909152604001600020548451600160801b9091046001600160801b031690859083908110610366576103666113e7565b60209081029190910101526001016102f4565b50505092915050565b600461038d81610b6b565b600019600154146103da5760405162461bcd60e51b815260206004820152601260248201527130b63932b0b23c9034b734ba103932b8101960711b60448201526064015b60405180910390fd5b6103e4600861098f565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610421573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104459190611418565b610450906001611447565b60015561045f60046000610bb7565b50565b600361046d81610b6b565b8160015481106106f0578360328111156106ee5786518851146104b1576040516306b5667560e21b81526001600160e01b03196000351660048201526024016103d1565b8751156106ee576104c3868689610c5b565b6104f5576040517f64ba7143ea5a17abea37667aa9ae137e3afba5033c5f504770c02829c128189c90600090a16106ee565b60006104ff610cd8565b6040805180820190915260008082526020820181905291925060008051602061152e833981519152918080805b8e518110156106e6578e8181518110610547576105476113e7565b6020908102919091018101516001600160a01b03811660009081528883526040908190208151808301909252546001600160801b038082168352600160801b90910416928101839052965093508b11156106de576105be8e82815181106105b0576105b06113e7565b60200260200101518d610d43565b91506105d9828c87600001516001600160801b03168a610d95565b93506105e5848c610dec565b1561062b576040516001600160801b0394506001600160a01b038416908c907fb32a150b9737190a456d8b2b81dd7d592a799ab2933ea494e44351acd41f835d90600090a35b600082600281111561063f5761063f6113b7565b146106de576001600160801b0384146106a3578a836001600160a01b031683600281111561066f5761066f6113b7565b6040518781527fa0957b65e189f06dfe2b38ff07e89a0df128ba3fcba66c68f8d2615daebc30a99060200160405180910390a45b6001600160a01b038316600090815260208790526040902080546fffffffffffffffffffffffffffffffff19166001600160801b0386161790555b60010161052c565b505050505050505b505b50505050505050565b6060818067ffffffffffffffff81111561071557610715610fb3565b60405190808252806020026020018201604052801561073e578160200160208202803683370190505b50915060008051602061152e83398151915260005b8281101561037957816000878784818110610770576107706113e7565b905060200201602081019061078591906113fd565b6001600160a01b0316815260208101919091526040016000205484516001600160801b03909116908590839081106107bf576107bf6113e7565b6020908102919091010152600101610753565b6107da610e0e565b6107e381610e6a565b6107ed8282610bb7565b5050565b6000600b6107fe81610b6b565b82518690811461082f576040516306b5667560e21b81526001600160e01b03196000351660048201526024016103d1565b8060000361084757506347c28ec560e11b9150610966565b60008051602061152e8339815191526000610862600861098f565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa15801561089f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c39190611418565b905060005b83811015610957578681815181106108e2576108e26113e7565b60200260200101511561094f57818360008d8d85818110610905576109056113e7565b905060200201602081019061091a91906113fd565b6001600160a01b03168152602081019190915260400160002080546001600160801b03928316600160801b0292169190911790555b6001016108c8565b506347c28ec560e11b94505050505b5095945050505050565b6000600b61097d81610b6b565b50636242a4ef60e11b95945050505050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f8111156109c6576109c66113b7565b60ff1681526020810191909152604001600020546001600160a01b0316905080610a05578160405163409140df60e11b81526004016103d1919061146e565b919050565b600054610100900460ff1615808015610a2a5750600054600160ff909116105b80610a445750303b158015610a44575060005460ff166001145b610aa75760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103d1565b6000805460ff191660011790558015610aca576000805461ff0019166101001790555b610ad5600886610bb7565b610ae0600b85610bb7565b610aeb600384610bb7565b610af6600483610bb7565b6000196001558015610b42576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6060610b53610cd8565b905090565b6000610b648383610d43565b9392505050565b610b748161098f565b6001600160a01b0316336001600160a01b03161461045f576000356001600160e01b03191681336040516320e0f98d60e21b81526004016103d19392919061147c565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f811115610bed57610bed6113b7565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115610c2e57610c2e6113b7565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b8051600190600090815b81811015610cc05785858281518110610c8057610c806113e7565b60200260200101511115610c975760009350610cc0565b848181518110610ca957610ca96113e7565b602002602001015183019250806001019050610c65565b50828015610cce5750858211155b9695505050505050565b604080516003808252608082019092526060916020820183803683370190505090506001818160ff1681518110610d1157610d116113e7565b6020908102919091010152600581600260ff1681518110610d3457610d346113e7565b60200260200101818152505090565b60008082612710610d5486836114b3565b610d5e91906114c6565b610d6891906114dd565b9050610bb88111610d8a576103e88111610d83576000610d8d565b6001610d8d565b60025b949350505050565b6000610dab610da56001866114b3565b84610ea0565b82866002811115610dbe57610dbe6113b7565b60ff1681518110610dd157610dd16113e7565b6020026020010151610de39190611447565b95945050505050565b6000601e610dfb6001846114b3565b610e0590856114b3565b10159392505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610e68576000356001600160e01b0319166001604051620f948f60ea1b81526004016103d19291906114ff565b565b806001600160a01b03163b60000361045f57604051630bfc64a360e21b81526001600160a01b03821660048201526024016103d1565b600081831015610eb05781610b64565b5090919050565b600060208284031215610ec957600080fd5b81356001600160e01b031981168114610b6457600080fd5b60008083601f840112610ef357600080fd5b50813567ffffffffffffffff811115610f0b57600080fd5b6020830191508360208260051b8501011115610f2657600080fd5b9250929050565b60008060208385031215610f4057600080fd5b823567ffffffffffffffff811115610f5757600080fd5b610f6385828601610ee1565b90969095509350505050565b6020808252825182820181905260009190848201906040850190845b81811015610fa757835183529284019291840191600101610f8b565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610ff257610ff2610fb3565b604052919050565b600067ffffffffffffffff82111561101457611014610fb3565b5060051b60200190565b80356001600160a01b0381168114610a0557600080fd5b600082601f83011261104657600080fd5b8135602061105b61105683610ffa565b610fc9565b8083825260208201915060208460051b87010193508684111561107d57600080fd5b602086015b848110156110995780358352918301918301611082565b509695505050505050565b600080600080600060a086880312156110bc57600080fd5b853567ffffffffffffffff808211156110d457600080fd5b818801915088601f8301126110e857600080fd5b813560206110f861105683610ffa565b82815260059290921b8401810191818101908c84111561111757600080fd5b948201945b8386101561113c5761112d8661101e565b8252948201949082019061111c565b9950508901359250508082111561115257600080fd5b5061115f88828901611035565b959895975050505060408401359360608101359360809091013592509050565b803560108110610a0557600080fd5b600080604083850312156111a157600080fd5b6111aa8361117f565b91506111b86020840161101e565b90509250929050565b6000806000806000606086880312156111d957600080fd5b853567ffffffffffffffff808211156111f157600080fd5b6111fd89838a01610ee1565b909750955060209150878201358181111561121757600080fd5b6112238a828b01610ee1565b90965094505060408801358181111561123b57600080fd5b88019050601f8101891361124e57600080fd5b803561125c61105682610ffa565b81815260059190911b8201830190838101908b83111561127b57600080fd5b928401925b828410156112a857833580151581146112995760008081fd5b82529284019290840190611280565b80955050505050509295509295909350565b600080600080604085870312156112d057600080fd5b843567ffffffffffffffff808211156112e857600080fd5b6112f488838901610ee1565b9096509450602087013591508082111561130d57600080fd5b5061131a87828801610ee1565b95989497509550505050565b60006020828403121561133857600080fd5b610b648261117f565b6000806000806080858703121561135757600080fd5b6113608561101e565b935061136e6020860161101e565b925061137c6040860161101e565b915061138a6060860161101e565b905092959194509250565b600080604083850312156113a857600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60208101600383106113e1576113e16113b7565b91905290565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561140f57600080fd5b610b648261101e565b60006020828403121561142a57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561029457610294611431565b6010811061146a5761146a6113b7565b9052565b60208101610294828461145a565b6001600160e01b0319841681526060810161149a602083018561145a565b6001600160a01b03929092166040919091015292915050565b8181038181111561029457610294611431565b808202811582820484141761029457610294611431565b6000826114fa57634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b03198316815260408101600b8310611520576115206113b7565b826020830152939250505056fed08d185790a07c7b9b721e2713c8580010a57f31c72c16f6e80b831d0ee45bfea2646970667358221220a88731885a136f6ffe2ef43beabc7b3a128ab2f3ee20d79c6777fe10326663bf64736f6c63430008170033", + "nonce": "0x2f128" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CREATE", + "contractName": "BridgeTracking", + "contractAddress": "0xB03E29Be08E57b2d95Fe9F94966CB86a0DD98481", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x2fb53a", + "value": "0x0", + "data": "0x608060405234801561001057600080fd5b5061001961001e565b6100eb565b600154600160a81b900460ff161561008c5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60015460ff600160a01b909104811610156100e9576001805460ff60a01b191660ff60a01b17905560405160ff81527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b611ad5806100fa6000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063c7c4fea91161008c578063de981f1b11610066578063de981f1b1461017e578063e2a75f36146101a9578063f67e8152146101bc578063f84bd121146101dc57600080fd5b8063c7c4fea914610145578063ca21287e14610158578063d25ed4c61461016b57600080fd5b80631794bb3c146100d4578063229f88ea146100e95780633b154455146100fc5780634ac0bcda146101045780635cd8a76b1461012a578063865e6fd314610132575b600080fd5b6100e76100e23660046114df565b6101e4565b005b6100e76100f736600461152f565b6102e4565b6100e761048c565b610117610112366004611559565b61055c565b6040519081526020015b60405180910390f35b6100e761057a565b6100e7610140366004611598565b610673565b6100e76101533660046115c4565b610692565b6100e7610166366004611604565b610a6b565b610117610179366004611660565b610b56565b61019161018c366004611679565b610b8b565b6040516001600160a01b039091168152602001610121565b6101176101b7366004611660565b610c01565b6101cf6101ca366004611694565b610c2b565b604051610121919061174f565b600254610117565b600154600160a81b900460ff161580801561020a575060018054600160a01b900460ff16105b8061022a5750303b15801561022a575060018054600160a01b900460ff16145b61024f5760405162461bcd60e51b815260040161024690611762565b60405180910390fd5b6001805460ff60a01b1916600160a01b179055801561027c576001805460ff60a81b1916600160a81b1790555b610287600285610c72565b610292600884610c72565b600282905580156102de576001805460ff60a81b191681556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b60026102ef81610d16565b6102f7610d62565b6000600a600085600281111561030f5761030f6117b0565b6002811115610320576103206117b0565b81526020019081526020016000206000848152602001908152602001600020905080600001546000036102de57610355610d70565b60006103616008610b8b565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa15801561039e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c291906117c6565b808355600480546001818101835560009290925260029081027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018054939450928892849260ff1990921691849081111561041f5761041f6117b0565b02179055506001808201869055830160005b81548110156104745761046c8888848481548110610451576104516117df565b6000918252602090912001546001600160a01b031687611012565b600101610431565b50610483600185016000611452565b50505050505050565b600461049781610d16565b600019600b54146104df5760405162461bcd60e51b815260206004820152601260248201527130b63932b0b23c9034b734ba103932b8101960711b6044820152606401610246565b6104e96008610b8b565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610526573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054a91906117c6565b600b5561055960046000610c72565b50565b6000610571838361056c86611192565b6112b8565b90505b92915050565b600154600290600160a81b900460ff161580156105a5575060015460ff808316600160a01b90920416105b6105c15760405162461bcd60e51b815260040161024690611762565b6001805460ff60a81b1960ff8416600160a01b021661ffff60a01b1990911617600160a81b179055600054610601906002906001600160a01b0316610c72565b600154610619906008906001600160a01b0316610c72565b600080546001600160a01b031916905560018054600161ff0160a01b031916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b61067b61130e565b61068481611368565b61068e8282610c72565b5050565b600261069d81610d16565b6106a5610d62565b60006106b16008610b8b565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106ee573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071291906117c6565b905061071c610d70565b6000600a6000876002811115610734576107346117b0565b6002811115610745576107456117b0565b81526020019081526020016000206000868152602001908152602001600020905080600001546000036107a7576001908101805491820181556000908152602090200180546001600160a01b0319166001600160a01b038516179055506102de565b6107b386868685611012565b600b548281101561048357600b8381556000906107cf90610b8b565b6001600160a01b0316639b19dbfd6040518163ffffffff1660e01b8152600401600060405180830381865afa15801561080c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108349190810190611816565b90506000610842838361139e565b9050600061084f84610c01565b9050600061085c85610b56565b9050600061086a600c610b8b565b9050600080826001600160a01b0316878786888c6040516024016108929594939291906118db565b60408051601f198184030181529181526020820180516001600160e01b0316634dca592560e01b179052516108c79190611975565b6000604051808303816000865af19150503d8060008114610904576040519150601f19603f3d011682016040523d82523d6000602084013e610909565b606091505b50915091508161096057604051634dca592560e01b906001600160a01b038516907feaa424ccc38ebcf22402729592dedf8315790e0128cb577cdeff1a3ee627f82790610957908590611991565b60405180910390a35b600061096c600d610b8b565b9050806001600160a01b03168b60405160240161098b91815260200190565b60408051601f198184030181529181526020820180516001600160e01b03166302ddfca960e61b179052516109c09190611975565b6000604051808303816000865af19150503d80600081146109fd576040519150601f19603f3d011682016040523d82523d6000602084013e610a02565b606091505b50909350915082610a5a576040516302ddfca960e61b906001600160a01b038316907feaa424ccc38ebcf22402729592dedf8315790e0128cb577cdeff1a3ee627f82790610a51908690611991565b60405180910390a35b505050505050505050505050505050565b600154600390600160a81b900460ff16158015610a96575060015460ff808316600160a01b90920416105b610ab25760405162461bcd60e51b815260040161024690611762565b6001805460ff60a81b1960ff8416600160a01b021661ffff60a01b1990911617600160a81b179055610ae5600b86610c72565b610af0600c85610c72565b610afb600d84610c72565b610b06600483610c72565b600019600b556001805460ff60a81b1916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050565b600081815260096020526040902060010154610b7182611192565b15610b8657600654610b8390826119c4565b90505b919050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115610bc257610bc26117b0565b60ff1681526020810191909152604001600020546001600160a01b0316905080610b86578160405163409140df60e11b815260040161024691906119f9565b600081815260096020526040902054610c1982611192565b15610b8657600454610b8390826119c4565b6060610c6a8484848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061139e92505050565b949350505050565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f811115610ca857610ca86117b0565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115610ce957610ce96117b0565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b610d1f81610b8b565b6001600160a01b0316336001600160a01b031614610559576000356001600160e01b03191681336040516320e0f98d60e21b815260040161024693929190611a07565b600254431015610d6e57005b565b6000610d7c6008610b8b565b60405163a3d545f560e01b81524360048201529091506000906001600160a01b0383169063a3d545f590602401602060405180830381865afa158015610dc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dea91906117c6565b905080600360000154101561068e576000826001600160a01b031663468c96ae6003600001546001610e1c91906119c4565b6040518263ffffffff1660e01b8152600401610e3a91815260200190565b6040805180830381865afa158015610e56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7a9190611a3e565b60038490556000818152600960205260408120600454815493955090935091839190610ea79084906119c4565b9091555050600654600182018054600090610ec39084906119c4565b90915550600090505b600854811015610f5357600880546000919083908110610eee57610eee6117df565b60009182526020808320909101546001600160a01b0316808352600782526040808420546002880190935283208054919450919290610f2e9084906119c4565b90915550506001600160a01b0316600090815260076020526040812055600101610ecc565b5060005b600454811015610fe557600060036001018281548110610f7957610f796117df565b6000918252602082206002918202018054909350600a91839160ff1690811115610fa557610fa56117b0565b6002811115610fb657610fb66117b0565b815260208082019290925260409081016000908120600195860154825290925290206003018590555001610f57565b50610ff260046000611470565b6000600581815560068290559061100a600882611452565b505050505050565b6000600a600086600281111561102a5761102a6117b0565b600281111561103b5761103b6117b0565b81526020808201929092526040908101600090812087825283528181206001600160a01b038716825260028101909352205490915060ff161561107e57506102de565b6001600160a01b03831660009081526002820160205260408120805460ff1916600117905560038201549081900361114b576001600160a01b038416600090815260076020526040812054900361111b57600880546001810182556000919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180546001600160a01b0319166001600160a01b0386161790555b6006805460019081019091556001600160a01b03851660009081526007602052604090208054909101905561100a565b82810361100a57600090815260096020908152604080832060018082018054820190556001600160a01b039790971684526002019091529020805490930190925550505050565b60008061119f6008610b8b565b60405163a3d545f560e01b81524360048201529091506000906001600160a01b0383169063a3d545f590602401602060405180830381865afa1580156111e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120d91906117c6565b9050600080836001600160a01b031663468c96ae600360000154600161123391906119c4565b6040518263ffffffff1660e01b815260040161125191815260200190565b6040805180830381865afa15801561126d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112919190611a3e565b915091508180156112a157508086145b80156112ae575060035483115b9695505050505050565b60008381526009602090815260408083206001600160a01b03861684526002019091529020548115611307576001600160a01b038316600090815260076020526040902054610c6a90826119c4565b9392505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610d6e576000356001600160e01b0319166001604051620f948f60ea1b8152600401610246929190611a71565b806001600160a01b03163b60000361055957604051630bfc64a360e21b81526001600160a01b0382166004820152602401610246565b80516060908067ffffffffffffffff8111156113bc576113bc6117f5565b6040519080825280602002602001820160405280156113e5578160200160208202803683370190505b50915060006113f385611192565b905060005b828110156114495761142486868381518110611416576114166117df565b6020026020010151846112b8565b848281518110611436576114366117df565b60209081029190910101526001016113f8565b50505092915050565b50805460008255906000526020600020908101906105599190611491565b508054600082556002029060005260206000209081019061055991906114aa565b5b808211156114a65760008155600101611492565b5090565b5b808211156114a657805460ff19168155600060018201556002016114ab565b6001600160a01b038116811461055957600080fd5b6000806000606084860312156114f457600080fd5b83356114ff816114ca565b9250602084013561150f816114ca565b929592945050506040919091013590565b803560038110610b8657600080fd5b6000806040838503121561154257600080fd5b61154b83611520565b946020939093013593505050565b6000806040838503121561156c57600080fd5b82359150602083013561157e816114ca565b809150509250929050565b803560108110610b8657600080fd5b600080604083850312156115ab57600080fd5b6115b483611589565b9150602083013561157e816114ca565b6000806000606084860312156115d957600080fd5b6115e284611520565b92506020840135915060408401356115f9816114ca565b809150509250925092565b6000806000806080858703121561161a57600080fd5b8435611625816114ca565b93506020850135611635816114ca565b92506040850135611645816114ca565b91506060850135611655816114ca565b939692955090935050565b60006020828403121561167257600080fd5b5035919050565b60006020828403121561168b57600080fd5b61057182611589565b6000806000604084860312156116a957600080fd5b83359250602084013567ffffffffffffffff808211156116c857600080fd5b818601915086601f8301126116dc57600080fd5b8135818111156116eb57600080fd5b8760208260051b850101111561170057600080fd5b6020830194508093505050509250925092565b60008151808452602080850194506020840160005b8381101561174457815187529582019590820190600101611728565b509495945050505050565b6020815260006105716020830184611713565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b6000602082840312156117d857600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8051610b86816114ca565b6000602080838503121561182957600080fd5b825167ffffffffffffffff8082111561184157600080fd5b818501915085601f83011261185557600080fd5b815181811115611867576118676117f5565b8060051b604051601f19603f8301168101818110858211171561188c5761188c6117f5565b6040529182528482019250838101850191888311156118aa57600080fd5b938501935b828510156118cf576118c08561180b565b845293850193928501926118af565b98975050505050505050565b60a0808252865190820181905260009060209060c0840190828a01845b8281101561191d5781516001600160a01b0316845292840192908401906001016118f8565b50505083810360208501526119328189611713565b6040850197909752505050606081019290925260809091015292915050565b60005b8381101561196c578181015183820152602001611954565b50506000910152565b60008251611987818460208701611951565b9190910192915050565b60208152600082518060208401526119b0816040850160208701611951565b601f01601f19169190910160400192915050565b8082018082111561057457634e487b7160e01b600052601160045260246000fd5b601081106119f5576119f56117b0565b9052565b6020810161057482846119e5565b6001600160e01b03198416815260608101611a2560208301856119e5565b6001600160a01b03929092166040919091015292915050565b60008060408385031215611a5157600080fd5b82518015158114611a6157600080fd5b6020939093015192949293505050565b6001600160e01b03198316815260408101600b8310611a9257611a926117b0565b826020830152939250505056fea2646970667358221220262d80d2feb74067f3cddee2705a4fff0aac4921a9a54ee2314b0f244bccac3e64736f6c63430008170033", + "nonce": "0x2f129" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CREATE", + "contractName": "PauseEnforcer", + "contractAddress": "0x3a3A92ba9d4D49aae06861136D547667c742F1aF", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x206788", + "value": "0x0", + "data": "0x608060405234801561001057600080fd5b5061001961001e565b6100de565b600254610100900460ff161561008a5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60025460ff90811610156100dc576002805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6111c4806100ed6000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c806391d14854116100a2578063caa6fea411610071578063caa6fea414610240578063d4b8399214610254578063d547741f1461026d578063dcf7bb5c14610280578063f82ec70b1461029357600080fd5b806391d148541461020a578063a217fddf1461021d578063b9f3163b14610225578063ca15c8731461022d57600080fd5b80636833f60d116100e95780636833f60d1461019c57806377a24f36146101a45780637a9ad019146101b75780637d4f7fc9146101cc5780639010d07c146101df57600080fd5b806301ffc9a71461011b578063248a9ca3146101435780632f2ff15d1461017457806336568abe14610189575b600080fd5b61012e610129366004610e11565b6102a6565b60405190151581526020015b60405180910390f35b610166610151366004610e3b565b60009081526020819052604090206001015490565b60405190815260200161013a565b610187610182366004610e79565b6102d1565b005b610187610197366004610e79565b6102fb565b61018761037e565b6101876101b2366004610ebf565b6104da565b61016660008051602061116f83398151915281565b6101876101da366004610fab565b610640565b6101f26101ed366004610fc8565b610663565b6040516001600160a01b03909116815260200161013a565b61012e610218366004610e79565b610682565b610166600081565b6101876106ab565b61016661023b366004610e3b565b610821565b60025461012e90600160b01b900460ff1681565b6002546101f2906201000090046001600160a01b031681565b61018761027b366004610e79565b610838565b61018761028e366004610fab565b61085d565b6101876102a1366004610fab565b610871565b60006001600160e01b03198216635a05180f60e01b14806102cb57506102cb82610894565b92915050565b6000828152602081905260409020600101546102ec816108c9565b6102f683836108d6565b505050565b6001600160a01b03811633146103705760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61037a82826108f8565b5050565b60008051602061116f833981519152610396816108c9565b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af11580156103e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040d9190610fea565b1561042b576040516310067f7560e11b815260040160405180910390fd5b60028054600160b01b60ff60b01b19909116179081905560408051638456cb5960e01b81529051620100009092046001600160a01b031691638456cb599160048082019260009290919082900301818387803b15801561048a57600080fd5b505af115801561049e573d6000803e3d6000fd5b50506040513381527fb8fad2fa0ed7a383e747c309ef2c4391d7b65592a48893e57ccc1fab70791456925060200190505b60405180910390a150565b600254610100900460ff16158080156104fa5750600254600160ff909116105b806105145750303b158015610514575060025460ff166001145b6105775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610367565b6002805460ff19166001179055801561059a576002805461ff0019166101001790555b6105a38461091a565b6105ae600084610972565b60005b82518110156105f3576105eb60008051602061116f8339815191528483815181106105de576105de61100c565b60200260200101516108d6565b6001016105b1565b50801561063a576002805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b600061064b816108c9565b61037a60008051602061116f833981519152836108d6565b600082815260016020526040812061067b908361097c565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008051602061116f8339815191526106c3816108c9565b600254600160b01b900460ff166106ed57604051631b2fd53f60e31b815260040160405180910390fd5b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610740573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107649190610fea565b61078157604051631e87b57b60e31b815260040160405180910390fd5b6002805460ff60b01b19169081905560408051631fa5d41d60e11b81529051620100009092046001600160a01b031691633f4ba83a9160048082019260009290919082900301818387803b1580156107d857600080fd5b505af11580156107ec573d6000803e3d6000fd5b50506040513381527ff5cbf596165cc457b2cd92e8d8450827ee314968160a5696402d75766fc52caf925060200190506104cf565b60008181526001602052604081206102cb90610988565b600082815260208190526040902060010154610853816108c9565b6102f683836108f8565b6000610868816108c9565b61037a8261091a565b600061087c816108c9565b61037a60008051602061116f833981519152836108f8565b60006001600160e01b03198216637965db0b60e01b14806102cb57506301ffc9a760e01b6001600160e01b03198316146102cb565b6108d38133610992565b50565b6108e082826109f6565b60008281526001602052604090206102f69082610a7a565b6109028282610a8f565b60008281526001602052604090206102f69082610af4565b6002805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040519081527f7f8cffd58ac96898bdd25ab64868bd933141d15ad1cd4a0df228fd3fcba2a26d906020016104cf565b61037a82826108d6565b600061067b8383610b09565b60006102cb825490565b61099c8282610682565b61037a576109b4816001600160a01b03166014610b33565b6109bf836020610b33565b6040516020016109d0929190611046565b60408051601f198184030181529082905262461bcd60e51b8252610367916004016110bb565b610a008282610682565b61037a576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610a363390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061067b836001600160a01b038416610ccf565b610a998282610682565b1561037a576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061067b836001600160a01b038416610d1e565b6000826000018281548110610b2057610b2061100c565b9060005260206000200154905092915050565b60606000610b42836002611104565b610b4d90600261111b565b67ffffffffffffffff811115610b6557610b65610ea9565b6040519080825280601f01601f191660200182016040528015610b8f576020820181803683370190505b509050600360fc1b81600081518110610baa57610baa61100c565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610bd957610bd961100c565b60200101906001600160f81b031916908160001a9053506000610bfd846002611104565b610c0890600161111b565b90505b6001811115610c80576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610c3c57610c3c61100c565b1a60f81b828281518110610c5257610c5261100c565b60200101906001600160f81b031916908160001a90535060049490941c93610c798161112e565b9050610c0b565b50831561067b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610367565b6000818152600183016020526040812054610d16575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556102cb565b5060006102cb565b60008181526001830160205260408120548015610e07576000610d42600183611145565b8554909150600090610d5690600190611145565b9050818114610dbb576000866000018281548110610d7657610d7661100c565b9060005260206000200154905080876000018481548110610d9957610d9961100c565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610dcc57610dcc611158565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506102cb565b60009150506102cb565b600060208284031215610e2357600080fd5b81356001600160e01b03198116811461067b57600080fd5b600060208284031215610e4d57600080fd5b5035919050565b6001600160a01b03811681146108d357600080fd5b8035610e7481610e54565b919050565b60008060408385031215610e8c57600080fd5b823591506020830135610e9e81610e54565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600060608486031215610ed457600080fd5b8335610edf81610e54565b9250602084810135610ef081610e54565b9250604085013567ffffffffffffffff80821115610f0d57600080fd5b818701915087601f830112610f2157600080fd5b813581811115610f3357610f33610ea9565b8060051b604051601f19603f83011681018181108582111715610f5857610f58610ea9565b60405291825284820192508381018501918a831115610f7657600080fd5b938501935b82851015610f9b57610f8c85610e69565b84529385019392850192610f7b565b8096505050505050509250925092565b600060208284031215610fbd57600080fd5b813561067b81610e54565b60008060408385031215610fdb57600080fd5b50508035926020909101359150565b600060208284031215610ffc57600080fd5b8151801515811461067b57600080fd5b634e487b7160e01b600052603260045260246000fd5b60005b8381101561103d578181015183820152602001611025565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161107e816017850160208801611022565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516110af816028840160208801611022565b01602801949350505050565b60208152600082518060208401526110da816040850160208701611022565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176102cb576102cb6110ee565b808201808211156102cb576102cb6110ee565b60008161113d5761113d6110ee565b506000190190565b818103818111156102cb576102cb6110ee565b634e487b7160e01b600052603160045260246000fdfe5bea60102f2a7acc9e82b1af0e3bd4069661102bb5dd143a6051cd1980dded1ca26469706673582212205cd579cff7903082498e437ed3eb21f8623bfa7f518ca2799b5e3497b22a08a864736f6c63430008170033", + "nonce": "0x2f12a" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CREATE", + "contractName": "RoninGatewayV3", + "contractAddress": "0x4222384E84C248aa8D50FDC702a1b55E6b4efc99", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x8aad78", + "value": "0x0", + "data": "0x60806040523480156200001157600080fd5b506000805460ff19169055620000266200002c565b620000ee565b603754610100900460ff1615620000995760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60375460ff9081161015620000ec576037805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6150b880620000fe6000396000f3fe6080604052600436106102975760003560e01c80638456cb591161015a578063ca15c873116100c1578063ecc836491161007a578063ecc836491461089f578063f0ce418e146108cc578063f23a6e6114610912578063f668214a1461093e578063fa3896591461095e578063fc6574bc1461097e576102a6565b8063ca15c873146107e7578063d547741f14610807578063dafae40814610827578063dbd2ef6c14610847578063de981f1b14610867578063e75235b814610887576102a6565b8063affed0e011610113578063affed0e0146106e5578063b9afa177146106fb578063b9c362091461071b578063bc197c811461073b578063bc7f038614610774578063c28f7894146107a1576102a6565b80638456cb591461063b578063865e6fd3146106505780639010d07c1461067057806391d14854146106905780639584a592146106b0578063a217fddf146106d0576102a6565b80633f4ba83a116101fe5780635d6a9a90116101b75780635d6a9a901461057257806364363f781461059f57806371706cbe146105bf57806375535f86146105d55780637de5dedd146105f5578063835fc6ca1461060a576102a6565b80633f4ba83a1461048f57806347b56b2c146104a45780634d92c4f0146104c45780635a7dd06a146105255780635c975abb146105455780635cd8a76b1461055d576102a6565b8063248a9ca311610250578063248a9ca3146103b15780632f2ff15d146103ef5780633101cfcb1461040f57806336568abe1461042f5780633e4574ec1461044f5780633e70838b1461046f576102a6565b806301ffc9a7146102ae578063065b3adf146102e35780630b1ff17f1461031b578063109679ef1461033b57806317892f961461035b57806317fa2ea114610384576102a6565b366102a6576102a46109d0565b005b6102a46109d0565b3480156102ba57600080fd5b506102ce6102c9366004613c2d565b6109e9565b60405190151581526020015b60405180910390f35b3480156102ef57600080fd5b50600554610303906001600160a01b031681565b6040516001600160a01b0390911681526020016102da565b34801561032757600080fd5b506102a4610336366004613c57565b610a09565b34801561034757600080fd5b506102a4610356366004613c88565b610a20565b34801561036757600080fd5b506078546079545b604080519283526020830191909152016102da565b34801561039057600080fd5b506103a461039f366004613ce5565b610a53565b6040516102da9190613d26565b3480156103bd57600080fd5b506103e16103cc366004613d60565b6000908152606b602052604090206001015490565b6040519081526020016102da565b3480156103fb57600080fd5b506102a461040a366004613d99565b610d90565b34801561041b57600080fd5b506102a461042a366004613dc9565b610dba565b34801561043b57600080fd5b506102a461044a366004613d99565b610e66565b34801561045b57600080fd5b506102ce61046a366004613d99565b610ee0565b34801561047b57600080fd5b506102a461048a366004613dc9565b610f10565b34801561049b57600080fd5b506102a4610f3a565b3480156104b057600080fd5b506102a46104bf366004613d60565b610f4c565b3480156104d057600080fd5b506105156104df366004613de6565b606f602090815260009283526040808420909152908252902080546001820154600383015460049093015460ff90921692909184565b6040516102da9493929190613e1e565b34801561053157600080fd5b506102a4610540366004613e4e565b611117565b34801561055157600080fd5b5060005460ff166102ce565b34801561056957600080fd5b506102a461117e565b34801561057e57600080fd5b5061059261058d366004613ec8565b611280565b6040516102da9190613f04565b3480156105ab57600080fd5b506102a46105ba366004613f30565b611324565b3480156105cb57600080fd5b506103e1606e5481565b3480156105e157600080fd5b5061036f6105f0366004613de6565b611360565b34801561060157600080fd5b506103e1611381565b34801561061657600080fd5b5061062a610625366004613d60565b611398565b6040516102da959493929190613ff8565b34801561064757600080fd5b506102a461146a565b34801561065c57600080fd5b506102a461066b36600461404e565b61147a565b34801561067c57600080fd5b5061030361068b366004613de6565b611495565b34801561069c57600080fd5b506102ce6106ab366004613d99565b6114ad565b3480156106bc57600080fd5b506102a46106cb36600461408b565b6114d8565b3480156106dc57600080fd5b506103e1600081565b3480156106f157600080fd5b506103e160045481565b34801561070757600080fd5b506103a4610716366004614184565b611625565b34801561072757600080fd5b506102a4610736366004613de6565b611743565b34801561074757600080fd5b50610767610756366004614368565b63bc197c8160e01b95945050505050565b6040516102da9190614415565b34801561078057600080fd5b506103e161078f366004613dc9565b60386020526000908152604090205481565b3480156107ad57600080fd5b506105156107bc366004613d60565b607660205260009081526040902080546001820154600383015460049093015460ff90921692909184565b3480156107f357600080fd5b506103e1610802366004613d60565b611755565b34801561081357600080fd5b506102a4610822366004613d99565b61176c565b34801561083357600080fd5b506102ce610842366004613d60565b611791565b34801561085357600080fd5b506102a461086236600461442a565b6117bd565b34801561087357600080fd5b506103036108823660046144ed565b61180f565b34801561089357600080fd5b5060015460025461036f565b3480156108ab57600080fd5b506108bf6108ba366004614508565b61188a565b6040516102da91906145a3565b3480156108d857600080fd5b506105156108e7366004613d60565b607060205260009081526040902080546001820154600383015460049093015460ff90921692909184565b34801561091e57600080fd5b5061076761092d366004614607565b63f23a6e6160e01b95945050505050565b34801561094a57600080fd5b506102ce610959366004613d60565b6119f1565b34801561096a57600080fd5b506102a4610979366004613f30565b611a1f565b34801561098a57600080fd5b506102ce61099936600461466f565b6000928352606f602090815260408085209385529281528284206001600160a01b0392909216845260029091019052902054151590565b60405163129c2ce160e31b815260040160405180910390fd5b60006109f482611c1a565b80610a035750610a0382611c3f565b92915050565b610a11611c64565b610a1c823383611caa565b5050565b610a28611c64565b610a30611d79565b610a50610a4236839003830183614746565b33610a4b611381565b611e1a565b50565b6060610a5d611d79565b336000610a68611381565b9050600084806001600160401b03811115610a8557610a856141f9565b604051908082528060200260200182016040528015610aae578160200160208202803683370190505b5094506000610abd600361180f565b905060005b82811015610d8457888882818110610adc57610adc6147d7565b905060200201359350816001600160a01b031663c7c4fea9600286896040518463ffffffff1660e01b8152600401610b16939291906147ed565b600060405180830381600087803b158015610b3057600080fd5b505af1158015610b44573d6000803e3d6000fd5b50505050610b51846119f1565b15610b7b576001878281518110610b6a57610b6a6147d7565b911515602092830291909101909101525b600084815260706020908152604080832060718352818420825160a081019093528054835260018082015492959491929184019160ff1690811115610bc257610bc2613e08565b6001811115610bd357610bd3613e08565b815260408051606080820183526002858101546001600160a01b039081168452600387015481166020858101919091526004880154858701528087019490945284518084018652600588015482168152600688015490911693810193909352600786015483850152838501929092528251808201909352600885018054919094019391839160ff1690811115610c6b57610c6b613e08565b6002811115610c7c57610c7c613e08565b81526001820154602082015260029091015460409091015290525090506000610ca482612121565b90506000610cb4848b8b856121eb565b90506001816004811115610cca57610cca613e08565b03610d7557835460ff19166002908117855560405163114fc47560e11b81526001600160a01b0388169163229f88ea91610d0991908c90600401614817565b600060405180830381600087803b158015610d2357600080fd5b505af1158015610d37573d6000803e3d6000fd5b505050507f62520d049932cdee872e9b3c59c0f6073637147e5e9bc8b050b062430eaf5c9f8284604051610d6c92919061482e565b60405180910390a15b50505050806001019050610ac2565b50505050505092915050565b6000828152606b6020526040902060010154610dab8161221e565b610db58383612228565b505050565b603754600390610100900460ff16158015610ddc575060375460ff8083169116105b610e015760405162461bcd60e51b8152600401610df89061488d565b60405180910390fd5b6037805461ffff191660ff831617610100179055610e20600b8361224a565b6037805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b6001600160a01b0381163314610ed65760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610df8565b610a1c82826122ee565b60008281526070602090815260408083206001600160a01b038516845260020190915281205415155b9392505050565b610f18612310565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b610f4261236a565b610f4a6123d9565b565b610f54611c64565b610f5d816119f1565b15610f7b576040516327ddf84960e11b815260040160405180910390fd5b6000818152607160209081526040808320815160a0810190925280548252600180820154929391929184019160ff1690811115610fba57610fba613e08565b6001811115610fcb57610fcb613e08565b815260408051606080820183526002858101546001600160a01b039081168452600387015481166020858101919091526004880154858701528087019490945284518084018652600588015482168152600688015490911693810193909352600786015483850152838501929092528251808201909352600885018054919094019391839160ff169081111561106357611063613e08565b600281111561107457611074613e08565b8152600182015460208201526002909101546040918201529152606083015101519192505046146110de576060810151604090810151905163092048d160e11b81526001600160e01b03196000351660048201526024810191909152466044820152606401610df8565b7f04e8cbd836dea43a2dc7eb19de345cca3a8e6978a2ef5225d924775500f67c7c61110882612121565b82604051610e5a92919061482e565b61111f611c64565b816000819003611142576040516316ee9d3b60e11b815260040160405180910390fd5b60005b818110156111775761116f858583818110611162576111626147d7565b905060a002013385611caa565b600101611145565b5050505050565b603754600290610100900460ff161580156111a0575060375460ff8083169116105b6111bc5760405162461bcd60e51b8152600401610df89061488d565b6037805461ffff191660ff8316176101001790556074546111e8906008906001600160a01b031661224a565b607554611200906003906001600160a01b031661224a565b60775461121890600a906001600160a01b031661224a565b607480546001600160a01b031990811690915560758054821690556077805490911690556037805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b604080518082018252600080825260208083018290526001600160a01b038616825260738152838220858352905282902082518084019093528054919291829060ff1660028111156112d4576112d4613e08565b60028111156112e5576112e5613e08565b815290546001600160a01b0361010090910481166020928301529082015191925016610a0357604051631b79f53b60e21b815260040160405180910390fd5b61132c612310565b600083900361134e576040516316ee9d3b60e11b815260040160405180910390fd5b61135a8484848461242b565b50505050565b60008061136b612310565b611375848461250e565b915091505b9250929050565b600061139361138e612598565b612605565b905090565b607160209081526000918252604091829020805460018201548451606080820187526002808601546001600160a01b03908116845260038701548116848901526004870154848a015288518084018a526005880154821681526006880154909116978101979097526007860154878901528751918201909752600885018054949760ff94851697939693959394929391928492169081111561143c5761143c613e08565b600281111561144d5761144d613e08565b815260200160018201548152602001600282015481525050905085565b61147261236a565b610f4a61263b565b611482612310565b61148b81612678565b610a1c828261224a565b6000828152606c60205260408120610f0990836126ae565b6000918252606b602090815260408084206001600160a01b0393909316845291905290205460ff1690565b603754610100900460ff16158080156114f85750603754600160ff909116105b806115125750303b158015611512575060375460ff166001145b61152e5760405162461bcd60e51b8152600401610df89061488d565b6037805460ff191660011790558015611551576037805461ff0019166101001790555b61155c60008d6126ba565b6115668b8b6126c4565b611570898961250e565b506000905061157f86806148db565b905011156115d1576115b261159486806148db565b6115a160208901896148db565b6115ab89806148db565b8989612754565b6115d16115bf86806148db565b6115cc60208801886148db565b61242b565b8015611617576037805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050505050565b606061162f611c64565b611637611d79565b81806001600160401b03811115611650576116506141f9565b604051908082528060200260200182016040528015611679578160200160208202803683370190505b5091506000611686611381565b9050611690613bc0565b60005b83811015611739578686828181106116ad576116ad6147d7565b905061016002018036038101906116c49190614746565b915060026040808401518101516000908152606f6020908152828220865183529052205460ff1660048111156116fc576116fc613e08565b03611726576001858281518110611715576117156147d7565b911515602092830291909101909101525b611731823385611e1a565b600101611693565b5050505092915050565b61174b612310565b610a1c82826126c4565b6000818152606c60205260408120610a0390612970565b6000828152606b60205260409020600101546117878161221e565b610db583836122ee565b600061179b612598565b6001546117a8919061493a565b6002546117b5908461493a565b101592915050565b6117c5612310565b60008790036117f5576000356001600160e01b0319166040516306b5667560e21b8152600401610df89190614415565b6118058888888888888888612754565b5050505050505050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f81111561184657611846613e08565b60ff1681526020810191909152604001600020546001600160a01b0316905080611885578160405163409140df60e11b8152600401610df89190614951565b919050565b6060816001600160401b038111156118a4576118a46141f9565b6040519080825280602002602001820160405280156118d757816020015b60608152602001906001900390816118c25790505b50905060005b828110156119e957600085815260726020526040812090858584818110611906576119066147d7565b905060200201602081019061191b9190613dc9565b6001600160a01b03166001600160a01b0316815260200190815260200160002080546119469061496b565b80601f01602080910402602001604051908101604052809291908181526020018280546119729061496b565b80156119bf5780601f10611994576101008083540402835291602001916119bf565b820191906000526020600020905b8154815290600101906020018083116119a257829003601f168201915b50505050508282815181106119d6576119d66147d7565b60209081029190910101526001016118dd565b509392505050565b6000600260008381526070602052604090205460ff166004811115611a1857611a18613e08565b1492915050565b611a27611c64565b611a2f611d79565b33838015801590611a3f57508083145b611a6a576000356001600160e01b0319166040516306b5667560e21b8152600401610df89190614415565b6000611a74611381565b9050600080611a83600361180f565b905060005b84811015611c0e57898982818110611aa257611aa26147d7565b905060200201359250878782818110611abd57611abd6147d7565b9050602002810190611acf919061499f565b60008581526072602090815260408083206001600160a01b038c168452909152902091611afd919083614a35565b5060405163c7c4fea960e01b81526001600160a01b0383169063c7c4fea990611b2f9060019087908b906004016147ed565b600060405180830381600087803b158015611b4957600080fd5b505af1158015611b5d573d6000803e3d6000fd5b50505060008481526076602052604081209150611b7c828988886121eb565b90506001816004811115611b9257611b92613e08565b03611c0457815460ff1916600217825560405163114fc47560e11b81526001600160a01b0385169063229f88ea90611bd1906001908990600401614817565b600060405180830381600087803b158015611beb57600080fd5b505af1158015611bff573d6000803e3d6000fd5b505050505b5050600101611a88565b50505050505050505050565b60006001600160e01b03198216635a05180f60e01b1480610a035750610a038261297a565b60006001600160e01b03198216630271189760e51b1480610a035750610a0382611c1a565b60005460ff1615610f4a5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610df8565b611cc4611cbf36859003850160408601614af4565b6129af565b611ccd836129f3565b6000611ce8611ce26040860160208701613dc9565b83611280565b80519091506002811115611cfe57611cfe613e08565b611d0e6060860160408701614b10565b6002811115611d1f57611d1f613e08565b14611d3c5760405162035e2b60ea1b815260040160405180910390fd5b611d6983611d506040870160208801613dc9565b611d6236889003880160408901614af4565b9190612a71565b6111778483858460200151612bfc565b611d83600b61180f565b604051635a02d57960e11b81523360048201526001600160a01b03919091169063b405aaf290602401602060405180830381865afa158015611dc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ded9190614b2b565b610f4a576000356001600160e01b0319166006604051620f948f60ea1b8152600401610df8929190614b4d565b82516080840151611e2a906129af565b600084602001516001811115611e4257611e42613e08565b14611e605760405163182f3d8760e11b815260040160405180910390fd5b4684606001516040015114611eae576060840151604090810151905163092048d160e11b81526001600160e01b03196000351660048201526024810191909152466044820152606401610df8565b6000611eca856060015160200151866040015160400151611280565b6080860151519091506002811115611ee457611ee4613e08565b81516002811115611ef757611ef7613e08565b148015611f2157508460400151602001516001600160a01b031681602001516001600160a01b0316145b611f3e5760405163f4b8742f60e01b815260040160405180910390fd5b6040808601518101516000908152606f6020908152828220858352905290812090611f6887612121565b90506000611f78838888856121eb565b905087604001516040015185886001600160a01b03167f48c4262ed68beb92fe5d7d48d70772e49cd50c317937dea60a99f15f794b645985604051611fbf91815260200190565b60405180910390a46000611fd3600361180f565b90506001826004811115611fe957611fe9613e08565b036120b357835460ff191660021784556060890151805160209091015160808b01516120189290916000612d8e565b885160405163114fc47560e11b81526001600160a01b0383169163229f88ea9161204791600091600401614817565b600060405180830381600087803b15801561206157600080fd5b505af1158015612075573d6000803e3d6000fd5b505050507f8d20d8121a34dded9035ff5b43e901c142824f7a22126392992c353c37890524838a6040516120aa92919061482e565b60405180910390a15b885160405163c7c4fea960e01b81526001600160a01b0383169163c7c4fea9916120e4916000918d906004016147ed565b600060405180830381600087803b1580156120fe57600080fd5b505af1158015612112573d6000803e3d6000fd5b50505050505050505050505050565b6000806121318360400151612fa7565b905060006121428460600151612fa7565b905060006121968560800151604080517f1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d815282516020808301919091528301518183015291015160608201526080902090565b604080517fb9d1fe7c9deeec5dc90a2f47ff1684239519f2545b2228d3d91fb27df3189eea815287516020808301919091529097015190870152606086019390935250608084015260a08301525060c0902090565b60006121f8858584612fef565b600061220486846130a5565b9050612212868583866131a9565b9150505b949350505050565b610a5081336131f5565b6122328282613259565b6000828152606c60205260409020610db590826132df565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f81111561228057612280613e08565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f8111156122c1576122c1613e08565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b6122f882826132f4565b6000828152606c60205260409020610db5908261335b565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610f4a576000356001600160e01b0319166001604051620f948f60ea1b8152600401610df8929190614b4d565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314806123ac57506005546001600160a01b031633145b610f4a576000356001600160e01b0319166001604051620f948f60ea1b8152600401610df8929190614b4d565b6123e1613370565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b828114612459576000356001600160e01b0319166040516306b5667560e21b8152600401610df89190614415565b60005b838110156124ca57828282818110612476576124766147d7565b9050602002013560386000878785818110612493576124936147d7565b90506020020160208101906124a89190613dc9565b6001600160a01b0316815260208101919091526040016000205560010161245c565b507f6f52f53a938df83439fa4c6055c7df0a6906d621aa6dfa4708187037fdfc41da848484846040516125009493929190614bf6565b60405180910390a150505050565b600080828411156125325760405163964a4d2760e01b815260040160405180910390fd5b505060018054600254607885905560798490556004805493840190556040805183815260208101839052929391928592879290917feac82d4d949d2d4f77f96aa68ab6b1bb750da73f14e55d41a1b93f387471ecba910160405180910390a49250929050565b60006125a4600b61180f565b6001600160a01b03166306aba0e16040518163ffffffff1660e01b8152600401602060405180830381865afa1580156125e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113939190614c28565b600060025460016002548460015461261d919061493a565b6126279190614c41565b6126319190614c54565b610a039190614c67565b612643611c64565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861240e3390565b806001600160a01b03163b600003610a5057604051630bfc64a360e21b81526001600160a01b0382166004820152602401610df8565b6000610f0983836133b9565b610a1c8282612228565b808211156126f3576000356001600160e01b0319166040516387f6f09560e01b8152600401610df89190614415565b6001805460028054858455908490556004805493840190556040805183815260208101839052929391928592879290917f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a450505050565b868514801561276257508683145b61278d576000356001600160e01b0319166040516306b5667560e21b8152600401610df89190614415565b60005b87811015612920578686828181106127aa576127aa6147d7565b90506020020160208101906127bf9190613dc9565b607360008b8b858181106127d5576127d56147d7565b90506020020160208101906127ea9190613dc9565b6001600160a01b03166001600160a01b03168152602001908152602001600020600087878581811061281e5761281e6147d7565b90506020020135815260200190815260200160002060000160016101000a8154816001600160a01b0302191690836001600160a01b0316021790555082828281811061286c5761286c6147d7565b90506020020160208101906128819190614b10565b607360008b8b85818110612897576128976147d7565b90506020020160208101906128ac9190613dc9565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008787858181106128e0576128e06147d7565b60209081029290920135835250810191909152604001600020805460ff1916600183600281111561291357612913613e08565b0217905550600101612790565b507f2544bff60c6d5b84946e06804af9f84e150bbee85238dbdee79efca4e0adf401888888888888888860405161295e989796959493929190614c89565b60405180910390a15050505050505050565b6000610a03825490565b60006001600160e01b03198216637965db0b60e01b1480610a0357506301ffc9a760e01b6001600160e01b0319831614610a03565b6129b8816133e3565b806129c757506129c78161341a565b806129d657506129d681613442565b610a505760405163034992a760e51b815260040160405180910390fd5b6000612a056060830160408401614b10565b6002811115612a1657612a16613e08565b148015612a53575060386000612a326040840160208501613dc9565b6001600160a01b031681526020810191909152604001600020546080820135105b15610a5057604051636eff4a8560e11b815260040160405180910390fd5b600060608185516002811115612a8957612a89613e08565b03612b645760408581015181516001600160a01b03878116602483015230604483015260648083019390935283518083039093018352608490910183526020820180516001600160e01b03166323b872dd60e01b179052915191851691612af09190614d18565b6000604051808303816000865af19150503d8060008114612b2d576040519150601f19603f3d011682016040523d82523d6000602084013e612b32565b606091505b509092509050818015612b5d575080511580612b5d575080806020019051810190612b5d9190614b2b565b9150612bd6565b600185516002811115612b7957612b79613e08565b03612b8e57612b5d838530886020015161346b565b600285516002811115612ba357612ba3613e08565b03612bbd57612b5d83853088602001518960400151613519565b6040516361e411a760e11b815260040160405180910390fd5b816111775784843085604051639d2e4c6760e01b8152600401610df89493929190614d34565b606e805460009182612c0d83614d6a565b9091555090506000612c3484838588612c2b368c90038c018c614d83565b939291906135cd565b60008381526071602090815260409091208251815590820151600180830180549495508594909160ff19909116908381811115612c7357612c73613e08565b02179055506040828101518051600280850180546001600160a01b039384166001600160a01b03199182161790915560208085015160038801805491861691841691909117905593850151600487015560608701518051600588018054918616918416919091179055938401516006870180549190941691161790915591015160078301556080830151805160088401805492939092839160ff19909116906001908490811115612d2657612d26613e08565b0217905550602082015181600101556040820151816002015550509050507ff313c253a5be72c29d0deb2c8768a9543744ac03d6b3cafd50cc976f1c2632fc612d6e82612121565b82604051612d7d92919061482e565b60405180910390a150949350505050565b806001600160a01b0316826001600160a01b031603612e3b5760408085015190516001600160a01b0385169180156108fc02916000818181858888f19350505050612e3657806001600160a01b031663d0e30db085604001516040518263ffffffff1660e01b81526004016000604051808303818588803b158015612e1257600080fd5b505af1158015612e26573d6000803e3d6000fd5b5050505050612e36848484613639565b61135a565b600084516002811115612e5057612e50613e08565b03612f16576040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa158015612e9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ec09190614c28565b90508460400151811015612f0557612ee88330838860400151612ee39190614c54565b6136b8565b612f0557604051632f739fff60e11b815260040160405180910390fd5b612f10858585613639565b5061135a565b600184516002811115612f2b57612f2b613e08565b03612f5c57612f3f8284866020015161375d565b612e365760405163c8e3a09f60e01b815260040160405180910390fd5b600284516002811115612f7157612f71613e08565b03612bbd57612f8a828486602001518760400151613784565b612e36576040516334b471a760e21b815260040160405180910390fd5b604080517f353bdd8d69b9e3185b3972e08b03845c0c14a21a390215302776a7a34b0e8764815282516020808301919091528301518183015291015160608201526080902090565b60008360030154118015613007575042836003015411155b1561301857825460ff191660041783555b6001600160a01b03821660009081526002840160205260409020541561305c5760405163025fd59560e41b81526001600160a01b0383166004820152602401610df8565b6001600160a01b039091166000818152600284016020908152604082209390935560059093018054600181018255908452919092200180546001600160a01b0319169091179055565b60008060006130b4600b61180f565b6001600160a01b031663c441c4a86040518163ffffffff1660e01b8152600401600060405180830381865afa1580156130f1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526131199190810190614e3e565b81519194509250905060005b818110156117395785876002016000868481518110613146576131466147d7565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002054036131a157828181518110613186576131866147d7565b60200260200101516bffffffffffffffffffffffff16850194505b600101613125565b60008383101580156131d057506000855460ff1660048111156131ce576131ce613e08565b145b156131e857845460ff19166001908117865585018290555b5050915460ff1692915050565b6131ff82826114ad565b610a1c57613217816001600160a01b031660146137ad565b6132228360206137ad565b604051602001613233929190614f36565b60408051601f198184030181529082905262461bcd60e51b8252610df891600401614fab565b61326382826114ad565b610a1c576000828152606b602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561329b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610f09836001600160a01b038416613948565b6132fe82826114ad565b15610a1c576000828152606b602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610f09836001600160a01b038416613997565b60005460ff16610f4a5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610df8565b60008260000182815481106133d0576133d06147d7565b9060005260206000200154905092915050565b600080825160028111156133f9576133f9613e08565b14801561340a575060008260400151115b8015610a03575050602001511590565b600060018251600281111561343157613431613e08565b148015610a03575050604001511590565b600060028251600281111561345957613459613e08565b148015610a0357505060400151151590565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928716916134cb91614d18565b6000604051808303816000865af19150503d8060008114613508576040519150601f19603f3d011682016040523d82523d6000602084013e61350d565b606091505b50909695505050505050565b604080516000808252602082019092526001600160a01b0387169061354990879087908790879060448101614fbe565b60408051601f198184030181529181526020820180516001600160e01b0316637921219560e11b1790525161357e9190614d18565b6000604051808303816000865af19150503d80600081146135bb576040519150601f19603f3d011682016040523d82523d6000602084013e6135c0565b606091505b5090979650505050505050565b6135d5613bc0565b92835260016020808501919091526060840180516001600160a01b0396871690528682015181519087169083015251466040918201528651818601805191881690915280519490961693909101929092529251810192909252910151608082015290565b6000808451600281111561364f5761364f613e08565b0361366a5761366382848660400151613a8a565b9050613694565b60018451600281111561367f5761367f613e08565b03612bbd57613663823085876020015161346b565b8061135a578383836040516341bd7d9160e11b8152600401610df893929190614ff8565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b03166340c10f1960e01b179052915160009286169161371091614d18565b6000604051808303816000865af19150503d806000811461374d576040519150601f19603f3d011682016040523d82523d6000602084013e613752565b606091505b509095945050505050565b600061376b8430858561346b565b905080610f095761377d8484846136b8565b9050610f09565b60006137938530868686613519565b905080612216576137a685858585613b5d565b9050612216565b606060006137bc83600261493a565b6137c7906002614c41565b6001600160401b038111156137de576137de6141f9565b6040519080825280601f01601f191660200182016040528015613808576020820181803683370190505b509050600360fc1b81600081518110613823576138236147d7565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613852576138526147d7565b60200101906001600160f81b031916908160001a905350600061387684600261493a565b613881906001614c41565b90505b60018111156138f9576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106138b5576138b56147d7565b1a60f81b8282815181106138cb576138cb6147d7565b60200101906001600160f81b031916908160001a90535060049490941c936138f281615028565b9050613884565b508315610f095760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610df8565b600081815260018301602052604081205461398f57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610a03565b506000610a03565b60008181526001830160205260408120548015613a805760006139bb600183614c54565b85549091506000906139cf90600190614c54565b9050818114613a345760008660000182815481106139ef576139ef6147d7565b9060005260206000200154905080876000018481548110613a1257613a126147d7565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613a4557613a4561503f565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610a03565b6000915050610a03565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b179052915160009260609290871691613ae79190614d18565b6000604051808303816000865af19150503d8060008114613b24576040519150601f19603f3d011682016040523d82523d6000602084013e613b29565b606091505b509092509050818015613b54575080511580613b54575080806020019051810190613b549190614b2b565b95945050505050565b604080516000808252602082019092526001600160a01b03861690613b8b9086908690869060448101615055565b60408051601f198184030181529181526020820180516001600160e01b031663731133e960e01b179052516134cb9190614d18565b6040805160a08101825260008082526020808301829052835160608082018652838252818301849052818601849052848601919091528451808201865283815280830184905280860184905281850152845190810185528281529081018290529283015290608082015290565b600060208284031215613c3f57600080fd5b81356001600160e01b031981168114610f0957600080fd5b60008082840360c0811215613c6b57600080fd5b60a0811215613c7957600080fd5b50919360a08501359350915050565b60006101608284031215613c9b57600080fd5b50919050565b60008083601f840112613cb357600080fd5b5081356001600160401b03811115613cca57600080fd5b6020830191508360208260051b850101111561137a57600080fd5b60008060208385031215613cf857600080fd5b82356001600160401b03811115613d0e57600080fd5b613d1a85828601613ca1565b90969095509350505050565b6020808252825182820181905260009190848201906040850190845b8181101561350d578351151583529284019291840191600101613d42565b600060208284031215613d7257600080fd5b5035919050565b6001600160a01b0381168114610a5057600080fd5b803561188581613d79565b60008060408385031215613dac57600080fd5b823591506020830135613dbe81613d79565b809150509250929050565b600060208284031215613ddb57600080fd5b8135610f0981613d79565b60008060408385031215613df957600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b6080810160058610613e3257613e32613e08565b9481526020810193909352604083019190915260609091015290565b600080600060408486031215613e6357600080fd5b83356001600160401b0380821115613e7a57600080fd5b818601915086601f830112613e8e57600080fd5b813581811115613e9d57600080fd5b87602060a083028501011115613eb257600080fd5b6020928301989097509590910135949350505050565b60008060408385031215613edb57600080fd5b8235613ee681613d79565b946020939093013593505050565b60038110610a5057610a50613e08565b81516040820190613f1481613ef4565b82526020928301516001600160a01b0316929091019190915290565b60008060008060408587031215613f4657600080fd5b84356001600160401b0380821115613f5d57600080fd5b613f6988838901613ca1565b90965094506020870135915080821115613f8257600080fd5b50613f8f87828801613ca1565b95989497509550505050565b60028110613fab57613fab613e08565b9052565b80516001600160a01b03908116835260208083015190911690830152604090810151910152565b8051613fe181613ef4565b825260208181015190830152604090810151910152565b858152610160810161400d6020830187613f9b565b61401a6040830186613faf565b61402760a0830185613faf565b614035610100830184613fd6565b9695505050505050565b80356010811061188557600080fd5b6000806040838503121561406157600080fd5b61406a8361403f565b91506020830135613dbe81613d79565b8060408101831015610a0357600080fd5b60008060008060008060008060008060006101208c8e0312156140ad57600080fd5b6140b68c613d8e565b9a5060208c0135995060408c0135985060608c0135975060808c013596506001600160401b038060a08e013511156140ed57600080fd5b6140fd8e60a08f01358f01613ca1565b909750955060c08d013581101561411357600080fd5b6141238e60c08f01358f0161407a565b94508060e08e0135111561413657600080fd5b6141468e60e08f01358f0161407a565b9350806101008e0135111561415a57600080fd5b5061416c8d6101008e01358e01613ca1565b81935080925050509295989b509295989b9093969950565b6000806020838503121561419757600080fd5b82356001600160401b03808211156141ae57600080fd5b818501915085601f8301126141c257600080fd5b8135818111156141d157600080fd5b866020610160830285010111156141e757600080fd5b60209290920196919550909350505050565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715614231576142316141f9565b60405290565b604051601f8201601f191681016001600160401b038111828210171561425f5761425f6141f9565b604052919050565b60006001600160401b03821115614280576142806141f9565b5060051b60200190565b600082601f83011261429b57600080fd5b813560206142b06142ab83614267565b614237565b8083825260208201915060208460051b8701019350868411156142d257600080fd5b602086015b848110156142ee57803583529183019183016142d7565b509695505050505050565b600082601f83011261430a57600080fd5b81356001600160401b03811115614323576143236141f9565b614336601f8201601f1916602001614237565b81815284602083860101111561434b57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561438057600080fd5b853561438b81613d79565b9450602086013561439b81613d79565b935060408601356001600160401b03808211156143b757600080fd5b6143c389838a0161428a565b945060608801359150808211156143d957600080fd5b6143e589838a0161428a565b935060808801359150808211156143fb57600080fd5b50614408888289016142f9565b9150509295509295909350565b6001600160e01b031991909116815260200190565b6000806000806000806000806080898b03121561444657600080fd5b88356001600160401b038082111561445d57600080fd5b6144698c838d01613ca1565b909a50985060208b013591508082111561448257600080fd5b61448e8c838d01613ca1565b909850965060408b01359150808211156144a757600080fd5b6144b38c838d01613ca1565b909650945060608b01359150808211156144cc57600080fd5b506144d98b828c01613ca1565b999c989b5096995094979396929594505050565b6000602082840312156144ff57600080fd5b610f098261403f565b60008060006040848603121561451d57600080fd5b8335925060208401356001600160401b0381111561453a57600080fd5b61454686828701613ca1565b9497909650939450505050565b60005b8381101561456e578181015183820152602001614556565b50506000910152565b6000815180845261458f816020860160208601614553565b601f01601f19169290920160200192915050565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b828110156145fa57603f198886030184526145e8858351614577565b945092850192908501906001016145cc565b5092979650505050505050565b600080600080600060a0868803121561461f57600080fd5b853561462a81613d79565b9450602086013561463a81613d79565b9350604086013592506060860135915060808601356001600160401b0381111561466357600080fd5b614408888289016142f9565b60008060006060848603121561468457600080fd5b8335925060208401359150604084013561469d81613d79565b809150509250925092565b6000606082840312156146ba57600080fd5b6146c261420f565b905081356146cf81613d79565b815260208201356146df81613d79565b806020830152506040820135604082015292915050565b80356003811061188557600080fd5b60006060828403121561471757600080fd5b61471f61420f565b905061472a826146f6565b8152602082013560208201526040820135604082015292915050565b6000610160828403121561475957600080fd5b60405160a081018181106001600160401b038211171561477b5761477b6141f9565b6040528235815260208301356002811061479457600080fd5b60208201526147a684604085016146a8565b60408201526147b88460a085016146a8565b60608201526147cb846101008501614705565b60808201529392505050565b634e487b7160e01b600052603260045260246000fd5b606081016147fa85613ef4565b93815260208101929092526001600160a01b031660409091015290565b6040810161482484613ef4565b9281526020015290565b6000610180820190508382528251602083015260208301516148536040840182613f9b565b5060408301516148666060840182613faf565b50606083015161487960c0840182613faf565b5060808301516119e9610120840182613fd6565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6000808335601e198436030181126148f257600080fd5b8301803591506001600160401b0382111561490c57600080fd5b6020019150600581901b360382131561137a57600080fd5b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610a0357610a03614924565b602081016010831061496557614965613e08565b91905290565b600181811c9082168061497f57607f821691505b602082108103613c9b57634e487b7160e01b600052602260045260246000fd5b6000808335601e198436030181126149b657600080fd5b8301803591506001600160401b038211156149d057600080fd5b60200191503681900382131561137a57600080fd5b601f821115610db5576000816000526020600020601f850160051c81016020861015614a0e5750805b601f850160051c820191505b81811015614a2d57828155600101614a1a565b505050505050565b6001600160401b03831115614a4c57614a4c6141f9565b614a6083614a5a835461496b565b836149e5565b6000601f841160018114614a945760008515614a7c5750838201355b600019600387901b1c1916600186901b178355611177565b600083815260209020601f19861690835b82811015614ac55786850135825560209485019460019092019101614aa5565b5086821015614ae25760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b600060608284031215614b0657600080fd5b610f098383614705565b600060208284031215614b2257600080fd5b610f09826146f6565b600060208284031215614b3d57600080fd5b81518015158114610f0957600080fd5b6001600160e01b03198316815260408101600b8310614b6e57614b6e613e08565b8260208301529392505050565b8183526000602080850194508260005b85811015614bb9578135614b9e81613d79565b6001600160a01b031687529582019590820190600101614b8b565b509495945050505050565b81835260006001600160fb1b03831115614bdd57600080fd5b8260051b80836020870137939093016020019392505050565b604081526000614c0a604083018688614b7b565b8281036020840152614c1d818587614bc4565b979650505050505050565b600060208284031215614c3a57600080fd5b5051919050565b80820180821115610a0357610a03614924565b81810381811115610a0357610a03614924565b600082614c8457634e487b7160e01b600052601260045260246000fd5b500490565b608081526000614c9d608083018a8c614b7b565b60208382036020850152614cb2828a8c614b7b565b91508382036040850152614cc782888a614bc4565b848103606086015285815286925060200160005b86811015614d0757614cec846146f6565b614cf581613ef4565b82529282019290820190600101614cdb565b509c9b505050505050505050505050565b60008251614d2a818460208701614553565b9190910192915050565b60c08101614d428287613fd6565b6001600160a01b0394851660608301529284166080820152921660a090920191909152919050565b600060018201614d7c57614d7c614924565b5060010190565b600060a08284031215614d9557600080fd5b614d9d61420f565b8235614da881613d79565b81526020830135614db881613d79565b6020820152614dca8460408501614705565b60408201529392505050565b600082601f830112614de757600080fd5b81516020614df76142ab83614267565b8083825260208201915060208460051b870101935086841115614e1957600080fd5b602086015b848110156142ee578051614e3181613d79565b8352918301918301614e1e565b600080600060608486031215614e5357600080fd5b83516001600160401b0380821115614e6a57600080fd5b614e7687838801614dd6565b9450602091508186015181811115614e8d57600080fd5b614e9988828901614dd6565b945050604086015181811115614eae57600080fd5b86019050601f81018713614ec157600080fd5b8051614ecf6142ab82614267565b81815260059190911b82018301908381019089831115614eee57600080fd5b928401925b82841015614f275783516bffffffffffffffffffffffff81168114614f185760008081fd5b82529284019290840190614ef3565b80955050505050509250925092565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351614f6e816017850160208801614553565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351614f9f816028840160208801614553565b01602801949350505050565b602081526000610f096020830184614577565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090614c1d90830184614577565b60a081016150068286613fd6565b6001600160a01b03938416606083015291909216608090920191909152919050565b60008161503757615037614924565b506000190190565b634e487b7160e01b600052603160045260246000fd5b60018060a01b0385168152836020820152826040820152608060608201526000614035608083018461457756fea2646970667358221220f2c96cbb22626006ee11ff90975b91b23886e548ed7a61504409d1948b356f0f64736f6c63430008170033", + "nonce": "0x2f12b" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0xd24d87ddc1917165435b306aac68d99e0f49a3fa", + "to": "0xb0507f2f22697022ecb25963a00d3d076dac5753", + "gas": "0x8fcf4", + "value": "0x0", + "data": "0x663ac01100000000000000000000000000000000000000000000000000000000663074ca00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000054000000000000000000000000000000000000000000000000000000000000010a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000110000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000003a00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000046000000000000000000000000000000000000000000000000000000000000005400000000000000000000000000000000000000000000000000000000000000620000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000007e0000000000000000000000000000000000000000000000000000000000000084000000000000000000000000000000000000000000000000000000000000008a00000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000000000096000000000000000000000000000000000000000000000000000000000000009c00000000000000000000000000000000000000000000000000000000000000ac00000000000000000000000000000000000000000000000000000000000000b2000000000000000000000000000000000000000000000000000000000000000844f1ef286000000000000000000000000836d911c7de3edfc953030b9abc4b2b18b2db8b9000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000045cd8a76b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000007beb0f3fc4002c4542015cfa9023dee1a9ec94000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe6000000000000000000000000b03e29be08e57b2d95fe9f94966cb86a0dd984810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000004222384e84c248aa8d50fdc702a1b55e6b4efc990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000003a3a92ba9d4d49aae06861136d547667c742f1af0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c44bb5274a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006435da8121000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x262" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0xb033ba62ec622dc54d0abfe0254e79692147ca26", + "to": "0xb0507f2f22697022ecb25963a00d3d076dac5753", + "gas": "0x4956e", + "value": "0x0", + "data": "0xa8a0e32c00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000007e500000000000000000000000000000000000000000000000000000000663074ca00000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000010c000000000000000000000000000000000000000000000000000000000000000110000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000003a00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000046000000000000000000000000000000000000000000000000000000000000005400000000000000000000000000000000000000000000000000000000000000620000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000007e0000000000000000000000000000000000000000000000000000000000000084000000000000000000000000000000000000000000000000000000000000008a00000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000000000096000000000000000000000000000000000000000000000000000000000000009c00000000000000000000000000000000000000000000000000000000000000ac00000000000000000000000000000000000000000000000000000000000000b2000000000000000000000000000000000000000000000000000000000000000844f1ef286000000000000000000000000836d911c7de3edfc953030b9abc4b2b18b2db8b9000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000045cd8a76b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000007beb0f3fc4002c4542015cfa9023dee1a9ec94000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe6000000000000000000000000b03e29be08e57b2d95fe9f94966cb86a0dd984810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000004222384e84c248aa8d50fdc702a1b55e6b4efc990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000003a3a92ba9d4d49aae06861136d547667c742f1af0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c44bb5274a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006435da8121000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x65" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x087d08e3ba42e64e3948962dd1371f906d1278b9", + "to": "0xb0507f2f22697022ecb25963a00d3d076dac5753", + "gas": "0x10cf46", + "value": "0x0", + "data": "0xa8a0e32c00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000007e500000000000000000000000000000000000000000000000000000000663074ca00000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000010c000000000000000000000000000000000000000000000000000000000000000110000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000003a00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000046000000000000000000000000000000000000000000000000000000000000005400000000000000000000000000000000000000000000000000000000000000620000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000007e0000000000000000000000000000000000000000000000000000000000000084000000000000000000000000000000000000000000000000000000000000008a00000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000000000096000000000000000000000000000000000000000000000000000000000000009c00000000000000000000000000000000000000000000000000000000000000ac00000000000000000000000000000000000000000000000000000000000000b2000000000000000000000000000000000000000000000000000000000000000844f1ef286000000000000000000000000836d911c7de3edfc953030b9abc4b2b18b2db8b9000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000045cd8a76b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000007beb0f3fc4002c4542015cfa9023dee1a9ec94000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe6000000000000000000000000b03e29be08e57b2d95fe9f94966cb86a0dd984810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000004222384e84c248aa8d50fdc702a1b55e6b4efc990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000003a3a92ba9d4d49aae06861136d547667c742f1af0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c44bb5274a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006435da8121000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x5a" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1713246801, + "chain": 2021, + "multi": false, + "commit": "9c4cad4" +} \ No newline at end of file diff --git a/broadcast/20240411-p2-upgrade-bridge-ronin-chain.s.sol/2021/run-1713250237.json b/broadcast/20240411-p2-upgrade-bridge-ronin-chain.s.sol/2021/run-1713250237.json new file mode 100644 index 00000000..a356ef7b --- /dev/null +++ b/broadcast/20240411-p2-upgrade-bridge-ronin-chain.s.sol/2021/run-1713250237.json @@ -0,0 +1,316 @@ +{ + "transactions": [ + { + "hash": "0x1467e2ab29e7b30da58b2651b5e1385992f17526838467aced5d2eab819d5688", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x53Ea388CB72081A3a397114a43741e7987815896", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x52ec2e6bbce45afff8955da6410bb13812f4289f", + "to": "0x53ea388cb72081a3a397114a43741e7987815896", + "gas": "0x77916", + "value": "0x0", + "data": "0x663ac01100000000000000000000000000000000000000000000000000000000663074ca00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab95000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000248f283970000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac575300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x47" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0xa58405e67e2e6558de328d173bce7db193836183c1303351bf95c59fbcb7d78f", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x53Ea388CB72081A3a397114a43741e7987815896", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x087d08e3ba42e64e3948962dd1371f906d1278b9", + "to": "0x53ea388cb72081a3a397114a43741e7987815896", + "gas": "0x467e6", + "value": "0x0", + "data": "0xa8a0e32c00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002d00000000000000000000000000000000000000000000000000000000000007e500000000000000000000000000000000000000000000000000000000663074ca00000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000010000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab95000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000248f283970000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac575300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x59" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x53Ea388CB72081A3a397114a43741e7987815896", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x06f8af58f656b507918d91b0b6f8b89bfcc556f9", + "to": "0x53ea388cb72081a3a397114a43741e7987815896", + "gas": "0x467e6", + "value": "0x0", + "data": "0xa8a0e32c00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002d00000000000000000000000000000000000000000000000000000000000007e500000000000000000000000000000000000000000000000000000000663074ca00000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000010000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab95000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000248f283970000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac575300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x0" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x53Ea388CB72081A3a397114a43741e7987815896", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0xe1100401454b5f850b09f3b92ce7f071c5f1cef4", + "to": "0x53ea388cb72081a3a397114a43741e7987815896", + "gas": "0x5cd02", + "value": "0x0", + "data": "0xa8a0e32c00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002d00000000000000000000000000000000000000000000000000000000000007e500000000000000000000000000000000000000000000000000000000663074ca00000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000010000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab95000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000248f283970000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac575300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x0" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CREATE", + "contractName": "BridgeReward", + "contractAddress": "0x836D911C7de3edfc953030B9ABc4b2B18B2db8b9", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x2b9610", + "value": "0x0", + "data": "0x60a060405230608052610010610015565b6100d5565b600054610100900460ff16156100815760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156100d3576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6080516118666100f06000396000610bc701526118666000f3fe6080604052600436106100dd5760003560e01c80638f7c34a21161007f578063ad43663e11610059578063ad43663e14610261578063b77f2a4014610276578063de981f1b14610296578063f5dbc4ee146102ce57600080fd5b80638f7c34a21461021957806395b6ef0c1461022e578063a6bd67881461024157600080fd5b80633b154455116100bb5780633b154455146101c757806359f778df146101dc5780635cd8a76b146101e4578063865e6fd3146101f957600080fd5b806306032d74146100e257806333b3ea6c1461018257806334087952146101a4575b600080fd5b3480156100ee57600080fd5b506101626100fd366004611335565b604080518082018252600080825260209182018190526001600160a01b039390931683527f518cfd198acbffe95e740cfce1af28a3f7de51f0d784893d3d72c5cc59d7062a815291819020815180830190925280548252600101549181019190915290565b604080518251815260209283015192810192909252015b60405180910390f35b34801561018e57600080fd5b506101a261019d366004611352565b6102e3565b005b3480156101b057600080fd5b506101b9610399565b604051908152602001610179565b3480156101d357600080fd5b506101a26103c8565b6101a26104bb565b3480156101f057600080fd5b506101a26104c5565b34801561020557600080fd5b506101a261021436600461137a565b610593565b34801561022557600080fd5b506101b96105ae565b6101a261023c3660046113b1565b6105c6565b34801561024d57600080fd5b506101a261025c366004611352565b6106e9565b34801561026d57600080fd5b506101b96106fd565b34801561028257600080fd5b506101a2610291366004611352565b610727565b3480156102a257600080fd5b506102b66102b136600461142a565b61073d565b6040516001600160a01b039091168152602001610179565b3480156102da57600080fd5b506101b96107b8565b6102ec336107e2565b61031c57604051638f47e7e360e01b81526001600160e01b03196000351660048201526024015b60405180910390fd5b6000610328600861073d565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610365573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103899190611445565b90506103958183610860565b5050565b60006103c37f3663384f6436b31a97d9c9a02f64ab8b73ead575c5b6224fa0800a6bd57f62f45490565b905090565b60046103d381610acd565b6000196103de6105ae565b146104205760405162461bcd60e51b815260206004820152601260248201527130b63932b0b23c9034b734ba103932b8101960711b6044820152606401610313565b6104ac600161042f600861073d565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa15801561046c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104909190611445565b61049a9190611474565b60008051602061181183398151915255565b6104b860046000610b19565b50565b6104c3610bbd565b565b600054600290610100900460ff161580156104e7575060005460ff8083169116105b6105035760405162461bcd60e51b815260040161031390611487565b6000805461ffff191660ff8316176101001790556105417faf260ffaff563b9407c1c5fe4aec2be8632142d158c44bb0ce4d471cb4883b8c60059055565b61054e60016104906105ae565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150565b61059b610c9e565b6105a481610cf8565b6103958282610b19565b60006103c36000805160206118118339815191525490565b600054610100900460ff16158080156105e65750600054600160ff909116105b806106005750303b158015610600575060005460ff166001145b61061c5760405162461bcd60e51b815260040161031390611487565b6000805460ff19166001179055801561063f576000805461ff0019166101001790555b61064a600b88610b19565b610655600387610b19565b610660600c86610b19565b61066b600885610b19565b610676600484610b19565b6000196000805160206118118339815191525561069282610d2e565b61069a610bbd565b80156106e0576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b600b6106f481610acd565b61039582610d2e565b60006103c37f90f7d557245e5dd9485f463e58974fa7cdc93c0abbd0a1afebb8f9640ec739105490565b600361073281610acd565b610395826000610860565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115610774576107746114d5565b60ff1681526020810191909152604001600020546001600160a01b03169050806107b3578160405163409140df60e11b815260040161031391906114ff565b919050565b60006103c37f9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c645490565b60006107ee600b61073d565b604051635a02d57960e11b81526001600160a01b038481166004830152919091169063b405aaf290602401602060405180830381865afa158015610836573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085a919061150d565b92915050565b600061086a6105ae565b9050816000036108cc5760008184111561089757600161088a8386611474565b6108949190611474565b90505b6108c8816108c37faf260ffaff563b9407c1c5fe4aec2be8632142d158c44bb0ce4d471cb4883b8c5490565b610d87565b9250505b6108d7838383610d9f565b60006108e3600b61073d565b6001600160a01b0316639b19dbfd6040518163ffffffff1660e01b8152600401600060405180830381865afa158015610920573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610948919081019061159a565b90506000610956600361073d565b905060005b84811015610ac55761096c84611639565b9350610abd83836001600160a01b031663f67e815287876040518363ffffffff1660e01b81526004016109a0929190611697565b600060405180830381865afa1580156109bd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109e591908101906116b0565b60405163692f6a6360e11b8152600481018890526001600160a01b0386169063d25ed4c690602401602060405180830381865afa158015610a2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4e9190611445565b604051637153af9b60e11b8152600481018990526001600160a01b0387169063e2a75f3690602401602060405180830381865afa158015610a93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab79190611445565b88610e33565b60010161095b565b505050505050565b610ad68161073d565b6001600160a01b0316336001600160a01b0316146104b8576000356001600160e01b03191681336040516320e0f98d60e21b815260040161031393929190611736565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f811115610b4f57610b4f6114d5565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115610b9057610b906114d5565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610c1457604051638f47e7e360e01b81526001600160e01b0319600035166004820152602401610313565b337f7ae161a1f0ef2537f5ff1957021a50412e72abdc6a941a77d99361e91e7f3c3d610c5e7f9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c645490565b604080519182523460208301520160405180910390a26104b87f9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c6434610f8a565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031633146104c3576000356001600160e01b0319166001604051620f948f60ea1b815260040161031392919061176d565b806001600160a01b03163b6000036104b857604051630bfc64a360e21b81526001600160a01b0382166004820152602401610313565b610d577f90f7d557245e5dd9485f463e58974fa7cdc93c0abbd0a1afebb8f9640ec73910829055565b6040518181527f9b40b647582311cc8f5f7d27e7ce206d126605d1625b8299b7edaeefd869ef2590602001610588565b6000818310610d965781610d98565b825b9392505050565b81600003610dc05760405163799ffe0d60e01b815260040160405180910390fd5b610dcb81600161179b565b8311610df45760405163425a5b1f60e01b81526004810184905260248101829052604401610313565b610dfe828261179b565b8311610e2e57604051630931302b60e31b8152600481018490526024810182905260448101839052606401610313565b505050565b845184518114610e64576040516306b5667560e21b81526001600160e01b0319600035166004820152602401610313565b6000610e6e6106fd565b90506000610e7b88610fa1565b90506000610e8a87878a61101f565b90506000806000805b87811015610f3957610edc8589898f8581518110610eb357610eb36117ae565b60200260200101518f8e8c8881518110610ecf57610ecf6117ae565b6020026020010151611072565b80945081955050506000610f0b8a8f8481518110610efc57610efc6117ae565b60200260200101518787611093565b90508380610f17575080155b610f215784610f24565b60005b610f2e908461179b565b925050600101610e93565b50610f647f3663384f6436b31a97d9c9a02f64ab8b73ead575c5b6224fa0800a6bd57f62f482610f8a565b50610f7c600080516020611811833981519152899055565b505050505050505050505050565b600061085a83610f9a85856111f9565b9250829055565b6060610fad600c61073d565b6001600160a01b0316635311153b836040518263ffffffff1660e01b8152600401610fd891906117c4565b6000604051808303816000875af1158015610ff7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261085a91908101906116b0565b60008061102d858585611218565b90508061105e576040517f64ba7143ea5a17abea37667aa9ae137e3afba5033c5f504770c02829c128189c90600090a15b801580611069575084155b95945050505050565b6000828210156110858989898989611295565b915097509795505050505050565b6001600160a01b03831660009081527f518cfd198acbffe95e740cfce1af28a3f7de51f0d784893d3d72c5cc59d7062a60205260408120821561113857838160010160008282546110e4919061179b565b9091555050604080516001600160a01b03871681526020810186905287917fb3d061c3ef3991b0d4b09f4c8b551d137c3d1e014cf5326462d3d1f6a8dfb9c291015b60405180910390a260009150506111f1565b611144858560006112c0565b156111b0578381600001600082825461115d919061179b565b9091555050604080516001600160a01b03871681526020810186905287917fbab0baccb39371d4d5206b519fe58d21cae9cdd63a1d1b5146ecdf405fd93152910160405180910390a260019150506111f1565b604080516001600160a01b03871681526020810186905287917f74b217634c5a7790ce69770c5e35019970453d4da3973769e7d6cdb7ce6816a19101611126565b949350505050565b815481018181101561085a57634e487b7160005260116020526024601cfd5b8051600190600090815b8181101561127d578585828151811061123d5761123d6117ae565b60200260200101511115611254576000935061127d565b848181518110611266576112666117ae565b602002602001015183019250806001019050611222565b5082801561128b5750858211155b9695505050505050565b6000856112b657816112a784866117d7565b6112b191906117ee565b61128b565b61128b85856117ee565b6000836001600160a01b0316838390604051600060405180830381858888f193505050503d8060008114611310576040519150601f19603f3d011682016040523d82523d6000602084013e611315565b606091505b509095945050505050565b6001600160a01b03811681146104b857600080fd5b60006020828403121561134757600080fd5b8135610d9881611320565b60006020828403121561136457600080fd5b5035919050565b8035601081106107b357600080fd5b6000806040838503121561138d57600080fd5b6113968361136b565b915060208301356113a681611320565b809150509250929050565b60008060008060008060c087890312156113ca57600080fd5b86356113d581611320565b955060208701356113e581611320565b945060408701356113f581611320565b9350606087013561140581611320565b9250608087013561141581611320565b8092505060a087013590509295509295509295565b60006020828403121561143c57600080fd5b610d988261136b565b60006020828403121561145757600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561085a5761085a61145e565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b601081106114fb576114fb6114d5565b9052565b6020810161085a82846114eb565b60006020828403121561151f57600080fd5b81518015158114610d9857600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561156e5761156e61152f565b604052919050565b600067ffffffffffffffff8211156115905761159061152f565b5060051b60200190565b600060208083850312156115ad57600080fd5b825167ffffffffffffffff8111156115c457600080fd5b8301601f810185136115d557600080fd5b80516115e86115e382611576565b611545565b81815260059190911b8201830190838101908783111561160757600080fd5b928401925b8284101561162e57835161161f81611320565b8252928401929084019061160c565b979650505050505050565b60006001820161164b5761164b61145e565b5060010190565b60008151808452602080850194506020840160005b8381101561168c5781516001600160a01b031687529582019590820190600101611667565b509495945050505050565b8281526040602082015260006111f16040830184611652565b600060208083850312156116c357600080fd5b825167ffffffffffffffff8111156116da57600080fd5b8301601f810185136116eb57600080fd5b80516116f96115e382611576565b81815260059190911b8201830190838101908783111561171857600080fd5b928401925b8284101561162e5783518252928401929084019061171d565b6001600160e01b0319841681526060810161175460208301856114eb565b6001600160a01b03929092166040919091015292915050565b6001600160e01b03198316815260408101600b831061178e5761178e6114d5565b8260208301529392505050565b8082018082111561085a5761085a61145e565b634e487b7160e01b600052603260045260246000fd5b602081526000610d986020830184611652565b808202811582820484141761085a5761085a61145e565b60008261180b57634e487b7160e01b600052601260045260246000fd5b50049056fe2417f25874c1cdc139a787dd21df976d40d767090442b3a2496917ecfc93b619a2646970667358221220cd237faf10660b4bf88f4dcc843cf0b3d4cce585ad7f99199ed3924ea16b8dfd64736f6c63430008170033", + "nonce": "0x2f127" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CREATE", + "contractName": "BridgeSlash", + "contractAddress": "0x7bEB0f3fC4002C4542015cFa9023dEE1A9EC9400", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x26b9de", + "value": "0x0", + "data": "0x608060405261000c610011565b6100d1565b600054610100900460ff161561007d5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156100cf576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b611583806100e06000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80639c2f445911610097578063de981f1b11610066578063de981f1b146101fd578063f8c8765e14610228578063f9f608731461023b578063fbb2f1941461024357600080fd5b80639c2f4459146101d2578063c48549de146101da578063d1e1f2f8146101ed578063ddc3f7f6146101f557600080fd5b80635311153b116100d35780635311153b1461016a5780636dda44081461017d578063865e6fd3146101935780638f851d8a146101a657600080fd5b806301ffc9a7146101055780631288810a1461012d5780633b1544551461014d5780634dca592514610157575b600080fd5b610118610113366004610eb7565b610263565b60405190151581526020015b60405180910390f35b61014061013b366004610f2d565b61029a565b6040516101249190610f6f565b610155610382565b005b6101556101653660046110a4565b610462565b610140610178366004610f2d565b6106f9565b610185600181565b604051908152602001610124565b6101556101a136600461118e565b6107d2565b6101b96101b43660046111c1565b6107f1565b6040516001600160e01b03199091168152602001610124565b610185603281565b6101b96101e83660046112ba565b610970565b610185600581565b610185601e81565b61021061020b366004611326565b61098f565b6040516001600160a01b039091168152602001610124565b610155610236366004611341565b610a0a565b610140610b49565b610256610251366004611395565b610b58565b60405161012491906113cd565b60006001600160e01b031982166312c0151560e21b148061029457506001600160e01b031982166301ffc9a760e01b145b92915050565b6060818067ffffffffffffffff8111156102b6576102b6610fb3565b6040519080825280602002602001820160405280156102df578160200160208202803683370190505b50915060008051602061152e83398151915260005b8281101561037957816000878784818110610311576103116113e7565b905060200201602081019061032691906113fd565b6001600160a01b031681526020810191909152604001600020548451600160801b9091046001600160801b031690859083908110610366576103666113e7565b60209081029190910101526001016102f4565b50505092915050565b600461038d81610b6b565b600019600154146103da5760405162461bcd60e51b815260206004820152601260248201527130b63932b0b23c9034b734ba103932b8101960711b60448201526064015b60405180910390fd5b6103e4600861098f565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610421573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104459190611418565b610450906001611447565b60015561045f60046000610bb7565b50565b600361046d81610b6b565b8160015481106106f0578360328111156106ee5786518851146104b1576040516306b5667560e21b81526001600160e01b03196000351660048201526024016103d1565b8751156106ee576104c3868689610c5b565b6104f5576040517f64ba7143ea5a17abea37667aa9ae137e3afba5033c5f504770c02829c128189c90600090a16106ee565b60006104ff610cd8565b6040805180820190915260008082526020820181905291925060008051602061152e833981519152918080805b8e518110156106e6578e8181518110610547576105476113e7565b6020908102919091018101516001600160a01b03811660009081528883526040908190208151808301909252546001600160801b038082168352600160801b90910416928101839052965093508b11156106de576105be8e82815181106105b0576105b06113e7565b60200260200101518d610d43565b91506105d9828c87600001516001600160801b03168a610d95565b93506105e5848c610dec565b1561062b576040516001600160801b0394506001600160a01b038416908c907fb32a150b9737190a456d8b2b81dd7d592a799ab2933ea494e44351acd41f835d90600090a35b600082600281111561063f5761063f6113b7565b146106de576001600160801b0384146106a3578a836001600160a01b031683600281111561066f5761066f6113b7565b6040518781527fa0957b65e189f06dfe2b38ff07e89a0df128ba3fcba66c68f8d2615daebc30a99060200160405180910390a45b6001600160a01b038316600090815260208790526040902080546fffffffffffffffffffffffffffffffff19166001600160801b0386161790555b60010161052c565b505050505050505b505b50505050505050565b6060818067ffffffffffffffff81111561071557610715610fb3565b60405190808252806020026020018201604052801561073e578160200160208202803683370190505b50915060008051602061152e83398151915260005b8281101561037957816000878784818110610770576107706113e7565b905060200201602081019061078591906113fd565b6001600160a01b0316815260208101919091526040016000205484516001600160801b03909116908590839081106107bf576107bf6113e7565b6020908102919091010152600101610753565b6107da610e0e565b6107e381610e6a565b6107ed8282610bb7565b5050565b6000600b6107fe81610b6b565b82518690811461082f576040516306b5667560e21b81526001600160e01b03196000351660048201526024016103d1565b8060000361084757506347c28ec560e11b9150610966565b60008051602061152e8339815191526000610862600861098f565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa15801561089f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c39190611418565b905060005b83811015610957578681815181106108e2576108e26113e7565b60200260200101511561094f57818360008d8d85818110610905576109056113e7565b905060200201602081019061091a91906113fd565b6001600160a01b03168152602081019190915260400160002080546001600160801b03928316600160801b0292169190911790555b6001016108c8565b506347c28ec560e11b94505050505b5095945050505050565b6000600b61097d81610b6b565b50636242a4ef60e11b95945050505050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f8111156109c6576109c66113b7565b60ff1681526020810191909152604001600020546001600160a01b0316905080610a05578160405163409140df60e11b81526004016103d1919061146e565b919050565b600054610100900460ff1615808015610a2a5750600054600160ff909116105b80610a445750303b158015610a44575060005460ff166001145b610aa75760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103d1565b6000805460ff191660011790558015610aca576000805461ff0019166101001790555b610ad5600886610bb7565b610ae0600b85610bb7565b610aeb600384610bb7565b610af6600483610bb7565b6000196001558015610b42576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6060610b53610cd8565b905090565b6000610b648383610d43565b9392505050565b610b748161098f565b6001600160a01b0316336001600160a01b03161461045f576000356001600160e01b03191681336040516320e0f98d60e21b81526004016103d19392919061147c565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f811115610bed57610bed6113b7565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115610c2e57610c2e6113b7565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b8051600190600090815b81811015610cc05785858281518110610c8057610c806113e7565b60200260200101511115610c975760009350610cc0565b848181518110610ca957610ca96113e7565b602002602001015183019250806001019050610c65565b50828015610cce5750858211155b9695505050505050565b604080516003808252608082019092526060916020820183803683370190505090506001818160ff1681518110610d1157610d116113e7565b6020908102919091010152600581600260ff1681518110610d3457610d346113e7565b60200260200101818152505090565b60008082612710610d5486836114b3565b610d5e91906114c6565b610d6891906114dd565b9050610bb88111610d8a576103e88111610d83576000610d8d565b6001610d8d565b60025b949350505050565b6000610dab610da56001866114b3565b84610ea0565b82866002811115610dbe57610dbe6113b7565b60ff1681518110610dd157610dd16113e7565b6020026020010151610de39190611447565b95945050505050565b6000601e610dfb6001846114b3565b610e0590856114b3565b10159392505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610e68576000356001600160e01b0319166001604051620f948f60ea1b81526004016103d19291906114ff565b565b806001600160a01b03163b60000361045f57604051630bfc64a360e21b81526001600160a01b03821660048201526024016103d1565b600081831015610eb05781610b64565b5090919050565b600060208284031215610ec957600080fd5b81356001600160e01b031981168114610b6457600080fd5b60008083601f840112610ef357600080fd5b50813567ffffffffffffffff811115610f0b57600080fd5b6020830191508360208260051b8501011115610f2657600080fd5b9250929050565b60008060208385031215610f4057600080fd5b823567ffffffffffffffff811115610f5757600080fd5b610f6385828601610ee1565b90969095509350505050565b6020808252825182820181905260009190848201906040850190845b81811015610fa757835183529284019291840191600101610f8b565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610ff257610ff2610fb3565b604052919050565b600067ffffffffffffffff82111561101457611014610fb3565b5060051b60200190565b80356001600160a01b0381168114610a0557600080fd5b600082601f83011261104657600080fd5b8135602061105b61105683610ffa565b610fc9565b8083825260208201915060208460051b87010193508684111561107d57600080fd5b602086015b848110156110995780358352918301918301611082565b509695505050505050565b600080600080600060a086880312156110bc57600080fd5b853567ffffffffffffffff808211156110d457600080fd5b818801915088601f8301126110e857600080fd5b813560206110f861105683610ffa565b82815260059290921b8401810191818101908c84111561111757600080fd5b948201945b8386101561113c5761112d8661101e565b8252948201949082019061111c565b9950508901359250508082111561115257600080fd5b5061115f88828901611035565b959895975050505060408401359360608101359360809091013592509050565b803560108110610a0557600080fd5b600080604083850312156111a157600080fd5b6111aa8361117f565b91506111b86020840161101e565b90509250929050565b6000806000806000606086880312156111d957600080fd5b853567ffffffffffffffff808211156111f157600080fd5b6111fd89838a01610ee1565b909750955060209150878201358181111561121757600080fd5b6112238a828b01610ee1565b90965094505060408801358181111561123b57600080fd5b88019050601f8101891361124e57600080fd5b803561125c61105682610ffa565b81815260059190911b8201830190838101908b83111561127b57600080fd5b928401925b828410156112a857833580151581146112995760008081fd5b82529284019290840190611280565b80955050505050509295509295909350565b600080600080604085870312156112d057600080fd5b843567ffffffffffffffff808211156112e857600080fd5b6112f488838901610ee1565b9096509450602087013591508082111561130d57600080fd5b5061131a87828801610ee1565b95989497509550505050565b60006020828403121561133857600080fd5b610b648261117f565b6000806000806080858703121561135757600080fd5b6113608561101e565b935061136e6020860161101e565b925061137c6040860161101e565b915061138a6060860161101e565b905092959194509250565b600080604083850312156113a857600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60208101600383106113e1576113e16113b7565b91905290565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561140f57600080fd5b610b648261101e565b60006020828403121561142a57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561029457610294611431565b6010811061146a5761146a6113b7565b9052565b60208101610294828461145a565b6001600160e01b0319841681526060810161149a602083018561145a565b6001600160a01b03929092166040919091015292915050565b8181038181111561029457610294611431565b808202811582820484141761029457610294611431565b6000826114fa57634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b03198316815260408101600b8310611520576115206113b7565b826020830152939250505056fed08d185790a07c7b9b721e2713c8580010a57f31c72c16f6e80b831d0ee45bfea2646970667358221220a88731885a136f6ffe2ef43beabc7b3a128ab2f3ee20d79c6777fe10326663bf64736f6c63430008170033", + "nonce": "0x2f128" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CREATE", + "contractName": "BridgeTracking", + "contractAddress": "0xB03E29Be08E57b2d95Fe9F94966CB86a0DD98481", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x2fb53a", + "value": "0x0", + "data": "0x608060405234801561001057600080fd5b5061001961001e565b6100eb565b600154600160a81b900460ff161561008c5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60015460ff600160a01b909104811610156100e9576001805460ff60a01b191660ff60a01b17905560405160ff81527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b611ad5806100fa6000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063c7c4fea91161008c578063de981f1b11610066578063de981f1b1461017e578063e2a75f36146101a9578063f67e8152146101bc578063f84bd121146101dc57600080fd5b8063c7c4fea914610145578063ca21287e14610158578063d25ed4c61461016b57600080fd5b80631794bb3c146100d4578063229f88ea146100e95780633b154455146100fc5780634ac0bcda146101045780635cd8a76b1461012a578063865e6fd314610132575b600080fd5b6100e76100e23660046114df565b6101e4565b005b6100e76100f736600461152f565b6102e4565b6100e761048c565b610117610112366004611559565b61055c565b6040519081526020015b60405180910390f35b6100e761057a565b6100e7610140366004611598565b610673565b6100e76101533660046115c4565b610692565b6100e7610166366004611604565b610a6b565b610117610179366004611660565b610b56565b61019161018c366004611679565b610b8b565b6040516001600160a01b039091168152602001610121565b6101176101b7366004611660565b610c01565b6101cf6101ca366004611694565b610c2b565b604051610121919061174f565b600254610117565b600154600160a81b900460ff161580801561020a575060018054600160a01b900460ff16105b8061022a5750303b15801561022a575060018054600160a01b900460ff16145b61024f5760405162461bcd60e51b815260040161024690611762565b60405180910390fd5b6001805460ff60a01b1916600160a01b179055801561027c576001805460ff60a81b1916600160a81b1790555b610287600285610c72565b610292600884610c72565b600282905580156102de576001805460ff60a81b191681556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b60026102ef81610d16565b6102f7610d62565b6000600a600085600281111561030f5761030f6117b0565b6002811115610320576103206117b0565b81526020019081526020016000206000848152602001908152602001600020905080600001546000036102de57610355610d70565b60006103616008610b8b565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa15801561039e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c291906117c6565b808355600480546001818101835560009290925260029081027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018054939450928892849260ff1990921691849081111561041f5761041f6117b0565b02179055506001808201869055830160005b81548110156104745761046c8888848481548110610451576104516117df565b6000918252602090912001546001600160a01b031687611012565b600101610431565b50610483600185016000611452565b50505050505050565b600461049781610d16565b600019600b54146104df5760405162461bcd60e51b815260206004820152601260248201527130b63932b0b23c9034b734ba103932b8101960711b6044820152606401610246565b6104e96008610b8b565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610526573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054a91906117c6565b600b5561055960046000610c72565b50565b6000610571838361056c86611192565b6112b8565b90505b92915050565b600154600290600160a81b900460ff161580156105a5575060015460ff808316600160a01b90920416105b6105c15760405162461bcd60e51b815260040161024690611762565b6001805460ff60a81b1960ff8416600160a01b021661ffff60a01b1990911617600160a81b179055600054610601906002906001600160a01b0316610c72565b600154610619906008906001600160a01b0316610c72565b600080546001600160a01b031916905560018054600161ff0160a01b031916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b61067b61130e565b61068481611368565b61068e8282610c72565b5050565b600261069d81610d16565b6106a5610d62565b60006106b16008610b8b565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106ee573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071291906117c6565b905061071c610d70565b6000600a6000876002811115610734576107346117b0565b6002811115610745576107456117b0565b81526020019081526020016000206000868152602001908152602001600020905080600001546000036107a7576001908101805491820181556000908152602090200180546001600160a01b0319166001600160a01b038516179055506102de565b6107b386868685611012565b600b548281101561048357600b8381556000906107cf90610b8b565b6001600160a01b0316639b19dbfd6040518163ffffffff1660e01b8152600401600060405180830381865afa15801561080c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108349190810190611816565b90506000610842838361139e565b9050600061084f84610c01565b9050600061085c85610b56565b9050600061086a600c610b8b565b9050600080826001600160a01b0316878786888c6040516024016108929594939291906118db565b60408051601f198184030181529181526020820180516001600160e01b0316634dca592560e01b179052516108c79190611975565b6000604051808303816000865af19150503d8060008114610904576040519150601f19603f3d011682016040523d82523d6000602084013e610909565b606091505b50915091508161096057604051634dca592560e01b906001600160a01b038516907feaa424ccc38ebcf22402729592dedf8315790e0128cb577cdeff1a3ee627f82790610957908590611991565b60405180910390a35b600061096c600d610b8b565b9050806001600160a01b03168b60405160240161098b91815260200190565b60408051601f198184030181529181526020820180516001600160e01b03166302ddfca960e61b179052516109c09190611975565b6000604051808303816000865af19150503d80600081146109fd576040519150601f19603f3d011682016040523d82523d6000602084013e610a02565b606091505b50909350915082610a5a576040516302ddfca960e61b906001600160a01b038316907feaa424ccc38ebcf22402729592dedf8315790e0128cb577cdeff1a3ee627f82790610a51908690611991565b60405180910390a35b505050505050505050505050505050565b600154600390600160a81b900460ff16158015610a96575060015460ff808316600160a01b90920416105b610ab25760405162461bcd60e51b815260040161024690611762565b6001805460ff60a81b1960ff8416600160a01b021661ffff60a01b1990911617600160a81b179055610ae5600b86610c72565b610af0600c85610c72565b610afb600d84610c72565b610b06600483610c72565b600019600b556001805460ff60a81b1916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050565b600081815260096020526040902060010154610b7182611192565b15610b8657600654610b8390826119c4565b90505b919050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115610bc257610bc26117b0565b60ff1681526020810191909152604001600020546001600160a01b0316905080610b86578160405163409140df60e11b815260040161024691906119f9565b600081815260096020526040902054610c1982611192565b15610b8657600454610b8390826119c4565b6060610c6a8484848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061139e92505050565b949350505050565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f811115610ca857610ca86117b0565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115610ce957610ce96117b0565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b610d1f81610b8b565b6001600160a01b0316336001600160a01b031614610559576000356001600160e01b03191681336040516320e0f98d60e21b815260040161024693929190611a07565b600254431015610d6e57005b565b6000610d7c6008610b8b565b60405163a3d545f560e01b81524360048201529091506000906001600160a01b0383169063a3d545f590602401602060405180830381865afa158015610dc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dea91906117c6565b905080600360000154101561068e576000826001600160a01b031663468c96ae6003600001546001610e1c91906119c4565b6040518263ffffffff1660e01b8152600401610e3a91815260200190565b6040805180830381865afa158015610e56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7a9190611a3e565b60038490556000818152600960205260408120600454815493955090935091839190610ea79084906119c4565b9091555050600654600182018054600090610ec39084906119c4565b90915550600090505b600854811015610f5357600880546000919083908110610eee57610eee6117df565b60009182526020808320909101546001600160a01b0316808352600782526040808420546002880190935283208054919450919290610f2e9084906119c4565b90915550506001600160a01b0316600090815260076020526040812055600101610ecc565b5060005b600454811015610fe557600060036001018281548110610f7957610f796117df565b6000918252602082206002918202018054909350600a91839160ff1690811115610fa557610fa56117b0565b6002811115610fb657610fb66117b0565b815260208082019290925260409081016000908120600195860154825290925290206003018590555001610f57565b50610ff260046000611470565b6000600581815560068290559061100a600882611452565b505050505050565b6000600a600086600281111561102a5761102a6117b0565b600281111561103b5761103b6117b0565b81526020808201929092526040908101600090812087825283528181206001600160a01b038716825260028101909352205490915060ff161561107e57506102de565b6001600160a01b03831660009081526002820160205260408120805460ff1916600117905560038201549081900361114b576001600160a01b038416600090815260076020526040812054900361111b57600880546001810182556000919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180546001600160a01b0319166001600160a01b0386161790555b6006805460019081019091556001600160a01b03851660009081526007602052604090208054909101905561100a565b82810361100a57600090815260096020908152604080832060018082018054820190556001600160a01b039790971684526002019091529020805490930190925550505050565b60008061119f6008610b8b565b60405163a3d545f560e01b81524360048201529091506000906001600160a01b0383169063a3d545f590602401602060405180830381865afa1580156111e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120d91906117c6565b9050600080836001600160a01b031663468c96ae600360000154600161123391906119c4565b6040518263ffffffff1660e01b815260040161125191815260200190565b6040805180830381865afa15801561126d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112919190611a3e565b915091508180156112a157508086145b80156112ae575060035483115b9695505050505050565b60008381526009602090815260408083206001600160a01b03861684526002019091529020548115611307576001600160a01b038316600090815260076020526040902054610c6a90826119c4565b9392505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610d6e576000356001600160e01b0319166001604051620f948f60ea1b8152600401610246929190611a71565b806001600160a01b03163b60000361055957604051630bfc64a360e21b81526001600160a01b0382166004820152602401610246565b80516060908067ffffffffffffffff8111156113bc576113bc6117f5565b6040519080825280602002602001820160405280156113e5578160200160208202803683370190505b50915060006113f385611192565b905060005b828110156114495761142486868381518110611416576114166117df565b6020026020010151846112b8565b848281518110611436576114366117df565b60209081029190910101526001016113f8565b50505092915050565b50805460008255906000526020600020908101906105599190611491565b508054600082556002029060005260206000209081019061055991906114aa565b5b808211156114a65760008155600101611492565b5090565b5b808211156114a657805460ff19168155600060018201556002016114ab565b6001600160a01b038116811461055957600080fd5b6000806000606084860312156114f457600080fd5b83356114ff816114ca565b9250602084013561150f816114ca565b929592945050506040919091013590565b803560038110610b8657600080fd5b6000806040838503121561154257600080fd5b61154b83611520565b946020939093013593505050565b6000806040838503121561156c57600080fd5b82359150602083013561157e816114ca565b809150509250929050565b803560108110610b8657600080fd5b600080604083850312156115ab57600080fd5b6115b483611589565b9150602083013561157e816114ca565b6000806000606084860312156115d957600080fd5b6115e284611520565b92506020840135915060408401356115f9816114ca565b809150509250925092565b6000806000806080858703121561161a57600080fd5b8435611625816114ca565b93506020850135611635816114ca565b92506040850135611645816114ca565b91506060850135611655816114ca565b939692955090935050565b60006020828403121561167257600080fd5b5035919050565b60006020828403121561168b57600080fd5b61057182611589565b6000806000604084860312156116a957600080fd5b83359250602084013567ffffffffffffffff808211156116c857600080fd5b818601915086601f8301126116dc57600080fd5b8135818111156116eb57600080fd5b8760208260051b850101111561170057600080fd5b6020830194508093505050509250925092565b60008151808452602080850194506020840160005b8381101561174457815187529582019590820190600101611728565b509495945050505050565b6020815260006105716020830184611713565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b6000602082840312156117d857600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8051610b86816114ca565b6000602080838503121561182957600080fd5b825167ffffffffffffffff8082111561184157600080fd5b818501915085601f83011261185557600080fd5b815181811115611867576118676117f5565b8060051b604051601f19603f8301168101818110858211171561188c5761188c6117f5565b6040529182528482019250838101850191888311156118aa57600080fd5b938501935b828510156118cf576118c08561180b565b845293850193928501926118af565b98975050505050505050565b60a0808252865190820181905260009060209060c0840190828a01845b8281101561191d5781516001600160a01b0316845292840192908401906001016118f8565b50505083810360208501526119328189611713565b6040850197909752505050606081019290925260809091015292915050565b60005b8381101561196c578181015183820152602001611954565b50506000910152565b60008251611987818460208701611951565b9190910192915050565b60208152600082518060208401526119b0816040850160208701611951565b601f01601f19169190910160400192915050565b8082018082111561057457634e487b7160e01b600052601160045260246000fd5b601081106119f5576119f56117b0565b9052565b6020810161057482846119e5565b6001600160e01b03198416815260608101611a2560208301856119e5565b6001600160a01b03929092166040919091015292915050565b60008060408385031215611a5157600080fd5b82518015158114611a6157600080fd5b6020939093015192949293505050565b6001600160e01b03198316815260408101600b8310611a9257611a926117b0565b826020830152939250505056fea2646970667358221220262d80d2feb74067f3cddee2705a4fff0aac4921a9a54ee2314b0f244bccac3e64736f6c63430008170033", + "nonce": "0x2f129" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CREATE", + "contractName": "PauseEnforcer", + "contractAddress": "0x3a3A92ba9d4D49aae06861136D547667c742F1aF", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x206788", + "value": "0x0", + "data": "0x608060405234801561001057600080fd5b5061001961001e565b6100de565b600254610100900460ff161561008a5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60025460ff90811610156100dc576002805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6111c4806100ed6000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c806391d14854116100a2578063caa6fea411610071578063caa6fea414610240578063d4b8399214610254578063d547741f1461026d578063dcf7bb5c14610280578063f82ec70b1461029357600080fd5b806391d148541461020a578063a217fddf1461021d578063b9f3163b14610225578063ca15c8731461022d57600080fd5b80636833f60d116100e95780636833f60d1461019c57806377a24f36146101a45780637a9ad019146101b75780637d4f7fc9146101cc5780639010d07c146101df57600080fd5b806301ffc9a71461011b578063248a9ca3146101435780632f2ff15d1461017457806336568abe14610189575b600080fd5b61012e610129366004610e11565b6102a6565b60405190151581526020015b60405180910390f35b610166610151366004610e3b565b60009081526020819052604090206001015490565b60405190815260200161013a565b610187610182366004610e79565b6102d1565b005b610187610197366004610e79565b6102fb565b61018761037e565b6101876101b2366004610ebf565b6104da565b61016660008051602061116f83398151915281565b6101876101da366004610fab565b610640565b6101f26101ed366004610fc8565b610663565b6040516001600160a01b03909116815260200161013a565b61012e610218366004610e79565b610682565b610166600081565b6101876106ab565b61016661023b366004610e3b565b610821565b60025461012e90600160b01b900460ff1681565b6002546101f2906201000090046001600160a01b031681565b61018761027b366004610e79565b610838565b61018761028e366004610fab565b61085d565b6101876102a1366004610fab565b610871565b60006001600160e01b03198216635a05180f60e01b14806102cb57506102cb82610894565b92915050565b6000828152602081905260409020600101546102ec816108c9565b6102f683836108d6565b505050565b6001600160a01b03811633146103705760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61037a82826108f8565b5050565b60008051602061116f833981519152610396816108c9565b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af11580156103e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040d9190610fea565b1561042b576040516310067f7560e11b815260040160405180910390fd5b60028054600160b01b60ff60b01b19909116179081905560408051638456cb5960e01b81529051620100009092046001600160a01b031691638456cb599160048082019260009290919082900301818387803b15801561048a57600080fd5b505af115801561049e573d6000803e3d6000fd5b50506040513381527fb8fad2fa0ed7a383e747c309ef2c4391d7b65592a48893e57ccc1fab70791456925060200190505b60405180910390a150565b600254610100900460ff16158080156104fa5750600254600160ff909116105b806105145750303b158015610514575060025460ff166001145b6105775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610367565b6002805460ff19166001179055801561059a576002805461ff0019166101001790555b6105a38461091a565b6105ae600084610972565b60005b82518110156105f3576105eb60008051602061116f8339815191528483815181106105de576105de61100c565b60200260200101516108d6565b6001016105b1565b50801561063a576002805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b600061064b816108c9565b61037a60008051602061116f833981519152836108d6565b600082815260016020526040812061067b908361097c565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008051602061116f8339815191526106c3816108c9565b600254600160b01b900460ff166106ed57604051631b2fd53f60e31b815260040160405180910390fd5b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610740573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107649190610fea565b61078157604051631e87b57b60e31b815260040160405180910390fd5b6002805460ff60b01b19169081905560408051631fa5d41d60e11b81529051620100009092046001600160a01b031691633f4ba83a9160048082019260009290919082900301818387803b1580156107d857600080fd5b505af11580156107ec573d6000803e3d6000fd5b50506040513381527ff5cbf596165cc457b2cd92e8d8450827ee314968160a5696402d75766fc52caf925060200190506104cf565b60008181526001602052604081206102cb90610988565b600082815260208190526040902060010154610853816108c9565b6102f683836108f8565b6000610868816108c9565b61037a8261091a565b600061087c816108c9565b61037a60008051602061116f833981519152836108f8565b60006001600160e01b03198216637965db0b60e01b14806102cb57506301ffc9a760e01b6001600160e01b03198316146102cb565b6108d38133610992565b50565b6108e082826109f6565b60008281526001602052604090206102f69082610a7a565b6109028282610a8f565b60008281526001602052604090206102f69082610af4565b6002805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040519081527f7f8cffd58ac96898bdd25ab64868bd933141d15ad1cd4a0df228fd3fcba2a26d906020016104cf565b61037a82826108d6565b600061067b8383610b09565b60006102cb825490565b61099c8282610682565b61037a576109b4816001600160a01b03166014610b33565b6109bf836020610b33565b6040516020016109d0929190611046565b60408051601f198184030181529082905262461bcd60e51b8252610367916004016110bb565b610a008282610682565b61037a576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610a363390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061067b836001600160a01b038416610ccf565b610a998282610682565b1561037a576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061067b836001600160a01b038416610d1e565b6000826000018281548110610b2057610b2061100c565b9060005260206000200154905092915050565b60606000610b42836002611104565b610b4d90600261111b565b67ffffffffffffffff811115610b6557610b65610ea9565b6040519080825280601f01601f191660200182016040528015610b8f576020820181803683370190505b509050600360fc1b81600081518110610baa57610baa61100c565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610bd957610bd961100c565b60200101906001600160f81b031916908160001a9053506000610bfd846002611104565b610c0890600161111b565b90505b6001811115610c80576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610c3c57610c3c61100c565b1a60f81b828281518110610c5257610c5261100c565b60200101906001600160f81b031916908160001a90535060049490941c93610c798161112e565b9050610c0b565b50831561067b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610367565b6000818152600183016020526040812054610d16575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556102cb565b5060006102cb565b60008181526001830160205260408120548015610e07576000610d42600183611145565b8554909150600090610d5690600190611145565b9050818114610dbb576000866000018281548110610d7657610d7661100c565b9060005260206000200154905080876000018481548110610d9957610d9961100c565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610dcc57610dcc611158565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506102cb565b60009150506102cb565b600060208284031215610e2357600080fd5b81356001600160e01b03198116811461067b57600080fd5b600060208284031215610e4d57600080fd5b5035919050565b6001600160a01b03811681146108d357600080fd5b8035610e7481610e54565b919050565b60008060408385031215610e8c57600080fd5b823591506020830135610e9e81610e54565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600060608486031215610ed457600080fd5b8335610edf81610e54565b9250602084810135610ef081610e54565b9250604085013567ffffffffffffffff80821115610f0d57600080fd5b818701915087601f830112610f2157600080fd5b813581811115610f3357610f33610ea9565b8060051b604051601f19603f83011681018181108582111715610f5857610f58610ea9565b60405291825284820192508381018501918a831115610f7657600080fd5b938501935b82851015610f9b57610f8c85610e69565b84529385019392850192610f7b565b8096505050505050509250925092565b600060208284031215610fbd57600080fd5b813561067b81610e54565b60008060408385031215610fdb57600080fd5b50508035926020909101359150565b600060208284031215610ffc57600080fd5b8151801515811461067b57600080fd5b634e487b7160e01b600052603260045260246000fd5b60005b8381101561103d578181015183820152602001611025565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161107e816017850160208801611022565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516110af816028840160208801611022565b01602801949350505050565b60208152600082518060208401526110da816040850160208701611022565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176102cb576102cb6110ee565b808201808211156102cb576102cb6110ee565b60008161113d5761113d6110ee565b506000190190565b818103818111156102cb576102cb6110ee565b634e487b7160e01b600052603160045260246000fdfe5bea60102f2a7acc9e82b1af0e3bd4069661102bb5dd143a6051cd1980dded1ca26469706673582212205cd579cff7903082498e437ed3eb21f8623bfa7f518ca2799b5e3497b22a08a864736f6c63430008170033", + "nonce": "0x2f12a" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CREATE", + "contractName": "RoninGatewayV3", + "contractAddress": "0x4222384E84C248aa8D50FDC702a1b55E6b4efc99", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x8aad78", + "value": "0x0", + "data": "0x60806040523480156200001157600080fd5b506000805460ff19169055620000266200002c565b620000ee565b603754610100900460ff1615620000995760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60375460ff9081161015620000ec576037805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6150b880620000fe6000396000f3fe6080604052600436106102975760003560e01c80638456cb591161015a578063ca15c873116100c1578063ecc836491161007a578063ecc836491461089f578063f0ce418e146108cc578063f23a6e6114610912578063f668214a1461093e578063fa3896591461095e578063fc6574bc1461097e576102a6565b8063ca15c873146107e7578063d547741f14610807578063dafae40814610827578063dbd2ef6c14610847578063de981f1b14610867578063e75235b814610887576102a6565b8063affed0e011610113578063affed0e0146106e5578063b9afa177146106fb578063b9c362091461071b578063bc197c811461073b578063bc7f038614610774578063c28f7894146107a1576102a6565b80638456cb591461063b578063865e6fd3146106505780639010d07c1461067057806391d14854146106905780639584a592146106b0578063a217fddf146106d0576102a6565b80633f4ba83a116101fe5780635d6a9a90116101b75780635d6a9a901461057257806364363f781461059f57806371706cbe146105bf57806375535f86146105d55780637de5dedd146105f5578063835fc6ca1461060a576102a6565b80633f4ba83a1461048f57806347b56b2c146104a45780634d92c4f0146104c45780635a7dd06a146105255780635c975abb146105455780635cd8a76b1461055d576102a6565b8063248a9ca311610250578063248a9ca3146103b15780632f2ff15d146103ef5780633101cfcb1461040f57806336568abe1461042f5780633e4574ec1461044f5780633e70838b1461046f576102a6565b806301ffc9a7146102ae578063065b3adf146102e35780630b1ff17f1461031b578063109679ef1461033b57806317892f961461035b57806317fa2ea114610384576102a6565b366102a6576102a46109d0565b005b6102a46109d0565b3480156102ba57600080fd5b506102ce6102c9366004613c2d565b6109e9565b60405190151581526020015b60405180910390f35b3480156102ef57600080fd5b50600554610303906001600160a01b031681565b6040516001600160a01b0390911681526020016102da565b34801561032757600080fd5b506102a4610336366004613c57565b610a09565b34801561034757600080fd5b506102a4610356366004613c88565b610a20565b34801561036757600080fd5b506078546079545b604080519283526020830191909152016102da565b34801561039057600080fd5b506103a461039f366004613ce5565b610a53565b6040516102da9190613d26565b3480156103bd57600080fd5b506103e16103cc366004613d60565b6000908152606b602052604090206001015490565b6040519081526020016102da565b3480156103fb57600080fd5b506102a461040a366004613d99565b610d90565b34801561041b57600080fd5b506102a461042a366004613dc9565b610dba565b34801561043b57600080fd5b506102a461044a366004613d99565b610e66565b34801561045b57600080fd5b506102ce61046a366004613d99565b610ee0565b34801561047b57600080fd5b506102a461048a366004613dc9565b610f10565b34801561049b57600080fd5b506102a4610f3a565b3480156104b057600080fd5b506102a46104bf366004613d60565b610f4c565b3480156104d057600080fd5b506105156104df366004613de6565b606f602090815260009283526040808420909152908252902080546001820154600383015460049093015460ff90921692909184565b6040516102da9493929190613e1e565b34801561053157600080fd5b506102a4610540366004613e4e565b611117565b34801561055157600080fd5b5060005460ff166102ce565b34801561056957600080fd5b506102a461117e565b34801561057e57600080fd5b5061059261058d366004613ec8565b611280565b6040516102da9190613f04565b3480156105ab57600080fd5b506102a46105ba366004613f30565b611324565b3480156105cb57600080fd5b506103e1606e5481565b3480156105e157600080fd5b5061036f6105f0366004613de6565b611360565b34801561060157600080fd5b506103e1611381565b34801561061657600080fd5b5061062a610625366004613d60565b611398565b6040516102da959493929190613ff8565b34801561064757600080fd5b506102a461146a565b34801561065c57600080fd5b506102a461066b36600461404e565b61147a565b34801561067c57600080fd5b5061030361068b366004613de6565b611495565b34801561069c57600080fd5b506102ce6106ab366004613d99565b6114ad565b3480156106bc57600080fd5b506102a46106cb36600461408b565b6114d8565b3480156106dc57600080fd5b506103e1600081565b3480156106f157600080fd5b506103e160045481565b34801561070757600080fd5b506103a4610716366004614184565b611625565b34801561072757600080fd5b506102a4610736366004613de6565b611743565b34801561074757600080fd5b50610767610756366004614368565b63bc197c8160e01b95945050505050565b6040516102da9190614415565b34801561078057600080fd5b506103e161078f366004613dc9565b60386020526000908152604090205481565b3480156107ad57600080fd5b506105156107bc366004613d60565b607660205260009081526040902080546001820154600383015460049093015460ff90921692909184565b3480156107f357600080fd5b506103e1610802366004613d60565b611755565b34801561081357600080fd5b506102a4610822366004613d99565b61176c565b34801561083357600080fd5b506102ce610842366004613d60565b611791565b34801561085357600080fd5b506102a461086236600461442a565b6117bd565b34801561087357600080fd5b506103036108823660046144ed565b61180f565b34801561089357600080fd5b5060015460025461036f565b3480156108ab57600080fd5b506108bf6108ba366004614508565b61188a565b6040516102da91906145a3565b3480156108d857600080fd5b506105156108e7366004613d60565b607060205260009081526040902080546001820154600383015460049093015460ff90921692909184565b34801561091e57600080fd5b5061076761092d366004614607565b63f23a6e6160e01b95945050505050565b34801561094a57600080fd5b506102ce610959366004613d60565b6119f1565b34801561096a57600080fd5b506102a4610979366004613f30565b611a1f565b34801561098a57600080fd5b506102ce61099936600461466f565b6000928352606f602090815260408085209385529281528284206001600160a01b0392909216845260029091019052902054151590565b60405163129c2ce160e31b815260040160405180910390fd5b60006109f482611c1a565b80610a035750610a0382611c3f565b92915050565b610a11611c64565b610a1c823383611caa565b5050565b610a28611c64565b610a30611d79565b610a50610a4236839003830183614746565b33610a4b611381565b611e1a565b50565b6060610a5d611d79565b336000610a68611381565b9050600084806001600160401b03811115610a8557610a856141f9565b604051908082528060200260200182016040528015610aae578160200160208202803683370190505b5094506000610abd600361180f565b905060005b82811015610d8457888882818110610adc57610adc6147d7565b905060200201359350816001600160a01b031663c7c4fea9600286896040518463ffffffff1660e01b8152600401610b16939291906147ed565b600060405180830381600087803b158015610b3057600080fd5b505af1158015610b44573d6000803e3d6000fd5b50505050610b51846119f1565b15610b7b576001878281518110610b6a57610b6a6147d7565b911515602092830291909101909101525b600084815260706020908152604080832060718352818420825160a081019093528054835260018082015492959491929184019160ff1690811115610bc257610bc2613e08565b6001811115610bd357610bd3613e08565b815260408051606080820183526002858101546001600160a01b039081168452600387015481166020858101919091526004880154858701528087019490945284518084018652600588015482168152600688015490911693810193909352600786015483850152838501929092528251808201909352600885018054919094019391839160ff1690811115610c6b57610c6b613e08565b6002811115610c7c57610c7c613e08565b81526001820154602082015260029091015460409091015290525090506000610ca482612121565b90506000610cb4848b8b856121eb565b90506001816004811115610cca57610cca613e08565b03610d7557835460ff19166002908117855560405163114fc47560e11b81526001600160a01b0388169163229f88ea91610d0991908c90600401614817565b600060405180830381600087803b158015610d2357600080fd5b505af1158015610d37573d6000803e3d6000fd5b505050507f62520d049932cdee872e9b3c59c0f6073637147e5e9bc8b050b062430eaf5c9f8284604051610d6c92919061482e565b60405180910390a15b50505050806001019050610ac2565b50505050505092915050565b6000828152606b6020526040902060010154610dab8161221e565b610db58383612228565b505050565b603754600390610100900460ff16158015610ddc575060375460ff8083169116105b610e015760405162461bcd60e51b8152600401610df89061488d565b60405180910390fd5b6037805461ffff191660ff831617610100179055610e20600b8361224a565b6037805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b6001600160a01b0381163314610ed65760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610df8565b610a1c82826122ee565b60008281526070602090815260408083206001600160a01b038516845260020190915281205415155b9392505050565b610f18612310565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b610f4261236a565b610f4a6123d9565b565b610f54611c64565b610f5d816119f1565b15610f7b576040516327ddf84960e11b815260040160405180910390fd5b6000818152607160209081526040808320815160a0810190925280548252600180820154929391929184019160ff1690811115610fba57610fba613e08565b6001811115610fcb57610fcb613e08565b815260408051606080820183526002858101546001600160a01b039081168452600387015481166020858101919091526004880154858701528087019490945284518084018652600588015482168152600688015490911693810193909352600786015483850152838501929092528251808201909352600885018054919094019391839160ff169081111561106357611063613e08565b600281111561107457611074613e08565b8152600182015460208201526002909101546040918201529152606083015101519192505046146110de576060810151604090810151905163092048d160e11b81526001600160e01b03196000351660048201526024810191909152466044820152606401610df8565b7f04e8cbd836dea43a2dc7eb19de345cca3a8e6978a2ef5225d924775500f67c7c61110882612121565b82604051610e5a92919061482e565b61111f611c64565b816000819003611142576040516316ee9d3b60e11b815260040160405180910390fd5b60005b818110156111775761116f858583818110611162576111626147d7565b905060a002013385611caa565b600101611145565b5050505050565b603754600290610100900460ff161580156111a0575060375460ff8083169116105b6111bc5760405162461bcd60e51b8152600401610df89061488d565b6037805461ffff191660ff8316176101001790556074546111e8906008906001600160a01b031661224a565b607554611200906003906001600160a01b031661224a565b60775461121890600a906001600160a01b031661224a565b607480546001600160a01b031990811690915560758054821690556077805490911690556037805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b604080518082018252600080825260208083018290526001600160a01b038616825260738152838220858352905282902082518084019093528054919291829060ff1660028111156112d4576112d4613e08565b60028111156112e5576112e5613e08565b815290546001600160a01b0361010090910481166020928301529082015191925016610a0357604051631b79f53b60e21b815260040160405180910390fd5b61132c612310565b600083900361134e576040516316ee9d3b60e11b815260040160405180910390fd5b61135a8484848461242b565b50505050565b60008061136b612310565b611375848461250e565b915091505b9250929050565b600061139361138e612598565b612605565b905090565b607160209081526000918252604091829020805460018201548451606080820187526002808601546001600160a01b03908116845260038701548116848901526004870154848a015288518084018a526005880154821681526006880154909116978101979097526007860154878901528751918201909752600885018054949760ff94851697939693959394929391928492169081111561143c5761143c613e08565b600281111561144d5761144d613e08565b815260200160018201548152602001600282015481525050905085565b61147261236a565b610f4a61263b565b611482612310565b61148b81612678565b610a1c828261224a565b6000828152606c60205260408120610f0990836126ae565b6000918252606b602090815260408084206001600160a01b0393909316845291905290205460ff1690565b603754610100900460ff16158080156114f85750603754600160ff909116105b806115125750303b158015611512575060375460ff166001145b61152e5760405162461bcd60e51b8152600401610df89061488d565b6037805460ff191660011790558015611551576037805461ff0019166101001790555b61155c60008d6126ba565b6115668b8b6126c4565b611570898961250e565b506000905061157f86806148db565b905011156115d1576115b261159486806148db565b6115a160208901896148db565b6115ab89806148db565b8989612754565b6115d16115bf86806148db565b6115cc60208801886148db565b61242b565b8015611617576037805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050505050565b606061162f611c64565b611637611d79565b81806001600160401b03811115611650576116506141f9565b604051908082528060200260200182016040528015611679578160200160208202803683370190505b5091506000611686611381565b9050611690613bc0565b60005b83811015611739578686828181106116ad576116ad6147d7565b905061016002018036038101906116c49190614746565b915060026040808401518101516000908152606f6020908152828220865183529052205460ff1660048111156116fc576116fc613e08565b03611726576001858281518110611715576117156147d7565b911515602092830291909101909101525b611731823385611e1a565b600101611693565b5050505092915050565b61174b612310565b610a1c82826126c4565b6000818152606c60205260408120610a0390612970565b6000828152606b60205260409020600101546117878161221e565b610db583836122ee565b600061179b612598565b6001546117a8919061493a565b6002546117b5908461493a565b101592915050565b6117c5612310565b60008790036117f5576000356001600160e01b0319166040516306b5667560e21b8152600401610df89190614415565b6118058888888888888888612754565b5050505050505050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f81111561184657611846613e08565b60ff1681526020810191909152604001600020546001600160a01b0316905080611885578160405163409140df60e11b8152600401610df89190614951565b919050565b6060816001600160401b038111156118a4576118a46141f9565b6040519080825280602002602001820160405280156118d757816020015b60608152602001906001900390816118c25790505b50905060005b828110156119e957600085815260726020526040812090858584818110611906576119066147d7565b905060200201602081019061191b9190613dc9565b6001600160a01b03166001600160a01b0316815260200190815260200160002080546119469061496b565b80601f01602080910402602001604051908101604052809291908181526020018280546119729061496b565b80156119bf5780601f10611994576101008083540402835291602001916119bf565b820191906000526020600020905b8154815290600101906020018083116119a257829003601f168201915b50505050508282815181106119d6576119d66147d7565b60209081029190910101526001016118dd565b509392505050565b6000600260008381526070602052604090205460ff166004811115611a1857611a18613e08565b1492915050565b611a27611c64565b611a2f611d79565b33838015801590611a3f57508083145b611a6a576000356001600160e01b0319166040516306b5667560e21b8152600401610df89190614415565b6000611a74611381565b9050600080611a83600361180f565b905060005b84811015611c0e57898982818110611aa257611aa26147d7565b905060200201359250878782818110611abd57611abd6147d7565b9050602002810190611acf919061499f565b60008581526072602090815260408083206001600160a01b038c168452909152902091611afd919083614a35565b5060405163c7c4fea960e01b81526001600160a01b0383169063c7c4fea990611b2f9060019087908b906004016147ed565b600060405180830381600087803b158015611b4957600080fd5b505af1158015611b5d573d6000803e3d6000fd5b50505060008481526076602052604081209150611b7c828988886121eb565b90506001816004811115611b9257611b92613e08565b03611c0457815460ff1916600217825560405163114fc47560e11b81526001600160a01b0385169063229f88ea90611bd1906001908990600401614817565b600060405180830381600087803b158015611beb57600080fd5b505af1158015611bff573d6000803e3d6000fd5b505050505b5050600101611a88565b50505050505050505050565b60006001600160e01b03198216635a05180f60e01b1480610a035750610a038261297a565b60006001600160e01b03198216630271189760e51b1480610a035750610a0382611c1a565b60005460ff1615610f4a5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610df8565b611cc4611cbf36859003850160408601614af4565b6129af565b611ccd836129f3565b6000611ce8611ce26040860160208701613dc9565b83611280565b80519091506002811115611cfe57611cfe613e08565b611d0e6060860160408701614b10565b6002811115611d1f57611d1f613e08565b14611d3c5760405162035e2b60ea1b815260040160405180910390fd5b611d6983611d506040870160208801613dc9565b611d6236889003880160408901614af4565b9190612a71565b6111778483858460200151612bfc565b611d83600b61180f565b604051635a02d57960e11b81523360048201526001600160a01b03919091169063b405aaf290602401602060405180830381865afa158015611dc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ded9190614b2b565b610f4a576000356001600160e01b0319166006604051620f948f60ea1b8152600401610df8929190614b4d565b82516080840151611e2a906129af565b600084602001516001811115611e4257611e42613e08565b14611e605760405163182f3d8760e11b815260040160405180910390fd5b4684606001516040015114611eae576060840151604090810151905163092048d160e11b81526001600160e01b03196000351660048201526024810191909152466044820152606401610df8565b6000611eca856060015160200151866040015160400151611280565b6080860151519091506002811115611ee457611ee4613e08565b81516002811115611ef757611ef7613e08565b148015611f2157508460400151602001516001600160a01b031681602001516001600160a01b0316145b611f3e5760405163f4b8742f60e01b815260040160405180910390fd5b6040808601518101516000908152606f6020908152828220858352905290812090611f6887612121565b90506000611f78838888856121eb565b905087604001516040015185886001600160a01b03167f48c4262ed68beb92fe5d7d48d70772e49cd50c317937dea60a99f15f794b645985604051611fbf91815260200190565b60405180910390a46000611fd3600361180f565b90506001826004811115611fe957611fe9613e08565b036120b357835460ff191660021784556060890151805160209091015160808b01516120189290916000612d8e565b885160405163114fc47560e11b81526001600160a01b0383169163229f88ea9161204791600091600401614817565b600060405180830381600087803b15801561206157600080fd5b505af1158015612075573d6000803e3d6000fd5b505050507f8d20d8121a34dded9035ff5b43e901c142824f7a22126392992c353c37890524838a6040516120aa92919061482e565b60405180910390a15b885160405163c7c4fea960e01b81526001600160a01b0383169163c7c4fea9916120e4916000918d906004016147ed565b600060405180830381600087803b1580156120fe57600080fd5b505af1158015612112573d6000803e3d6000fd5b50505050505050505050505050565b6000806121318360400151612fa7565b905060006121428460600151612fa7565b905060006121968560800151604080517f1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d815282516020808301919091528301518183015291015160608201526080902090565b604080517fb9d1fe7c9deeec5dc90a2f47ff1684239519f2545b2228d3d91fb27df3189eea815287516020808301919091529097015190870152606086019390935250608084015260a08301525060c0902090565b60006121f8858584612fef565b600061220486846130a5565b9050612212868583866131a9565b9150505b949350505050565b610a5081336131f5565b6122328282613259565b6000828152606c60205260409020610db590826132df565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f81111561228057612280613e08565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f8111156122c1576122c1613e08565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b6122f882826132f4565b6000828152606c60205260409020610db5908261335b565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610f4a576000356001600160e01b0319166001604051620f948f60ea1b8152600401610df8929190614b4d565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314806123ac57506005546001600160a01b031633145b610f4a576000356001600160e01b0319166001604051620f948f60ea1b8152600401610df8929190614b4d565b6123e1613370565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b828114612459576000356001600160e01b0319166040516306b5667560e21b8152600401610df89190614415565b60005b838110156124ca57828282818110612476576124766147d7565b9050602002013560386000878785818110612493576124936147d7565b90506020020160208101906124a89190613dc9565b6001600160a01b0316815260208101919091526040016000205560010161245c565b507f6f52f53a938df83439fa4c6055c7df0a6906d621aa6dfa4708187037fdfc41da848484846040516125009493929190614bf6565b60405180910390a150505050565b600080828411156125325760405163964a4d2760e01b815260040160405180910390fd5b505060018054600254607885905560798490556004805493840190556040805183815260208101839052929391928592879290917feac82d4d949d2d4f77f96aa68ab6b1bb750da73f14e55d41a1b93f387471ecba910160405180910390a49250929050565b60006125a4600b61180f565b6001600160a01b03166306aba0e16040518163ffffffff1660e01b8152600401602060405180830381865afa1580156125e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113939190614c28565b600060025460016002548460015461261d919061493a565b6126279190614c41565b6126319190614c54565b610a039190614c67565b612643611c64565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861240e3390565b806001600160a01b03163b600003610a5057604051630bfc64a360e21b81526001600160a01b0382166004820152602401610df8565b6000610f0983836133b9565b610a1c8282612228565b808211156126f3576000356001600160e01b0319166040516387f6f09560e01b8152600401610df89190614415565b6001805460028054858455908490556004805493840190556040805183815260208101839052929391928592879290917f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a450505050565b868514801561276257508683145b61278d576000356001600160e01b0319166040516306b5667560e21b8152600401610df89190614415565b60005b87811015612920578686828181106127aa576127aa6147d7565b90506020020160208101906127bf9190613dc9565b607360008b8b858181106127d5576127d56147d7565b90506020020160208101906127ea9190613dc9565b6001600160a01b03166001600160a01b03168152602001908152602001600020600087878581811061281e5761281e6147d7565b90506020020135815260200190815260200160002060000160016101000a8154816001600160a01b0302191690836001600160a01b0316021790555082828281811061286c5761286c6147d7565b90506020020160208101906128819190614b10565b607360008b8b85818110612897576128976147d7565b90506020020160208101906128ac9190613dc9565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008787858181106128e0576128e06147d7565b60209081029290920135835250810191909152604001600020805460ff1916600183600281111561291357612913613e08565b0217905550600101612790565b507f2544bff60c6d5b84946e06804af9f84e150bbee85238dbdee79efca4e0adf401888888888888888860405161295e989796959493929190614c89565b60405180910390a15050505050505050565b6000610a03825490565b60006001600160e01b03198216637965db0b60e01b1480610a0357506301ffc9a760e01b6001600160e01b0319831614610a03565b6129b8816133e3565b806129c757506129c78161341a565b806129d657506129d681613442565b610a505760405163034992a760e51b815260040160405180910390fd5b6000612a056060830160408401614b10565b6002811115612a1657612a16613e08565b148015612a53575060386000612a326040840160208501613dc9565b6001600160a01b031681526020810191909152604001600020546080820135105b15610a5057604051636eff4a8560e11b815260040160405180910390fd5b600060608185516002811115612a8957612a89613e08565b03612b645760408581015181516001600160a01b03878116602483015230604483015260648083019390935283518083039093018352608490910183526020820180516001600160e01b03166323b872dd60e01b179052915191851691612af09190614d18565b6000604051808303816000865af19150503d8060008114612b2d576040519150601f19603f3d011682016040523d82523d6000602084013e612b32565b606091505b509092509050818015612b5d575080511580612b5d575080806020019051810190612b5d9190614b2b565b9150612bd6565b600185516002811115612b7957612b79613e08565b03612b8e57612b5d838530886020015161346b565b600285516002811115612ba357612ba3613e08565b03612bbd57612b5d83853088602001518960400151613519565b6040516361e411a760e11b815260040160405180910390fd5b816111775784843085604051639d2e4c6760e01b8152600401610df89493929190614d34565b606e805460009182612c0d83614d6a565b9091555090506000612c3484838588612c2b368c90038c018c614d83565b939291906135cd565b60008381526071602090815260409091208251815590820151600180830180549495508594909160ff19909116908381811115612c7357612c73613e08565b02179055506040828101518051600280850180546001600160a01b039384166001600160a01b03199182161790915560208085015160038801805491861691841691909117905593850151600487015560608701518051600588018054918616918416919091179055938401516006870180549190941691161790915591015160078301556080830151805160088401805492939092839160ff19909116906001908490811115612d2657612d26613e08565b0217905550602082015181600101556040820151816002015550509050507ff313c253a5be72c29d0deb2c8768a9543744ac03d6b3cafd50cc976f1c2632fc612d6e82612121565b82604051612d7d92919061482e565b60405180910390a150949350505050565b806001600160a01b0316826001600160a01b031603612e3b5760408085015190516001600160a01b0385169180156108fc02916000818181858888f19350505050612e3657806001600160a01b031663d0e30db085604001516040518263ffffffff1660e01b81526004016000604051808303818588803b158015612e1257600080fd5b505af1158015612e26573d6000803e3d6000fd5b5050505050612e36848484613639565b61135a565b600084516002811115612e5057612e50613e08565b03612f16576040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa158015612e9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ec09190614c28565b90508460400151811015612f0557612ee88330838860400151612ee39190614c54565b6136b8565b612f0557604051632f739fff60e11b815260040160405180910390fd5b612f10858585613639565b5061135a565b600184516002811115612f2b57612f2b613e08565b03612f5c57612f3f8284866020015161375d565b612e365760405163c8e3a09f60e01b815260040160405180910390fd5b600284516002811115612f7157612f71613e08565b03612bbd57612f8a828486602001518760400151613784565b612e36576040516334b471a760e21b815260040160405180910390fd5b604080517f353bdd8d69b9e3185b3972e08b03845c0c14a21a390215302776a7a34b0e8764815282516020808301919091528301518183015291015160608201526080902090565b60008360030154118015613007575042836003015411155b1561301857825460ff191660041783555b6001600160a01b03821660009081526002840160205260409020541561305c5760405163025fd59560e41b81526001600160a01b0383166004820152602401610df8565b6001600160a01b039091166000818152600284016020908152604082209390935560059093018054600181018255908452919092200180546001600160a01b0319169091179055565b60008060006130b4600b61180f565b6001600160a01b031663c441c4a86040518163ffffffff1660e01b8152600401600060405180830381865afa1580156130f1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526131199190810190614e3e565b81519194509250905060005b818110156117395785876002016000868481518110613146576131466147d7565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002054036131a157828181518110613186576131866147d7565b60200260200101516bffffffffffffffffffffffff16850194505b600101613125565b60008383101580156131d057506000855460ff1660048111156131ce576131ce613e08565b145b156131e857845460ff19166001908117865585018290555b5050915460ff1692915050565b6131ff82826114ad565b610a1c57613217816001600160a01b031660146137ad565b6132228360206137ad565b604051602001613233929190614f36565b60408051601f198184030181529082905262461bcd60e51b8252610df891600401614fab565b61326382826114ad565b610a1c576000828152606b602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561329b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610f09836001600160a01b038416613948565b6132fe82826114ad565b15610a1c576000828152606b602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610f09836001600160a01b038416613997565b60005460ff16610f4a5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610df8565b60008260000182815481106133d0576133d06147d7565b9060005260206000200154905092915050565b600080825160028111156133f9576133f9613e08565b14801561340a575060008260400151115b8015610a03575050602001511590565b600060018251600281111561343157613431613e08565b148015610a03575050604001511590565b600060028251600281111561345957613459613e08565b148015610a0357505060400151151590565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928716916134cb91614d18565b6000604051808303816000865af19150503d8060008114613508576040519150601f19603f3d011682016040523d82523d6000602084013e61350d565b606091505b50909695505050505050565b604080516000808252602082019092526001600160a01b0387169061354990879087908790879060448101614fbe565b60408051601f198184030181529181526020820180516001600160e01b0316637921219560e11b1790525161357e9190614d18565b6000604051808303816000865af19150503d80600081146135bb576040519150601f19603f3d011682016040523d82523d6000602084013e6135c0565b606091505b5090979650505050505050565b6135d5613bc0565b92835260016020808501919091526060840180516001600160a01b0396871690528682015181519087169083015251466040918201528651818601805191881690915280519490961693909101929092529251810192909252910151608082015290565b6000808451600281111561364f5761364f613e08565b0361366a5761366382848660400151613a8a565b9050613694565b60018451600281111561367f5761367f613e08565b03612bbd57613663823085876020015161346b565b8061135a578383836040516341bd7d9160e11b8152600401610df893929190614ff8565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b03166340c10f1960e01b179052915160009286169161371091614d18565b6000604051808303816000865af19150503d806000811461374d576040519150601f19603f3d011682016040523d82523d6000602084013e613752565b606091505b509095945050505050565b600061376b8430858561346b565b905080610f095761377d8484846136b8565b9050610f09565b60006137938530868686613519565b905080612216576137a685858585613b5d565b9050612216565b606060006137bc83600261493a565b6137c7906002614c41565b6001600160401b038111156137de576137de6141f9565b6040519080825280601f01601f191660200182016040528015613808576020820181803683370190505b509050600360fc1b81600081518110613823576138236147d7565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613852576138526147d7565b60200101906001600160f81b031916908160001a905350600061387684600261493a565b613881906001614c41565b90505b60018111156138f9576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106138b5576138b56147d7565b1a60f81b8282815181106138cb576138cb6147d7565b60200101906001600160f81b031916908160001a90535060049490941c936138f281615028565b9050613884565b508315610f095760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610df8565b600081815260018301602052604081205461398f57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610a03565b506000610a03565b60008181526001830160205260408120548015613a805760006139bb600183614c54565b85549091506000906139cf90600190614c54565b9050818114613a345760008660000182815481106139ef576139ef6147d7565b9060005260206000200154905080876000018481548110613a1257613a126147d7565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613a4557613a4561503f565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610a03565b6000915050610a03565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b179052915160009260609290871691613ae79190614d18565b6000604051808303816000865af19150503d8060008114613b24576040519150601f19603f3d011682016040523d82523d6000602084013e613b29565b606091505b509092509050818015613b54575080511580613b54575080806020019051810190613b549190614b2b565b95945050505050565b604080516000808252602082019092526001600160a01b03861690613b8b9086908690869060448101615055565b60408051601f198184030181529181526020820180516001600160e01b031663731133e960e01b179052516134cb9190614d18565b6040805160a08101825260008082526020808301829052835160608082018652838252818301849052818601849052848601919091528451808201865283815280830184905280860184905281850152845190810185528281529081018290529283015290608082015290565b600060208284031215613c3f57600080fd5b81356001600160e01b031981168114610f0957600080fd5b60008082840360c0811215613c6b57600080fd5b60a0811215613c7957600080fd5b50919360a08501359350915050565b60006101608284031215613c9b57600080fd5b50919050565b60008083601f840112613cb357600080fd5b5081356001600160401b03811115613cca57600080fd5b6020830191508360208260051b850101111561137a57600080fd5b60008060208385031215613cf857600080fd5b82356001600160401b03811115613d0e57600080fd5b613d1a85828601613ca1565b90969095509350505050565b6020808252825182820181905260009190848201906040850190845b8181101561350d578351151583529284019291840191600101613d42565b600060208284031215613d7257600080fd5b5035919050565b6001600160a01b0381168114610a5057600080fd5b803561188581613d79565b60008060408385031215613dac57600080fd5b823591506020830135613dbe81613d79565b809150509250929050565b600060208284031215613ddb57600080fd5b8135610f0981613d79565b60008060408385031215613df957600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b6080810160058610613e3257613e32613e08565b9481526020810193909352604083019190915260609091015290565b600080600060408486031215613e6357600080fd5b83356001600160401b0380821115613e7a57600080fd5b818601915086601f830112613e8e57600080fd5b813581811115613e9d57600080fd5b87602060a083028501011115613eb257600080fd5b6020928301989097509590910135949350505050565b60008060408385031215613edb57600080fd5b8235613ee681613d79565b946020939093013593505050565b60038110610a5057610a50613e08565b81516040820190613f1481613ef4565b82526020928301516001600160a01b0316929091019190915290565b60008060008060408587031215613f4657600080fd5b84356001600160401b0380821115613f5d57600080fd5b613f6988838901613ca1565b90965094506020870135915080821115613f8257600080fd5b50613f8f87828801613ca1565b95989497509550505050565b60028110613fab57613fab613e08565b9052565b80516001600160a01b03908116835260208083015190911690830152604090810151910152565b8051613fe181613ef4565b825260208181015190830152604090810151910152565b858152610160810161400d6020830187613f9b565b61401a6040830186613faf565b61402760a0830185613faf565b614035610100830184613fd6565b9695505050505050565b80356010811061188557600080fd5b6000806040838503121561406157600080fd5b61406a8361403f565b91506020830135613dbe81613d79565b8060408101831015610a0357600080fd5b60008060008060008060008060008060006101208c8e0312156140ad57600080fd5b6140b68c613d8e565b9a5060208c0135995060408c0135985060608c0135975060808c013596506001600160401b038060a08e013511156140ed57600080fd5b6140fd8e60a08f01358f01613ca1565b909750955060c08d013581101561411357600080fd5b6141238e60c08f01358f0161407a565b94508060e08e0135111561413657600080fd5b6141468e60e08f01358f0161407a565b9350806101008e0135111561415a57600080fd5b5061416c8d6101008e01358e01613ca1565b81935080925050509295989b509295989b9093969950565b6000806020838503121561419757600080fd5b82356001600160401b03808211156141ae57600080fd5b818501915085601f8301126141c257600080fd5b8135818111156141d157600080fd5b866020610160830285010111156141e757600080fd5b60209290920196919550909350505050565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715614231576142316141f9565b60405290565b604051601f8201601f191681016001600160401b038111828210171561425f5761425f6141f9565b604052919050565b60006001600160401b03821115614280576142806141f9565b5060051b60200190565b600082601f83011261429b57600080fd5b813560206142b06142ab83614267565b614237565b8083825260208201915060208460051b8701019350868411156142d257600080fd5b602086015b848110156142ee57803583529183019183016142d7565b509695505050505050565b600082601f83011261430a57600080fd5b81356001600160401b03811115614323576143236141f9565b614336601f8201601f1916602001614237565b81815284602083860101111561434b57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561438057600080fd5b853561438b81613d79565b9450602086013561439b81613d79565b935060408601356001600160401b03808211156143b757600080fd5b6143c389838a0161428a565b945060608801359150808211156143d957600080fd5b6143e589838a0161428a565b935060808801359150808211156143fb57600080fd5b50614408888289016142f9565b9150509295509295909350565b6001600160e01b031991909116815260200190565b6000806000806000806000806080898b03121561444657600080fd5b88356001600160401b038082111561445d57600080fd5b6144698c838d01613ca1565b909a50985060208b013591508082111561448257600080fd5b61448e8c838d01613ca1565b909850965060408b01359150808211156144a757600080fd5b6144b38c838d01613ca1565b909650945060608b01359150808211156144cc57600080fd5b506144d98b828c01613ca1565b999c989b5096995094979396929594505050565b6000602082840312156144ff57600080fd5b610f098261403f565b60008060006040848603121561451d57600080fd5b8335925060208401356001600160401b0381111561453a57600080fd5b61454686828701613ca1565b9497909650939450505050565b60005b8381101561456e578181015183820152602001614556565b50506000910152565b6000815180845261458f816020860160208601614553565b601f01601f19169290920160200192915050565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b828110156145fa57603f198886030184526145e8858351614577565b945092850192908501906001016145cc565b5092979650505050505050565b600080600080600060a0868803121561461f57600080fd5b853561462a81613d79565b9450602086013561463a81613d79565b9350604086013592506060860135915060808601356001600160401b0381111561466357600080fd5b614408888289016142f9565b60008060006060848603121561468457600080fd5b8335925060208401359150604084013561469d81613d79565b809150509250925092565b6000606082840312156146ba57600080fd5b6146c261420f565b905081356146cf81613d79565b815260208201356146df81613d79565b806020830152506040820135604082015292915050565b80356003811061188557600080fd5b60006060828403121561471757600080fd5b61471f61420f565b905061472a826146f6565b8152602082013560208201526040820135604082015292915050565b6000610160828403121561475957600080fd5b60405160a081018181106001600160401b038211171561477b5761477b6141f9565b6040528235815260208301356002811061479457600080fd5b60208201526147a684604085016146a8565b60408201526147b88460a085016146a8565b60608201526147cb846101008501614705565b60808201529392505050565b634e487b7160e01b600052603260045260246000fd5b606081016147fa85613ef4565b93815260208101929092526001600160a01b031660409091015290565b6040810161482484613ef4565b9281526020015290565b6000610180820190508382528251602083015260208301516148536040840182613f9b565b5060408301516148666060840182613faf565b50606083015161487960c0840182613faf565b5060808301516119e9610120840182613fd6565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6000808335601e198436030181126148f257600080fd5b8301803591506001600160401b0382111561490c57600080fd5b6020019150600581901b360382131561137a57600080fd5b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610a0357610a03614924565b602081016010831061496557614965613e08565b91905290565b600181811c9082168061497f57607f821691505b602082108103613c9b57634e487b7160e01b600052602260045260246000fd5b6000808335601e198436030181126149b657600080fd5b8301803591506001600160401b038211156149d057600080fd5b60200191503681900382131561137a57600080fd5b601f821115610db5576000816000526020600020601f850160051c81016020861015614a0e5750805b601f850160051c820191505b81811015614a2d57828155600101614a1a565b505050505050565b6001600160401b03831115614a4c57614a4c6141f9565b614a6083614a5a835461496b565b836149e5565b6000601f841160018114614a945760008515614a7c5750838201355b600019600387901b1c1916600186901b178355611177565b600083815260209020601f19861690835b82811015614ac55786850135825560209485019460019092019101614aa5565b5086821015614ae25760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b600060608284031215614b0657600080fd5b610f098383614705565b600060208284031215614b2257600080fd5b610f09826146f6565b600060208284031215614b3d57600080fd5b81518015158114610f0957600080fd5b6001600160e01b03198316815260408101600b8310614b6e57614b6e613e08565b8260208301529392505050565b8183526000602080850194508260005b85811015614bb9578135614b9e81613d79565b6001600160a01b031687529582019590820190600101614b8b565b509495945050505050565b81835260006001600160fb1b03831115614bdd57600080fd5b8260051b80836020870137939093016020019392505050565b604081526000614c0a604083018688614b7b565b8281036020840152614c1d818587614bc4565b979650505050505050565b600060208284031215614c3a57600080fd5b5051919050565b80820180821115610a0357610a03614924565b81810381811115610a0357610a03614924565b600082614c8457634e487b7160e01b600052601260045260246000fd5b500490565b608081526000614c9d608083018a8c614b7b565b60208382036020850152614cb2828a8c614b7b565b91508382036040850152614cc782888a614bc4565b848103606086015285815286925060200160005b86811015614d0757614cec846146f6565b614cf581613ef4565b82529282019290820190600101614cdb565b509c9b505050505050505050505050565b60008251614d2a818460208701614553565b9190910192915050565b60c08101614d428287613fd6565b6001600160a01b0394851660608301529284166080820152921660a090920191909152919050565b600060018201614d7c57614d7c614924565b5060010190565b600060a08284031215614d9557600080fd5b614d9d61420f565b8235614da881613d79565b81526020830135614db881613d79565b6020820152614dca8460408501614705565b60408201529392505050565b600082601f830112614de757600080fd5b81516020614df76142ab83614267565b8083825260208201915060208460051b870101935086841115614e1957600080fd5b602086015b848110156142ee578051614e3181613d79565b8352918301918301614e1e565b600080600060608486031215614e5357600080fd5b83516001600160401b0380821115614e6a57600080fd5b614e7687838801614dd6565b9450602091508186015181811115614e8d57600080fd5b614e9988828901614dd6565b945050604086015181811115614eae57600080fd5b86019050601f81018713614ec157600080fd5b8051614ecf6142ab82614267565b81815260059190911b82018301908381019089831115614eee57600080fd5b928401925b82841015614f275783516bffffffffffffffffffffffff81168114614f185760008081fd5b82529284019290840190614ef3565b80955050505050509250925092565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351614f6e816017850160208801614553565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351614f9f816028840160208801614553565b01602801949350505050565b602081526000610f096020830184614577565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090614c1d90830184614577565b60a081016150068286613fd6565b6001600160a01b03938416606083015291909216608090920191909152919050565b60008161503757615037614924565b506000190190565b634e487b7160e01b600052603160045260246000fd5b60018060a01b0385168152836020820152826040820152608060608201526000614035608083018461457756fea2646970667358221220f2c96cbb22626006ee11ff90975b91b23886e548ed7a61504409d1948b356f0f64736f6c63430008170033", + "nonce": "0x2f12b" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0xd24d87ddc1917165435b306aac68d99e0f49a3fa", + "to": "0xb0507f2f22697022ecb25963a00d3d076dac5753", + "gas": "0x8fcf4", + "value": "0x0", + "data": "0x663ac01100000000000000000000000000000000000000000000000000000000663074ca00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000054000000000000000000000000000000000000000000000000000000000000010a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000110000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000003a00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000046000000000000000000000000000000000000000000000000000000000000005400000000000000000000000000000000000000000000000000000000000000620000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000007e0000000000000000000000000000000000000000000000000000000000000084000000000000000000000000000000000000000000000000000000000000008a00000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000000000096000000000000000000000000000000000000000000000000000000000000009c00000000000000000000000000000000000000000000000000000000000000ac00000000000000000000000000000000000000000000000000000000000000b2000000000000000000000000000000000000000000000000000000000000000844f1ef286000000000000000000000000836d911c7de3edfc953030b9abc4b2b18b2db8b9000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000045cd8a76b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000007beb0f3fc4002c4542015cfa9023dee1a9ec94000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe6000000000000000000000000b03e29be08e57b2d95fe9f94966cb86a0dd984810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000004222384e84c248aa8d50fdc702a1b55e6b4efc990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000003a3a92ba9d4d49aae06861136d547667c742f1af0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c44bb5274a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006435da8121000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x262" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0xb033ba62ec622dc54d0abfe0254e79692147ca26", + "to": "0xb0507f2f22697022ecb25963a00d3d076dac5753", + "gas": "0x4956e", + "value": "0x0", + "data": "0xa8a0e32c00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000007e500000000000000000000000000000000000000000000000000000000663074ca00000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000010c000000000000000000000000000000000000000000000000000000000000000110000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000003a00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000046000000000000000000000000000000000000000000000000000000000000005400000000000000000000000000000000000000000000000000000000000000620000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000007e0000000000000000000000000000000000000000000000000000000000000084000000000000000000000000000000000000000000000000000000000000008a00000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000000000096000000000000000000000000000000000000000000000000000000000000009c00000000000000000000000000000000000000000000000000000000000000ac00000000000000000000000000000000000000000000000000000000000000b2000000000000000000000000000000000000000000000000000000000000000844f1ef286000000000000000000000000836d911c7de3edfc953030b9abc4b2b18b2db8b9000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000045cd8a76b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000007beb0f3fc4002c4542015cfa9023dee1a9ec94000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe6000000000000000000000000b03e29be08e57b2d95fe9f94966cb86a0dd984810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000004222384e84c248aa8d50fdc702a1b55e6b4efc990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000003a3a92ba9d4d49aae06861136d547667c742f1af0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c44bb5274a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006435da8121000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x65" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x087d08e3ba42e64e3948962dd1371f906d1278b9", + "to": "0xb0507f2f22697022ecb25963a00d3d076dac5753", + "gas": "0x10cf46", + "value": "0x0", + "data": "0xa8a0e32c00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000007e500000000000000000000000000000000000000000000000000000000663074ca00000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000010c000000000000000000000000000000000000000000000000000000000000000110000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000003a00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000046000000000000000000000000000000000000000000000000000000000000005400000000000000000000000000000000000000000000000000000000000000620000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000007e0000000000000000000000000000000000000000000000000000000000000084000000000000000000000000000000000000000000000000000000000000008a00000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000000000096000000000000000000000000000000000000000000000000000000000000009c00000000000000000000000000000000000000000000000000000000000000ac00000000000000000000000000000000000000000000000000000000000000b2000000000000000000000000000000000000000000000000000000000000000844f1ef286000000000000000000000000836d911c7de3edfc953030b9abc4b2b18b2db8b9000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000045cd8a76b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000007beb0f3fc4002c4542015cfa9023dee1a9ec94000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe6000000000000000000000000b03e29be08e57b2d95fe9f94966cb86a0dd984810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000004222384e84c248aa8d50fdc702a1b55e6b4efc990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000003a3a92ba9d4d49aae06861136d547667c742f1af0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c44bb5274a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006435da8121000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x5a" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "transactionHash": "0x1467e2ab29e7b30da58b2651b5e1385992f17526838467aced5d2eab819d5688", + "transactionIndex": "0x0", + "blockHash": "0xffec7c7da845eccb01d1004dafa29ff8bc2fd666e8240677855015b16d12e2c0", + "blockNumber": "0x1949658", + "from": "0x52ec2e6BBcE45AfFF8955Da6410bb13812F4289F", + "to": "0x53Ea388CB72081A3a397114a43741e7987815896", + "cumulativeGasUsed": "0x35243", + "gasUsed": "0x35243", + "contractAddress": null, + "logs": [ + { + "address": "0x53Ea388CB72081A3a397114a43741e7987815896", + "topics": [ + "0xa57d40f1496988cf60ab7c9d5ba4ff83647f67d3898d441a3aaf21b651678fd9", + "0x00000000000000000000000000000000000000000000000000000000000007e5", + "0x000000000000000000000000000000000000000000000000000000000000002d", + "0xc3d2b68e9a7c0ec3a1a5df197f5a38348c52edd72740f605436476faa32cab1c" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000004000000000000000000000000052ec2e6bbce45afff8955da6410bb13812f4289f000000000000000000000000000000000000000000000000000000000000002d00000000000000000000000000000000000000000000000000000000000007e500000000000000000000000000000000000000000000000000000000663074ca00000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000010000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab95000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000248f283970000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac575300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000f4240", + "blockHash": "0xffec7c7da845eccb01d1004dafa29ff8bc2fd666e8240677855015b16d12e2c0", + "blockNumber": "0x1949658", + "transactionHash": "0x1467e2ab29e7b30da58b2651b5e1385992f17526838467aced5d2eab819d5688", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + }, + { + "address": "0x53Ea388CB72081A3a397114a43741e7987815896", + "topics": [ + "0x1203f9e81c814a35f5f4cc24087b2a24c6fb7986a9f1406b68a9484882c93a23", + "0xc3d2b68e9a7c0ec3a1a5df197f5a38348c52edd72740f605436476faa32cab1c", + "0x00000000000000000000000052ec2e6bbce45afff8955da6410bb13812f4289f" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064", + "blockHash": "0xffec7c7da845eccb01d1004dafa29ff8bc2fd666e8240677855015b16d12e2c0", + "blockNumber": "0x1949658", + "transactionHash": "0x1467e2ab29e7b30da58b2651b5e1385992f17526838467aced5d2eab819d5688", + "transactionIndex": "0x0", + "logIndex": "0x1", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000010000000000100000000000000000000000000000080000000020000000002000000004000000000000000000000000000000000400000000000000000004000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000040000000000000000000000000000000000001000000000000000000000000008000000000000000000400000000000010000002000000000000000000000000000800000000000000000000000000000000400000000000000000004000000000000000080000000000000000000004000000000000", + "type": "0x0", + "effectiveGasPrice": "0x4a817c800" + }, + { + "transactionHash": "0xa58405e67e2e6558de328d173bce7db193836183c1303351bf95c59fbcb7d78f", + "transactionIndex": "0x1", + "blockHash": "0x6427eebf0bf5f2ad49256ce4267f797fdd1b0e0fd99f968bc484311ce6fdc0d3", + "blockNumber": "0x194965a", + "from": "0x087D08e3ba42e64E3948962dd1371F906D1278b9", + "to": "0x53Ea388CB72081A3a397114a43741e7987815896", + "cumulativeGasUsed": "0x45b13", + "gasUsed": "0x1f54a", + "contractAddress": null, + "logs": [ + { + "address": "0x53Ea388CB72081A3a397114a43741e7987815896", + "topics": [ + "0x1203f9e81c814a35f5f4cc24087b2a24c6fb7986a9f1406b68a9484882c93a23", + "0xc3d2b68e9a7c0ec3a1a5df197f5a38348c52edd72740f605436476faa32cab1c", + "0x000000000000000000000000087d08e3ba42e64e3948962dd1371f906d1278b9" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064", + "blockHash": "0x6427eebf0bf5f2ad49256ce4267f797fdd1b0e0fd99f968bc484311ce6fdc0d3", + "blockNumber": "0x194965a", + "transactionHash": "0xa58405e67e2e6558de328d173bce7db193836183c1303351bf95c59fbcb7d78f", + "transactionIndex": "0x1", + "logIndex": "0x4", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000020000000000000000004000000000000400000000000000000000000000000000000000004000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000800000000000400000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000080000000000000000000004000000000000", + "type": "0x0", + "effectiveGasPrice": "0x4a817c800" + } + ], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1713250237, + "chain": 2021, + "multi": false, + "commit": "299b38b" +} \ No newline at end of file diff --git a/broadcast/20240411-p2-upgrade-bridge-ronin-chain.s.sol/2021/run-1713251065.json b/broadcast/20240411-p2-upgrade-bridge-ronin-chain.s.sol/2021/run-1713251065.json new file mode 100644 index 00000000..84a624ba --- /dev/null +++ b/broadcast/20240411-p2-upgrade-bridge-ronin-chain.s.sol/2021/run-1713251065.json @@ -0,0 +1,348 @@ +{ + "transactions": [ + { + "hash": "0xbefcfe4868f0c8e4482deaa0f523cff58ea8d18dca1e399e3c980039786e71d8", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x53Ea388CB72081A3a397114a43741e7987815896", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x52ec2e6bbce45afff8955da6410bb13812f4289f", + "to": "0x53ea388cb72081a3a397114a43741e7987815896", + "gas": "0x77916", + "value": "0x0", + "data": "0x663ac01100000000000000000000000000000000000000000000000000000000663074ca00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab95000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000248f283970000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac575300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x47" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0xbb3277760b381cd77bb80507d23472da400d1a1d75cb6b75d2a9f441964f932f", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x53Ea388CB72081A3a397114a43741e7987815896", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x087d08e3ba42e64e3948962dd1371f906d1278b9", + "to": "0x53ea388cb72081a3a397114a43741e7987815896", + "gas": "0x467e6", + "value": "0x0", + "data": "0xa8a0e32c00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002d00000000000000000000000000000000000000000000000000000000000007e500000000000000000000000000000000000000000000000000000000663074ca00000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000010000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab95000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000248f283970000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac575300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x59" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x53Ea388CB72081A3a397114a43741e7987815896", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x06f8af58f656b507918d91b0b6f8b89bfcc556f9", + "to": "0x53ea388cb72081a3a397114a43741e7987815896", + "gas": "0x467e6", + "value": "0x0", + "data": "0xa8a0e32c00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002d00000000000000000000000000000000000000000000000000000000000007e500000000000000000000000000000000000000000000000000000000663074ca00000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000010000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab95000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000248f283970000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac575300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x0" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x53Ea388CB72081A3a397114a43741e7987815896", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0xe1100401454b5f850b09f3b92ce7f071c5f1cef4", + "to": "0x53ea388cb72081a3a397114a43741e7987815896", + "gas": "0x5cd02", + "value": "0x0", + "data": "0xa8a0e32c00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002d00000000000000000000000000000000000000000000000000000000000007e500000000000000000000000000000000000000000000000000000000663074ca00000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000010000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab95000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000248f283970000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac575300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x0" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CREATE", + "contractName": "BridgeReward", + "contractAddress": "0x836D911C7de3edfc953030B9ABc4b2B18B2db8b9", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x2b9610", + "value": "0x0", + "data": "0x60a060405230608052610010610015565b6100d5565b600054610100900460ff16156100815760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156100d3576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6080516118666100f06000396000610bc701526118666000f3fe6080604052600436106100dd5760003560e01c80638f7c34a21161007f578063ad43663e11610059578063ad43663e14610261578063b77f2a4014610276578063de981f1b14610296578063f5dbc4ee146102ce57600080fd5b80638f7c34a21461021957806395b6ef0c1461022e578063a6bd67881461024157600080fd5b80633b154455116100bb5780633b154455146101c757806359f778df146101dc5780635cd8a76b146101e4578063865e6fd3146101f957600080fd5b806306032d74146100e257806333b3ea6c1461018257806334087952146101a4575b600080fd5b3480156100ee57600080fd5b506101626100fd366004611335565b604080518082018252600080825260209182018190526001600160a01b039390931683527f518cfd198acbffe95e740cfce1af28a3f7de51f0d784893d3d72c5cc59d7062a815291819020815180830190925280548252600101549181019190915290565b604080518251815260209283015192810192909252015b60405180910390f35b34801561018e57600080fd5b506101a261019d366004611352565b6102e3565b005b3480156101b057600080fd5b506101b9610399565b604051908152602001610179565b3480156101d357600080fd5b506101a26103c8565b6101a26104bb565b3480156101f057600080fd5b506101a26104c5565b34801561020557600080fd5b506101a261021436600461137a565b610593565b34801561022557600080fd5b506101b96105ae565b6101a261023c3660046113b1565b6105c6565b34801561024d57600080fd5b506101a261025c366004611352565b6106e9565b34801561026d57600080fd5b506101b96106fd565b34801561028257600080fd5b506101a2610291366004611352565b610727565b3480156102a257600080fd5b506102b66102b136600461142a565b61073d565b6040516001600160a01b039091168152602001610179565b3480156102da57600080fd5b506101b96107b8565b6102ec336107e2565b61031c57604051638f47e7e360e01b81526001600160e01b03196000351660048201526024015b60405180910390fd5b6000610328600861073d565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610365573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103899190611445565b90506103958183610860565b5050565b60006103c37f3663384f6436b31a97d9c9a02f64ab8b73ead575c5b6224fa0800a6bd57f62f45490565b905090565b60046103d381610acd565b6000196103de6105ae565b146104205760405162461bcd60e51b815260206004820152601260248201527130b63932b0b23c9034b734ba103932b8101960711b6044820152606401610313565b6104ac600161042f600861073d565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa15801561046c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104909190611445565b61049a9190611474565b60008051602061181183398151915255565b6104b860046000610b19565b50565b6104c3610bbd565b565b600054600290610100900460ff161580156104e7575060005460ff8083169116105b6105035760405162461bcd60e51b815260040161031390611487565b6000805461ffff191660ff8316176101001790556105417faf260ffaff563b9407c1c5fe4aec2be8632142d158c44bb0ce4d471cb4883b8c60059055565b61054e60016104906105ae565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150565b61059b610c9e565b6105a481610cf8565b6103958282610b19565b60006103c36000805160206118118339815191525490565b600054610100900460ff16158080156105e65750600054600160ff909116105b806106005750303b158015610600575060005460ff166001145b61061c5760405162461bcd60e51b815260040161031390611487565b6000805460ff19166001179055801561063f576000805461ff0019166101001790555b61064a600b88610b19565b610655600387610b19565b610660600c86610b19565b61066b600885610b19565b610676600484610b19565b6000196000805160206118118339815191525561069282610d2e565b61069a610bbd565b80156106e0576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b600b6106f481610acd565b61039582610d2e565b60006103c37f90f7d557245e5dd9485f463e58974fa7cdc93c0abbd0a1afebb8f9640ec739105490565b600361073281610acd565b610395826000610860565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115610774576107746114d5565b60ff1681526020810191909152604001600020546001600160a01b03169050806107b3578160405163409140df60e11b815260040161031391906114ff565b919050565b60006103c37f9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c645490565b60006107ee600b61073d565b604051635a02d57960e11b81526001600160a01b038481166004830152919091169063b405aaf290602401602060405180830381865afa158015610836573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085a919061150d565b92915050565b600061086a6105ae565b9050816000036108cc5760008184111561089757600161088a8386611474565b6108949190611474565b90505b6108c8816108c37faf260ffaff563b9407c1c5fe4aec2be8632142d158c44bb0ce4d471cb4883b8c5490565b610d87565b9250505b6108d7838383610d9f565b60006108e3600b61073d565b6001600160a01b0316639b19dbfd6040518163ffffffff1660e01b8152600401600060405180830381865afa158015610920573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610948919081019061159a565b90506000610956600361073d565b905060005b84811015610ac55761096c84611639565b9350610abd83836001600160a01b031663f67e815287876040518363ffffffff1660e01b81526004016109a0929190611697565b600060405180830381865afa1580156109bd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109e591908101906116b0565b60405163692f6a6360e11b8152600481018890526001600160a01b0386169063d25ed4c690602401602060405180830381865afa158015610a2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4e9190611445565b604051637153af9b60e11b8152600481018990526001600160a01b0387169063e2a75f3690602401602060405180830381865afa158015610a93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab79190611445565b88610e33565b60010161095b565b505050505050565b610ad68161073d565b6001600160a01b0316336001600160a01b0316146104b8576000356001600160e01b03191681336040516320e0f98d60e21b815260040161031393929190611736565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f811115610b4f57610b4f6114d5565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115610b9057610b906114d5565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610c1457604051638f47e7e360e01b81526001600160e01b0319600035166004820152602401610313565b337f7ae161a1f0ef2537f5ff1957021a50412e72abdc6a941a77d99361e91e7f3c3d610c5e7f9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c645490565b604080519182523460208301520160405180910390a26104b87f9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c6434610f8a565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031633146104c3576000356001600160e01b0319166001604051620f948f60ea1b815260040161031392919061176d565b806001600160a01b03163b6000036104b857604051630bfc64a360e21b81526001600160a01b0382166004820152602401610313565b610d577f90f7d557245e5dd9485f463e58974fa7cdc93c0abbd0a1afebb8f9640ec73910829055565b6040518181527f9b40b647582311cc8f5f7d27e7ce206d126605d1625b8299b7edaeefd869ef2590602001610588565b6000818310610d965781610d98565b825b9392505050565b81600003610dc05760405163799ffe0d60e01b815260040160405180910390fd5b610dcb81600161179b565b8311610df45760405163425a5b1f60e01b81526004810184905260248101829052604401610313565b610dfe828261179b565b8311610e2e57604051630931302b60e31b8152600481018490526024810182905260448101839052606401610313565b505050565b845184518114610e64576040516306b5667560e21b81526001600160e01b0319600035166004820152602401610313565b6000610e6e6106fd565b90506000610e7b88610fa1565b90506000610e8a87878a61101f565b90506000806000805b87811015610f3957610edc8589898f8581518110610eb357610eb36117ae565b60200260200101518f8e8c8881518110610ecf57610ecf6117ae565b6020026020010151611072565b80945081955050506000610f0b8a8f8481518110610efc57610efc6117ae565b60200260200101518787611093565b90508380610f17575080155b610f215784610f24565b60005b610f2e908461179b565b925050600101610e93565b50610f647f3663384f6436b31a97d9c9a02f64ab8b73ead575c5b6224fa0800a6bd57f62f482610f8a565b50610f7c600080516020611811833981519152899055565b505050505050505050505050565b600061085a83610f9a85856111f9565b9250829055565b6060610fad600c61073d565b6001600160a01b0316635311153b836040518263ffffffff1660e01b8152600401610fd891906117c4565b6000604051808303816000875af1158015610ff7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261085a91908101906116b0565b60008061102d858585611218565b90508061105e576040517f64ba7143ea5a17abea37667aa9ae137e3afba5033c5f504770c02829c128189c90600090a15b801580611069575084155b95945050505050565b6000828210156110858989898989611295565b915097509795505050505050565b6001600160a01b03831660009081527f518cfd198acbffe95e740cfce1af28a3f7de51f0d784893d3d72c5cc59d7062a60205260408120821561113857838160010160008282546110e4919061179b565b9091555050604080516001600160a01b03871681526020810186905287917fb3d061c3ef3991b0d4b09f4c8b551d137c3d1e014cf5326462d3d1f6a8dfb9c291015b60405180910390a260009150506111f1565b611144858560006112c0565b156111b0578381600001600082825461115d919061179b565b9091555050604080516001600160a01b03871681526020810186905287917fbab0baccb39371d4d5206b519fe58d21cae9cdd63a1d1b5146ecdf405fd93152910160405180910390a260019150506111f1565b604080516001600160a01b03871681526020810186905287917f74b217634c5a7790ce69770c5e35019970453d4da3973769e7d6cdb7ce6816a19101611126565b949350505050565b815481018181101561085a57634e487b7160005260116020526024601cfd5b8051600190600090815b8181101561127d578585828151811061123d5761123d6117ae565b60200260200101511115611254576000935061127d565b848181518110611266576112666117ae565b602002602001015183019250806001019050611222565b5082801561128b5750858211155b9695505050505050565b6000856112b657816112a784866117d7565b6112b191906117ee565b61128b565b61128b85856117ee565b6000836001600160a01b0316838390604051600060405180830381858888f193505050503d8060008114611310576040519150601f19603f3d011682016040523d82523d6000602084013e611315565b606091505b509095945050505050565b6001600160a01b03811681146104b857600080fd5b60006020828403121561134757600080fd5b8135610d9881611320565b60006020828403121561136457600080fd5b5035919050565b8035601081106107b357600080fd5b6000806040838503121561138d57600080fd5b6113968361136b565b915060208301356113a681611320565b809150509250929050565b60008060008060008060c087890312156113ca57600080fd5b86356113d581611320565b955060208701356113e581611320565b945060408701356113f581611320565b9350606087013561140581611320565b9250608087013561141581611320565b8092505060a087013590509295509295509295565b60006020828403121561143c57600080fd5b610d988261136b565b60006020828403121561145757600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561085a5761085a61145e565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b601081106114fb576114fb6114d5565b9052565b6020810161085a82846114eb565b60006020828403121561151f57600080fd5b81518015158114610d9857600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561156e5761156e61152f565b604052919050565b600067ffffffffffffffff8211156115905761159061152f565b5060051b60200190565b600060208083850312156115ad57600080fd5b825167ffffffffffffffff8111156115c457600080fd5b8301601f810185136115d557600080fd5b80516115e86115e382611576565b611545565b81815260059190911b8201830190838101908783111561160757600080fd5b928401925b8284101561162e57835161161f81611320565b8252928401929084019061160c565b979650505050505050565b60006001820161164b5761164b61145e565b5060010190565b60008151808452602080850194506020840160005b8381101561168c5781516001600160a01b031687529582019590820190600101611667565b509495945050505050565b8281526040602082015260006111f16040830184611652565b600060208083850312156116c357600080fd5b825167ffffffffffffffff8111156116da57600080fd5b8301601f810185136116eb57600080fd5b80516116f96115e382611576565b81815260059190911b8201830190838101908783111561171857600080fd5b928401925b8284101561162e5783518252928401929084019061171d565b6001600160e01b0319841681526060810161175460208301856114eb565b6001600160a01b03929092166040919091015292915050565b6001600160e01b03198316815260408101600b831061178e5761178e6114d5565b8260208301529392505050565b8082018082111561085a5761085a61145e565b634e487b7160e01b600052603260045260246000fd5b602081526000610d986020830184611652565b808202811582820484141761085a5761085a61145e565b60008261180b57634e487b7160e01b600052601260045260246000fd5b50049056fe2417f25874c1cdc139a787dd21df976d40d767090442b3a2496917ecfc93b619a2646970667358221220cd237faf10660b4bf88f4dcc843cf0b3d4cce585ad7f99199ed3924ea16b8dfd64736f6c63430008170033", + "nonce": "0x2f127" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CREATE", + "contractName": "BridgeSlash", + "contractAddress": "0x7bEB0f3fC4002C4542015cFa9023dEE1A9EC9400", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x26b9de", + "value": "0x0", + "data": "0x608060405261000c610011565b6100d1565b600054610100900460ff161561007d5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156100cf576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b611583806100e06000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80639c2f445911610097578063de981f1b11610066578063de981f1b146101fd578063f8c8765e14610228578063f9f608731461023b578063fbb2f1941461024357600080fd5b80639c2f4459146101d2578063c48549de146101da578063d1e1f2f8146101ed578063ddc3f7f6146101f557600080fd5b80635311153b116100d35780635311153b1461016a5780636dda44081461017d578063865e6fd3146101935780638f851d8a146101a657600080fd5b806301ffc9a7146101055780631288810a1461012d5780633b1544551461014d5780634dca592514610157575b600080fd5b610118610113366004610eb7565b610263565b60405190151581526020015b60405180910390f35b61014061013b366004610f2d565b61029a565b6040516101249190610f6f565b610155610382565b005b6101556101653660046110a4565b610462565b610140610178366004610f2d565b6106f9565b610185600181565b604051908152602001610124565b6101556101a136600461118e565b6107d2565b6101b96101b43660046111c1565b6107f1565b6040516001600160e01b03199091168152602001610124565b610185603281565b6101b96101e83660046112ba565b610970565b610185600581565b610185601e81565b61021061020b366004611326565b61098f565b6040516001600160a01b039091168152602001610124565b610155610236366004611341565b610a0a565b610140610b49565b610256610251366004611395565b610b58565b60405161012491906113cd565b60006001600160e01b031982166312c0151560e21b148061029457506001600160e01b031982166301ffc9a760e01b145b92915050565b6060818067ffffffffffffffff8111156102b6576102b6610fb3565b6040519080825280602002602001820160405280156102df578160200160208202803683370190505b50915060008051602061152e83398151915260005b8281101561037957816000878784818110610311576103116113e7565b905060200201602081019061032691906113fd565b6001600160a01b031681526020810191909152604001600020548451600160801b9091046001600160801b031690859083908110610366576103666113e7565b60209081029190910101526001016102f4565b50505092915050565b600461038d81610b6b565b600019600154146103da5760405162461bcd60e51b815260206004820152601260248201527130b63932b0b23c9034b734ba103932b8101960711b60448201526064015b60405180910390fd5b6103e4600861098f565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610421573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104459190611418565b610450906001611447565b60015561045f60046000610bb7565b50565b600361046d81610b6b565b8160015481106106f0578360328111156106ee5786518851146104b1576040516306b5667560e21b81526001600160e01b03196000351660048201526024016103d1565b8751156106ee576104c3868689610c5b565b6104f5576040517f64ba7143ea5a17abea37667aa9ae137e3afba5033c5f504770c02829c128189c90600090a16106ee565b60006104ff610cd8565b6040805180820190915260008082526020820181905291925060008051602061152e833981519152918080805b8e518110156106e6578e8181518110610547576105476113e7565b6020908102919091018101516001600160a01b03811660009081528883526040908190208151808301909252546001600160801b038082168352600160801b90910416928101839052965093508b11156106de576105be8e82815181106105b0576105b06113e7565b60200260200101518d610d43565b91506105d9828c87600001516001600160801b03168a610d95565b93506105e5848c610dec565b1561062b576040516001600160801b0394506001600160a01b038416908c907fb32a150b9737190a456d8b2b81dd7d592a799ab2933ea494e44351acd41f835d90600090a35b600082600281111561063f5761063f6113b7565b146106de576001600160801b0384146106a3578a836001600160a01b031683600281111561066f5761066f6113b7565b6040518781527fa0957b65e189f06dfe2b38ff07e89a0df128ba3fcba66c68f8d2615daebc30a99060200160405180910390a45b6001600160a01b038316600090815260208790526040902080546fffffffffffffffffffffffffffffffff19166001600160801b0386161790555b60010161052c565b505050505050505b505b50505050505050565b6060818067ffffffffffffffff81111561071557610715610fb3565b60405190808252806020026020018201604052801561073e578160200160208202803683370190505b50915060008051602061152e83398151915260005b8281101561037957816000878784818110610770576107706113e7565b905060200201602081019061078591906113fd565b6001600160a01b0316815260208101919091526040016000205484516001600160801b03909116908590839081106107bf576107bf6113e7565b6020908102919091010152600101610753565b6107da610e0e565b6107e381610e6a565b6107ed8282610bb7565b5050565b6000600b6107fe81610b6b565b82518690811461082f576040516306b5667560e21b81526001600160e01b03196000351660048201526024016103d1565b8060000361084757506347c28ec560e11b9150610966565b60008051602061152e8339815191526000610862600861098f565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa15801561089f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c39190611418565b905060005b83811015610957578681815181106108e2576108e26113e7565b60200260200101511561094f57818360008d8d85818110610905576109056113e7565b905060200201602081019061091a91906113fd565b6001600160a01b03168152602081019190915260400160002080546001600160801b03928316600160801b0292169190911790555b6001016108c8565b506347c28ec560e11b94505050505b5095945050505050565b6000600b61097d81610b6b565b50636242a4ef60e11b95945050505050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f8111156109c6576109c66113b7565b60ff1681526020810191909152604001600020546001600160a01b0316905080610a05578160405163409140df60e11b81526004016103d1919061146e565b919050565b600054610100900460ff1615808015610a2a5750600054600160ff909116105b80610a445750303b158015610a44575060005460ff166001145b610aa75760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103d1565b6000805460ff191660011790558015610aca576000805461ff0019166101001790555b610ad5600886610bb7565b610ae0600b85610bb7565b610aeb600384610bb7565b610af6600483610bb7565b6000196001558015610b42576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6060610b53610cd8565b905090565b6000610b648383610d43565b9392505050565b610b748161098f565b6001600160a01b0316336001600160a01b03161461045f576000356001600160e01b03191681336040516320e0f98d60e21b81526004016103d19392919061147c565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f811115610bed57610bed6113b7565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115610c2e57610c2e6113b7565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b8051600190600090815b81811015610cc05785858281518110610c8057610c806113e7565b60200260200101511115610c975760009350610cc0565b848181518110610ca957610ca96113e7565b602002602001015183019250806001019050610c65565b50828015610cce5750858211155b9695505050505050565b604080516003808252608082019092526060916020820183803683370190505090506001818160ff1681518110610d1157610d116113e7565b6020908102919091010152600581600260ff1681518110610d3457610d346113e7565b60200260200101818152505090565b60008082612710610d5486836114b3565b610d5e91906114c6565b610d6891906114dd565b9050610bb88111610d8a576103e88111610d83576000610d8d565b6001610d8d565b60025b949350505050565b6000610dab610da56001866114b3565b84610ea0565b82866002811115610dbe57610dbe6113b7565b60ff1681518110610dd157610dd16113e7565b6020026020010151610de39190611447565b95945050505050565b6000601e610dfb6001846114b3565b610e0590856114b3565b10159392505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610e68576000356001600160e01b0319166001604051620f948f60ea1b81526004016103d19291906114ff565b565b806001600160a01b03163b60000361045f57604051630bfc64a360e21b81526001600160a01b03821660048201526024016103d1565b600081831015610eb05781610b64565b5090919050565b600060208284031215610ec957600080fd5b81356001600160e01b031981168114610b6457600080fd5b60008083601f840112610ef357600080fd5b50813567ffffffffffffffff811115610f0b57600080fd5b6020830191508360208260051b8501011115610f2657600080fd5b9250929050565b60008060208385031215610f4057600080fd5b823567ffffffffffffffff811115610f5757600080fd5b610f6385828601610ee1565b90969095509350505050565b6020808252825182820181905260009190848201906040850190845b81811015610fa757835183529284019291840191600101610f8b565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610ff257610ff2610fb3565b604052919050565b600067ffffffffffffffff82111561101457611014610fb3565b5060051b60200190565b80356001600160a01b0381168114610a0557600080fd5b600082601f83011261104657600080fd5b8135602061105b61105683610ffa565b610fc9565b8083825260208201915060208460051b87010193508684111561107d57600080fd5b602086015b848110156110995780358352918301918301611082565b509695505050505050565b600080600080600060a086880312156110bc57600080fd5b853567ffffffffffffffff808211156110d457600080fd5b818801915088601f8301126110e857600080fd5b813560206110f861105683610ffa565b82815260059290921b8401810191818101908c84111561111757600080fd5b948201945b8386101561113c5761112d8661101e565b8252948201949082019061111c565b9950508901359250508082111561115257600080fd5b5061115f88828901611035565b959895975050505060408401359360608101359360809091013592509050565b803560108110610a0557600080fd5b600080604083850312156111a157600080fd5b6111aa8361117f565b91506111b86020840161101e565b90509250929050565b6000806000806000606086880312156111d957600080fd5b853567ffffffffffffffff808211156111f157600080fd5b6111fd89838a01610ee1565b909750955060209150878201358181111561121757600080fd5b6112238a828b01610ee1565b90965094505060408801358181111561123b57600080fd5b88019050601f8101891361124e57600080fd5b803561125c61105682610ffa565b81815260059190911b8201830190838101908b83111561127b57600080fd5b928401925b828410156112a857833580151581146112995760008081fd5b82529284019290840190611280565b80955050505050509295509295909350565b600080600080604085870312156112d057600080fd5b843567ffffffffffffffff808211156112e857600080fd5b6112f488838901610ee1565b9096509450602087013591508082111561130d57600080fd5b5061131a87828801610ee1565b95989497509550505050565b60006020828403121561133857600080fd5b610b648261117f565b6000806000806080858703121561135757600080fd5b6113608561101e565b935061136e6020860161101e565b925061137c6040860161101e565b915061138a6060860161101e565b905092959194509250565b600080604083850312156113a857600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60208101600383106113e1576113e16113b7565b91905290565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561140f57600080fd5b610b648261101e565b60006020828403121561142a57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561029457610294611431565b6010811061146a5761146a6113b7565b9052565b60208101610294828461145a565b6001600160e01b0319841681526060810161149a602083018561145a565b6001600160a01b03929092166040919091015292915050565b8181038181111561029457610294611431565b808202811582820484141761029457610294611431565b6000826114fa57634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b03198316815260408101600b8310611520576115206113b7565b826020830152939250505056fed08d185790a07c7b9b721e2713c8580010a57f31c72c16f6e80b831d0ee45bfea2646970667358221220a88731885a136f6ffe2ef43beabc7b3a128ab2f3ee20d79c6777fe10326663bf64736f6c63430008170033", + "nonce": "0x2f128" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CREATE", + "contractName": "BridgeTracking", + "contractAddress": "0xB03E29Be08E57b2d95Fe9F94966CB86a0DD98481", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x2fb53a", + "value": "0x0", + "data": "0x608060405234801561001057600080fd5b5061001961001e565b6100eb565b600154600160a81b900460ff161561008c5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60015460ff600160a01b909104811610156100e9576001805460ff60a01b191660ff60a01b17905560405160ff81527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b611ad5806100fa6000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063c7c4fea91161008c578063de981f1b11610066578063de981f1b1461017e578063e2a75f36146101a9578063f67e8152146101bc578063f84bd121146101dc57600080fd5b8063c7c4fea914610145578063ca21287e14610158578063d25ed4c61461016b57600080fd5b80631794bb3c146100d4578063229f88ea146100e95780633b154455146100fc5780634ac0bcda146101045780635cd8a76b1461012a578063865e6fd314610132575b600080fd5b6100e76100e23660046114df565b6101e4565b005b6100e76100f736600461152f565b6102e4565b6100e761048c565b610117610112366004611559565b61055c565b6040519081526020015b60405180910390f35b6100e761057a565b6100e7610140366004611598565b610673565b6100e76101533660046115c4565b610692565b6100e7610166366004611604565b610a6b565b610117610179366004611660565b610b56565b61019161018c366004611679565b610b8b565b6040516001600160a01b039091168152602001610121565b6101176101b7366004611660565b610c01565b6101cf6101ca366004611694565b610c2b565b604051610121919061174f565b600254610117565b600154600160a81b900460ff161580801561020a575060018054600160a01b900460ff16105b8061022a5750303b15801561022a575060018054600160a01b900460ff16145b61024f5760405162461bcd60e51b815260040161024690611762565b60405180910390fd5b6001805460ff60a01b1916600160a01b179055801561027c576001805460ff60a81b1916600160a81b1790555b610287600285610c72565b610292600884610c72565b600282905580156102de576001805460ff60a81b191681556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b60026102ef81610d16565b6102f7610d62565b6000600a600085600281111561030f5761030f6117b0565b6002811115610320576103206117b0565b81526020019081526020016000206000848152602001908152602001600020905080600001546000036102de57610355610d70565b60006103616008610b8b565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa15801561039e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c291906117c6565b808355600480546001818101835560009290925260029081027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018054939450928892849260ff1990921691849081111561041f5761041f6117b0565b02179055506001808201869055830160005b81548110156104745761046c8888848481548110610451576104516117df565b6000918252602090912001546001600160a01b031687611012565b600101610431565b50610483600185016000611452565b50505050505050565b600461049781610d16565b600019600b54146104df5760405162461bcd60e51b815260206004820152601260248201527130b63932b0b23c9034b734ba103932b8101960711b6044820152606401610246565b6104e96008610b8b565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610526573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054a91906117c6565b600b5561055960046000610c72565b50565b6000610571838361056c86611192565b6112b8565b90505b92915050565b600154600290600160a81b900460ff161580156105a5575060015460ff808316600160a01b90920416105b6105c15760405162461bcd60e51b815260040161024690611762565b6001805460ff60a81b1960ff8416600160a01b021661ffff60a01b1990911617600160a81b179055600054610601906002906001600160a01b0316610c72565b600154610619906008906001600160a01b0316610c72565b600080546001600160a01b031916905560018054600161ff0160a01b031916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b61067b61130e565b61068481611368565b61068e8282610c72565b5050565b600261069d81610d16565b6106a5610d62565b60006106b16008610b8b565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106ee573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071291906117c6565b905061071c610d70565b6000600a6000876002811115610734576107346117b0565b6002811115610745576107456117b0565b81526020019081526020016000206000868152602001908152602001600020905080600001546000036107a7576001908101805491820181556000908152602090200180546001600160a01b0319166001600160a01b038516179055506102de565b6107b386868685611012565b600b548281101561048357600b8381556000906107cf90610b8b565b6001600160a01b0316639b19dbfd6040518163ffffffff1660e01b8152600401600060405180830381865afa15801561080c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108349190810190611816565b90506000610842838361139e565b9050600061084f84610c01565b9050600061085c85610b56565b9050600061086a600c610b8b565b9050600080826001600160a01b0316878786888c6040516024016108929594939291906118db565b60408051601f198184030181529181526020820180516001600160e01b0316634dca592560e01b179052516108c79190611975565b6000604051808303816000865af19150503d8060008114610904576040519150601f19603f3d011682016040523d82523d6000602084013e610909565b606091505b50915091508161096057604051634dca592560e01b906001600160a01b038516907feaa424ccc38ebcf22402729592dedf8315790e0128cb577cdeff1a3ee627f82790610957908590611991565b60405180910390a35b600061096c600d610b8b565b9050806001600160a01b03168b60405160240161098b91815260200190565b60408051601f198184030181529181526020820180516001600160e01b03166302ddfca960e61b179052516109c09190611975565b6000604051808303816000865af19150503d80600081146109fd576040519150601f19603f3d011682016040523d82523d6000602084013e610a02565b606091505b50909350915082610a5a576040516302ddfca960e61b906001600160a01b038316907feaa424ccc38ebcf22402729592dedf8315790e0128cb577cdeff1a3ee627f82790610a51908690611991565b60405180910390a35b505050505050505050505050505050565b600154600390600160a81b900460ff16158015610a96575060015460ff808316600160a01b90920416105b610ab25760405162461bcd60e51b815260040161024690611762565b6001805460ff60a81b1960ff8416600160a01b021661ffff60a01b1990911617600160a81b179055610ae5600b86610c72565b610af0600c85610c72565b610afb600d84610c72565b610b06600483610c72565b600019600b556001805460ff60a81b1916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050565b600081815260096020526040902060010154610b7182611192565b15610b8657600654610b8390826119c4565b90505b919050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115610bc257610bc26117b0565b60ff1681526020810191909152604001600020546001600160a01b0316905080610b86578160405163409140df60e11b815260040161024691906119f9565b600081815260096020526040902054610c1982611192565b15610b8657600454610b8390826119c4565b6060610c6a8484848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061139e92505050565b949350505050565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f811115610ca857610ca86117b0565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115610ce957610ce96117b0565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b610d1f81610b8b565b6001600160a01b0316336001600160a01b031614610559576000356001600160e01b03191681336040516320e0f98d60e21b815260040161024693929190611a07565b600254431015610d6e57005b565b6000610d7c6008610b8b565b60405163a3d545f560e01b81524360048201529091506000906001600160a01b0383169063a3d545f590602401602060405180830381865afa158015610dc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dea91906117c6565b905080600360000154101561068e576000826001600160a01b031663468c96ae6003600001546001610e1c91906119c4565b6040518263ffffffff1660e01b8152600401610e3a91815260200190565b6040805180830381865afa158015610e56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7a9190611a3e565b60038490556000818152600960205260408120600454815493955090935091839190610ea79084906119c4565b9091555050600654600182018054600090610ec39084906119c4565b90915550600090505b600854811015610f5357600880546000919083908110610eee57610eee6117df565b60009182526020808320909101546001600160a01b0316808352600782526040808420546002880190935283208054919450919290610f2e9084906119c4565b90915550506001600160a01b0316600090815260076020526040812055600101610ecc565b5060005b600454811015610fe557600060036001018281548110610f7957610f796117df565b6000918252602082206002918202018054909350600a91839160ff1690811115610fa557610fa56117b0565b6002811115610fb657610fb66117b0565b815260208082019290925260409081016000908120600195860154825290925290206003018590555001610f57565b50610ff260046000611470565b6000600581815560068290559061100a600882611452565b505050505050565b6000600a600086600281111561102a5761102a6117b0565b600281111561103b5761103b6117b0565b81526020808201929092526040908101600090812087825283528181206001600160a01b038716825260028101909352205490915060ff161561107e57506102de565b6001600160a01b03831660009081526002820160205260408120805460ff1916600117905560038201549081900361114b576001600160a01b038416600090815260076020526040812054900361111b57600880546001810182556000919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180546001600160a01b0319166001600160a01b0386161790555b6006805460019081019091556001600160a01b03851660009081526007602052604090208054909101905561100a565b82810361100a57600090815260096020908152604080832060018082018054820190556001600160a01b039790971684526002019091529020805490930190925550505050565b60008061119f6008610b8b565b60405163a3d545f560e01b81524360048201529091506000906001600160a01b0383169063a3d545f590602401602060405180830381865afa1580156111e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120d91906117c6565b9050600080836001600160a01b031663468c96ae600360000154600161123391906119c4565b6040518263ffffffff1660e01b815260040161125191815260200190565b6040805180830381865afa15801561126d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112919190611a3e565b915091508180156112a157508086145b80156112ae575060035483115b9695505050505050565b60008381526009602090815260408083206001600160a01b03861684526002019091529020548115611307576001600160a01b038316600090815260076020526040902054610c6a90826119c4565b9392505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610d6e576000356001600160e01b0319166001604051620f948f60ea1b8152600401610246929190611a71565b806001600160a01b03163b60000361055957604051630bfc64a360e21b81526001600160a01b0382166004820152602401610246565b80516060908067ffffffffffffffff8111156113bc576113bc6117f5565b6040519080825280602002602001820160405280156113e5578160200160208202803683370190505b50915060006113f385611192565b905060005b828110156114495761142486868381518110611416576114166117df565b6020026020010151846112b8565b848281518110611436576114366117df565b60209081029190910101526001016113f8565b50505092915050565b50805460008255906000526020600020908101906105599190611491565b508054600082556002029060005260206000209081019061055991906114aa565b5b808211156114a65760008155600101611492565b5090565b5b808211156114a657805460ff19168155600060018201556002016114ab565b6001600160a01b038116811461055957600080fd5b6000806000606084860312156114f457600080fd5b83356114ff816114ca565b9250602084013561150f816114ca565b929592945050506040919091013590565b803560038110610b8657600080fd5b6000806040838503121561154257600080fd5b61154b83611520565b946020939093013593505050565b6000806040838503121561156c57600080fd5b82359150602083013561157e816114ca565b809150509250929050565b803560108110610b8657600080fd5b600080604083850312156115ab57600080fd5b6115b483611589565b9150602083013561157e816114ca565b6000806000606084860312156115d957600080fd5b6115e284611520565b92506020840135915060408401356115f9816114ca565b809150509250925092565b6000806000806080858703121561161a57600080fd5b8435611625816114ca565b93506020850135611635816114ca565b92506040850135611645816114ca565b91506060850135611655816114ca565b939692955090935050565b60006020828403121561167257600080fd5b5035919050565b60006020828403121561168b57600080fd5b61057182611589565b6000806000604084860312156116a957600080fd5b83359250602084013567ffffffffffffffff808211156116c857600080fd5b818601915086601f8301126116dc57600080fd5b8135818111156116eb57600080fd5b8760208260051b850101111561170057600080fd5b6020830194508093505050509250925092565b60008151808452602080850194506020840160005b8381101561174457815187529582019590820190600101611728565b509495945050505050565b6020815260006105716020830184611713565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b6000602082840312156117d857600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8051610b86816114ca565b6000602080838503121561182957600080fd5b825167ffffffffffffffff8082111561184157600080fd5b818501915085601f83011261185557600080fd5b815181811115611867576118676117f5565b8060051b604051601f19603f8301168101818110858211171561188c5761188c6117f5565b6040529182528482019250838101850191888311156118aa57600080fd5b938501935b828510156118cf576118c08561180b565b845293850193928501926118af565b98975050505050505050565b60a0808252865190820181905260009060209060c0840190828a01845b8281101561191d5781516001600160a01b0316845292840192908401906001016118f8565b50505083810360208501526119328189611713565b6040850197909752505050606081019290925260809091015292915050565b60005b8381101561196c578181015183820152602001611954565b50506000910152565b60008251611987818460208701611951565b9190910192915050565b60208152600082518060208401526119b0816040850160208701611951565b601f01601f19169190910160400192915050565b8082018082111561057457634e487b7160e01b600052601160045260246000fd5b601081106119f5576119f56117b0565b9052565b6020810161057482846119e5565b6001600160e01b03198416815260608101611a2560208301856119e5565b6001600160a01b03929092166040919091015292915050565b60008060408385031215611a5157600080fd5b82518015158114611a6157600080fd5b6020939093015192949293505050565b6001600160e01b03198316815260408101600b8310611a9257611a926117b0565b826020830152939250505056fea2646970667358221220262d80d2feb74067f3cddee2705a4fff0aac4921a9a54ee2314b0f244bccac3e64736f6c63430008170033", + "nonce": "0x2f129" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CREATE", + "contractName": "PauseEnforcer", + "contractAddress": "0x3a3A92ba9d4D49aae06861136D547667c742F1aF", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x206788", + "value": "0x0", + "data": "0x608060405234801561001057600080fd5b5061001961001e565b6100de565b600254610100900460ff161561008a5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60025460ff90811610156100dc576002805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6111c4806100ed6000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c806391d14854116100a2578063caa6fea411610071578063caa6fea414610240578063d4b8399214610254578063d547741f1461026d578063dcf7bb5c14610280578063f82ec70b1461029357600080fd5b806391d148541461020a578063a217fddf1461021d578063b9f3163b14610225578063ca15c8731461022d57600080fd5b80636833f60d116100e95780636833f60d1461019c57806377a24f36146101a45780637a9ad019146101b75780637d4f7fc9146101cc5780639010d07c146101df57600080fd5b806301ffc9a71461011b578063248a9ca3146101435780632f2ff15d1461017457806336568abe14610189575b600080fd5b61012e610129366004610e11565b6102a6565b60405190151581526020015b60405180910390f35b610166610151366004610e3b565b60009081526020819052604090206001015490565b60405190815260200161013a565b610187610182366004610e79565b6102d1565b005b610187610197366004610e79565b6102fb565b61018761037e565b6101876101b2366004610ebf565b6104da565b61016660008051602061116f83398151915281565b6101876101da366004610fab565b610640565b6101f26101ed366004610fc8565b610663565b6040516001600160a01b03909116815260200161013a565b61012e610218366004610e79565b610682565b610166600081565b6101876106ab565b61016661023b366004610e3b565b610821565b60025461012e90600160b01b900460ff1681565b6002546101f2906201000090046001600160a01b031681565b61018761027b366004610e79565b610838565b61018761028e366004610fab565b61085d565b6101876102a1366004610fab565b610871565b60006001600160e01b03198216635a05180f60e01b14806102cb57506102cb82610894565b92915050565b6000828152602081905260409020600101546102ec816108c9565b6102f683836108d6565b505050565b6001600160a01b03811633146103705760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61037a82826108f8565b5050565b60008051602061116f833981519152610396816108c9565b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af11580156103e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040d9190610fea565b1561042b576040516310067f7560e11b815260040160405180910390fd5b60028054600160b01b60ff60b01b19909116179081905560408051638456cb5960e01b81529051620100009092046001600160a01b031691638456cb599160048082019260009290919082900301818387803b15801561048a57600080fd5b505af115801561049e573d6000803e3d6000fd5b50506040513381527fb8fad2fa0ed7a383e747c309ef2c4391d7b65592a48893e57ccc1fab70791456925060200190505b60405180910390a150565b600254610100900460ff16158080156104fa5750600254600160ff909116105b806105145750303b158015610514575060025460ff166001145b6105775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610367565b6002805460ff19166001179055801561059a576002805461ff0019166101001790555b6105a38461091a565b6105ae600084610972565b60005b82518110156105f3576105eb60008051602061116f8339815191528483815181106105de576105de61100c565b60200260200101516108d6565b6001016105b1565b50801561063a576002805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b600061064b816108c9565b61037a60008051602061116f833981519152836108d6565b600082815260016020526040812061067b908361097c565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008051602061116f8339815191526106c3816108c9565b600254600160b01b900460ff166106ed57604051631b2fd53f60e31b815260040160405180910390fd5b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610740573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107649190610fea565b61078157604051631e87b57b60e31b815260040160405180910390fd5b6002805460ff60b01b19169081905560408051631fa5d41d60e11b81529051620100009092046001600160a01b031691633f4ba83a9160048082019260009290919082900301818387803b1580156107d857600080fd5b505af11580156107ec573d6000803e3d6000fd5b50506040513381527ff5cbf596165cc457b2cd92e8d8450827ee314968160a5696402d75766fc52caf925060200190506104cf565b60008181526001602052604081206102cb90610988565b600082815260208190526040902060010154610853816108c9565b6102f683836108f8565b6000610868816108c9565b61037a8261091a565b600061087c816108c9565b61037a60008051602061116f833981519152836108f8565b60006001600160e01b03198216637965db0b60e01b14806102cb57506301ffc9a760e01b6001600160e01b03198316146102cb565b6108d38133610992565b50565b6108e082826109f6565b60008281526001602052604090206102f69082610a7a565b6109028282610a8f565b60008281526001602052604090206102f69082610af4565b6002805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040519081527f7f8cffd58ac96898bdd25ab64868bd933141d15ad1cd4a0df228fd3fcba2a26d906020016104cf565b61037a82826108d6565b600061067b8383610b09565b60006102cb825490565b61099c8282610682565b61037a576109b4816001600160a01b03166014610b33565b6109bf836020610b33565b6040516020016109d0929190611046565b60408051601f198184030181529082905262461bcd60e51b8252610367916004016110bb565b610a008282610682565b61037a576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610a363390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061067b836001600160a01b038416610ccf565b610a998282610682565b1561037a576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061067b836001600160a01b038416610d1e565b6000826000018281548110610b2057610b2061100c565b9060005260206000200154905092915050565b60606000610b42836002611104565b610b4d90600261111b565b67ffffffffffffffff811115610b6557610b65610ea9565b6040519080825280601f01601f191660200182016040528015610b8f576020820181803683370190505b509050600360fc1b81600081518110610baa57610baa61100c565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610bd957610bd961100c565b60200101906001600160f81b031916908160001a9053506000610bfd846002611104565b610c0890600161111b565b90505b6001811115610c80576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610c3c57610c3c61100c565b1a60f81b828281518110610c5257610c5261100c565b60200101906001600160f81b031916908160001a90535060049490941c93610c798161112e565b9050610c0b565b50831561067b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610367565b6000818152600183016020526040812054610d16575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556102cb565b5060006102cb565b60008181526001830160205260408120548015610e07576000610d42600183611145565b8554909150600090610d5690600190611145565b9050818114610dbb576000866000018281548110610d7657610d7661100c565b9060005260206000200154905080876000018481548110610d9957610d9961100c565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610dcc57610dcc611158565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506102cb565b60009150506102cb565b600060208284031215610e2357600080fd5b81356001600160e01b03198116811461067b57600080fd5b600060208284031215610e4d57600080fd5b5035919050565b6001600160a01b03811681146108d357600080fd5b8035610e7481610e54565b919050565b60008060408385031215610e8c57600080fd5b823591506020830135610e9e81610e54565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600060608486031215610ed457600080fd5b8335610edf81610e54565b9250602084810135610ef081610e54565b9250604085013567ffffffffffffffff80821115610f0d57600080fd5b818701915087601f830112610f2157600080fd5b813581811115610f3357610f33610ea9565b8060051b604051601f19603f83011681018181108582111715610f5857610f58610ea9565b60405291825284820192508381018501918a831115610f7657600080fd5b938501935b82851015610f9b57610f8c85610e69565b84529385019392850192610f7b565b8096505050505050509250925092565b600060208284031215610fbd57600080fd5b813561067b81610e54565b60008060408385031215610fdb57600080fd5b50508035926020909101359150565b600060208284031215610ffc57600080fd5b8151801515811461067b57600080fd5b634e487b7160e01b600052603260045260246000fd5b60005b8381101561103d578181015183820152602001611025565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161107e816017850160208801611022565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516110af816028840160208801611022565b01602801949350505050565b60208152600082518060208401526110da816040850160208701611022565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176102cb576102cb6110ee565b808201808211156102cb576102cb6110ee565b60008161113d5761113d6110ee565b506000190190565b818103818111156102cb576102cb6110ee565b634e487b7160e01b600052603160045260246000fdfe5bea60102f2a7acc9e82b1af0e3bd4069661102bb5dd143a6051cd1980dded1ca26469706673582212205cd579cff7903082498e437ed3eb21f8623bfa7f518ca2799b5e3497b22a08a864736f6c63430008170033", + "nonce": "0x2f12a" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CREATE", + "contractName": "RoninGatewayV3", + "contractAddress": "0x4222384E84C248aa8D50FDC702a1b55E6b4efc99", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x8aad78", + "value": "0x0", + "data": "0x60806040523480156200001157600080fd5b506000805460ff19169055620000266200002c565b620000ee565b603754610100900460ff1615620000995760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60375460ff9081161015620000ec576037805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6150b880620000fe6000396000f3fe6080604052600436106102975760003560e01c80638456cb591161015a578063ca15c873116100c1578063ecc836491161007a578063ecc836491461089f578063f0ce418e146108cc578063f23a6e6114610912578063f668214a1461093e578063fa3896591461095e578063fc6574bc1461097e576102a6565b8063ca15c873146107e7578063d547741f14610807578063dafae40814610827578063dbd2ef6c14610847578063de981f1b14610867578063e75235b814610887576102a6565b8063affed0e011610113578063affed0e0146106e5578063b9afa177146106fb578063b9c362091461071b578063bc197c811461073b578063bc7f038614610774578063c28f7894146107a1576102a6565b80638456cb591461063b578063865e6fd3146106505780639010d07c1461067057806391d14854146106905780639584a592146106b0578063a217fddf146106d0576102a6565b80633f4ba83a116101fe5780635d6a9a90116101b75780635d6a9a901461057257806364363f781461059f57806371706cbe146105bf57806375535f86146105d55780637de5dedd146105f5578063835fc6ca1461060a576102a6565b80633f4ba83a1461048f57806347b56b2c146104a45780634d92c4f0146104c45780635a7dd06a146105255780635c975abb146105455780635cd8a76b1461055d576102a6565b8063248a9ca311610250578063248a9ca3146103b15780632f2ff15d146103ef5780633101cfcb1461040f57806336568abe1461042f5780633e4574ec1461044f5780633e70838b1461046f576102a6565b806301ffc9a7146102ae578063065b3adf146102e35780630b1ff17f1461031b578063109679ef1461033b57806317892f961461035b57806317fa2ea114610384576102a6565b366102a6576102a46109d0565b005b6102a46109d0565b3480156102ba57600080fd5b506102ce6102c9366004613c2d565b6109e9565b60405190151581526020015b60405180910390f35b3480156102ef57600080fd5b50600554610303906001600160a01b031681565b6040516001600160a01b0390911681526020016102da565b34801561032757600080fd5b506102a4610336366004613c57565b610a09565b34801561034757600080fd5b506102a4610356366004613c88565b610a20565b34801561036757600080fd5b506078546079545b604080519283526020830191909152016102da565b34801561039057600080fd5b506103a461039f366004613ce5565b610a53565b6040516102da9190613d26565b3480156103bd57600080fd5b506103e16103cc366004613d60565b6000908152606b602052604090206001015490565b6040519081526020016102da565b3480156103fb57600080fd5b506102a461040a366004613d99565b610d90565b34801561041b57600080fd5b506102a461042a366004613dc9565b610dba565b34801561043b57600080fd5b506102a461044a366004613d99565b610e66565b34801561045b57600080fd5b506102ce61046a366004613d99565b610ee0565b34801561047b57600080fd5b506102a461048a366004613dc9565b610f10565b34801561049b57600080fd5b506102a4610f3a565b3480156104b057600080fd5b506102a46104bf366004613d60565b610f4c565b3480156104d057600080fd5b506105156104df366004613de6565b606f602090815260009283526040808420909152908252902080546001820154600383015460049093015460ff90921692909184565b6040516102da9493929190613e1e565b34801561053157600080fd5b506102a4610540366004613e4e565b611117565b34801561055157600080fd5b5060005460ff166102ce565b34801561056957600080fd5b506102a461117e565b34801561057e57600080fd5b5061059261058d366004613ec8565b611280565b6040516102da9190613f04565b3480156105ab57600080fd5b506102a46105ba366004613f30565b611324565b3480156105cb57600080fd5b506103e1606e5481565b3480156105e157600080fd5b5061036f6105f0366004613de6565b611360565b34801561060157600080fd5b506103e1611381565b34801561061657600080fd5b5061062a610625366004613d60565b611398565b6040516102da959493929190613ff8565b34801561064757600080fd5b506102a461146a565b34801561065c57600080fd5b506102a461066b36600461404e565b61147a565b34801561067c57600080fd5b5061030361068b366004613de6565b611495565b34801561069c57600080fd5b506102ce6106ab366004613d99565b6114ad565b3480156106bc57600080fd5b506102a46106cb36600461408b565b6114d8565b3480156106dc57600080fd5b506103e1600081565b3480156106f157600080fd5b506103e160045481565b34801561070757600080fd5b506103a4610716366004614184565b611625565b34801561072757600080fd5b506102a4610736366004613de6565b611743565b34801561074757600080fd5b50610767610756366004614368565b63bc197c8160e01b95945050505050565b6040516102da9190614415565b34801561078057600080fd5b506103e161078f366004613dc9565b60386020526000908152604090205481565b3480156107ad57600080fd5b506105156107bc366004613d60565b607660205260009081526040902080546001820154600383015460049093015460ff90921692909184565b3480156107f357600080fd5b506103e1610802366004613d60565b611755565b34801561081357600080fd5b506102a4610822366004613d99565b61176c565b34801561083357600080fd5b506102ce610842366004613d60565b611791565b34801561085357600080fd5b506102a461086236600461442a565b6117bd565b34801561087357600080fd5b506103036108823660046144ed565b61180f565b34801561089357600080fd5b5060015460025461036f565b3480156108ab57600080fd5b506108bf6108ba366004614508565b61188a565b6040516102da91906145a3565b3480156108d857600080fd5b506105156108e7366004613d60565b607060205260009081526040902080546001820154600383015460049093015460ff90921692909184565b34801561091e57600080fd5b5061076761092d366004614607565b63f23a6e6160e01b95945050505050565b34801561094a57600080fd5b506102ce610959366004613d60565b6119f1565b34801561096a57600080fd5b506102a4610979366004613f30565b611a1f565b34801561098a57600080fd5b506102ce61099936600461466f565b6000928352606f602090815260408085209385529281528284206001600160a01b0392909216845260029091019052902054151590565b60405163129c2ce160e31b815260040160405180910390fd5b60006109f482611c1a565b80610a035750610a0382611c3f565b92915050565b610a11611c64565b610a1c823383611caa565b5050565b610a28611c64565b610a30611d79565b610a50610a4236839003830183614746565b33610a4b611381565b611e1a565b50565b6060610a5d611d79565b336000610a68611381565b9050600084806001600160401b03811115610a8557610a856141f9565b604051908082528060200260200182016040528015610aae578160200160208202803683370190505b5094506000610abd600361180f565b905060005b82811015610d8457888882818110610adc57610adc6147d7565b905060200201359350816001600160a01b031663c7c4fea9600286896040518463ffffffff1660e01b8152600401610b16939291906147ed565b600060405180830381600087803b158015610b3057600080fd5b505af1158015610b44573d6000803e3d6000fd5b50505050610b51846119f1565b15610b7b576001878281518110610b6a57610b6a6147d7565b911515602092830291909101909101525b600084815260706020908152604080832060718352818420825160a081019093528054835260018082015492959491929184019160ff1690811115610bc257610bc2613e08565b6001811115610bd357610bd3613e08565b815260408051606080820183526002858101546001600160a01b039081168452600387015481166020858101919091526004880154858701528087019490945284518084018652600588015482168152600688015490911693810193909352600786015483850152838501929092528251808201909352600885018054919094019391839160ff1690811115610c6b57610c6b613e08565b6002811115610c7c57610c7c613e08565b81526001820154602082015260029091015460409091015290525090506000610ca482612121565b90506000610cb4848b8b856121eb565b90506001816004811115610cca57610cca613e08565b03610d7557835460ff19166002908117855560405163114fc47560e11b81526001600160a01b0388169163229f88ea91610d0991908c90600401614817565b600060405180830381600087803b158015610d2357600080fd5b505af1158015610d37573d6000803e3d6000fd5b505050507f62520d049932cdee872e9b3c59c0f6073637147e5e9bc8b050b062430eaf5c9f8284604051610d6c92919061482e565b60405180910390a15b50505050806001019050610ac2565b50505050505092915050565b6000828152606b6020526040902060010154610dab8161221e565b610db58383612228565b505050565b603754600390610100900460ff16158015610ddc575060375460ff8083169116105b610e015760405162461bcd60e51b8152600401610df89061488d565b60405180910390fd5b6037805461ffff191660ff831617610100179055610e20600b8361224a565b6037805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b6001600160a01b0381163314610ed65760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610df8565b610a1c82826122ee565b60008281526070602090815260408083206001600160a01b038516845260020190915281205415155b9392505050565b610f18612310565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b610f4261236a565b610f4a6123d9565b565b610f54611c64565b610f5d816119f1565b15610f7b576040516327ddf84960e11b815260040160405180910390fd5b6000818152607160209081526040808320815160a0810190925280548252600180820154929391929184019160ff1690811115610fba57610fba613e08565b6001811115610fcb57610fcb613e08565b815260408051606080820183526002858101546001600160a01b039081168452600387015481166020858101919091526004880154858701528087019490945284518084018652600588015482168152600688015490911693810193909352600786015483850152838501929092528251808201909352600885018054919094019391839160ff169081111561106357611063613e08565b600281111561107457611074613e08565b8152600182015460208201526002909101546040918201529152606083015101519192505046146110de576060810151604090810151905163092048d160e11b81526001600160e01b03196000351660048201526024810191909152466044820152606401610df8565b7f04e8cbd836dea43a2dc7eb19de345cca3a8e6978a2ef5225d924775500f67c7c61110882612121565b82604051610e5a92919061482e565b61111f611c64565b816000819003611142576040516316ee9d3b60e11b815260040160405180910390fd5b60005b818110156111775761116f858583818110611162576111626147d7565b905060a002013385611caa565b600101611145565b5050505050565b603754600290610100900460ff161580156111a0575060375460ff8083169116105b6111bc5760405162461bcd60e51b8152600401610df89061488d565b6037805461ffff191660ff8316176101001790556074546111e8906008906001600160a01b031661224a565b607554611200906003906001600160a01b031661224a565b60775461121890600a906001600160a01b031661224a565b607480546001600160a01b031990811690915560758054821690556077805490911690556037805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b604080518082018252600080825260208083018290526001600160a01b038616825260738152838220858352905282902082518084019093528054919291829060ff1660028111156112d4576112d4613e08565b60028111156112e5576112e5613e08565b815290546001600160a01b0361010090910481166020928301529082015191925016610a0357604051631b79f53b60e21b815260040160405180910390fd5b61132c612310565b600083900361134e576040516316ee9d3b60e11b815260040160405180910390fd5b61135a8484848461242b565b50505050565b60008061136b612310565b611375848461250e565b915091505b9250929050565b600061139361138e612598565b612605565b905090565b607160209081526000918252604091829020805460018201548451606080820187526002808601546001600160a01b03908116845260038701548116848901526004870154848a015288518084018a526005880154821681526006880154909116978101979097526007860154878901528751918201909752600885018054949760ff94851697939693959394929391928492169081111561143c5761143c613e08565b600281111561144d5761144d613e08565b815260200160018201548152602001600282015481525050905085565b61147261236a565b610f4a61263b565b611482612310565b61148b81612678565b610a1c828261224a565b6000828152606c60205260408120610f0990836126ae565b6000918252606b602090815260408084206001600160a01b0393909316845291905290205460ff1690565b603754610100900460ff16158080156114f85750603754600160ff909116105b806115125750303b158015611512575060375460ff166001145b61152e5760405162461bcd60e51b8152600401610df89061488d565b6037805460ff191660011790558015611551576037805461ff0019166101001790555b61155c60008d6126ba565b6115668b8b6126c4565b611570898961250e565b506000905061157f86806148db565b905011156115d1576115b261159486806148db565b6115a160208901896148db565b6115ab89806148db565b8989612754565b6115d16115bf86806148db565b6115cc60208801886148db565b61242b565b8015611617576037805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050505050565b606061162f611c64565b611637611d79565b81806001600160401b03811115611650576116506141f9565b604051908082528060200260200182016040528015611679578160200160208202803683370190505b5091506000611686611381565b9050611690613bc0565b60005b83811015611739578686828181106116ad576116ad6147d7565b905061016002018036038101906116c49190614746565b915060026040808401518101516000908152606f6020908152828220865183529052205460ff1660048111156116fc576116fc613e08565b03611726576001858281518110611715576117156147d7565b911515602092830291909101909101525b611731823385611e1a565b600101611693565b5050505092915050565b61174b612310565b610a1c82826126c4565b6000818152606c60205260408120610a0390612970565b6000828152606b60205260409020600101546117878161221e565b610db583836122ee565b600061179b612598565b6001546117a8919061493a565b6002546117b5908461493a565b101592915050565b6117c5612310565b60008790036117f5576000356001600160e01b0319166040516306b5667560e21b8152600401610df89190614415565b6118058888888888888888612754565b5050505050505050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f81111561184657611846613e08565b60ff1681526020810191909152604001600020546001600160a01b0316905080611885578160405163409140df60e11b8152600401610df89190614951565b919050565b6060816001600160401b038111156118a4576118a46141f9565b6040519080825280602002602001820160405280156118d757816020015b60608152602001906001900390816118c25790505b50905060005b828110156119e957600085815260726020526040812090858584818110611906576119066147d7565b905060200201602081019061191b9190613dc9565b6001600160a01b03166001600160a01b0316815260200190815260200160002080546119469061496b565b80601f01602080910402602001604051908101604052809291908181526020018280546119729061496b565b80156119bf5780601f10611994576101008083540402835291602001916119bf565b820191906000526020600020905b8154815290600101906020018083116119a257829003601f168201915b50505050508282815181106119d6576119d66147d7565b60209081029190910101526001016118dd565b509392505050565b6000600260008381526070602052604090205460ff166004811115611a1857611a18613e08565b1492915050565b611a27611c64565b611a2f611d79565b33838015801590611a3f57508083145b611a6a576000356001600160e01b0319166040516306b5667560e21b8152600401610df89190614415565b6000611a74611381565b9050600080611a83600361180f565b905060005b84811015611c0e57898982818110611aa257611aa26147d7565b905060200201359250878782818110611abd57611abd6147d7565b9050602002810190611acf919061499f565b60008581526072602090815260408083206001600160a01b038c168452909152902091611afd919083614a35565b5060405163c7c4fea960e01b81526001600160a01b0383169063c7c4fea990611b2f9060019087908b906004016147ed565b600060405180830381600087803b158015611b4957600080fd5b505af1158015611b5d573d6000803e3d6000fd5b50505060008481526076602052604081209150611b7c828988886121eb565b90506001816004811115611b9257611b92613e08565b03611c0457815460ff1916600217825560405163114fc47560e11b81526001600160a01b0385169063229f88ea90611bd1906001908990600401614817565b600060405180830381600087803b158015611beb57600080fd5b505af1158015611bff573d6000803e3d6000fd5b505050505b5050600101611a88565b50505050505050505050565b60006001600160e01b03198216635a05180f60e01b1480610a035750610a038261297a565b60006001600160e01b03198216630271189760e51b1480610a035750610a0382611c1a565b60005460ff1615610f4a5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610df8565b611cc4611cbf36859003850160408601614af4565b6129af565b611ccd836129f3565b6000611ce8611ce26040860160208701613dc9565b83611280565b80519091506002811115611cfe57611cfe613e08565b611d0e6060860160408701614b10565b6002811115611d1f57611d1f613e08565b14611d3c5760405162035e2b60ea1b815260040160405180910390fd5b611d6983611d506040870160208801613dc9565b611d6236889003880160408901614af4565b9190612a71565b6111778483858460200151612bfc565b611d83600b61180f565b604051635a02d57960e11b81523360048201526001600160a01b03919091169063b405aaf290602401602060405180830381865afa158015611dc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ded9190614b2b565b610f4a576000356001600160e01b0319166006604051620f948f60ea1b8152600401610df8929190614b4d565b82516080840151611e2a906129af565b600084602001516001811115611e4257611e42613e08565b14611e605760405163182f3d8760e11b815260040160405180910390fd5b4684606001516040015114611eae576060840151604090810151905163092048d160e11b81526001600160e01b03196000351660048201526024810191909152466044820152606401610df8565b6000611eca856060015160200151866040015160400151611280565b6080860151519091506002811115611ee457611ee4613e08565b81516002811115611ef757611ef7613e08565b148015611f2157508460400151602001516001600160a01b031681602001516001600160a01b0316145b611f3e5760405163f4b8742f60e01b815260040160405180910390fd5b6040808601518101516000908152606f6020908152828220858352905290812090611f6887612121565b90506000611f78838888856121eb565b905087604001516040015185886001600160a01b03167f48c4262ed68beb92fe5d7d48d70772e49cd50c317937dea60a99f15f794b645985604051611fbf91815260200190565b60405180910390a46000611fd3600361180f565b90506001826004811115611fe957611fe9613e08565b036120b357835460ff191660021784556060890151805160209091015160808b01516120189290916000612d8e565b885160405163114fc47560e11b81526001600160a01b0383169163229f88ea9161204791600091600401614817565b600060405180830381600087803b15801561206157600080fd5b505af1158015612075573d6000803e3d6000fd5b505050507f8d20d8121a34dded9035ff5b43e901c142824f7a22126392992c353c37890524838a6040516120aa92919061482e565b60405180910390a15b885160405163c7c4fea960e01b81526001600160a01b0383169163c7c4fea9916120e4916000918d906004016147ed565b600060405180830381600087803b1580156120fe57600080fd5b505af1158015612112573d6000803e3d6000fd5b50505050505050505050505050565b6000806121318360400151612fa7565b905060006121428460600151612fa7565b905060006121968560800151604080517f1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d815282516020808301919091528301518183015291015160608201526080902090565b604080517fb9d1fe7c9deeec5dc90a2f47ff1684239519f2545b2228d3d91fb27df3189eea815287516020808301919091529097015190870152606086019390935250608084015260a08301525060c0902090565b60006121f8858584612fef565b600061220486846130a5565b9050612212868583866131a9565b9150505b949350505050565b610a5081336131f5565b6122328282613259565b6000828152606c60205260409020610db590826132df565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f81111561228057612280613e08565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f8111156122c1576122c1613e08565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b6122f882826132f4565b6000828152606c60205260409020610db5908261335b565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610f4a576000356001600160e01b0319166001604051620f948f60ea1b8152600401610df8929190614b4d565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314806123ac57506005546001600160a01b031633145b610f4a576000356001600160e01b0319166001604051620f948f60ea1b8152600401610df8929190614b4d565b6123e1613370565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b828114612459576000356001600160e01b0319166040516306b5667560e21b8152600401610df89190614415565b60005b838110156124ca57828282818110612476576124766147d7565b9050602002013560386000878785818110612493576124936147d7565b90506020020160208101906124a89190613dc9565b6001600160a01b0316815260208101919091526040016000205560010161245c565b507f6f52f53a938df83439fa4c6055c7df0a6906d621aa6dfa4708187037fdfc41da848484846040516125009493929190614bf6565b60405180910390a150505050565b600080828411156125325760405163964a4d2760e01b815260040160405180910390fd5b505060018054600254607885905560798490556004805493840190556040805183815260208101839052929391928592879290917feac82d4d949d2d4f77f96aa68ab6b1bb750da73f14e55d41a1b93f387471ecba910160405180910390a49250929050565b60006125a4600b61180f565b6001600160a01b03166306aba0e16040518163ffffffff1660e01b8152600401602060405180830381865afa1580156125e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113939190614c28565b600060025460016002548460015461261d919061493a565b6126279190614c41565b6126319190614c54565b610a039190614c67565b612643611c64565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861240e3390565b806001600160a01b03163b600003610a5057604051630bfc64a360e21b81526001600160a01b0382166004820152602401610df8565b6000610f0983836133b9565b610a1c8282612228565b808211156126f3576000356001600160e01b0319166040516387f6f09560e01b8152600401610df89190614415565b6001805460028054858455908490556004805493840190556040805183815260208101839052929391928592879290917f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a450505050565b868514801561276257508683145b61278d576000356001600160e01b0319166040516306b5667560e21b8152600401610df89190614415565b60005b87811015612920578686828181106127aa576127aa6147d7565b90506020020160208101906127bf9190613dc9565b607360008b8b858181106127d5576127d56147d7565b90506020020160208101906127ea9190613dc9565b6001600160a01b03166001600160a01b03168152602001908152602001600020600087878581811061281e5761281e6147d7565b90506020020135815260200190815260200160002060000160016101000a8154816001600160a01b0302191690836001600160a01b0316021790555082828281811061286c5761286c6147d7565b90506020020160208101906128819190614b10565b607360008b8b85818110612897576128976147d7565b90506020020160208101906128ac9190613dc9565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008787858181106128e0576128e06147d7565b60209081029290920135835250810191909152604001600020805460ff1916600183600281111561291357612913613e08565b0217905550600101612790565b507f2544bff60c6d5b84946e06804af9f84e150bbee85238dbdee79efca4e0adf401888888888888888860405161295e989796959493929190614c89565b60405180910390a15050505050505050565b6000610a03825490565b60006001600160e01b03198216637965db0b60e01b1480610a0357506301ffc9a760e01b6001600160e01b0319831614610a03565b6129b8816133e3565b806129c757506129c78161341a565b806129d657506129d681613442565b610a505760405163034992a760e51b815260040160405180910390fd5b6000612a056060830160408401614b10565b6002811115612a1657612a16613e08565b148015612a53575060386000612a326040840160208501613dc9565b6001600160a01b031681526020810191909152604001600020546080820135105b15610a5057604051636eff4a8560e11b815260040160405180910390fd5b600060608185516002811115612a8957612a89613e08565b03612b645760408581015181516001600160a01b03878116602483015230604483015260648083019390935283518083039093018352608490910183526020820180516001600160e01b03166323b872dd60e01b179052915191851691612af09190614d18565b6000604051808303816000865af19150503d8060008114612b2d576040519150601f19603f3d011682016040523d82523d6000602084013e612b32565b606091505b509092509050818015612b5d575080511580612b5d575080806020019051810190612b5d9190614b2b565b9150612bd6565b600185516002811115612b7957612b79613e08565b03612b8e57612b5d838530886020015161346b565b600285516002811115612ba357612ba3613e08565b03612bbd57612b5d83853088602001518960400151613519565b6040516361e411a760e11b815260040160405180910390fd5b816111775784843085604051639d2e4c6760e01b8152600401610df89493929190614d34565b606e805460009182612c0d83614d6a565b9091555090506000612c3484838588612c2b368c90038c018c614d83565b939291906135cd565b60008381526071602090815260409091208251815590820151600180830180549495508594909160ff19909116908381811115612c7357612c73613e08565b02179055506040828101518051600280850180546001600160a01b039384166001600160a01b03199182161790915560208085015160038801805491861691841691909117905593850151600487015560608701518051600588018054918616918416919091179055938401516006870180549190941691161790915591015160078301556080830151805160088401805492939092839160ff19909116906001908490811115612d2657612d26613e08565b0217905550602082015181600101556040820151816002015550509050507ff313c253a5be72c29d0deb2c8768a9543744ac03d6b3cafd50cc976f1c2632fc612d6e82612121565b82604051612d7d92919061482e565b60405180910390a150949350505050565b806001600160a01b0316826001600160a01b031603612e3b5760408085015190516001600160a01b0385169180156108fc02916000818181858888f19350505050612e3657806001600160a01b031663d0e30db085604001516040518263ffffffff1660e01b81526004016000604051808303818588803b158015612e1257600080fd5b505af1158015612e26573d6000803e3d6000fd5b5050505050612e36848484613639565b61135a565b600084516002811115612e5057612e50613e08565b03612f16576040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa158015612e9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ec09190614c28565b90508460400151811015612f0557612ee88330838860400151612ee39190614c54565b6136b8565b612f0557604051632f739fff60e11b815260040160405180910390fd5b612f10858585613639565b5061135a565b600184516002811115612f2b57612f2b613e08565b03612f5c57612f3f8284866020015161375d565b612e365760405163c8e3a09f60e01b815260040160405180910390fd5b600284516002811115612f7157612f71613e08565b03612bbd57612f8a828486602001518760400151613784565b612e36576040516334b471a760e21b815260040160405180910390fd5b604080517f353bdd8d69b9e3185b3972e08b03845c0c14a21a390215302776a7a34b0e8764815282516020808301919091528301518183015291015160608201526080902090565b60008360030154118015613007575042836003015411155b1561301857825460ff191660041783555b6001600160a01b03821660009081526002840160205260409020541561305c5760405163025fd59560e41b81526001600160a01b0383166004820152602401610df8565b6001600160a01b039091166000818152600284016020908152604082209390935560059093018054600181018255908452919092200180546001600160a01b0319169091179055565b60008060006130b4600b61180f565b6001600160a01b031663c441c4a86040518163ffffffff1660e01b8152600401600060405180830381865afa1580156130f1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526131199190810190614e3e565b81519194509250905060005b818110156117395785876002016000868481518110613146576131466147d7565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002054036131a157828181518110613186576131866147d7565b60200260200101516bffffffffffffffffffffffff16850194505b600101613125565b60008383101580156131d057506000855460ff1660048111156131ce576131ce613e08565b145b156131e857845460ff19166001908117865585018290555b5050915460ff1692915050565b6131ff82826114ad565b610a1c57613217816001600160a01b031660146137ad565b6132228360206137ad565b604051602001613233929190614f36565b60408051601f198184030181529082905262461bcd60e51b8252610df891600401614fab565b61326382826114ad565b610a1c576000828152606b602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561329b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610f09836001600160a01b038416613948565b6132fe82826114ad565b15610a1c576000828152606b602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610f09836001600160a01b038416613997565b60005460ff16610f4a5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610df8565b60008260000182815481106133d0576133d06147d7565b9060005260206000200154905092915050565b600080825160028111156133f9576133f9613e08565b14801561340a575060008260400151115b8015610a03575050602001511590565b600060018251600281111561343157613431613e08565b148015610a03575050604001511590565b600060028251600281111561345957613459613e08565b148015610a0357505060400151151590565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928716916134cb91614d18565b6000604051808303816000865af19150503d8060008114613508576040519150601f19603f3d011682016040523d82523d6000602084013e61350d565b606091505b50909695505050505050565b604080516000808252602082019092526001600160a01b0387169061354990879087908790879060448101614fbe565b60408051601f198184030181529181526020820180516001600160e01b0316637921219560e11b1790525161357e9190614d18565b6000604051808303816000865af19150503d80600081146135bb576040519150601f19603f3d011682016040523d82523d6000602084013e6135c0565b606091505b5090979650505050505050565b6135d5613bc0565b92835260016020808501919091526060840180516001600160a01b0396871690528682015181519087169083015251466040918201528651818601805191881690915280519490961693909101929092529251810192909252910151608082015290565b6000808451600281111561364f5761364f613e08565b0361366a5761366382848660400151613a8a565b9050613694565b60018451600281111561367f5761367f613e08565b03612bbd57613663823085876020015161346b565b8061135a578383836040516341bd7d9160e11b8152600401610df893929190614ff8565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b03166340c10f1960e01b179052915160009286169161371091614d18565b6000604051808303816000865af19150503d806000811461374d576040519150601f19603f3d011682016040523d82523d6000602084013e613752565b606091505b509095945050505050565b600061376b8430858561346b565b905080610f095761377d8484846136b8565b9050610f09565b60006137938530868686613519565b905080612216576137a685858585613b5d565b9050612216565b606060006137bc83600261493a565b6137c7906002614c41565b6001600160401b038111156137de576137de6141f9565b6040519080825280601f01601f191660200182016040528015613808576020820181803683370190505b509050600360fc1b81600081518110613823576138236147d7565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613852576138526147d7565b60200101906001600160f81b031916908160001a905350600061387684600261493a565b613881906001614c41565b90505b60018111156138f9576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106138b5576138b56147d7565b1a60f81b8282815181106138cb576138cb6147d7565b60200101906001600160f81b031916908160001a90535060049490941c936138f281615028565b9050613884565b508315610f095760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610df8565b600081815260018301602052604081205461398f57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610a03565b506000610a03565b60008181526001830160205260408120548015613a805760006139bb600183614c54565b85549091506000906139cf90600190614c54565b9050818114613a345760008660000182815481106139ef576139ef6147d7565b9060005260206000200154905080876000018481548110613a1257613a126147d7565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613a4557613a4561503f565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610a03565b6000915050610a03565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b179052915160009260609290871691613ae79190614d18565b6000604051808303816000865af19150503d8060008114613b24576040519150601f19603f3d011682016040523d82523d6000602084013e613b29565b606091505b509092509050818015613b54575080511580613b54575080806020019051810190613b549190614b2b565b95945050505050565b604080516000808252602082019092526001600160a01b03861690613b8b9086908690869060448101615055565b60408051601f198184030181529181526020820180516001600160e01b031663731133e960e01b179052516134cb9190614d18565b6040805160a08101825260008082526020808301829052835160608082018652838252818301849052818601849052848601919091528451808201865283815280830184905280860184905281850152845190810185528281529081018290529283015290608082015290565b600060208284031215613c3f57600080fd5b81356001600160e01b031981168114610f0957600080fd5b60008082840360c0811215613c6b57600080fd5b60a0811215613c7957600080fd5b50919360a08501359350915050565b60006101608284031215613c9b57600080fd5b50919050565b60008083601f840112613cb357600080fd5b5081356001600160401b03811115613cca57600080fd5b6020830191508360208260051b850101111561137a57600080fd5b60008060208385031215613cf857600080fd5b82356001600160401b03811115613d0e57600080fd5b613d1a85828601613ca1565b90969095509350505050565b6020808252825182820181905260009190848201906040850190845b8181101561350d578351151583529284019291840191600101613d42565b600060208284031215613d7257600080fd5b5035919050565b6001600160a01b0381168114610a5057600080fd5b803561188581613d79565b60008060408385031215613dac57600080fd5b823591506020830135613dbe81613d79565b809150509250929050565b600060208284031215613ddb57600080fd5b8135610f0981613d79565b60008060408385031215613df957600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b6080810160058610613e3257613e32613e08565b9481526020810193909352604083019190915260609091015290565b600080600060408486031215613e6357600080fd5b83356001600160401b0380821115613e7a57600080fd5b818601915086601f830112613e8e57600080fd5b813581811115613e9d57600080fd5b87602060a083028501011115613eb257600080fd5b6020928301989097509590910135949350505050565b60008060408385031215613edb57600080fd5b8235613ee681613d79565b946020939093013593505050565b60038110610a5057610a50613e08565b81516040820190613f1481613ef4565b82526020928301516001600160a01b0316929091019190915290565b60008060008060408587031215613f4657600080fd5b84356001600160401b0380821115613f5d57600080fd5b613f6988838901613ca1565b90965094506020870135915080821115613f8257600080fd5b50613f8f87828801613ca1565b95989497509550505050565b60028110613fab57613fab613e08565b9052565b80516001600160a01b03908116835260208083015190911690830152604090810151910152565b8051613fe181613ef4565b825260208181015190830152604090810151910152565b858152610160810161400d6020830187613f9b565b61401a6040830186613faf565b61402760a0830185613faf565b614035610100830184613fd6565b9695505050505050565b80356010811061188557600080fd5b6000806040838503121561406157600080fd5b61406a8361403f565b91506020830135613dbe81613d79565b8060408101831015610a0357600080fd5b60008060008060008060008060008060006101208c8e0312156140ad57600080fd5b6140b68c613d8e565b9a5060208c0135995060408c0135985060608c0135975060808c013596506001600160401b038060a08e013511156140ed57600080fd5b6140fd8e60a08f01358f01613ca1565b909750955060c08d013581101561411357600080fd5b6141238e60c08f01358f0161407a565b94508060e08e0135111561413657600080fd5b6141468e60e08f01358f0161407a565b9350806101008e0135111561415a57600080fd5b5061416c8d6101008e01358e01613ca1565b81935080925050509295989b509295989b9093969950565b6000806020838503121561419757600080fd5b82356001600160401b03808211156141ae57600080fd5b818501915085601f8301126141c257600080fd5b8135818111156141d157600080fd5b866020610160830285010111156141e757600080fd5b60209290920196919550909350505050565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715614231576142316141f9565b60405290565b604051601f8201601f191681016001600160401b038111828210171561425f5761425f6141f9565b604052919050565b60006001600160401b03821115614280576142806141f9565b5060051b60200190565b600082601f83011261429b57600080fd5b813560206142b06142ab83614267565b614237565b8083825260208201915060208460051b8701019350868411156142d257600080fd5b602086015b848110156142ee57803583529183019183016142d7565b509695505050505050565b600082601f83011261430a57600080fd5b81356001600160401b03811115614323576143236141f9565b614336601f8201601f1916602001614237565b81815284602083860101111561434b57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561438057600080fd5b853561438b81613d79565b9450602086013561439b81613d79565b935060408601356001600160401b03808211156143b757600080fd5b6143c389838a0161428a565b945060608801359150808211156143d957600080fd5b6143e589838a0161428a565b935060808801359150808211156143fb57600080fd5b50614408888289016142f9565b9150509295509295909350565b6001600160e01b031991909116815260200190565b6000806000806000806000806080898b03121561444657600080fd5b88356001600160401b038082111561445d57600080fd5b6144698c838d01613ca1565b909a50985060208b013591508082111561448257600080fd5b61448e8c838d01613ca1565b909850965060408b01359150808211156144a757600080fd5b6144b38c838d01613ca1565b909650945060608b01359150808211156144cc57600080fd5b506144d98b828c01613ca1565b999c989b5096995094979396929594505050565b6000602082840312156144ff57600080fd5b610f098261403f565b60008060006040848603121561451d57600080fd5b8335925060208401356001600160401b0381111561453a57600080fd5b61454686828701613ca1565b9497909650939450505050565b60005b8381101561456e578181015183820152602001614556565b50506000910152565b6000815180845261458f816020860160208601614553565b601f01601f19169290920160200192915050565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b828110156145fa57603f198886030184526145e8858351614577565b945092850192908501906001016145cc565b5092979650505050505050565b600080600080600060a0868803121561461f57600080fd5b853561462a81613d79565b9450602086013561463a81613d79565b9350604086013592506060860135915060808601356001600160401b0381111561466357600080fd5b614408888289016142f9565b60008060006060848603121561468457600080fd5b8335925060208401359150604084013561469d81613d79565b809150509250925092565b6000606082840312156146ba57600080fd5b6146c261420f565b905081356146cf81613d79565b815260208201356146df81613d79565b806020830152506040820135604082015292915050565b80356003811061188557600080fd5b60006060828403121561471757600080fd5b61471f61420f565b905061472a826146f6565b8152602082013560208201526040820135604082015292915050565b6000610160828403121561475957600080fd5b60405160a081018181106001600160401b038211171561477b5761477b6141f9565b6040528235815260208301356002811061479457600080fd5b60208201526147a684604085016146a8565b60408201526147b88460a085016146a8565b60608201526147cb846101008501614705565b60808201529392505050565b634e487b7160e01b600052603260045260246000fd5b606081016147fa85613ef4565b93815260208101929092526001600160a01b031660409091015290565b6040810161482484613ef4565b9281526020015290565b6000610180820190508382528251602083015260208301516148536040840182613f9b565b5060408301516148666060840182613faf565b50606083015161487960c0840182613faf565b5060808301516119e9610120840182613fd6565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6000808335601e198436030181126148f257600080fd5b8301803591506001600160401b0382111561490c57600080fd5b6020019150600581901b360382131561137a57600080fd5b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610a0357610a03614924565b602081016010831061496557614965613e08565b91905290565b600181811c9082168061497f57607f821691505b602082108103613c9b57634e487b7160e01b600052602260045260246000fd5b6000808335601e198436030181126149b657600080fd5b8301803591506001600160401b038211156149d057600080fd5b60200191503681900382131561137a57600080fd5b601f821115610db5576000816000526020600020601f850160051c81016020861015614a0e5750805b601f850160051c820191505b81811015614a2d57828155600101614a1a565b505050505050565b6001600160401b03831115614a4c57614a4c6141f9565b614a6083614a5a835461496b565b836149e5565b6000601f841160018114614a945760008515614a7c5750838201355b600019600387901b1c1916600186901b178355611177565b600083815260209020601f19861690835b82811015614ac55786850135825560209485019460019092019101614aa5565b5086821015614ae25760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b600060608284031215614b0657600080fd5b610f098383614705565b600060208284031215614b2257600080fd5b610f09826146f6565b600060208284031215614b3d57600080fd5b81518015158114610f0957600080fd5b6001600160e01b03198316815260408101600b8310614b6e57614b6e613e08565b8260208301529392505050565b8183526000602080850194508260005b85811015614bb9578135614b9e81613d79565b6001600160a01b031687529582019590820190600101614b8b565b509495945050505050565b81835260006001600160fb1b03831115614bdd57600080fd5b8260051b80836020870137939093016020019392505050565b604081526000614c0a604083018688614b7b565b8281036020840152614c1d818587614bc4565b979650505050505050565b600060208284031215614c3a57600080fd5b5051919050565b80820180821115610a0357610a03614924565b81810381811115610a0357610a03614924565b600082614c8457634e487b7160e01b600052601260045260246000fd5b500490565b608081526000614c9d608083018a8c614b7b565b60208382036020850152614cb2828a8c614b7b565b91508382036040850152614cc782888a614bc4565b848103606086015285815286925060200160005b86811015614d0757614cec846146f6565b614cf581613ef4565b82529282019290820190600101614cdb565b509c9b505050505050505050505050565b60008251614d2a818460208701614553565b9190910192915050565b60c08101614d428287613fd6565b6001600160a01b0394851660608301529284166080820152921660a090920191909152919050565b600060018201614d7c57614d7c614924565b5060010190565b600060a08284031215614d9557600080fd5b614d9d61420f565b8235614da881613d79565b81526020830135614db881613d79565b6020820152614dca8460408501614705565b60408201529392505050565b600082601f830112614de757600080fd5b81516020614df76142ab83614267565b8083825260208201915060208460051b870101935086841115614e1957600080fd5b602086015b848110156142ee578051614e3181613d79565b8352918301918301614e1e565b600080600060608486031215614e5357600080fd5b83516001600160401b0380821115614e6a57600080fd5b614e7687838801614dd6565b9450602091508186015181811115614e8d57600080fd5b614e9988828901614dd6565b945050604086015181811115614eae57600080fd5b86019050601f81018713614ec157600080fd5b8051614ecf6142ab82614267565b81815260059190911b82018301908381019089831115614eee57600080fd5b928401925b82841015614f275783516bffffffffffffffffffffffff81168114614f185760008081fd5b82529284019290840190614ef3565b80955050505050509250925092565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351614f6e816017850160208801614553565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351614f9f816028840160208801614553565b01602801949350505050565b602081526000610f096020830184614577565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090614c1d90830184614577565b60a081016150068286613fd6565b6001600160a01b03938416606083015291909216608090920191909152919050565b60008161503757615037614924565b506000190190565b634e487b7160e01b600052603160045260246000fd5b60018060a01b0385168152836020820152826040820152608060608201526000614035608083018461457756fea2646970667358221220f2c96cbb22626006ee11ff90975b91b23886e548ed7a61504409d1948b356f0f64736f6c63430008170033", + "nonce": "0x2f12b" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0xd24d87ddc1917165435b306aac68d99e0f49a3fa", + "to": "0xb0507f2f22697022ecb25963a00d3d076dac5753", + "gas": "0x8fcf4", + "value": "0x0", + "data": "0x663ac01100000000000000000000000000000000000000000000000000000000663074ca00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000054000000000000000000000000000000000000000000000000000000000000010a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000110000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000003a00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000046000000000000000000000000000000000000000000000000000000000000005400000000000000000000000000000000000000000000000000000000000000620000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000007e0000000000000000000000000000000000000000000000000000000000000084000000000000000000000000000000000000000000000000000000000000008a00000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000000000096000000000000000000000000000000000000000000000000000000000000009c00000000000000000000000000000000000000000000000000000000000000ac00000000000000000000000000000000000000000000000000000000000000b2000000000000000000000000000000000000000000000000000000000000000844f1ef286000000000000000000000000836d911c7de3edfc953030b9abc4b2b18b2db8b9000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000045cd8a76b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000007beb0f3fc4002c4542015cfa9023dee1a9ec94000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe6000000000000000000000000b03e29be08e57b2d95fe9f94966cb86a0dd984810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000004222384e84c248aa8d50fdc702a1b55e6b4efc990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000003a3a92ba9d4d49aae06861136d547667c742f1af0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c44bb5274a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006435da8121000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x262" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0xb033ba62ec622dc54d0abfe0254e79692147ca26", + "to": "0xb0507f2f22697022ecb25963a00d3d076dac5753", + "gas": "0x4956e", + "value": "0x0", + "data": "0xa8a0e32c00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000007e500000000000000000000000000000000000000000000000000000000663074ca00000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000010c000000000000000000000000000000000000000000000000000000000000000110000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000003a00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000046000000000000000000000000000000000000000000000000000000000000005400000000000000000000000000000000000000000000000000000000000000620000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000007e0000000000000000000000000000000000000000000000000000000000000084000000000000000000000000000000000000000000000000000000000000008a00000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000000000096000000000000000000000000000000000000000000000000000000000000009c00000000000000000000000000000000000000000000000000000000000000ac00000000000000000000000000000000000000000000000000000000000000b2000000000000000000000000000000000000000000000000000000000000000844f1ef286000000000000000000000000836d911c7de3edfc953030b9abc4b2b18b2db8b9000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000045cd8a76b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000007beb0f3fc4002c4542015cfa9023dee1a9ec94000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe6000000000000000000000000b03e29be08e57b2d95fe9f94966cb86a0dd984810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000004222384e84c248aa8d50fdc702a1b55e6b4efc990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000003a3a92ba9d4d49aae06861136d547667c742f1af0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c44bb5274a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006435da8121000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x65" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x087d08e3ba42e64e3948962dd1371f906d1278b9", + "to": "0xb0507f2f22697022ecb25963a00d3d076dac5753", + "gas": "0x10cf46", + "value": "0x0", + "data": "0xa8a0e32c00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000007e500000000000000000000000000000000000000000000000000000000663074ca00000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000010c000000000000000000000000000000000000000000000000000000000000000110000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000003a00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000046000000000000000000000000000000000000000000000000000000000000005400000000000000000000000000000000000000000000000000000000000000620000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000007e0000000000000000000000000000000000000000000000000000000000000084000000000000000000000000000000000000000000000000000000000000008a00000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000000000096000000000000000000000000000000000000000000000000000000000000009c00000000000000000000000000000000000000000000000000000000000000ac00000000000000000000000000000000000000000000000000000000000000b2000000000000000000000000000000000000000000000000000000000000000844f1ef286000000000000000000000000836d911c7de3edfc953030b9abc4b2b18b2db8b9000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000045cd8a76b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000007beb0f3fc4002c4542015cfa9023dee1a9ec94000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe6000000000000000000000000b03e29be08e57b2d95fe9f94966cb86a0dd984810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000004222384e84c248aa8d50fdc702a1b55e6b4efc990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000003a3a92ba9d4d49aae06861136d547667c742f1af0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c44bb5274a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006435da8121000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x5a" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "transactionHash": "0x1467e2ab29e7b30da58b2651b5e1385992f17526838467aced5d2eab819d5688", + "transactionIndex": "0x0", + "blockHash": "0xffec7c7da845eccb01d1004dafa29ff8bc2fd666e8240677855015b16d12e2c0", + "blockNumber": "0x1949658", + "from": "0x52ec2e6BBcE45AfFF8955Da6410bb13812F4289F", + "to": "0x53Ea388CB72081A3a397114a43741e7987815896", + "cumulativeGasUsed": "0x35243", + "gasUsed": "0x35243", + "contractAddress": null, + "logs": [ + { + "address": "0x53Ea388CB72081A3a397114a43741e7987815896", + "topics": [ + "0xa57d40f1496988cf60ab7c9d5ba4ff83647f67d3898d441a3aaf21b651678fd9", + "0x00000000000000000000000000000000000000000000000000000000000007e5", + "0x000000000000000000000000000000000000000000000000000000000000002d", + "0xc3d2b68e9a7c0ec3a1a5df197f5a38348c52edd72740f605436476faa32cab1c" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000004000000000000000000000000052ec2e6bbce45afff8955da6410bb13812f4289f000000000000000000000000000000000000000000000000000000000000002d00000000000000000000000000000000000000000000000000000000000007e500000000000000000000000000000000000000000000000000000000663074ca00000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000010000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab95000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000248f283970000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac575300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000f4240", + "blockHash": "0xffec7c7da845eccb01d1004dafa29ff8bc2fd666e8240677855015b16d12e2c0", + "blockNumber": "0x1949658", + "transactionHash": "0x1467e2ab29e7b30da58b2651b5e1385992f17526838467aced5d2eab819d5688", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + }, + { + "address": "0x53Ea388CB72081A3a397114a43741e7987815896", + "topics": [ + "0x1203f9e81c814a35f5f4cc24087b2a24c6fb7986a9f1406b68a9484882c93a23", + "0xc3d2b68e9a7c0ec3a1a5df197f5a38348c52edd72740f605436476faa32cab1c", + "0x00000000000000000000000052ec2e6bbce45afff8955da6410bb13812f4289f" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064", + "blockHash": "0xffec7c7da845eccb01d1004dafa29ff8bc2fd666e8240677855015b16d12e2c0", + "blockNumber": "0x1949658", + "transactionHash": "0x1467e2ab29e7b30da58b2651b5e1385992f17526838467aced5d2eab819d5688", + "transactionIndex": "0x0", + "logIndex": "0x1", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000010000000000100000000000000000000000000000080000000020000000002000000004000000000000000000000000000000000400000000000000000004000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000040000000000000000000000000000000000001000000000000000000000000008000000000000000000400000000000010000002000000000000000000000000000800000000000000000000000000000000400000000000000000004000000000000000080000000000000000000004000000000000", + "type": "0x0", + "effectiveGasPrice": "0x4a817c800" + }, + { + "transactionHash": "0xa58405e67e2e6558de328d173bce7db193836183c1303351bf95c59fbcb7d78f", + "transactionIndex": "0x1", + "blockHash": "0x6427eebf0bf5f2ad49256ce4267f797fdd1b0e0fd99f968bc484311ce6fdc0d3", + "blockNumber": "0x194965a", + "from": "0x087D08e3ba42e64E3948962dd1371F906D1278b9", + "to": "0x53Ea388CB72081A3a397114a43741e7987815896", + "cumulativeGasUsed": "0x45b13", + "gasUsed": "0x1f54a", + "contractAddress": null, + "logs": [ + { + "address": "0x53Ea388CB72081A3a397114a43741e7987815896", + "topics": [ + "0x1203f9e81c814a35f5f4cc24087b2a24c6fb7986a9f1406b68a9484882c93a23", + "0xc3d2b68e9a7c0ec3a1a5df197f5a38348c52edd72740f605436476faa32cab1c", + "0x000000000000000000000000087d08e3ba42e64e3948962dd1371f906d1278b9" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064", + "blockHash": "0x6427eebf0bf5f2ad49256ce4267f797fdd1b0e0fd99f968bc484311ce6fdc0d3", + "blockNumber": "0x194965a", + "transactionHash": "0xa58405e67e2e6558de328d173bce7db193836183c1303351bf95c59fbcb7d78f", + "transactionIndex": "0x1", + "logIndex": "0x4", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000020000000000000000004000000000000400000000000000000000000000000000000000004000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000800000000000400000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000080000000000000000000004000000000000", + "type": "0x0", + "effectiveGasPrice": "0x4a817c800" + }, + { + "transactionHash": "0xbefcfe4868f0c8e4482deaa0f523cff58ea8d18dca1e399e3c980039786e71d8", + "transactionIndex": "0x0", + "blockHash": "0x3a2de8e12ac13f0ce1594844697c72ffedced5cb9aec464d118720c2378ce590", + "blockNumber": "0x194976c", + "from": "0x06f8Af58F656B507918d91B0B6F8B89bfCC556f9", + "to": "0x53Ea388CB72081A3a397114a43741e7987815896", + "cumulativeGasUsed": "0x1f54a", + "gasUsed": "0x1f54a", + "contractAddress": null, + "logs": [ + { + "address": "0x53Ea388CB72081A3a397114a43741e7987815896", + "topics": [ + "0x1203f9e81c814a35f5f4cc24087b2a24c6fb7986a9f1406b68a9484882c93a23", + "0xc3d2b68e9a7c0ec3a1a5df197f5a38348c52edd72740f605436476faa32cab1c", + "0x00000000000000000000000006f8af58f656b507918d91b0b6f8b89bfcc556f9" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064", + "blockHash": "0x3a2de8e12ac13f0ce1594844697c72ffedced5cb9aec464d118720c2378ce590", + "blockNumber": "0x194976c", + "transactionHash": "0xbefcfe4868f0c8e4482deaa0f523cff58ea8d18dca1e399e3c980039786e71d8", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000020000000000001000004000000000000000000000000000000000000000000000000000004000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000004000000000001000080000000000000000000004000000000000", + "type": "0x0", + "effectiveGasPrice": "0x4a817c800" + } + ], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1713251065, + "chain": 2021, + "multi": false, + "commit": "299b38b" +} \ No newline at end of file diff --git a/broadcast/20240411-p2-upgrade-bridge-ronin-chain.s.sol/2021/run-1713252455.json b/broadcast/20240411-p2-upgrade-bridge-ronin-chain.s.sol/2021/run-1713252455.json new file mode 100644 index 00000000..4cec20cf --- /dev/null +++ b/broadcast/20240411-p2-upgrade-bridge-ronin-chain.s.sol/2021/run-1713252455.json @@ -0,0 +1,776 @@ +{ + "transactions": [ + { + "hash": "0x0206aa397c251997e5fef0b9533415b0e0400594367f9203456e008d05499501", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x53Ea388CB72081A3a397114a43741e7987815896", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0xe1100401454b5f850b09f3b92ce7f071c5f1cef4", + "to": "0x53ea388cb72081a3a397114a43741e7987815896", + "gas": "0x989680", + "value": "0x0", + "data": "0xa8a0e32c00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002d00000000000000000000000000000000000000000000000000000000000007e500000000000000000000000000000000000000000000000000000000663074ca00000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000010000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab95000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000248f283970000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac575300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x1" + }, + "additionalContracts": [], + "isFixedGasLimit": true + }, + { + "hash": "0x88a3b563a8bda1da038e94a90d37b8c03d4383ec602b892ecfc2bc414d11fa93", + "transactionType": "CREATE", + "contractName": "BridgeReward", + "contractAddress": "0x7bEB0f3fC4002C4542015cFa9023dEE1A9EC9400", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x2b9610", + "value": "0x0", + "data": "0x60a060405230608052610010610015565b6100d5565b600054610100900460ff16156100815760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156100d3576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6080516118666100f06000396000610bc701526118666000f3fe6080604052600436106100dd5760003560e01c80638f7c34a21161007f578063ad43663e11610059578063ad43663e14610261578063b77f2a4014610276578063de981f1b14610296578063f5dbc4ee146102ce57600080fd5b80638f7c34a21461021957806395b6ef0c1461022e578063a6bd67881461024157600080fd5b80633b154455116100bb5780633b154455146101c757806359f778df146101dc5780635cd8a76b146101e4578063865e6fd3146101f957600080fd5b806306032d74146100e257806333b3ea6c1461018257806334087952146101a4575b600080fd5b3480156100ee57600080fd5b506101626100fd366004611335565b604080518082018252600080825260209182018190526001600160a01b039390931683527f518cfd198acbffe95e740cfce1af28a3f7de51f0d784893d3d72c5cc59d7062a815291819020815180830190925280548252600101549181019190915290565b604080518251815260209283015192810192909252015b60405180910390f35b34801561018e57600080fd5b506101a261019d366004611352565b6102e3565b005b3480156101b057600080fd5b506101b9610399565b604051908152602001610179565b3480156101d357600080fd5b506101a26103c8565b6101a26104bb565b3480156101f057600080fd5b506101a26104c5565b34801561020557600080fd5b506101a261021436600461137a565b610593565b34801561022557600080fd5b506101b96105ae565b6101a261023c3660046113b1565b6105c6565b34801561024d57600080fd5b506101a261025c366004611352565b6106e9565b34801561026d57600080fd5b506101b96106fd565b34801561028257600080fd5b506101a2610291366004611352565b610727565b3480156102a257600080fd5b506102b66102b136600461142a565b61073d565b6040516001600160a01b039091168152602001610179565b3480156102da57600080fd5b506101b96107b8565b6102ec336107e2565b61031c57604051638f47e7e360e01b81526001600160e01b03196000351660048201526024015b60405180910390fd5b6000610328600861073d565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610365573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103899190611445565b90506103958183610860565b5050565b60006103c37f3663384f6436b31a97d9c9a02f64ab8b73ead575c5b6224fa0800a6bd57f62f45490565b905090565b60046103d381610acd565b6000196103de6105ae565b146104205760405162461bcd60e51b815260206004820152601260248201527130b63932b0b23c9034b734ba103932b8101960711b6044820152606401610313565b6104ac600161042f600861073d565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa15801561046c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104909190611445565b61049a9190611474565b60008051602061181183398151915255565b6104b860046000610b19565b50565b6104c3610bbd565b565b600054600290610100900460ff161580156104e7575060005460ff8083169116105b6105035760405162461bcd60e51b815260040161031390611487565b6000805461ffff191660ff8316176101001790556105417faf260ffaff563b9407c1c5fe4aec2be8632142d158c44bb0ce4d471cb4883b8c60059055565b61054e60016104906105ae565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150565b61059b610c9e565b6105a481610cf8565b6103958282610b19565b60006103c36000805160206118118339815191525490565b600054610100900460ff16158080156105e65750600054600160ff909116105b806106005750303b158015610600575060005460ff166001145b61061c5760405162461bcd60e51b815260040161031390611487565b6000805460ff19166001179055801561063f576000805461ff0019166101001790555b61064a600b88610b19565b610655600387610b19565b610660600c86610b19565b61066b600885610b19565b610676600484610b19565b6000196000805160206118118339815191525561069282610d2e565b61069a610bbd565b80156106e0576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b600b6106f481610acd565b61039582610d2e565b60006103c37f90f7d557245e5dd9485f463e58974fa7cdc93c0abbd0a1afebb8f9640ec739105490565b600361073281610acd565b610395826000610860565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115610774576107746114d5565b60ff1681526020810191909152604001600020546001600160a01b03169050806107b3578160405163409140df60e11b815260040161031391906114ff565b919050565b60006103c37f9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c645490565b60006107ee600b61073d565b604051635a02d57960e11b81526001600160a01b038481166004830152919091169063b405aaf290602401602060405180830381865afa158015610836573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085a919061150d565b92915050565b600061086a6105ae565b9050816000036108cc5760008184111561089757600161088a8386611474565b6108949190611474565b90505b6108c8816108c37faf260ffaff563b9407c1c5fe4aec2be8632142d158c44bb0ce4d471cb4883b8c5490565b610d87565b9250505b6108d7838383610d9f565b60006108e3600b61073d565b6001600160a01b0316639b19dbfd6040518163ffffffff1660e01b8152600401600060405180830381865afa158015610920573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610948919081019061159a565b90506000610956600361073d565b905060005b84811015610ac55761096c84611639565b9350610abd83836001600160a01b031663f67e815287876040518363ffffffff1660e01b81526004016109a0929190611697565b600060405180830381865afa1580156109bd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109e591908101906116b0565b60405163692f6a6360e11b8152600481018890526001600160a01b0386169063d25ed4c690602401602060405180830381865afa158015610a2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4e9190611445565b604051637153af9b60e11b8152600481018990526001600160a01b0387169063e2a75f3690602401602060405180830381865afa158015610a93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab79190611445565b88610e33565b60010161095b565b505050505050565b610ad68161073d565b6001600160a01b0316336001600160a01b0316146104b8576000356001600160e01b03191681336040516320e0f98d60e21b815260040161031393929190611736565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f811115610b4f57610b4f6114d5565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115610b9057610b906114d5565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610c1457604051638f47e7e360e01b81526001600160e01b0319600035166004820152602401610313565b337f7ae161a1f0ef2537f5ff1957021a50412e72abdc6a941a77d99361e91e7f3c3d610c5e7f9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c645490565b604080519182523460208301520160405180910390a26104b87f9a8c9f129792436c37b7bd2d79c56132fc05bf26cc8070794648517c2a0c6c6434610f8a565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031633146104c3576000356001600160e01b0319166001604051620f948f60ea1b815260040161031392919061176d565b806001600160a01b03163b6000036104b857604051630bfc64a360e21b81526001600160a01b0382166004820152602401610313565b610d577f90f7d557245e5dd9485f463e58974fa7cdc93c0abbd0a1afebb8f9640ec73910829055565b6040518181527f9b40b647582311cc8f5f7d27e7ce206d126605d1625b8299b7edaeefd869ef2590602001610588565b6000818310610d965781610d98565b825b9392505050565b81600003610dc05760405163799ffe0d60e01b815260040160405180910390fd5b610dcb81600161179b565b8311610df45760405163425a5b1f60e01b81526004810184905260248101829052604401610313565b610dfe828261179b565b8311610e2e57604051630931302b60e31b8152600481018490526024810182905260448101839052606401610313565b505050565b845184518114610e64576040516306b5667560e21b81526001600160e01b0319600035166004820152602401610313565b6000610e6e6106fd565b90506000610e7b88610fa1565b90506000610e8a87878a61101f565b90506000806000805b87811015610f3957610edc8589898f8581518110610eb357610eb36117ae565b60200260200101518f8e8c8881518110610ecf57610ecf6117ae565b6020026020010151611072565b80945081955050506000610f0b8a8f8481518110610efc57610efc6117ae565b60200260200101518787611093565b90508380610f17575080155b610f215784610f24565b60005b610f2e908461179b565b925050600101610e93565b50610f647f3663384f6436b31a97d9c9a02f64ab8b73ead575c5b6224fa0800a6bd57f62f482610f8a565b50610f7c600080516020611811833981519152899055565b505050505050505050505050565b600061085a83610f9a85856111f9565b9250829055565b6060610fad600c61073d565b6001600160a01b0316635311153b836040518263ffffffff1660e01b8152600401610fd891906117c4565b6000604051808303816000875af1158015610ff7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261085a91908101906116b0565b60008061102d858585611218565b90508061105e576040517f64ba7143ea5a17abea37667aa9ae137e3afba5033c5f504770c02829c128189c90600090a15b801580611069575084155b95945050505050565b6000828210156110858989898989611295565b915097509795505050505050565b6001600160a01b03831660009081527f518cfd198acbffe95e740cfce1af28a3f7de51f0d784893d3d72c5cc59d7062a60205260408120821561113857838160010160008282546110e4919061179b565b9091555050604080516001600160a01b03871681526020810186905287917fb3d061c3ef3991b0d4b09f4c8b551d137c3d1e014cf5326462d3d1f6a8dfb9c291015b60405180910390a260009150506111f1565b611144858560006112c0565b156111b0578381600001600082825461115d919061179b565b9091555050604080516001600160a01b03871681526020810186905287917fbab0baccb39371d4d5206b519fe58d21cae9cdd63a1d1b5146ecdf405fd93152910160405180910390a260019150506111f1565b604080516001600160a01b03871681526020810186905287917f74b217634c5a7790ce69770c5e35019970453d4da3973769e7d6cdb7ce6816a19101611126565b949350505050565b815481018181101561085a57634e487b7160005260116020526024601cfd5b8051600190600090815b8181101561127d578585828151811061123d5761123d6117ae565b60200260200101511115611254576000935061127d565b848181518110611266576112666117ae565b602002602001015183019250806001019050611222565b5082801561128b5750858211155b9695505050505050565b6000856112b657816112a784866117d7565b6112b191906117ee565b61128b565b61128b85856117ee565b6000836001600160a01b0316838390604051600060405180830381858888f193505050503d8060008114611310576040519150601f19603f3d011682016040523d82523d6000602084013e611315565b606091505b509095945050505050565b6001600160a01b03811681146104b857600080fd5b60006020828403121561134757600080fd5b8135610d9881611320565b60006020828403121561136457600080fd5b5035919050565b8035601081106107b357600080fd5b6000806040838503121561138d57600080fd5b6113968361136b565b915060208301356113a681611320565b809150509250929050565b60008060008060008060c087890312156113ca57600080fd5b86356113d581611320565b955060208701356113e581611320565b945060408701356113f581611320565b9350606087013561140581611320565b9250608087013561141581611320565b8092505060a087013590509295509295509295565b60006020828403121561143c57600080fd5b610d988261136b565b60006020828403121561145757600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561085a5761085a61145e565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b601081106114fb576114fb6114d5565b9052565b6020810161085a82846114eb565b60006020828403121561151f57600080fd5b81518015158114610d9857600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561156e5761156e61152f565b604052919050565b600067ffffffffffffffff8211156115905761159061152f565b5060051b60200190565b600060208083850312156115ad57600080fd5b825167ffffffffffffffff8111156115c457600080fd5b8301601f810185136115d557600080fd5b80516115e86115e382611576565b611545565b81815260059190911b8201830190838101908783111561160757600080fd5b928401925b8284101561162e57835161161f81611320565b8252928401929084019061160c565b979650505050505050565b60006001820161164b5761164b61145e565b5060010190565b60008151808452602080850194506020840160005b8381101561168c5781516001600160a01b031687529582019590820190600101611667565b509495945050505050565b8281526040602082015260006111f16040830184611652565b600060208083850312156116c357600080fd5b825167ffffffffffffffff8111156116da57600080fd5b8301601f810185136116eb57600080fd5b80516116f96115e382611576565b81815260059190911b8201830190838101908783111561171857600080fd5b928401925b8284101561162e5783518252928401929084019061171d565b6001600160e01b0319841681526060810161175460208301856114eb565b6001600160a01b03929092166040919091015292915050565b6001600160e01b03198316815260408101600b831061178e5761178e6114d5565b8260208301529392505050565b8082018082111561085a5761085a61145e565b634e487b7160e01b600052603260045260246000fd5b602081526000610d986020830184611652565b808202811582820484141761085a5761085a61145e565b60008261180b57634e487b7160e01b600052601260045260246000fd5b50049056fe2417f25874c1cdc139a787dd21df976d40d767090442b3a2496917ecfc93b619a2646970667358221220cd237faf10660b4bf88f4dcc843cf0b3d4cce585ad7f99199ed3924ea16b8dfd64736f6c63430008170033", + "nonce": "0x2f128" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x9d4495274114cd427debfe5d5c13a3aa6b61ab3261ae9b7ad90a9fff9515d2f9", + "transactionType": "CREATE", + "contractName": "BridgeSlash", + "contractAddress": "0xB03E29Be08E57b2d95Fe9F94966CB86a0DD98481", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x26b9de", + "value": "0x0", + "data": "0x608060405261000c610011565b6100d1565b600054610100900460ff161561007d5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156100cf576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b611583806100e06000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80639c2f445911610097578063de981f1b11610066578063de981f1b146101fd578063f8c8765e14610228578063f9f608731461023b578063fbb2f1941461024357600080fd5b80639c2f4459146101d2578063c48549de146101da578063d1e1f2f8146101ed578063ddc3f7f6146101f557600080fd5b80635311153b116100d35780635311153b1461016a5780636dda44081461017d578063865e6fd3146101935780638f851d8a146101a657600080fd5b806301ffc9a7146101055780631288810a1461012d5780633b1544551461014d5780634dca592514610157575b600080fd5b610118610113366004610eb7565b610263565b60405190151581526020015b60405180910390f35b61014061013b366004610f2d565b61029a565b6040516101249190610f6f565b610155610382565b005b6101556101653660046110a4565b610462565b610140610178366004610f2d565b6106f9565b610185600181565b604051908152602001610124565b6101556101a136600461118e565b6107d2565b6101b96101b43660046111c1565b6107f1565b6040516001600160e01b03199091168152602001610124565b610185603281565b6101b96101e83660046112ba565b610970565b610185600581565b610185601e81565b61021061020b366004611326565b61098f565b6040516001600160a01b039091168152602001610124565b610155610236366004611341565b610a0a565b610140610b49565b610256610251366004611395565b610b58565b60405161012491906113cd565b60006001600160e01b031982166312c0151560e21b148061029457506001600160e01b031982166301ffc9a760e01b145b92915050565b6060818067ffffffffffffffff8111156102b6576102b6610fb3565b6040519080825280602002602001820160405280156102df578160200160208202803683370190505b50915060008051602061152e83398151915260005b8281101561037957816000878784818110610311576103116113e7565b905060200201602081019061032691906113fd565b6001600160a01b031681526020810191909152604001600020548451600160801b9091046001600160801b031690859083908110610366576103666113e7565b60209081029190910101526001016102f4565b50505092915050565b600461038d81610b6b565b600019600154146103da5760405162461bcd60e51b815260206004820152601260248201527130b63932b0b23c9034b734ba103932b8101960711b60448201526064015b60405180910390fd5b6103e4600861098f565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610421573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104459190611418565b610450906001611447565b60015561045f60046000610bb7565b50565b600361046d81610b6b565b8160015481106106f0578360328111156106ee5786518851146104b1576040516306b5667560e21b81526001600160e01b03196000351660048201526024016103d1565b8751156106ee576104c3868689610c5b565b6104f5576040517f64ba7143ea5a17abea37667aa9ae137e3afba5033c5f504770c02829c128189c90600090a16106ee565b60006104ff610cd8565b6040805180820190915260008082526020820181905291925060008051602061152e833981519152918080805b8e518110156106e6578e8181518110610547576105476113e7565b6020908102919091018101516001600160a01b03811660009081528883526040908190208151808301909252546001600160801b038082168352600160801b90910416928101839052965093508b11156106de576105be8e82815181106105b0576105b06113e7565b60200260200101518d610d43565b91506105d9828c87600001516001600160801b03168a610d95565b93506105e5848c610dec565b1561062b576040516001600160801b0394506001600160a01b038416908c907fb32a150b9737190a456d8b2b81dd7d592a799ab2933ea494e44351acd41f835d90600090a35b600082600281111561063f5761063f6113b7565b146106de576001600160801b0384146106a3578a836001600160a01b031683600281111561066f5761066f6113b7565b6040518781527fa0957b65e189f06dfe2b38ff07e89a0df128ba3fcba66c68f8d2615daebc30a99060200160405180910390a45b6001600160a01b038316600090815260208790526040902080546fffffffffffffffffffffffffffffffff19166001600160801b0386161790555b60010161052c565b505050505050505b505b50505050505050565b6060818067ffffffffffffffff81111561071557610715610fb3565b60405190808252806020026020018201604052801561073e578160200160208202803683370190505b50915060008051602061152e83398151915260005b8281101561037957816000878784818110610770576107706113e7565b905060200201602081019061078591906113fd565b6001600160a01b0316815260208101919091526040016000205484516001600160801b03909116908590839081106107bf576107bf6113e7565b6020908102919091010152600101610753565b6107da610e0e565b6107e381610e6a565b6107ed8282610bb7565b5050565b6000600b6107fe81610b6b565b82518690811461082f576040516306b5667560e21b81526001600160e01b03196000351660048201526024016103d1565b8060000361084757506347c28ec560e11b9150610966565b60008051602061152e8339815191526000610862600861098f565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa15801561089f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c39190611418565b905060005b83811015610957578681815181106108e2576108e26113e7565b60200260200101511561094f57818360008d8d85818110610905576109056113e7565b905060200201602081019061091a91906113fd565b6001600160a01b03168152602081019190915260400160002080546001600160801b03928316600160801b0292169190911790555b6001016108c8565b506347c28ec560e11b94505050505b5095945050505050565b6000600b61097d81610b6b565b50636242a4ef60e11b95945050505050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f8111156109c6576109c66113b7565b60ff1681526020810191909152604001600020546001600160a01b0316905080610a05578160405163409140df60e11b81526004016103d1919061146e565b919050565b600054610100900460ff1615808015610a2a5750600054600160ff909116105b80610a445750303b158015610a44575060005460ff166001145b610aa75760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103d1565b6000805460ff191660011790558015610aca576000805461ff0019166101001790555b610ad5600886610bb7565b610ae0600b85610bb7565b610aeb600384610bb7565b610af6600483610bb7565b6000196001558015610b42576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6060610b53610cd8565b905090565b6000610b648383610d43565b9392505050565b610b748161098f565b6001600160a01b0316336001600160a01b03161461045f576000356001600160e01b03191681336040516320e0f98d60e21b81526004016103d19392919061147c565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f811115610bed57610bed6113b7565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115610c2e57610c2e6113b7565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b8051600190600090815b81811015610cc05785858281518110610c8057610c806113e7565b60200260200101511115610c975760009350610cc0565b848181518110610ca957610ca96113e7565b602002602001015183019250806001019050610c65565b50828015610cce5750858211155b9695505050505050565b604080516003808252608082019092526060916020820183803683370190505090506001818160ff1681518110610d1157610d116113e7565b6020908102919091010152600581600260ff1681518110610d3457610d346113e7565b60200260200101818152505090565b60008082612710610d5486836114b3565b610d5e91906114c6565b610d6891906114dd565b9050610bb88111610d8a576103e88111610d83576000610d8d565b6001610d8d565b60025b949350505050565b6000610dab610da56001866114b3565b84610ea0565b82866002811115610dbe57610dbe6113b7565b60ff1681518110610dd157610dd16113e7565b6020026020010151610de39190611447565b95945050505050565b6000601e610dfb6001846114b3565b610e0590856114b3565b10159392505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610e68576000356001600160e01b0319166001604051620f948f60ea1b81526004016103d19291906114ff565b565b806001600160a01b03163b60000361045f57604051630bfc64a360e21b81526001600160a01b03821660048201526024016103d1565b600081831015610eb05781610b64565b5090919050565b600060208284031215610ec957600080fd5b81356001600160e01b031981168114610b6457600080fd5b60008083601f840112610ef357600080fd5b50813567ffffffffffffffff811115610f0b57600080fd5b6020830191508360208260051b8501011115610f2657600080fd5b9250929050565b60008060208385031215610f4057600080fd5b823567ffffffffffffffff811115610f5757600080fd5b610f6385828601610ee1565b90969095509350505050565b6020808252825182820181905260009190848201906040850190845b81811015610fa757835183529284019291840191600101610f8b565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610ff257610ff2610fb3565b604052919050565b600067ffffffffffffffff82111561101457611014610fb3565b5060051b60200190565b80356001600160a01b0381168114610a0557600080fd5b600082601f83011261104657600080fd5b8135602061105b61105683610ffa565b610fc9565b8083825260208201915060208460051b87010193508684111561107d57600080fd5b602086015b848110156110995780358352918301918301611082565b509695505050505050565b600080600080600060a086880312156110bc57600080fd5b853567ffffffffffffffff808211156110d457600080fd5b818801915088601f8301126110e857600080fd5b813560206110f861105683610ffa565b82815260059290921b8401810191818101908c84111561111757600080fd5b948201945b8386101561113c5761112d8661101e565b8252948201949082019061111c565b9950508901359250508082111561115257600080fd5b5061115f88828901611035565b959895975050505060408401359360608101359360809091013592509050565b803560108110610a0557600080fd5b600080604083850312156111a157600080fd5b6111aa8361117f565b91506111b86020840161101e565b90509250929050565b6000806000806000606086880312156111d957600080fd5b853567ffffffffffffffff808211156111f157600080fd5b6111fd89838a01610ee1565b909750955060209150878201358181111561121757600080fd5b6112238a828b01610ee1565b90965094505060408801358181111561123b57600080fd5b88019050601f8101891361124e57600080fd5b803561125c61105682610ffa565b81815260059190911b8201830190838101908b83111561127b57600080fd5b928401925b828410156112a857833580151581146112995760008081fd5b82529284019290840190611280565b80955050505050509295509295909350565b600080600080604085870312156112d057600080fd5b843567ffffffffffffffff808211156112e857600080fd5b6112f488838901610ee1565b9096509450602087013591508082111561130d57600080fd5b5061131a87828801610ee1565b95989497509550505050565b60006020828403121561133857600080fd5b610b648261117f565b6000806000806080858703121561135757600080fd5b6113608561101e565b935061136e6020860161101e565b925061137c6040860161101e565b915061138a6060860161101e565b905092959194509250565b600080604083850312156113a857600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60208101600383106113e1576113e16113b7565b91905290565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561140f57600080fd5b610b648261101e565b60006020828403121561142a57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561029457610294611431565b6010811061146a5761146a6113b7565b9052565b60208101610294828461145a565b6001600160e01b0319841681526060810161149a602083018561145a565b6001600160a01b03929092166040919091015292915050565b8181038181111561029457610294611431565b808202811582820484141761029457610294611431565b6000826114fa57634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b03198316815260408101600b8310611520576115206113b7565b826020830152939250505056fed08d185790a07c7b9b721e2713c8580010a57f31c72c16f6e80b831d0ee45bfea2646970667358221220a88731885a136f6ffe2ef43beabc7b3a128ab2f3ee20d79c6777fe10326663bf64736f6c63430008170033", + "nonce": "0x2f129" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x654979ade55752136df9338da1f00bd477efeb2541fb0ba16c91a8157625d6cc", + "transactionType": "CREATE", + "contractName": "BridgeTracking", + "contractAddress": "0x3a3A92ba9d4D49aae06861136D547667c742F1aF", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x2fb53a", + "value": "0x0", + "data": "0x608060405234801561001057600080fd5b5061001961001e565b6100eb565b600154600160a81b900460ff161561008c5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60015460ff600160a01b909104811610156100e9576001805460ff60a01b191660ff60a01b17905560405160ff81527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b611ad5806100fa6000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063c7c4fea91161008c578063de981f1b11610066578063de981f1b1461017e578063e2a75f36146101a9578063f67e8152146101bc578063f84bd121146101dc57600080fd5b8063c7c4fea914610145578063ca21287e14610158578063d25ed4c61461016b57600080fd5b80631794bb3c146100d4578063229f88ea146100e95780633b154455146100fc5780634ac0bcda146101045780635cd8a76b1461012a578063865e6fd314610132575b600080fd5b6100e76100e23660046114df565b6101e4565b005b6100e76100f736600461152f565b6102e4565b6100e761048c565b610117610112366004611559565b61055c565b6040519081526020015b60405180910390f35b6100e761057a565b6100e7610140366004611598565b610673565b6100e76101533660046115c4565b610692565b6100e7610166366004611604565b610a6b565b610117610179366004611660565b610b56565b61019161018c366004611679565b610b8b565b6040516001600160a01b039091168152602001610121565b6101176101b7366004611660565b610c01565b6101cf6101ca366004611694565b610c2b565b604051610121919061174f565b600254610117565b600154600160a81b900460ff161580801561020a575060018054600160a01b900460ff16105b8061022a5750303b15801561022a575060018054600160a01b900460ff16145b61024f5760405162461bcd60e51b815260040161024690611762565b60405180910390fd5b6001805460ff60a01b1916600160a01b179055801561027c576001805460ff60a81b1916600160a81b1790555b610287600285610c72565b610292600884610c72565b600282905580156102de576001805460ff60a81b191681556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b60026102ef81610d16565b6102f7610d62565b6000600a600085600281111561030f5761030f6117b0565b6002811115610320576103206117b0565b81526020019081526020016000206000848152602001908152602001600020905080600001546000036102de57610355610d70565b60006103616008610b8b565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa15801561039e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c291906117c6565b808355600480546001818101835560009290925260029081027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018054939450928892849260ff1990921691849081111561041f5761041f6117b0565b02179055506001808201869055830160005b81548110156104745761046c8888848481548110610451576104516117df565b6000918252602090912001546001600160a01b031687611012565b600101610431565b50610483600185016000611452565b50505050505050565b600461049781610d16565b600019600b54146104df5760405162461bcd60e51b815260206004820152601260248201527130b63932b0b23c9034b734ba103932b8101960711b6044820152606401610246565b6104e96008610b8b565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610526573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054a91906117c6565b600b5561055960046000610c72565b50565b6000610571838361056c86611192565b6112b8565b90505b92915050565b600154600290600160a81b900460ff161580156105a5575060015460ff808316600160a01b90920416105b6105c15760405162461bcd60e51b815260040161024690611762565b6001805460ff60a81b1960ff8416600160a01b021661ffff60a01b1990911617600160a81b179055600054610601906002906001600160a01b0316610c72565b600154610619906008906001600160a01b0316610c72565b600080546001600160a01b031916905560018054600161ff0160a01b031916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b61067b61130e565b61068481611368565b61068e8282610c72565b5050565b600261069d81610d16565b6106a5610d62565b60006106b16008610b8b565b6001600160a01b031663060406186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106ee573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071291906117c6565b905061071c610d70565b6000600a6000876002811115610734576107346117b0565b6002811115610745576107456117b0565b81526020019081526020016000206000868152602001908152602001600020905080600001546000036107a7576001908101805491820181556000908152602090200180546001600160a01b0319166001600160a01b038516179055506102de565b6107b386868685611012565b600b548281101561048357600b8381556000906107cf90610b8b565b6001600160a01b0316639b19dbfd6040518163ffffffff1660e01b8152600401600060405180830381865afa15801561080c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108349190810190611816565b90506000610842838361139e565b9050600061084f84610c01565b9050600061085c85610b56565b9050600061086a600c610b8b565b9050600080826001600160a01b0316878786888c6040516024016108929594939291906118db565b60408051601f198184030181529181526020820180516001600160e01b0316634dca592560e01b179052516108c79190611975565b6000604051808303816000865af19150503d8060008114610904576040519150601f19603f3d011682016040523d82523d6000602084013e610909565b606091505b50915091508161096057604051634dca592560e01b906001600160a01b038516907feaa424ccc38ebcf22402729592dedf8315790e0128cb577cdeff1a3ee627f82790610957908590611991565b60405180910390a35b600061096c600d610b8b565b9050806001600160a01b03168b60405160240161098b91815260200190565b60408051601f198184030181529181526020820180516001600160e01b03166302ddfca960e61b179052516109c09190611975565b6000604051808303816000865af19150503d80600081146109fd576040519150601f19603f3d011682016040523d82523d6000602084013e610a02565b606091505b50909350915082610a5a576040516302ddfca960e61b906001600160a01b038316907feaa424ccc38ebcf22402729592dedf8315790e0128cb577cdeff1a3ee627f82790610a51908690611991565b60405180910390a35b505050505050505050505050505050565b600154600390600160a81b900460ff16158015610a96575060015460ff808316600160a01b90920416105b610ab25760405162461bcd60e51b815260040161024690611762565b6001805460ff60a81b1960ff8416600160a01b021661ffff60a01b1990911617600160a81b179055610ae5600b86610c72565b610af0600c85610c72565b610afb600d84610c72565b610b06600483610c72565b600019600b556001805460ff60a81b1916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050565b600081815260096020526040902060010154610b7182611192565b15610b8657600654610b8390826119c4565b90505b919050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115610bc257610bc26117b0565b60ff1681526020810191909152604001600020546001600160a01b0316905080610b86578160405163409140df60e11b815260040161024691906119f9565b600081815260096020526040902054610c1982611192565b15610b8657600454610b8390826119c4565b6060610c6a8484848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061139e92505050565b949350505050565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f811115610ca857610ca86117b0565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115610ce957610ce96117b0565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b610d1f81610b8b565b6001600160a01b0316336001600160a01b031614610559576000356001600160e01b03191681336040516320e0f98d60e21b815260040161024693929190611a07565b600254431015610d6e57005b565b6000610d7c6008610b8b565b60405163a3d545f560e01b81524360048201529091506000906001600160a01b0383169063a3d545f590602401602060405180830381865afa158015610dc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dea91906117c6565b905080600360000154101561068e576000826001600160a01b031663468c96ae6003600001546001610e1c91906119c4565b6040518263ffffffff1660e01b8152600401610e3a91815260200190565b6040805180830381865afa158015610e56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7a9190611a3e565b60038490556000818152600960205260408120600454815493955090935091839190610ea79084906119c4565b9091555050600654600182018054600090610ec39084906119c4565b90915550600090505b600854811015610f5357600880546000919083908110610eee57610eee6117df565b60009182526020808320909101546001600160a01b0316808352600782526040808420546002880190935283208054919450919290610f2e9084906119c4565b90915550506001600160a01b0316600090815260076020526040812055600101610ecc565b5060005b600454811015610fe557600060036001018281548110610f7957610f796117df565b6000918252602082206002918202018054909350600a91839160ff1690811115610fa557610fa56117b0565b6002811115610fb657610fb66117b0565b815260208082019290925260409081016000908120600195860154825290925290206003018590555001610f57565b50610ff260046000611470565b6000600581815560068290559061100a600882611452565b505050505050565b6000600a600086600281111561102a5761102a6117b0565b600281111561103b5761103b6117b0565b81526020808201929092526040908101600090812087825283528181206001600160a01b038716825260028101909352205490915060ff161561107e57506102de565b6001600160a01b03831660009081526002820160205260408120805460ff1916600117905560038201549081900361114b576001600160a01b038416600090815260076020526040812054900361111b57600880546001810182556000919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180546001600160a01b0319166001600160a01b0386161790555b6006805460019081019091556001600160a01b03851660009081526007602052604090208054909101905561100a565b82810361100a57600090815260096020908152604080832060018082018054820190556001600160a01b039790971684526002019091529020805490930190925550505050565b60008061119f6008610b8b565b60405163a3d545f560e01b81524360048201529091506000906001600160a01b0383169063a3d545f590602401602060405180830381865afa1580156111e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120d91906117c6565b9050600080836001600160a01b031663468c96ae600360000154600161123391906119c4565b6040518263ffffffff1660e01b815260040161125191815260200190565b6040805180830381865afa15801561126d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112919190611a3e565b915091508180156112a157508086145b80156112ae575060035483115b9695505050505050565b60008381526009602090815260408083206001600160a01b03861684526002019091529020548115611307576001600160a01b038316600090815260076020526040902054610c6a90826119c4565b9392505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610d6e576000356001600160e01b0319166001604051620f948f60ea1b8152600401610246929190611a71565b806001600160a01b03163b60000361055957604051630bfc64a360e21b81526001600160a01b0382166004820152602401610246565b80516060908067ffffffffffffffff8111156113bc576113bc6117f5565b6040519080825280602002602001820160405280156113e5578160200160208202803683370190505b50915060006113f385611192565b905060005b828110156114495761142486868381518110611416576114166117df565b6020026020010151846112b8565b848281518110611436576114366117df565b60209081029190910101526001016113f8565b50505092915050565b50805460008255906000526020600020908101906105599190611491565b508054600082556002029060005260206000209081019061055991906114aa565b5b808211156114a65760008155600101611492565b5090565b5b808211156114a657805460ff19168155600060018201556002016114ab565b6001600160a01b038116811461055957600080fd5b6000806000606084860312156114f457600080fd5b83356114ff816114ca565b9250602084013561150f816114ca565b929592945050506040919091013590565b803560038110610b8657600080fd5b6000806040838503121561154257600080fd5b61154b83611520565b946020939093013593505050565b6000806040838503121561156c57600080fd5b82359150602083013561157e816114ca565b809150509250929050565b803560108110610b8657600080fd5b600080604083850312156115ab57600080fd5b6115b483611589565b9150602083013561157e816114ca565b6000806000606084860312156115d957600080fd5b6115e284611520565b92506020840135915060408401356115f9816114ca565b809150509250925092565b6000806000806080858703121561161a57600080fd5b8435611625816114ca565b93506020850135611635816114ca565b92506040850135611645816114ca565b91506060850135611655816114ca565b939692955090935050565b60006020828403121561167257600080fd5b5035919050565b60006020828403121561168b57600080fd5b61057182611589565b6000806000604084860312156116a957600080fd5b83359250602084013567ffffffffffffffff808211156116c857600080fd5b818601915086601f8301126116dc57600080fd5b8135818111156116eb57600080fd5b8760208260051b850101111561170057600080fd5b6020830194508093505050509250925092565b60008151808452602080850194506020840160005b8381101561174457815187529582019590820190600101611728565b509495945050505050565b6020815260006105716020830184611713565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b6000602082840312156117d857600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8051610b86816114ca565b6000602080838503121561182957600080fd5b825167ffffffffffffffff8082111561184157600080fd5b818501915085601f83011261185557600080fd5b815181811115611867576118676117f5565b8060051b604051601f19603f8301168101818110858211171561188c5761188c6117f5565b6040529182528482019250838101850191888311156118aa57600080fd5b938501935b828510156118cf576118c08561180b565b845293850193928501926118af565b98975050505050505050565b60a0808252865190820181905260009060209060c0840190828a01845b8281101561191d5781516001600160a01b0316845292840192908401906001016118f8565b50505083810360208501526119328189611713565b6040850197909752505050606081019290925260809091015292915050565b60005b8381101561196c578181015183820152602001611954565b50506000910152565b60008251611987818460208701611951565b9190910192915050565b60208152600082518060208401526119b0816040850160208701611951565b601f01601f19169190910160400192915050565b8082018082111561057457634e487b7160e01b600052601160045260246000fd5b601081106119f5576119f56117b0565b9052565b6020810161057482846119e5565b6001600160e01b03198416815260608101611a2560208301856119e5565b6001600160a01b03929092166040919091015292915050565b60008060408385031215611a5157600080fd5b82518015158114611a6157600080fd5b6020939093015192949293505050565b6001600160e01b03198316815260408101600b8310611a9257611a926117b0565b826020830152939250505056fea2646970667358221220262d80d2feb74067f3cddee2705a4fff0aac4921a9a54ee2314b0f244bccac3e64736f6c63430008170033", + "nonce": "0x2f12a" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0xf141319220c49fe33883a82d7d180ad835c4c2794bbb51bc2e5870ad27a9dfab", + "transactionType": "CREATE", + "contractName": "PauseEnforcer", + "contractAddress": "0x4222384E84C248aa8D50FDC702a1b55E6b4efc99", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x206788", + "value": "0x0", + "data": "0x608060405234801561001057600080fd5b5061001961001e565b6100de565b600254610100900460ff161561008a5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60025460ff90811610156100dc576002805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6111c4806100ed6000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c806391d14854116100a2578063caa6fea411610071578063caa6fea414610240578063d4b8399214610254578063d547741f1461026d578063dcf7bb5c14610280578063f82ec70b1461029357600080fd5b806391d148541461020a578063a217fddf1461021d578063b9f3163b14610225578063ca15c8731461022d57600080fd5b80636833f60d116100e95780636833f60d1461019c57806377a24f36146101a45780637a9ad019146101b75780637d4f7fc9146101cc5780639010d07c146101df57600080fd5b806301ffc9a71461011b578063248a9ca3146101435780632f2ff15d1461017457806336568abe14610189575b600080fd5b61012e610129366004610e11565b6102a6565b60405190151581526020015b60405180910390f35b610166610151366004610e3b565b60009081526020819052604090206001015490565b60405190815260200161013a565b610187610182366004610e79565b6102d1565b005b610187610197366004610e79565b6102fb565b61018761037e565b6101876101b2366004610ebf565b6104da565b61016660008051602061116f83398151915281565b6101876101da366004610fab565b610640565b6101f26101ed366004610fc8565b610663565b6040516001600160a01b03909116815260200161013a565b61012e610218366004610e79565b610682565b610166600081565b6101876106ab565b61016661023b366004610e3b565b610821565b60025461012e90600160b01b900460ff1681565b6002546101f2906201000090046001600160a01b031681565b61018761027b366004610e79565b610838565b61018761028e366004610fab565b61085d565b6101876102a1366004610fab565b610871565b60006001600160e01b03198216635a05180f60e01b14806102cb57506102cb82610894565b92915050565b6000828152602081905260409020600101546102ec816108c9565b6102f683836108d6565b505050565b6001600160a01b03811633146103705760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61037a82826108f8565b5050565b60008051602061116f833981519152610396816108c9565b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af11580156103e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040d9190610fea565b1561042b576040516310067f7560e11b815260040160405180910390fd5b60028054600160b01b60ff60b01b19909116179081905560408051638456cb5960e01b81529051620100009092046001600160a01b031691638456cb599160048082019260009290919082900301818387803b15801561048a57600080fd5b505af115801561049e573d6000803e3d6000fd5b50506040513381527fb8fad2fa0ed7a383e747c309ef2c4391d7b65592a48893e57ccc1fab70791456925060200190505b60405180910390a150565b600254610100900460ff16158080156104fa5750600254600160ff909116105b806105145750303b158015610514575060025460ff166001145b6105775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610367565b6002805460ff19166001179055801561059a576002805461ff0019166101001790555b6105a38461091a565b6105ae600084610972565b60005b82518110156105f3576105eb60008051602061116f8339815191528483815181106105de576105de61100c565b60200260200101516108d6565b6001016105b1565b50801561063a576002805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b600061064b816108c9565b61037a60008051602061116f833981519152836108d6565b600082815260016020526040812061067b908361097c565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008051602061116f8339815191526106c3816108c9565b600254600160b01b900460ff166106ed57604051631b2fd53f60e31b815260040160405180910390fd5b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610740573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107649190610fea565b61078157604051631e87b57b60e31b815260040160405180910390fd5b6002805460ff60b01b19169081905560408051631fa5d41d60e11b81529051620100009092046001600160a01b031691633f4ba83a9160048082019260009290919082900301818387803b1580156107d857600080fd5b505af11580156107ec573d6000803e3d6000fd5b50506040513381527ff5cbf596165cc457b2cd92e8d8450827ee314968160a5696402d75766fc52caf925060200190506104cf565b60008181526001602052604081206102cb90610988565b600082815260208190526040902060010154610853816108c9565b6102f683836108f8565b6000610868816108c9565b61037a8261091a565b600061087c816108c9565b61037a60008051602061116f833981519152836108f8565b60006001600160e01b03198216637965db0b60e01b14806102cb57506301ffc9a760e01b6001600160e01b03198316146102cb565b6108d38133610992565b50565b6108e082826109f6565b60008281526001602052604090206102f69082610a7a565b6109028282610a8f565b60008281526001602052604090206102f69082610af4565b6002805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040519081527f7f8cffd58ac96898bdd25ab64868bd933141d15ad1cd4a0df228fd3fcba2a26d906020016104cf565b61037a82826108d6565b600061067b8383610b09565b60006102cb825490565b61099c8282610682565b61037a576109b4816001600160a01b03166014610b33565b6109bf836020610b33565b6040516020016109d0929190611046565b60408051601f198184030181529082905262461bcd60e51b8252610367916004016110bb565b610a008282610682565b61037a576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610a363390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061067b836001600160a01b038416610ccf565b610a998282610682565b1561037a576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061067b836001600160a01b038416610d1e565b6000826000018281548110610b2057610b2061100c565b9060005260206000200154905092915050565b60606000610b42836002611104565b610b4d90600261111b565b67ffffffffffffffff811115610b6557610b65610ea9565b6040519080825280601f01601f191660200182016040528015610b8f576020820181803683370190505b509050600360fc1b81600081518110610baa57610baa61100c565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610bd957610bd961100c565b60200101906001600160f81b031916908160001a9053506000610bfd846002611104565b610c0890600161111b565b90505b6001811115610c80576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610c3c57610c3c61100c565b1a60f81b828281518110610c5257610c5261100c565b60200101906001600160f81b031916908160001a90535060049490941c93610c798161112e565b9050610c0b565b50831561067b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610367565b6000818152600183016020526040812054610d16575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556102cb565b5060006102cb565b60008181526001830160205260408120548015610e07576000610d42600183611145565b8554909150600090610d5690600190611145565b9050818114610dbb576000866000018281548110610d7657610d7661100c565b9060005260206000200154905080876000018481548110610d9957610d9961100c565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610dcc57610dcc611158565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506102cb565b60009150506102cb565b600060208284031215610e2357600080fd5b81356001600160e01b03198116811461067b57600080fd5b600060208284031215610e4d57600080fd5b5035919050565b6001600160a01b03811681146108d357600080fd5b8035610e7481610e54565b919050565b60008060408385031215610e8c57600080fd5b823591506020830135610e9e81610e54565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600060608486031215610ed457600080fd5b8335610edf81610e54565b9250602084810135610ef081610e54565b9250604085013567ffffffffffffffff80821115610f0d57600080fd5b818701915087601f830112610f2157600080fd5b813581811115610f3357610f33610ea9565b8060051b604051601f19603f83011681018181108582111715610f5857610f58610ea9565b60405291825284820192508381018501918a831115610f7657600080fd5b938501935b82851015610f9b57610f8c85610e69565b84529385019392850192610f7b565b8096505050505050509250925092565b600060208284031215610fbd57600080fd5b813561067b81610e54565b60008060408385031215610fdb57600080fd5b50508035926020909101359150565b600060208284031215610ffc57600080fd5b8151801515811461067b57600080fd5b634e487b7160e01b600052603260045260246000fd5b60005b8381101561103d578181015183820152602001611025565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161107e816017850160208801611022565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516110af816028840160208801611022565b01602801949350505050565b60208152600082518060208401526110da816040850160208701611022565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176102cb576102cb6110ee565b808201808211156102cb576102cb6110ee565b60008161113d5761113d6110ee565b506000190190565b818103818111156102cb576102cb6110ee565b634e487b7160e01b600052603160045260246000fdfe5bea60102f2a7acc9e82b1af0e3bd4069661102bb5dd143a6051cd1980dded1ca26469706673582212205cd579cff7903082498e437ed3eb21f8623bfa7f518ca2799b5e3497b22a08a864736f6c63430008170033", + "nonce": "0x2f12b" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x6fb9b0e921f8b65c67263c1a0771bc8997d12461adb0a26b4da588ca1bbf485d", + "transactionType": "CREATE", + "contractName": "RoninGatewayV3", + "contractAddress": "0xdA48f437Eb827CB997a7D09487D53bE72F2C57a8", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x8aad78", + "value": "0x0", + "data": "0x60806040523480156200001157600080fd5b506000805460ff19169055620000266200002c565b620000ee565b603754610100900460ff1615620000995760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60375460ff9081161015620000ec576037805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6150b880620000fe6000396000f3fe6080604052600436106102975760003560e01c80638456cb591161015a578063ca15c873116100c1578063ecc836491161007a578063ecc836491461089f578063f0ce418e146108cc578063f23a6e6114610912578063f668214a1461093e578063fa3896591461095e578063fc6574bc1461097e576102a6565b8063ca15c873146107e7578063d547741f14610807578063dafae40814610827578063dbd2ef6c14610847578063de981f1b14610867578063e75235b814610887576102a6565b8063affed0e011610113578063affed0e0146106e5578063b9afa177146106fb578063b9c362091461071b578063bc197c811461073b578063bc7f038614610774578063c28f7894146107a1576102a6565b80638456cb591461063b578063865e6fd3146106505780639010d07c1461067057806391d14854146106905780639584a592146106b0578063a217fddf146106d0576102a6565b80633f4ba83a116101fe5780635d6a9a90116101b75780635d6a9a901461057257806364363f781461059f57806371706cbe146105bf57806375535f86146105d55780637de5dedd146105f5578063835fc6ca1461060a576102a6565b80633f4ba83a1461048f57806347b56b2c146104a45780634d92c4f0146104c45780635a7dd06a146105255780635c975abb146105455780635cd8a76b1461055d576102a6565b8063248a9ca311610250578063248a9ca3146103b15780632f2ff15d146103ef5780633101cfcb1461040f57806336568abe1461042f5780633e4574ec1461044f5780633e70838b1461046f576102a6565b806301ffc9a7146102ae578063065b3adf146102e35780630b1ff17f1461031b578063109679ef1461033b57806317892f961461035b57806317fa2ea114610384576102a6565b366102a6576102a46109d0565b005b6102a46109d0565b3480156102ba57600080fd5b506102ce6102c9366004613c2d565b6109e9565b60405190151581526020015b60405180910390f35b3480156102ef57600080fd5b50600554610303906001600160a01b031681565b6040516001600160a01b0390911681526020016102da565b34801561032757600080fd5b506102a4610336366004613c57565b610a09565b34801561034757600080fd5b506102a4610356366004613c88565b610a20565b34801561036757600080fd5b506078546079545b604080519283526020830191909152016102da565b34801561039057600080fd5b506103a461039f366004613ce5565b610a53565b6040516102da9190613d26565b3480156103bd57600080fd5b506103e16103cc366004613d60565b6000908152606b602052604090206001015490565b6040519081526020016102da565b3480156103fb57600080fd5b506102a461040a366004613d99565b610d90565b34801561041b57600080fd5b506102a461042a366004613dc9565b610dba565b34801561043b57600080fd5b506102a461044a366004613d99565b610e66565b34801561045b57600080fd5b506102ce61046a366004613d99565b610ee0565b34801561047b57600080fd5b506102a461048a366004613dc9565b610f10565b34801561049b57600080fd5b506102a4610f3a565b3480156104b057600080fd5b506102a46104bf366004613d60565b610f4c565b3480156104d057600080fd5b506105156104df366004613de6565b606f602090815260009283526040808420909152908252902080546001820154600383015460049093015460ff90921692909184565b6040516102da9493929190613e1e565b34801561053157600080fd5b506102a4610540366004613e4e565b611117565b34801561055157600080fd5b5060005460ff166102ce565b34801561056957600080fd5b506102a461117e565b34801561057e57600080fd5b5061059261058d366004613ec8565b611280565b6040516102da9190613f04565b3480156105ab57600080fd5b506102a46105ba366004613f30565b611324565b3480156105cb57600080fd5b506103e1606e5481565b3480156105e157600080fd5b5061036f6105f0366004613de6565b611360565b34801561060157600080fd5b506103e1611381565b34801561061657600080fd5b5061062a610625366004613d60565b611398565b6040516102da959493929190613ff8565b34801561064757600080fd5b506102a461146a565b34801561065c57600080fd5b506102a461066b36600461404e565b61147a565b34801561067c57600080fd5b5061030361068b366004613de6565b611495565b34801561069c57600080fd5b506102ce6106ab366004613d99565b6114ad565b3480156106bc57600080fd5b506102a46106cb36600461408b565b6114d8565b3480156106dc57600080fd5b506103e1600081565b3480156106f157600080fd5b506103e160045481565b34801561070757600080fd5b506103a4610716366004614184565b611625565b34801561072757600080fd5b506102a4610736366004613de6565b611743565b34801561074757600080fd5b50610767610756366004614368565b63bc197c8160e01b95945050505050565b6040516102da9190614415565b34801561078057600080fd5b506103e161078f366004613dc9565b60386020526000908152604090205481565b3480156107ad57600080fd5b506105156107bc366004613d60565b607660205260009081526040902080546001820154600383015460049093015460ff90921692909184565b3480156107f357600080fd5b506103e1610802366004613d60565b611755565b34801561081357600080fd5b506102a4610822366004613d99565b61176c565b34801561083357600080fd5b506102ce610842366004613d60565b611791565b34801561085357600080fd5b506102a461086236600461442a565b6117bd565b34801561087357600080fd5b506103036108823660046144ed565b61180f565b34801561089357600080fd5b5060015460025461036f565b3480156108ab57600080fd5b506108bf6108ba366004614508565b61188a565b6040516102da91906145a3565b3480156108d857600080fd5b506105156108e7366004613d60565b607060205260009081526040902080546001820154600383015460049093015460ff90921692909184565b34801561091e57600080fd5b5061076761092d366004614607565b63f23a6e6160e01b95945050505050565b34801561094a57600080fd5b506102ce610959366004613d60565b6119f1565b34801561096a57600080fd5b506102a4610979366004613f30565b611a1f565b34801561098a57600080fd5b506102ce61099936600461466f565b6000928352606f602090815260408085209385529281528284206001600160a01b0392909216845260029091019052902054151590565b60405163129c2ce160e31b815260040160405180910390fd5b60006109f482611c1a565b80610a035750610a0382611c3f565b92915050565b610a11611c64565b610a1c823383611caa565b5050565b610a28611c64565b610a30611d79565b610a50610a4236839003830183614746565b33610a4b611381565b611e1a565b50565b6060610a5d611d79565b336000610a68611381565b9050600084806001600160401b03811115610a8557610a856141f9565b604051908082528060200260200182016040528015610aae578160200160208202803683370190505b5094506000610abd600361180f565b905060005b82811015610d8457888882818110610adc57610adc6147d7565b905060200201359350816001600160a01b031663c7c4fea9600286896040518463ffffffff1660e01b8152600401610b16939291906147ed565b600060405180830381600087803b158015610b3057600080fd5b505af1158015610b44573d6000803e3d6000fd5b50505050610b51846119f1565b15610b7b576001878281518110610b6a57610b6a6147d7565b911515602092830291909101909101525b600084815260706020908152604080832060718352818420825160a081019093528054835260018082015492959491929184019160ff1690811115610bc257610bc2613e08565b6001811115610bd357610bd3613e08565b815260408051606080820183526002858101546001600160a01b039081168452600387015481166020858101919091526004880154858701528087019490945284518084018652600588015482168152600688015490911693810193909352600786015483850152838501929092528251808201909352600885018054919094019391839160ff1690811115610c6b57610c6b613e08565b6002811115610c7c57610c7c613e08565b81526001820154602082015260029091015460409091015290525090506000610ca482612121565b90506000610cb4848b8b856121eb565b90506001816004811115610cca57610cca613e08565b03610d7557835460ff19166002908117855560405163114fc47560e11b81526001600160a01b0388169163229f88ea91610d0991908c90600401614817565b600060405180830381600087803b158015610d2357600080fd5b505af1158015610d37573d6000803e3d6000fd5b505050507f62520d049932cdee872e9b3c59c0f6073637147e5e9bc8b050b062430eaf5c9f8284604051610d6c92919061482e565b60405180910390a15b50505050806001019050610ac2565b50505050505092915050565b6000828152606b6020526040902060010154610dab8161221e565b610db58383612228565b505050565b603754600390610100900460ff16158015610ddc575060375460ff8083169116105b610e015760405162461bcd60e51b8152600401610df89061488d565b60405180910390fd5b6037805461ffff191660ff831617610100179055610e20600b8361224a565b6037805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b6001600160a01b0381163314610ed65760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610df8565b610a1c82826122ee565b60008281526070602090815260408083206001600160a01b038516845260020190915281205415155b9392505050565b610f18612310565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b610f4261236a565b610f4a6123d9565b565b610f54611c64565b610f5d816119f1565b15610f7b576040516327ddf84960e11b815260040160405180910390fd5b6000818152607160209081526040808320815160a0810190925280548252600180820154929391929184019160ff1690811115610fba57610fba613e08565b6001811115610fcb57610fcb613e08565b815260408051606080820183526002858101546001600160a01b039081168452600387015481166020858101919091526004880154858701528087019490945284518084018652600588015482168152600688015490911693810193909352600786015483850152838501929092528251808201909352600885018054919094019391839160ff169081111561106357611063613e08565b600281111561107457611074613e08565b8152600182015460208201526002909101546040918201529152606083015101519192505046146110de576060810151604090810151905163092048d160e11b81526001600160e01b03196000351660048201526024810191909152466044820152606401610df8565b7f04e8cbd836dea43a2dc7eb19de345cca3a8e6978a2ef5225d924775500f67c7c61110882612121565b82604051610e5a92919061482e565b61111f611c64565b816000819003611142576040516316ee9d3b60e11b815260040160405180910390fd5b60005b818110156111775761116f858583818110611162576111626147d7565b905060a002013385611caa565b600101611145565b5050505050565b603754600290610100900460ff161580156111a0575060375460ff8083169116105b6111bc5760405162461bcd60e51b8152600401610df89061488d565b6037805461ffff191660ff8316176101001790556074546111e8906008906001600160a01b031661224a565b607554611200906003906001600160a01b031661224a565b60775461121890600a906001600160a01b031661224a565b607480546001600160a01b031990811690915560758054821690556077805490911690556037805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b604080518082018252600080825260208083018290526001600160a01b038616825260738152838220858352905282902082518084019093528054919291829060ff1660028111156112d4576112d4613e08565b60028111156112e5576112e5613e08565b815290546001600160a01b0361010090910481166020928301529082015191925016610a0357604051631b79f53b60e21b815260040160405180910390fd5b61132c612310565b600083900361134e576040516316ee9d3b60e11b815260040160405180910390fd5b61135a8484848461242b565b50505050565b60008061136b612310565b611375848461250e565b915091505b9250929050565b600061139361138e612598565b612605565b905090565b607160209081526000918252604091829020805460018201548451606080820187526002808601546001600160a01b03908116845260038701548116848901526004870154848a015288518084018a526005880154821681526006880154909116978101979097526007860154878901528751918201909752600885018054949760ff94851697939693959394929391928492169081111561143c5761143c613e08565b600281111561144d5761144d613e08565b815260200160018201548152602001600282015481525050905085565b61147261236a565b610f4a61263b565b611482612310565b61148b81612678565b610a1c828261224a565b6000828152606c60205260408120610f0990836126ae565b6000918252606b602090815260408084206001600160a01b0393909316845291905290205460ff1690565b603754610100900460ff16158080156114f85750603754600160ff909116105b806115125750303b158015611512575060375460ff166001145b61152e5760405162461bcd60e51b8152600401610df89061488d565b6037805460ff191660011790558015611551576037805461ff0019166101001790555b61155c60008d6126ba565b6115668b8b6126c4565b611570898961250e565b506000905061157f86806148db565b905011156115d1576115b261159486806148db565b6115a160208901896148db565b6115ab89806148db565b8989612754565b6115d16115bf86806148db565b6115cc60208801886148db565b61242b565b8015611617576037805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050505050565b606061162f611c64565b611637611d79565b81806001600160401b03811115611650576116506141f9565b604051908082528060200260200182016040528015611679578160200160208202803683370190505b5091506000611686611381565b9050611690613bc0565b60005b83811015611739578686828181106116ad576116ad6147d7565b905061016002018036038101906116c49190614746565b915060026040808401518101516000908152606f6020908152828220865183529052205460ff1660048111156116fc576116fc613e08565b03611726576001858281518110611715576117156147d7565b911515602092830291909101909101525b611731823385611e1a565b600101611693565b5050505092915050565b61174b612310565b610a1c82826126c4565b6000818152606c60205260408120610a0390612970565b6000828152606b60205260409020600101546117878161221e565b610db583836122ee565b600061179b612598565b6001546117a8919061493a565b6002546117b5908461493a565b101592915050565b6117c5612310565b60008790036117f5576000356001600160e01b0319166040516306b5667560e21b8152600401610df89190614415565b6118058888888888888888612754565b5050505050505050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f81111561184657611846613e08565b60ff1681526020810191909152604001600020546001600160a01b0316905080611885578160405163409140df60e11b8152600401610df89190614951565b919050565b6060816001600160401b038111156118a4576118a46141f9565b6040519080825280602002602001820160405280156118d757816020015b60608152602001906001900390816118c25790505b50905060005b828110156119e957600085815260726020526040812090858584818110611906576119066147d7565b905060200201602081019061191b9190613dc9565b6001600160a01b03166001600160a01b0316815260200190815260200160002080546119469061496b565b80601f01602080910402602001604051908101604052809291908181526020018280546119729061496b565b80156119bf5780601f10611994576101008083540402835291602001916119bf565b820191906000526020600020905b8154815290600101906020018083116119a257829003601f168201915b50505050508282815181106119d6576119d66147d7565b60209081029190910101526001016118dd565b509392505050565b6000600260008381526070602052604090205460ff166004811115611a1857611a18613e08565b1492915050565b611a27611c64565b611a2f611d79565b33838015801590611a3f57508083145b611a6a576000356001600160e01b0319166040516306b5667560e21b8152600401610df89190614415565b6000611a74611381565b9050600080611a83600361180f565b905060005b84811015611c0e57898982818110611aa257611aa26147d7565b905060200201359250878782818110611abd57611abd6147d7565b9050602002810190611acf919061499f565b60008581526072602090815260408083206001600160a01b038c168452909152902091611afd919083614a35565b5060405163c7c4fea960e01b81526001600160a01b0383169063c7c4fea990611b2f9060019087908b906004016147ed565b600060405180830381600087803b158015611b4957600080fd5b505af1158015611b5d573d6000803e3d6000fd5b50505060008481526076602052604081209150611b7c828988886121eb565b90506001816004811115611b9257611b92613e08565b03611c0457815460ff1916600217825560405163114fc47560e11b81526001600160a01b0385169063229f88ea90611bd1906001908990600401614817565b600060405180830381600087803b158015611beb57600080fd5b505af1158015611bff573d6000803e3d6000fd5b505050505b5050600101611a88565b50505050505050505050565b60006001600160e01b03198216635a05180f60e01b1480610a035750610a038261297a565b60006001600160e01b03198216630271189760e51b1480610a035750610a0382611c1a565b60005460ff1615610f4a5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610df8565b611cc4611cbf36859003850160408601614af4565b6129af565b611ccd836129f3565b6000611ce8611ce26040860160208701613dc9565b83611280565b80519091506002811115611cfe57611cfe613e08565b611d0e6060860160408701614b10565b6002811115611d1f57611d1f613e08565b14611d3c5760405162035e2b60ea1b815260040160405180910390fd5b611d6983611d506040870160208801613dc9565b611d6236889003880160408901614af4565b9190612a71565b6111778483858460200151612bfc565b611d83600b61180f565b604051635a02d57960e11b81523360048201526001600160a01b03919091169063b405aaf290602401602060405180830381865afa158015611dc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ded9190614b2b565b610f4a576000356001600160e01b0319166006604051620f948f60ea1b8152600401610df8929190614b4d565b82516080840151611e2a906129af565b600084602001516001811115611e4257611e42613e08565b14611e605760405163182f3d8760e11b815260040160405180910390fd5b4684606001516040015114611eae576060840151604090810151905163092048d160e11b81526001600160e01b03196000351660048201526024810191909152466044820152606401610df8565b6000611eca856060015160200151866040015160400151611280565b6080860151519091506002811115611ee457611ee4613e08565b81516002811115611ef757611ef7613e08565b148015611f2157508460400151602001516001600160a01b031681602001516001600160a01b0316145b611f3e5760405163f4b8742f60e01b815260040160405180910390fd5b6040808601518101516000908152606f6020908152828220858352905290812090611f6887612121565b90506000611f78838888856121eb565b905087604001516040015185886001600160a01b03167f48c4262ed68beb92fe5d7d48d70772e49cd50c317937dea60a99f15f794b645985604051611fbf91815260200190565b60405180910390a46000611fd3600361180f565b90506001826004811115611fe957611fe9613e08565b036120b357835460ff191660021784556060890151805160209091015160808b01516120189290916000612d8e565b885160405163114fc47560e11b81526001600160a01b0383169163229f88ea9161204791600091600401614817565b600060405180830381600087803b15801561206157600080fd5b505af1158015612075573d6000803e3d6000fd5b505050507f8d20d8121a34dded9035ff5b43e901c142824f7a22126392992c353c37890524838a6040516120aa92919061482e565b60405180910390a15b885160405163c7c4fea960e01b81526001600160a01b0383169163c7c4fea9916120e4916000918d906004016147ed565b600060405180830381600087803b1580156120fe57600080fd5b505af1158015612112573d6000803e3d6000fd5b50505050505050505050505050565b6000806121318360400151612fa7565b905060006121428460600151612fa7565b905060006121968560800151604080517f1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d815282516020808301919091528301518183015291015160608201526080902090565b604080517fb9d1fe7c9deeec5dc90a2f47ff1684239519f2545b2228d3d91fb27df3189eea815287516020808301919091529097015190870152606086019390935250608084015260a08301525060c0902090565b60006121f8858584612fef565b600061220486846130a5565b9050612212868583866131a9565b9150505b949350505050565b610a5081336131f5565b6122328282613259565b6000828152606c60205260409020610db590826132df565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f81111561228057612280613e08565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f8111156122c1576122c1613e08565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b6122f882826132f4565b6000828152606c60205260409020610db5908261335b565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610f4a576000356001600160e01b0319166001604051620f948f60ea1b8152600401610df8929190614b4d565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314806123ac57506005546001600160a01b031633145b610f4a576000356001600160e01b0319166001604051620f948f60ea1b8152600401610df8929190614b4d565b6123e1613370565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b828114612459576000356001600160e01b0319166040516306b5667560e21b8152600401610df89190614415565b60005b838110156124ca57828282818110612476576124766147d7565b9050602002013560386000878785818110612493576124936147d7565b90506020020160208101906124a89190613dc9565b6001600160a01b0316815260208101919091526040016000205560010161245c565b507f6f52f53a938df83439fa4c6055c7df0a6906d621aa6dfa4708187037fdfc41da848484846040516125009493929190614bf6565b60405180910390a150505050565b600080828411156125325760405163964a4d2760e01b815260040160405180910390fd5b505060018054600254607885905560798490556004805493840190556040805183815260208101839052929391928592879290917feac82d4d949d2d4f77f96aa68ab6b1bb750da73f14e55d41a1b93f387471ecba910160405180910390a49250929050565b60006125a4600b61180f565b6001600160a01b03166306aba0e16040518163ffffffff1660e01b8152600401602060405180830381865afa1580156125e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113939190614c28565b600060025460016002548460015461261d919061493a565b6126279190614c41565b6126319190614c54565b610a039190614c67565b612643611c64565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861240e3390565b806001600160a01b03163b600003610a5057604051630bfc64a360e21b81526001600160a01b0382166004820152602401610df8565b6000610f0983836133b9565b610a1c8282612228565b808211156126f3576000356001600160e01b0319166040516387f6f09560e01b8152600401610df89190614415565b6001805460028054858455908490556004805493840190556040805183815260208101839052929391928592879290917f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a450505050565b868514801561276257508683145b61278d576000356001600160e01b0319166040516306b5667560e21b8152600401610df89190614415565b60005b87811015612920578686828181106127aa576127aa6147d7565b90506020020160208101906127bf9190613dc9565b607360008b8b858181106127d5576127d56147d7565b90506020020160208101906127ea9190613dc9565b6001600160a01b03166001600160a01b03168152602001908152602001600020600087878581811061281e5761281e6147d7565b90506020020135815260200190815260200160002060000160016101000a8154816001600160a01b0302191690836001600160a01b0316021790555082828281811061286c5761286c6147d7565b90506020020160208101906128819190614b10565b607360008b8b85818110612897576128976147d7565b90506020020160208101906128ac9190613dc9565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008787858181106128e0576128e06147d7565b60209081029290920135835250810191909152604001600020805460ff1916600183600281111561291357612913613e08565b0217905550600101612790565b507f2544bff60c6d5b84946e06804af9f84e150bbee85238dbdee79efca4e0adf401888888888888888860405161295e989796959493929190614c89565b60405180910390a15050505050505050565b6000610a03825490565b60006001600160e01b03198216637965db0b60e01b1480610a0357506301ffc9a760e01b6001600160e01b0319831614610a03565b6129b8816133e3565b806129c757506129c78161341a565b806129d657506129d681613442565b610a505760405163034992a760e51b815260040160405180910390fd5b6000612a056060830160408401614b10565b6002811115612a1657612a16613e08565b148015612a53575060386000612a326040840160208501613dc9565b6001600160a01b031681526020810191909152604001600020546080820135105b15610a5057604051636eff4a8560e11b815260040160405180910390fd5b600060608185516002811115612a8957612a89613e08565b03612b645760408581015181516001600160a01b03878116602483015230604483015260648083019390935283518083039093018352608490910183526020820180516001600160e01b03166323b872dd60e01b179052915191851691612af09190614d18565b6000604051808303816000865af19150503d8060008114612b2d576040519150601f19603f3d011682016040523d82523d6000602084013e612b32565b606091505b509092509050818015612b5d575080511580612b5d575080806020019051810190612b5d9190614b2b565b9150612bd6565b600185516002811115612b7957612b79613e08565b03612b8e57612b5d838530886020015161346b565b600285516002811115612ba357612ba3613e08565b03612bbd57612b5d83853088602001518960400151613519565b6040516361e411a760e11b815260040160405180910390fd5b816111775784843085604051639d2e4c6760e01b8152600401610df89493929190614d34565b606e805460009182612c0d83614d6a565b9091555090506000612c3484838588612c2b368c90038c018c614d83565b939291906135cd565b60008381526071602090815260409091208251815590820151600180830180549495508594909160ff19909116908381811115612c7357612c73613e08565b02179055506040828101518051600280850180546001600160a01b039384166001600160a01b03199182161790915560208085015160038801805491861691841691909117905593850151600487015560608701518051600588018054918616918416919091179055938401516006870180549190941691161790915591015160078301556080830151805160088401805492939092839160ff19909116906001908490811115612d2657612d26613e08565b0217905550602082015181600101556040820151816002015550509050507ff313c253a5be72c29d0deb2c8768a9543744ac03d6b3cafd50cc976f1c2632fc612d6e82612121565b82604051612d7d92919061482e565b60405180910390a150949350505050565b806001600160a01b0316826001600160a01b031603612e3b5760408085015190516001600160a01b0385169180156108fc02916000818181858888f19350505050612e3657806001600160a01b031663d0e30db085604001516040518263ffffffff1660e01b81526004016000604051808303818588803b158015612e1257600080fd5b505af1158015612e26573d6000803e3d6000fd5b5050505050612e36848484613639565b61135a565b600084516002811115612e5057612e50613e08565b03612f16576040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa158015612e9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ec09190614c28565b90508460400151811015612f0557612ee88330838860400151612ee39190614c54565b6136b8565b612f0557604051632f739fff60e11b815260040160405180910390fd5b612f10858585613639565b5061135a565b600184516002811115612f2b57612f2b613e08565b03612f5c57612f3f8284866020015161375d565b612e365760405163c8e3a09f60e01b815260040160405180910390fd5b600284516002811115612f7157612f71613e08565b03612bbd57612f8a828486602001518760400151613784565b612e36576040516334b471a760e21b815260040160405180910390fd5b604080517f353bdd8d69b9e3185b3972e08b03845c0c14a21a390215302776a7a34b0e8764815282516020808301919091528301518183015291015160608201526080902090565b60008360030154118015613007575042836003015411155b1561301857825460ff191660041783555b6001600160a01b03821660009081526002840160205260409020541561305c5760405163025fd59560e41b81526001600160a01b0383166004820152602401610df8565b6001600160a01b039091166000818152600284016020908152604082209390935560059093018054600181018255908452919092200180546001600160a01b0319169091179055565b60008060006130b4600b61180f565b6001600160a01b031663c441c4a86040518163ffffffff1660e01b8152600401600060405180830381865afa1580156130f1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526131199190810190614e3e565b81519194509250905060005b818110156117395785876002016000868481518110613146576131466147d7565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002054036131a157828181518110613186576131866147d7565b60200260200101516bffffffffffffffffffffffff16850194505b600101613125565b60008383101580156131d057506000855460ff1660048111156131ce576131ce613e08565b145b156131e857845460ff19166001908117865585018290555b5050915460ff1692915050565b6131ff82826114ad565b610a1c57613217816001600160a01b031660146137ad565b6132228360206137ad565b604051602001613233929190614f36565b60408051601f198184030181529082905262461bcd60e51b8252610df891600401614fab565b61326382826114ad565b610a1c576000828152606b602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561329b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610f09836001600160a01b038416613948565b6132fe82826114ad565b15610a1c576000828152606b602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610f09836001600160a01b038416613997565b60005460ff16610f4a5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610df8565b60008260000182815481106133d0576133d06147d7565b9060005260206000200154905092915050565b600080825160028111156133f9576133f9613e08565b14801561340a575060008260400151115b8015610a03575050602001511590565b600060018251600281111561343157613431613e08565b148015610a03575050604001511590565b600060028251600281111561345957613459613e08565b148015610a0357505060400151151590565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928716916134cb91614d18565b6000604051808303816000865af19150503d8060008114613508576040519150601f19603f3d011682016040523d82523d6000602084013e61350d565b606091505b50909695505050505050565b604080516000808252602082019092526001600160a01b0387169061354990879087908790879060448101614fbe565b60408051601f198184030181529181526020820180516001600160e01b0316637921219560e11b1790525161357e9190614d18565b6000604051808303816000865af19150503d80600081146135bb576040519150601f19603f3d011682016040523d82523d6000602084013e6135c0565b606091505b5090979650505050505050565b6135d5613bc0565b92835260016020808501919091526060840180516001600160a01b0396871690528682015181519087169083015251466040918201528651818601805191881690915280519490961693909101929092529251810192909252910151608082015290565b6000808451600281111561364f5761364f613e08565b0361366a5761366382848660400151613a8a565b9050613694565b60018451600281111561367f5761367f613e08565b03612bbd57613663823085876020015161346b565b8061135a578383836040516341bd7d9160e11b8152600401610df893929190614ff8565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b03166340c10f1960e01b179052915160009286169161371091614d18565b6000604051808303816000865af19150503d806000811461374d576040519150601f19603f3d011682016040523d82523d6000602084013e613752565b606091505b509095945050505050565b600061376b8430858561346b565b905080610f095761377d8484846136b8565b9050610f09565b60006137938530868686613519565b905080612216576137a685858585613b5d565b9050612216565b606060006137bc83600261493a565b6137c7906002614c41565b6001600160401b038111156137de576137de6141f9565b6040519080825280601f01601f191660200182016040528015613808576020820181803683370190505b509050600360fc1b81600081518110613823576138236147d7565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613852576138526147d7565b60200101906001600160f81b031916908160001a905350600061387684600261493a565b613881906001614c41565b90505b60018111156138f9576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106138b5576138b56147d7565b1a60f81b8282815181106138cb576138cb6147d7565b60200101906001600160f81b031916908160001a90535060049490941c936138f281615028565b9050613884565b508315610f095760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610df8565b600081815260018301602052604081205461398f57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610a03565b506000610a03565b60008181526001830160205260408120548015613a805760006139bb600183614c54565b85549091506000906139cf90600190614c54565b9050818114613a345760008660000182815481106139ef576139ef6147d7565b9060005260206000200154905080876000018481548110613a1257613a126147d7565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613a4557613a4561503f565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610a03565b6000915050610a03565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b179052915160009260609290871691613ae79190614d18565b6000604051808303816000865af19150503d8060008114613b24576040519150601f19603f3d011682016040523d82523d6000602084013e613b29565b606091505b509092509050818015613b54575080511580613b54575080806020019051810190613b549190614b2b565b95945050505050565b604080516000808252602082019092526001600160a01b03861690613b8b9086908690869060448101615055565b60408051601f198184030181529181526020820180516001600160e01b031663731133e960e01b179052516134cb9190614d18565b6040805160a08101825260008082526020808301829052835160608082018652838252818301849052818601849052848601919091528451808201865283815280830184905280860184905281850152845190810185528281529081018290529283015290608082015290565b600060208284031215613c3f57600080fd5b81356001600160e01b031981168114610f0957600080fd5b60008082840360c0811215613c6b57600080fd5b60a0811215613c7957600080fd5b50919360a08501359350915050565b60006101608284031215613c9b57600080fd5b50919050565b60008083601f840112613cb357600080fd5b5081356001600160401b03811115613cca57600080fd5b6020830191508360208260051b850101111561137a57600080fd5b60008060208385031215613cf857600080fd5b82356001600160401b03811115613d0e57600080fd5b613d1a85828601613ca1565b90969095509350505050565b6020808252825182820181905260009190848201906040850190845b8181101561350d578351151583529284019291840191600101613d42565b600060208284031215613d7257600080fd5b5035919050565b6001600160a01b0381168114610a5057600080fd5b803561188581613d79565b60008060408385031215613dac57600080fd5b823591506020830135613dbe81613d79565b809150509250929050565b600060208284031215613ddb57600080fd5b8135610f0981613d79565b60008060408385031215613df957600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b6080810160058610613e3257613e32613e08565b9481526020810193909352604083019190915260609091015290565b600080600060408486031215613e6357600080fd5b83356001600160401b0380821115613e7a57600080fd5b818601915086601f830112613e8e57600080fd5b813581811115613e9d57600080fd5b87602060a083028501011115613eb257600080fd5b6020928301989097509590910135949350505050565b60008060408385031215613edb57600080fd5b8235613ee681613d79565b946020939093013593505050565b60038110610a5057610a50613e08565b81516040820190613f1481613ef4565b82526020928301516001600160a01b0316929091019190915290565b60008060008060408587031215613f4657600080fd5b84356001600160401b0380821115613f5d57600080fd5b613f6988838901613ca1565b90965094506020870135915080821115613f8257600080fd5b50613f8f87828801613ca1565b95989497509550505050565b60028110613fab57613fab613e08565b9052565b80516001600160a01b03908116835260208083015190911690830152604090810151910152565b8051613fe181613ef4565b825260208181015190830152604090810151910152565b858152610160810161400d6020830187613f9b565b61401a6040830186613faf565b61402760a0830185613faf565b614035610100830184613fd6565b9695505050505050565b80356010811061188557600080fd5b6000806040838503121561406157600080fd5b61406a8361403f565b91506020830135613dbe81613d79565b8060408101831015610a0357600080fd5b60008060008060008060008060008060006101208c8e0312156140ad57600080fd5b6140b68c613d8e565b9a5060208c0135995060408c0135985060608c0135975060808c013596506001600160401b038060a08e013511156140ed57600080fd5b6140fd8e60a08f01358f01613ca1565b909750955060c08d013581101561411357600080fd5b6141238e60c08f01358f0161407a565b94508060e08e0135111561413657600080fd5b6141468e60e08f01358f0161407a565b9350806101008e0135111561415a57600080fd5b5061416c8d6101008e01358e01613ca1565b81935080925050509295989b509295989b9093969950565b6000806020838503121561419757600080fd5b82356001600160401b03808211156141ae57600080fd5b818501915085601f8301126141c257600080fd5b8135818111156141d157600080fd5b866020610160830285010111156141e757600080fd5b60209290920196919550909350505050565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715614231576142316141f9565b60405290565b604051601f8201601f191681016001600160401b038111828210171561425f5761425f6141f9565b604052919050565b60006001600160401b03821115614280576142806141f9565b5060051b60200190565b600082601f83011261429b57600080fd5b813560206142b06142ab83614267565b614237565b8083825260208201915060208460051b8701019350868411156142d257600080fd5b602086015b848110156142ee57803583529183019183016142d7565b509695505050505050565b600082601f83011261430a57600080fd5b81356001600160401b03811115614323576143236141f9565b614336601f8201601f1916602001614237565b81815284602083860101111561434b57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561438057600080fd5b853561438b81613d79565b9450602086013561439b81613d79565b935060408601356001600160401b03808211156143b757600080fd5b6143c389838a0161428a565b945060608801359150808211156143d957600080fd5b6143e589838a0161428a565b935060808801359150808211156143fb57600080fd5b50614408888289016142f9565b9150509295509295909350565b6001600160e01b031991909116815260200190565b6000806000806000806000806080898b03121561444657600080fd5b88356001600160401b038082111561445d57600080fd5b6144698c838d01613ca1565b909a50985060208b013591508082111561448257600080fd5b61448e8c838d01613ca1565b909850965060408b01359150808211156144a757600080fd5b6144b38c838d01613ca1565b909650945060608b01359150808211156144cc57600080fd5b506144d98b828c01613ca1565b999c989b5096995094979396929594505050565b6000602082840312156144ff57600080fd5b610f098261403f565b60008060006040848603121561451d57600080fd5b8335925060208401356001600160401b0381111561453a57600080fd5b61454686828701613ca1565b9497909650939450505050565b60005b8381101561456e578181015183820152602001614556565b50506000910152565b6000815180845261458f816020860160208601614553565b601f01601f19169290920160200192915050565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b828110156145fa57603f198886030184526145e8858351614577565b945092850192908501906001016145cc565b5092979650505050505050565b600080600080600060a0868803121561461f57600080fd5b853561462a81613d79565b9450602086013561463a81613d79565b9350604086013592506060860135915060808601356001600160401b0381111561466357600080fd5b614408888289016142f9565b60008060006060848603121561468457600080fd5b8335925060208401359150604084013561469d81613d79565b809150509250925092565b6000606082840312156146ba57600080fd5b6146c261420f565b905081356146cf81613d79565b815260208201356146df81613d79565b806020830152506040820135604082015292915050565b80356003811061188557600080fd5b60006060828403121561471757600080fd5b61471f61420f565b905061472a826146f6565b8152602082013560208201526040820135604082015292915050565b6000610160828403121561475957600080fd5b60405160a081018181106001600160401b038211171561477b5761477b6141f9565b6040528235815260208301356002811061479457600080fd5b60208201526147a684604085016146a8565b60408201526147b88460a085016146a8565b60608201526147cb846101008501614705565b60808201529392505050565b634e487b7160e01b600052603260045260246000fd5b606081016147fa85613ef4565b93815260208101929092526001600160a01b031660409091015290565b6040810161482484613ef4565b9281526020015290565b6000610180820190508382528251602083015260208301516148536040840182613f9b565b5060408301516148666060840182613faf565b50606083015161487960c0840182613faf565b5060808301516119e9610120840182613fd6565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6000808335601e198436030181126148f257600080fd5b8301803591506001600160401b0382111561490c57600080fd5b6020019150600581901b360382131561137a57600080fd5b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610a0357610a03614924565b602081016010831061496557614965613e08565b91905290565b600181811c9082168061497f57607f821691505b602082108103613c9b57634e487b7160e01b600052602260045260246000fd5b6000808335601e198436030181126149b657600080fd5b8301803591506001600160401b038211156149d057600080fd5b60200191503681900382131561137a57600080fd5b601f821115610db5576000816000526020600020601f850160051c81016020861015614a0e5750805b601f850160051c820191505b81811015614a2d57828155600101614a1a565b505050505050565b6001600160401b03831115614a4c57614a4c6141f9565b614a6083614a5a835461496b565b836149e5565b6000601f841160018114614a945760008515614a7c5750838201355b600019600387901b1c1916600186901b178355611177565b600083815260209020601f19861690835b82811015614ac55786850135825560209485019460019092019101614aa5565b5086821015614ae25760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b600060608284031215614b0657600080fd5b610f098383614705565b600060208284031215614b2257600080fd5b610f09826146f6565b600060208284031215614b3d57600080fd5b81518015158114610f0957600080fd5b6001600160e01b03198316815260408101600b8310614b6e57614b6e613e08565b8260208301529392505050565b8183526000602080850194508260005b85811015614bb9578135614b9e81613d79565b6001600160a01b031687529582019590820190600101614b8b565b509495945050505050565b81835260006001600160fb1b03831115614bdd57600080fd5b8260051b80836020870137939093016020019392505050565b604081526000614c0a604083018688614b7b565b8281036020840152614c1d818587614bc4565b979650505050505050565b600060208284031215614c3a57600080fd5b5051919050565b80820180821115610a0357610a03614924565b81810381811115610a0357610a03614924565b600082614c8457634e487b7160e01b600052601260045260246000fd5b500490565b608081526000614c9d608083018a8c614b7b565b60208382036020850152614cb2828a8c614b7b565b91508382036040850152614cc782888a614bc4565b848103606086015285815286925060200160005b86811015614d0757614cec846146f6565b614cf581613ef4565b82529282019290820190600101614cdb565b509c9b505050505050505050505050565b60008251614d2a818460208701614553565b9190910192915050565b60c08101614d428287613fd6565b6001600160a01b0394851660608301529284166080820152921660a090920191909152919050565b600060018201614d7c57614d7c614924565b5060010190565b600060a08284031215614d9557600080fd5b614d9d61420f565b8235614da881613d79565b81526020830135614db881613d79565b6020820152614dca8460408501614705565b60408201529392505050565b600082601f830112614de757600080fd5b81516020614df76142ab83614267565b8083825260208201915060208460051b870101935086841115614e1957600080fd5b602086015b848110156142ee578051614e3181613d79565b8352918301918301614e1e565b600080600060608486031215614e5357600080fd5b83516001600160401b0380821115614e6a57600080fd5b614e7687838801614dd6565b9450602091508186015181811115614e8d57600080fd5b614e9988828901614dd6565b945050604086015181811115614eae57600080fd5b86019050601f81018713614ec157600080fd5b8051614ecf6142ab82614267565b81815260059190911b82018301908381019089831115614eee57600080fd5b928401925b82841015614f275783516bffffffffffffffffffffffff81168114614f185760008081fd5b82529284019290840190614ef3565b80955050505050509250925092565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351614f6e816017850160208801614553565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351614f9f816028840160208801614553565b01602801949350505050565b602081526000610f096020830184614577565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090614c1d90830184614577565b60a081016150068286613fd6565b6001600160a01b03938416606083015291909216608090920191909152919050565b60008161503757615037614924565b506000190190565b634e487b7160e01b600052603160045260246000fd5b60018060a01b0385168152836020820152826040820152608060608201526000614035608083018461457756fea2646970667358221220f2c96cbb22626006ee11ff90975b91b23886e548ed7a61504409d1948b356f0f64736f6c63430008170033", + "nonce": "0x2f12c" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x88f864693662cd6f8b970cb5f1f0d8ef9c75a182d113c7922eeed584f677c694", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0xd24d87ddc1917165435b306aac68d99e0f49a3fa", + "to": "0xb0507f2f22697022ecb25963a00d3d076dac5753", + "gas": "0x8fcf4", + "value": "0x0", + "data": "0x663ac0110000000000000000000000000000000000000000000000000000000066309b0400000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000054000000000000000000000000000000000000000000000000000000000000010a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000110000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000003a00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000046000000000000000000000000000000000000000000000000000000000000005400000000000000000000000000000000000000000000000000000000000000620000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000007e0000000000000000000000000000000000000000000000000000000000000084000000000000000000000000000000000000000000000000000000000000008a00000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000000000096000000000000000000000000000000000000000000000000000000000000009c00000000000000000000000000000000000000000000000000000000000000ac00000000000000000000000000000000000000000000000000000000000000b2000000000000000000000000000000000000000000000000000000000000000844f1ef2860000000000000000000000007beb0f3fc4002c4542015cfa9023dee1a9ec9400000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000045cd8a76b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe6000000000000000000000000b03e29be08e57b2d95fe9f94966cb86a0dd984810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000003a3a92ba9d4d49aae06861136d547667c742f1af0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe6000000000000000000000000da48f437eb827cb997a7d09487d53be72f2c57a80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000004222384e84c248aa8d50fdc702a1b55e6b4efc990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c44bb5274a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006435da8121000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x262" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x1ed4ca9cd1570633ec8d8cf949a11a1eae6f7d0b057820ef078e6942e5dffa40", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0xb033ba62ec622dc54d0abfe0254e79692147ca26", + "to": "0xb0507f2f22697022ecb25963a00d3d076dac5753", + "gas": "0x112a880", + "value": "0x0", + "data": "0xa8a0e32c00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000007e50000000000000000000000000000000000000000000000000000000066309b0400000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000010c000000000000000000000000000000000000000000000000000000000000000110000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000003a00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000046000000000000000000000000000000000000000000000000000000000000005400000000000000000000000000000000000000000000000000000000000000620000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000007e0000000000000000000000000000000000000000000000000000000000000084000000000000000000000000000000000000000000000000000000000000008a00000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000000000096000000000000000000000000000000000000000000000000000000000000009c00000000000000000000000000000000000000000000000000000000000000ac00000000000000000000000000000000000000000000000000000000000000b2000000000000000000000000000000000000000000000000000000000000000844f1ef2860000000000000000000000007beb0f3fc4002c4542015cfa9023dee1a9ec9400000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000045cd8a76b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe6000000000000000000000000b03e29be08e57b2d95fe9f94966cb86a0dd984810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000003a3a92ba9d4d49aae06861136d547667c742f1af0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe6000000000000000000000000da48f437eb827cb997a7d09487d53be72f2c57a80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000004222384e84c248aa8d50fdc702a1b55e6b4efc990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c44bb5274a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006435da8121000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x65" + }, + "additionalContracts": [], + "isFixedGasLimit": true + }, + { + "hash": "0xf622879aa1f3a4de0e870483dd4231e94a67fd543b823ed6333c43ab9283c881", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", + "function": null, + "arguments": null, + "transaction": { + "type": "0x00", + "from": "0x087d08e3ba42e64e3948962dd1371f906d1278b9", + "to": "0xb0507f2f22697022ecb25963a00d3d076dac5753", + "gas": "0x112a880", + "value": "0x0", + "data": "0xa8a0e32c00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000007e50000000000000000000000000000000000000000000000000000000066309b0400000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000010c000000000000000000000000000000000000000000000000000000000000000110000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000003a00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000046000000000000000000000000000000000000000000000000000000000000005400000000000000000000000000000000000000000000000000000000000000620000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000007e0000000000000000000000000000000000000000000000000000000000000084000000000000000000000000000000000000000000000000000000000000008a00000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000000000096000000000000000000000000000000000000000000000000000000000000009c00000000000000000000000000000000000000000000000000000000000000ac00000000000000000000000000000000000000000000000000000000000000b2000000000000000000000000000000000000000000000000000000000000000844f1ef2860000000000000000000000007beb0f3fc4002c4542015cfa9023dee1a9ec9400000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000045cd8a76b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe6000000000000000000000000b03e29be08e57b2d95fe9f94966cb86a0dd984810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000003a3a92ba9d4d49aae06861136d547667c742f1af0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe6000000000000000000000000da48f437eb827cb997a7d09487d53be72f2c57a80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000004222384e84c248aa8d50fdc702a1b55e6b4efc990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c44bb5274a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006435da8121000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f4240", + "nonce": "0x5a" + }, + "additionalContracts": [], + "isFixedGasLimit": true + } + ], + "receipts": [ + { + "transactionHash": "0x0206aa397c251997e5fef0b9533415b0e0400594367f9203456e008d05499501", + "transactionIndex": "0x0", + "blockHash": "0x23a6f4ec211937ac48764496fd88302fb7adda78d3f57e829157f4dfe696f60f", + "blockNumber": "0x1949928", + "from": "0xe1100401454B5f850b09f3b92cE7f071C5F1CEF4", + "to": "0x53Ea388CB72081A3a397114a43741e7987815896", + "cumulativeGasUsed": "0x29401", + "gasUsed": "0x29401", + "contractAddress": null, + "logs": [ + { + "address": "0x53Ea388CB72081A3a397114a43741e7987815896", + "topics": [ + "0x1203f9e81c814a35f5f4cc24087b2a24c6fb7986a9f1406b68a9484882c93a23", + "0xc3d2b68e9a7c0ec3a1a5df197f5a38348c52edd72740f605436476faa32cab1c", + "0x000000000000000000000000e1100401454b5f850b09f3b92ce7f071c5f1cef4" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064", + "blockHash": "0x23a6f4ec211937ac48764496fd88302fb7adda78d3f57e829157f4dfe696f60f", + "blockNumber": "0x1949928", + "transactionHash": "0x0206aa397c251997e5fef0b9533415b0e0400594367f9203456e008d05499501", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + }, + { + "address": "0x53Ea388CB72081A3a397114a43741e7987815896", + "topics": [ + "0x5c819725ea53655a3b898f3df59b66489761935454e9212ca1e5ebd759953d0b", + "0xc3d2b68e9a7c0ec3a1a5df197f5a38348c52edd72740f605436476faa32cab1c" + ], + "data": "0x", + "blockHash": "0x23a6f4ec211937ac48764496fd88302fb7adda78d3f57e829157f4dfe696f60f", + "blockNumber": "0x1949928", + "transactionHash": "0x0206aa397c251997e5fef0b9533415b0e0400594367f9203456e008d05499501", + "transactionIndex": "0x0", + "logIndex": "0x1", + "removed": false + }, + { + "address": "0x1aD54D61F47acBcBA99fb6540A1694EB2F47AB95", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x00000000000000000000000053ea388cb72081a3a397114a43741e7987815896000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac5753", + "blockHash": "0x23a6f4ec211937ac48764496fd88302fb7adda78d3f57e829157f4dfe696f60f", + "blockNumber": "0x1949928", + "transactionHash": "0x0206aa397c251997e5fef0b9533415b0e0400594367f9203456e008d05499501", + "transactionIndex": "0x0", + "logIndex": "0x2", + "removed": false + }, + { + "address": "0x53Ea388CB72081A3a397114a43741e7987815896", + "topics": [ + "0xe134987599ae266ec90edeff1b26125b287dbb57b10822649432d1bb26537fba", + "0xc3d2b68e9a7c0ec3a1a5df197f5a38348c52edd72740f605436476faa32cab1c" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x23a6f4ec211937ac48764496fd88302fb7adda78d3f57e829157f4dfe696f60f", + "blockNumber": "0x1949928", + "transactionHash": "0x0206aa397c251997e5fef0b9533415b0e0400594367f9203456e008d05499501", + "transactionIndex": "0x0", + "logIndex": "0x3", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000020000020000000000000000000000000000000000000000000000000000020000000000000000004000000000000000000000000000000000000080000000000000004000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000040000000000200010000000000000000000000800000000000000000008000000080000000000000000400000000000000000010004000000000000000000000000000000000000000000400000000002000400000010000000000004000000000000000080000000000000000000004000000000000", + "type": "0x0", + "effectiveGasPrice": "0x4a817c800" + }, + { + "transactionHash": "0x88a3b563a8bda1da038e94a90d37b8c03d4383ec602b892ecfc2bc414d11fa93", + "transactionIndex": "0x0", + "blockHash": "0xaa0e3664f810a85208493e65f362b1b60122ae54abbd5390735e52f0635a6675", + "blockNumber": "0x194992b", + "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "to": null, + "cumulativeGasUsed": "0x15cb08", + "gasUsed": "0x15cb08", + "contractAddress": "0x7bEB0f3fC4002C4542015cFa9023dEE1A9EC9400", + "logs": [ + { + "address": "0x7bEB0f3fC4002C4542015cFa9023dEE1A9EC9400", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "blockHash": "0xaa0e3664f810a85208493e65f362b1b60122ae54abbd5390735e52f0635a6675", + "blockNumber": "0x194992b", + "transactionHash": "0x88a3b563a8bda1da038e94a90d37b8c03d4383ec602b892ecfc2bc414d11fa93", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x0", + "effectiveGasPrice": "0x4a817c800" + }, + { + "transactionHash": "0x9d4495274114cd427debfe5d5c13a3aa6b61ab3261ae9b7ad90a9fff9515d2f9", + "transactionIndex": "0x0", + "blockHash": "0x0903a71b1c8dec5f1043dbce7cb378d32d8cbcc404ca0ebd9d2e89f7b573bedb", + "blockNumber": "0x194992e", + "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "to": null, + "cumulativeGasUsed": "0x135cef", + "gasUsed": "0x135cef", + "contractAddress": "0xB03E29Be08E57b2d95Fe9F94966CB86a0DD98481", + "logs": [ + { + "address": "0xB03E29Be08E57b2d95Fe9F94966CB86a0DD98481", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "blockHash": "0x0903a71b1c8dec5f1043dbce7cb378d32d8cbcc404ca0ebd9d2e89f7b573bedb", + "blockNumber": "0x194992e", + "transactionHash": "0x9d4495274114cd427debfe5d5c13a3aa6b61ab3261ae9b7ad90a9fff9515d2f9", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000200000000000000000000400000000000000000000000000020000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x0", + "effectiveGasPrice": "0x4a817c800" + }, + { + "transactionHash": "0x654979ade55752136df9338da1f00bd477efeb2541fb0ba16c91a8157625d6cc", + "transactionIndex": "0x0", + "blockHash": "0x1f8e5f74f3a2a25883dea85a1692039de3060b6358f3c6415f8cea8572ed1dd0", + "blockNumber": "0x1949930", + "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "to": null, + "cumulativeGasUsed": "0x17da9d", + "gasUsed": "0x17da9d", + "contractAddress": "0x3a3A92ba9d4D49aae06861136D547667c742F1aF", + "logs": [ + { + "address": "0x3a3A92ba9d4D49aae06861136D547667c742F1aF", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "blockHash": "0x1f8e5f74f3a2a25883dea85a1692039de3060b6358f3c6415f8cea8572ed1dd0", + "blockNumber": "0x1949930", + "transactionHash": "0x654979ade55752136df9338da1f00bd477efeb2541fb0ba16c91a8157625d6cc", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x0", + "effectiveGasPrice": "0x4a817c800" + }, + { + "transactionHash": "0xf141319220c49fe33883a82d7d180ad835c4c2794bbb51bc2e5870ad27a9dfab", + "transactionIndex": "0x0", + "blockHash": "0xb7f0bc621431477d508d9ff0a19354707fa0a30b1e4b47ffba8de6213b04e559", + "blockNumber": "0x1949933", + "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "to": null, + "cumulativeGasUsed": "0x1033c4", + "gasUsed": "0x1033c4", + "contractAddress": "0x4222384E84C248aa8D50FDC702a1b55E6b4efc99", + "logs": [ + { + "address": "0x4222384E84C248aa8D50FDC702a1b55E6b4efc99", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "blockHash": "0xb7f0bc621431477d508d9ff0a19354707fa0a30b1e4b47ffba8de6213b04e559", + "blockNumber": "0x1949933", + "transactionHash": "0xf141319220c49fe33883a82d7d180ad835c4c2794bbb51bc2e5870ad27a9dfab", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000", + "type": "0x0", + "effectiveGasPrice": "0x4a817c800" + }, + { + "transactionHash": "0x6fb9b0e921f8b65c67263c1a0771bc8997d12461adb0a26b4da588ca1bbf485d", + "transactionIndex": "0x0", + "blockHash": "0x65e4be7bcc0faa02c0af4fc4ac37701930125e99d450b8b1bda30dbe6d02a0b0", + "blockNumber": "0x1949936", + "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "to": null, + "cumulativeGasUsed": "0x4556bc", + "gasUsed": "0x4556bc", + "contractAddress": "0xdA48f437Eb827CB997a7D09487D53bE72F2C57a8", + "logs": [ + { + "address": "0xdA48f437Eb827CB997a7D09487D53bE72F2C57a8", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "blockHash": "0x65e4be7bcc0faa02c0af4fc4ac37701930125e99d450b8b1bda30dbe6d02a0b0", + "blockNumber": "0x1949936", + "transactionHash": "0x6fb9b0e921f8b65c67263c1a0771bc8997d12461adb0a26b4da588ca1bbf485d", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000010000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x0", + "effectiveGasPrice": "0x4a817c800" + }, + { + "transactionHash": "0x88f864693662cd6f8b970cb5f1f0d8ef9c75a182d113c7922eeed584f677c694", + "transactionIndex": "0x0", + "blockHash": "0xed0ff2415597339efaa121b459b27c729e16939f12a02232abd4990ebd27cfba", + "blockNumber": "0x1949939", + "from": "0xd24D87DDc1917165435b306aAC68D99e0F49A3Fa", + "to": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", + "cumulativeGasUsed": "0x43ace", + "gasUsed": "0x43ace", + "contractAddress": null, + "logs": [ + { + "address": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", + "topics": [ + "0xa57d40f1496988cf60ab7c9d5ba4ff83647f67d3898d441a3aaf21b651678fd9", + "0x00000000000000000000000000000000000000000000000000000000000007e5", + "0x000000000000000000000000000000000000000000000000000000000000001c", + "0x633b2b0bafd8079174114e3dad0826c6f1b434ced40b5e9630de110e77934895" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000d24d87ddc1917165435b306aac68d99e0f49a3fa000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000007e50000000000000000000000000000000000000000000000000000000066309b0400000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000010c000000000000000000000000000000000000000000000000000000000000000110000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab950000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000003a00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000046000000000000000000000000000000000000000000000000000000000000005400000000000000000000000000000000000000000000000000000000000000620000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000007e0000000000000000000000000000000000000000000000000000000000000084000000000000000000000000000000000000000000000000000000000000008a00000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000000000096000000000000000000000000000000000000000000000000000000000000009c00000000000000000000000000000000000000000000000000000000000000ac00000000000000000000000000000000000000000000000000000000000000b2000000000000000000000000000000000000000000000000000000000000000844f1ef2860000000000000000000000007beb0f3fc4002c4542015cfa9023dee1a9ec9400000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000045cd8a76b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe6000000000000000000000000b03e29be08e57b2d95fe9f94966cb86a0dd984810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000003a3a92ba9d4d49aae06861136d547667c742f1af0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe6000000000000000000000000da48f437eb827cb997a7d09487d53be72f2c57a80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000004222384e84c248aa8d50fdc702a1b55e6b4efc990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c44bb5274a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006435da8121000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f2839700000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f4240", + "blockHash": "0xed0ff2415597339efaa121b459b27c729e16939f12a02232abd4990ebd27cfba", + "blockNumber": "0x1949939", + "transactionHash": "0x88f864693662cd6f8b970cb5f1f0d8ef9c75a182d113c7922eeed584f677c694", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + }, + { + "address": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", + "topics": [ + "0x1203f9e81c814a35f5f4cc24087b2a24c6fb7986a9f1406b68a9484882c93a23", + "0x633b2b0bafd8079174114e3dad0826c6f1b434ced40b5e9630de110e77934895", + "0x000000000000000000000000d24d87ddc1917165435b306aac68d99e0f49a3fa" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064", + "blockHash": "0xed0ff2415597339efaa121b459b27c729e16939f12a02232abd4990ebd27cfba", + "blockNumber": "0x1949939", + "transactionHash": "0x88f864693662cd6f8b970cb5f1f0d8ef9c75a182d113c7922eeed584f677c694", + "transactionIndex": "0x0", + "logIndex": "0x1", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000400010000100000100000000000000000000000000000000000000000000000000000000000000000000000000000000000200080000000000000000000000004000000000000000000000000000000000000000004000000000000000000400000000000000000000000000000000000000000040000000000000000000000000000000000000000000200000000000000000000000001000000000000000000000000008002000000000000000400008000000000000002000000000000000000000810000800000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000", + "type": "0x0", + "effectiveGasPrice": "0x4a817c800" + }, + { + "transactionHash": "0x1ed4ca9cd1570633ec8d8cf949a11a1eae6f7d0b057820ef078e6942e5dffa40", + "transactionIndex": "0x0", + "blockHash": "0x55b880d0d4edecf0ef5fc6797dec195ff82cb4683cca2a7e3a150e5ea2e82be8", + "blockNumber": "0x194993b", + "from": "0xb033ba62EC622dC54D0ABFE0254e79692147CA26", + "to": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", + "cumulativeGasUsed": "0x22834", + "gasUsed": "0x22834", + "contractAddress": null, + "logs": [ + { + "address": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", + "topics": [ + "0x1203f9e81c814a35f5f4cc24087b2a24c6fb7986a9f1406b68a9484882c93a23", + "0x633b2b0bafd8079174114e3dad0826c6f1b434ced40b5e9630de110e77934895", + "0x000000000000000000000000b033ba62ec622dc54d0abfe0254e79692147ca26" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064", + "blockHash": "0x55b880d0d4edecf0ef5fc6797dec195ff82cb4683cca2a7e3a150e5ea2e82be8", + "blockNumber": "0x194993b", + "transactionHash": "0x1ed4ca9cd1570633ec8d8cf949a11a1eae6f7d0b057820ef078e6942e5dffa40", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000004000000000000000000000000000000000000000004000000008000000000400000000010000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000100800000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000", + "type": "0x0", + "effectiveGasPrice": "0x4a817c800" + }, + { + "transactionHash": "0xf622879aa1f3a4de0e870483dd4231e94a67fd543b823ed6333c43ab9283c881", + "transactionIndex": "0x0", + "blockHash": "0x0691de3e386a9300e6acb17e73392cc3158a05f8771fe01a63276732df8ff400", + "blockNumber": "0x194993e", + "from": "0x087D08e3ba42e64E3948962dd1371F906D1278b9", + "to": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", + "cumulativeGasUsed": "0x77891", + "gasUsed": "0x77891", + "contractAddress": null, + "logs": [ + { + "address": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", + "topics": [ + "0x1203f9e81c814a35f5f4cc24087b2a24c6fb7986a9f1406b68a9484882c93a23", + "0x633b2b0bafd8079174114e3dad0826c6f1b434ced40b5e9630de110e77934895", + "0x000000000000000000000000087d08e3ba42e64e3948962dd1371f906d1278b9" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064", + "blockHash": "0x0691de3e386a9300e6acb17e73392cc3158a05f8771fe01a63276732df8ff400", + "blockNumber": "0x194993e", + "transactionHash": "0xf622879aa1f3a4de0e870483dd4231e94a67fd543b823ed6333c43ab9283c881", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + }, + { + "address": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", + "topics": [ + "0x5c819725ea53655a3b898f3df59b66489761935454e9212ca1e5ebd759953d0b", + "0x633b2b0bafd8079174114e3dad0826c6f1b434ced40b5e9630de110e77934895" + ], + "data": "0x", + "blockHash": "0x0691de3e386a9300e6acb17e73392cc3158a05f8771fe01a63276732df8ff400", + "blockNumber": "0x194993e", + "transactionHash": "0xf622879aa1f3a4de0e870483dd4231e94a67fd543b823ed6333c43ab9283c881", + "transactionIndex": "0x0", + "logIndex": "0x1", + "removed": false + }, + { + "address": "0x6E19cF519b7B83F7CE719B6d30232485d9609D95", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000007beb0f3fc4002c4542015cfa9023dee1a9ec9400" + ], + "data": "0x", + "blockHash": "0x0691de3e386a9300e6acb17e73392cc3158a05f8771fe01a63276732df8ff400", + "blockNumber": "0x194993e", + "transactionHash": "0xf622879aa1f3a4de0e870483dd4231e94a67fd543b823ed6333c43ab9283c881", + "transactionIndex": "0x0", + "logIndex": "0x2", + "removed": false + }, + { + "address": "0x6E19cF519b7B83F7CE719B6d30232485d9609D95", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000002", + "blockHash": "0x0691de3e386a9300e6acb17e73392cc3158a05f8771fe01a63276732df8ff400", + "blockNumber": "0x194993e", + "transactionHash": "0xf622879aa1f3a4de0e870483dd4231e94a67fd543b823ed6333c43ab9283c881", + "transactionIndex": "0x0", + "logIndex": "0x3", + "removed": false + }, + { + "address": "0x7FC81d20f7D1f53D0eA094fcBdd1b531B71225EB", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000b03e29be08e57b2d95fe9f94966cb86a0dd98481" + ], + "data": "0x", + "blockHash": "0x0691de3e386a9300e6acb17e73392cc3158a05f8771fe01a63276732df8ff400", + "blockNumber": "0x194993e", + "transactionHash": "0xf622879aa1f3a4de0e870483dd4231e94a67fd543b823ed6333c43ab9283c881", + "transactionIndex": "0x0", + "logIndex": "0x4", + "removed": false + }, + { + "address": "0x880c5da7bFF9740464287EBFE381Be1cCCCE4FEA", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000003a3a92ba9d4d49aae06861136d547667c742f1af" + ], + "data": "0x", + "blockHash": "0x0691de3e386a9300e6acb17e73392cc3158a05f8771fe01a63276732df8ff400", + "blockNumber": "0x194993e", + "transactionHash": "0xf622879aa1f3a4de0e870483dd4231e94a67fd543b823ed6333c43ab9283c881", + "transactionIndex": "0x0", + "logIndex": "0x5", + "removed": false + }, + { + "address": "0xCee681C9108c42C710c6A8A949307D5F13C9F3ca", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000da48f437eb827cb997a7d09487d53be72f2c57a8" + ], + "data": "0x", + "blockHash": "0x0691de3e386a9300e6acb17e73392cc3158a05f8771fe01a63276732df8ff400", + "blockNumber": "0x194993e", + "transactionHash": "0xf622879aa1f3a4de0e870483dd4231e94a67fd543b823ed6333c43ab9283c881", + "transactionIndex": "0x0", + "logIndex": "0x6", + "removed": false + }, + { + "address": "0x1aD54D61F47acBcBA99fb6540A1694EB2F47AB95", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000004222384e84c248aa8d50fdc702a1b55e6b4efc99" + ], + "data": "0x", + "blockHash": "0x0691de3e386a9300e6acb17e73392cc3158a05f8771fe01a63276732df8ff400", + "blockNumber": "0x194993e", + "transactionHash": "0xf622879aa1f3a4de0e870483dd4231e94a67fd543b823ed6333c43ab9283c881", + "transactionIndex": "0x0", + "logIndex": "0x7", + "removed": false + }, + { + "address": "0x6E19cF519b7B83F7CE719B6d30232485d9609D95", + "topics": [ + "0x865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c59", + "0x000000000000000000000000000000000000000000000000000000000000000b", + "0x0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf" + ], + "data": "0x", + "blockHash": "0x0691de3e386a9300e6acb17e73392cc3158a05f8771fe01a63276732df8ff400", + "blockNumber": "0x194993e", + "transactionHash": "0xf622879aa1f3a4de0e870483dd4231e94a67fd543b823ed6333c43ab9283c881", + "transactionIndex": "0x0", + "logIndex": "0x8", + "removed": false + }, + { + "address": "0x7FC81d20f7D1f53D0eA094fcBdd1b531B71225EB", + "topics": [ + "0x865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c59", + "0x000000000000000000000000000000000000000000000000000000000000000b", + "0x0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf" + ], + "data": "0x", + "blockHash": "0x0691de3e386a9300e6acb17e73392cc3158a05f8771fe01a63276732df8ff400", + "blockNumber": "0x194993e", + "transactionHash": "0xf622879aa1f3a4de0e870483dd4231e94a67fd543b823ed6333c43ab9283c881", + "transactionIndex": "0x0", + "logIndex": "0x9", + "removed": false + }, + { + "address": "0x880c5da7bFF9740464287EBFE381Be1cCCCE4FEA", + "topics": [ + "0x865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c59", + "0x000000000000000000000000000000000000000000000000000000000000000b", + "0x0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf" + ], + "data": "0x", + "blockHash": "0x0691de3e386a9300e6acb17e73392cc3158a05f8771fe01a63276732df8ff400", + "blockNumber": "0x194993e", + "transactionHash": "0xf622879aa1f3a4de0e870483dd4231e94a67fd543b823ed6333c43ab9283c881", + "transactionIndex": "0x0", + "logIndex": "0xa", + "removed": false + }, + { + "address": "0xCee681C9108c42C710c6A8A949307D5F13C9F3ca", + "topics": [ + "0x865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c59", + "0x000000000000000000000000000000000000000000000000000000000000000b", + "0x0000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf" + ], + "data": "0x", + "blockHash": "0x0691de3e386a9300e6acb17e73392cc3158a05f8771fe01a63276732df8ff400", + "blockNumber": "0x194993e", + "transactionHash": "0xf622879aa1f3a4de0e870483dd4231e94a67fd543b823ed6333c43ab9283c881", + "transactionIndex": "0x0", + "logIndex": "0xb", + "removed": false + }, + { + "address": "0x6E19cF519b7B83F7CE719B6d30232485d9609D95", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac57530000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf", + "blockHash": "0x0691de3e386a9300e6acb17e73392cc3158a05f8771fe01a63276732df8ff400", + "blockNumber": "0x194993e", + "transactionHash": "0xf622879aa1f3a4de0e870483dd4231e94a67fd543b823ed6333c43ab9283c881", + "transactionIndex": "0x0", + "logIndex": "0xc", + "removed": false + }, + { + "address": "0x7FC81d20f7D1f53D0eA094fcBdd1b531B71225EB", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac57530000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf", + "blockHash": "0x0691de3e386a9300e6acb17e73392cc3158a05f8771fe01a63276732df8ff400", + "blockNumber": "0x194993e", + "transactionHash": "0xf622879aa1f3a4de0e870483dd4231e94a67fd543b823ed6333c43ab9283c881", + "transactionIndex": "0x0", + "logIndex": "0xd", + "removed": false + }, + { + "address": "0x880c5da7bFF9740464287EBFE381Be1cCCCE4FEA", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac57530000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf", + "blockHash": "0x0691de3e386a9300e6acb17e73392cc3158a05f8771fe01a63276732df8ff400", + "blockNumber": "0x194993e", + "transactionHash": "0xf622879aa1f3a4de0e870483dd4231e94a67fd543b823ed6333c43ab9283c881", + "transactionIndex": "0x0", + "logIndex": "0xe", + "removed": false + }, + { + "address": "0xCee681C9108c42C710c6A8A949307D5F13C9F3ca", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac57530000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf", + "blockHash": "0x0691de3e386a9300e6acb17e73392cc3158a05f8771fe01a63276732df8ff400", + "blockNumber": "0x194993e", + "transactionHash": "0xf622879aa1f3a4de0e870483dd4231e94a67fd543b823ed6333c43ab9283c881", + "transactionIndex": "0x0", + "logIndex": "0xf", + "removed": false + }, + { + "address": "0x1aD54D61F47acBcBA99fb6540A1694EB2F47AB95", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac57530000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf", + "blockHash": "0x0691de3e386a9300e6acb17e73392cc3158a05f8771fe01a63276732df8ff400", + "blockNumber": "0x194993e", + "transactionHash": "0xf622879aa1f3a4de0e870483dd4231e94a67fd543b823ed6333c43ab9283c881", + "transactionIndex": "0x0", + "logIndex": "0x10", + "removed": false + }, + { + "address": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "topics": [ + "0xb85c58eeff9fe423669ae0841666f4c8499e8731b8275eb462e4fa1720ec420e" + ], + "data": "0x0000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb0000000000000000000000000000000000000000000000000000000000000001", + "blockHash": "0x0691de3e386a9300e6acb17e73392cc3158a05f8771fe01a63276732df8ff400", + "blockNumber": "0x194993e", + "transactionHash": "0xf622879aa1f3a4de0e870483dd4231e94a67fd543b823ed6333c43ab9283c881", + "transactionIndex": "0x0", + "logIndex": "0x11", + "removed": false + }, + { + "address": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac57530000000000000000000000008aaad4782890eb879a0fc132a6adf9e5ee708faf", + "blockHash": "0x0691de3e386a9300e6acb17e73392cc3158a05f8771fe01a63276732df8ff400", + "blockNumber": "0x194993e", + "transactionHash": "0xf622879aa1f3a4de0e870483dd4231e94a67fd543b823ed6333c43ab9283c881", + "transactionIndex": "0x0", + "logIndex": "0x12", + "removed": false + }, + { + "address": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", + "topics": [ + "0xe134987599ae266ec90edeff1b26125b287dbb57b10822649432d1bb26537fba", + "0x633b2b0bafd8079174114e3dad0826c6f1b434ced40b5e9630de110e77934895" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000003400000000000000000000000000000000000000000000000000000000000000360000000000000000000000000000000000000000000000000000000000000038000000000000000000000000000000000000000000000000000000000000003a000000000000000000000000000000000000000000000000000000000000003c000000000000000000000000000000000000000000000000000000000000003e00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000042000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x0691de3e386a9300e6acb17e73392cc3158a05f8771fe01a63276732df8ff400", + "blockNumber": "0x194993e", + "transactionHash": "0xf622879aa1f3a4de0e870483dd4231e94a67fd543b823ed6333c43ab9283c881", + "transactionIndex": "0x0", + "logIndex": "0x13", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x08000000000020000000104020000000400000800000000000000000000000000000000000000000000000020000002000420000005000010080010000000002000000000004800000040000000002000000000000000000000004000100000000000000420080200000000000000000000000800000000000040000000000000000000000000000000000000000000200010000100080800010000000800000020000000000008000000080000c0040200000040000000024000000001000400800002000000000080020000004000004200001040000100050000040000001002000040002c000000000000000000000004000000000040000080020000001", + "type": "0x0", + "effectiveGasPrice": "0x4a817c800" + } + ], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1713252455, + "chain": 2021, + "multi": false, + "commit": "299b38b" +} \ No newline at end of file diff --git a/broadcast/20240411-p3-upgrade-bridge-main-chain.s.sol/11155111/run-1713254298.json b/broadcast/20240411-p3-upgrade-bridge-main-chain.s.sol/11155111/run-1713254298.json new file mode 100644 index 00000000..5d393b7d --- /dev/null +++ b/broadcast/20240411-p3-upgrade-bridge-main-chain.s.sol/11155111/run-1713254298.json @@ -0,0 +1,260 @@ +{ + "transactions": [ + { + "hash": "0x32dcfdca4661c4cd3882524622948948f7b0cf1f1d1de824c635ceed267e1def", + "transactionType": "CALL", + "contractName": "TransparentUpgradeableProxyV2", + "contractAddress": "0x61eC0ebf966AE84C414BDA715E17CeF657e039DF", + "function": "changeAdmin(address)", + "arguments": [ + "0x5396b75c9eb8D1153D2B8a0Bb9a8c4B1541f758d" + ], + "transaction": { + "type": "0x02", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "to": "0x61ec0ebf966ae84c414bda715e17cef657e039df", + "gas": "0x10f58", + "value": "0x0", + "data": "0x8f2839700000000000000000000000005396b75c9eb8d1153d2b8a0bb9a8c4b1541f758d", + "nonce": "0x13", + "accessList": [] + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x2faea0626466f084d03101489e4a35b7ca9b20b4703fceebcd2cb1bbe58bb7a7", + "transactionType": "CALL", + "contractName": "TransparentUpgradeableProxyV2", + "contractAddress": "0x06855f31dF1d3D25cE486CF09dB49bDa535D2a9e", + "function": "changeAdmin(address)", + "arguments": [ + "0x5396b75c9eb8D1153D2B8a0Bb9a8c4B1541f758d" + ], + "transaction": { + "type": "0x02", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "to": "0x06855f31df1d3d25ce486cf09db49bda535d2a9e", + "gas": "0x10f58", + "value": "0x0", + "data": "0x8f2839700000000000000000000000005396b75c9eb8d1153d2b8a0bb9a8c4b1541f758d", + "nonce": "0x14", + "accessList": [] + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CREATE", + "contractName": "MainchainBridgeManager", + "contractAddress": "0x8A6e09c0E369086B3AC219aB66F990b0A7d3E1Da", + "function": null, + "arguments": null, + "transaction": { + "type": "0x02", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x8c2502", + "value": "0x0", + "data": "0x60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61519e80620000f46000396000f3fe608060405234801561001057600080fd5b50600436106102065760003560e01c80639b19dbfd1161011a578063cc7e6b3b116100ad578063de981f1b1161007c578063de981f1b146104ae578063e75235b8146104c1578063e9c03498146104de578063f80b5352146104f1578063f896f070146104f957600080fd5b8063cc7e6b3b14610460578063d0a50db014610480578063d78392f814610488578063dafae4081461049b57600080fd5b8063b405aaf2116100e9578063b405aaf21461041b578063b9c362091461042e578063bc96180b14610441578063c441c4a81461044957600080fd5b80639b19dbfd14610392578063a64a83801461039a578063aee1767f146103ad578063b384abef146103c057600080fd5b80633644e5151161019d5780637f7fe0581161016c5780637f7fe05814610303578063800eaab31461032e578063865e6fd3146103415780638dc0dbc614610354578063901979d51461036757600080fd5b80633644e515146102bc57806362077409146102c5578063776fb1ec146102d85780637de5dedd146102fb57600080fd5b80631f425338116101d95780631f425338146102635780632d6d7d731461027657806334d5f37b1461028957806335da8121146102a957600080fd5b806301a5f43f1461020b57806306aba0e1146102205780630a44fa431461023b5780630f7c31891461024e575b600080fd5b61021e610219366004613fd0565b61050c565b005b6102286105bb565b6040519081526020015b60405180910390f35b610228610249366004614069565b6105ca565b61025661064f565b60405161023291906140ef565b61021e610271366004614069565b610668565b610256610284366004614069565b61070a565b610228610297366004614102565b60026020526000908152604090205481565b61021e6102b7366004614069565b610751565b61022860015481565b61021e6102d336600461415f565b610799565b6102eb6102e6366004614102565b6107c9565b6040519015158152602001610232565b610228610816565b610316610311366004614212565b61086c565b6040516001600160a01b039091168152602001610232565b61021e61033c3660046143c4565b6108ed565b61021e61034f366004614436565b610925565b61021e610362366004614469565b610940565b61037a610375366004614212565b61096a565b6040516001600160601b039091168152602001610232565b6102566109a0565b61021e6103a8366004614102565b610a0b565b6103166103bb366004614212565b610a1f565b61040a6103ce3660046144ad565b600360208181526000938452604080852090915291835291208054600182015460028301549383015460069093015460ff909216939092909185565b6040516102329594939291906144e5565b6102eb610429366004614212565b610a31565b61021e61043c3660046144ad565b610a69565b600454610228565b610451610a7b565b60405161023293929190614554565b61047361046e366004614069565b610b55565b6040516102329190614597565b610228610b93565b61037a610496366004614212565b610ba6565b6102eb6104a9366004614102565b610bb1565b6103166104bc3660046145aa565b610c03565b6104c9610c7e565b60408051928352602083019190915201610232565b61021e6104ec366004614069565b610cc6565b610256610d0f565b61021e61050736600461463a565b610d72565b610514610eac565b6105b286868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808a0282810182019093528982529093508992508891829185019084908082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250610f0892505050565b50505050505050565b60006105c561126a565b905090565b600082828080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061060b925083915061127d9050565b6106478484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506112b292505050565b949350505050565b60606105c5600080516020615149833981519152611337565b610670610eac565b8181808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506106af925083915061127d9050565b60008051602061514983398151915260005b83811015610703576106fa8585838181106106de576106de61475f565b90506020020160208101906106f39190614212565b839061134b565b506001016106c1565b5050505050565b606061074883838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250611360915050565b90505b92915050565b610759610eac565b6107958282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506114b392505050565b5050565b6107a233611570565b6107bb6107b56060870160408801614212565b336115b2565b61070385858585853361160d565b60008060008381527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff602052604090205460ff16600481111561080e5761080e6144cf565b141592915050565b600080610821611641565b905060008061082e610c7e565b9150915080600182856004015485610846919061478b565b61085091906147a2565b61085a91906147b5565b61086491906147c8565b935050505090565b600080600061088261087c611641565b85611665565b91509150816108b45760405163141e2e1f60e11b81526001600160a01b03851660048201526024015b60405180910390fd5b6108bc611641565b60010181815481106108d0576108d061475f565b6000918252602090912001546001600160a01b0316949350505050565b33301461091b576000356001600160e01b0319166040516307337e1960e41b81526004016108ab91906147ea565b61079582826116ca565b61092d610eac565b61093681611773565b61079582826117a9565b61094933611570565b61095c6107b56080870160608801614212565b61070385858585853361184d565b600080610975611641565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b031690565b60606109aa611641565b600101805480602002602001604051908101604052809291908181526020018280548015610a0157602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116109e3575b5050505050905090565b610a13610eac565b610a1c81611881565b50565b6000610a2a826118ee565b5092915050565b600080610a3c611641565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b0316151590565b610a71610eac565b610795828261196e565b60608060606000610a8a611641565b805460408051602080840282018101909252828152929350839190830182828015610ade57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610ac0575b5050505050935080600101805480602002602001604051908101604052809291908181526020018280548015610b3d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b1f575b50505050509250610b4d84611a70565b915050909192565b6060610748838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611a7092505050565b6000610b9d611641565b60010154919050565b600061074b82611b5c565b60007ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00610bdc61126a565b8160010154610beb919061478b565b6002820154610bfa908561478b565b10159392505050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115610c3a57610c3a6144cf565b60ff1681526020810191909152604001600020546001600160a01b0316905080610c79578160405163409140df60e11b81526004016108ab91906147ff565b919050565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f01547ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f02549091565b610cce610eac565b610d0a828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611b9192505050565b505050565b6060610d19611641565b805460408051602080840282018101909252828152929190830182828015610a01576020028201919060005260206000209081546001600160a01b031681526001909101906020018083116109e3575050505050905090565b600054610100900460ff1615808015610d925750600054600160ff909116105b80610dac5750303b158015610dac575060005460ff166001145b610e0f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016108ab565b6000805460ff191660011790558015610e32576000805461ff0019166101001790555b610e3f600160ff1b611f77565b610e498383611fa7565b610e598b8b8b8b8b8b8b8b611fd8565b8015610e9f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610f06576000356001600160e01b0319166001604051620f948f60ea1b81526004016108ab929190614819565b565b6060610f148383612029565b610f1d8161127d565b6000610f27611641565b845187519192509081148015610f3d5750855181145b610f68576000356001600160e01b0319166040516306b5667560e21b81526004016108ab91906147ea565b806001600160401b03811115610f8057610f8061422d565b604051908082528060200260200182016040528015610fa9578160200160208202803683370190505b50935080600003610fbb575050611262565b60008060008060005b858110156111ce578a8181518110610fde57610fde61475f565b60200260200101519450898181518110610ffa57610ffa61475f565b602002602001015193508b81815181106110165761101661475f565b6020026020010151925061102985612133565b61103284612133565b826001600160601b031660000361106a576000356001600160e01b031916604051637f11b8a360e11b81526004016108ab91906147ea565b6001600160a01b03808616600081815260038a01602090815260408083205494891683528083205460028d0190925280832054938352909120546001600160601b0393841693918216926110c2929081169116614847565b6110cc9190614847565b6110d69190614847565b6001600160601b03166000148982815181106110f4576110f461475f565b6020026020010190151590811515815250508881815181106111185761111861475f565b6020026020010151156111c6578654600181810189556000898152602080822090930180546001600160a01b03808b166001600160a01b0319928316811790935591835260028c018552604080842080546001600160601b038b166001600160601b03199182168117909255868f018054978801815586528786209096018054948c1694909316841790925591835260038c0190945290208054909116821790556111c390836147a2565b91505b600101610fc4565b50808660040160008282546111e391906147a2565b909155505060405161121e906347c28ec560e11b9061120a908c908f908d9060200161489a565b604051602081830303815290604052612168565b7f897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b78888c8c8c60405161125394939291906148d3565b60405180910390a15050505050505b509392505050565b6000611274611641565b60040154905090565b61128681612195565b15610a1c576000356001600160e01b031916604051630d697db160e11b81526004016108ab91906147ea565b6000816112be8161127d565b60006112c8611641565b905060005b845181101561132f578160020160008683815181106112ee576112ee61475f565b6020908102919091018101516001600160a01b0316825281019190915260400160002054611325906001600160601b0316856147a2565b93506001016112cd565b505050919050565b6060600061134483612234565b9392505050565b6000610748836001600160a01b038416612290565b606082516001600160401b0381111561137b5761137b61422d565b6040519080825280602002602001820160405280156113a4578160200160208202803683370190505b50905060005b8351811015610a2a57600560008583815181106113c9576113c961475f565b602002602001015160058111156113e2576113e26144cf565b60058111156113f3576113f36144cf565b815260200190815260200160002060009054906101000a90046001600160a01b03168282815181106114275761142761475f565b60200260200101906001600160a01b031690816001600160a01b03168152505082801561147f575060006001600160a01b031682828151811061146c5761146c61475f565b60200260200101516001600160a01b0316145b156114ab576000356001600160e01b03191660405163053265f160e01b81526004016108ab91906147ea565b6001016113aa565b806114bd8161127d565b600080516020615149833981519152600080805b8551811015611568578581815181106114ec576114ec61475f565b602002602001015192506114ff83611773565b611510836312c0151560e21b612383565b61151a8484612516565b604080516001600160a01b038616815282151560208201529193507fb85c58eeff9fe423669ae0841666f4c8499e8731b8275eb462e4fa1720ec420e910160405180910390a16001016114d1565b505050505050565b61157981611b5c565b6001600160601b0316600003610a1c576000356001600160e01b0319166003604051620f948f60ea1b81526004016108ab929190614819565b6001600160a01b038216158015906115dc5750816001600160a01b0316816001600160a01b031614155b15610795576040516301df97c360e51b81526001600160a01b038084166004830152821660248201526044016108ab565b600061162161161b88614a6e565b8361252b565b90506105b2818787878761163c6116378e614a6e565b61263d565b61277c565b7fc648703095712c0419b6431ae642c061f0a105ac2d7c3d9604061ef4ebc3830090565b60008060005b84548110156116b8578481815481106116865761168661475f565b6000918252602090912001546001600160a01b03908116908516036116b0576001925090506116c3565b60010161166b565b506000600019915091505b9250929050565b60005b8251811015610d0a57306001600160a01b03168282815181106116f2576116f261475f565b60200260200101516001600160a01b03160361172f576000356001600160e01b03191660405163053265f160e01b81526004016108ab91906147ea565b61176b8382815181106117445761174461475f565b602002602001015183838151811061175e5761175e61475f565b6020026020010151612c48565b6001016116cd565b806001600160a01b03163b600003610a1c57604051630bfc64a360e21b81526001600160a01b03821660048201526024016108ab565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f8111156117df576117df6144cf565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115611820576118206144cf565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b61185f61185987614b49565b82612cdb565b5061156861186c87614b49565b8686868661163c61187c8d614b49565b612de2565b60038110156118a3576040516305f4dee960e31b815260040160405180910390fd5b60006118ad611641565b600581018390556040518381529091507f22d5bb5059ffe2949a098666fc198587200c8118483074120d3ca7050c7753f19060200160405180910390a15050565b6000806000806119086118ff611641565b60010186611665565b9150915081611935576040516326527e1760e01b81526001600160a01b03861660048201526024016108ab565b61193d611641565b80548290811061194f5761194f61475f565b6000918252602090912001546001600160a01b03169590945092505050565b8082118061197d575060018111155b156119a9576000356001600160e01b0319166040516387f6f09560e01b81526004016108ab91906147ea565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f0180547ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f028054928590558390557ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00805490929084908690856000611a2c83614c2f565b9091555060408051868152602081018690527f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a45050505050565b60606000611a7c611641565b905082516001600160401b03811115611a9757611a9761422d565b604051908082528060200260200182016040528015611ac0578160200160208202803683370190505b50915060005b8351811015611b5557816002016000858381518110611ae757611ae761475f565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160601b0316838281518110611b3557611b3561475f565b6001600160601b0390921660209283029190910190910152600101611ac6565b5050919050565b6000611b66611641565b6001600160a01b0390921660009081526002929092016020525060409020546001600160601b031690565b606081611b9d8161127d565b6000611ba7611641565b8451909150806001600160401b03811115611bc457611bc461422d565b604051908082528060200260200182016040528015611bed578160200160208202803683370190505b50935080600003611bff575050611f71565b60058201548254611c119083906147b5565b1015611c305760405163b2e765cb60e01b815260040160405180910390fd5b60008060008060005b85811015611ef757898181518110611c5357611c5361475f565b60200260200101519350611c66846118ee565b9095509150611c7485612133565b611c7d84612133565b6001600160a01b03851660009081526002880160205260409020546001600160601b031615801590611cd157506001600160a01b03841660009081526003880160205260409020546001600160601b031615155b898281518110611ce357611ce361475f565b602002602001019015159081151581525050888181518110611d0757611d0761475f565b602002602001015115611eef576001600160a01b038516600090815260028801602052604081205488546001600160601b039091169190611d4a906001906147b5565b9050886000018181548110611d6157611d6161475f565b60009182526020909120015489546001600160a01b03909116908a9086908110611d8d57611d8d61475f565b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790558854899080611dc757611dc7614c48565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038916825260028b0190526040902080546001600160601b031916905560018901805482908110611e2757611e2761475f565b60009182526020909120015460018a0180546001600160a01b039092169186908110611e5557611e5561475f565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555088600101805480611e9657611e96614c48565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038816825260038b0190526040902080546001600160601b0319169055611eea82866147a2565b945050505b600101611c39565b5081866004016000828254611f0c91906147b5565b9091555050604051611f3190636242a4ef60e11b9061120a908c908c90602001614c5e565b7fdf3dcd7987202f64648f3acdbf12401e3a2bb23e77e19f99826b5475cbb86369888a604051611f62929190614c8c565b60405180910390a15050505050505b50919050565b600054610100900460ff16611f9e5760405162461bcd60e51b81526004016108ab90614cb1565b610a1c81612f2c565b600054610100900460ff16611fce5760405162461bcd60e51b81526004016108ab90614cb1565b6107958282612f5c565b600054610100900460ff16611fff5760405162461bcd60e51b81526004016108ab90614cb1565b6120098888612f8e565b61201284612fe5565b61201f8686858585613015565b5050505050505050565b81518151606091908082016001600160401b0381111561204b5761204b61422d565b604051908082528060200260200182016040528015612074578160200160208202803683370190505b50925060005b828110156120ce578581815181106120945761209461475f565b60200260200101518482815181106120ae576120ae61475f565b6001600160a01b039092166020928302919091019091015260010161207a565b60005b82811015612129578581815181106120eb576120eb61475f565b60200260200101518583815181106121055761210561475f565b6001600160a01b0390921660209283029190910190910152600191820191016120d1565b5050505092915050565b6001600160a01b038116610a1c576000356001600160e01b03191660405163104c66df60e31b81526004016108ab91906147ea565b612172828261313f565b610795573382826040516319b5fdcb60e31b81526004016108ab93929190614d4c565b600081516000036121a857506000919050565b60005b600183510381101561222b57600181015b8351811015612222578381815181106121d7576121d761475f565b60200260200101516001600160a01b03168483815181106121fa576121fa61475f565b60200260200101516001600160a01b03160361221a575060019392505050565b6001016121bc565b506001016121ab565b50600092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561228457602002820191906000526020600020905b815481526020019060010190808311612270575b50505050509050919050565b600081815260018301602052604081205480156123795760006122b46001836147b5565b85549091506000906122c8906001906147b5565b905081811461232d5760008660000182815481106122e8576122e861475f565b906000526020600020015490508087600001848154811061230b5761230b61475f565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061233e5761233e614c48565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061074b565b600091505061074b565b60008160405160240161239691906147ea565b60408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b1790525190915060009081906001600160a01b038616906123df908590614d80565b600060405180830381855afa9150503d806000811461241a576040519150601f19603f3d011682016040523d82523d6000602084013e61241f565b606091505b5091509150816124e157846001600160a01b0316836040516024016124449190614d9c565b60408051601f198184030181529181526020820180516001600160e01b03166325da93a560e11b179052516124799190614d80565b600060405180830381855afa9150503d80600081146124b4576040519150601f19603f3d011682016040523d82523d6000602084013e6124b9565b606091505b509092509050816124e157838560405163069d427960e11b81526004016108ab929190614daf565b808060200190518101906124f59190614dd2565b61070357838560405163069d427960e11b81526004016108ab929190614daf565b6000610748836001600160a01b038416613471565b612533613f0c565b61254c61254584606001516001611360565b84906134c0565b9050612563600454826135c690919063ffffffff16565b600061256e82612de2565b9050600061257c6000613667565b60008181527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff6020908152604090912090870151600182018590556006909101559050825181146125ee576000356001600160e01b03191660405163d4cec26960e01b81526004016108ab91906147ea565b81817fe5af2d3fb7bcab8f865476bc675bf1bbb8b5a749c827ee1cd215dc9c2b8f92d78561261b8961263d565b898960405161262d9493929190614f5d565b60405180910390a3505092915050565b6080810151606082015160a083015151600092919083906001600160401b0381111561266b5761266b61422d565b604051908082528060200260200182016040528015612694578160200160208202803683370190505b5060c086015190915060005b82518110156126f3578660a0015181815181106126bf576126bf61475f565b6020026020010151805190602001208382815181106126e0576126e061475f565b60209081029190910101526001016126a0565b50604080517fde480f0c53a3651c08fbab1dffbc45fe574f31188827fe52cb9035da9fe57e4a8152875160208083019190915280890151828401529790910151606082015283518702938701939093206080840152835186029386019390932060a0830152805185029085012060c082015281518402919093012060e083015250610100902090565b831580159061278a57508382145b6127b5576000356001600160e01b0319166040516306b5667560e21b81526004016108ab91906147ea565b60006128426127c360015490565b612802846000604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b60405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b9050600061289161285260015490565b612802856001604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b90506000846001600160401b038111156128ad576128ad61422d565b6040519080825280602002602001820160405280156128d6578160200160208202803683370190505b5090506000856001600160401b038111156128f3576128f361422d565b60405190808252806020026020018201604052801561291c578160200160208202803683370190505b50905060008060008060003660005b8c811015612ab0578d8d828181106129455761294561475f565b90506060020191508f8f8281811061295f5761295f61475f565b9050602002016020810190612974919061501e565b9250600083600181111561298a5761298a6144cf565b036129f4576129af8b6129a0602085018561503f565b84602001358560400135613703565b94508489886129bd81614c2f565b9950815181106129cf576129cf61475f565b60200260200101906001600160a01b031690816001600160a01b031681525050612a65565b6001836001811115612a0857612a086144cf565b03612a3e57612a1e8a6129a0602085018561503f565b9450848887612a2c81614c2f565b9850815181106129cf576129cf61475f565b6000356001600160e01b031916604051630612418f60e11b81526004016108ab91906147ea565b846001600160a01b0316846001600160a01b031610612aa5576000356001600160e01b031916604051635d3dcd3160e01b81526004016108ab91906147ea565b84935060010161292b565b505050928552508252506020808b015160009081526003825260408082208d51835290925290812090612ae161372b565b90506000612aee85613735565b9050818110612b755780600003612b26576000356001600160e01b031916604051637f11b8a360e11b81526004016108ab91906147ea565b825460ff1916600190811784558301546040517f5c819725ea53655a3b898f3df59b66489761935454e9212ca1e5ebd759953d0b90600090a2612b69838e613740565b50505050505050611568565b600082612b806137ad565b612b8a91906147b5565b612b959060016147a2565b90506000612ba286613735565b9050818110612c215780600003612bda576000356001600160e01b031916604051637f11b8a360e11b81526004016108ab91906147ea565b845460ff1916600317855560018501546040517f55295d4ce992922fa2e5ffbf3a3dcdb367de0a15e125ace083456017fd22060f90600090a2505050505050505050611568565b6000356001600160e01b031916604051634ccfe64360e11b81526004016108ab91906147ea565b8060056000846005811115612c5f57612c5f6144cf565b6005811115612c7057612c706144cf565b8152602081019190915260400160002080546001600160a01b0319166001600160a01b039283161790558116826005811115612cae57612cae6144cf565b6040517f356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d90600090a35050565b6020820151600090808203612d1d5760405163092048d160e11b8152600080356001600160e01b031916600483015260248201524660448201526064016108ab565b600454612d2b9085906135c6565b6000612d3685612de2565b9050612d4182613667565b6000838152600360209081526040808320848452909152908190209087015160018201849055600690910155925084518314612d9e576000356001600160e01b03191660405163d4cec26960e01b81526004016108ab91906147ea565b8083837fd1221ffb98610024a29755d7db3c71692310f43a7cfcce7ee488a8c7e9e0bfa48888604051612dd2929190615062565b60405180910390a4505092915050565b60a0810151608082015160c083015151600092919083906001600160401b03811115612e1057612e1061422d565b604051908082528060200260200182016040528015612e39578160200160208202803683370190505b5060e086015190915060005b8251811015612e98578660c001518181518110612e6457612e6461475f565b602002602001015180519060200120838281518110612e8557612e8561475f565b6020908102919091010152600101612e45565b50604080517f1b59eeec7c321899dc1e7a5b3d876c9a445dffc6d2f96ba842d7489908fdee1281528751602080830191909152808901518284015291880151606080830191909152909701516080880152835181029381019390932060a0870152835183029383019390932060c0860152805182029082012060e08501528151810291012061010083015250610120902090565b600054610100900460ff16612f535760405162461bcd60e51b81526004016108ab90614cb1565b610a1c816137b7565b600054610100900460ff16612f835760405162461bcd60e51b81526004016108ab90614cb1565b61091b600030612c48565b600054610100900460ff16612fb55760405162461bcd60e51b81526004016108ab90614cb1565b60017ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00908155610d0a838361196e565b600054610100900460ff1661300c5760405162461bcd60e51b81526004016108ab90614cb1565b610a1c816114b3565b600054610100900460ff1661303c5760405162461bcd60e51b81526004016108ab90614cb1565b6130476002856117a9565b604080516020808201839052600e60608301526d212924a223a2afa6a0a720a3a2a960911b6080808401919091528284018990528351808403909101815260a0830184528051908201207f599a80fcaa47b95e2323ab4d34d34e0cc9feda4b843edafcc30c7bdf60ea15bf60c08401527fe4d2346818310a10fac5a6d073d3dce255578caf4aa81ddcbcc7c2b98405eef060e08401527f2a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4de61010084015261012080840191909152835180840390910181526101409092019092528051910120600155613134818385610f08565b506107036003611881565b6001600061315a600080516020615149833981519152611337565b8051909150600081900361316f57505061074b565b6000816001600160401b038111156131895761318961422d565b6040519080825280602002602001820160405280156131b2578160200160208202803683370190505b5090506000826001600160401b038111156131cf576131cf61422d565b60405190808252806020026020018201604052801561320257816020015b60608152602001906001900390816131ed5790505b5090506000878760405160200161321a92919061508c565b604051602081830303815290604052905060008160405160240161323e9190614d9c565b60408051601f198184030181529190526020810180516001600160e01b03166325da93a560e11b179052905060005b85811015613427578681815181106132875761328761475f565b60200260200101516001600160a01b0316836040516132a69190614d80565b6000604051808303816000865af19150503d80600081146132e3576040519150601f19603f3d011682016040523d82523d6000602084013e6132e8565b606091505b508683815181106132fb576132fb61475f565b602002602001018684815181106133145761331461475f565b602002602001018290528215151515815250505084818151811061333a5761333a61475f565b602002602001015161341f578681815181106133585761335861475f565b60200260200101516001600160a01b0316826040516133779190614d80565b6000604051808303816000865af19150503d80600081146133b4576040519150601f19603f3d011682016040523d82523d6000602084013e6133b9565b606091505b508683815181106133cc576133cc61475f565b602002602001018684815181106133e5576133e561475f565b602002602001018290528215151515815250505087801561341c57508481815181106134135761341361475f565b60200260200101515b97505b60010161326d565b507fc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b638287868660405161345d94939291906150bd565b60405180910390a150505050505092915050565b60008181526001830160205260408120546134b85750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561074b565b50600061074b565b6134c8613f0c565b8251815260006020808301919091528301516040808301919091528301516001600160a01b0316606080830191909152830151516001600160401b038111156135135761351361422d565b60405190808252806020026020018201604052801561353c578160200160208202803683370190505b5060808083019190915283015160a08083019190915283015160c08083019190915283015160e082015260005b836060015151811015610a2a578281815181106135885761358861475f565b6020026020010151826080015182815181106135a6576135a661475f565b6001600160a01b0390921660209283029190910190910152600101613569565b60008260800151511180156135e457508160a0015151826080015151145b80156135f957508160c0015151826080015151145b801561360e57508160e0015151826080015151145b613639576000356001600160e01b0319166040516306b5667560e21b81526004016108ab91906147ea565b61364381426147a2565b826040015111156107955760405163ad89be9d60e01b815260040160405180910390fd5b600081815260026020526040812054908190036136965750600090815260026020526040902060019081905590565b60008281526003602090815260408083208484529091528120906000825460ff1660048111156136c8576136c86144cf565b036136e65760405163757a436360e01b815260040160405180910390fd5b505050600090815260026020526040902080546001019081905590565b60008060006137148787878761399c565b9150915061372181613a89565b5095945050505050565b60006105c5610816565b600061074b826112b2565b61374981613c3f565b1561079557815460ff1916600217825560008061376583613c59565b9150915083600101547fe134987599ae266ec90edeff1b26125b287dbb57b10822649432d1bb26537fba838360405161379f92919061510a565b60405180910390a250505050565b60006105c56105bb565b600481905560405181907fe5cd1c123a8cf63fa1b7229678db61fe8ae99dbbd27889370b6667c8cae97da190600090a250565b600483015481101561389d578260080160008460040183815481106138115761381161475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff19169055600484018054600786019291908490811061385a5761385a61475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff191681556001818101839055600290910191909155016137ea565b5060005b6005830154811015613954578260080160008460050183815481106138c8576138c861475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff1916905560058401805460078601929190849081106139115761391161475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff191681556001818101839055600290910191909155016138a1565b50815460ff191682556000600183018190556002830181905560038301819055613982906004840190613f5a565b613990600583016000613f5a565b60006006830155919050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156139d35750600090506003613a80565b8460ff16601b141580156139eb57508460ff16601c14155b156139fc5750600090506004613a80565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613a50573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613a7957600060019250925050613a80565b9150600090505b94509492505050565b6000816004811115613a9d57613a9d6144cf565b03613aa55750565b6001816004811115613ab957613ab96144cf565b03613b065760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016108ab565b6002816004811115613b1a57613b1a6144cf565b03613b675760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016108ab565b6003816004811115613b7b57613b7b6144cf565b03613bd35760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016108ab565b6004816004811115613be757613be76144cf565b03610a1c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016108ab565b600081602001516000148061074b57505060200151461490565b606080613c6583613c3f565b613ca357602083015160405163092048d160e11b81526000356001600160e01b031916600482015260248101919091524660448201526064016108ab565b8260800151516001600160401b03811115613cc057613cc061422d565b604051908082528060200260200182016040528015613ce9578160200160208202803683370190505b5091508260800151516001600160401b03811115613d0957613d0961422d565b604051908082528060200260200182016040528015613d3c57816020015b6060815260200190600190039081613d275790505b50905060005b836080015151811015613f06578360e001518181518110613d6557613d6561475f565b60200260200101515a11613d9857613d7c84612de2565b6040516307aec4ab60e21b81526004016108ab91815260200190565b83608001518181518110613dae57613dae61475f565b60200260200101516001600160a01b03168460a001518281518110613dd557613dd561475f565b60200260200101518560e001518381518110613df357613df361475f565b6020026020010151908660c001518481518110613e1257613e1261475f565b6020026020010151604051613e279190614d80565b600060405180830381858888f193505050503d8060008114613e65576040519150601f19603f3d011682016040523d82523d6000602084013e613e6a565b606091505b50848381518110613e7d57613e7d61475f565b60200260200101848481518110613e9657613e9661475f565b6020026020010182905282151515158152505050828181518110613ebc57613ebc61475f565b6020026020010151613efe5780828281518110613edb57613edb61475f565b60200260200101516040516376df417560e11b81526004016108ab92919061512f565b600101613d42565b50915091565b60405180610100016040528060008152602001600081526020016000815260200160006001600160a01b03168152602001606081526020016060815260200160608152602001606081525090565b5080546000825590600052602060002090810190610a1c91905b80821115613f885760008155600101613f74565b5090565b60008083601f840112613f9e57600080fd5b5081356001600160401b03811115613fb557600080fd5b6020830191508360208260051b85010111156116c357600080fd5b60008060008060008060608789031215613fe957600080fd5b86356001600160401b038082111561400057600080fd5b61400c8a838b01613f8c565b9098509650602089013591508082111561402557600080fd5b6140318a838b01613f8c565b9096509450604089013591508082111561404a57600080fd5b5061405789828a01613f8c565b979a9699509497509295939492505050565b6000806020838503121561407c57600080fd5b82356001600160401b0381111561409257600080fd5b61409e85828601613f8c565b90969095509350505050565b60008151808452602080850194506020840160005b838110156140e45781516001600160a01b0316875295820195908201906001016140bf565b509495945050505050565b60208152600061074860208301846140aa565b60006020828403121561411457600080fd5b5035919050565b60008083601f84011261412d57600080fd5b5081356001600160401b0381111561414457600080fd5b6020830191508360206060830285010111156116c357600080fd5b60008060008060006060868803121561417757600080fd5b85356001600160401b038082111561418e57600080fd5b9087019060e0828a0312156141a257600080fd5b909550602087013590808211156141b857600080fd5b6141c489838a01613f8c565b909650945060408801359150808211156141dd57600080fd5b506141ea8882890161411b565b969995985093965092949392505050565b80356001600160a01b0381168114610c7957600080fd5b60006020828403121561422457600080fd5b610748826141fb565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b03811182821017156142655761426561422d565b60405290565b60405161010081016001600160401b03811182821017156142655761426561422d565b604051601f8201601f191681016001600160401b03811182821017156142b6576142b661422d565b604052919050565b60006001600160401b038211156142d7576142d761422d565b5060051b60200190565b600082601f8301126142f257600080fd5b81356020614307614302836142be565b61428e565b8083825260208201915060208460051b87010193508684111561432957600080fd5b602086015b84811015614353578035600681106143465760008081fd5b835291830191830161432e565b509695505050505050565b600082601f83011261436f57600080fd5b8135602061437f614302836142be565b8083825260208201915060208460051b8701019350868411156143a157600080fd5b602086015b84811015614353576143b7816141fb565b83529183019183016143a6565b600080604083850312156143d757600080fd5b82356001600160401b03808211156143ee57600080fd5b6143fa868387016142e1565b9350602085013591508082111561441057600080fd5b5061441d8582860161435e565b9150509250929050565b803560108110610c7957600080fd5b6000806040838503121561444957600080fd5b61445283614427565b9150614460602084016141fb565b90509250929050565b60008060008060006060868803121561448157600080fd5b85356001600160401b038082111561449857600080fd5b90870190610100828a0312156141a257600080fd5b600080604083850312156144c057600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60a08101600587106144f9576144f96144cf565b95815260208101949094526040840192909252606083015260809091015290565b60008151808452602080850194506020840160005b838110156140e45781516001600160601b03168752958201959082019060010161452f565b60608152600061456760608301866140aa565b828103602084015261457981866140aa565b9050828103604084015261458d818561451a565b9695505050505050565b602081526000610748602083018461451a565b6000602082840312156145bc57600080fd5b61074882614427565b600082601f8301126145d657600080fd5b813560206145e6614302836142be565b8083825260208201915060208460051b87010193508684111561460857600080fd5b602086015b848110156143535780356001600160601b038116811461462d5760008081fd5b835291830191830161460d565b6000806000806000806000806000806101408b8d03121561465a57600080fd5b8a35995060208b0135985060408b0135975061467860608c016141fb565b965060808b01356001600160401b038082111561469457600080fd5b6146a08e838f0161435e565b975060a08d01359150808211156146b657600080fd5b6146c28e838f0161435e565b965060c08d01359150808211156146d857600080fd5b6146e48e838f0161435e565b955060e08d01359150808211156146fa57600080fd5b6147068e838f016145c5565b94506101008d013591508082111561471d57600080fd5b6147298e838f016142e1565b93506101208d013591508082111561474057600080fd5b5061474d8d828e0161435e565b9150509295989b9194979a5092959850565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761074b5761074b614775565b8082018082111561074b5761074b614775565b8181038181111561074b5761074b614775565b6000826147e557634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031991909116815260200190565b6020810160108310614813576148136144cf565b91905290565b6001600160e01b03198316815260408101600b831061483a5761483a6144cf565b8260208301529392505050565b6001600160601b03818116838216019080821115610a2a57610a2a614775565b60008151808452602080850194506020840160005b838110156140e457815115158752958201959082019060010161487c565b6060815260006148ad60608301866140aa565b82810360208401526148bf818661451a565b9050828103604084015261458d8185614867565b6080815260006148e66080830187614867565b82810360208401526148f8818761451a565b9050828103604084015261490c81866140aa565b9050828103606084015261492081856140aa565b979650505050505050565b600082601f83011261493c57600080fd5b8135602061494c614302836142be565b8083825260208201915060208460051b87010193508684111561496e57600080fd5b602086015b848110156143535780358352918301918301614973565b6000601f83601f84011261499d57600080fd5b823560206149ad614302836142be565b82815260059290921b850181019181810190878411156149cc57600080fd5b8287015b84811015614a625780356001600160401b03808211156149f05760008081fd5b818a0191508a603f830112614a055760008081fd5b85820135604082821115614a1b57614a1b61422d565b614a2c828b01601f1916890161428e565b92508183528c81838601011115614a435760008081fd5b81818501898501375060009082018701528452509183019183016149d0565b50979650505050505050565b600060e08236031215614a8057600080fd5b614a88614243565b8235815260208301356020820152614aa2604084016141fb565b604082015260608301356001600160401b0380821115614ac157600080fd5b614acd368387016142e1565b60608401526080850135915080821115614ae657600080fd5b614af23683870161492b565b608084015260a0850135915080821115614b0b57600080fd5b614b173683870161498a565b60a084015260c0850135915080821115614b3057600080fd5b50614b3d3682860161492b565b60c08301525092915050565b60006101008236031215614b5c57600080fd5b614b6461426b565b823581526020830135602082015260408301356040820152614b88606084016141fb565b606082015260808301356001600160401b0380821115614ba757600080fd5b614bb33683870161435e565b608084015260a0850135915080821115614bcc57600080fd5b614bd83683870161492b565b60a084015260c0850135915080821115614bf157600080fd5b614bfd3683870161498a565b60c084015260e0850135915080821115614c1657600080fd5b50614c233682860161492b565b60e08301525092915050565b600060018201614c4157614c41614775565b5060010190565b634e487b7160e01b600052603160045260246000fd5b604081526000614c7160408301856140aa565b8281036020840152614c838185614867565b95945050505050565b604081526000614c9f6040830185614867565b8281036020840152614c8381856140aa565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60005b83811015614d17578181015183820152602001614cff565b50506000910152565b60008151808452614d38816020860160208601614cfc565b601f01601f19169290920160200192915050565b6001600160a01b03841681526001600160e01b031983166020820152606060408201819052600090614c8390830184614d20565b60008251614d92818460208701614cfc565b9190910192915050565b6020815260006107486020830184614d20565b6001600160e01b03199290921682526001600160a01b0316602082015260400190565b600060208284031215614de457600080fd5b8151801515811461134457600080fd5b60008151808452602080850194506020840160005b838110156140e457815187529582019590820190600101614e09565b60008282518085526020808601955060208260051b8401016020860160005b84811015614e7257601f19868403018952614e60838351614d20565b98840198925090830190600101614e44565b5090979650505050505050565b60006101008251845260208301516020850152604083015160408501526060830151614eb660608601826001600160a01b03169052565b506080830151816080860152614ece828601826140aa565b91505060a083015184820360a0860152614ee88282614df4565b91505060c083015184820360c0860152614f028282614e25565b91505060e083015184820360e0860152614c838282614df4565b60008151808452602080850194506020840160005b838110156140e457815160068110614f4b57614f4b6144cf565b87529582019590820190600101614f31565b608081526000614f706080830187614e7f565b8560208401528281036040840152845181526020850151602082015260018060a01b036040860151166040820152606085015160e06060830152614fb760e0830182614f1c565b905060808601518282036080840152614fd08282614df4565b91505060a086015182820360a0840152614fea8282614e25565b91505060c086015182820360c08401526150048282614df4565b9350505050614c8360608301846001600160a01b03169052565b60006020828403121561503057600080fd5b81356002811061134457600080fd5b60006020828403121561505157600080fd5b813560ff8116811461134457600080fd5b6040815260006150756040830185614e7f565b905060018060a01b03831660208301529392505050565b6001600160e01b03198316815281516000906150af816004850160208701614cfc565b919091016004019392505050565b6080815260006150d06080830187614d20565b82810360208401526150e281876140aa565b905082810360408401526150f68186614867565b905082810360608401526149208185614e25565b60408152600061511d6040830185614867565b8281036020840152614c838185614e25565b8281526040602082015260006106476040830184614d2056fe5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd976240a26469706673582212200c6f63384302c679c24a323da0191d39419570db3a104ad821b83178df1126da64736f6c63430008170033", + "nonce": "0x15", + "accessList": [] + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CREATE", + "contractName": "TransparentUpgradeableProxyV2", + "contractAddress": "0x603075B625cc2cf69FbB3546C6acC2451FE792AF", + "function": null, + "arguments": [ + "0x8A6e09c0E369086B3AC219aB66F990b0A7d3E1Da", + "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "0xf896f0700000000000000000000000000000000000000000000000000000000000000007000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000007e500000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000003a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000002e82d2b56f858f79deef11b160bfc4631873da2b000000000000000000000000bcb61783dd2403fe8cc9b89b27b1a9bb03d040cb000000000000000000000000b266bf53cf7eac4e2065a404598dcb0e15e9462c000000000000000000000000cc5fc5b6c8595f56306da736f6cd02ed9141c84a0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000d24d87ddc1917165435b306aac68d99e0f49a3fa000000000000000000000000b033ba62ec622dc54d0abfe0254e79692147ca26000000000000000000000000087d08e3ba42e64e3948962dd1371f906d1278b900000000000000000000000052ec2e6bbce45afff8955da6410bb13812f4289f00000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e00000000000000000000000061ec0ebf966ae84c414bda715e17cef657e039df" + ], + "transaction": { + "type": "0x02", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x29415c", + "value": "0x0", + "data": "0x608060405260405162000edd38038062000edd83398101604081905262000026916200041a565b8282828281620000398282600062000053565b506200004790508262000085565b5050505050506200054d565b6200005e83620000f7565b6000825111806200006c5750805b1562000080576200007e838362000139565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f620000c760008051602062000e96833981519152546001600160a01b031690565b604080516001600160a01b03928316815291841660208301520160405180910390a1620000f48162000168565b50565b620001028162000206565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606062000161838360405180606001604052806027815260200162000eb6602791396200029d565b9392505050565b6001600160a01b038116620001d35760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b8060008051602062000e968339815191525b80546001600160a01b0319166001600160a01b039290921691909117905550565b6001600160a01b0381163b620002755760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620001ca565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc620001e5565b60606001600160a01b0384163b620003075760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401620001ca565b600080856001600160a01b031685604051620003249190620004fa565b600060405180830381855af49150503d806000811462000361576040519150601f19603f3d011682016040523d82523d6000602084013e62000366565b606091505b5090925090506200037982828662000383565b9695505050505050565b606083156200039457508162000161565b825115620003a55782518084602001fd5b8160405162461bcd60e51b8152600401620001ca919062000518565b80516001600160a01b0381168114620003d957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000411578181015183820152602001620003f7565b50506000910152565b6000806000606084860312156200043057600080fd5b6200043b84620003c1565b92506200044b60208501620003c1565b60408501519092506001600160401b03808211156200046957600080fd5b818601915086601f8301126200047e57600080fd5b815181811115620004935762000493620003de565b604051601f8201601f19908116603f01168101908382118183101715620004be57620004be620003de565b81604052828152896020848701011115620004d857600080fd5b620004eb836020830160208801620003f4565b80955050505050509250925092565b600082516200050e818460208701620003f4565b9190910192915050565b602081526000825180602084015262000539816040850160208701620003f4565b601f01601f19169190910160400192915050565b610939806200055d6000396000f3fe6080604052600436106100595760003560e01c80633659cfe6146100705780634bb5274a146100905780634f1ef286146100a35780635c60da1b146100b65780638f283970146100e7578063f851a4401461010757610068565b366100685761006661011c565b005b61006661011c565b34801561007c57600080fd5b5061006661008b366004610704565b610136565b61006661009e366004610735565b610173565b6100666100b13660046107e6565b6101b8565b3480156100c257600080fd5b506100cb61021f565b6040516001600160a01b03909116815260200160405180910390f35b3480156100f357600080fd5b50610066610102366004610704565b610250565b34801561011357600080fd5b506100cb610270565b610124610291565b61013461012f610326565b610330565b565b61013e61034f565b6001600160a01b0316330361016b5761016881604051806020016040528060008152506000610382565b50565b61016861011c565b61017b61034f565b6001600160a01b0316330361016b576000610194610326565b9050600080835160208501845af43d6000803e8080156101b3573d6000f35b3d6000fd5b6101c061034f565b6001600160a01b03163303610217576102128383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525060019250610382915050565b505050565b61021261011c565b600061022961034f565b6001600160a01b0316330361024557610240610326565b905090565b61024d61011c565b90565b61025861034f565b6001600160a01b0316330361016b57610168816103ad565b600061027a61034f565b6001600160a01b031633036102455761024061034f565b61029961034f565b6001600160a01b031633036101345760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b6000610240610401565b3660008037600080366000845af43d6000803e8080156101b3573d6000f35b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b61038b83610429565b6000825111806103985750805b15610212576103a78383610469565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103d661034f565b604080516001600160a01b03928316815291841660208301520160405180910390a161016881610495565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610373565b6104328161053e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061048e83836040518060600160405280602781526020016108dd602791396105d2565b9392505050565b6001600160a01b0381166104fa5760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b606482015260840161031d565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b6001600160a01b0381163b6105ab5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161031d565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc61051d565b60606001600160a01b0384163b61063a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161031d565b600080856001600160a01b031685604051610655919061088d565b600060405180830381855af49150503d8060008114610690576040519150601f19603f3d011682016040523d82523d6000602084013e610695565b606091505b50915091506106a58282866106af565b9695505050505050565b606083156106be57508161048e565b8251156106ce5782518084602001fd5b8160405162461bcd60e51b815260040161031d91906108a9565b80356001600160a01b03811681146106ff57600080fd5b919050565b60006020828403121561071657600080fd5b61048e826106e8565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561074757600080fd5b813567ffffffffffffffff8082111561075f57600080fd5b818401915084601f83011261077357600080fd5b8135818111156107855761078561071f565b604051601f8201601f19908116603f011681019083821181831017156107ad576107ad61071f565b816040528281528760208487010111156107c657600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000806000604084860312156107fb57600080fd5b610804846106e8565b9250602084013567ffffffffffffffff8082111561082157600080fd5b818601915086601f83011261083557600080fd5b81358181111561084457600080fd5b87602082850101111561085657600080fd5b6020830194508093505050509250925092565b60005b8381101561088457818101518382015260200161086c565b50506000910152565b6000825161089f818460208701610869565b9190910192915050565b60208152600082518060208401526108c8816040850160208701610869565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220c665d628940e317f0b6d03df17271fb51c4d35c9dbf89cce5e4d9768343c58a864736f6c63430008170033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c65640000000000000000000000008a6e09c0e369086b3ac219ab66f990b0a7d3e1da000000000000000000000000968d0cd7343f711216817e617d3f92a23dc91c0700000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000404f896f0700000000000000000000000000000000000000000000000000000000000000007000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000007e500000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000003a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000002e82d2b56f858f79deef11b160bfc4631873da2b000000000000000000000000bcb61783dd2403fe8cc9b89b27b1a9bb03d040cb000000000000000000000000b266bf53cf7eac4e2065a404598dcb0e15e9462c000000000000000000000000cc5fc5b6c8595f56306da736f6cd02ed9141c84a0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000d24d87ddc1917165435b306aac68d99e0f49a3fa000000000000000000000000b033ba62ec622dc54d0abfe0254e79692147ca26000000000000000000000000087d08e3ba42e64e3948962dd1371f906d1278b900000000000000000000000052ec2e6bbce45afff8955da6410bb13812f4289f00000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e00000000000000000000000061ec0ebf966ae84c414bda715e17cef657e039df00000000000000000000000000000000000000000000000000000000", + "nonce": "0x16", + "accessList": [] + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CALL", + "contractName": "src/extensions/TransparentUpgradeableProxyV2.sol:TransparentUpgradeableProxyV2", + "contractAddress": "0x603075B625cc2cf69FbB3546C6acC2451FE792AF", + "function": "changeAdmin(address)", + "arguments": [ + "0x5396b75c9eb8D1153D2B8a0Bb9a8c4B1541f758d" + ], + "transaction": { + "type": "0x02", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "to": "0x603075b625cc2cf69fbb3546c6acc2451fe792af", + "gas": "0x10f58", + "value": "0x0", + "data": "0x8f2839700000000000000000000000005396b75c9eb8d1153d2b8a0bb9a8c4b1541f758d", + "nonce": "0x17", + "accessList": [] + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CREATE", + "contractName": "WethUnwrapper", + "contractAddress": "0xdbf1c9FB0cb61Ae76901e55c5C04e77d2BE131A1", + "function": null, + "arguments": [ + "0x1Aa1BC6BaEFCF09D6Fd0139B828b5E764D050F08" + ], + "transaction": { + "type": "0x02", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0xa55e6", + "value": "0x0", + "data": "0x60a060405234801561001057600080fd5b5060405161059138038061059183398101604081905261002f91610071565b600160009081556001600160a01b0382163b90036100605760405163155634d360e31b815260040160405180910390fd5b6001600160a01b03166080526100a1565b60006020828403121561008357600080fd5b81516001600160a01b038116811461009a57600080fd5b9392505050565b6080516104c26100cf6000396000818160610152818160ea01528181610237015261030a01526104c26000f3fe6080604052600436106100385760003560e01c80633fc8cef31461004f5780635dbd60591461009f578063de0e9a3e146100bf57610047565b36610047576100456100df565b005b6100456100df565b34801561005b57600080fd5b506100837f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b3480156100ab57600080fd5b506100456100ba366004610408565b61012a565b3480156100cb57600080fd5b506100456100da366004610444565b6101a2565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146101285760405163155634d360e31b815260040160405180910390fd5b565b6002600054036101815760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b600260005561018f82610214565b6101998183610372565b50506001600055565b6002600054036101f45760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610178565b600260005561020281610214565b61020c3382610372565b506001600055565b604051336024820152306044820152606481018290526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b17905251610290919061045d565b6000604051808303816000865af19150503d80600081146102cd576040519150601f19603f3d011682016040523d82523d6000602084013e6102d2565b606091505b50509050806102f4576040516302805e0360e11b815260040160405180910390fd5b604051632e1a7d4d60e01b8152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561035657600080fd5b505af115801561036a573d6000803e3d6000fd5b505050505050565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146103bf576040519150601f19603f3d011682016040523d82523d6000602084013e6103c4565b606091505b50509050806104035760405163094b984760e21b81526001600160a01b03841660048201526001600160e01b0319600035166024820152604401610178565b505050565b6000806040838503121561041b57600080fd5b8235915060208301356001600160a01b038116811461043957600080fd5b809150509250929050565b60006020828403121561045657600080fd5b5035919050565b6000825160005b8181101561047e5760208186018101518583015201610464565b50600092019182525091905056fea2646970667358221220aaebf21164f6d2f08d44be8bf09fb75965583264b715eb60df75d1b1d0f7cb9e64736f6c634300081700330000000000000000000000001aa1bc6baefcf09d6fd0139b828b5e764d050f08", + "nonce": "0x18", + "accessList": [] + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CREATE", + "contractName": "PauseEnforcer", + "contractAddress": "0x23614572006e2D0DB35E54d4082Aec68d9686450", + "function": null, + "arguments": null, + "transaction": { + "type": "0x02", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x206788", + "value": "0x0", + "data": "0x608060405234801561001057600080fd5b5061001961001e565b6100de565b600254610100900460ff161561008a5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60025460ff90811610156100dc576002805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6111c4806100ed6000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c806391d14854116100a2578063caa6fea411610071578063caa6fea414610240578063d4b8399214610254578063d547741f1461026d578063dcf7bb5c14610280578063f82ec70b1461029357600080fd5b806391d148541461020a578063a217fddf1461021d578063b9f3163b14610225578063ca15c8731461022d57600080fd5b80636833f60d116100e95780636833f60d1461019c57806377a24f36146101a45780637a9ad019146101b75780637d4f7fc9146101cc5780639010d07c146101df57600080fd5b806301ffc9a71461011b578063248a9ca3146101435780632f2ff15d1461017457806336568abe14610189575b600080fd5b61012e610129366004610e11565b6102a6565b60405190151581526020015b60405180910390f35b610166610151366004610e3b565b60009081526020819052604090206001015490565b60405190815260200161013a565b610187610182366004610e79565b6102d1565b005b610187610197366004610e79565b6102fb565b61018761037e565b6101876101b2366004610ebf565b6104da565b61016660008051602061116f83398151915281565b6101876101da366004610fab565b610640565b6101f26101ed366004610fc8565b610663565b6040516001600160a01b03909116815260200161013a565b61012e610218366004610e79565b610682565b610166600081565b6101876106ab565b61016661023b366004610e3b565b610821565b60025461012e90600160b01b900460ff1681565b6002546101f2906201000090046001600160a01b031681565b61018761027b366004610e79565b610838565b61018761028e366004610fab565b61085d565b6101876102a1366004610fab565b610871565b60006001600160e01b03198216635a05180f60e01b14806102cb57506102cb82610894565b92915050565b6000828152602081905260409020600101546102ec816108c9565b6102f683836108d6565b505050565b6001600160a01b03811633146103705760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61037a82826108f8565b5050565b60008051602061116f833981519152610396816108c9565b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af11580156103e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040d9190610fea565b1561042b576040516310067f7560e11b815260040160405180910390fd5b60028054600160b01b60ff60b01b19909116179081905560408051638456cb5960e01b81529051620100009092046001600160a01b031691638456cb599160048082019260009290919082900301818387803b15801561048a57600080fd5b505af115801561049e573d6000803e3d6000fd5b50506040513381527fb8fad2fa0ed7a383e747c309ef2c4391d7b65592a48893e57ccc1fab70791456925060200190505b60405180910390a150565b600254610100900460ff16158080156104fa5750600254600160ff909116105b806105145750303b158015610514575060025460ff166001145b6105775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610367565b6002805460ff19166001179055801561059a576002805461ff0019166101001790555b6105a38461091a565b6105ae600084610972565b60005b82518110156105f3576105eb60008051602061116f8339815191528483815181106105de576105de61100c565b60200260200101516108d6565b6001016105b1565b50801561063a576002805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b600061064b816108c9565b61037a60008051602061116f833981519152836108d6565b600082815260016020526040812061067b908361097c565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008051602061116f8339815191526106c3816108c9565b600254600160b01b900460ff166106ed57604051631b2fd53f60e31b815260040160405180910390fd5b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610740573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107649190610fea565b61078157604051631e87b57b60e31b815260040160405180910390fd5b6002805460ff60b01b19169081905560408051631fa5d41d60e11b81529051620100009092046001600160a01b031691633f4ba83a9160048082019260009290919082900301818387803b1580156107d857600080fd5b505af11580156107ec573d6000803e3d6000fd5b50506040513381527ff5cbf596165cc457b2cd92e8d8450827ee314968160a5696402d75766fc52caf925060200190506104cf565b60008181526001602052604081206102cb90610988565b600082815260208190526040902060010154610853816108c9565b6102f683836108f8565b6000610868816108c9565b61037a8261091a565b600061087c816108c9565b61037a60008051602061116f833981519152836108f8565b60006001600160e01b03198216637965db0b60e01b14806102cb57506301ffc9a760e01b6001600160e01b03198316146102cb565b6108d38133610992565b50565b6108e082826109f6565b60008281526001602052604090206102f69082610a7a565b6109028282610a8f565b60008281526001602052604090206102f69082610af4565b6002805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040519081527f7f8cffd58ac96898bdd25ab64868bd933141d15ad1cd4a0df228fd3fcba2a26d906020016104cf565b61037a82826108d6565b600061067b8383610b09565b60006102cb825490565b61099c8282610682565b61037a576109b4816001600160a01b03166014610b33565b6109bf836020610b33565b6040516020016109d0929190611046565b60408051601f198184030181529082905262461bcd60e51b8252610367916004016110bb565b610a008282610682565b61037a576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610a363390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061067b836001600160a01b038416610ccf565b610a998282610682565b1561037a576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061067b836001600160a01b038416610d1e565b6000826000018281548110610b2057610b2061100c565b9060005260206000200154905092915050565b60606000610b42836002611104565b610b4d90600261111b565b67ffffffffffffffff811115610b6557610b65610ea9565b6040519080825280601f01601f191660200182016040528015610b8f576020820181803683370190505b509050600360fc1b81600081518110610baa57610baa61100c565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610bd957610bd961100c565b60200101906001600160f81b031916908160001a9053506000610bfd846002611104565b610c0890600161111b565b90505b6001811115610c80576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610c3c57610c3c61100c565b1a60f81b828281518110610c5257610c5261100c565b60200101906001600160f81b031916908160001a90535060049490941c93610c798161112e565b9050610c0b565b50831561067b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610367565b6000818152600183016020526040812054610d16575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556102cb565b5060006102cb565b60008181526001830160205260408120548015610e07576000610d42600183611145565b8554909150600090610d5690600190611145565b9050818114610dbb576000866000018281548110610d7657610d7661100c565b9060005260206000200154905080876000018481548110610d9957610d9961100c565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610dcc57610dcc611158565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506102cb565b60009150506102cb565b600060208284031215610e2357600080fd5b81356001600160e01b03198116811461067b57600080fd5b600060208284031215610e4d57600080fd5b5035919050565b6001600160a01b03811681146108d357600080fd5b8035610e7481610e54565b919050565b60008060408385031215610e8c57600080fd5b823591506020830135610e9e81610e54565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600060608486031215610ed457600080fd5b8335610edf81610e54565b9250602084810135610ef081610e54565b9250604085013567ffffffffffffffff80821115610f0d57600080fd5b818701915087601f830112610f2157600080fd5b813581811115610f3357610f33610ea9565b8060051b604051601f19603f83011681018181108582111715610f5857610f58610ea9565b60405291825284820192508381018501918a831115610f7657600080fd5b938501935b82851015610f9b57610f8c85610e69565b84529385019392850192610f7b565b8096505050505050509250925092565b600060208284031215610fbd57600080fd5b813561067b81610e54565b60008060408385031215610fdb57600080fd5b50508035926020909101359150565b600060208284031215610ffc57600080fd5b8151801515811461067b57600080fd5b634e487b7160e01b600052603260045260246000fd5b60005b8381101561103d578181015183820152602001611025565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161107e816017850160208801611022565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516110af816028840160208801611022565b01602801949350505050565b60208152600082518060208401526110da816040850160208701611022565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176102cb576102cb6110ee565b808201808211156102cb576102cb6110ee565b60008161113d5761113d6110ee565b506000190190565b818103818111156102cb576102cb6110ee565b634e487b7160e01b600052603160045260246000fdfe5bea60102f2a7acc9e82b1af0e3bd4069661102bb5dd143a6051cd1980dded1ca26469706673582212205cd579cff7903082498e437ed3eb21f8623bfa7f518ca2799b5e3497b22a08a864736f6c63430008170033", + "nonce": "0x19", + "accessList": [] + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CREATE", + "contractName": "MainchainGatewayV3", + "contractAddress": "0x1050f2E63177b5eD18f3E88D000DB3a600d664e3", + "function": null, + "arguments": null, + "transaction": { + "type": "0x02", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x928914", + "value": "0x0", + "data": "0x60806040523480156200001157600080fd5b506000805460ff19169055620000266200002c565b620000ee565b607154610100900460ff1615620000995760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60715460ff9081161015620000ec576071805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61556180620000fe6000396000f3fe60806040526004361061039b5760003560e01c80638f34e347116101dc578063b9c3620911610102578063d55ed103116100a0578063dff525e11161006f578063dff525e114610b04578063e400327c14610b24578063e75235b814610b44578063f23a6e6114610b5c576103aa565b8063d55ed10314610a77578063d64af2a614610aa4578063dafae40814610ac4578063de981f1b14610ae4576103aa565b8063ca15c873116100dc578063ca15c873146109f2578063cdb6744414610a12578063d19773d214610a2a578063d547741f14610a57576103aa565b8063b9c3620914610986578063bc197c81146109a6578063c48549de146109d2576103aa565b8063a217fddf1161017a578063affed0e011610149578063affed0e0146108f6578063b1a2567e1461090c578063b1d08a031461092c578063b297579414610959576103aa565b8063a217fddf14610894578063a3912ec8146103a8578063ab796566146108a9578063ac78dfe8146108d6576103aa565b80639157921c116101b65780639157921c146107ff57806391d148541461081f57806393c5678f1461083f5780639dcc4da31461085f576103aa565b80638f34e3471461077e5780638f851d8a146107b25780639010d07c146107df576103aa565b806338e454b1116102c1578063504af48c1161025f5780636c1ce6701161022e5780636c1ce670146107145780637de5dedd146107345780638456cb5914610749578063865e6fd31461075e576103aa565b8063504af48c1461068f57806359122f6b146106a25780635c975abb146106cf5780636932be98146106e7576103aa565b80634b14557e1161029b5780634b14557e1461060c5780634d0d66731461061f5780634d493f4e1461063f5780634f4247a11461066f576103aa565b806338e454b1146105c25780633e70838b146105d75780633f4ba83a146105f7576103aa565b80631d4a7210116103395780632f2ff15d116103085780632f2ff15d14610556578063302d12db146105765780633644e5151461058d57806336568abe146105a2576103aa565b80631d4a7210146104c3578063248a9ca3146104f057806329b6eca9146105205780632dfdf0b514610540576103aa565b806317ce2dd41161037557806317ce2dd41461043f57806317fcb39b146104635780631a8e55b0146104835780631b6e7594146104a3576103aa565b806301ffc9a7146103b2578063065b3adf146103e7578063110a83081461041f576103aa565b366103aa576103a8610b88565b005b6103a8610b88565b3480156103be57600080fd5b506103d26103cd36600461416e565b610bbc565b60405190151581526020015b60405180910390f35b3480156103f357600080fd5b50600554610407906001600160a01b031681565b6040516001600160a01b0390911681526020016103de565b34801561042b57600080fd5b506103a861043a3660046141ad565b610c01565b34801561044b57600080fd5b5061045560755481565b6040519081526020016103de565b34801561046f57600080fd5b50607454610407906001600160a01b031681565b34801561048f57600080fd5b506103a861049e36600461420e565b610ca6565b3480156104af57600080fd5b506103a86104be366004614279565b610ce2565b3480156104cf57600080fd5b506104556104de3660046141ad565b603e6020526000908152604090205481565b3480156104fc57600080fd5b5061045561050b36600461431d565b60009081526072602052604090206001015490565b34801561052c57600080fd5b506103a861053b3660046141ad565b610d22565b34801561054c57600080fd5b5061045560765481565b34801561056257600080fd5b506103a8610571366004614336565b610dab565b34801561058257600080fd5b50610455620f424081565b34801561059957600080fd5b50607754610455565b3480156105ae57600080fd5b506103a86105bd366004614336565b610dd5565b3480156105ce57600080fd5b506103a8610e53565b3480156105e357600080fd5b506103a86105f23660046141ad565b611030565b34801561060357600080fd5b506103a861105a565b6103a861061a366004614366565b61106a565b34801561062b57600080fd5b506103d261063a366004614391565b61108d565b34801561064b57600080fd5b506103d261065a36600461431d565b607a6020526000908152604090205460ff1681565b34801561067b57600080fd5b50607f54610407906001600160a01b031681565b6103a861069d36600461443b565b6110fd565b3480156106ae57600080fd5b506104556106bd3660046141ad565b603a6020526000908152604090205481565b3480156106db57600080fd5b5060005460ff166103d2565b3480156106f357600080fd5b5061045561070236600461431d565b60796020526000908152604090205481565b34801561072057600080fd5b506103d261072f366004614515565b6113c3565b34801561074057600080fd5b506104556113cf565b34801561075557600080fd5b506103a86113f0565b34801561076a57600080fd5b506103a8610779366004614550565b611400565b34801561078a57600080fd5b506104557f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e481565b3480156107be57600080fd5b506107d26107cd36600461461b565b61141b565b6040516103de9190614712565b3480156107eb57600080fd5b506104076107fa366004614727565b61159d565b34801561080b57600080fd5b506103a861081a366004614749565b6115b5565b34801561082b57600080fd5b506103d261083a366004614336565b611839565b34801561084b57600080fd5b506103a861085a36600461420e565b611864565b34801561086b57600080fd5b5061087f61087a366004614727565b61189a565b604080519283526020830191909152016103de565b3480156108a057600080fd5b50610455600081565b3480156108b557600080fd5b506104556108c43660046141ad565b603c6020526000908152604090205481565b3480156108e257600080fd5b506103d26108f136600461431d565b6118c3565b34801561090257600080fd5b5061045560045481565b34801561091857600080fd5b506103a861092736600461420e565b6118f9565b34801561093857600080fd5b506104556109473660046141ad565b60396020526000908152604090205481565b34801561096557600080fd5b506109796109743660046141ad565b61192f565b6040516103de9190614790565b34801561099257600080fd5b506103a86109a1366004614727565b6119d2565b3480156109b257600080fd5b506107d26109c1366004614893565b63bc197c8160e01b95945050505050565b3480156109de57600080fd5b506107d26109ed36600461420e565b6119ec565b3480156109fe57600080fd5b50610455610a0d36600461431d565b611b80565b348015610a1e57600080fd5b5060375460385461087f565b348015610a3657600080fd5b50610455610a453660046141ad565b603b6020526000908152604090205481565b348015610a6357600080fd5b506103a8610a72366004614336565b611b97565b348015610a8357600080fd5b50610455610a923660046141ad565b603d6020526000908152604090205481565b348015610ab057600080fd5b506103a8610abf3660046141ad565b611bbc565b348015610ad057600080fd5b506103d2610adf36600461431d565b611bcd565b348015610af057600080fd5b50610407610aff366004614940565b611bfb565b348015610b1057600080fd5b506103a8610b1f36600461495b565b611c71565b348015610b3057600080fd5b506103a8610b3f36600461420e565b611ce6565b348015610b5057600080fd5b5060015460025461087f565b348015610b6857600080fd5b506107d2610b77366004614a18565b63f23a6e6160e01b95945050505050565b6074546001600160a01b0316331480610bab5750607f546001600160a01b031633145b15610bb257565b610bba611d1c565b565b60006001600160e01b031982166246560160e51b1480610bec57506001600160e01b031982166312c0151560e21b145b80610bfb5750610bfb82611d46565b92915050565b607154600490610100900460ff16158015610c23575060715460ff8083169116105b610c485760405162461bcd60e51b8152600401610c3f90614a80565b60405180910390fd5b60718054607f80546001600160a01b0319166001600160a01b03861617905561ff001961010060ff851661ffff199093168317171690915560405190815260008051602061550c833981519152906020015b60405180910390a15050565b610cae611d6b565b6000839003610cd0576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484611dc5565b50505050565b610cea611d6b565b6000859003610d0c576040516316ee9d3b60e11b815260040160405180910390fd5b610d1a868686868686611e9a565b505050505050565b607154600290610100900460ff16158015610d44575060715460ff8083169116105b610d605760405162461bcd60e51b8152600401610c3f90614a80565b6071805461ffff191660ff831617610100179055610d7f600b83612042565b6071805461ff001916905560405160ff8216815260008051602061550c83398151915290602001610c9a565b600082815260726020526040902060010154610dc6816120e6565b610dd083836120f0565b505050565b6001600160a01b0381163314610e455760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610c3f565b610e4f8282612112565b5050565b607154600390610100900460ff16158015610e75575060715460ff8083169116105b610e915760405162461bcd60e51b8152600401610c3f90614a80565b6071805461ffff191660ff8316176101001790556000610eb1600b611bfb565b9050600080826001600160a01b031663c441c4a86040518163ffffffff1660e01b8152600401600060405180830381865afa158015610ef4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f1c9190810190614b4b565b92509250506000805b8351811015610fd957828181518110610f4057610f40614c31565b6020026020010151607e6000868481518110610f5e57610f5e614c31565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154816001600160601b0302191690836001600160601b03160217905550828181518110610fbc57610fbc614c31565b602002602001015182610fcf9190614c5d565b9150600101610f25565b50607d80546001600160601b0319166001600160601b039290921691909117905550506071805461ff00191690555060405160ff8216815260008051602061550c833981519152906020015b60405180910390a150565b611038611d6b565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b611062612134565b610bba6121a3565b6110726121f5565b61108a61108436839003830183614ccd565b3361223b565b50565b60006110976121f5565b6110f3848484808060200260200160405190810160405280939291908181526020016000905b828210156110e9576110da60608302860136819003810190614d20565b815260200190600101906110bd565b5050505050612516565b90505b9392505050565b607154610100900460ff161580801561111d5750607154600160ff909116105b806111375750303b158015611137575060715460ff166001145b6111535760405162461bcd60e51b8152600401610c3f90614a80565b6071805460ff191660011790558015611176576071805461ff0019166101001790555b61118160008c6129aa565b607589905561118f8a6129b4565b61121a6040517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81527f159f52c1e3a2b6a6aad3950adf713516211484e0516dad685ea662a094b7c43b60208201527fad7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5604082015246606082015230608082015260a0812060775550565b6112248887612a02565b61122e8787612a92565b5050611238612b29565b60006112448680614d6a565b905011156113055761126d6112598680614d6a565b6112666020890189614d6a565b8787611e9a565b61129361127a8680614d6a565b8660005b60200281019061128e9190614d6a565b612b76565b6112b96112a08680614d6a565b8660015b6020028101906112b49190614d6a565b611dc5565b6112df6112c68680614d6a565b8660025b6020028101906112da9190614d6a565b612c4b565b6113056112ec8680614d6a565b8660035b6020028101906113009190614d6a565b612d5c565b60005b6113156040870187614d6a565b9050811015611381576113797f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e461134f6040890189614d6a565b8481811061135f5761135f614c31565b905060200201602081019061137491906141ad565b6120f0565b600101611308565b5080156113b6576071805461ff00191690556040516001815260008051602061550c8339815191529060200160405180910390a15b5050505050505050505050565b60006110f68383612e31565b60006113eb6113e6607d546001600160601b031690565b612efc565b905090565b6113f8612134565b610bba612f32565b611408611d6b565b61141181612f6f565b610e4f8282612042565b6000600b61142881612fa5565b825186908114158061143a5750808514155b15611466576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b8060000361147e57506347c28ec560e11b9150611593565b60005b818110156115865784818151811061149b5761149b614c31565b60200260200101511561157e578686828181106114ba576114ba614c31565b90506020020160208101906114cf9190614db3565b607d80546001600160601b031981166001600160601b03918216939093011691909117905586868281811061150657611506614c31565b905060200201602081019061151b9190614db3565b607e60008b8b8581811061153157611531614c31565b905060200201602081019061154691906141ad565b6001600160a01b03168152602081019190915260400160002080546001600160601b0319166001600160601b03929092169190911790555b600101611481565b506347c28ec560e11b9250505b5095945050505050565b60008281526073602052604081206110f69083612ff1565b7f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e46115df816120e6565b60006115f86115f336859003850185614e2d565b612ffd565b905061160c6115f336859003850185614e2d565b83356000908152607960205260409020541461163b5760405163f4b8742f60e01b815260040160405180910390fd5b82356000908152607a602052604090205460ff1661166c5760405163147bfe0760e01b815260040160405180910390fd5b82356000908152607a602052604090819020805460ff19169055517fd639511b37b3b002cca6cfe6bca0d833945a5af5a045578a0627fc43b79b2630906116b69083908690614f00565b60405180910390a160006116d060808501606086016141ad565b905060006116e661012086016101008701614f86565b60028111156116f7576116f7614766565b036117be5760006117113686900386016101008701614fa1565b6001600160a01b0383166000908152603b602052604090205490915061173d90610140870135906130c7565b604082015260006117573687900387016101008801614fa1565b604083015190915061176e90610140880135614fbd565b604082015260745461178e908390339086906001600160a01b03166130e1565b6117b76117a160608801604089016141ad565b60745483919086906001600160a01b03166130e1565b50506117fa565b6117fa6117d160608601604087016141ad565b60745483906001600160a01b03166117f23689900389016101008a01614fa1565b9291906130e1565b7f21e88e956aa3e086f6388e899965cef814688f99ad8bb29b08d396571016372d828560405161182b929190614f00565b60405180910390a150505050565b60009182526072602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61186c611d6b565b600083900361188e576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484612b76565b6000806118a5611d6b565b6118af8484612a92565b90925090506118bc612b29565b9250929050565b60006118d7607d546001600160601b031690565b6037546118e49190614fd0565b6038546118f19084614fd0565b101592915050565b611901611d6b565b6000839003611923576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484612c4b565b60408051808201909152600080825260208201526001600160a01b0382166000908152607860205260409081902081518083019092528054829060ff16600281111561197d5761197d614766565b600281111561198e5761198e614766565b815290546001600160a01b03610100909104811660209283015290820151919250166119cd57604051631b79f53b60e21b815260040160405180910390fd5b919050565b6119da611d6b565b6119e48282612a02565b610e4f612b29565b6000600b6119f981612fa5565b84838114611a28576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b80600003611a405750636242a4ef60e11b9150611b77565b6000805b82811015611b2757868682818110611a5e57611a5e614c31565b9050602002016020810190611a739190614fe7565b15611b1f57607e60008a8a84818110611a8e57611a8e614c31565b9050602002016020810190611aa391906141ad565b6001600160a01b0316815260208101919091526040016000908120546001600160601b03169290920191607e908a8a84818110611ae257611ae2614c31565b9050602002016020810190611af791906141ad565b6001600160a01b03168152602081019190915260400160002080546001600160601b03191690555b600101611a44565b50607d8054829190600090611b469084906001600160601b0316615004565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555063c48549de60e01b935050505b50949350505050565b6000818152607360205260408120610bfb90613313565b600082815260726020526040902060010154611bb2816120e6565b610dd08383612112565b611bc4611d6b565b61108a816129b4565b6000611be1607d546001600160601b031690565b600154611bee9190614fd0565b6002546118f19084614fd0565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115611c3257611c32614766565b60ff1681526020810191909152604001600020546001600160a01b03169050806119cd578160405163409140df60e11b8152600401610c3f9190615034565b611c79611d6b565b6000869003611c9b576040516316ee9d3b60e11b815260040160405180910390fd5b611ca9878787878787611e9a565b611cb6878783600061127e565b611cc387878360016112a4565b611cd087878360026112ca565b611cdd87878360036112f0565b50505050505050565b611cee611d6b565b6000839003611d10576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484612d5c565b611d246121f5565b611d2c61412d565b33815260408082015134910152805161108a90829061223b565b60006001600160e01b03198216630271189760e51b1480610bfb5750610bfb8261331d565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610bba576000356001600160e01b0319166001604051620f948f60ea1b8152600401610c3f929190615042565b828114611df3576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015611e6457828282818110611e1057611e10614c31565b90506020020135603a6000878785818110611e2d57611e2d614c31565b9050602002016020810190611e4291906141ad565b6001600160a01b03168152602081019190915260400160002055600101611df6565b507f64557254143204d91ba2d95acb9fda1e5fea55f77efd028685765bc1e94dd4b58484848460405161182b94939291906150b9565b8483148015611ea857508481145b611ed3576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b85811015611ff857848482818110611ef057611ef0614c31565b9050602002016020810190611f0591906141ad565b60786000898985818110611f1b57611f1b614c31565b9050602002016020810190611f3091906141ad565b6001600160a01b03908116825260208201929092526040016000208054610100600160a81b0319166101009390921692909202179055828282818110611f7857611f78614c31565b9050602002016020810190611f8d9190614f86565b60786000898985818110611fa357611fa3614c31565b9050602002016020810190611fb891906141ad565b6001600160a01b031681526020810191909152604001600020805460ff19166001836002811115611feb57611feb614766565b0217905550600101611ed6565b507fa4f03cc9c0e0aeb5b71b4ec800702753f65748c2cf3064695ba8e8b46be7044486868686868660405161203296959493929190615105565b60405180910390a1505050505050565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f81111561207857612078614766565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f8111156120b9576120b9614766565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b61108a8133613342565b6120fa82826133a6565b6000828152607360205260409020610dd0908261342c565b61211c8282613441565b6000828152607360205260409020610dd090826134a8565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031633148061217657506005546001600160a01b031633145b610bba576000356001600160e01b0319166001604051620f948f60ea1b8152600401610c3f929190615042565b6121ab6134bd565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60005460ff1615610bba5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610c3f565b604080518082018252600080825260208201526074549184015190916001600160a01b03169061226a90613506565b60208401516001600160a01b031661230b5734846040015160400151146122a45760405163129c2ce160e31b815260040160405180910390fd5b6122ad8161192f565b60408501515190925060028111156122c7576122c7614766565b825160028111156122da576122da614766565b146122f75760405162035e2b60ea1b815260040160405180910390fd5b6001600160a01b03811660208501526124a3565b341561232a5760405163129c2ce160e31b815260040160405180910390fd5b612337846020015161192f565b604085015151909250600281111561235157612351614766565b8251600281111561236457612364614766565b146123815760405162035e2b60ea1b815260040160405180910390fd5b6020840151604085015161239691859061354a565b83602001516001600160a01b0316816001600160a01b0316036124a357607454607f54604086810151810151905163095ea7b360e01b81526001600160a01b039283166004820152602481019190915291169063095ea7b3906044016020604051808303816000875af1158015612411573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124359190615176565b50607f546040808601518101519051636f074d1f60e11b81526001600160a01b039092169163de0e9a3e916124709160040190815260200190565b600060405180830381600087803b15801561248a57600080fd5b505af115801561249e573d6000803e3d6000fd5b505050505b60768054600091826124b483615193565b91905055905060006124db858386602001516075548a6136c390949392919063ffffffff16565b90507fd7b25068d9dc8d00765254cfb7f5070f98d263c8d68931d937c7362fa738048b61250782612ffd565b826040516120329291906151cc565b600082356101408401358261253160808701606088016141ad565b905061254e6125493688900388016101008901614fa1565b613506565b60016125606040880160208901615268565b600181111561257157612571614766565b1461258f5760405163182f3d8760e11b815260040160405180910390fd5b608086013546146125d15760405163092048d160e11b81526000356001600160e01b031916600482015260808701356024820152466044820152606401610c3f565b60006125e66109746080890160608a016141ad565b90506125fa61012088016101008901614f86565b600281111561260b5761260b614766565b8151600281111561261e5761261e614766565b14801561264f575061263660e0880160c089016141ad565b6001600160a01b031681602001516001600160a01b0316145b8015612660575060755460e0880135145b61267d5760405163f4b8742f60e01b815260040160405180910390fd5b600084815260796020526040902054156126aa57604051634f13df6160e01b815260040160405180910390fd5b60016126be61012089016101008a01614f86565b60028111156126cf576126cf614766565b14806126e257506126e08284612e31565b155b6126ff5760405163c51297b760e01b815260040160405180910390fd5b60006127136115f3368a90038a018a614e2d565b9050600061272360775483613798565b9050600061274361273c6101208c016101008d01614f86565b86886137d9565b60408051606081018252600080825260208201819052918101829052919a50919250819081906000805b8e51811015612881578e818151811061278857612788614c31565b6020908102919091018101518051818301516040808401518151600081529586018083528e905260ff9093169085015260608401526080830152935060019060a0016020604051602081039080840390855afa1580156127ec573d6000803e3d6000fd5b505050602060405103519450846001600160a01b0316846001600160a01b031610612838576000356001600160e01b031916604051635d3dcd3160e01b8152600401610c3f9190614712565b6001600160a01b0385166000908152607e60205260409020548594506001600160601b03166128679083615283565b91508682106128795760019550612881565b60010161276d565b50846128a057604051639e8f5f6360e01b815260040160405180910390fd5b50505060008981526079602052604090208590555050871561291b576000878152607a602052604090819020805460ff19166001179055517f89e52969465b1f1866fc5d46fd62de953962e9cb33552443cd999eba05bd20dc906129079085908d90614f00565b60405180910390a150505050505050610bfb565b6129258587613869565b61296461293860608c0160408d016141ad565b86607460009054906101000a90046001600160a01b03168d610100018036038101906117f29190614fa1565b7f21e88e956aa3e086f6388e899965cef814688f99ad8bb29b08d396571016372d838b604051612995929190614f00565b60405180910390a15050505050505092915050565b610e4f82826120f0565b607480546001600160a01b0319166001600160a01b0383169081179091556040519081527f9d2334c23be647e994f27a72c5eee42a43d5bdcfe15bb88e939103c2b114cbaf90602001611025565b80821115612a31576000356001600160e01b0319166040516387f6f09560e01b8152600401610c3f9190614712565b6001805460028054858455908490556004805493840190556040805183815260208101839052929391928592879290917f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a450505050565b60008082841115612ac4576000356001600160e01b0319166040516387f6f09560e01b8152600401610c3f9190614712565b5050603780546038805492859055839055600480546001810190915560408051838152602081018590529293928592879290917f31312c97b89cc751b832d98fd459b967a2c3eef3b49757d1cf5ebaa12bb6eee1910160405180910390a49250929050565b600254603754612b399190614fd0565b603854600154612b499190614fd0565b1115610bba576000356001600160e01b0319166040516387f6f09560e01b8152600401610c3f9190614712565b828114612ba4576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015612c1557828282818110612bc157612bc1614c31565b9050602002013560396000878785818110612bde57612bde614c31565b9050602002016020810190612bf391906141ad565b6001600160a01b03168152602081019190915260400160002055600101612ba7565b507f80bc635c452ae67f12f9b6f12ad4daa6dbbc04eeb9ebb87d354ce10c0e210dc08484848460405161182b94939291906150b9565b828114612c79576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015612d2657620f4240838383818110612c9a57612c9a614c31565b905060200201351115612cc05760405163572d3bd360e11b815260040160405180910390fd5b828282818110612cd257612cd2614c31565b90506020020135603b6000878785818110612cef57612cef614c31565b9050602002016020810190612d0491906141ad565b6001600160a01b03168152602081019190915260400160002055600101612c7c565b507fb05f5de88ae0294ebb6f67c5af2fcbbd593cc6bdfe543e2869794a4c8ce3ea508484848460405161182b94939291906150b9565b828114612d8a576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015612dfb57828282818110612da757612da7614c31565b90506020020135603c6000878785818110612dc457612dc4614c31565b9050602002016020810190612dd991906141ad565b6001600160a01b03168152602081019190915260400160002055600101612d8d565b507fb5d2963614d72181b4df1f993d45b83edf42fa19710f0204217ba1b3e183bb738484848460405161182b94939291906150b9565b6001600160a01b0382166000908152603a60205260408120548210612e5857506000610bfb565b6000612e676201518042615296565b6001600160a01b0385166000908152603e6020526040902054909150811115612ead5750506001600160a01b0382166000908152603c6020526040902054811015610bfb565b6001600160a01b0384166000908152603d6020526040902054612ed1908490615283565b6001600160a01b0385166000908152603c602052604090205411159150610bfb9050565b5092915050565b6000600254600160025484600154612f149190614fd0565b612f1e9190615283565b612f289190614fbd565b610bfb9190615296565b612f3a6121f5565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586121d83390565b806001600160a01b03163b60000361108a57604051630bfc64a360e21b81526001600160a01b0382166004820152602401610c3f565b612fae81611bfb565b6001600160a01b0316336001600160a01b03161461108a576000356001600160e01b03191681336040516320e0f98d60e21b8152600401610c3f939291906152b8565b60006110f683836138f9565b60008061300d8360400151613923565b9050600061301e8460600151613923565b905060006130728560800151604080517f1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d815282516020808301919091528301518183015291015160608201526080902090565b604080517fb9d1fe7c9deeec5dc90a2f47ff1684239519f2545b2228d3d91fb27df3189eea815287516020808301919091529097015190870152606086019390935250608084015260a08301525060c0902090565b6000620f42406130d78385614fd0565b6110f69190615296565b806001600160a01b0316826001600160a01b03160361318e5760408085015190516001600160a01b0385169180156108fc02916000818181858888f1935050505061318957806001600160a01b031663d0e30db085604001516040518263ffffffff1660e01b81526004016000604051808303818588803b15801561316557600080fd5b505af1158015613179573d6000803e3d6000fd5b505050505061318984848461396b565b610cdc565b6000845160028111156131a3576131a3614766565b03613269576040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156131ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061321391906152ef565b905084604001518110156132585761323b83308388604001516132369190614fbd565b6139ea565b61325857604051632f739fff60e11b815260040160405180910390fd5b61326385858561396b565b50610cdc565b60018451600281111561327e5761327e614766565b036132af5761329282848660200151613a8f565b6131895760405163c8e3a09f60e01b815260040160405180910390fd5b6002845160028111156132c4576132c4614766565b036132fa576132dd828486602001518760400151613ab6565b613189576040516334b471a760e21b815260040160405180910390fd5b6040516361e411a760e11b815260040160405180910390fd5b6000610bfb825490565b60006001600160e01b03198216635a05180f60e01b1480610bfb5750610bfb82613ae3565b61334c8282611839565b610e4f57613364816001600160a01b03166014613b18565b61336f836020613b18565b60405160200161338092919061532c565b60408051601f198184030181529082905262461bcd60e51b8252610c3f916004016153cd565b6133b08282611839565b610e4f5760008281526072602090815260408083206001600160a01b03851684529091529020805460ff191660011790556133e83390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006110f6836001600160a01b038416613cb3565b61344b8282611839565b15610e4f5760008281526072602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006110f6836001600160a01b038416613d02565b60005460ff16610bba5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610c3f565b61350f81613df5565b8061351e575061351e81613e2c565b8061352d575061352d81613e54565b61108a5760405163034992a760e51b815260040160405180910390fd5b60006060818551600281111561356257613562614766565b0361363d5760408581015181516001600160a01b03878116602483015230604483015260648083019390935283518083039093018352608490910183526020820180516001600160e01b03166323b872dd60e01b1790529151918516916135c991906153e0565b6000604051808303816000865af19150503d8060008114613606576040519150601f19603f3d011682016040523d82523d6000602084013e61360b565b606091505b5090925090508180156136365750805115806136365750808060200190518101906136369190615176565b9150613696565b60018551600281111561365257613652614766565b03613667576136368385308860200151613e7d565b60028551600281111561367c5761367c614766565b036132fa5761363683853088602001518960400151613f2b565b816136bc5784843085604051639d2e4c6760e01b8152600401610c3f94939291906153fc565b5050505050565b6137336040805160a08101825260008082526020808301829052835160608082018652838252818301849052818601849052848601919091528451808201865283815280830184905280860184905281850152845190810185528281529081018290529283015290608082015290565b83815260006020820181905250604080820180516001600160a01b039788169052602080890151825190891690820152905146908301528751606084018051918916909152805195909716940193909352935182015292909201516080820152919050565b6040805161190160f01b60208083019190915260228201859052604280830185905283518084039091018152606290920190925280519101206000906110f6565b60008060006137f0607d546001600160601b031690565b90506137fb81612efc565b9250600086600281111561381157613811614766565b03613860576001600160a01b03851660009081526039602052604090205484106138415761383e81613fdf565b92505b6001600160a01b0385166000908152603a602052604090205484101591505b50935093915050565b60006138786201518042615296565b6001600160a01b0384166000908152603e60205260409020549091508111156138c7576001600160a01b03929092166000908152603e6020908152604080832094909455603d90529190912055565b6001600160a01b0383166000908152603d6020526040812080548492906138ef908490615283565b9091555050505050565b600082600001828154811061391057613910614c31565b9060005260206000200154905092915050565b604080517f353bdd8d69b9e3185b3972e08b03845c0c14a21a390215302776a7a34b0e8764815282516020808301919091528301518183015291015160608201526080902090565b6000808451600281111561398157613981614766565b0361399c5761399582848660400151613ff7565b90506139c6565b6001845160028111156139b1576139b1614766565b036132fa576139958230858760200151613e7d565b80610cdc578383836040516341bd7d9160e11b8152600401610c3f93929190615432565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b03166340c10f1960e01b1790529151600092861691613a42916153e0565b6000604051808303816000865af19150503d8060008114613a7f576040519150601f19603f3d011682016040523d82523d6000602084013e613a84565b606091505b509095945050505050565b6000613a9d84308585613e7d565b9050806110f657613aaf8484846139ea565b90506110f6565b6000613ac58530868686613f2b565b905080613adb57613ad8858585856140ca565b90505b949350505050565b60006001600160e01b03198216637965db0b60e01b1480610bfb57506301ffc9a760e01b6001600160e01b0319831614610bfb565b60606000613b27836002614fd0565b613b32906002615283565b6001600160401b03811115613b4957613b4961457c565b6040519080825280601f01601f191660200182016040528015613b73576020820181803683370190505b509050600360fc1b81600081518110613b8e57613b8e614c31565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613bbd57613bbd614c31565b60200101906001600160f81b031916908160001a9053506000613be1846002614fd0565b613bec906001615283565b90505b6001811115613c64576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613c2057613c20614c31565b1a60f81b828281518110613c3657613c36614c31565b60200101906001600160f81b031916908160001a90535060049490941c93613c5d81615462565b9050613bef565b5083156110f65760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c3f565b6000818152600183016020526040812054613cfa57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610bfb565b506000610bfb565b60008181526001830160205260408120548015613deb576000613d26600183614fbd565b8554909150600090613d3a90600190614fbd565b9050818114613d9f576000866000018281548110613d5a57613d5a614c31565b9060005260206000200154905080876000018481548110613d7d57613d7d614c31565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613db057613db0615479565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610bfb565b6000915050610bfb565b60008082516002811115613e0b57613e0b614766565b148015613e1c575060008260400151115b8015610bfb575050602001511590565b6000600182516002811115613e4357613e43614766565b148015610bfb575050604001511590565b6000600282516002811115613e6b57613e6b614766565b148015610bfb57505060400151151590565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b1790529151600092871691613edd916153e0565b6000604051808303816000865af19150503d8060008114613f1a576040519150601f19603f3d011682016040523d82523d6000602084013e613f1f565b606091505b50909695505050505050565b604080516000808252602082019092526001600160a01b03871690613f5b9087908790879087906044810161548f565b60408051601f198184030181529181526020820180516001600160e01b0316637921219560e11b17905251613f9091906153e0565b6000604051808303816000865af19150503d8060008114613fcd576040519150601f19603f3d011682016040523d82523d6000602084013e613fd2565b606091505b5090979650505050505050565b6000603854600160385484603754612f149190614fd0565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000926060929087169161405491906153e0565b6000604051808303816000865af19150503d8060008114614091576040519150601f19603f3d011682016040523d82523d6000602084013e614096565b606091505b5090925090508180156140c15750805115806140c15750808060200190518101906140c19190615176565b95945050505050565b604080516000808252602082019092526001600160a01b038616906140f890869086908690604481016154d4565b60408051601f198184030181529181526020820180516001600160e01b031663731133e960e01b17905251613edd91906153e0565b60408051606081018252600080825260208201529081016141696040805160608101909152806000815260200160008152602001600081525090565b905290565b60006020828403121561418057600080fd5b81356001600160e01b0319811681146110f657600080fd5b6001600160a01b038116811461108a57600080fd5b6000602082840312156141bf57600080fd5b81356110f681614198565b60008083601f8401126141dc57600080fd5b5081356001600160401b038111156141f357600080fd5b6020830191508360208260051b85010111156118bc57600080fd5b6000806000806040858703121561422457600080fd5b84356001600160401b038082111561423b57600080fd5b614247888389016141ca565b9096509450602087013591508082111561426057600080fd5b5061426d878288016141ca565b95989497509550505050565b6000806000806000806060878903121561429257600080fd5b86356001600160401b03808211156142a957600080fd5b6142b58a838b016141ca565b909850965060208901359150808211156142ce57600080fd5b6142da8a838b016141ca565b909650945060408901359150808211156142f357600080fd5b5061430089828a016141ca565b979a9699509497509295939492505050565b80356119cd81614198565b60006020828403121561432f57600080fd5b5035919050565b6000806040838503121561434957600080fd5b82359150602083013561435b81614198565b809150509250929050565b600060a0828403121561437857600080fd5b50919050565b6000610160828403121561437857600080fd5b600080600061018084860312156143a757600080fd5b6143b1858561437e565b92506101608401356001600160401b03808211156143ce57600080fd5b818601915086601f8301126143e257600080fd5b8135818111156143f157600080fd5b87602060608302850101111561440657600080fd5b6020830194508093505050509250925092565b8060608101831015610bfb57600080fd5b8060808101831015610bfb57600080fd5b6000806000806000806000806000806101208b8d03121561445b57600080fd5b6144648b614312565b995061447260208c01614312565b985060408b0135975060608b0135965060808b0135955060a08b0135945060c08b01356001600160401b03808211156144aa57600080fd5b6144b68e838f01614419565b955060e08d01359150808211156144cc57600080fd5b6144d88e838f0161442a565b94506101008d01359150808211156144ef57600080fd5b506144fc8d828e016141ca565b915080935050809150509295989b9194979a5092959850565b6000806040838503121561452857600080fd5b823561453381614198565b946020939093013593505050565b8035601081106119cd57600080fd5b6000806040838503121561456357600080fd5b61456c83614541565b9150602083013561435b81614198565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b03811182821017156145b4576145b461457c565b60405290565b604051601f8201601f191681016001600160401b03811182821017156145e2576145e261457c565b604052919050565b60006001600160401b038211156146035761460361457c565b5060051b60200190565b801515811461108a57600080fd5b60008060008060006060868803121561463357600080fd5b85356001600160401b038082111561464a57600080fd5b61465689838a016141ca565b909750955060209150878201358181111561467057600080fd5b61467c8a828b016141ca565b90965094505060408801358181111561469457600080fd5b88019050601f810189136146a757600080fd5b80356146ba6146b5826145ea565b6145ba565b81815260059190911b8201830190838101908b8311156146d957600080fd5b928401925b828410156147005783356146f18161460d565b825292840192908401906146de565b80955050505050509295509295909350565b6001600160e01b031991909116815260200190565b6000806040838503121561473a57600080fd5b50508035926020909101359150565b6000610160828403121561475c57600080fd5b6110f6838361437e565b634e487b7160e01b600052602160045260246000fd5b6003811061478c5761478c614766565b9052565b60006040820190506147a382845161477c565b6020928301516001600160a01b0316919092015290565b600082601f8301126147cb57600080fd5b813560206147db6146b5836145ea565b8083825260208201915060208460051b8701019350868411156147fd57600080fd5b602086015b848110156148195780358352918301918301614802565b509695505050505050565b600082601f83011261483557600080fd5b81356001600160401b0381111561484e5761484e61457c565b614861601f8201601f19166020016145ba565b81815284602083860101111561487657600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a086880312156148ab57600080fd5b85356148b681614198565b945060208601356148c681614198565b935060408601356001600160401b03808211156148e257600080fd5b6148ee89838a016147ba565b9450606088013591508082111561490457600080fd5b61491089838a016147ba565b9350608088013591508082111561492657600080fd5b5061493388828901614824565b9150509295509295909350565b60006020828403121561495257600080fd5b6110f682614541565b60008060008060008060006080888a03121561497657600080fd5b87356001600160401b038082111561498d57600080fd5b6149998b838c016141ca565b909950975060208a01359150808211156149b257600080fd5b6149be8b838c016141ca565b909750955060408a01359150808211156149d757600080fd5b6149e38b838c016141ca565b909550935060608a01359150808211156149fc57600080fd5b50614a098a828b0161442a565b91505092959891949750929550565b600080600080600060a08688031215614a3057600080fd5b8535614a3b81614198565b94506020860135614a4b81614198565b9350604086013592506060860135915060808601356001600160401b03811115614a7457600080fd5b61493388828901614824565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b600082601f830112614adf57600080fd5b81516020614aef6146b5836145ea565b8083825260208201915060208460051b870101935086841115614b1157600080fd5b602086015b84811015614819578051614b2981614198565b8352918301918301614b16565b6001600160601b038116811461108a57600080fd5b600080600060608486031215614b6057600080fd5b83516001600160401b0380821115614b7757600080fd5b614b8387838801614ace565b9450602091508186015181811115614b9a57600080fd5b614ba688828901614ace565b945050604086015181811115614bbb57600080fd5b86019050601f81018713614bce57600080fd5b8051614bdc6146b5826145ea565b81815260059190911b82018301908381019089831115614bfb57600080fd5b928401925b82841015614c22578351614c1381614b36565b82529284019290840190614c00565b80955050505050509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6001600160601b03818116838216019080821115612ef557612ef5614c47565b8035600381106119cd57600080fd5b600060608284031215614c9e57600080fd5b614ca6614592565b9050614cb182614c7d565b8152602082013560208201526040820135604082015292915050565b600060a08284031215614cdf57600080fd5b614ce7614592565b8235614cf281614198565b81526020830135614d0281614198565b6020820152614d148460408501614c8c565b60408201529392505050565b600060608284031215614d3257600080fd5b614d3a614592565b823560ff81168114614d4b57600080fd5b8152602083810135908201526040928301359281019290925250919050565b6000808335601e19843603018112614d8157600080fd5b8301803591506001600160401b03821115614d9b57600080fd5b6020019150600581901b36038213156118bc57600080fd5b600060208284031215614dc557600080fd5b81356110f681614b36565b8035600281106119cd57600080fd5b600060608284031215614df157600080fd5b614df9614592565b90508135614e0681614198565b81526020820135614e1681614198565b806020830152506040820135604082015292915050565b60006101608284031215614e4057600080fd5b60405160a081018181106001600160401b0382111715614e6257614e6261457c565b60405282358152614e7560208401614dd0565b6020820152614e878460408501614ddf565b6040820152614e998460a08501614ddf565b6060820152614eac846101008501614c8c565b60808201529392505050565b6002811061478c5761478c614766565b8035614ed381614198565b6001600160a01b039081168352602082013590614eef82614198565b166020830152604090810135910152565b60006101808201905083825282356020830152614f1f60208401614dd0565b614f2c6040840182614eb8565b50614f3d6060830160408501614ec8565b614f4d60c0830160a08501614ec8565b610120614f68818401614f636101008701614c7d565b61477c565b61014081850135818501528085013561016085015250509392505050565b600060208284031215614f9857600080fd5b6110f682614c7d565b600060608284031215614fb357600080fd5b6110f68383614c8c565b81810381811115610bfb57610bfb614c47565b8082028115828204841417610bfb57610bfb614c47565b600060208284031215614ff957600080fd5b81356110f68161460d565b6001600160601b03828116828216039080821115612ef557612ef5614c47565b6010811061478c5761478c614766565b60208101610bfb8284615024565b6001600160e01b03198316815260408101600b831061506357615063614766565b8260208301529392505050565b8183526000602080850194508260005b858110156150ae57813561509381614198565b6001600160a01b031687529582019590820190600101615080565b509495945050505050565b6040815260006150cd604083018688615070565b82810360208401528381526001600160fb1b038411156150ec57600080fd5b8360051b80866020840137016020019695505050505050565b60608152600061511960608301888a615070565b6020838203602085015261512e82888a615070565b848103604086015285815286925060200160005b868110156151675761515782614f6386614c7d565b9282019290820190600101615142565b509a9950505050505050505050565b60006020828403121561518857600080fd5b81516110f68161460d565b6000600182016151a5576151a5614c47565b5060010190565b6151b782825161477c565b60208181015190830152604090810151910152565b6000610180820190508382528251602083015260208301516151f16040840182614eb8565b5060408381015180516001600160a01b03908116606086015260208201511660808501529081015160a084015250606083015180516001600160a01b0390811660c085015260208201511660e084015260408101516101008401525060808301516152606101208401826151ac565b509392505050565b60006020828403121561527a57600080fd5b6110f682614dd0565b80820180821115610bfb57610bfb614c47565b6000826152b357634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031984168152606081016152d66020830185615024565b6001600160a01b03929092166040919091015292915050565b60006020828403121561530157600080fd5b5051919050565b60005b8381101561532357818101518382015260200161530b565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615364816017850160208801615308565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615395816028840160208801615308565b01602801949350505050565b600081518084526153b9816020860160208601615308565b601f01601f19169290920160200192915050565b6020815260006110f660208301846153a1565b600082516153f2818460208701615308565b9190910192915050565b60c0810161540a82876151ac565b6001600160a01b0394851660608301529284166080820152921660a090920191909152919050565b60a0810161544082866151ac565b6001600160a01b03938416606083015291909216608090920191909152919050565b60008161547157615471614c47565b506000190190565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906154c9908301846153a1565b979650505050505050565b60018060a01b038516815283602082015282604082015260806060820152600061550160808301846153a1565b969550505050505056fe7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498a264697066735822122039bdd676fa56a806e2f91eb197d0a444b13ff0899114d328ae5983c28d58606164736f6c63430008170033", + "nonce": "0x1a", + "accessList": [] + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CALL", + "contractName": "MainchainBridgeManager", + "contractAddress": "0x5396b75c9eb8D1153D2B8a0Bb9a8c4B1541f758d", + "function": null, + "arguments": null, + "transaction": { + "type": "0x02", + "from": "0xd24d87ddc1917165435b306aac68d99e0f49a3fa", + "to": "0x5396b75c9eb8d1153d2b8a0bb9a8c4b1541f758d", + "gas": "0x7a1200", + "value": "0x0", + "data": "0x5e05cf9e000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000009800000000000000000000000000000000000000000000000000000000000000a2000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000aa36a7000000000000000000000000000000000000000000000000000000006630a1a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000820000000000000000000000000000000000000000000000000000000000000000700000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e00000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e00000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e00000000000000000000000061ec0ebf966ae84c414bda715e17cef657e039df00000000000000000000000061ec0ebf966ae84c414bda715e17cef657e039df000000000000000000000000603075b625cc2cf69fbb3546c6acc2451fe792af000000000000000000000000603075b625cc2cf69fbb3546c6acc2451fe792af00000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000003c000000000000000000000000000000000000000000000000000000000000004c000000000000000000000000000000000000000000000000000000000000000a44f1ef2860000000000000000000000001050f2e63177b5ed18f3e88d000db3a600d664e300000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024110a8308000000000000000000000000dbf1c9fb0cb61ae76901e55c5c04e77d2be131a1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000603075b625cc2cf69fbb3546c6acc2451fe792af000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f283970000000000000000000000000603075b625cc2cf69fbb3546c6acc2451fe792af0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe600000000000000000000000023614572006e2d0db35e54d4082aec68d96864500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f283970000000000000000000000000603075b625cc2cf69fbb3546c6acc2451fe792af0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c44bb5274a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006435da81210000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f283970000000000000000000000000603075b625cc2cf69fbb3546c6acc2451fe792af00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001b3b6caa3d4505a1c9cf9e919a054d18fb9d535d011aa1014de547e4571caa3ddf6de4da3398eaffeabe44e76ba336b5fcccddc7d97656f8cbbb2c64ae249371be000000000000000000000000000000000000000000000000000000000000001c2edc7c3cf58e29df3decbf15c345fddb2edce83568fd8506aa2b10b259e29e58215de8c6bcc92188508cee6cd09d14a58f19dc839644d4c645b59b8d7e31d82e000000000000000000000000000000000000000000000000000000000000001b080ed428672a9a77220c4317866dc69e2ee99b5bdd08e72c0c581f4fc57a2852524263bd497a1305257b03bccbb0dad12dae0279408f2c2b2fc7a283cc2844ca000000000000000000000000000000000000000000000000000000000000001cbf30a6c1395c8d9e4e7d48206247431aaa77dc4df0e8495e4db8dadd099425d106eb70446b5ab47e64da5a45fd3755b9474003508b18e0a447937a1f50cc6590", + "nonce": "0x0", + "accessList": [] + }, + "additionalContracts": [], + "isFixedGasLimit": true + } + ], + "receipts": [ + { + "transactionHash": "0x32dcfdca4661c4cd3882524622948948f7b0cf1f1d1de824c635ceed267e1def", + "transactionIndex": "0xc", + "blockHash": "0xa9bc997f9730f4ee6ed230f52b4ace8b73907ede3c4dc9439fdea6b17cfe4b2c", + "blockNumber": "0x571e07", + "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "to": "0x61eC0ebf966AE84C414BDA715E17CeF657e039DF", + "cumulativeGasUsed": "0x8b968", + "gasUsed": "0x7001", + "contractAddress": null, + "logs": [ + { + "address": "0x61eC0ebf966AE84C414BDA715E17CeF657e039DF", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000968d0cd7343f711216817e617d3f92a23dc91c070000000000000000000000005396b75c9eb8d1153d2b8a0bb9a8c4b1541f758d", + "blockHash": "0xa9bc997f9730f4ee6ed230f52b4ace8b73907ede3c4dc9439fdea6b17cfe4b2c", + "blockNumber": "0x571e07", + "transactionHash": "0x32dcfdca4661c4cd3882524622948948f7b0cf1f1d1de824c635ceed267e1def", + "transactionIndex": "0xc", + "logIndex": "0x7", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000020000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000400000000000000000000000000080000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "effectiveGasPrice": "0x194ba3d10a" + }, + { + "transactionHash": "0x2faea0626466f084d03101489e4a35b7ca9b20b4703fceebcd2cb1bbe58bb7a7", + "transactionIndex": "0xe", + "blockHash": "0xca322afa88e562ff018bd1ad101ebe1ae7ef05454f60f9a0036336c6c969fcf1", + "blockNumber": "0x571e08", + "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "to": "0x06855f31dF1d3D25cE486CF09dB49bDa535D2a9e", + "cumulativeGasUsed": "0xe1b27", + "gasUsed": "0x7001", + "contractAddress": null, + "logs": [ + { + "address": "0x06855f31dF1d3D25cE486CF09dB49bDa535D2a9e", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000968d0cd7343f711216817e617d3f92a23dc91c070000000000000000000000005396b75c9eb8d1153d2b8a0bb9a8c4b1541f758d", + "blockHash": "0xca322afa88e562ff018bd1ad101ebe1ae7ef05454f60f9a0036336c6c969fcf1", + "blockNumber": "0x571e08", + "transactionHash": "0x2faea0626466f084d03101489e4a35b7ca9b20b4703fceebcd2cb1bbe58bb7a7", + "transactionIndex": "0xe", + "logIndex": "0xc", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000040000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000440000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "effectiveGasPrice": "0x1c5e0e07d7" + } + ], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1713254298, + "chain": 11155111, + "multi": false, + "commit": "d84a88c" +} \ No newline at end of file diff --git a/broadcast/20240411-p3-upgrade-bridge-main-chain.s.sol/11155111/run-1713254978.json b/broadcast/20240411-p3-upgrade-bridge-main-chain.s.sol/11155111/run-1713254978.json new file mode 100644 index 00000000..fedad33c --- /dev/null +++ b/broadcast/20240411-p3-upgrade-bridge-main-chain.s.sol/11155111/run-1713254978.json @@ -0,0 +1,738 @@ +{ + "transactions": [ + { + "hash": "0xf8db3100846b70a3a0c38a27dc792cff5e4a02498aea7b04b181a889bd7eb200", + "transactionType": "CALL", + "contractName": "TransparentUpgradeableProxyV2", + "contractAddress": "0x61eC0ebf966AE84C414BDA715E17CeF657e039DF", + "function": "changeAdmin(address)", + "arguments": [ + "0x5396b75c9eb8D1153D2B8a0Bb9a8c4B1541f758d" + ], + "transaction": { + "type": "0x02", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "to": "0x61ec0ebf966ae84c414bda715e17cef657e039df", + "gas": "0x10f58", + "value": "0x0", + "data": "0x8f2839700000000000000000000000005396b75c9eb8d1153d2b8a0bb9a8c4b1541f758d", + "nonce": "0x13", + "accessList": [] + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x5147b7112152f9d5b5ac870bfa90501324ede13008546831abd76706bc097b27", + "transactionType": "CALL", + "contractName": "TransparentUpgradeableProxyV2", + "contractAddress": "0x06855f31dF1d3D25cE486CF09dB49bDa535D2a9e", + "function": "changeAdmin(address)", + "arguments": [ + "0x5396b75c9eb8D1153D2B8a0Bb9a8c4B1541f758d" + ], + "transaction": { + "type": "0x02", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "to": "0x06855f31df1d3d25ce486cf09db49bda535d2a9e", + "gas": "0x10f58", + "value": "0x0", + "data": "0x8f2839700000000000000000000000005396b75c9eb8d1153d2b8a0bb9a8c4b1541f758d", + "nonce": "0x14", + "accessList": [] + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0xe85854178d838b3f4c5685d97201e45ab55a55033993f19beabe479db0cf20e0", + "transactionType": "CREATE", + "contractName": "MainchainBridgeManager", + "contractAddress": "0x8A6e09c0E369086B3AC219aB66F990b0A7d3E1Da", + "function": null, + "arguments": null, + "transaction": { + "type": "0x02", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x8c2502", + "value": "0x0", + "data": "0x60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61519e80620000f46000396000f3fe608060405234801561001057600080fd5b50600436106102065760003560e01c80639b19dbfd1161011a578063cc7e6b3b116100ad578063de981f1b1161007c578063de981f1b146104ae578063e75235b8146104c1578063e9c03498146104de578063f80b5352146104f1578063f896f070146104f957600080fd5b8063cc7e6b3b14610460578063d0a50db014610480578063d78392f814610488578063dafae4081461049b57600080fd5b8063b405aaf2116100e9578063b405aaf21461041b578063b9c362091461042e578063bc96180b14610441578063c441c4a81461044957600080fd5b80639b19dbfd14610392578063a64a83801461039a578063aee1767f146103ad578063b384abef146103c057600080fd5b80633644e5151161019d5780637f7fe0581161016c5780637f7fe05814610303578063800eaab31461032e578063865e6fd3146103415780638dc0dbc614610354578063901979d51461036757600080fd5b80633644e515146102bc57806362077409146102c5578063776fb1ec146102d85780637de5dedd146102fb57600080fd5b80631f425338116101d95780631f425338146102635780632d6d7d731461027657806334d5f37b1461028957806335da8121146102a957600080fd5b806301a5f43f1461020b57806306aba0e1146102205780630a44fa431461023b5780630f7c31891461024e575b600080fd5b61021e610219366004613fd0565b61050c565b005b6102286105bb565b6040519081526020015b60405180910390f35b610228610249366004614069565b6105ca565b61025661064f565b60405161023291906140ef565b61021e610271366004614069565b610668565b610256610284366004614069565b61070a565b610228610297366004614102565b60026020526000908152604090205481565b61021e6102b7366004614069565b610751565b61022860015481565b61021e6102d336600461415f565b610799565b6102eb6102e6366004614102565b6107c9565b6040519015158152602001610232565b610228610816565b610316610311366004614212565b61086c565b6040516001600160a01b039091168152602001610232565b61021e61033c3660046143c4565b6108ed565b61021e61034f366004614436565b610925565b61021e610362366004614469565b610940565b61037a610375366004614212565b61096a565b6040516001600160601b039091168152602001610232565b6102566109a0565b61021e6103a8366004614102565b610a0b565b6103166103bb366004614212565b610a1f565b61040a6103ce3660046144ad565b600360208181526000938452604080852090915291835291208054600182015460028301549383015460069093015460ff909216939092909185565b6040516102329594939291906144e5565b6102eb610429366004614212565b610a31565b61021e61043c3660046144ad565b610a69565b600454610228565b610451610a7b565b60405161023293929190614554565b61047361046e366004614069565b610b55565b6040516102329190614597565b610228610b93565b61037a610496366004614212565b610ba6565b6102eb6104a9366004614102565b610bb1565b6103166104bc3660046145aa565b610c03565b6104c9610c7e565b60408051928352602083019190915201610232565b61021e6104ec366004614069565b610cc6565b610256610d0f565b61021e61050736600461463a565b610d72565b610514610eac565b6105b286868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808a0282810182019093528982529093508992508891829185019084908082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250610f0892505050565b50505050505050565b60006105c561126a565b905090565b600082828080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061060b925083915061127d9050565b6106478484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506112b292505050565b949350505050565b60606105c5600080516020615149833981519152611337565b610670610eac565b8181808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506106af925083915061127d9050565b60008051602061514983398151915260005b83811015610703576106fa8585838181106106de576106de61475f565b90506020020160208101906106f39190614212565b839061134b565b506001016106c1565b5050505050565b606061074883838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250611360915050565b90505b92915050565b610759610eac565b6107958282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506114b392505050565b5050565b6107a233611570565b6107bb6107b56060870160408801614212565b336115b2565b61070385858585853361160d565b60008060008381527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff602052604090205460ff16600481111561080e5761080e6144cf565b141592915050565b600080610821611641565b905060008061082e610c7e565b9150915080600182856004015485610846919061478b565b61085091906147a2565b61085a91906147b5565b61086491906147c8565b935050505090565b600080600061088261087c611641565b85611665565b91509150816108b45760405163141e2e1f60e11b81526001600160a01b03851660048201526024015b60405180910390fd5b6108bc611641565b60010181815481106108d0576108d061475f565b6000918252602090912001546001600160a01b0316949350505050565b33301461091b576000356001600160e01b0319166040516307337e1960e41b81526004016108ab91906147ea565b61079582826116ca565b61092d610eac565b61093681611773565b61079582826117a9565b61094933611570565b61095c6107b56080870160608801614212565b61070385858585853361184d565b600080610975611641565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b031690565b60606109aa611641565b600101805480602002602001604051908101604052809291908181526020018280548015610a0157602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116109e3575b5050505050905090565b610a13610eac565b610a1c81611881565b50565b6000610a2a826118ee565b5092915050565b600080610a3c611641565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b0316151590565b610a71610eac565b610795828261196e565b60608060606000610a8a611641565b805460408051602080840282018101909252828152929350839190830182828015610ade57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610ac0575b5050505050935080600101805480602002602001604051908101604052809291908181526020018280548015610b3d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b1f575b50505050509250610b4d84611a70565b915050909192565b6060610748838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611a7092505050565b6000610b9d611641565b60010154919050565b600061074b82611b5c565b60007ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00610bdc61126a565b8160010154610beb919061478b565b6002820154610bfa908561478b565b10159392505050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115610c3a57610c3a6144cf565b60ff1681526020810191909152604001600020546001600160a01b0316905080610c79578160405163409140df60e11b81526004016108ab91906147ff565b919050565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f01547ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f02549091565b610cce610eac565b610d0a828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611b9192505050565b505050565b6060610d19611641565b805460408051602080840282018101909252828152929190830182828015610a01576020028201919060005260206000209081546001600160a01b031681526001909101906020018083116109e3575050505050905090565b600054610100900460ff1615808015610d925750600054600160ff909116105b80610dac5750303b158015610dac575060005460ff166001145b610e0f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016108ab565b6000805460ff191660011790558015610e32576000805461ff0019166101001790555b610e3f600160ff1b611f77565b610e498383611fa7565b610e598b8b8b8b8b8b8b8b611fd8565b8015610e9f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610f06576000356001600160e01b0319166001604051620f948f60ea1b81526004016108ab929190614819565b565b6060610f148383612029565b610f1d8161127d565b6000610f27611641565b845187519192509081148015610f3d5750855181145b610f68576000356001600160e01b0319166040516306b5667560e21b81526004016108ab91906147ea565b806001600160401b03811115610f8057610f8061422d565b604051908082528060200260200182016040528015610fa9578160200160208202803683370190505b50935080600003610fbb575050611262565b60008060008060005b858110156111ce578a8181518110610fde57610fde61475f565b60200260200101519450898181518110610ffa57610ffa61475f565b602002602001015193508b81815181106110165761101661475f565b6020026020010151925061102985612133565b61103284612133565b826001600160601b031660000361106a576000356001600160e01b031916604051637f11b8a360e11b81526004016108ab91906147ea565b6001600160a01b03808616600081815260038a01602090815260408083205494891683528083205460028d0190925280832054938352909120546001600160601b0393841693918216926110c2929081169116614847565b6110cc9190614847565b6110d69190614847565b6001600160601b03166000148982815181106110f4576110f461475f565b6020026020010190151590811515815250508881815181106111185761111861475f565b6020026020010151156111c6578654600181810189556000898152602080822090930180546001600160a01b03808b166001600160a01b0319928316811790935591835260028c018552604080842080546001600160601b038b166001600160601b03199182168117909255868f018054978801815586528786209096018054948c1694909316841790925591835260038c0190945290208054909116821790556111c390836147a2565b91505b600101610fc4565b50808660040160008282546111e391906147a2565b909155505060405161121e906347c28ec560e11b9061120a908c908f908d9060200161489a565b604051602081830303815290604052612168565b7f897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b78888c8c8c60405161125394939291906148d3565b60405180910390a15050505050505b509392505050565b6000611274611641565b60040154905090565b61128681612195565b15610a1c576000356001600160e01b031916604051630d697db160e11b81526004016108ab91906147ea565b6000816112be8161127d565b60006112c8611641565b905060005b845181101561132f578160020160008683815181106112ee576112ee61475f565b6020908102919091018101516001600160a01b0316825281019190915260400160002054611325906001600160601b0316856147a2565b93506001016112cd565b505050919050565b6060600061134483612234565b9392505050565b6000610748836001600160a01b038416612290565b606082516001600160401b0381111561137b5761137b61422d565b6040519080825280602002602001820160405280156113a4578160200160208202803683370190505b50905060005b8351811015610a2a57600560008583815181106113c9576113c961475f565b602002602001015160058111156113e2576113e26144cf565b60058111156113f3576113f36144cf565b815260200190815260200160002060009054906101000a90046001600160a01b03168282815181106114275761142761475f565b60200260200101906001600160a01b031690816001600160a01b03168152505082801561147f575060006001600160a01b031682828151811061146c5761146c61475f565b60200260200101516001600160a01b0316145b156114ab576000356001600160e01b03191660405163053265f160e01b81526004016108ab91906147ea565b6001016113aa565b806114bd8161127d565b600080516020615149833981519152600080805b8551811015611568578581815181106114ec576114ec61475f565b602002602001015192506114ff83611773565b611510836312c0151560e21b612383565b61151a8484612516565b604080516001600160a01b038616815282151560208201529193507fb85c58eeff9fe423669ae0841666f4c8499e8731b8275eb462e4fa1720ec420e910160405180910390a16001016114d1565b505050505050565b61157981611b5c565b6001600160601b0316600003610a1c576000356001600160e01b0319166003604051620f948f60ea1b81526004016108ab929190614819565b6001600160a01b038216158015906115dc5750816001600160a01b0316816001600160a01b031614155b15610795576040516301df97c360e51b81526001600160a01b038084166004830152821660248201526044016108ab565b600061162161161b88614a6e565b8361252b565b90506105b2818787878761163c6116378e614a6e565b61263d565b61277c565b7fc648703095712c0419b6431ae642c061f0a105ac2d7c3d9604061ef4ebc3830090565b60008060005b84548110156116b8578481815481106116865761168661475f565b6000918252602090912001546001600160a01b03908116908516036116b0576001925090506116c3565b60010161166b565b506000600019915091505b9250929050565b60005b8251811015610d0a57306001600160a01b03168282815181106116f2576116f261475f565b60200260200101516001600160a01b03160361172f576000356001600160e01b03191660405163053265f160e01b81526004016108ab91906147ea565b61176b8382815181106117445761174461475f565b602002602001015183838151811061175e5761175e61475f565b6020026020010151612c48565b6001016116cd565b806001600160a01b03163b600003610a1c57604051630bfc64a360e21b81526001600160a01b03821660048201526024016108ab565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f8111156117df576117df6144cf565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115611820576118206144cf565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b61185f61185987614b49565b82612cdb565b5061156861186c87614b49565b8686868661163c61187c8d614b49565b612de2565b60038110156118a3576040516305f4dee960e31b815260040160405180910390fd5b60006118ad611641565b600581018390556040518381529091507f22d5bb5059ffe2949a098666fc198587200c8118483074120d3ca7050c7753f19060200160405180910390a15050565b6000806000806119086118ff611641565b60010186611665565b9150915081611935576040516326527e1760e01b81526001600160a01b03861660048201526024016108ab565b61193d611641565b80548290811061194f5761194f61475f565b6000918252602090912001546001600160a01b03169590945092505050565b8082118061197d575060018111155b156119a9576000356001600160e01b0319166040516387f6f09560e01b81526004016108ab91906147ea565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f0180547ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f028054928590558390557ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00805490929084908690856000611a2c83614c2f565b9091555060408051868152602081018690527f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a45050505050565b60606000611a7c611641565b905082516001600160401b03811115611a9757611a9761422d565b604051908082528060200260200182016040528015611ac0578160200160208202803683370190505b50915060005b8351811015611b5557816002016000858381518110611ae757611ae761475f565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160601b0316838281518110611b3557611b3561475f565b6001600160601b0390921660209283029190910190910152600101611ac6565b5050919050565b6000611b66611641565b6001600160a01b0390921660009081526002929092016020525060409020546001600160601b031690565b606081611b9d8161127d565b6000611ba7611641565b8451909150806001600160401b03811115611bc457611bc461422d565b604051908082528060200260200182016040528015611bed578160200160208202803683370190505b50935080600003611bff575050611f71565b60058201548254611c119083906147b5565b1015611c305760405163b2e765cb60e01b815260040160405180910390fd5b60008060008060005b85811015611ef757898181518110611c5357611c5361475f565b60200260200101519350611c66846118ee565b9095509150611c7485612133565b611c7d84612133565b6001600160a01b03851660009081526002880160205260409020546001600160601b031615801590611cd157506001600160a01b03841660009081526003880160205260409020546001600160601b031615155b898281518110611ce357611ce361475f565b602002602001019015159081151581525050888181518110611d0757611d0761475f565b602002602001015115611eef576001600160a01b038516600090815260028801602052604081205488546001600160601b039091169190611d4a906001906147b5565b9050886000018181548110611d6157611d6161475f565b60009182526020909120015489546001600160a01b03909116908a9086908110611d8d57611d8d61475f565b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790558854899080611dc757611dc7614c48565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038916825260028b0190526040902080546001600160601b031916905560018901805482908110611e2757611e2761475f565b60009182526020909120015460018a0180546001600160a01b039092169186908110611e5557611e5561475f565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555088600101805480611e9657611e96614c48565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038816825260038b0190526040902080546001600160601b0319169055611eea82866147a2565b945050505b600101611c39565b5081866004016000828254611f0c91906147b5565b9091555050604051611f3190636242a4ef60e11b9061120a908c908c90602001614c5e565b7fdf3dcd7987202f64648f3acdbf12401e3a2bb23e77e19f99826b5475cbb86369888a604051611f62929190614c8c565b60405180910390a15050505050505b50919050565b600054610100900460ff16611f9e5760405162461bcd60e51b81526004016108ab90614cb1565b610a1c81612f2c565b600054610100900460ff16611fce5760405162461bcd60e51b81526004016108ab90614cb1565b6107958282612f5c565b600054610100900460ff16611fff5760405162461bcd60e51b81526004016108ab90614cb1565b6120098888612f8e565b61201284612fe5565b61201f8686858585613015565b5050505050505050565b81518151606091908082016001600160401b0381111561204b5761204b61422d565b604051908082528060200260200182016040528015612074578160200160208202803683370190505b50925060005b828110156120ce578581815181106120945761209461475f565b60200260200101518482815181106120ae576120ae61475f565b6001600160a01b039092166020928302919091019091015260010161207a565b60005b82811015612129578581815181106120eb576120eb61475f565b60200260200101518583815181106121055761210561475f565b6001600160a01b0390921660209283029190910190910152600191820191016120d1565b5050505092915050565b6001600160a01b038116610a1c576000356001600160e01b03191660405163104c66df60e31b81526004016108ab91906147ea565b612172828261313f565b610795573382826040516319b5fdcb60e31b81526004016108ab93929190614d4c565b600081516000036121a857506000919050565b60005b600183510381101561222b57600181015b8351811015612222578381815181106121d7576121d761475f565b60200260200101516001600160a01b03168483815181106121fa576121fa61475f565b60200260200101516001600160a01b03160361221a575060019392505050565b6001016121bc565b506001016121ab565b50600092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561228457602002820191906000526020600020905b815481526020019060010190808311612270575b50505050509050919050565b600081815260018301602052604081205480156123795760006122b46001836147b5565b85549091506000906122c8906001906147b5565b905081811461232d5760008660000182815481106122e8576122e861475f565b906000526020600020015490508087600001848154811061230b5761230b61475f565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061233e5761233e614c48565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061074b565b600091505061074b565b60008160405160240161239691906147ea565b60408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b1790525190915060009081906001600160a01b038616906123df908590614d80565b600060405180830381855afa9150503d806000811461241a576040519150601f19603f3d011682016040523d82523d6000602084013e61241f565b606091505b5091509150816124e157846001600160a01b0316836040516024016124449190614d9c565b60408051601f198184030181529181526020820180516001600160e01b03166325da93a560e11b179052516124799190614d80565b600060405180830381855afa9150503d80600081146124b4576040519150601f19603f3d011682016040523d82523d6000602084013e6124b9565b606091505b509092509050816124e157838560405163069d427960e11b81526004016108ab929190614daf565b808060200190518101906124f59190614dd2565b61070357838560405163069d427960e11b81526004016108ab929190614daf565b6000610748836001600160a01b038416613471565b612533613f0c565b61254c61254584606001516001611360565b84906134c0565b9050612563600454826135c690919063ffffffff16565b600061256e82612de2565b9050600061257c6000613667565b60008181527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff6020908152604090912090870151600182018590556006909101559050825181146125ee576000356001600160e01b03191660405163d4cec26960e01b81526004016108ab91906147ea565b81817fe5af2d3fb7bcab8f865476bc675bf1bbb8b5a749c827ee1cd215dc9c2b8f92d78561261b8961263d565b898960405161262d9493929190614f5d565b60405180910390a3505092915050565b6080810151606082015160a083015151600092919083906001600160401b0381111561266b5761266b61422d565b604051908082528060200260200182016040528015612694578160200160208202803683370190505b5060c086015190915060005b82518110156126f3578660a0015181815181106126bf576126bf61475f565b6020026020010151805190602001208382815181106126e0576126e061475f565b60209081029190910101526001016126a0565b50604080517fde480f0c53a3651c08fbab1dffbc45fe574f31188827fe52cb9035da9fe57e4a8152875160208083019190915280890151828401529790910151606082015283518702938701939093206080840152835186029386019390932060a0830152805185029085012060c082015281518402919093012060e083015250610100902090565b831580159061278a57508382145b6127b5576000356001600160e01b0319166040516306b5667560e21b81526004016108ab91906147ea565b60006128426127c360015490565b612802846000604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b60405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b9050600061289161285260015490565b612802856001604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b90506000846001600160401b038111156128ad576128ad61422d565b6040519080825280602002602001820160405280156128d6578160200160208202803683370190505b5090506000856001600160401b038111156128f3576128f361422d565b60405190808252806020026020018201604052801561291c578160200160208202803683370190505b50905060008060008060003660005b8c811015612ab0578d8d828181106129455761294561475f565b90506060020191508f8f8281811061295f5761295f61475f565b9050602002016020810190612974919061501e565b9250600083600181111561298a5761298a6144cf565b036129f4576129af8b6129a0602085018561503f565b84602001358560400135613703565b94508489886129bd81614c2f565b9950815181106129cf576129cf61475f565b60200260200101906001600160a01b031690816001600160a01b031681525050612a65565b6001836001811115612a0857612a086144cf565b03612a3e57612a1e8a6129a0602085018561503f565b9450848887612a2c81614c2f565b9850815181106129cf576129cf61475f565b6000356001600160e01b031916604051630612418f60e11b81526004016108ab91906147ea565b846001600160a01b0316846001600160a01b031610612aa5576000356001600160e01b031916604051635d3dcd3160e01b81526004016108ab91906147ea565b84935060010161292b565b505050928552508252506020808b015160009081526003825260408082208d51835290925290812090612ae161372b565b90506000612aee85613735565b9050818110612b755780600003612b26576000356001600160e01b031916604051637f11b8a360e11b81526004016108ab91906147ea565b825460ff1916600190811784558301546040517f5c819725ea53655a3b898f3df59b66489761935454e9212ca1e5ebd759953d0b90600090a2612b69838e613740565b50505050505050611568565b600082612b806137ad565b612b8a91906147b5565b612b959060016147a2565b90506000612ba286613735565b9050818110612c215780600003612bda576000356001600160e01b031916604051637f11b8a360e11b81526004016108ab91906147ea565b845460ff1916600317855560018501546040517f55295d4ce992922fa2e5ffbf3a3dcdb367de0a15e125ace083456017fd22060f90600090a2505050505050505050611568565b6000356001600160e01b031916604051634ccfe64360e11b81526004016108ab91906147ea565b8060056000846005811115612c5f57612c5f6144cf565b6005811115612c7057612c706144cf565b8152602081019190915260400160002080546001600160a01b0319166001600160a01b039283161790558116826005811115612cae57612cae6144cf565b6040517f356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d90600090a35050565b6020820151600090808203612d1d5760405163092048d160e11b8152600080356001600160e01b031916600483015260248201524660448201526064016108ab565b600454612d2b9085906135c6565b6000612d3685612de2565b9050612d4182613667565b6000838152600360209081526040808320848452909152908190209087015160018201849055600690910155925084518314612d9e576000356001600160e01b03191660405163d4cec26960e01b81526004016108ab91906147ea565b8083837fd1221ffb98610024a29755d7db3c71692310f43a7cfcce7ee488a8c7e9e0bfa48888604051612dd2929190615062565b60405180910390a4505092915050565b60a0810151608082015160c083015151600092919083906001600160401b03811115612e1057612e1061422d565b604051908082528060200260200182016040528015612e39578160200160208202803683370190505b5060e086015190915060005b8251811015612e98578660c001518181518110612e6457612e6461475f565b602002602001015180519060200120838281518110612e8557612e8561475f565b6020908102919091010152600101612e45565b50604080517f1b59eeec7c321899dc1e7a5b3d876c9a445dffc6d2f96ba842d7489908fdee1281528751602080830191909152808901518284015291880151606080830191909152909701516080880152835181029381019390932060a0870152835183029383019390932060c0860152805182029082012060e08501528151810291012061010083015250610120902090565b600054610100900460ff16612f535760405162461bcd60e51b81526004016108ab90614cb1565b610a1c816137b7565b600054610100900460ff16612f835760405162461bcd60e51b81526004016108ab90614cb1565b61091b600030612c48565b600054610100900460ff16612fb55760405162461bcd60e51b81526004016108ab90614cb1565b60017ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00908155610d0a838361196e565b600054610100900460ff1661300c5760405162461bcd60e51b81526004016108ab90614cb1565b610a1c816114b3565b600054610100900460ff1661303c5760405162461bcd60e51b81526004016108ab90614cb1565b6130476002856117a9565b604080516020808201839052600e60608301526d212924a223a2afa6a0a720a3a2a960911b6080808401919091528284018990528351808403909101815260a0830184528051908201207f599a80fcaa47b95e2323ab4d34d34e0cc9feda4b843edafcc30c7bdf60ea15bf60c08401527fe4d2346818310a10fac5a6d073d3dce255578caf4aa81ddcbcc7c2b98405eef060e08401527f2a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4de61010084015261012080840191909152835180840390910181526101409092019092528051910120600155613134818385610f08565b506107036003611881565b6001600061315a600080516020615149833981519152611337565b8051909150600081900361316f57505061074b565b6000816001600160401b038111156131895761318961422d565b6040519080825280602002602001820160405280156131b2578160200160208202803683370190505b5090506000826001600160401b038111156131cf576131cf61422d565b60405190808252806020026020018201604052801561320257816020015b60608152602001906001900390816131ed5790505b5090506000878760405160200161321a92919061508c565b604051602081830303815290604052905060008160405160240161323e9190614d9c565b60408051601f198184030181529190526020810180516001600160e01b03166325da93a560e11b179052905060005b85811015613427578681815181106132875761328761475f565b60200260200101516001600160a01b0316836040516132a69190614d80565b6000604051808303816000865af19150503d80600081146132e3576040519150601f19603f3d011682016040523d82523d6000602084013e6132e8565b606091505b508683815181106132fb576132fb61475f565b602002602001018684815181106133145761331461475f565b602002602001018290528215151515815250505084818151811061333a5761333a61475f565b602002602001015161341f578681815181106133585761335861475f565b60200260200101516001600160a01b0316826040516133779190614d80565b6000604051808303816000865af19150503d80600081146133b4576040519150601f19603f3d011682016040523d82523d6000602084013e6133b9565b606091505b508683815181106133cc576133cc61475f565b602002602001018684815181106133e5576133e561475f565b602002602001018290528215151515815250505087801561341c57508481815181106134135761341361475f565b60200260200101515b97505b60010161326d565b507fc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b638287868660405161345d94939291906150bd565b60405180910390a150505050505092915050565b60008181526001830160205260408120546134b85750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561074b565b50600061074b565b6134c8613f0c565b8251815260006020808301919091528301516040808301919091528301516001600160a01b0316606080830191909152830151516001600160401b038111156135135761351361422d565b60405190808252806020026020018201604052801561353c578160200160208202803683370190505b5060808083019190915283015160a08083019190915283015160c08083019190915283015160e082015260005b836060015151811015610a2a578281815181106135885761358861475f565b6020026020010151826080015182815181106135a6576135a661475f565b6001600160a01b0390921660209283029190910190910152600101613569565b60008260800151511180156135e457508160a0015151826080015151145b80156135f957508160c0015151826080015151145b801561360e57508160e0015151826080015151145b613639576000356001600160e01b0319166040516306b5667560e21b81526004016108ab91906147ea565b61364381426147a2565b826040015111156107955760405163ad89be9d60e01b815260040160405180910390fd5b600081815260026020526040812054908190036136965750600090815260026020526040902060019081905590565b60008281526003602090815260408083208484529091528120906000825460ff1660048111156136c8576136c86144cf565b036136e65760405163757a436360e01b815260040160405180910390fd5b505050600090815260026020526040902080546001019081905590565b60008060006137148787878761399c565b9150915061372181613a89565b5095945050505050565b60006105c5610816565b600061074b826112b2565b61374981613c3f565b1561079557815460ff1916600217825560008061376583613c59565b9150915083600101547fe134987599ae266ec90edeff1b26125b287dbb57b10822649432d1bb26537fba838360405161379f92919061510a565b60405180910390a250505050565b60006105c56105bb565b600481905560405181907fe5cd1c123a8cf63fa1b7229678db61fe8ae99dbbd27889370b6667c8cae97da190600090a250565b600483015481101561389d578260080160008460040183815481106138115761381161475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff19169055600484018054600786019291908490811061385a5761385a61475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff191681556001818101839055600290910191909155016137ea565b5060005b6005830154811015613954578260080160008460050183815481106138c8576138c861475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff1916905560058401805460078601929190849081106139115761391161475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff191681556001818101839055600290910191909155016138a1565b50815460ff191682556000600183018190556002830181905560038301819055613982906004840190613f5a565b613990600583016000613f5a565b60006006830155919050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156139d35750600090506003613a80565b8460ff16601b141580156139eb57508460ff16601c14155b156139fc5750600090506004613a80565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613a50573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613a7957600060019250925050613a80565b9150600090505b94509492505050565b6000816004811115613a9d57613a9d6144cf565b03613aa55750565b6001816004811115613ab957613ab96144cf565b03613b065760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016108ab565b6002816004811115613b1a57613b1a6144cf565b03613b675760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016108ab565b6003816004811115613b7b57613b7b6144cf565b03613bd35760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016108ab565b6004816004811115613be757613be76144cf565b03610a1c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016108ab565b600081602001516000148061074b57505060200151461490565b606080613c6583613c3f565b613ca357602083015160405163092048d160e11b81526000356001600160e01b031916600482015260248101919091524660448201526064016108ab565b8260800151516001600160401b03811115613cc057613cc061422d565b604051908082528060200260200182016040528015613ce9578160200160208202803683370190505b5091508260800151516001600160401b03811115613d0957613d0961422d565b604051908082528060200260200182016040528015613d3c57816020015b6060815260200190600190039081613d275790505b50905060005b836080015151811015613f06578360e001518181518110613d6557613d6561475f565b60200260200101515a11613d9857613d7c84612de2565b6040516307aec4ab60e21b81526004016108ab91815260200190565b83608001518181518110613dae57613dae61475f565b60200260200101516001600160a01b03168460a001518281518110613dd557613dd561475f565b60200260200101518560e001518381518110613df357613df361475f565b6020026020010151908660c001518481518110613e1257613e1261475f565b6020026020010151604051613e279190614d80565b600060405180830381858888f193505050503d8060008114613e65576040519150601f19603f3d011682016040523d82523d6000602084013e613e6a565b606091505b50848381518110613e7d57613e7d61475f565b60200260200101848481518110613e9657613e9661475f565b6020026020010182905282151515158152505050828181518110613ebc57613ebc61475f565b6020026020010151613efe5780828281518110613edb57613edb61475f565b60200260200101516040516376df417560e11b81526004016108ab92919061512f565b600101613d42565b50915091565b60405180610100016040528060008152602001600081526020016000815260200160006001600160a01b03168152602001606081526020016060815260200160608152602001606081525090565b5080546000825590600052602060002090810190610a1c91905b80821115613f885760008155600101613f74565b5090565b60008083601f840112613f9e57600080fd5b5081356001600160401b03811115613fb557600080fd5b6020830191508360208260051b85010111156116c357600080fd5b60008060008060008060608789031215613fe957600080fd5b86356001600160401b038082111561400057600080fd5b61400c8a838b01613f8c565b9098509650602089013591508082111561402557600080fd5b6140318a838b01613f8c565b9096509450604089013591508082111561404a57600080fd5b5061405789828a01613f8c565b979a9699509497509295939492505050565b6000806020838503121561407c57600080fd5b82356001600160401b0381111561409257600080fd5b61409e85828601613f8c565b90969095509350505050565b60008151808452602080850194506020840160005b838110156140e45781516001600160a01b0316875295820195908201906001016140bf565b509495945050505050565b60208152600061074860208301846140aa565b60006020828403121561411457600080fd5b5035919050565b60008083601f84011261412d57600080fd5b5081356001600160401b0381111561414457600080fd5b6020830191508360206060830285010111156116c357600080fd5b60008060008060006060868803121561417757600080fd5b85356001600160401b038082111561418e57600080fd5b9087019060e0828a0312156141a257600080fd5b909550602087013590808211156141b857600080fd5b6141c489838a01613f8c565b909650945060408801359150808211156141dd57600080fd5b506141ea8882890161411b565b969995985093965092949392505050565b80356001600160a01b0381168114610c7957600080fd5b60006020828403121561422457600080fd5b610748826141fb565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b03811182821017156142655761426561422d565b60405290565b60405161010081016001600160401b03811182821017156142655761426561422d565b604051601f8201601f191681016001600160401b03811182821017156142b6576142b661422d565b604052919050565b60006001600160401b038211156142d7576142d761422d565b5060051b60200190565b600082601f8301126142f257600080fd5b81356020614307614302836142be565b61428e565b8083825260208201915060208460051b87010193508684111561432957600080fd5b602086015b84811015614353578035600681106143465760008081fd5b835291830191830161432e565b509695505050505050565b600082601f83011261436f57600080fd5b8135602061437f614302836142be565b8083825260208201915060208460051b8701019350868411156143a157600080fd5b602086015b84811015614353576143b7816141fb565b83529183019183016143a6565b600080604083850312156143d757600080fd5b82356001600160401b03808211156143ee57600080fd5b6143fa868387016142e1565b9350602085013591508082111561441057600080fd5b5061441d8582860161435e565b9150509250929050565b803560108110610c7957600080fd5b6000806040838503121561444957600080fd5b61445283614427565b9150614460602084016141fb565b90509250929050565b60008060008060006060868803121561448157600080fd5b85356001600160401b038082111561449857600080fd5b90870190610100828a0312156141a257600080fd5b600080604083850312156144c057600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60a08101600587106144f9576144f96144cf565b95815260208101949094526040840192909252606083015260809091015290565b60008151808452602080850194506020840160005b838110156140e45781516001600160601b03168752958201959082019060010161452f565b60608152600061456760608301866140aa565b828103602084015261457981866140aa565b9050828103604084015261458d818561451a565b9695505050505050565b602081526000610748602083018461451a565b6000602082840312156145bc57600080fd5b61074882614427565b600082601f8301126145d657600080fd5b813560206145e6614302836142be565b8083825260208201915060208460051b87010193508684111561460857600080fd5b602086015b848110156143535780356001600160601b038116811461462d5760008081fd5b835291830191830161460d565b6000806000806000806000806000806101408b8d03121561465a57600080fd5b8a35995060208b0135985060408b0135975061467860608c016141fb565b965060808b01356001600160401b038082111561469457600080fd5b6146a08e838f0161435e565b975060a08d01359150808211156146b657600080fd5b6146c28e838f0161435e565b965060c08d01359150808211156146d857600080fd5b6146e48e838f0161435e565b955060e08d01359150808211156146fa57600080fd5b6147068e838f016145c5565b94506101008d013591508082111561471d57600080fd5b6147298e838f016142e1565b93506101208d013591508082111561474057600080fd5b5061474d8d828e0161435e565b9150509295989b9194979a5092959850565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761074b5761074b614775565b8082018082111561074b5761074b614775565b8181038181111561074b5761074b614775565b6000826147e557634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031991909116815260200190565b6020810160108310614813576148136144cf565b91905290565b6001600160e01b03198316815260408101600b831061483a5761483a6144cf565b8260208301529392505050565b6001600160601b03818116838216019080821115610a2a57610a2a614775565b60008151808452602080850194506020840160005b838110156140e457815115158752958201959082019060010161487c565b6060815260006148ad60608301866140aa565b82810360208401526148bf818661451a565b9050828103604084015261458d8185614867565b6080815260006148e66080830187614867565b82810360208401526148f8818761451a565b9050828103604084015261490c81866140aa565b9050828103606084015261492081856140aa565b979650505050505050565b600082601f83011261493c57600080fd5b8135602061494c614302836142be565b8083825260208201915060208460051b87010193508684111561496e57600080fd5b602086015b848110156143535780358352918301918301614973565b6000601f83601f84011261499d57600080fd5b823560206149ad614302836142be565b82815260059290921b850181019181810190878411156149cc57600080fd5b8287015b84811015614a625780356001600160401b03808211156149f05760008081fd5b818a0191508a603f830112614a055760008081fd5b85820135604082821115614a1b57614a1b61422d565b614a2c828b01601f1916890161428e565b92508183528c81838601011115614a435760008081fd5b81818501898501375060009082018701528452509183019183016149d0565b50979650505050505050565b600060e08236031215614a8057600080fd5b614a88614243565b8235815260208301356020820152614aa2604084016141fb565b604082015260608301356001600160401b0380821115614ac157600080fd5b614acd368387016142e1565b60608401526080850135915080821115614ae657600080fd5b614af23683870161492b565b608084015260a0850135915080821115614b0b57600080fd5b614b173683870161498a565b60a084015260c0850135915080821115614b3057600080fd5b50614b3d3682860161492b565b60c08301525092915050565b60006101008236031215614b5c57600080fd5b614b6461426b565b823581526020830135602082015260408301356040820152614b88606084016141fb565b606082015260808301356001600160401b0380821115614ba757600080fd5b614bb33683870161435e565b608084015260a0850135915080821115614bcc57600080fd5b614bd83683870161492b565b60a084015260c0850135915080821115614bf157600080fd5b614bfd3683870161498a565b60c084015260e0850135915080821115614c1657600080fd5b50614c233682860161492b565b60e08301525092915050565b600060018201614c4157614c41614775565b5060010190565b634e487b7160e01b600052603160045260246000fd5b604081526000614c7160408301856140aa565b8281036020840152614c838185614867565b95945050505050565b604081526000614c9f6040830185614867565b8281036020840152614c8381856140aa565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60005b83811015614d17578181015183820152602001614cff565b50506000910152565b60008151808452614d38816020860160208601614cfc565b601f01601f19169290920160200192915050565b6001600160a01b03841681526001600160e01b031983166020820152606060408201819052600090614c8390830184614d20565b60008251614d92818460208701614cfc565b9190910192915050565b6020815260006107486020830184614d20565b6001600160e01b03199290921682526001600160a01b0316602082015260400190565b600060208284031215614de457600080fd5b8151801515811461134457600080fd5b60008151808452602080850194506020840160005b838110156140e457815187529582019590820190600101614e09565b60008282518085526020808601955060208260051b8401016020860160005b84811015614e7257601f19868403018952614e60838351614d20565b98840198925090830190600101614e44565b5090979650505050505050565b60006101008251845260208301516020850152604083015160408501526060830151614eb660608601826001600160a01b03169052565b506080830151816080860152614ece828601826140aa565b91505060a083015184820360a0860152614ee88282614df4565b91505060c083015184820360c0860152614f028282614e25565b91505060e083015184820360e0860152614c838282614df4565b60008151808452602080850194506020840160005b838110156140e457815160068110614f4b57614f4b6144cf565b87529582019590820190600101614f31565b608081526000614f706080830187614e7f565b8560208401528281036040840152845181526020850151602082015260018060a01b036040860151166040820152606085015160e06060830152614fb760e0830182614f1c565b905060808601518282036080840152614fd08282614df4565b91505060a086015182820360a0840152614fea8282614e25565b91505060c086015182820360c08401526150048282614df4565b9350505050614c8360608301846001600160a01b03169052565b60006020828403121561503057600080fd5b81356002811061134457600080fd5b60006020828403121561505157600080fd5b813560ff8116811461134457600080fd5b6040815260006150756040830185614e7f565b905060018060a01b03831660208301529392505050565b6001600160e01b03198316815281516000906150af816004850160208701614cfc565b919091016004019392505050565b6080815260006150d06080830187614d20565b82810360208401526150e281876140aa565b905082810360408401526150f68186614867565b905082810360608401526149208185614e25565b60408152600061511d6040830185614867565b8281036020840152614c838185614e25565b8281526040602082015260006106476040830184614d2056fe5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd976240a26469706673582212200c6f63384302c679c24a323da0191d39419570db3a104ad821b83178df1126da64736f6c63430008170033", + "nonce": "0x15", + "accessList": [] + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x91610b4f041e04847fb9ebc85d851506bb6973a0bd477dfa209dd7e41a49b2a8", + "transactionType": "CREATE", + "contractName": "TransparentUpgradeableProxyV2", + "contractAddress": "0x603075B625cc2cf69FbB3546C6acC2451FE792AF", + "function": null, + "arguments": [ + "0x8A6e09c0E369086B3AC219aB66F990b0A7d3E1Da", + "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "0xf896f0700000000000000000000000000000000000000000000000000000000000000007000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000007e500000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000003a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000002e82d2b56f858f79deef11b160bfc4631873da2b000000000000000000000000bcb61783dd2403fe8cc9b89b27b1a9bb03d040cb000000000000000000000000b266bf53cf7eac4e2065a404598dcb0e15e9462c000000000000000000000000cc5fc5b6c8595f56306da736f6cd02ed9141c84a0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000d24d87ddc1917165435b306aac68d99e0f49a3fa000000000000000000000000b033ba62ec622dc54d0abfe0254e79692147ca26000000000000000000000000087d08e3ba42e64e3948962dd1371f906d1278b900000000000000000000000052ec2e6bbce45afff8955da6410bb13812f4289f00000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e00000000000000000000000061ec0ebf966ae84c414bda715e17cef657e039df" + ], + "transaction": { + "type": "0x02", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x29415c", + "value": "0x0", + "data": "0x608060405260405162000edd38038062000edd83398101604081905262000026916200041a565b8282828281620000398282600062000053565b506200004790508262000085565b5050505050506200054d565b6200005e83620000f7565b6000825111806200006c5750805b1562000080576200007e838362000139565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f620000c760008051602062000e96833981519152546001600160a01b031690565b604080516001600160a01b03928316815291841660208301520160405180910390a1620000f48162000168565b50565b620001028162000206565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606062000161838360405180606001604052806027815260200162000eb6602791396200029d565b9392505050565b6001600160a01b038116620001d35760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b8060008051602062000e968339815191525b80546001600160a01b0319166001600160a01b039290921691909117905550565b6001600160a01b0381163b620002755760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620001ca565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc620001e5565b60606001600160a01b0384163b620003075760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401620001ca565b600080856001600160a01b031685604051620003249190620004fa565b600060405180830381855af49150503d806000811462000361576040519150601f19603f3d011682016040523d82523d6000602084013e62000366565b606091505b5090925090506200037982828662000383565b9695505050505050565b606083156200039457508162000161565b825115620003a55782518084602001fd5b8160405162461bcd60e51b8152600401620001ca919062000518565b80516001600160a01b0381168114620003d957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000411578181015183820152602001620003f7565b50506000910152565b6000806000606084860312156200043057600080fd5b6200043b84620003c1565b92506200044b60208501620003c1565b60408501519092506001600160401b03808211156200046957600080fd5b818601915086601f8301126200047e57600080fd5b815181811115620004935762000493620003de565b604051601f8201601f19908116603f01168101908382118183101715620004be57620004be620003de565b81604052828152896020848701011115620004d857600080fd5b620004eb836020830160208801620003f4565b80955050505050509250925092565b600082516200050e818460208701620003f4565b9190910192915050565b602081526000825180602084015262000539816040850160208701620003f4565b601f01601f19169190910160400192915050565b610939806200055d6000396000f3fe6080604052600436106100595760003560e01c80633659cfe6146100705780634bb5274a146100905780634f1ef286146100a35780635c60da1b146100b65780638f283970146100e7578063f851a4401461010757610068565b366100685761006661011c565b005b61006661011c565b34801561007c57600080fd5b5061006661008b366004610704565b610136565b61006661009e366004610735565b610173565b6100666100b13660046107e6565b6101b8565b3480156100c257600080fd5b506100cb61021f565b6040516001600160a01b03909116815260200160405180910390f35b3480156100f357600080fd5b50610066610102366004610704565b610250565b34801561011357600080fd5b506100cb610270565b610124610291565b61013461012f610326565b610330565b565b61013e61034f565b6001600160a01b0316330361016b5761016881604051806020016040528060008152506000610382565b50565b61016861011c565b61017b61034f565b6001600160a01b0316330361016b576000610194610326565b9050600080835160208501845af43d6000803e8080156101b3573d6000f35b3d6000fd5b6101c061034f565b6001600160a01b03163303610217576102128383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525060019250610382915050565b505050565b61021261011c565b600061022961034f565b6001600160a01b0316330361024557610240610326565b905090565b61024d61011c565b90565b61025861034f565b6001600160a01b0316330361016b57610168816103ad565b600061027a61034f565b6001600160a01b031633036102455761024061034f565b61029961034f565b6001600160a01b031633036101345760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b6000610240610401565b3660008037600080366000845af43d6000803e8080156101b3573d6000f35b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b61038b83610429565b6000825111806103985750805b15610212576103a78383610469565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103d661034f565b604080516001600160a01b03928316815291841660208301520160405180910390a161016881610495565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610373565b6104328161053e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061048e83836040518060600160405280602781526020016108dd602791396105d2565b9392505050565b6001600160a01b0381166104fa5760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b606482015260840161031d565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b6001600160a01b0381163b6105ab5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161031d565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc61051d565b60606001600160a01b0384163b61063a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161031d565b600080856001600160a01b031685604051610655919061088d565b600060405180830381855af49150503d8060008114610690576040519150601f19603f3d011682016040523d82523d6000602084013e610695565b606091505b50915091506106a58282866106af565b9695505050505050565b606083156106be57508161048e565b8251156106ce5782518084602001fd5b8160405162461bcd60e51b815260040161031d91906108a9565b80356001600160a01b03811681146106ff57600080fd5b919050565b60006020828403121561071657600080fd5b61048e826106e8565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561074757600080fd5b813567ffffffffffffffff8082111561075f57600080fd5b818401915084601f83011261077357600080fd5b8135818111156107855761078561071f565b604051601f8201601f19908116603f011681019083821181831017156107ad576107ad61071f565b816040528281528760208487010111156107c657600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000806000604084860312156107fb57600080fd5b610804846106e8565b9250602084013567ffffffffffffffff8082111561082157600080fd5b818601915086601f83011261083557600080fd5b81358181111561084457600080fd5b87602082850101111561085657600080fd5b6020830194508093505050509250925092565b60005b8381101561088457818101518382015260200161086c565b50506000910152565b6000825161089f818460208701610869565b9190910192915050565b60208152600082518060208401526108c8816040850160208701610869565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220c665d628940e317f0b6d03df17271fb51c4d35c9dbf89cce5e4d9768343c58a864736f6c63430008170033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c65640000000000000000000000008a6e09c0e369086b3ac219ab66f990b0a7d3e1da000000000000000000000000968d0cd7343f711216817e617d3f92a23dc91c0700000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000404f896f0700000000000000000000000000000000000000000000000000000000000000007000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000007e500000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000003a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000002e82d2b56f858f79deef11b160bfc4631873da2b000000000000000000000000bcb61783dd2403fe8cc9b89b27b1a9bb03d040cb000000000000000000000000b266bf53cf7eac4e2065a404598dcb0e15e9462c000000000000000000000000cc5fc5b6c8595f56306da736f6cd02ed9141c84a0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000d24d87ddc1917165435b306aac68d99e0f49a3fa000000000000000000000000b033ba62ec622dc54d0abfe0254e79692147ca26000000000000000000000000087d08e3ba42e64e3948962dd1371f906d1278b900000000000000000000000052ec2e6bbce45afff8955da6410bb13812f4289f00000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e00000000000000000000000061ec0ebf966ae84c414bda715e17cef657e039df00000000000000000000000000000000000000000000000000000000", + "nonce": "0x16", + "accessList": [] + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0xbe7f2344e273284469e954c19134ee10471821447455bb6b67b5b3e1a2e3d1f9", + "transactionType": "CALL", + "contractName": "src/extensions/TransparentUpgradeableProxyV2.sol:TransparentUpgradeableProxyV2", + "contractAddress": "0x603075B625cc2cf69FbB3546C6acC2451FE792AF", + "function": "changeAdmin(address)", + "arguments": [ + "0x5396b75c9eb8D1153D2B8a0Bb9a8c4B1541f758d" + ], + "transaction": { + "type": "0x02", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "to": "0x603075b625cc2cf69fbb3546c6acc2451fe792af", + "gas": "0x10f58", + "value": "0x0", + "data": "0x8f2839700000000000000000000000005396b75c9eb8d1153d2b8a0bb9a8c4b1541f758d", + "nonce": "0x17", + "accessList": [] + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x24b2d31919e5b58826110a78c5f4b56390fa6a5f9382abb905f47c03b1311863", + "transactionType": "CREATE", + "contractName": "WethUnwrapper", + "contractAddress": "0xdbf1c9FB0cb61Ae76901e55c5C04e77d2BE131A1", + "function": null, + "arguments": [ + "0x1Aa1BC6BaEFCF09D6Fd0139B828b5E764D050F08" + ], + "transaction": { + "type": "0x02", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0xa55e6", + "value": "0x0", + "data": "0x60a060405234801561001057600080fd5b5060405161059138038061059183398101604081905261002f91610071565b600160009081556001600160a01b0382163b90036100605760405163155634d360e31b815260040160405180910390fd5b6001600160a01b03166080526100a1565b60006020828403121561008357600080fd5b81516001600160a01b038116811461009a57600080fd5b9392505050565b6080516104c26100cf6000396000818160610152818160ea01528181610237015261030a01526104c26000f3fe6080604052600436106100385760003560e01c80633fc8cef31461004f5780635dbd60591461009f578063de0e9a3e146100bf57610047565b36610047576100456100df565b005b6100456100df565b34801561005b57600080fd5b506100837f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b3480156100ab57600080fd5b506100456100ba366004610408565b61012a565b3480156100cb57600080fd5b506100456100da366004610444565b6101a2565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146101285760405163155634d360e31b815260040160405180910390fd5b565b6002600054036101815760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b600260005561018f82610214565b6101998183610372565b50506001600055565b6002600054036101f45760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610178565b600260005561020281610214565b61020c3382610372565b506001600055565b604051336024820152306044820152606481018290526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b17905251610290919061045d565b6000604051808303816000865af19150503d80600081146102cd576040519150601f19603f3d011682016040523d82523d6000602084013e6102d2565b606091505b50509050806102f4576040516302805e0360e11b815260040160405180910390fd5b604051632e1a7d4d60e01b8152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561035657600080fd5b505af115801561036a573d6000803e3d6000fd5b505050505050565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146103bf576040519150601f19603f3d011682016040523d82523d6000602084013e6103c4565b606091505b50509050806104035760405163094b984760e21b81526001600160a01b03841660048201526001600160e01b0319600035166024820152604401610178565b505050565b6000806040838503121561041b57600080fd5b8235915060208301356001600160a01b038116811461043957600080fd5b809150509250929050565b60006020828403121561045657600080fd5b5035919050565b6000825160005b8181101561047e5760208186018101518583015201610464565b50600092019182525091905056fea2646970667358221220aaebf21164f6d2f08d44be8bf09fb75965583264b715eb60df75d1b1d0f7cb9e64736f6c634300081700330000000000000000000000001aa1bc6baefcf09d6fd0139b828b5e764d050f08", + "nonce": "0x18", + "accessList": [] + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x34a4f62a3a088803c6c9a3ad2721668f1ed98a02cea045af25150b1a455ed01c", + "transactionType": "CREATE", + "contractName": "PauseEnforcer", + "contractAddress": "0x23614572006e2D0DB35E54d4082Aec68d9686450", + "function": null, + "arguments": null, + "transaction": { + "type": "0x02", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x206788", + "value": "0x0", + "data": "0x608060405234801561001057600080fd5b5061001961001e565b6100de565b600254610100900460ff161561008a5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60025460ff90811610156100dc576002805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6111c4806100ed6000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c806391d14854116100a2578063caa6fea411610071578063caa6fea414610240578063d4b8399214610254578063d547741f1461026d578063dcf7bb5c14610280578063f82ec70b1461029357600080fd5b806391d148541461020a578063a217fddf1461021d578063b9f3163b14610225578063ca15c8731461022d57600080fd5b80636833f60d116100e95780636833f60d1461019c57806377a24f36146101a45780637a9ad019146101b75780637d4f7fc9146101cc5780639010d07c146101df57600080fd5b806301ffc9a71461011b578063248a9ca3146101435780632f2ff15d1461017457806336568abe14610189575b600080fd5b61012e610129366004610e11565b6102a6565b60405190151581526020015b60405180910390f35b610166610151366004610e3b565b60009081526020819052604090206001015490565b60405190815260200161013a565b610187610182366004610e79565b6102d1565b005b610187610197366004610e79565b6102fb565b61018761037e565b6101876101b2366004610ebf565b6104da565b61016660008051602061116f83398151915281565b6101876101da366004610fab565b610640565b6101f26101ed366004610fc8565b610663565b6040516001600160a01b03909116815260200161013a565b61012e610218366004610e79565b610682565b610166600081565b6101876106ab565b61016661023b366004610e3b565b610821565b60025461012e90600160b01b900460ff1681565b6002546101f2906201000090046001600160a01b031681565b61018761027b366004610e79565b610838565b61018761028e366004610fab565b61085d565b6101876102a1366004610fab565b610871565b60006001600160e01b03198216635a05180f60e01b14806102cb57506102cb82610894565b92915050565b6000828152602081905260409020600101546102ec816108c9565b6102f683836108d6565b505050565b6001600160a01b03811633146103705760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61037a82826108f8565b5050565b60008051602061116f833981519152610396816108c9565b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af11580156103e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040d9190610fea565b1561042b576040516310067f7560e11b815260040160405180910390fd5b60028054600160b01b60ff60b01b19909116179081905560408051638456cb5960e01b81529051620100009092046001600160a01b031691638456cb599160048082019260009290919082900301818387803b15801561048a57600080fd5b505af115801561049e573d6000803e3d6000fd5b50506040513381527fb8fad2fa0ed7a383e747c309ef2c4391d7b65592a48893e57ccc1fab70791456925060200190505b60405180910390a150565b600254610100900460ff16158080156104fa5750600254600160ff909116105b806105145750303b158015610514575060025460ff166001145b6105775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610367565b6002805460ff19166001179055801561059a576002805461ff0019166101001790555b6105a38461091a565b6105ae600084610972565b60005b82518110156105f3576105eb60008051602061116f8339815191528483815181106105de576105de61100c565b60200260200101516108d6565b6001016105b1565b50801561063a576002805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b600061064b816108c9565b61037a60008051602061116f833981519152836108d6565b600082815260016020526040812061067b908361097c565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008051602061116f8339815191526106c3816108c9565b600254600160b01b900460ff166106ed57604051631b2fd53f60e31b815260040160405180910390fd5b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610740573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107649190610fea565b61078157604051631e87b57b60e31b815260040160405180910390fd5b6002805460ff60b01b19169081905560408051631fa5d41d60e11b81529051620100009092046001600160a01b031691633f4ba83a9160048082019260009290919082900301818387803b1580156107d857600080fd5b505af11580156107ec573d6000803e3d6000fd5b50506040513381527ff5cbf596165cc457b2cd92e8d8450827ee314968160a5696402d75766fc52caf925060200190506104cf565b60008181526001602052604081206102cb90610988565b600082815260208190526040902060010154610853816108c9565b6102f683836108f8565b6000610868816108c9565b61037a8261091a565b600061087c816108c9565b61037a60008051602061116f833981519152836108f8565b60006001600160e01b03198216637965db0b60e01b14806102cb57506301ffc9a760e01b6001600160e01b03198316146102cb565b6108d38133610992565b50565b6108e082826109f6565b60008281526001602052604090206102f69082610a7a565b6109028282610a8f565b60008281526001602052604090206102f69082610af4565b6002805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040519081527f7f8cffd58ac96898bdd25ab64868bd933141d15ad1cd4a0df228fd3fcba2a26d906020016104cf565b61037a82826108d6565b600061067b8383610b09565b60006102cb825490565b61099c8282610682565b61037a576109b4816001600160a01b03166014610b33565b6109bf836020610b33565b6040516020016109d0929190611046565b60408051601f198184030181529082905262461bcd60e51b8252610367916004016110bb565b610a008282610682565b61037a576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610a363390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061067b836001600160a01b038416610ccf565b610a998282610682565b1561037a576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061067b836001600160a01b038416610d1e565b6000826000018281548110610b2057610b2061100c565b9060005260206000200154905092915050565b60606000610b42836002611104565b610b4d90600261111b565b67ffffffffffffffff811115610b6557610b65610ea9565b6040519080825280601f01601f191660200182016040528015610b8f576020820181803683370190505b509050600360fc1b81600081518110610baa57610baa61100c565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610bd957610bd961100c565b60200101906001600160f81b031916908160001a9053506000610bfd846002611104565b610c0890600161111b565b90505b6001811115610c80576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610c3c57610c3c61100c565b1a60f81b828281518110610c5257610c5261100c565b60200101906001600160f81b031916908160001a90535060049490941c93610c798161112e565b9050610c0b565b50831561067b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610367565b6000818152600183016020526040812054610d16575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556102cb565b5060006102cb565b60008181526001830160205260408120548015610e07576000610d42600183611145565b8554909150600090610d5690600190611145565b9050818114610dbb576000866000018281548110610d7657610d7661100c565b9060005260206000200154905080876000018481548110610d9957610d9961100c565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610dcc57610dcc611158565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506102cb565b60009150506102cb565b600060208284031215610e2357600080fd5b81356001600160e01b03198116811461067b57600080fd5b600060208284031215610e4d57600080fd5b5035919050565b6001600160a01b03811681146108d357600080fd5b8035610e7481610e54565b919050565b60008060408385031215610e8c57600080fd5b823591506020830135610e9e81610e54565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600060608486031215610ed457600080fd5b8335610edf81610e54565b9250602084810135610ef081610e54565b9250604085013567ffffffffffffffff80821115610f0d57600080fd5b818701915087601f830112610f2157600080fd5b813581811115610f3357610f33610ea9565b8060051b604051601f19603f83011681018181108582111715610f5857610f58610ea9565b60405291825284820192508381018501918a831115610f7657600080fd5b938501935b82851015610f9b57610f8c85610e69565b84529385019392850192610f7b565b8096505050505050509250925092565b600060208284031215610fbd57600080fd5b813561067b81610e54565b60008060408385031215610fdb57600080fd5b50508035926020909101359150565b600060208284031215610ffc57600080fd5b8151801515811461067b57600080fd5b634e487b7160e01b600052603260045260246000fd5b60005b8381101561103d578181015183820152602001611025565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161107e816017850160208801611022565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516110af816028840160208801611022565b01602801949350505050565b60208152600082518060208401526110da816040850160208701611022565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176102cb576102cb6110ee565b808201808211156102cb576102cb6110ee565b60008161113d5761113d6110ee565b506000190190565b818103818111156102cb576102cb6110ee565b634e487b7160e01b600052603160045260246000fdfe5bea60102f2a7acc9e82b1af0e3bd4069661102bb5dd143a6051cd1980dded1ca26469706673582212205cd579cff7903082498e437ed3eb21f8623bfa7f518ca2799b5e3497b22a08a864736f6c63430008170033", + "nonce": "0x19", + "accessList": [] + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CREATE", + "contractName": "MainchainGatewayV3", + "contractAddress": "0x1050f2E63177b5eD18f3E88D000DB3a600d664e3", + "function": null, + "arguments": null, + "transaction": { + "type": "0x02", + "from": "0x968d0cd7343f711216817e617d3f92a23dc91c07", + "gas": "0x928914", + "value": "0x0", + "data": "0x60806040523480156200001157600080fd5b506000805460ff19169055620000266200002c565b620000ee565b607154610100900460ff1615620000995760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60715460ff9081161015620000ec576071805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61556180620000fe6000396000f3fe60806040526004361061039b5760003560e01c80638f34e347116101dc578063b9c3620911610102578063d55ed103116100a0578063dff525e11161006f578063dff525e114610b04578063e400327c14610b24578063e75235b814610b44578063f23a6e6114610b5c576103aa565b8063d55ed10314610a77578063d64af2a614610aa4578063dafae40814610ac4578063de981f1b14610ae4576103aa565b8063ca15c873116100dc578063ca15c873146109f2578063cdb6744414610a12578063d19773d214610a2a578063d547741f14610a57576103aa565b8063b9c3620914610986578063bc197c81146109a6578063c48549de146109d2576103aa565b8063a217fddf1161017a578063affed0e011610149578063affed0e0146108f6578063b1a2567e1461090c578063b1d08a031461092c578063b297579414610959576103aa565b8063a217fddf14610894578063a3912ec8146103a8578063ab796566146108a9578063ac78dfe8146108d6576103aa565b80639157921c116101b65780639157921c146107ff57806391d148541461081f57806393c5678f1461083f5780639dcc4da31461085f576103aa565b80638f34e3471461077e5780638f851d8a146107b25780639010d07c146107df576103aa565b806338e454b1116102c1578063504af48c1161025f5780636c1ce6701161022e5780636c1ce670146107145780637de5dedd146107345780638456cb5914610749578063865e6fd31461075e576103aa565b8063504af48c1461068f57806359122f6b146106a25780635c975abb146106cf5780636932be98146106e7576103aa565b80634b14557e1161029b5780634b14557e1461060c5780634d0d66731461061f5780634d493f4e1461063f5780634f4247a11461066f576103aa565b806338e454b1146105c25780633e70838b146105d75780633f4ba83a146105f7576103aa565b80631d4a7210116103395780632f2ff15d116103085780632f2ff15d14610556578063302d12db146105765780633644e5151461058d57806336568abe146105a2576103aa565b80631d4a7210146104c3578063248a9ca3146104f057806329b6eca9146105205780632dfdf0b514610540576103aa565b806317ce2dd41161037557806317ce2dd41461043f57806317fcb39b146104635780631a8e55b0146104835780631b6e7594146104a3576103aa565b806301ffc9a7146103b2578063065b3adf146103e7578063110a83081461041f576103aa565b366103aa576103a8610b88565b005b6103a8610b88565b3480156103be57600080fd5b506103d26103cd36600461416e565b610bbc565b60405190151581526020015b60405180910390f35b3480156103f357600080fd5b50600554610407906001600160a01b031681565b6040516001600160a01b0390911681526020016103de565b34801561042b57600080fd5b506103a861043a3660046141ad565b610c01565b34801561044b57600080fd5b5061045560755481565b6040519081526020016103de565b34801561046f57600080fd5b50607454610407906001600160a01b031681565b34801561048f57600080fd5b506103a861049e36600461420e565b610ca6565b3480156104af57600080fd5b506103a86104be366004614279565b610ce2565b3480156104cf57600080fd5b506104556104de3660046141ad565b603e6020526000908152604090205481565b3480156104fc57600080fd5b5061045561050b36600461431d565b60009081526072602052604090206001015490565b34801561052c57600080fd5b506103a861053b3660046141ad565b610d22565b34801561054c57600080fd5b5061045560765481565b34801561056257600080fd5b506103a8610571366004614336565b610dab565b34801561058257600080fd5b50610455620f424081565b34801561059957600080fd5b50607754610455565b3480156105ae57600080fd5b506103a86105bd366004614336565b610dd5565b3480156105ce57600080fd5b506103a8610e53565b3480156105e357600080fd5b506103a86105f23660046141ad565b611030565b34801561060357600080fd5b506103a861105a565b6103a861061a366004614366565b61106a565b34801561062b57600080fd5b506103d261063a366004614391565b61108d565b34801561064b57600080fd5b506103d261065a36600461431d565b607a6020526000908152604090205460ff1681565b34801561067b57600080fd5b50607f54610407906001600160a01b031681565b6103a861069d36600461443b565b6110fd565b3480156106ae57600080fd5b506104556106bd3660046141ad565b603a6020526000908152604090205481565b3480156106db57600080fd5b5060005460ff166103d2565b3480156106f357600080fd5b5061045561070236600461431d565b60796020526000908152604090205481565b34801561072057600080fd5b506103d261072f366004614515565b6113c3565b34801561074057600080fd5b506104556113cf565b34801561075557600080fd5b506103a86113f0565b34801561076a57600080fd5b506103a8610779366004614550565b611400565b34801561078a57600080fd5b506104557f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e481565b3480156107be57600080fd5b506107d26107cd36600461461b565b61141b565b6040516103de9190614712565b3480156107eb57600080fd5b506104076107fa366004614727565b61159d565b34801561080b57600080fd5b506103a861081a366004614749565b6115b5565b34801561082b57600080fd5b506103d261083a366004614336565b611839565b34801561084b57600080fd5b506103a861085a36600461420e565b611864565b34801561086b57600080fd5b5061087f61087a366004614727565b61189a565b604080519283526020830191909152016103de565b3480156108a057600080fd5b50610455600081565b3480156108b557600080fd5b506104556108c43660046141ad565b603c6020526000908152604090205481565b3480156108e257600080fd5b506103d26108f136600461431d565b6118c3565b34801561090257600080fd5b5061045560045481565b34801561091857600080fd5b506103a861092736600461420e565b6118f9565b34801561093857600080fd5b506104556109473660046141ad565b60396020526000908152604090205481565b34801561096557600080fd5b506109796109743660046141ad565b61192f565b6040516103de9190614790565b34801561099257600080fd5b506103a86109a1366004614727565b6119d2565b3480156109b257600080fd5b506107d26109c1366004614893565b63bc197c8160e01b95945050505050565b3480156109de57600080fd5b506107d26109ed36600461420e565b6119ec565b3480156109fe57600080fd5b50610455610a0d36600461431d565b611b80565b348015610a1e57600080fd5b5060375460385461087f565b348015610a3657600080fd5b50610455610a453660046141ad565b603b6020526000908152604090205481565b348015610a6357600080fd5b506103a8610a72366004614336565b611b97565b348015610a8357600080fd5b50610455610a923660046141ad565b603d6020526000908152604090205481565b348015610ab057600080fd5b506103a8610abf3660046141ad565b611bbc565b348015610ad057600080fd5b506103d2610adf36600461431d565b611bcd565b348015610af057600080fd5b50610407610aff366004614940565b611bfb565b348015610b1057600080fd5b506103a8610b1f36600461495b565b611c71565b348015610b3057600080fd5b506103a8610b3f36600461420e565b611ce6565b348015610b5057600080fd5b5060015460025461087f565b348015610b6857600080fd5b506107d2610b77366004614a18565b63f23a6e6160e01b95945050505050565b6074546001600160a01b0316331480610bab5750607f546001600160a01b031633145b15610bb257565b610bba611d1c565b565b60006001600160e01b031982166246560160e51b1480610bec57506001600160e01b031982166312c0151560e21b145b80610bfb5750610bfb82611d46565b92915050565b607154600490610100900460ff16158015610c23575060715460ff8083169116105b610c485760405162461bcd60e51b8152600401610c3f90614a80565b60405180910390fd5b60718054607f80546001600160a01b0319166001600160a01b03861617905561ff001961010060ff851661ffff199093168317171690915560405190815260008051602061550c833981519152906020015b60405180910390a15050565b610cae611d6b565b6000839003610cd0576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484611dc5565b50505050565b610cea611d6b565b6000859003610d0c576040516316ee9d3b60e11b815260040160405180910390fd5b610d1a868686868686611e9a565b505050505050565b607154600290610100900460ff16158015610d44575060715460ff8083169116105b610d605760405162461bcd60e51b8152600401610c3f90614a80565b6071805461ffff191660ff831617610100179055610d7f600b83612042565b6071805461ff001916905560405160ff8216815260008051602061550c83398151915290602001610c9a565b600082815260726020526040902060010154610dc6816120e6565b610dd083836120f0565b505050565b6001600160a01b0381163314610e455760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610c3f565b610e4f8282612112565b5050565b607154600390610100900460ff16158015610e75575060715460ff8083169116105b610e915760405162461bcd60e51b8152600401610c3f90614a80565b6071805461ffff191660ff8316176101001790556000610eb1600b611bfb565b9050600080826001600160a01b031663c441c4a86040518163ffffffff1660e01b8152600401600060405180830381865afa158015610ef4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f1c9190810190614b4b565b92509250506000805b8351811015610fd957828181518110610f4057610f40614c31565b6020026020010151607e6000868481518110610f5e57610f5e614c31565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154816001600160601b0302191690836001600160601b03160217905550828181518110610fbc57610fbc614c31565b602002602001015182610fcf9190614c5d565b9150600101610f25565b50607d80546001600160601b0319166001600160601b039290921691909117905550506071805461ff00191690555060405160ff8216815260008051602061550c833981519152906020015b60405180910390a150565b611038611d6b565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b611062612134565b610bba6121a3565b6110726121f5565b61108a61108436839003830183614ccd565b3361223b565b50565b60006110976121f5565b6110f3848484808060200260200160405190810160405280939291908181526020016000905b828210156110e9576110da60608302860136819003810190614d20565b815260200190600101906110bd565b5050505050612516565b90505b9392505050565b607154610100900460ff161580801561111d5750607154600160ff909116105b806111375750303b158015611137575060715460ff166001145b6111535760405162461bcd60e51b8152600401610c3f90614a80565b6071805460ff191660011790558015611176576071805461ff0019166101001790555b61118160008c6129aa565b607589905561118f8a6129b4565b61121a6040517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81527f159f52c1e3a2b6a6aad3950adf713516211484e0516dad685ea662a094b7c43b60208201527fad7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5604082015246606082015230608082015260a0812060775550565b6112248887612a02565b61122e8787612a92565b5050611238612b29565b60006112448680614d6a565b905011156113055761126d6112598680614d6a565b6112666020890189614d6a565b8787611e9a565b61129361127a8680614d6a565b8660005b60200281019061128e9190614d6a565b612b76565b6112b96112a08680614d6a565b8660015b6020028101906112b49190614d6a565b611dc5565b6112df6112c68680614d6a565b8660025b6020028101906112da9190614d6a565b612c4b565b6113056112ec8680614d6a565b8660035b6020028101906113009190614d6a565b612d5c565b60005b6113156040870187614d6a565b9050811015611381576113797f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e461134f6040890189614d6a565b8481811061135f5761135f614c31565b905060200201602081019061137491906141ad565b6120f0565b600101611308565b5080156113b6576071805461ff00191690556040516001815260008051602061550c8339815191529060200160405180910390a15b5050505050505050505050565b60006110f68383612e31565b60006113eb6113e6607d546001600160601b031690565b612efc565b905090565b6113f8612134565b610bba612f32565b611408611d6b565b61141181612f6f565b610e4f8282612042565b6000600b61142881612fa5565b825186908114158061143a5750808514155b15611466576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b8060000361147e57506347c28ec560e11b9150611593565b60005b818110156115865784818151811061149b5761149b614c31565b60200260200101511561157e578686828181106114ba576114ba614c31565b90506020020160208101906114cf9190614db3565b607d80546001600160601b031981166001600160601b03918216939093011691909117905586868281811061150657611506614c31565b905060200201602081019061151b9190614db3565b607e60008b8b8581811061153157611531614c31565b905060200201602081019061154691906141ad565b6001600160a01b03168152602081019190915260400160002080546001600160601b0319166001600160601b03929092169190911790555b600101611481565b506347c28ec560e11b9250505b5095945050505050565b60008281526073602052604081206110f69083612ff1565b7f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e46115df816120e6565b60006115f86115f336859003850185614e2d565b612ffd565b905061160c6115f336859003850185614e2d565b83356000908152607960205260409020541461163b5760405163f4b8742f60e01b815260040160405180910390fd5b82356000908152607a602052604090205460ff1661166c5760405163147bfe0760e01b815260040160405180910390fd5b82356000908152607a602052604090819020805460ff19169055517fd639511b37b3b002cca6cfe6bca0d833945a5af5a045578a0627fc43b79b2630906116b69083908690614f00565b60405180910390a160006116d060808501606086016141ad565b905060006116e661012086016101008701614f86565b60028111156116f7576116f7614766565b036117be5760006117113686900386016101008701614fa1565b6001600160a01b0383166000908152603b602052604090205490915061173d90610140870135906130c7565b604082015260006117573687900387016101008801614fa1565b604083015190915061176e90610140880135614fbd565b604082015260745461178e908390339086906001600160a01b03166130e1565b6117b76117a160608801604089016141ad565b60745483919086906001600160a01b03166130e1565b50506117fa565b6117fa6117d160608601604087016141ad565b60745483906001600160a01b03166117f23689900389016101008a01614fa1565b9291906130e1565b7f21e88e956aa3e086f6388e899965cef814688f99ad8bb29b08d396571016372d828560405161182b929190614f00565b60405180910390a150505050565b60009182526072602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61186c611d6b565b600083900361188e576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484612b76565b6000806118a5611d6b565b6118af8484612a92565b90925090506118bc612b29565b9250929050565b60006118d7607d546001600160601b031690565b6037546118e49190614fd0565b6038546118f19084614fd0565b101592915050565b611901611d6b565b6000839003611923576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484612c4b565b60408051808201909152600080825260208201526001600160a01b0382166000908152607860205260409081902081518083019092528054829060ff16600281111561197d5761197d614766565b600281111561198e5761198e614766565b815290546001600160a01b03610100909104811660209283015290820151919250166119cd57604051631b79f53b60e21b815260040160405180910390fd5b919050565b6119da611d6b565b6119e48282612a02565b610e4f612b29565b6000600b6119f981612fa5565b84838114611a28576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b80600003611a405750636242a4ef60e11b9150611b77565b6000805b82811015611b2757868682818110611a5e57611a5e614c31565b9050602002016020810190611a739190614fe7565b15611b1f57607e60008a8a84818110611a8e57611a8e614c31565b9050602002016020810190611aa391906141ad565b6001600160a01b0316815260208101919091526040016000908120546001600160601b03169290920191607e908a8a84818110611ae257611ae2614c31565b9050602002016020810190611af791906141ad565b6001600160a01b03168152602081019190915260400160002080546001600160601b03191690555b600101611a44565b50607d8054829190600090611b469084906001600160601b0316615004565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555063c48549de60e01b935050505b50949350505050565b6000818152607360205260408120610bfb90613313565b600082815260726020526040902060010154611bb2816120e6565b610dd08383612112565b611bc4611d6b565b61108a816129b4565b6000611be1607d546001600160601b031690565b600154611bee9190614fd0565b6002546118f19084614fd0565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115611c3257611c32614766565b60ff1681526020810191909152604001600020546001600160a01b03169050806119cd578160405163409140df60e11b8152600401610c3f9190615034565b611c79611d6b565b6000869003611c9b576040516316ee9d3b60e11b815260040160405180910390fd5b611ca9878787878787611e9a565b611cb6878783600061127e565b611cc387878360016112a4565b611cd087878360026112ca565b611cdd87878360036112f0565b50505050505050565b611cee611d6b565b6000839003611d10576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484612d5c565b611d246121f5565b611d2c61412d565b33815260408082015134910152805161108a90829061223b565b60006001600160e01b03198216630271189760e51b1480610bfb5750610bfb8261331d565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610bba576000356001600160e01b0319166001604051620f948f60ea1b8152600401610c3f929190615042565b828114611df3576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015611e6457828282818110611e1057611e10614c31565b90506020020135603a6000878785818110611e2d57611e2d614c31565b9050602002016020810190611e4291906141ad565b6001600160a01b03168152602081019190915260400160002055600101611df6565b507f64557254143204d91ba2d95acb9fda1e5fea55f77efd028685765bc1e94dd4b58484848460405161182b94939291906150b9565b8483148015611ea857508481145b611ed3576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b85811015611ff857848482818110611ef057611ef0614c31565b9050602002016020810190611f0591906141ad565b60786000898985818110611f1b57611f1b614c31565b9050602002016020810190611f3091906141ad565b6001600160a01b03908116825260208201929092526040016000208054610100600160a81b0319166101009390921692909202179055828282818110611f7857611f78614c31565b9050602002016020810190611f8d9190614f86565b60786000898985818110611fa357611fa3614c31565b9050602002016020810190611fb891906141ad565b6001600160a01b031681526020810191909152604001600020805460ff19166001836002811115611feb57611feb614766565b0217905550600101611ed6565b507fa4f03cc9c0e0aeb5b71b4ec800702753f65748c2cf3064695ba8e8b46be7044486868686868660405161203296959493929190615105565b60405180910390a1505050505050565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f81111561207857612078614766565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f8111156120b9576120b9614766565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b61108a8133613342565b6120fa82826133a6565b6000828152607360205260409020610dd0908261342c565b61211c8282613441565b6000828152607360205260409020610dd090826134a8565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031633148061217657506005546001600160a01b031633145b610bba576000356001600160e01b0319166001604051620f948f60ea1b8152600401610c3f929190615042565b6121ab6134bd565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60005460ff1615610bba5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610c3f565b604080518082018252600080825260208201526074549184015190916001600160a01b03169061226a90613506565b60208401516001600160a01b031661230b5734846040015160400151146122a45760405163129c2ce160e31b815260040160405180910390fd5b6122ad8161192f565b60408501515190925060028111156122c7576122c7614766565b825160028111156122da576122da614766565b146122f75760405162035e2b60ea1b815260040160405180910390fd5b6001600160a01b03811660208501526124a3565b341561232a5760405163129c2ce160e31b815260040160405180910390fd5b612337846020015161192f565b604085015151909250600281111561235157612351614766565b8251600281111561236457612364614766565b146123815760405162035e2b60ea1b815260040160405180910390fd5b6020840151604085015161239691859061354a565b83602001516001600160a01b0316816001600160a01b0316036124a357607454607f54604086810151810151905163095ea7b360e01b81526001600160a01b039283166004820152602481019190915291169063095ea7b3906044016020604051808303816000875af1158015612411573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124359190615176565b50607f546040808601518101519051636f074d1f60e11b81526001600160a01b039092169163de0e9a3e916124709160040190815260200190565b600060405180830381600087803b15801561248a57600080fd5b505af115801561249e573d6000803e3d6000fd5b505050505b60768054600091826124b483615193565b91905055905060006124db858386602001516075548a6136c390949392919063ffffffff16565b90507fd7b25068d9dc8d00765254cfb7f5070f98d263c8d68931d937c7362fa738048b61250782612ffd565b826040516120329291906151cc565b600082356101408401358261253160808701606088016141ad565b905061254e6125493688900388016101008901614fa1565b613506565b60016125606040880160208901615268565b600181111561257157612571614766565b1461258f5760405163182f3d8760e11b815260040160405180910390fd5b608086013546146125d15760405163092048d160e11b81526000356001600160e01b031916600482015260808701356024820152466044820152606401610c3f565b60006125e66109746080890160608a016141ad565b90506125fa61012088016101008901614f86565b600281111561260b5761260b614766565b8151600281111561261e5761261e614766565b14801561264f575061263660e0880160c089016141ad565b6001600160a01b031681602001516001600160a01b0316145b8015612660575060755460e0880135145b61267d5760405163f4b8742f60e01b815260040160405180910390fd5b600084815260796020526040902054156126aa57604051634f13df6160e01b815260040160405180910390fd5b60016126be61012089016101008a01614f86565b60028111156126cf576126cf614766565b14806126e257506126e08284612e31565b155b6126ff5760405163c51297b760e01b815260040160405180910390fd5b60006127136115f3368a90038a018a614e2d565b9050600061272360775483613798565b9050600061274361273c6101208c016101008d01614f86565b86886137d9565b60408051606081018252600080825260208201819052918101829052919a50919250819081906000805b8e51811015612881578e818151811061278857612788614c31565b6020908102919091018101518051818301516040808401518151600081529586018083528e905260ff9093169085015260608401526080830152935060019060a0016020604051602081039080840390855afa1580156127ec573d6000803e3d6000fd5b505050602060405103519450846001600160a01b0316846001600160a01b031610612838576000356001600160e01b031916604051635d3dcd3160e01b8152600401610c3f9190614712565b6001600160a01b0385166000908152607e60205260409020548594506001600160601b03166128679083615283565b91508682106128795760019550612881565b60010161276d565b50846128a057604051639e8f5f6360e01b815260040160405180910390fd5b50505060008981526079602052604090208590555050871561291b576000878152607a602052604090819020805460ff19166001179055517f89e52969465b1f1866fc5d46fd62de953962e9cb33552443cd999eba05bd20dc906129079085908d90614f00565b60405180910390a150505050505050610bfb565b6129258587613869565b61296461293860608c0160408d016141ad565b86607460009054906101000a90046001600160a01b03168d610100018036038101906117f29190614fa1565b7f21e88e956aa3e086f6388e899965cef814688f99ad8bb29b08d396571016372d838b604051612995929190614f00565b60405180910390a15050505050505092915050565b610e4f82826120f0565b607480546001600160a01b0319166001600160a01b0383169081179091556040519081527f9d2334c23be647e994f27a72c5eee42a43d5bdcfe15bb88e939103c2b114cbaf90602001611025565b80821115612a31576000356001600160e01b0319166040516387f6f09560e01b8152600401610c3f9190614712565b6001805460028054858455908490556004805493840190556040805183815260208101839052929391928592879290917f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a450505050565b60008082841115612ac4576000356001600160e01b0319166040516387f6f09560e01b8152600401610c3f9190614712565b5050603780546038805492859055839055600480546001810190915560408051838152602081018590529293928592879290917f31312c97b89cc751b832d98fd459b967a2c3eef3b49757d1cf5ebaa12bb6eee1910160405180910390a49250929050565b600254603754612b399190614fd0565b603854600154612b499190614fd0565b1115610bba576000356001600160e01b0319166040516387f6f09560e01b8152600401610c3f9190614712565b828114612ba4576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015612c1557828282818110612bc157612bc1614c31565b9050602002013560396000878785818110612bde57612bde614c31565b9050602002016020810190612bf391906141ad565b6001600160a01b03168152602081019190915260400160002055600101612ba7565b507f80bc635c452ae67f12f9b6f12ad4daa6dbbc04eeb9ebb87d354ce10c0e210dc08484848460405161182b94939291906150b9565b828114612c79576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015612d2657620f4240838383818110612c9a57612c9a614c31565b905060200201351115612cc05760405163572d3bd360e11b815260040160405180910390fd5b828282818110612cd257612cd2614c31565b90506020020135603b6000878785818110612cef57612cef614c31565b9050602002016020810190612d0491906141ad565b6001600160a01b03168152602081019190915260400160002055600101612c7c565b507fb05f5de88ae0294ebb6f67c5af2fcbbd593cc6bdfe543e2869794a4c8ce3ea508484848460405161182b94939291906150b9565b828114612d8a576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015612dfb57828282818110612da757612da7614c31565b90506020020135603c6000878785818110612dc457612dc4614c31565b9050602002016020810190612dd991906141ad565b6001600160a01b03168152602081019190915260400160002055600101612d8d565b507fb5d2963614d72181b4df1f993d45b83edf42fa19710f0204217ba1b3e183bb738484848460405161182b94939291906150b9565b6001600160a01b0382166000908152603a60205260408120548210612e5857506000610bfb565b6000612e676201518042615296565b6001600160a01b0385166000908152603e6020526040902054909150811115612ead5750506001600160a01b0382166000908152603c6020526040902054811015610bfb565b6001600160a01b0384166000908152603d6020526040902054612ed1908490615283565b6001600160a01b0385166000908152603c602052604090205411159150610bfb9050565b5092915050565b6000600254600160025484600154612f149190614fd0565b612f1e9190615283565b612f289190614fbd565b610bfb9190615296565b612f3a6121f5565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586121d83390565b806001600160a01b03163b60000361108a57604051630bfc64a360e21b81526001600160a01b0382166004820152602401610c3f565b612fae81611bfb565b6001600160a01b0316336001600160a01b03161461108a576000356001600160e01b03191681336040516320e0f98d60e21b8152600401610c3f939291906152b8565b60006110f683836138f9565b60008061300d8360400151613923565b9050600061301e8460600151613923565b905060006130728560800151604080517f1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d815282516020808301919091528301518183015291015160608201526080902090565b604080517fb9d1fe7c9deeec5dc90a2f47ff1684239519f2545b2228d3d91fb27df3189eea815287516020808301919091529097015190870152606086019390935250608084015260a08301525060c0902090565b6000620f42406130d78385614fd0565b6110f69190615296565b806001600160a01b0316826001600160a01b03160361318e5760408085015190516001600160a01b0385169180156108fc02916000818181858888f1935050505061318957806001600160a01b031663d0e30db085604001516040518263ffffffff1660e01b81526004016000604051808303818588803b15801561316557600080fd5b505af1158015613179573d6000803e3d6000fd5b505050505061318984848461396b565b610cdc565b6000845160028111156131a3576131a3614766565b03613269576040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156131ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061321391906152ef565b905084604001518110156132585761323b83308388604001516132369190614fbd565b6139ea565b61325857604051632f739fff60e11b815260040160405180910390fd5b61326385858561396b565b50610cdc565b60018451600281111561327e5761327e614766565b036132af5761329282848660200151613a8f565b6131895760405163c8e3a09f60e01b815260040160405180910390fd5b6002845160028111156132c4576132c4614766565b036132fa576132dd828486602001518760400151613ab6565b613189576040516334b471a760e21b815260040160405180910390fd5b6040516361e411a760e11b815260040160405180910390fd5b6000610bfb825490565b60006001600160e01b03198216635a05180f60e01b1480610bfb5750610bfb82613ae3565b61334c8282611839565b610e4f57613364816001600160a01b03166014613b18565b61336f836020613b18565b60405160200161338092919061532c565b60408051601f198184030181529082905262461bcd60e51b8252610c3f916004016153cd565b6133b08282611839565b610e4f5760008281526072602090815260408083206001600160a01b03851684529091529020805460ff191660011790556133e83390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006110f6836001600160a01b038416613cb3565b61344b8282611839565b15610e4f5760008281526072602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006110f6836001600160a01b038416613d02565b60005460ff16610bba5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610c3f565b61350f81613df5565b8061351e575061351e81613e2c565b8061352d575061352d81613e54565b61108a5760405163034992a760e51b815260040160405180910390fd5b60006060818551600281111561356257613562614766565b0361363d5760408581015181516001600160a01b03878116602483015230604483015260648083019390935283518083039093018352608490910183526020820180516001600160e01b03166323b872dd60e01b1790529151918516916135c991906153e0565b6000604051808303816000865af19150503d8060008114613606576040519150601f19603f3d011682016040523d82523d6000602084013e61360b565b606091505b5090925090508180156136365750805115806136365750808060200190518101906136369190615176565b9150613696565b60018551600281111561365257613652614766565b03613667576136368385308860200151613e7d565b60028551600281111561367c5761367c614766565b036132fa5761363683853088602001518960400151613f2b565b816136bc5784843085604051639d2e4c6760e01b8152600401610c3f94939291906153fc565b5050505050565b6137336040805160a08101825260008082526020808301829052835160608082018652838252818301849052818601849052848601919091528451808201865283815280830184905280860184905281850152845190810185528281529081018290529283015290608082015290565b83815260006020820181905250604080820180516001600160a01b039788169052602080890151825190891690820152905146908301528751606084018051918916909152805195909716940193909352935182015292909201516080820152919050565b6040805161190160f01b60208083019190915260228201859052604280830185905283518084039091018152606290920190925280519101206000906110f6565b60008060006137f0607d546001600160601b031690565b90506137fb81612efc565b9250600086600281111561381157613811614766565b03613860576001600160a01b03851660009081526039602052604090205484106138415761383e81613fdf565b92505b6001600160a01b0385166000908152603a602052604090205484101591505b50935093915050565b60006138786201518042615296565b6001600160a01b0384166000908152603e60205260409020549091508111156138c7576001600160a01b03929092166000908152603e6020908152604080832094909455603d90529190912055565b6001600160a01b0383166000908152603d6020526040812080548492906138ef908490615283565b9091555050505050565b600082600001828154811061391057613910614c31565b9060005260206000200154905092915050565b604080517f353bdd8d69b9e3185b3972e08b03845c0c14a21a390215302776a7a34b0e8764815282516020808301919091528301518183015291015160608201526080902090565b6000808451600281111561398157613981614766565b0361399c5761399582848660400151613ff7565b90506139c6565b6001845160028111156139b1576139b1614766565b036132fa576139958230858760200151613e7d565b80610cdc578383836040516341bd7d9160e11b8152600401610c3f93929190615432565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b03166340c10f1960e01b1790529151600092861691613a42916153e0565b6000604051808303816000865af19150503d8060008114613a7f576040519150601f19603f3d011682016040523d82523d6000602084013e613a84565b606091505b509095945050505050565b6000613a9d84308585613e7d565b9050806110f657613aaf8484846139ea565b90506110f6565b6000613ac58530868686613f2b565b905080613adb57613ad8858585856140ca565b90505b949350505050565b60006001600160e01b03198216637965db0b60e01b1480610bfb57506301ffc9a760e01b6001600160e01b0319831614610bfb565b60606000613b27836002614fd0565b613b32906002615283565b6001600160401b03811115613b4957613b4961457c565b6040519080825280601f01601f191660200182016040528015613b73576020820181803683370190505b509050600360fc1b81600081518110613b8e57613b8e614c31565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613bbd57613bbd614c31565b60200101906001600160f81b031916908160001a9053506000613be1846002614fd0565b613bec906001615283565b90505b6001811115613c64576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613c2057613c20614c31565b1a60f81b828281518110613c3657613c36614c31565b60200101906001600160f81b031916908160001a90535060049490941c93613c5d81615462565b9050613bef565b5083156110f65760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c3f565b6000818152600183016020526040812054613cfa57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610bfb565b506000610bfb565b60008181526001830160205260408120548015613deb576000613d26600183614fbd565b8554909150600090613d3a90600190614fbd565b9050818114613d9f576000866000018281548110613d5a57613d5a614c31565b9060005260206000200154905080876000018481548110613d7d57613d7d614c31565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613db057613db0615479565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610bfb565b6000915050610bfb565b60008082516002811115613e0b57613e0b614766565b148015613e1c575060008260400151115b8015610bfb575050602001511590565b6000600182516002811115613e4357613e43614766565b148015610bfb575050604001511590565b6000600282516002811115613e6b57613e6b614766565b148015610bfb57505060400151151590565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b1790529151600092871691613edd916153e0565b6000604051808303816000865af19150503d8060008114613f1a576040519150601f19603f3d011682016040523d82523d6000602084013e613f1f565b606091505b50909695505050505050565b604080516000808252602082019092526001600160a01b03871690613f5b9087908790879087906044810161548f565b60408051601f198184030181529181526020820180516001600160e01b0316637921219560e11b17905251613f9091906153e0565b6000604051808303816000865af19150503d8060008114613fcd576040519150601f19603f3d011682016040523d82523d6000602084013e613fd2565b606091505b5090979650505050505050565b6000603854600160385484603754612f149190614fd0565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000926060929087169161405491906153e0565b6000604051808303816000865af19150503d8060008114614091576040519150601f19603f3d011682016040523d82523d6000602084013e614096565b606091505b5090925090508180156140c15750805115806140c15750808060200190518101906140c19190615176565b95945050505050565b604080516000808252602082019092526001600160a01b038616906140f890869086908690604481016154d4565b60408051601f198184030181529181526020820180516001600160e01b031663731133e960e01b17905251613edd91906153e0565b60408051606081018252600080825260208201529081016141696040805160608101909152806000815260200160008152602001600081525090565b905290565b60006020828403121561418057600080fd5b81356001600160e01b0319811681146110f657600080fd5b6001600160a01b038116811461108a57600080fd5b6000602082840312156141bf57600080fd5b81356110f681614198565b60008083601f8401126141dc57600080fd5b5081356001600160401b038111156141f357600080fd5b6020830191508360208260051b85010111156118bc57600080fd5b6000806000806040858703121561422457600080fd5b84356001600160401b038082111561423b57600080fd5b614247888389016141ca565b9096509450602087013591508082111561426057600080fd5b5061426d878288016141ca565b95989497509550505050565b6000806000806000806060878903121561429257600080fd5b86356001600160401b03808211156142a957600080fd5b6142b58a838b016141ca565b909850965060208901359150808211156142ce57600080fd5b6142da8a838b016141ca565b909650945060408901359150808211156142f357600080fd5b5061430089828a016141ca565b979a9699509497509295939492505050565b80356119cd81614198565b60006020828403121561432f57600080fd5b5035919050565b6000806040838503121561434957600080fd5b82359150602083013561435b81614198565b809150509250929050565b600060a0828403121561437857600080fd5b50919050565b6000610160828403121561437857600080fd5b600080600061018084860312156143a757600080fd5b6143b1858561437e565b92506101608401356001600160401b03808211156143ce57600080fd5b818601915086601f8301126143e257600080fd5b8135818111156143f157600080fd5b87602060608302850101111561440657600080fd5b6020830194508093505050509250925092565b8060608101831015610bfb57600080fd5b8060808101831015610bfb57600080fd5b6000806000806000806000806000806101208b8d03121561445b57600080fd5b6144648b614312565b995061447260208c01614312565b985060408b0135975060608b0135965060808b0135955060a08b0135945060c08b01356001600160401b03808211156144aa57600080fd5b6144b68e838f01614419565b955060e08d01359150808211156144cc57600080fd5b6144d88e838f0161442a565b94506101008d01359150808211156144ef57600080fd5b506144fc8d828e016141ca565b915080935050809150509295989b9194979a5092959850565b6000806040838503121561452857600080fd5b823561453381614198565b946020939093013593505050565b8035601081106119cd57600080fd5b6000806040838503121561456357600080fd5b61456c83614541565b9150602083013561435b81614198565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b03811182821017156145b4576145b461457c565b60405290565b604051601f8201601f191681016001600160401b03811182821017156145e2576145e261457c565b604052919050565b60006001600160401b038211156146035761460361457c565b5060051b60200190565b801515811461108a57600080fd5b60008060008060006060868803121561463357600080fd5b85356001600160401b038082111561464a57600080fd5b61465689838a016141ca565b909750955060209150878201358181111561467057600080fd5b61467c8a828b016141ca565b90965094505060408801358181111561469457600080fd5b88019050601f810189136146a757600080fd5b80356146ba6146b5826145ea565b6145ba565b81815260059190911b8201830190838101908b8311156146d957600080fd5b928401925b828410156147005783356146f18161460d565b825292840192908401906146de565b80955050505050509295509295909350565b6001600160e01b031991909116815260200190565b6000806040838503121561473a57600080fd5b50508035926020909101359150565b6000610160828403121561475c57600080fd5b6110f6838361437e565b634e487b7160e01b600052602160045260246000fd5b6003811061478c5761478c614766565b9052565b60006040820190506147a382845161477c565b6020928301516001600160a01b0316919092015290565b600082601f8301126147cb57600080fd5b813560206147db6146b5836145ea565b8083825260208201915060208460051b8701019350868411156147fd57600080fd5b602086015b848110156148195780358352918301918301614802565b509695505050505050565b600082601f83011261483557600080fd5b81356001600160401b0381111561484e5761484e61457c565b614861601f8201601f19166020016145ba565b81815284602083860101111561487657600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a086880312156148ab57600080fd5b85356148b681614198565b945060208601356148c681614198565b935060408601356001600160401b03808211156148e257600080fd5b6148ee89838a016147ba565b9450606088013591508082111561490457600080fd5b61491089838a016147ba565b9350608088013591508082111561492657600080fd5b5061493388828901614824565b9150509295509295909350565b60006020828403121561495257600080fd5b6110f682614541565b60008060008060008060006080888a03121561497657600080fd5b87356001600160401b038082111561498d57600080fd5b6149998b838c016141ca565b909950975060208a01359150808211156149b257600080fd5b6149be8b838c016141ca565b909750955060408a01359150808211156149d757600080fd5b6149e38b838c016141ca565b909550935060608a01359150808211156149fc57600080fd5b50614a098a828b0161442a565b91505092959891949750929550565b600080600080600060a08688031215614a3057600080fd5b8535614a3b81614198565b94506020860135614a4b81614198565b9350604086013592506060860135915060808601356001600160401b03811115614a7457600080fd5b61493388828901614824565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b600082601f830112614adf57600080fd5b81516020614aef6146b5836145ea565b8083825260208201915060208460051b870101935086841115614b1157600080fd5b602086015b84811015614819578051614b2981614198565b8352918301918301614b16565b6001600160601b038116811461108a57600080fd5b600080600060608486031215614b6057600080fd5b83516001600160401b0380821115614b7757600080fd5b614b8387838801614ace565b9450602091508186015181811115614b9a57600080fd5b614ba688828901614ace565b945050604086015181811115614bbb57600080fd5b86019050601f81018713614bce57600080fd5b8051614bdc6146b5826145ea565b81815260059190911b82018301908381019089831115614bfb57600080fd5b928401925b82841015614c22578351614c1381614b36565b82529284019290840190614c00565b80955050505050509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6001600160601b03818116838216019080821115612ef557612ef5614c47565b8035600381106119cd57600080fd5b600060608284031215614c9e57600080fd5b614ca6614592565b9050614cb182614c7d565b8152602082013560208201526040820135604082015292915050565b600060a08284031215614cdf57600080fd5b614ce7614592565b8235614cf281614198565b81526020830135614d0281614198565b6020820152614d148460408501614c8c565b60408201529392505050565b600060608284031215614d3257600080fd5b614d3a614592565b823560ff81168114614d4b57600080fd5b8152602083810135908201526040928301359281019290925250919050565b6000808335601e19843603018112614d8157600080fd5b8301803591506001600160401b03821115614d9b57600080fd5b6020019150600581901b36038213156118bc57600080fd5b600060208284031215614dc557600080fd5b81356110f681614b36565b8035600281106119cd57600080fd5b600060608284031215614df157600080fd5b614df9614592565b90508135614e0681614198565b81526020820135614e1681614198565b806020830152506040820135604082015292915050565b60006101608284031215614e4057600080fd5b60405160a081018181106001600160401b0382111715614e6257614e6261457c565b60405282358152614e7560208401614dd0565b6020820152614e878460408501614ddf565b6040820152614e998460a08501614ddf565b6060820152614eac846101008501614c8c565b60808201529392505050565b6002811061478c5761478c614766565b8035614ed381614198565b6001600160a01b039081168352602082013590614eef82614198565b166020830152604090810135910152565b60006101808201905083825282356020830152614f1f60208401614dd0565b614f2c6040840182614eb8565b50614f3d6060830160408501614ec8565b614f4d60c0830160a08501614ec8565b610120614f68818401614f636101008701614c7d565b61477c565b61014081850135818501528085013561016085015250509392505050565b600060208284031215614f9857600080fd5b6110f682614c7d565b600060608284031215614fb357600080fd5b6110f68383614c8c565b81810381811115610bfb57610bfb614c47565b8082028115828204841417610bfb57610bfb614c47565b600060208284031215614ff957600080fd5b81356110f68161460d565b6001600160601b03828116828216039080821115612ef557612ef5614c47565b6010811061478c5761478c614766565b60208101610bfb8284615024565b6001600160e01b03198316815260408101600b831061506357615063614766565b8260208301529392505050565b8183526000602080850194508260005b858110156150ae57813561509381614198565b6001600160a01b031687529582019590820190600101615080565b509495945050505050565b6040815260006150cd604083018688615070565b82810360208401528381526001600160fb1b038411156150ec57600080fd5b8360051b80866020840137016020019695505050505050565b60608152600061511960608301888a615070565b6020838203602085015261512e82888a615070565b848103604086015285815286925060200160005b868110156151675761515782614f6386614c7d565b9282019290820190600101615142565b509a9950505050505050505050565b60006020828403121561518857600080fd5b81516110f68161460d565b6000600182016151a5576151a5614c47565b5060010190565b6151b782825161477c565b60208181015190830152604090810151910152565b6000610180820190508382528251602083015260208301516151f16040840182614eb8565b5060408381015180516001600160a01b03908116606086015260208201511660808501529081015160a084015250606083015180516001600160a01b0390811660c085015260208201511660e084015260408101516101008401525060808301516152606101208401826151ac565b509392505050565b60006020828403121561527a57600080fd5b6110f682614dd0565b80820180821115610bfb57610bfb614c47565b6000826152b357634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031984168152606081016152d66020830185615024565b6001600160a01b03929092166040919091015292915050565b60006020828403121561530157600080fd5b5051919050565b60005b8381101561532357818101518382015260200161530b565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615364816017850160208801615308565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615395816028840160208801615308565b01602801949350505050565b600081518084526153b9816020860160208601615308565b601f01601f19169290920160200192915050565b6020815260006110f660208301846153a1565b600082516153f2818460208701615308565b9190910192915050565b60c0810161540a82876151ac565b6001600160a01b0394851660608301529284166080820152921660a090920191909152919050565b60a0810161544082866151ac565b6001600160a01b03938416606083015291909216608090920191909152919050565b60008161547157615471614c47565b506000190190565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906154c9908301846153a1565b979650505050505050565b60018060a01b038516815283602082015282604082015260806060820152600061550160808301846153a1565b969550505050505056fe7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498a264697066735822122039bdd676fa56a806e2f91eb197d0a444b13ff0899114d328ae5983c28d58606164736f6c63430008170033", + "nonce": "0x1a", + "accessList": [] + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": null, + "transactionType": "CALL", + "contractName": "MainchainBridgeManager", + "contractAddress": "0x5396b75c9eb8D1153D2B8a0Bb9a8c4B1541f758d", + "function": null, + "arguments": null, + "transaction": { + "type": "0x02", + "from": "0xd24d87ddc1917165435b306aac68d99e0f49a3fa", + "to": "0x5396b75c9eb8d1153d2b8a0bb9a8c4b1541f758d", + "gas": "0x7a1200", + "value": "0x0", + "data": "0x5e05cf9e000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000009800000000000000000000000000000000000000000000000000000000000000a2000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000aa36a7000000000000000000000000000000000000000000000000000000006630a1a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000820000000000000000000000000000000000000000000000000000000000000000700000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e00000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e00000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e00000000000000000000000061ec0ebf966ae84c414bda715e17cef657e039df00000000000000000000000061ec0ebf966ae84c414bda715e17cef657e039df000000000000000000000000603075b625cc2cf69fbb3546c6acc2451fe792af000000000000000000000000603075b625cc2cf69fbb3546c6acc2451fe792af00000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000003c000000000000000000000000000000000000000000000000000000000000004c000000000000000000000000000000000000000000000000000000000000000a44f1ef2860000000000000000000000001050f2e63177b5ed18f3e88d000db3a600d664e300000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024110a8308000000000000000000000000dbf1c9fb0cb61ae76901e55c5c04e77d2be131a1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000603075b625cc2cf69fbb3546c6acc2451fe792af000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f283970000000000000000000000000603075b625cc2cf69fbb3546c6acc2451fe792af0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe600000000000000000000000023614572006e2d0db35e54d4082aec68d96864500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f283970000000000000000000000000603075b625cc2cf69fbb3546c6acc2451fe792af0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c44bb5274a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006435da81210000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f283970000000000000000000000000603075b625cc2cf69fbb3546c6acc2451fe792af00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001b3b6caa3d4505a1c9cf9e919a054d18fb9d535d011aa1014de547e4571caa3ddf6de4da3398eaffeabe44e76ba336b5fcccddc7d97656f8cbbb2c64ae249371be000000000000000000000000000000000000000000000000000000000000001c2edc7c3cf58e29df3decbf15c345fddb2edce83568fd8506aa2b10b259e29e58215de8c6bcc92188508cee6cd09d14a58f19dc839644d4c645b59b8d7e31d82e000000000000000000000000000000000000000000000000000000000000001b080ed428672a9a77220c4317866dc69e2ee99b5bdd08e72c0c581f4fc57a2852524263bd497a1305257b03bccbb0dad12dae0279408f2c2b2fc7a283cc2844ca000000000000000000000000000000000000000000000000000000000000001cbf30a6c1395c8d9e4e7d48206247431aaa77dc4df0e8495e4db8dadd099425d106eb70446b5ab47e64da5a45fd3755b9474003508b18e0a447937a1f50cc6590", + "nonce": "0x0", + "accessList": [] + }, + "additionalContracts": [], + "isFixedGasLimit": true + } + ], + "receipts": [ + { + "transactionHash": "0x32dcfdca4661c4cd3882524622948948f7b0cf1f1d1de824c635ceed267e1def", + "transactionIndex": "0xc", + "blockHash": "0xa9bc997f9730f4ee6ed230f52b4ace8b73907ede3c4dc9439fdea6b17cfe4b2c", + "blockNumber": "0x571e07", + "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "to": "0x61eC0ebf966AE84C414BDA715E17CeF657e039DF", + "cumulativeGasUsed": "0x8b968", + "gasUsed": "0x7001", + "contractAddress": null, + "logs": [ + { + "address": "0x61eC0ebf966AE84C414BDA715E17CeF657e039DF", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000968d0cd7343f711216817e617d3f92a23dc91c070000000000000000000000005396b75c9eb8d1153d2b8a0bb9a8c4b1541f758d", + "blockHash": "0xa9bc997f9730f4ee6ed230f52b4ace8b73907ede3c4dc9439fdea6b17cfe4b2c", + "blockNumber": "0x571e07", + "transactionHash": "0x32dcfdca4661c4cd3882524622948948f7b0cf1f1d1de824c635ceed267e1def", + "transactionIndex": "0xc", + "logIndex": "0x7", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000020000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000400000000000000000000000000080000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "effectiveGasPrice": "0x194ba3d10a" + }, + { + "transactionHash": "0x2faea0626466f084d03101489e4a35b7ca9b20b4703fceebcd2cb1bbe58bb7a7", + "transactionIndex": "0xe", + "blockHash": "0xca322afa88e562ff018bd1ad101ebe1ae7ef05454f60f9a0036336c6c969fcf1", + "blockNumber": "0x571e08", + "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "to": "0x06855f31dF1d3D25cE486CF09dB49bDa535D2a9e", + "cumulativeGasUsed": "0xe1b27", + "gasUsed": "0x7001", + "contractAddress": null, + "logs": [ + { + "address": "0x06855f31dF1d3D25cE486CF09dB49bDa535D2a9e", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000968d0cd7343f711216817e617d3f92a23dc91c070000000000000000000000005396b75c9eb8d1153d2b8a0bb9a8c4b1541f758d", + "blockHash": "0xca322afa88e562ff018bd1ad101ebe1ae7ef05454f60f9a0036336c6c969fcf1", + "blockNumber": "0x571e08", + "transactionHash": "0x2faea0626466f084d03101489e4a35b7ca9b20b4703fceebcd2cb1bbe58bb7a7", + "transactionIndex": "0xe", + "logIndex": "0xc", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000040000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000440000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "effectiveGasPrice": "0x1c5e0e07d7" + }, + { + "transactionHash": "0xf8db3100846b70a3a0c38a27dc792cff5e4a02498aea7b04b181a889bd7eb200", + "transactionIndex": "0xe", + "blockHash": "0x3fce148ea7bfe7bf07aa76b8a6a99d6507f9c36964517a8956a15d6b5ab7d42a", + "blockNumber": "0x571e3b", + "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "to": null, + "cumulativeGasUsed": "0x7612e2", + "gasUsed": "0x461747", + "contractAddress": "0x8A6e09c0E369086B3AC219aB66F990b0A7d3E1Da", + "logs": [ + { + "address": "0x8A6e09c0E369086B3AC219aB66F990b0A7d3E1Da", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "blockHash": "0x3fce148ea7bfe7bf07aa76b8a6a99d6507f9c36964517a8956a15d6b5ab7d42a", + "blockNumber": "0x571e3b", + "transactionHash": "0xf8db3100846b70a3a0c38a27dc792cff5e4a02498aea7b04b181a889bd7eb200", + "transactionIndex": "0xe", + "logIndex": "0x18", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000002000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "effectiveGasPrice": "0xe451ba401" + }, + { + "transactionHash": "0x5147b7112152f9d5b5ac870bfa90501324ede13008546831abd76706bc097b27", + "transactionIndex": "0xe", + "blockHash": "0xf418ec1bd432f094a0c3444d15a78616db2ade1379e0b27903859d023e387dbb", + "blockNumber": "0x571e3c", + "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "to": null, + "cumulativeGasUsed": "0xaca308", + "gasUsed": "0x15196e", + "contractAddress": "0x603075B625cc2cf69FbB3546C6acC2451FE792AF", + "logs": [ + { + "address": "0x603075B625cc2cf69FbB3546C6acC2451FE792AF", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000008a6e09c0e369086b3ac219ab66f990b0a7d3e1da" + ], + "data": "0x", + "blockHash": "0xf418ec1bd432f094a0c3444d15a78616db2ade1379e0b27903859d023e387dbb", + "blockNumber": "0x571e3c", + "transactionHash": "0x5147b7112152f9d5b5ac870bfa90501324ede13008546831abd76706bc097b27", + "transactionIndex": "0xe", + "logIndex": "0x14", + "removed": false + }, + { + "address": "0x603075B625cc2cf69FbB3546C6acC2451FE792AF", + "topics": [ + "0xe5cd1c123a8cf63fa1b7229678db61fe8ae99dbbd27889370b6667c8cae97da1", + "0x8000000000000000000000000000000000000000000000000000000000000000" + ], + "data": "0x", + "blockHash": "0xf418ec1bd432f094a0c3444d15a78616db2ade1379e0b27903859d023e387dbb", + "blockNumber": "0x571e3c", + "transactionHash": "0x5147b7112152f9d5b5ac870bfa90501324ede13008546831abd76706bc097b27", + "transactionIndex": "0xe", + "logIndex": "0x15", + "removed": false + }, + { + "address": "0x603075B625cc2cf69FbB3546C6acC2451FE792AF", + "topics": [ + "0x356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000603075b625cc2cf69fbb3546c6acc2451fe792af" + ], + "data": "0x", + "blockHash": "0xf418ec1bd432f094a0c3444d15a78616db2ade1379e0b27903859d023e387dbb", + "blockNumber": "0x571e3c", + "transactionHash": "0x5147b7112152f9d5b5ac870bfa90501324ede13008546831abd76706bc097b27", + "transactionIndex": "0xe", + "logIndex": "0x16", + "removed": false + }, + { + "address": "0x603075B625cc2cf69FbB3546C6acC2451FE792AF", + "topics": [ + "0x356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x00000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e" + ], + "data": "0x", + "blockHash": "0xf418ec1bd432f094a0c3444d15a78616db2ade1379e0b27903859d023e387dbb", + "blockNumber": "0x571e3c", + "transactionHash": "0x5147b7112152f9d5b5ac870bfa90501324ede13008546831abd76706bc097b27", + "transactionIndex": "0xe", + "logIndex": "0x17", + "removed": false + }, + { + "address": "0x603075B625cc2cf69FbB3546C6acC2451FE792AF", + "topics": [ + "0x356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d", + "0x0000000000000000000000000000000000000000000000000000000000000005", + "0x00000000000000000000000061ec0ebf966ae84c414bda715e17cef657e039df" + ], + "data": "0x", + "blockHash": "0xf418ec1bd432f094a0c3444d15a78616db2ade1379e0b27903859d023e387dbb", + "blockNumber": "0x571e3c", + "transactionHash": "0x5147b7112152f9d5b5ac870bfa90501324ede13008546831abd76706bc097b27", + "transactionIndex": "0xe", + "logIndex": "0x18", + "removed": false + }, + { + "address": "0x603075B625cc2cf69FbB3546C6acC2451FE792AF", + "topics": [ + "0x976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000007", + "0x000000000000000000000000000000000000000000000000000000000000000a" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xf418ec1bd432f094a0c3444d15a78616db2ade1379e0b27903859d023e387dbb", + "blockNumber": "0x571e3c", + "transactionHash": "0x5147b7112152f9d5b5ac870bfa90501324ede13008546831abd76706bc097b27", + "transactionIndex": "0xe", + "logIndex": "0x19", + "removed": false + }, + { + "address": "0x603075B625cc2cf69FbB3546C6acC2451FE792AF", + "topics": [ + "0x865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c59", + "0x0000000000000000000000000000000000000000000000000000000000000002", + "0x00000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e" + ], + "data": "0x", + "blockHash": "0xf418ec1bd432f094a0c3444d15a78616db2ade1379e0b27903859d023e387dbb", + "blockNumber": "0x571e3c", + "transactionHash": "0x5147b7112152f9d5b5ac870bfa90501324ede13008546831abd76706bc097b27", + "transactionIndex": "0xe", + "logIndex": "0x1a", + "removed": false + }, + { + "address": "0x603075B625cc2cf69FbB3546C6acC2451FE792AF", + "topics": [ + "0x897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b78" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000004000000000000000000000000d24d87ddc1917165435b306aac68d99e0f49a3fa000000000000000000000000b033ba62ec622dc54d0abfe0254e79692147ca26000000000000000000000000087d08e3ba42e64e3948962dd1371f906d1278b900000000000000000000000052ec2e6bbce45afff8955da6410bb13812f4289f00000000000000000000000000000000000000000000000000000000000000040000000000000000000000002e82d2b56f858f79deef11b160bfc4631873da2b000000000000000000000000bcb61783dd2403fe8cc9b89b27b1a9bb03d040cb000000000000000000000000b266bf53cf7eac4e2065a404598dcb0e15e9462c000000000000000000000000cc5fc5b6c8595f56306da736f6cd02ed9141c84a", + "blockHash": "0xf418ec1bd432f094a0c3444d15a78616db2ade1379e0b27903859d023e387dbb", + "blockNumber": "0x571e3c", + "transactionHash": "0x5147b7112152f9d5b5ac870bfa90501324ede13008546831abd76706bc097b27", + "transactionIndex": "0xe", + "logIndex": "0x1b", + "removed": false + }, + { + "address": "0x603075B625cc2cf69FbB3546C6acC2451FE792AF", + "topics": [ + "0x22d5bb5059ffe2949a098666fc198587200c8118483074120d3ca7050c7753f1" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000003", + "blockHash": "0xf418ec1bd432f094a0c3444d15a78616db2ade1379e0b27903859d023e387dbb", + "blockNumber": "0x571e3c", + "transactionHash": "0x5147b7112152f9d5b5ac870bfa90501324ede13008546831abd76706bc097b27", + "transactionIndex": "0xe", + "logIndex": "0x1c", + "removed": false + }, + { + "address": "0x603075B625cc2cf69FbB3546C6acC2451FE792AF", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "blockHash": "0xf418ec1bd432f094a0c3444d15a78616db2ade1379e0b27903859d023e387dbb", + "blockNumber": "0x571e3c", + "transactionHash": "0x5147b7112152f9d5b5ac870bfa90501324ede13008546831abd76706bc097b27", + "transactionIndex": "0xe", + "logIndex": "0x1d", + "removed": false + }, + { + "address": "0x603075B625cc2cf69FbB3546C6acC2451FE792AF", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000968d0cd7343f711216817e617d3f92a23dc91c07", + "blockHash": "0xf418ec1bd432f094a0c3444d15a78616db2ade1379e0b27903859d023e387dbb", + "blockNumber": "0x571e3c", + "transactionHash": "0x5147b7112152f9d5b5ac870bfa90501324ede13008546831abd76706bc097b27", + "transactionIndex": "0xe", + "logIndex": "0x1e", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x04020000000000000000000000000000400080000000200000100000000001000000400000000000100000000000000000001000040000010220000000040000000030000000800000000000040002000002000000040005000400000000400000000000020000000040000000000808000000800000000000000000000000001000000000000100010004020000001100000800000080000000000400800000000000000800001000010100000400000000010000000000000000000000000000000020000000000000000002040100000000800400001000000100000060080000020000000000000000000000000000000100008000000000000000001000", + "type": "0x2", + "effectiveGasPrice": "0xe376fb1bc" + }, + { + "transactionHash": "0xe85854178d838b3f4c5685d97201e45ab55a55033993f19beabe479db0cf20e0", + "transactionIndex": "0xa", + "blockHash": "0xd1f2f8d0fdaed5660f48ca9975eaa3974212789749762eba868cf24b73d67599", + "blockNumber": "0x571e3d", + "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "to": "0x603075B625cc2cf69FbB3546C6acC2451FE792AF", + "cumulativeGasUsed": "0x3578f6", + "gasUsed": "0x7001", + "contractAddress": null, + "logs": [ + { + "address": "0x603075B625cc2cf69FbB3546C6acC2451FE792AF", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000968d0cd7343f711216817e617d3f92a23dc91c070000000000000000000000005396b75c9eb8d1153d2b8a0bb9a8c4b1541f758d", + "blockHash": "0xd1f2f8d0fdaed5660f48ca9975eaa3974212789749762eba868cf24b73d67599", + "blockNumber": "0x571e3d", + "transactionHash": "0xe85854178d838b3f4c5685d97201e45ab55a55033993f19beabe479db0cf20e0", + "transactionIndex": "0xa", + "logIndex": "0x10", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000100000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "effectiveGasPrice": "0xeee9ddcd8" + }, + { + "transactionHash": "0x91610b4f041e04847fb9ebc85d851506bb6973a0bd477dfa209dd7e41a49b2a8", + "transactionIndex": "0xd", + "blockHash": "0xfeb34621f76a36baa15bab287dd8bb6cba65249d4d58c2c978976055755fe965", + "blockNumber": "0x571e3e", + "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "to": null, + "cumulativeGasUsed": "0x27b745", + "gasUsed": "0x53aef", + "contractAddress": "0xdbf1c9FB0cb61Ae76901e55c5C04e77d2BE131A1", + "logs": [], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "effectiveGasPrice": "0xebcfee0e3" + }, + { + "transactionHash": "0xbe7f2344e273284469e954c19134ee10471821447455bb6b67b5b3e1a2e3d1f9", + "transactionIndex": "0x1b", + "blockHash": "0xf807eaaef29ec4cc035c754fd92ac2ee8aa752320fcf45cdb63cd103ce41805e", + "blockNumber": "0x571e3f", + "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "to": null, + "cumulativeGasUsed": "0x42cd18", + "gasUsed": "0x10348c", + "contractAddress": "0x23614572006e2D0DB35E54d4082Aec68d9686450", + "logs": [ + { + "address": "0x23614572006e2D0DB35E54d4082Aec68d9686450", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "blockHash": "0xf807eaaef29ec4cc035c754fd92ac2ee8aa752320fcf45cdb63cd103ce41805e", + "blockNumber": "0x571e3f", + "transactionHash": "0xbe7f2344e273284469e954c19134ee10471821447455bb6b67b5b3e1a2e3d1f9", + "transactionIndex": "0x1b", + "logIndex": "0x2e", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000", + "type": "0x2", + "effectiveGasPrice": "0xdd944432e" + }, + { + "transactionHash": "0x24b2d31919e5b58826110a78c5f4b56390fa6a5f9382abb905f47c03b1311863", + "transactionIndex": "0x15", + "blockHash": "0x0160463bfc8c8aeea1accb17aeb2130de3bfba3f709549d662d6ff5b0cf0ba43", + "blockNumber": "0x571e40", + "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", + "to": null, + "cumulativeGasUsed": "0x6b0311", + "gasUsed": "0x494be4", + "contractAddress": "0x1050f2E63177b5eD18f3E88D000DB3a600d664e3", + "logs": [ + { + "address": "0x1050f2E63177b5eD18f3E88D000DB3a600d664e3", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "blockHash": "0x0160463bfc8c8aeea1accb17aeb2130de3bfba3f709549d662d6ff5b0cf0ba43", + "blockNumber": "0x571e40", + "transactionHash": "0x24b2d31919e5b58826110a78c5f4b56390fa6a5f9382abb905f47c03b1311863", + "transactionIndex": "0x15", + "logIndex": "0x20", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "effectiveGasPrice": "0xd8c2ecd6e" + }, + { + "transactionHash": "0x34a4f62a3a088803c6c9a3ad2721668f1ed98a02cea045af25150b1a455ed01c", + "transactionIndex": "0x14", + "blockHash": "0xbb704424bcac09e4ff284893f80c9940680941f83e3cffe649829e3191c9bb20", + "blockNumber": "0x571e41", + "from": "0xd24D87DDc1917165435b306aAC68D99e0F49A3Fa", + "to": "0x5396b75c9eb8D1153D2B8a0Bb9a8c4B1541f758d", + "cumulativeGasUsed": "0x1b9e85", + "gasUsed": "0x61a77", + "contractAddress": null, + "logs": [ + { + "address": "0x5396b75c9eb8D1153D2B8a0Bb9a8c4B1541f758d", + "topics": [ + "0xa57d40f1496988cf60ab7c9d5ba4ff83647f67d3898d441a3aaf21b651678fd9", + "0x0000000000000000000000000000000000000000000000000000000000aa36a7", + "0x0000000000000000000000000000000000000000000000000000000000000002", + "0x82caa412e6e22245af70cc2b1b41c0f699841e35d07507164317334bff1fc2c4" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000d24d87ddc1917165435b306aac68d99e0f49a3fa00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000aa36a7000000000000000000000000000000000000000000000000000000006630a1a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000820000000000000000000000000000000000000000000000000000000000000000700000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e00000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e00000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e00000000000000000000000061ec0ebf966ae84c414bda715e17cef657e039df00000000000000000000000061ec0ebf966ae84c414bda715e17cef657e039df000000000000000000000000603075b625cc2cf69fbb3546c6acc2451fe792af000000000000000000000000603075b625cc2cf69fbb3546c6acc2451fe792af00000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000003c000000000000000000000000000000000000000000000000000000000000004c000000000000000000000000000000000000000000000000000000000000000a44f1ef2860000000000000000000000001050f2e63177b5ed18f3e88d000db3a600d664e300000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024110a8308000000000000000000000000dbf1c9fb0cb61ae76901e55c5c04e77d2be131a1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44bb5274a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044865e6fd3000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000603075b625cc2cf69fbb3546c6acc2451fe792af000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f283970000000000000000000000000603075b625cc2cf69fbb3546c6acc2451fe792af0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe600000000000000000000000023614572006e2d0db35e54d4082aec68d96864500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f283970000000000000000000000000603075b625cc2cf69fbb3546c6acc2451fe792af0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c44bb5274a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006435da81210000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248f283970000000000000000000000000603075b625cc2cf69fbb3546c6acc2451fe792af00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f4240", + "blockHash": "0xbb704424bcac09e4ff284893f80c9940680941f83e3cffe649829e3191c9bb20", + "blockNumber": "0x571e41", + "transactionHash": "0x34a4f62a3a088803c6c9a3ad2721668f1ed98a02cea045af25150b1a455ed01c", + "transactionIndex": "0x14", + "logIndex": "0x12", + "removed": false + }, + { + "address": "0x5396b75c9eb8D1153D2B8a0Bb9a8c4B1541f758d", + "topics": [ + "0x5c819725ea53655a3b898f3df59b66489761935454e9212ca1e5ebd759953d0b", + "0x82caa412e6e22245af70cc2b1b41c0f699841e35d07507164317334bff1fc2c4" + ], + "data": "0x", + "blockHash": "0xbb704424bcac09e4ff284893f80c9940680941f83e3cffe649829e3191c9bb20", + "blockNumber": "0x571e41", + "transactionHash": "0x34a4f62a3a088803c6c9a3ad2721668f1ed98a02cea045af25150b1a455ed01c", + "transactionIndex": "0x14", + "logIndex": "0x13", + "removed": false + }, + { + "address": "0x06855f31dF1d3D25cE486CF09dB49bDa535D2a9e", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000001050f2e63177b5ed18f3e88d000db3a600d664e3" + ], + "data": "0x", + "blockHash": "0xbb704424bcac09e4ff284893f80c9940680941f83e3cffe649829e3191c9bb20", + "blockNumber": "0x571e41", + "transactionHash": "0x34a4f62a3a088803c6c9a3ad2721668f1ed98a02cea045af25150b1a455ed01c", + "transactionIndex": "0x14", + "logIndex": "0x14", + "removed": false + }, + { + "address": "0x06855f31dF1d3D25cE486CF09dB49bDa535D2a9e", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000004", + "blockHash": "0xbb704424bcac09e4ff284893f80c9940680941f83e3cffe649829e3191c9bb20", + "blockNumber": "0x571e41", + "transactionHash": "0x34a4f62a3a088803c6c9a3ad2721668f1ed98a02cea045af25150b1a455ed01c", + "transactionIndex": "0x14", + "logIndex": "0x15", + "removed": false + }, + { + "address": "0x06855f31dF1d3D25cE486CF09dB49bDa535D2a9e", + "topics": [ + "0x865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c59", + "0x000000000000000000000000000000000000000000000000000000000000000b", + "0x000000000000000000000000603075b625cc2cf69fbb3546c6acc2451fe792af" + ], + "data": "0x", + "blockHash": "0xbb704424bcac09e4ff284893f80c9940680941f83e3cffe649829e3191c9bb20", + "blockNumber": "0x571e41", + "transactionHash": "0x34a4f62a3a088803c6c9a3ad2721668f1ed98a02cea045af25150b1a455ed01c", + "transactionIndex": "0x14", + "logIndex": "0x16", + "removed": false + }, + { + "address": "0x06855f31dF1d3D25cE486CF09dB49bDa535D2a9e", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x0000000000000000000000005396b75c9eb8d1153d2b8a0bb9a8c4b1541f758d000000000000000000000000603075b625cc2cf69fbb3546c6acc2451fe792af", + "blockHash": "0xbb704424bcac09e4ff284893f80c9940680941f83e3cffe649829e3191c9bb20", + "blockNumber": "0x571e41", + "transactionHash": "0x34a4f62a3a088803c6c9a3ad2721668f1ed98a02cea045af25150b1a455ed01c", + "transactionIndex": "0x14", + "logIndex": "0x17", + "removed": false + }, + { + "address": "0x61eC0ebf966AE84C414BDA715E17CeF657e039DF", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x00000000000000000000000023614572006e2d0db35e54d4082aec68d9686450" + ], + "data": "0x", + "blockHash": "0xbb704424bcac09e4ff284893f80c9940680941f83e3cffe649829e3191c9bb20", + "blockNumber": "0x571e41", + "transactionHash": "0x34a4f62a3a088803c6c9a3ad2721668f1ed98a02cea045af25150b1a455ed01c", + "transactionIndex": "0x14", + "logIndex": "0x18", + "removed": false + }, + { + "address": "0x61eC0ebf966AE84C414BDA715E17CeF657e039DF", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x0000000000000000000000005396b75c9eb8d1153d2b8a0bb9a8c4b1541f758d000000000000000000000000603075b625cc2cf69fbb3546c6acc2451fe792af", + "blockHash": "0xbb704424bcac09e4ff284893f80c9940680941f83e3cffe649829e3191c9bb20", + "blockNumber": "0x571e41", + "transactionHash": "0x34a4f62a3a088803c6c9a3ad2721668f1ed98a02cea045af25150b1a455ed01c", + "transactionIndex": "0x14", + "logIndex": "0x19", + "removed": false + }, + { + "address": "0x603075B625cc2cf69FbB3546C6acC2451FE792AF", + "topics": [ + "0xb85c58eeff9fe423669ae0841666f4c8499e8731b8275eb462e4fa1720ec420e" + ], + "data": "0x00000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e0000000000000000000000000000000000000000000000000000000000000001", + "blockHash": "0xbb704424bcac09e4ff284893f80c9940680941f83e3cffe649829e3191c9bb20", + "blockNumber": "0x571e41", + "transactionHash": "0x34a4f62a3a088803c6c9a3ad2721668f1ed98a02cea045af25150b1a455ed01c", + "transactionIndex": "0x14", + "logIndex": "0x1a", + "removed": false + }, + { + "address": "0x603075B625cc2cf69FbB3546C6acC2451FE792AF", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x0000000000000000000000005396b75c9eb8d1153d2b8a0bb9a8c4b1541f758d000000000000000000000000603075b625cc2cf69fbb3546c6acc2451fe792af", + "blockHash": "0xbb704424bcac09e4ff284893f80c9940680941f83e3cffe649829e3191c9bb20", + "blockNumber": "0x571e41", + "transactionHash": "0x34a4f62a3a088803c6c9a3ad2721668f1ed98a02cea045af25150b1a455ed01c", + "transactionIndex": "0x14", + "logIndex": "0x1b", + "removed": false + }, + { + "address": "0x5396b75c9eb8D1153D2B8a0Bb9a8c4B1541f758d", + "topics": [ + "0xe134987599ae266ec90edeff1b26125b287dbb57b10822649432d1bb26537fba", + "0x82caa412e6e22245af70cc2b1b41c0f699841e35d07507164317334bff1fc2c4" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xbb704424bcac09e4ff284893f80c9940680941f83e3cffe649829e3191c9bb20", + "blockNumber": "0x571e41", + "transactionHash": "0x34a4f62a3a088803c6c9a3ad2721668f1ed98a02cea045af25150b1a455ed01c", + "transactionIndex": "0x14", + "logIndex": "0x1c", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x06000000008000010000004000000000400000000000000000000000000000000000000000000000000000080000040002000000000000010000000000000100000000000000800000000000000002000000000000000000000000000000500000000000000000000000000000000000000000800000000000000000000000000000000000000040000004000000000204010000000080000010000200800000000000000000028000000180000400000000000000000000000001000212000000000020000000000000200802040100102000000440001000400000400000080004080000000000000000900010000000000100008000040000000000000000", + "type": "0x2", + "effectiveGasPrice": "0xde8809ffc" + } + ], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1713254978, + "chain": 11155111, + "multi": false, + "commit": "d84a88c" +} \ No newline at end of file From 2cfa11d0607ca4a5fd74469543f0baaa7ecc1f4c Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 16 Apr 2024 15:13:26 +0700 Subject: [PATCH 176/180] chore: replace RoninBridgeManager artifact --- .../ronin-testnet/RoninBridgeManager.json | 2865 +---------------- 1 file changed, 129 insertions(+), 2736 deletions(-) diff --git a/deployments/ronin-testnet/RoninBridgeManager.json b/deployments/ronin-testnet/RoninBridgeManager.json index 85c0679e..6e7b6d55 100644 --- a/deployments/ronin-testnet/RoninBridgeManager.json +++ b/deployments/ronin-testnet/RoninBridgeManager.json @@ -1,2825 +1,218 @@ { - "address": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", "abi": [ { + "type": "constructor", "inputs": [ { - "internalType": "uint256", - "name": "num", - "type": "uint256" + "name": "_logic", + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", - "name": "denom", - "type": "uint256" + "name": "admin_", + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", - "name": "roninChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expiryDuration", - "type": "uint256" - }, - { - "internalType": "address", - "name": "bridgeContract", - "type": "address" - }, - { - "internalType": "address[]", - "name": "callbackRegisters", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "bridgeOperators", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "governors", - "type": "address[]" - }, - { - "internalType": "uint96[]", - "name": "voteWeights", - "type": "uint96[]" - }, - { - "internalType": "enum GlobalProposal.TargetOption[]", - "name": "targetOptions", - "type": "uint8[]" - }, - { - "internalType": "address[]", - "name": "targets", - "type": "address[]" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "codehash", - "type": "bytes32" - } - ], - "name": "ErrAddressIsNotCreatedEOA", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "voter", - "type": "address" - } - ], - "name": "ErrAlreadyVoted", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "bridgeOperator", - "type": "address" - } - ], - "name": "ErrBridgeOperatorAlreadyExisted", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "bridgeOperator", - "type": "address" - } - ], - "name": "ErrBridgeOperatorUpdateFailed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "enum ContractType", - "name": "contractType", - "type": "uint8" - } - ], - "name": "ErrContractTypeNotFound", - "type": "error" - }, - { - "inputs": [], - "name": "ErrCurrentProposalIsNotCompleted", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" - } - ], - "name": "ErrDuplicated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "proposalHash", - "type": "bytes32" - } - ], - "name": "ErrInsufficientGas", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" - } - ], - "name": "ErrInvalidArguments", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" - }, - { - "internalType": "uint256", - "name": "actual", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expected", - "type": "uint256" - } - ], - "name": "ErrInvalidChainId", - "type": "error" - }, - { - "inputs": [], - "name": "ErrInvalidExpiryTimestamp", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" - } - ], - "name": "ErrInvalidOrder", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - } - ], - "name": "ErrInvalidProposal", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" - } - ], - "name": "ErrInvalidProposalNonce", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" - } - ], - "name": "ErrInvalidSignatures", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" - } - ], - "name": "ErrInvalidThreshold", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" - } - ], - "name": "ErrInvalidVoteWeight", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" - } - ], - "name": "ErrLengthMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" - } - ], - "name": "ErrOnlySelfCall", - "type": "error" - }, - { - "inputs": [], - "name": "ErrQueryForEmptyVote", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" - }, - { - "internalType": "enum RoleAccess", - "name": "expectedRole", - "type": "uint8" - } - ], - "name": "ErrUnauthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - }, - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "ErrUnsupportedInterface", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" - } - ], - "name": "ErrUnsupportedVoteType", - "type": "error" - }, - { - "inputs": [], - "name": "ErrVoteIsFinalized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "msgSig", - "type": "bytes4" - } - ], - "name": "ErrZeroAddress", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "ErrZeroCodeContract", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "governor", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "fromBridgeOperator", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "toBridgeOperator", - "type": "address" - } - ], - "name": "BridgeOperatorUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bool[]", - "name": "statuses", - "type": "bool[]" - }, - { - "indexed": false, - "internalType": "uint96[]", - "name": "voteWeights", - "type": "uint96[]" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "governors", - "type": "address[]" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "bridgeOperators", - "type": "address[]" - } - ], - "name": "BridgeOperatorsAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bool[]", - "name": "statuses", - "type": "bool[]" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "bridgeOperators", - "type": "address[]" - } - ], - "name": "BridgeOperatorsRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "enum ContractType", - "name": "contractType", - "type": "uint8" - }, - { - "indexed": true, - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "ContractUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "round", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "proposalHash", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expiryTimestamp", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "targets", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - }, - { - "internalType": "bytes[]", - "name": "calldatas", - "type": "bytes[]" - }, - { - "internalType": "uint256[]", - "name": "gasAmounts", - "type": "uint256[]" - } - ], - "indexed": false, - "internalType": "struct Proposal.ProposalDetail", - "name": "proposal", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "globalProposalHash", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expiryTimestamp", - "type": "uint256" - }, - { - "internalType": "enum GlobalProposal.TargetOption[]", - "name": "targetOptions", - "type": "uint8[]" - }, - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - }, - { - "internalType": "bytes[]", - "name": "calldatas", - "type": "bytes[]" - }, - { - "internalType": "uint256[]", - "name": "gasAmounts", - "type": "uint256[]" - } - ], - "indexed": false, - "internalType": "struct GlobalProposal.GlobalProposalDetail", - "name": "globalProposal", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "address", - "name": "creator", - "type": "address" - } - ], - "name": "GlobalProposalCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes", - "name": "callData", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "registers", - "type": "address[]" - }, - { - "indexed": false, - "internalType": "bool[]", - "name": "statuses", - "type": "bool[]" - }, - { - "indexed": false, - "internalType": "bytes[]", - "name": "returnDatas", - "type": "bytes[]" - } - ], - "name": "Notified", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "proposalHash", - "type": "bytes32" - } - ], - "name": "ProposalApproved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "round", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "proposalHash", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expiryTimestamp", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "targets", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - }, - { - "internalType": "bytes[]", - "name": "calldatas", - "type": "bytes[]" - }, - { - "internalType": "uint256[]", - "name": "gasAmounts", - "type": "uint256[]" - } - ], - "indexed": false, - "internalType": "struct Proposal.ProposalDetail", - "name": "proposal", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "address", - "name": "creator", - "type": "address" - } - ], - "name": "ProposalCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "proposalHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bool[]", - "name": "successCalls", - "type": "bool[]" - }, - { - "indexed": false, - "internalType": "bytes[]", - "name": "returnDatas", - "type": "bytes[]" - } - ], - "name": "ProposalExecuted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "proposalHash", - "type": "bytes32" - } - ], - "name": "ProposalExpired", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "ProposalExpiryDurationChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "proposalHash", - "type": "bytes32" - } - ], - "name": "ProposalRejected", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "proposalHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "voter", - "type": "address" - }, - { - "indexed": false, - "internalType": "enum Ballot.VoteType", - "name": "support", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "weight", - "type": "uint256" - } - ], - "name": "ProposalVoted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "enum GlobalProposal.TargetOption", - "name": "targetOption", - "type": "uint8" - }, - { - "indexed": true, - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "TargetOptionUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "numerator", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "denominator", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "previousNumerator", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "previousDenominator", - "type": "uint256" - } - ], - "name": "ThresholdUpdated", - "type": "event" - }, - { - "inputs": [], - "name": "DOMAIN_SEPARATOR", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint96[]", - "name": "voteWeights", - "type": "uint96[]" - }, - { - "internalType": "address[]", - "name": "governors", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "bridgeOperators", - "type": "address[]" - } - ], - "name": "addBridgeOperators", - "outputs": [ - { - "internalType": "bool[]", - "name": "addeds", - "type": "bool[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expiryTimestamp", - "type": "uint256" - }, - { - "internalType": "enum GlobalProposal.TargetOption[]", - "name": "targetOptions", - "type": "uint8[]" - }, - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - }, - { - "internalType": "bytes[]", - "name": "calldatas", - "type": "bytes[]" - }, - { - "internalType": "uint256[]", - "name": "gasAmounts", - "type": "uint256[]" - } - ], - "internalType": "struct GlobalProposal.GlobalProposalDetail", - "name": "globalProposal", - "type": "tuple" - }, - { - "internalType": "enum Ballot.VoteType[]", - "name": "supports_", - "type": "uint8[]" - }, - { - "components": [ - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "internalType": "struct SignatureConsumer.Signature[]", - "name": "signatures", - "type": "tuple[]" - } - ], - "name": "castGlobalProposalBySignatures", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expiryTimestamp", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "targets", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - }, - { - "internalType": "bytes[]", - "name": "calldatas", - "type": "bytes[]" - }, - { - "internalType": "uint256[]", - "name": "gasAmounts", - "type": "uint256[]" - } - ], - "internalType": "struct Proposal.ProposalDetail", - "name": "proposal", - "type": "tuple" - }, - { - "internalType": "enum Ballot.VoteType[]", - "name": "supports_", - "type": "uint8[]" - }, - { - "components": [ - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "internalType": "struct SignatureConsumer.Signature[]", - "name": "signatures", - "type": "tuple[]" - } - ], - "name": "castProposalBySignatures", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expiryTimestamp", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "targets", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - }, - { - "internalType": "bytes[]", - "name": "calldatas", - "type": "bytes[]" - }, - { - "internalType": "uint256[]", - "name": "gasAmounts", - "type": "uint256[]" - } - ], - "internalType": "struct Proposal.ProposalDetail", - "name": "proposal", - "type": "tuple" - }, - { - "internalType": "enum Ballot.VoteType", - "name": "support", - "type": "uint8" - } - ], - "name": "castProposalVoteForCurrentNetwork", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_voteWeight", - "type": "uint256" - } - ], - "name": "checkThreshold", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_chainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_round", - "type": "uint256" - } - ], - "name": "deleteExpired", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "governors", - "type": "address[]" - } - ], - "name": "getBridgeOperatorOf", - "outputs": [ - { - "internalType": "address[]", - "name": "bridgeOperators", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "bridgeOperator", - "type": "address" - } - ], - "name": "getBridgeOperatorWeight", - "outputs": [ - { - "internalType": "uint256", - "name": "weight", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getBridgeOperators", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCallbackRegisters", - "outputs": [ - { - "internalType": "address[]", - "name": "registers", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "enum ContractType", - "name": "contractType", - "type": "uint8" - } - ], - "name": "getContract", - "outputs": [ - { - "internalType": "address", - "name": "contract_", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getFullBridgeOperatorInfos", - "outputs": [ - { - "internalType": "address[]", - "name": "governors", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "bridgeOperators", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "weights", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "round_", - "type": "uint256" - } - ], - "name": "getGlobalProposalSignatures", - "outputs": [ - { - "internalType": "address[]", - "name": "voters", - "type": "address[]" - }, - { - "internalType": "enum Ballot.VoteType[]", - "name": "supports_", - "type": "uint8[]" - }, - { - "components": [ - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "internalType": "struct SignatureConsumer.Signature[]", - "name": "signatures", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "governor", - "type": "address" - } - ], - "name": "getGovernorWeight", - "outputs": [ - { - "internalType": "uint256", - "name": "weight", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "governors", - "type": "address[]" - } - ], - "name": "getGovernorWeights", - "outputs": [ - { - "internalType": "uint256[]", - "name": "weights", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getGovernors", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "bridgeOperators", - "type": "address[]" - } - ], - "name": "getGovernorsOf", - "outputs": [ - { - "internalType": "address[]", - "name": "governors", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getProposalExpiryDuration", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_chainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_round", - "type": "uint256" - } - ], - "name": "getProposalSignatures", - "outputs": [ - { - "internalType": "address[]", - "name": "_voters", - "type": "address[]" - }, - { - "internalType": "enum Ballot.VoteType[]", - "name": "_supports", - "type": "uint8[]" - }, - { - "components": [ - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "internalType": "struct SignatureConsumer.Signature[]", - "name": "_signatures", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getThreshold", - "outputs": [ - { - "internalType": "uint256", - "name": "num_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "denom_", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getTotalWeights", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "round_", - "type": "uint256" - }, - { - "internalType": "address", - "name": "voter", - "type": "address" - } - ], - "name": "globalProposalVoted", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "isBridgeOperator", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "minimumVoteWeight", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_chainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_round", - "type": "uint256" - }, - { - "internalType": "address", - "name": "_voter", - "type": "address" - } - ], - "name": "proposalVoted", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_chainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_expiryTimestamp", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "_targets", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "_values", - "type": "uint256[]" - }, - { - "internalType": "bytes[]", - "name": "_calldatas", - "type": "bytes[]" - }, - { - "internalType": "uint256[]", - "name": "_gasAmounts", - "type": "uint256[]" - } - ], - "name": "propose", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expiryTimestamp", - "type": "uint256" - }, - { - "internalType": "enum GlobalProposal.TargetOption[]", - "name": "targetOptions", - "type": "uint8[]" - }, - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - }, - { - "internalType": "bytes[]", - "name": "calldatas", - "type": "bytes[]" - }, - { - "internalType": "uint256[]", - "name": "gasAmounts", - "type": "uint256[]" - } - ], - "name": "proposeGlobal", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expiryTimestamp", - "type": "uint256" - }, - { - "internalType": "enum GlobalProposal.TargetOption[]", - "name": "targetOptions", - "type": "uint8[]" - }, - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - }, - { - "internalType": "bytes[]", - "name": "calldatas", - "type": "bytes[]" - }, - { - "internalType": "uint256[]", - "name": "gasAmounts", - "type": "uint256[]" - } - ], - "internalType": "struct GlobalProposal.GlobalProposalDetail", - "name": "globalProposal", - "type": "tuple" - }, - { - "internalType": "enum Ballot.VoteType[]", - "name": "supports_", - "type": "uint8[]" - }, - { - "components": [ - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "internalType": "struct SignatureConsumer.Signature[]", - "name": "signatures", - "type": "tuple[]" - } - ], - "name": "proposeGlobalProposalStructAndCastVotes", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expiryTimestamp", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "targets", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - }, - { - "internalType": "bytes[]", - "name": "calldatas", - "type": "bytes[]" - }, - { - "internalType": "uint256[]", - "name": "gasAmounts", - "type": "uint256[]" - }, - { - "internalType": "enum Ballot.VoteType", - "name": "support", - "type": "uint8" - } - ], - "name": "proposeProposalForCurrentNetwork", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expiryTimestamp", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "targets", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - }, - { - "internalType": "bytes[]", - "name": "calldatas", - "type": "bytes[]" - }, - { - "internalType": "uint256[]", - "name": "gasAmounts", - "type": "uint256[]" - } - ], - "internalType": "struct Proposal.ProposalDetail", - "name": "_proposal", - "type": "tuple" - }, - { - "internalType": "enum Ballot.VoteType[]", - "name": "_supports", - "type": "uint8[]" - }, - { - "components": [ - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "internalType": "struct SignatureConsumer.Signature[]", - "name": "_signatures", - "type": "tuple[]" + "name": "_data", + "type": "bytes", + "internalType": "bytes" } ], - "name": "proposeProposalStructAndCastVotes", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "registers", - "type": "address[]" - } - ], - "name": "registerCallbacks", - "outputs": [ - { - "internalType": "bool[]", - "name": "registereds", - "type": "bool[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "payable" }, { - "inputs": [ - { - "internalType": "address[]", - "name": "bridgeOperators", - "type": "address[]" - } - ], - "name": "removeBridgeOperators", - "outputs": [ - { - "internalType": "bool[]", - "name": "removeds", - "type": "bool[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" + "type": "fallback", + "stateMutability": "payable" }, { - "inputs": [ - { - "internalType": "enum GlobalProposal.TargetOption[]", - "name": "targetOptions", - "type": "uint8[]" - } - ], - "name": "resolveTargets", - "outputs": [ - { - "internalType": "address[]", - "name": "targets", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" + "type": "receive", + "stateMutability": "payable" }, { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "round", + "type": "function", + "name": "admin", + "inputs": [], "outputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "admin_", + "type": "address", + "internalType": "address" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "changeAdmin", "inputs": [ { - "internalType": "enum ContractType", - "name": "contractType", - "type": "uint8" - }, - { - "internalType": "address", - "name": "addr", - "type": "address" + "name": "newAdmin", + "type": "address", + "internalType": "address" } ], - "name": "setContract", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "numerator", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "denominator", - "type": "uint256" - } - ], - "name": "setThreshold", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "functionDelegateCall", "inputs": [ { - "internalType": "address[]", - "name": "governors", - "type": "address[]" + "name": "_data", + "type": "bytes", + "internalType": "bytes" } ], - "name": "sumGovernorsWeight", - "outputs": [ - { - "internalType": "uint256", - "name": "sum", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" + "outputs": [], + "stateMutability": "payable" }, { + "type": "function", + "name": "implementation", "inputs": [], - "name": "totalBridgeOperators", "outputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "implementation_", + "type": "address", + "internalType": "address" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "upgradeTo", "inputs": [ { - "internalType": "address[]", - "name": "registers", - "type": "address[]" - } - ], - "name": "unregisterCallbacks", - "outputs": [ - { - "internalType": "bool[]", - "name": "unregistereds", - "type": "bool[]" + "name": "newImplementation", + "type": "address", + "internalType": "address" } ], - "stateMutability": "nonpayable", - "type": "function" + "outputs": [], + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "upgradeToAndCall", "inputs": [ { - "internalType": "address", - "name": "newBridgeOperator", - "type": "address" + "name": "newImplementation", + "type": "address", + "internalType": "address" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" } ], - "name": "updateBridgeOperator", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "payable" }, { + "type": "event", + "name": "AdminChanged", "inputs": [ { - "internalType": "enum GlobalProposal.TargetOption[]", - "name": "targetOptions", - "type": "uint8[]" + "name": "previousAdmin", + "type": "address", + "indexed": false, + "internalType": "address" }, { - "internalType": "address[]", - "name": "targets", - "type": "address[]" + "name": "newAdmin", + "type": "address", + "indexed": false, + "internalType": "address" } ], - "name": "updateManyTargetOption", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "anonymous": false }, { + "type": "event", + "name": "BeaconUpgraded", "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "beacon", + "type": "address", + "indexed": true, + "internalType": "address" } ], - "name": "vote", - "outputs": [ - { - "internalType": "enum VoteStatusConsumer.VoteStatus", - "name": "status", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "hash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "againstVoteWeight", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "forVoteWeight", - "type": "uint256" - }, + "anonymous": false + }, + { + "type": "event", + "name": "Upgraded", + "inputs": [ { - "internalType": "uint256", - "name": "expiryTimestamp", - "type": "uint256" + "name": "implementation", + "type": "address", + "indexed": true, + "internalType": "address" } ], - "stateMutability": "view", - "type": "function" + "anonymous": false } ], - "transactionHash": "0xf62fde282ce6c4bb8ff81c023408201fe1ee22f8712a40ff46df694b9a6851d3", - "receipt": { - "to": null, - "from": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", - "contractAddress": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", - "transactionIndex": 0, - "gasUsed": "6316780", - "logsBloom": "0x04020000000001000000000000000000040080000000200000100000000000000000500000000000008000000000000000004000021000010080000000240000010000000000800000000000000000000000000000040000000000000000000000000000420000040000000000000840000000000000000000000000000000000000000000000000000000000000104000000000000000000000000400000000000000000000000000000100000000000000000008800000000008000000400000004000000000000800000000000000000100800000001000000000000060000018020000000000000000000000000000000000008000000000000000001000", - "blockHash": "0x8a4a4259eab93c37e92553549a3485ac1d979aff404867da891e87c764cb59d2", - "transactionHash": "0xf62fde282ce6c4bb8ff81c023408201fe1ee22f8712a40ff46df694b9a6851d3", - "logs": [ - { - "transactionIndex": 0, - "blockNumber": 19062129, - "transactionHash": "0xf62fde282ce6c4bb8ff81c023408201fe1ee22f8712a40ff46df694b9a6851d3", - "address": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", - "topics": [ - "0x865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c59", - "0x0000000000000000000000000000000000000000000000000000000000000002", - "0x000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca" - ], - "data": "0x", - "logIndex": 0, - "blockHash": "0x8a4a4259eab93c37e92553549a3485ac1d979aff404867da891e87c764cb59d2" - }, - { - "transactionIndex": 0, - "blockNumber": 19062129, - "transactionHash": "0xf62fde282ce6c4bb8ff81c023408201fe1ee22f8712a40ff46df694b9a6851d3", - "address": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", - "topics": [ - "0xc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b63" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000240000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000001845ebae8a0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000040000000000000000000000002e82d2b56f858f79deef11b160bfc4631873da2b000000000000000000000000bcb61783dd2403fe8cc9b89b27b1a9bb03d040cb000000000000000000000000b266bf53cf7eac4e2065a404598dcb0e15e9462c000000000000000000000000cc5fc5b6c8595f56306da736f6cd02ed9141c84a000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000a408c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000425472616e73706172656e745570677261646561626c6550726f78793a2061646d696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267657400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "logIndex": 1, - "blockHash": "0x8a4a4259eab93c37e92553549a3485ac1d979aff404867da891e87c764cb59d2" - }, - { - "transactionIndex": 0, - "blockNumber": 19062129, - "transactionHash": "0xf62fde282ce6c4bb8ff81c023408201fe1ee22f8712a40ff46df694b9a6851d3", - "address": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", - "topics": [ - "0x897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b78" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000004000000000000000000000000d24d87ddc1917165435b306aac68d99e0f49a3fa000000000000000000000000b033ba62ec622dc54d0abfe0254e79692147ca26000000000000000000000000087d08e3ba42e64e3948962dd1371f906d1278b900000000000000000000000052ec2e6bbce45afff8955da6410bb13812f4289f00000000000000000000000000000000000000000000000000000000000000040000000000000000000000002e82d2b56f858f79deef11b160bfc4631873da2b000000000000000000000000bcb61783dd2403fe8cc9b89b27b1a9bb03d040cb000000000000000000000000b266bf53cf7eac4e2065a404598dcb0e15e9462c000000000000000000000000cc5fc5b6c8595f56306da736f6cd02ed9141c84a", - "logIndex": 2, - "blockHash": "0x8a4a4259eab93c37e92553549a3485ac1d979aff404867da891e87c764cb59d2" - }, - { - "transactionIndex": 0, - "blockNumber": 19062129, - "transactionHash": "0xf62fde282ce6c4bb8ff81c023408201fe1ee22f8712a40ff46df694b9a6851d3", - "address": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", - "topics": [ - "0xe5cd1c123a8cf63fa1b7229678db61fe8ae99dbbd27889370b6667c8cae97da1", - "0x0000000000000000000000000000000000000000000000000000000000127500" - ], - "data": "0x", - "logIndex": 3, - "blockHash": "0x8a4a4259eab93c37e92553549a3485ac1d979aff404867da891e87c764cb59d2" - }, - { - "transactionIndex": 0, - "blockNumber": 19062129, - "transactionHash": "0xf62fde282ce6c4bb8ff81c023408201fe1ee22f8712a40ff46df694b9a6851d3", - "address": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", - "topics": [ - "0x356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac5753" - ], - "data": "0x", - "logIndex": 4, - "blockHash": "0x8a4a4259eab93c37e92553549a3485ac1d979aff404867da891e87c764cb59d2" - }, - { - "transactionIndex": 0, - "blockNumber": 19062129, - "transactionHash": "0xf62fde282ce6c4bb8ff81c023408201fe1ee22f8712a40ff46df694b9a6851d3", - "address": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", - "topics": [ - "0x356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d", - "0x0000000000000000000000000000000000000000000000000000000000000001", - "0x000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca" - ], - "data": "0x", - "logIndex": 5, - "blockHash": "0x8a4a4259eab93c37e92553549a3485ac1d979aff404867da891e87c764cb59d2" - }, - { - "transactionIndex": 0, - "blockNumber": 19062129, - "transactionHash": "0xf62fde282ce6c4bb8ff81c023408201fe1ee22f8712a40ff46df694b9a6851d3", - "address": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", - "topics": [ - "0x356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d", - "0x0000000000000000000000000000000000000000000000000000000000000002", - "0x0000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d95" - ], - "data": "0x", - "logIndex": 6, - "blockHash": "0x8a4a4259eab93c37e92553549a3485ac1d979aff404867da891e87c764cb59d2" - }, - { - "transactionIndex": 0, - "blockNumber": 19062129, - "transactionHash": "0xf62fde282ce6c4bb8ff81c023408201fe1ee22f8712a40ff46df694b9a6851d3", - "address": "0xb0507f2f22697022eCb25963a00D3D076dAc5753", - "topics": [ - "0x356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d", - "0x0000000000000000000000000000000000000000000000000000000000000003", - "0x0000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb" - ], - "data": "0x", - "logIndex": 7, - "blockHash": "0x8a4a4259eab93c37e92553549a3485ac1d979aff404867da891e87c764cb59d2" - } - ], - "blockNumber": 19062129, - "cumulativeGasUsed": "6316780", - "status": 1, - "byzantium": true - }, - "args": [ - 70, - 100, - 2021, - 1209600, - "0xCee681C9108c42C710c6A8A949307D5F13C9F3ca", - [ - "0x7FC81d20f7D1f53D0eA094fcBdd1b531B71225EB" - ], - [ - "0x2e82D2b56f858f79DeeF11B160bFC4631873da2B", - "0xBcb61783dd2403FE8cC9B89B27B1A9Bb03d040Cb", - "0xB266Bf53Cf7EAc4E2065A404598DCB0E15E9462c", - "0xcc5fc5b6c8595f56306da736f6cd02ed9141c84a" - ], - [ - "0xd24D87DDc1917165435b306aAC68D99e0F49A3Fa", - "0xb033ba62EC622dC54D0ABFE0254e79692147CA26", - "0x087D08e3ba42e64E3948962dd1371F906D1278b9", - "0x52ec2e6BBcE45AfFF8955Da6410bb13812F4289F" - ], - [ - 100, - 100, - 100, - 100 - ], - [ - 1, - 2, - 3 - ], - [ - "0xCee681C9108c42C710c6A8A949307D5F13C9F3ca", - "0x6E19cF519b7B83F7CE719B6d30232485d9609D95", - "0x7FC81d20f7D1f53D0eA094fcBdd1b531B71225EB" - ] - ], - "numDeployments": 4, - "solcInputHash": "6c219cc499cc18168de5a543cc795d09", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"roninChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryDuration\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"bridgeContract\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"callbackRegisters\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"internalType\":\"uint96[]\",\"name\":\"voteWeights\",\"type\":\"uint96[]\"},{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"codehash\",\"type\":\"bytes32\"}],\"name\":\"ErrAddressIsNotCreatedEOA\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"ErrAlreadyVoted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeOperator\",\"type\":\"address\"}],\"name\":\"ErrBridgeOperatorAlreadyExisted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeOperator\",\"type\":\"address\"}],\"name\":\"ErrBridgeOperatorUpdateFailed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"ErrContractTypeNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrCurrentProposalIsNotCompleted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrDuplicated\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ErrInsufficientGas\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidArguments\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"}],\"name\":\"ErrInvalidChainId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidExpiryTimestamp\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidOrder\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"}],\"name\":\"ErrInvalidProposal\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidProposalNonce\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidSignatures\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidThreshold\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidVoteWeight\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrLengthMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrOnlySelfCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrQueryForEmptyVote\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum RoleAccess\",\"name\":\"expectedRole\",\"type\":\"uint8\"}],\"name\":\"ErrUnauthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrUnsupportedInterface\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrUnsupportedVoteType\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrVoteIsFinalized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrZeroAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrZeroCodeContract\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fromBridgeOperator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"toBridgeOperator\",\"type\":\"address\"}],\"name\":\"BridgeOperatorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"statuses\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"uint96[]\",\"name\":\"voteWeights\",\"type\":\"uint96[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"BridgeOperatorsAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"statuses\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"BridgeOperatorsRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ContractUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"round\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"indexed\":false,\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"globalProposalHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"indexed\":false,\"internalType\":\"struct GlobalProposal.GlobalProposalDetail\",\"name\":\"globalProposal\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"}],\"name\":\"GlobalProposalCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"statuses\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"returnDatas\",\"type\":\"bytes[]\"}],\"name\":\"Notified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ProposalApproved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"round\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"indexed\":false,\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"}],\"name\":\"ProposalCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"successCalls\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"returnDatas\",\"type\":\"bytes[]\"}],\"name\":\"ProposalExecuted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ProposalExpired\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"ProposalExpiryDurationChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ProposalRejected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"enum Ballot.VoteType\",\"name\":\"support\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\"}],\"name\":\"ProposalVoted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum GlobalProposal.TargetOption\",\"name\":\"targetOption\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"TargetOptionUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"numerator\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"denominator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousNumerator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousDenominator\",\"type\":\"uint256\"}],\"name\":\"ThresholdUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96[]\",\"name\":\"voteWeights\",\"type\":\"uint96[]\"},{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"addBridgeOperators\",\"outputs\":[{\"internalType\":\"bool[]\",\"name\":\"addeds\",\"type\":\"bool[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"internalType\":\"struct GlobalProposal.GlobalProposalDetail\",\"name\":\"globalProposal\",\"type\":\"tuple\"},{\"internalType\":\"enum Ballot.VoteType[]\",\"name\":\"supports_\",\"type\":\"uint8[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"signatures\",\"type\":\"tuple[]\"}],\"name\":\"castGlobalProposalBySignatures\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"internalType\":\"enum Ballot.VoteType[]\",\"name\":\"supports_\",\"type\":\"uint8[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"signatures\",\"type\":\"tuple[]\"}],\"name\":\"castProposalBySignatures\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"internalType\":\"enum Ballot.VoteType\",\"name\":\"support\",\"type\":\"uint8\"}],\"name\":\"castProposalVoteForCurrentNetwork\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_voteWeight\",\"type\":\"uint256\"}],\"name\":\"checkThreshold\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"deleteExpired\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"}],\"name\":\"getBridgeOperatorOf\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeOperator\",\"type\":\"address\"}],\"name\":\"getBridgeOperatorWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBridgeOperators\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCallbackRegisters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"getContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"contract_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFullBridgeOperatorInfos\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"weights\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"round_\",\"type\":\"uint256\"}],\"name\":\"getGlobalProposalSignatures\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"voters\",\"type\":\"address[]\"},{\"internalType\":\"enum Ballot.VoteType[]\",\"name\":\"supports_\",\"type\":\"uint8[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"signatures\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"}],\"name\":\"getGovernorWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"}],\"name\":\"getGovernorWeights\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"weights\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGovernors\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"getGovernorsOf\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getProposalExpiryDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"getProposalSignatures\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"_voters\",\"type\":\"address[]\"},{\"internalType\":\"enum Ballot.VoteType[]\",\"name\":\"_supports\",\"type\":\"uint8[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"_signatures\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"num_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalWeights\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"round_\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"globalProposalVoted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isBridgeOperator\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minimumVoteWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_voter\",\"type\":\"address\"}],\"name\":\"proposalVoted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"_targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"_calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_gasAmounts\",\"type\":\"uint256[]\"}],\"name\":\"propose\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"name\":\"proposeGlobal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"internalType\":\"struct GlobalProposal.GlobalProposalDetail\",\"name\":\"globalProposal\",\"type\":\"tuple\"},{\"internalType\":\"enum Ballot.VoteType[]\",\"name\":\"supports_\",\"type\":\"uint8[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"signatures\",\"type\":\"tuple[]\"}],\"name\":\"proposeGlobalProposalStructAndCastVotes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"},{\"internalType\":\"enum Ballot.VoteType\",\"name\":\"support\",\"type\":\"uint8\"}],\"name\":\"proposeProposalForCurrentNetwork\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"_proposal\",\"type\":\"tuple\"},{\"internalType\":\"enum Ballot.VoteType[]\",\"name\":\"_supports\",\"type\":\"uint8[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"_signatures\",\"type\":\"tuple[]\"}],\"name\":\"proposeProposalStructAndCastVotes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"}],\"name\":\"registerCallbacks\",\"outputs\":[{\"internalType\":\"bool[]\",\"name\":\"registereds\",\"type\":\"bool[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"removeBridgeOperators\",\"outputs\":[{\"internalType\":\"bool[]\",\"name\":\"removeds\",\"type\":\"bool[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"}],\"name\":\"resolveTargets\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"round\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denominator\",\"type\":\"uint256\"}],\"name\":\"setThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"}],\"name\":\"sumGovernorsWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"sum\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalBridgeOperators\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"}],\"name\":\"unregisterCallbacks\",\"outputs\":[{\"internalType\":\"bool[]\",\"name\":\"unregistereds\",\"type\":\"bool[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newBridgeOperator\",\"type\":\"address\"}],\"name\":\"updateBridgeOperator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"}],\"name\":\"updateManyTargetOption\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"vote\",\"outputs\":[{\"internalType\":\"enum VoteStatusConsumer.VoteStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"againstVoteWeight\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"forVoteWeight\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"ErrAddressIsNotCreatedEOA(address,bytes32)\":[{\"details\":\"Error thrown when an address is expected to be an already created externally owned account (EOA). This error indicates that the provided address is invalid for certain contract operations that require already created EOA.\"}],\"ErrAlreadyVoted(address)\":[{\"details\":\"Error indicating that a voter has already voted.\",\"params\":{\"voter\":\"The address of the voter who has already voted.\"}}],\"ErrBridgeOperatorAlreadyExisted(address)\":[{\"details\":\"Error thrown when attempting to add a bridge operator that already exists in the contract. This error indicates that the provided bridge operator address is already registered as a bridge operator in the contract.\"}],\"ErrBridgeOperatorUpdateFailed(address)\":[{\"details\":\"Error raised when a bridge operator update operation fails.\",\"params\":{\"bridgeOperator\":\"The address of the bridge operator that failed to update.\"}}],\"ErrContractTypeNotFound(uint8)\":[{\"details\":\"Error of invalid role.\"}],\"ErrCurrentProposalIsNotCompleted()\":[{\"details\":\"Error thrown when the current proposal is not completed.\"}],\"ErrDuplicated(bytes4)\":[{\"details\":\"Error thrown when a duplicated element is detected in an array.\",\"params\":{\"msgSig\":\"The function signature that invoke the error.\"}}],\"ErrInsufficientGas(bytes32)\":[{\"details\":\"Error thrown when there is insufficient gas to execute a function.\"}],\"ErrInvalidArguments(bytes4)\":[{\"details\":\"Error indicating that arguments are invalid.\"}],\"ErrInvalidChainId(bytes4,uint256,uint256)\":[{\"details\":\"Error indicating that the chain ID is invalid.\",\"params\":{\"actual\":\"Current chain ID that executing function.\",\"expected\":\"Expected chain ID required for the tx to success.\",\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid chain ID.\"}}],\"ErrInvalidExpiryTimestamp()\":[{\"details\":\"Error thrown when an invalid expiry timestamp is provided.\"}],\"ErrInvalidOrder(bytes4)\":[{\"details\":\"Error indicating that an order is invalid.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid order.\"}}],\"ErrInvalidProposal(bytes32,bytes32)\":[{\"details\":\"Error thrown when an invalid proposal is encountered.\",\"params\":{\"actual\":\"The actual value of the proposal.\",\"expected\":\"The expected value of the proposal.\"}}],\"ErrInvalidProposalNonce(bytes4)\":[{\"details\":\"Error indicating that the proposal nonce is invalid.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid proposal nonce.\"}}],\"ErrInvalidSignatures(bytes4)\":[{\"details\":\"Error indicating that a signature is invalid for a specific function signature.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that encountered an invalid signature.\"}}],\"ErrInvalidThreshold(bytes4)\":[{\"details\":\"Error indicating that the provided threshold is invalid for a specific function signature.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that the invalid threshold applies to.\"}}],\"ErrInvalidVoteWeight(bytes4)\":[{\"details\":\"Error indicating that a vote weight is invalid for a specific function signature.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that encountered an invalid vote weight.\"}}],\"ErrLengthMismatch(bytes4)\":[{\"details\":\"Error indicating a mismatch in the length of input parameters or arrays for a specific function.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that has a length mismatch.\"}}],\"ErrOnlySelfCall(bytes4)\":[{\"details\":\"Error indicating that a function can only be called by the contract itself.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that can only be called by the contract itself.\"}}],\"ErrQueryForEmptyVote()\":[{\"details\":\"Error thrown when querying for an empty vote.\"}],\"ErrUnauthorized(bytes4,uint8)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"expectedRole\":\"The role required to perform the function.\",\"msgSig\":\"The function signature (bytes4) that the caller is unauthorized to perform.\"}}],\"ErrUnsupportedInterface(bytes4,address)\":[{\"details\":\"The error indicating an unsupported interface.\",\"params\":{\"addr\":\"The address where the unsupported interface was encountered.\",\"interfaceId\":\"The bytes4 interface identifier that is not supported.\"}}],\"ErrUnsupportedVoteType(bytes4)\":[{\"details\":\"Error indicating that a vote type is not supported.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the operation that encountered an unsupported vote type.\"}}],\"ErrVoteIsFinalized()\":[{\"details\":\"Error thrown when attempting to interact with a finalized vote.\"}],\"ErrZeroAddress(bytes4)\":[{\"details\":\"Error indicating that given address is null when it should not.\"}],\"ErrZeroCodeContract(address)\":[{\"details\":\"Error of set to non-contract.\"}]},\"kind\":\"dev\",\"methods\":{\"addBridgeOperators(uint96[],address[],address[])\":{\"details\":\"Adds multiple bridge operators.\",\"params\":{\"bridgeOperators\":\"An array of addresses representing the bridge operators to add.\",\"governors\":\"An array of addresses of hot/cold wallets for bridge operator to update their node address.\"},\"returns\":{\"addeds\":\"An array of booleans indicating whether each bridge operator was added successfully. Note: return boolean array `addeds` indicates whether a group (voteWeight, governor, operator) are recorded. It is expected that FE/BE staticcall to the function first to get the return values and handle it correctly. Governors are expected to see the outcome of this function and decide if they want to vote for the proposal or not. Example Usage: Making an `eth_call` in ethers.js ``` const {addeds} = await bridgeManagerContract.callStatic.addBridgeOperators( voteWeights, governors, bridgeOperators, // overriding the caller to the contract itself since we use `onlySelfCall` guard {from: bridgeManagerContract.address} ) const filteredOperators = bridgeOperators.filter((_, index) => addeds[index]); const filteredWeights = weights.filter((_, index) => addeds[index]); const filteredGovernors = governors.filter((_, index) => addeds[index]); // ... (Process or use the information as required) ... ```\"}},\"castGlobalProposalBySignatures((uint256,uint256,uint8[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])\":{\"details\":\"See `GovernanceProposal-_castGlobalProposalBySignatures`.\"},\"castProposalBySignatures((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])\":{\"details\":\"See `GovernanceProposal-_castProposalBySignatures`.\"},\"castProposalVoteForCurrentNetwork((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8)\":{\"details\":\"Casts vote for a proposal on the current network. Requirements: - The method caller is governor.\"},\"checkThreshold(uint256)\":{\"details\":\"Checks whether the `_voteWeight` passes the threshold.\"},\"deleteExpired(uint256,uint256)\":{\"details\":\"Deletes the expired proposal by its chainId and nonce, without creating a new proposal. Requirements: - The proposal is already created.\"},\"getBridgeOperatorOf(address[])\":{\"details\":\"Returns an array of bridge operators correspoding to governor addresses.\",\"returns\":{\"bridgeOperators\":\"An array containing the addresses of all bridge operators.\"}},\"getBridgeOperatorWeight(address)\":{\"details\":\"External function to retrieve the vote weight of a specific bridge operator.\",\"params\":{\"bridgeOperator\":\"The address of the bridge operator to get the vote weight for.\"},\"returns\":{\"weight\":\"The vote weight of the specified bridge operator.\"}},\"getBridgeOperators()\":{\"details\":\"Returns an array of all bridge operators.\",\"returns\":{\"_0\":\"An array containing the addresses of all bridge operators.\"}},\"getCallbackRegisters()\":{\"details\":\"Retrieves the addresses of registered callbacks.\",\"returns\":{\"registers\":\"An array containing the addresses of registered callbacks.\"}},\"getContract(uint8)\":{\"details\":\"Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.\",\"params\":{\"contractType\":\"The role of the contract to retrieve.\"},\"returns\":{\"contract_\":\"The address of the contract with the specified role.\"}},\"getFullBridgeOperatorInfos()\":{\"details\":\"Retrieves the full information of all registered bridge operators. This external function allows external callers to obtain the full information of all the registered bridge operators. The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.\",\"returns\":{\"bridgeOperators\":\"An array of addresses representing the registered bridge operators.\",\"governors\":\"An array of addresses representing the governors of each bridge operator.\",\"weights\":\"An array of uint256 values representing the vote weights of each bridge operator. Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator. Example Usage: ``` (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos(); for (uint256 i = 0; i < bridgeOperators.length; i++) { // Access individual information for each bridge operator. address governor = governors[i]; address bridgeOperator = bridgeOperators[i]; uint256 weight = weights[i]; // ... (Process or use the information as required) ... } ```\"}},\"getGlobalProposalSignatures(uint256)\":{\"details\":\"See {CommonGovernanceProposal-_getProposalSignatures}\"},\"getGovernorWeight(address)\":{\"details\":\"External function to retrieve the vote weight of a specific governor.\",\"params\":{\"governor\":\"The address of the governor to get the vote weight for.\"},\"returns\":{\"weight\":\"voteWeight The vote weight of the specified governor.\"}},\"getGovernorWeights(address[])\":{\"details\":\"Returns the weights of a list of governor addresses.\"},\"getGovernors()\":{\"details\":\"Returns an array of all governors.\",\"returns\":{\"_0\":\"An array containing the addresses of all governors.\"}},\"getGovernorsOf(address[])\":{\"details\":\"Retrieves the governors corresponding to a given array of bridge operators. This external function allows external callers to obtain the governors associated with a given array of bridge operators. The function takes an input array `bridgeOperators` containing bridge operator addresses and returns an array of corresponding governors.\",\"params\":{\"bridgeOperators\":\"An array of bridge operator addresses for which governors are to be retrieved.\"},\"returns\":{\"governors\":\"An array of addresses representing the governors corresponding to the provided bridge operators.\"}},\"getProposalExpiryDuration()\":{\"details\":\"Returns the expiry duration for a new proposal.\"},\"getProposalSignatures(uint256,uint256)\":{\"details\":\"See {CommonGovernanceProposal-_getProposalSignatures}\"},\"getThreshold()\":{\"details\":\"Returns the threshold.\"},\"getTotalWeights()\":{\"details\":\"Returns total weights.\"},\"globalProposalVoted(uint256,address)\":{\"details\":\"See {CommonGovernanceProposal-_proposalVoted}\"},\"isBridgeOperator(address)\":{\"details\":\"Checks if the given address is a bridge operator.\",\"params\":{\"addr\":\"The address to check.\"},\"returns\":{\"_0\":\"A boolean indicating whether the address is a bridge operator.\"}},\"minimumVoteWeight()\":{\"details\":\"Returns the minimum vote weight to pass the threshold.\"},\"proposalVoted(uint256,uint256,address)\":{\"details\":\"See {CommonGovernanceProposal-_proposalVoted}\"},\"propose(uint256,uint256,address[],uint256[],bytes[],uint256[])\":{\"details\":\"See `CoreGovernance-_proposeProposal`. Requirements: - The method caller is governor.\"},\"proposeGlobal(uint256,uint8[],uint256[],bytes[],uint256[])\":{\"details\":\"See `CoreGovernance-_proposeGlobal`. Requirements: - The method caller is governor.\"},\"proposeGlobalProposalStructAndCastVotes((uint256,uint256,uint8[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])\":{\"details\":\"See `GovernanceProposal-_proposeGlobalProposalStructAndCastVotes`. Requirements: - The method caller is governor.\"},\"proposeProposalForCurrentNetwork(uint256,address[],uint256[],bytes[],uint256[],uint8)\":{\"details\":\"Proposes and casts vote for a proposal on the current network. Requirements: - The method caller is governor. - The proposal is for the current network.\"},\"proposeProposalStructAndCastVotes((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])\":{\"details\":\"See `GovernanceProposal-_proposeProposalStructAndCastVotes`. Requirements: - The method caller is governor. - The proposal is for the current network.\"},\"registerCallbacks(address[])\":{\"details\":\"Registers multiple callbacks with the bridge.\",\"params\":{\"registers\":\"The array of callback addresses to register.\"},\"returns\":{\"registereds\":\"An array indicating the success status of each registration.\"}},\"removeBridgeOperators(address[])\":{\"details\":\"Removes multiple bridge operators.\",\"params\":{\"bridgeOperators\":\"An array of addresses representing the bridge operators to remove.\"},\"returns\":{\"removeds\":\"An array of booleans indicating whether each bridge operator was removed successfully. * Note: return boolean array `removeds` indicates whether a group (voteWeight, governor, operator) are recorded. It is expected that FE/BE staticcall to the function first to get the return values and handle it correctly. Governors are expected to see the outcome of this function and decide if they want to vote for the proposal or not. Example Usage: Making an `eth_call` in ethers.js ``` const {removeds} = await bridgeManagerContract.callStatic.removeBridgeOperators( bridgeOperators, // overriding the caller to the contract itself since we use `onlySelfCall` guard {from: bridgeManagerContract.address} ) const filteredOperators = bridgeOperators.filter((_, index) => removeds[index]); // ... (Process or use the information as required) ... ```\"}},\"resolveTargets(uint8[])\":{\"details\":\"Returns corresponding address of target options. Return address(0) on non-existent target.\"},\"setContract(uint8,address)\":{\"details\":\"Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.\",\"params\":{\"addr\":\"The address of the contract to set.\",\"contractType\":\"The role of the contract to set.\"}},\"setThreshold(uint256,uint256)\":{\"details\":\"Sets the threshold. Requirements: - The method caller is admin. Emits the `ThresholdUpdated` event.\"},\"sumGovernorsWeight(address[])\":{\"details\":\"Returns total weights of the governor list.\"},\"totalBridgeOperators()\":{\"details\":\"Returns the total number of bridge operators.\",\"returns\":{\"_0\":\"The total number of bridge operators.\"}},\"unregisterCallbacks(address[])\":{\"details\":\"Unregisters multiple callbacks from the bridge.\",\"params\":{\"registers\":\"The array of callback addresses to unregister.\"},\"returns\":{\"unregistereds\":\"An array indicating the success status of each unregistration.\"}},\"updateBridgeOperator(address)\":{\"details\":\"Governor updates their corresponding governor and/or operator address. Requirements: - The caller must the governor of the operator that is requested changes.\",\"params\":{\"bridgeOperator\":\"The address of the bridge operator to update.\"}},\"updateManyTargetOption(uint8[],address[])\":{\"details\":\"Updates list of `targetOptions` to `targets`. Requirement: - Only allow self-call through proposal. \"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"round(uint256)\":{\"notice\":\"chain id = 0 for global proposal\"},\"updateBridgeOperator(address)\":{\"notice\":\"This method checks authorization by querying the corresponding operator of the msg.sender and then attempts to remove it from the `_bridgeOperatorSet` for gas optimization. In case we allow a governor can leave their operator address blank null `address(0)`, consider add authorization check.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/ronin/gateway/RoninBridgeManager.sol\":\"RoninBridgeManager\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"none\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0xa6a787e7a901af6511e19aa53e1a00352db215a011d2c7a438d0582dd5da76f9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _HEX_SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n // Inspired by OraclizeAPI's implementation - MIT licence\\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\\n\\n if (value == 0) {\\n return \\\"0\\\";\\n }\\n uint256 temp = value;\\n uint256 digits;\\n while (temp != 0) {\\n digits++;\\n temp /= 10;\\n }\\n bytes memory buffer = new bytes(digits);\\n while (value != 0) {\\n digits -= 1;\\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\\n value /= 10;\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n if (value == 0) {\\n return \\\"0x00\\\";\\n }\\n uint256 temp = value;\\n uint256 length = 0;\\n while (temp != 0) {\\n length++;\\n temp >>= 8;\\n }\\n return toHexString(value, length);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xaf159a8b1923ad2a26d516089bceca9bdeaeacd04be50983ea00ba63070f08a3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.3) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSA {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n } else if (error == RecoverError.InvalidSignatureV) {\\n revert(\\\"ECDSA: invalid signature 'v' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n if (v != 27 && v != 28) {\\n return (address(0), RecoverError.InvalidSignatureV);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", Strings.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0xdb7f5c28fc61cda0bd8ab60ce288e206b791643bcd3ba464a70cbec18895a2f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n *\\n * [WARNING]\\n * ====\\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.\\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\\n *\\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.\\n * ====\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n bytes32 lastValue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastValue;\\n // Update the index for the moved value\\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n return set._values[index];\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function _values(Set storage set) private view returns (bytes32[] memory) {\\n return set._values;\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\\n return _values(set._inner);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(AddressSet storage set) internal view returns (address[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n address[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(UintSet storage set) internal view returns (uint256[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n uint256[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0x5050943b32b6a8f282573d166b2e9d87ab7eb4dbba4ab6acf36ecb54fe6995e4\",\"license\":\"MIT\"},\"contracts/extensions/TransparentUpgradeableProxyV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\\\";\\n\\ncontract TransparentUpgradeableProxyV2 is TransparentUpgradeableProxy {\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable TransparentUpgradeableProxy(_logic, admin_, _data) {}\\n\\n /**\\n * @dev Calls a function from the current implementation as specified by `_data`, which should be an encoded function call.\\n *\\n * Requirements:\\n * - Only the admin can call this function.\\n *\\n * Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid\\n * triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider\\n * reviewing the encoded data `_data` and the method which is called before using this.\\n *\\n */\\n function functionDelegateCall(bytes memory _data) public payable ifAdmin {\\n address _addr = _implementation();\\n assembly {\\n let _result := delegatecall(gas(), _addr, add(_data, 32), mload(_data), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n switch _result\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x6609392ea7d3174439b5715100bee82528fe6e4aff28927d48c27db8475e88c5\",\"license\":\"MIT\"},\"contracts/extensions/bridge-operator-governance/BridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IBridgeManagerCallback, EnumerableSet, BridgeManagerCallbackRegister } from \\\"./BridgeManagerCallbackRegister.sol\\\";\\nimport { IHasContracts, HasContracts } from \\\"../../extensions/collections/HasContracts.sol\\\";\\nimport { IQuorum } from \\\"../../interfaces/IQuorum.sol\\\";\\nimport { IBridgeManager } from \\\"../../interfaces/bridge/IBridgeManager.sol\\\";\\nimport { AddressArrayUtils } from \\\"../../libraries/AddressArrayUtils.sol\\\";\\nimport { ContractType } from \\\"../../utils/ContractType.sol\\\";\\nimport { RoleAccess } from \\\"../../utils/RoleAccess.sol\\\";\\nimport { TUint256Slot } from \\\"../../types/Types.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\n\\nabstract contract BridgeManager is IQuorum, IBridgeManager, BridgeManagerCallbackRegister, HasContracts {\\n using AddressArrayUtils for address[];\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeAdmin.governorToBridgeOperatorInfo.slot\\\") - 1\\n bytes32 private constant GOVERNOR_TO_BRIDGE_OPERATOR_INFO_SLOT =\\n 0x88547008e60f5748911f2e59feb3093b7e4c2e87b2dd69d61f112fcc932de8e3;\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeAdmin.govenorOf.slot\\\") - 1\\n bytes32 private constant GOVENOR_OF_SLOT = 0x8400683eb2cb350596d73644c0c89fe45f108600003457374f4ab3e87b4f3aa3;\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeAdmin.governors.slot\\\") - 1\\n bytes32 private constant GOVERNOR_SET_SLOT = 0x546f6b46ab35b030b6816596b352aef78857377176c8b24baa2046a62cf1998c;\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeAdmin.bridgeOperators.slot\\\") - 1\\n bytes32 private constant BRIDGE_OPERATOR_SET_SLOT =\\n 0xd38c234075fde25875da8a6b7e36b58b86681d483271a99eeeee1d78e258a24d;\\n\\n /**\\n * @dev The numerator value used for calculations in the contract.\\n * @notice value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeAdmin.numerator.slot\\\") - 1\\n */\\n TUint256Slot internal constant NUMERATOR_SLOT =\\n TUint256Slot.wrap(0xc55405a488814eaa0e2a685a0131142785b8d033d311c8c8244e34a7c12ca40f);\\n\\n /**\\n * @dev The denominator value used for calculations in the contract.\\n * @notice value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeAdmin.denominator.slot\\\") - 1\\n */\\n TUint256Slot internal constant DENOMINATOR_SLOT =\\n TUint256Slot.wrap(0xac1ff16a4f04f2a37a9ba5252a69baa100b460e517d1f8019c054a5ad698f9ff);\\n\\n /**\\n * @dev The nonce value used for tracking nonces in the contract.\\n * @notice value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeAdmin.nonce.slot\\\") - 1\\n */\\n TUint256Slot internal constant NONCE_SLOT =\\n TUint256Slot.wrap(0x92872d32822c9d44b36a2537d3e0d4c46fc4de1ce154ccfaed560a8a58445f1d);\\n\\n /**\\n * @dev The total weight value used for storing the cumulative weight in the contract.\\n * @notice value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeAdmin.totalWeights.slot\\\") - 1\\n */\\n TUint256Slot internal constant TOTAL_WEIGHTS_SLOT =\\n TUint256Slot.wrap(0x6924fe71b0c8b61aea02ca498b5f53b29bd95726278b1fe4eb791bb24a42644c);\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n bytes32 public immutable DOMAIN_SEPARATOR;\\n\\n modifier onlyGovernor() virtual {\\n _requireGovernor(msg.sender);\\n _;\\n }\\n\\n constructor(\\n uint256 num,\\n uint256 denom,\\n uint256 roninChainId,\\n address bridgeContract,\\n address[] memory callbackRegisters,\\n address[] memory bridgeOperators,\\n address[] memory governors,\\n uint96[] memory voteWeights\\n ) payable BridgeManagerCallbackRegister(callbackRegisters) {\\n NONCE_SLOT.store(1);\\n NUMERATOR_SLOT.store(num);\\n DENOMINATOR_SLOT.store(denom);\\n\\n _setContract(ContractType.BRIDGE, bridgeContract);\\n\\n DOMAIN_SEPARATOR = keccak256(\\n abi.encode(\\n keccak256(\\\"EIP712Domain(string name,string version,bytes32 salt)\\\"),\\n keccak256(\\\"BridgeAdmin\\\"), // name hash\\n keccak256(\\\"2\\\"), // version hash\\n keccak256(abi.encode(\\\"BRIDGE_ADMIN\\\", roninChainId)) // salt\\n )\\n );\\n\\n _addBridgeOperators(voteWeights, governors, bridgeOperators);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function addBridgeOperators(\\n uint96[] calldata voteWeights,\\n address[] calldata governors,\\n address[] calldata bridgeOperators\\n ) external onlySelfCall returns (bool[] memory addeds) {\\n addeds = _addBridgeOperators(voteWeights, governors, bridgeOperators);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function removeBridgeOperators(\\n address[] calldata bridgeOperators\\n ) external onlySelfCall returns (bool[] memory removeds) {\\n removeds = _removeBridgeOperators(bridgeOperators);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n * @notice This method checks authorization by querying the corresponding operator of the msg.sender and then\\n * attempts to remove it from the `_bridgeOperatorSet` for gas optimization. In case we allow a governor can leave\\n * their operator address blank null `address(0)`, consider add authorization check.\\n */\\n function updateBridgeOperator(address newBridgeOperator) external onlyGovernor {\\n _requireCreatedEOA(newBridgeOperator);\\n\\n // Queries the previous bridge operator\\n mapping(address => BridgeOperatorInfo) storage _gorvernorToBridgeOperatorInfo = _getGovernorToBridgeOperatorInfo();\\n address currentBridgeOperator = _gorvernorToBridgeOperatorInfo[msg.sender].addr;\\n if (currentBridgeOperator == newBridgeOperator) {\\n revert ErrBridgeOperatorAlreadyExisted(newBridgeOperator);\\n }\\n\\n // Tries replace the bridge operator\\n EnumerableSet.AddressSet storage _bridgeOperatorSet = _getBridgeOperatorSet();\\n bool updated = _bridgeOperatorSet.remove(currentBridgeOperator) && _bridgeOperatorSet.add(newBridgeOperator);\\n if (!updated) revert ErrBridgeOperatorUpdateFailed(newBridgeOperator);\\n\\n mapping(address => address) storage _governorOf = _getGovernorOf();\\n delete _governorOf[currentBridgeOperator];\\n _governorOf[newBridgeOperator] = msg.sender;\\n _gorvernorToBridgeOperatorInfo[msg.sender].addr = newBridgeOperator;\\n\\n _notifyRegisters(\\n IBridgeManagerCallback.onBridgeOperatorUpdated.selector,\\n abi.encode(currentBridgeOperator, newBridgeOperator)\\n );\\n\\n emit BridgeOperatorUpdated(msg.sender, currentBridgeOperator, newBridgeOperator);\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function setContract(ContractType contractType, address addr) external override onlySelfCall {\\n _requireHasCode(addr);\\n _setContract(contractType, addr);\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function setThreshold(\\n uint256 numerator,\\n uint256 denominator\\n ) external override onlySelfCall returns (uint256, uint256) {\\n return _setThreshold(numerator, denominator);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getTotalWeights() public view returns (uint256) {\\n return TOTAL_WEIGHTS_SLOT.load();\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getGovernorWeights(address[] calldata governors) external view returns (uint256[] memory weights) {\\n weights = _getGovernorWeights(governors);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getGovernorWeight(address governor) external view returns (uint256 weight) {\\n weight = _getGovernorWeight(governor);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function sumGovernorsWeight(\\n address[] calldata governors\\n ) external view nonDuplicate(governors) returns (uint256 sum) {\\n sum = _sumGovernorsWeight(governors);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function totalBridgeOperators() external view returns (uint256) {\\n return _getBridgeOperatorSet().length();\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function isBridgeOperator(address addr) external view returns (bool) {\\n return _getBridgeOperatorSet().contains(addr);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getBridgeOperators() external view returns (address[] memory) {\\n return _getBridgeOperators();\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getGovernors() external view returns (address[] memory) {\\n return _getGovernors();\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getBridgeOperatorOf(address[] memory governors) public view returns (address[] memory bridgeOperators) {\\n uint256 length = governors.length;\\n bridgeOperators = new address[](length);\\n\\n mapping(address => BridgeOperatorInfo) storage _gorvernorToBridgeOperator = _getGovernorToBridgeOperatorInfo();\\n for (uint256 i; i < length; ) {\\n bridgeOperators[i] = _gorvernorToBridgeOperator[governors[i]].addr;\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getGovernorsOf(address[] calldata bridgeOperators) external view returns (address[] memory governors) {\\n uint256 length = bridgeOperators.length;\\n governors = new address[](length);\\n mapping(address => address) storage _governorOf = _getGovernorOf();\\n\\n for (uint256 i; i < length; ) {\\n governors[i] = _governorOf[bridgeOperators[i]];\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getFullBridgeOperatorInfos()\\n external\\n view\\n returns (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights)\\n {\\n governors = _getGovernors();\\n bridgeOperators = getBridgeOperatorOf(governors);\\n weights = _getGovernorWeights(governors);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint256 weight) {\\n mapping(address => address) storage _governorOf = _getGovernorOf();\\n mapping(address => BridgeOperatorInfo) storage _governorToBridgeOperatorInfo = _getGovernorToBridgeOperatorInfo();\\n weight = _governorToBridgeOperatorInfo[_governorOf[bridgeOperator]].voteWeight;\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function minimumVoteWeight() public view virtual returns (uint256) {\\n return (NUMERATOR_SLOT.mul(TOTAL_WEIGHTS_SLOT.load()) + DENOMINATOR_SLOT.load() - 1) / DENOMINATOR_SLOT.load();\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function getThreshold() external view virtual returns (uint256 num_, uint256 denom_) {\\n return (NUMERATOR_SLOT.load(), DENOMINATOR_SLOT.load());\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function checkThreshold(uint256 _voteWeight) external view virtual returns (bool) {\\n return _voteWeight * DENOMINATOR_SLOT.load() >= NUMERATOR_SLOT.mul(TOTAL_WEIGHTS_SLOT.load());\\n }\\n\\n /**\\n * @dev Internal function to add bridge operators.\\n *\\n * This function adds the specified `bridgeOperators` to the bridge operator set and establishes the associated mappings.\\n *\\n * Requirements:\\n * - The caller must have the necessary permission to add bridge operators.\\n * - The lengths of `voteWeights`, `governors`, and `bridgeOperators` arrays must be equal.\\n *\\n * @param voteWeights An array of uint256 values representing the vote weights for each bridge operator.\\n * @param governors An array of addresses representing the governors for each bridge operator.\\n * @return addeds An array of boolean values indicating whether each bridge operator was successfully added.\\n */\\n function _addBridgeOperators(\\n uint96[] memory voteWeights,\\n address[] memory governors,\\n address[] memory bridgeOperators\\n ) internal nonDuplicate(governors.extend(bridgeOperators)) returns (bool[] memory addeds) {\\n uint256 length = bridgeOperators.length;\\n if (!(length == voteWeights.length && length == governors.length)) revert ErrLengthMismatch(msg.sig);\\n addeds = new bool[](length);\\n // simply skip add operations if inputs are empty.\\n if (length == 0) return addeds;\\n\\n EnumerableSet.AddressSet storage _governorSet = _getGovernorsSet();\\n mapping(address => address) storage _governorOf = _getGovernorOf();\\n EnumerableSet.AddressSet storage _bridgeOperatorSet = _getBridgeOperatorSet();\\n mapping(address => BridgeOperatorInfo) storage _governorToBridgeOperatorInfo = _getGovernorToBridgeOperatorInfo();\\n\\n address governor;\\n address bridgeOperator;\\n uint256 accumulatedWeight;\\n BridgeOperatorInfo memory bridgeOperatorInfo;\\n\\n for (uint256 i; i < length; ) {\\n governor = governors[i];\\n bridgeOperator = bridgeOperators[i];\\n\\n _requireCreatedEOA(governor);\\n _requireCreatedEOA(bridgeOperator);\\n if (voteWeights[i] == 0) revert ErrInvalidVoteWeight(msg.sig);\\n\\n addeds[i] = !(_governorSet.contains(governor) ||\\n _governorSet.contains(bridgeOperator) ||\\n _bridgeOperatorSet.contains(governor) ||\\n _bridgeOperatorSet.contains(bridgeOperator));\\n\\n if (addeds[i]) {\\n _governorSet.add(governor);\\n _bridgeOperatorSet.add(bridgeOperator);\\n _governorOf[bridgeOperator] = governor;\\n bridgeOperatorInfo.addr = bridgeOperator;\\n accumulatedWeight += bridgeOperatorInfo.voteWeight = voteWeights[i];\\n _governorToBridgeOperatorInfo[governor] = bridgeOperatorInfo;\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n TOTAL_WEIGHTS_SLOT.addAssign(accumulatedWeight);\\n\\n _notifyRegisters(IBridgeManagerCallback.onBridgeOperatorsAdded.selector, abi.encode(bridgeOperators, addeds));\\n\\n emit BridgeOperatorsAdded(addeds, voteWeights, governors, bridgeOperators);\\n }\\n\\n /**\\n * @dev Internal function to remove bridge operators.\\n *\\n * This function removes the specified `bridgeOperators` from the bridge operator set and related mappings.\\n *\\n * Requirements:\\n * - The caller must have the necessary permission to remove bridge operators.\\n *\\n * @param bridgeOperators An array of addresses representing the bridge operators to be removed.\\n * @return removeds An array of boolean values indicating whether each bridge operator was successfully removed.\\n */\\n function _removeBridgeOperators(\\n address[] memory bridgeOperators\\n ) internal nonDuplicate(bridgeOperators) returns (bool[] memory removeds) {\\n uint256 length = bridgeOperators.length;\\n removeds = new bool[](length);\\n // simply skip remove operations if inputs are empty.\\n if (length == 0) return removeds;\\n\\n mapping(address => address) storage _governorOf = _getGovernorOf();\\n EnumerableSet.AddressSet storage _governorSet = _getGovernorsSet();\\n EnumerableSet.AddressSet storage _bridgeOperatorSet = _getBridgeOperatorSet();\\n mapping(address => BridgeOperatorInfo) storage _governorToBridgeOperatorInfo = _getGovernorToBridgeOperatorInfo();\\n\\n address governor;\\n address bridgeOperator;\\n uint256 accumulatedWeight;\\n BridgeOperatorInfo memory bridgeOperatorInfo;\\n\\n for (uint256 i; i < length; ) {\\n bridgeOperator = bridgeOperators[i];\\n governor = _governorOf[bridgeOperator];\\n\\n _requireNonZeroAddress(governor);\\n _requireNonZeroAddress(bridgeOperator);\\n\\n bridgeOperatorInfo = _governorToBridgeOperatorInfo[governor];\\n if (bridgeOperatorInfo.addr != bridgeOperator) revert ErrInvalidArguments(msg.sig);\\n\\n removeds[i] = _bridgeOperatorSet.contains(bridgeOperator) && _governorSet.contains(governor);\\n if (removeds[i]) {\\n _governorSet.remove(governor);\\n _bridgeOperatorSet.remove(bridgeOperator);\\n\\n delete _governorOf[bridgeOperator];\\n delete _governorToBridgeOperatorInfo[governor];\\n accumulatedWeight += bridgeOperatorInfo.voteWeight;\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n TOTAL_WEIGHTS_SLOT.subAssign(accumulatedWeight);\\n\\n _notifyRegisters(IBridgeManagerCallback.onBridgeOperatorsRemoved.selector, abi.encode(bridgeOperators, removeds));\\n\\n emit BridgeOperatorsRemoved(removeds, bridgeOperators);\\n }\\n\\n /**\\n * @dev Sets threshold and returns the old one.\\n *\\n * Emits the `ThresholdUpdated` event.\\n *\\n */\\n function _setThreshold(\\n uint256 numerator,\\n uint256 denominator\\n ) internal virtual returns (uint256 previousNum, uint256 previousDenom) {\\n if (numerator > denominator) revert ErrInvalidThreshold(msg.sig);\\n\\n previousNum = NUMERATOR_SLOT.load();\\n previousDenom = DENOMINATOR_SLOT.load();\\n NUMERATOR_SLOT.store(numerator);\\n DENOMINATOR_SLOT.store(denominator);\\n\\n emit ThresholdUpdated(NONCE_SLOT.postIncrement(), numerator, denominator, previousNum, previousDenom);\\n }\\n\\n /**\\n * @dev Internal function to get all bridge operators.\\n * @return bridgeOperators An array containing all the registered bridge operator addresses.\\n */\\n function _getBridgeOperators() internal view returns (address[] memory) {\\n return _getBridgeOperatorSet().values();\\n }\\n\\n /**\\n * @dev Internal function to get all governors.\\n * @return governors An array containing all the registered governor addresses.\\n */\\n function _getGovernors() internal view returns (address[] memory) {\\n return _getGovernorsSet().values();\\n }\\n\\n /**\\n * @dev Internal function to get the vote weights of a given array of governors.\\n * @param governors An array containing the addresses of governors.\\n * @return weights An array containing the vote weights of the corresponding governors.\\n */\\n function _getGovernorWeights(address[] memory governors) internal view returns (uint256[] memory weights) {\\n uint256 length = governors.length;\\n weights = new uint256[](length);\\n mapping(address => BridgeOperatorInfo) storage _governorToBridgeOperatorInfo = _getGovernorToBridgeOperatorInfo();\\n for (uint256 i; i < length; ) {\\n weights[i] = _governorToBridgeOperatorInfo[governors[i]].voteWeight;\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @dev Internal function to calculate the sum of vote weights for a given array of governors.\\n * @param governors An array containing the addresses of governors to calculate the sum of vote weights.\\n * @return sum The total sum of vote weights for the provided governors.\\n * @notice The input array `governors` must contain unique addresses to avoid duplicate calculations.\\n */\\n function _sumGovernorsWeight(address[] memory governors) internal view nonDuplicate(governors) returns (uint256 sum) {\\n uint256 length = _getBridgeOperatorSet().length();\\n mapping(address => BridgeOperatorInfo) storage _governorToBridgeOperatorInfo = _getGovernorToBridgeOperatorInfo();\\n\\n for (uint256 i; i < length; ) {\\n sum += _governorToBridgeOperatorInfo[governors[i]].voteWeight;\\n\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @dev Internal function to require that the caller has governor role access.\\n * @param addr The address to check for governor role access.\\n * @dev If the address does not have governor role access (vote weight is zero), a revert with the corresponding error message is triggered.\\n */\\n function _requireGovernor(address addr) internal view {\\n if (_getGovernorWeight(addr) == 0) {\\n revert ErrUnauthorized(msg.sig, RoleAccess.GOVERNOR);\\n }\\n }\\n\\n /**\\n * @dev Internal function to retrieve the vote weight of a specific governor.\\n * @param governor The address of the governor to get the vote weight for.\\n * @return voteWeight The vote weight of the specified governor.\\n */\\n function _getGovernorWeight(address governor) internal view returns (uint256) {\\n return _getGovernorToBridgeOperatorInfo()[governor].voteWeight;\\n }\\n\\n /**\\n * @dev Internal function to access the address set of bridge operators.\\n * @return bridgeOperators the storage address set.\\n */\\n function _getBridgeOperatorSet() internal pure returns (EnumerableSet.AddressSet storage bridgeOperators) {\\n assembly (\\\"memory-safe\\\") {\\n bridgeOperators.slot := BRIDGE_OPERATOR_SET_SLOT\\n }\\n }\\n\\n /**\\n * @dev Internal function to access the address set of bridge operators.\\n * @return governors the storage address set.\\n */\\n function _getGovernorsSet() internal pure returns (EnumerableSet.AddressSet storage governors) {\\n assembly (\\\"memory-safe\\\") {\\n governors.slot := GOVERNOR_SET_SLOT\\n }\\n }\\n\\n /**\\n * @dev Internal function to access the mapping from governor => BridgeOperatorInfo.\\n * @return governorToBridgeOperatorInfo the mapping from governor => BridgeOperatorInfo.\\n */\\n function _getGovernorToBridgeOperatorInfo()\\n internal\\n pure\\n returns (mapping(address => BridgeOperatorInfo) storage governorToBridgeOperatorInfo)\\n {\\n assembly (\\\"memory-safe\\\") {\\n governorToBridgeOperatorInfo.slot := GOVERNOR_TO_BRIDGE_OPERATOR_INFO_SLOT\\n }\\n }\\n\\n /**\\n * @dev Internal function to access the mapping from bridge operator => governor.\\n * @return governorOf the mapping from bridge operator => governor.\\n */\\n function _getGovernorOf() internal pure returns (mapping(address => address) storage governorOf) {\\n assembly (\\\"memory-safe\\\") {\\n governorOf.slot := GOVENOR_OF_SLOT\\n }\\n }\\n}\\n\",\"keccak256\":\"0x26e2963f2b9a2a8dc304ced298444f6497bbf63d6e9bff7743c53a81558ef011\",\"license\":\"MIT\"},\"contracts/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { EnumerableSet } from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\nimport { IBridgeManagerCallbackRegister } from \\\"../../interfaces/bridge/IBridgeManagerCallbackRegister.sol\\\";\\nimport { IBridgeManagerCallback } from \\\"../../interfaces/bridge/IBridgeManagerCallback.sol\\\";\\nimport { IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\n\\n/**\\n * @title BridgeManagerCallbackRegister\\n * @dev A contract that manages callback registrations and execution for a bridge.\\n */\\nabstract contract BridgeManagerCallbackRegister is IdentityGuard, IBridgeManagerCallbackRegister {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n /**\\n * @dev Storage slot for the address set of callback registers.\\n * @dev Value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeAdmin.callbackRegisters.slot\\\") - 1.\\n */\\n bytes32 private constant CALLBACK_REGISTERS_SLOT = 0x5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd976240;\\n\\n constructor(address[] memory callbackRegisters) payable {\\n _registerCallbacks(callbackRegisters);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallbackRegister\\n */\\n function registerCallbacks(address[] calldata registers) external onlySelfCall returns (bool[] memory registereds) {\\n registereds = _registerCallbacks(registers);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallbackRegister\\n */\\n function unregisterCallbacks(\\n address[] calldata registers\\n ) external onlySelfCall returns (bool[] memory unregistereds) {\\n unregistereds = _unregisterCallbacks(registers);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallbackRegister\\n */\\n function getCallbackRegisters() external view returns (address[] memory registers) {\\n registers = _getCallbackRegisters().values();\\n }\\n\\n /**\\n * @dev Internal function to register multiple callbacks with the bridge.\\n * @param registers The array of callback addresses to register.\\n * @return registereds An array indicating the success status of each registration.\\n */\\n function _registerCallbacks(\\n address[] memory registers\\n ) internal nonDuplicate(registers) returns (bool[] memory registereds) {\\n uint256 length = registers.length;\\n registereds = new bool[](length);\\n if (length == 0) return registereds;\\n\\n EnumerableSet.AddressSet storage _callbackRegisters = _getCallbackRegisters();\\n address register;\\n bytes4 callbackInterface = type(IBridgeManagerCallback).interfaceId;\\n\\n for (uint256 i; i < length; ) {\\n register = registers[i];\\n\\n _requireHasCode(register);\\n _requireSupportsInterface(register, callbackInterface);\\n\\n registereds[i] = _callbackRegisters.add(register);\\n\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @dev Internal function to unregister multiple callbacks from the bridge.\\n * @param registers The array of callback addresses to unregister.\\n * @return unregistereds An array indicating the success status of each unregistration.\\n */\\n function _unregisterCallbacks(\\n address[] memory registers\\n ) internal nonDuplicate(registers) returns (bool[] memory unregistereds) {\\n uint256 length = registers.length;\\n unregistereds = new bool[](length);\\n EnumerableSet.AddressSet storage _callbackRegisters = _getCallbackRegisters();\\n\\n for (uint256 i; i < length; ) {\\n unregistereds[i] = _callbackRegisters.remove(registers[i]);\\n\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @dev Internal function to notify all registered callbacks with the provided function signature and data.\\n * @param callbackFnSig The function signature of the callback method.\\n * @param inputs The data to pass to the callback method.\\n */\\n function _notifyRegisters(bytes4 callbackFnSig, bytes memory inputs) internal {\\n address[] memory registers = _getCallbackRegisters().values();\\n uint256 length = registers.length;\\n if (length == 0) return;\\n\\n bool[] memory statuses = new bool[](length);\\n bytes[] memory returnDatas = new bytes[](length);\\n bytes memory callData = abi.encodePacked(callbackFnSig, inputs);\\n\\n for (uint256 i; i < length; ) {\\n (statuses[i], returnDatas[i]) = registers[i].call(callData);\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n emit Notified(callData, registers, statuses, returnDatas);\\n }\\n\\n /**\\n * @dev Internal function to retrieve the address set of callback registers.\\n * @return callbackRegisters The storage reference to the callback registers.\\n */\\n function _getCallbackRegisters() internal pure returns (EnumerableSet.AddressSet storage callbackRegisters) {\\n assembly (\\\"memory-safe\\\") {\\n callbackRegisters.slot := CALLBACK_REGISTERS_SLOT\\n }\\n }\\n}\\n\",\"keccak256\":\"0x604f39e11b8dc4ce6fb765c606f7b87bc0cad3540dbb291cccb809123724bdf3\",\"license\":\"MIT\"},\"contracts/extensions/collections/HasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { HasProxyAdmin } from \\\"./HasProxyAdmin.sol\\\";\\nimport \\\"../../interfaces/collections/IHasContracts.sol\\\";\\nimport { IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\nimport { ErrUnexpectedInternalCall } from \\\"../../utils/CommonErrors.sol\\\";\\n\\n/**\\n * @title HasContracts\\n * @dev A contract that provides functionality to manage multiple contracts with different roles.\\n */\\nabstract contract HasContracts is HasProxyAdmin, IHasContracts, IdentityGuard {\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.collections.HasContracts.slot\\\") - 1\\n bytes32 private constant _STORAGE_SLOT = 0xdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb;\\n\\n /**\\n * @dev Modifier to restrict access to functions only to contracts with a specific role.\\n * @param contractType The contract type that allowed to call\\n */\\n modifier onlyContract(ContractType contractType) virtual {\\n _requireContract(contractType);\\n _;\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function setContract(ContractType contractType, address addr) external virtual onlyAdmin {\\n _requireHasCode(addr);\\n _setContract(contractType, addr);\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function getContract(ContractType contractType) public view returns (address contract_) {\\n contract_ = _getContractMap()[uint8(contractType)];\\n if (contract_ == address(0)) revert ErrContractTypeNotFound(contractType);\\n }\\n\\n /**\\n * @dev Internal function to set the address of a contract with a specific role.\\n * @param contractType The contract type of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function _setContract(ContractType contractType, address addr) internal virtual {\\n _getContractMap()[uint8(contractType)] = addr;\\n emit ContractUpdated(contractType, addr);\\n }\\n\\n /**\\n * @dev Internal function to access the mapping of contract addresses with roles.\\n * @return contracts_ The mapping of contract addresses with roles.\\n */\\n function _getContractMap() private pure returns (mapping(uint8 => address) storage contracts_) {\\n assembly {\\n contracts_.slot := _STORAGE_SLOT\\n }\\n }\\n\\n /**\\n * @dev Internal function to check if the calling contract has a specific role.\\n * @param contractType The contract type that the calling contract must have.\\n * @dev Throws an error if the calling contract does not have the specified role.\\n */\\n function _requireContract(ContractType contractType) private view {\\n if (msg.sender != getContract(contractType)) {\\n revert ErrUnexpectedInternalCall(msg.sig, contractType, msg.sender);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9e1dceb68827adfb8c8184662f29ab5fe14e292a632878150e3b0b6c61bc1dce\",\"license\":\"MIT\"},\"contracts/extensions/collections/HasProxyAdmin.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/StorageSlot.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\n\\nabstract contract HasProxyAdmin {\\n // bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n modifier onlyAdmin() {\\n _requireAdmin();\\n _;\\n }\\n\\n /**\\n * @dev Returns proxy admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n function _requireAdmin() internal view {\\n if (msg.sender != _getAdmin()) revert ErrUnauthorized(msg.sig, RoleAccess.ADMIN);\\n }\\n}\\n\",\"keccak256\":\"0x06e5962713a77abf6d5ba646e1cc1cfb6f9c50e7d52520dd82a10bf309534187\",\"license\":\"MIT\"},\"contracts/extensions/sequential-governance/CoreGovernance.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../libraries/Proposal.sol\\\";\\nimport \\\"../../libraries/GlobalProposal.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\nimport \\\"../../libraries/Ballot.sol\\\";\\nimport \\\"../../interfaces/consumers/ChainTypeConsumer.sol\\\";\\nimport \\\"../../interfaces/consumers/SignatureConsumer.sol\\\";\\nimport \\\"../../interfaces/consumers/VoteStatusConsumer.sol\\\";\\n\\nabstract contract CoreGovernance is SignatureConsumer, VoteStatusConsumer, ChainTypeConsumer {\\n using Proposal for Proposal.ProposalDetail;\\n\\n /**\\n * @dev Error thrown when attempting to interact with a finalized vote.\\n */\\n error ErrVoteIsFinalized();\\n\\n /**\\n * @dev Error thrown when the current proposal is not completed.\\n */\\n error ErrCurrentProposalIsNotCompleted();\\n\\n struct ProposalVote {\\n VoteStatus status;\\n bytes32 hash;\\n uint256 againstVoteWeight; // Total weight of against votes\\n uint256 forVoteWeight; // Total weight of for votes\\n address[] forVoteds; // Array of addresses voting for\\n address[] againstVoteds; // Array of addresses voting against\\n uint256 expiryTimestamp;\\n mapping(address => Signature) sig;\\n mapping(address => bool) voted;\\n }\\n\\n /// @dev Emitted when a proposal is created\\n event ProposalCreated(\\n uint256 indexed chainId,\\n uint256 indexed round,\\n bytes32 indexed proposalHash,\\n Proposal.ProposalDetail proposal,\\n address creator\\n );\\n /// @dev Emitted when the proposal is voted\\n event ProposalVoted(bytes32 indexed proposalHash, address indexed voter, Ballot.VoteType support, uint256 weight);\\n /// @dev Emitted when the proposal is approved\\n event ProposalApproved(bytes32 indexed proposalHash);\\n /// @dev Emitted when the vote is reject\\n event ProposalRejected(bytes32 indexed proposalHash);\\n /// @dev Emitted when the vote is expired\\n event ProposalExpired(bytes32 indexed proposalHash);\\n /// @dev Emitted when the proposal is executed\\n event ProposalExecuted(bytes32 indexed proposalHash, bool[] successCalls, bytes[] returnDatas);\\n /// @dev Emitted when the proposal expiry duration is changed.\\n event ProposalExpiryDurationChanged(uint256 indexed duration);\\n\\n /// @dev Mapping from chain id => vote round\\n /// @notice chain id = 0 for global proposal\\n mapping(uint256 => uint256) public round;\\n /// @dev Mapping from chain id => vote round => proposal vote\\n mapping(uint256 => mapping(uint256 => ProposalVote)) public vote;\\n\\n uint256 internal _proposalExpiryDuration;\\n\\n constructor(uint256 _expiryDuration) {\\n _setProposalExpiryDuration(_expiryDuration);\\n }\\n\\n /**\\n * @dev Creates new voting round by calculating the `_round` number of chain `_chainId`.\\n * Increases the `_round` number if the previous one is not expired. Delete the previous proposal\\n * if it is expired and not increase the `_round`.\\n */\\n function _createVotingRound(uint256 _chainId) internal returns (uint256 _round) {\\n _round = round[_chainId];\\n // Skip checking for the first ever round\\n if (_round == 0) {\\n _round = round[_chainId] = 1;\\n } else {\\n ProposalVote storage _latestProposalVote = vote[_chainId][_round];\\n bool _isExpired = _tryDeleteExpiredVotingRound(_latestProposalVote);\\n // Skip increasing round number if the latest round is expired, allow the vote to be overridden\\n if (!_isExpired) {\\n if (_latestProposalVote.status == VoteStatus.Pending) revert ErrCurrentProposalIsNotCompleted();\\n unchecked {\\n _round = ++round[_chainId];\\n }\\n }\\n }\\n }\\n\\n /**\\n * @dev Saves new round voting for the proposal `_proposalHash` of chain `_chainId`.\\n */\\n function _saveVotingRound(ProposalVote storage _vote, bytes32 _proposalHash, uint256 _expiryTimestamp) internal {\\n _vote.hash = _proposalHash;\\n _vote.expiryTimestamp = _expiryTimestamp;\\n }\\n\\n /**\\n * @dev Proposes for a new proposal.\\n *\\n * Requirements:\\n * - The chain id is not equal to 0.\\n *\\n * Emits the `ProposalCreated` event.\\n *\\n */\\n function _proposeProposal(\\n uint256 chainId,\\n uint256 expiryTimestamp,\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n uint256[] memory gasAmounts,\\n address creator\\n ) internal virtual returns (Proposal.ProposalDetail memory proposal) {\\n if (chainId == 0) revert ErrInvalidChainId(msg.sig, 0, block.chainid);\\n uint256 round_ = _createVotingRound(chainId);\\n\\n proposal = Proposal.ProposalDetail(round_, chainId, expiryTimestamp, targets, values, calldatas, gasAmounts);\\n proposal.validate(_proposalExpiryDuration);\\n\\n bytes32 proposalHash = proposal.hash();\\n _saveVotingRound(vote[chainId][round_], proposalHash, expiryTimestamp);\\n emit ProposalCreated(chainId, round_, proposalHash, proposal, creator);\\n }\\n\\n /**\\n * @dev Proposes proposal struct.\\n *\\n * Requirements:\\n * - The chain id is not equal to 0.\\n * - The proposal nonce is equal to the new round.\\n *\\n * Emits the `ProposalCreated` event.\\n *\\n */\\n function _proposeProposalStruct(\\n Proposal.ProposalDetail memory proposal,\\n address creator\\n ) internal virtual returns (uint256 round_) {\\n uint256 chainId = proposal.chainId;\\n if (chainId == 0) revert ErrInvalidChainId(msg.sig, 0, block.chainid);\\n proposal.validate(_proposalExpiryDuration);\\n\\n bytes32 proposalHash = proposal.hash();\\n round_ = _createVotingRound(chainId);\\n _saveVotingRound(vote[chainId][round_], proposalHash, proposal.expiryTimestamp);\\n if (round_ != proposal.nonce) revert ErrInvalidProposalNonce(msg.sig);\\n emit ProposalCreated(chainId, round_, proposalHash, proposal, creator);\\n }\\n\\n /**\\n * @dev Casts vote for the proposal with data and returns whether the voting is done.\\n *\\n * Requirements:\\n * - The proposal nonce is equal to the round.\\n * - The vote is not finalized.\\n * - The voter has not voted for the round.\\n *\\n * Emits the `ProposalVoted` event. Emits the `ProposalApproved`, `ProposalExecuted` or `ProposalRejected` once the\\n * proposal is approved, executed or rejected.\\n *\\n */\\n function _castVote(\\n Proposal.ProposalDetail memory proposal,\\n Ballot.VoteType support,\\n uint256 minimumForVoteWeight,\\n uint256 minimumAgainstVoteWeight,\\n address voter,\\n Signature memory signature,\\n uint256 voterWeight\\n ) internal virtual returns (bool done) {\\n uint256 chainId = proposal.chainId;\\n uint256 round_ = proposal.nonce;\\n ProposalVote storage _vote = vote[chainId][round_];\\n\\n if (_tryDeleteExpiredVotingRound(_vote)) {\\n return true;\\n }\\n\\n if (round[proposal.chainId] != round_) revert ErrInvalidProposalNonce(msg.sig);\\n if (_vote.status != VoteStatus.Pending) revert ErrVoteIsFinalized();\\n if (_voted(_vote, voter)) revert ErrAlreadyVoted(voter);\\n\\n _vote.voted[voter] = true;\\n // Stores the signature if it is not empty\\n if (signature.r > 0 || signature.s > 0 || signature.v > 0) {\\n _vote.sig[voter] = signature;\\n }\\n emit ProposalVoted(_vote.hash, voter, support, voterWeight);\\n\\n uint256 _forVoteWeight;\\n uint256 _againstVoteWeight;\\n if (support == Ballot.VoteType.For) {\\n _vote.forVoteds.push(voter);\\n _forVoteWeight = _vote.forVoteWeight += voterWeight;\\n } else if (support == Ballot.VoteType.Against) {\\n _vote.againstVoteds.push(voter);\\n _againstVoteWeight = _vote.againstVoteWeight += voterWeight;\\n } else revert ErrUnsupportedVoteType(msg.sig);\\n\\n if (_forVoteWeight >= minimumForVoteWeight) {\\n done = true;\\n _vote.status = VoteStatus.Approved;\\n emit ProposalApproved(_vote.hash);\\n _tryExecute(_vote, proposal);\\n } else if (_againstVoteWeight >= minimumAgainstVoteWeight) {\\n done = true;\\n _vote.status = VoteStatus.Rejected;\\n emit ProposalRejected(_vote.hash);\\n }\\n }\\n\\n /**\\n * @dev When the contract is on Ronin chain, checks whether the proposal is expired and delete it if is expired.\\n *\\n * Emits the event `ProposalExpired` if the vote is expired.\\n *\\n * Note: This function assumes the vote `_proposalVote` is already created, consider verifying the vote's existence\\n * before or it will emit an unexpected event of `ProposalExpired`.\\n */\\n function _tryDeleteExpiredVotingRound(ProposalVote storage proposalVote) internal returns (bool isExpired) {\\n isExpired =\\n _getChainType() == ChainType.RoninChain &&\\n proposalVote.status == VoteStatus.Pending &&\\n proposalVote.expiryTimestamp <= block.timestamp;\\n\\n if (isExpired) {\\n emit ProposalExpired(proposalVote.hash);\\n\\n for (uint256 _i; _i < proposalVote.forVoteds.length; ) {\\n delete proposalVote.voted[proposalVote.forVoteds[_i]];\\n delete proposalVote.sig[proposalVote.forVoteds[_i]];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n for (uint256 _i; _i < proposalVote.againstVoteds.length; ) {\\n delete proposalVote.voted[proposalVote.againstVoteds[_i]];\\n delete proposalVote.sig[proposalVote.againstVoteds[_i]];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n delete proposalVote.status;\\n delete proposalVote.hash;\\n delete proposalVote.againstVoteWeight;\\n delete proposalVote.forVoteWeight;\\n delete proposalVote.forVoteds;\\n delete proposalVote.againstVoteds;\\n delete proposalVote.expiryTimestamp;\\n }\\n }\\n\\n /**\\n * @dev Executes the proposal and update the vote status once the proposal is executable.\\n */\\n function _tryExecute(ProposalVote storage vote_, Proposal.ProposalDetail memory proposal) internal {\\n if (proposal.executable()) {\\n vote_.status = VoteStatus.Executed;\\n (bool[] memory _successCalls, bytes[] memory _returnDatas) = proposal.execute();\\n emit ProposalExecuted(vote_.hash, _successCalls, _returnDatas);\\n }\\n }\\n\\n /**\\n * @dev Sets the expiry duration for a new proposal.\\n */\\n function _setProposalExpiryDuration(uint256 expiryDuration) internal {\\n _proposalExpiryDuration = expiryDuration;\\n emit ProposalExpiryDurationChanged(expiryDuration);\\n }\\n\\n /**\\n * @dev Returns the expiry duration for a new proposal.\\n */\\n function _getProposalExpiryDuration() internal view returns (uint256) {\\n return _proposalExpiryDuration;\\n }\\n\\n /**\\n * @dev Returns whether the voter casted for the proposal.\\n */\\n function _voted(ProposalVote storage vote_, address voter) internal view returns (bool) {\\n return vote_.voted[voter];\\n }\\n\\n /**\\n * @dev Returns total weight from validators.\\n */\\n function _getTotalWeights() internal view virtual returns (uint256);\\n\\n /**\\n * @dev Returns minimum vote to pass a proposal.\\n */\\n function _getMinimumVoteWeight() internal view virtual returns (uint256);\\n\\n /**\\n * @dev Returns current context is running on whether Ronin chain or on mainchain.\\n */\\n function _getChainType() internal view virtual returns (ChainType);\\n}\\n\",\"keccak256\":\"0x141791e1ab3c89cac0af0240a497cf9562ddbb050561798b9c4565d86254b736\",\"license\":\"MIT\"},\"contracts/extensions/sequential-governance/GlobalCoreGovernance.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../libraries/Proposal.sol\\\";\\nimport \\\"../../libraries/GlobalProposal.sol\\\";\\nimport \\\"./CoreGovernance.sol\\\";\\n\\nabstract contract GlobalCoreGovernance is CoreGovernance {\\n using Proposal for Proposal.ProposalDetail;\\n using GlobalProposal for GlobalProposal.GlobalProposalDetail;\\n\\n mapping(GlobalProposal.TargetOption => address) internal _targetOptionsMap;\\n\\n /// @dev Emitted when a proposal is created\\n event GlobalProposalCreated(\\n uint256 indexed round,\\n bytes32 indexed proposalHash,\\n Proposal.ProposalDetail proposal,\\n bytes32 globalProposalHash,\\n GlobalProposal.GlobalProposalDetail globalProposal,\\n address creator\\n );\\n\\n /// @dev Emitted when the target options are updated\\n event TargetOptionUpdated(GlobalProposal.TargetOption indexed targetOption, address indexed addr);\\n\\n constructor(GlobalProposal.TargetOption[] memory targetOptions, address[] memory addrs) {\\n _updateTargetOption(GlobalProposal.TargetOption.BridgeManager, address(this));\\n _updateManyTargetOption(targetOptions, addrs);\\n }\\n\\n /**\\n * @dev Proposes for a global proposal.\\n *\\n * Emits the `GlobalProposalCreated` event.\\n *\\n */\\n function _proposeGlobal(\\n uint256 expiryTimestamp,\\n GlobalProposal.TargetOption[] calldata targetOptions,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n uint256[] memory gasAmounts,\\n address creator\\n ) internal virtual {\\n uint256 round_ = _createVotingRound(0);\\n GlobalProposal.GlobalProposalDetail memory globalProposal = GlobalProposal.GlobalProposalDetail(\\n round_,\\n expiryTimestamp,\\n targetOptions,\\n values,\\n calldatas,\\n gasAmounts\\n );\\n Proposal.ProposalDetail memory proposal = globalProposal.intoProposalDetail(\\n _resolveTargets({ targetOptions: targetOptions, strict: true })\\n );\\n proposal.validate(_proposalExpiryDuration);\\n\\n bytes32 proposalHash = proposal.hash();\\n _saveVotingRound(vote[0][round_], proposalHash, expiryTimestamp);\\n emit GlobalProposalCreated(round_, proposalHash, proposal, globalProposal.hash(), globalProposal, creator);\\n }\\n\\n /**\\n * @dev Proposes global proposal struct.\\n *\\n * Requirements:\\n * - The proposal nonce is equal to the new round.\\n *\\n * Emits the `GlobalProposalCreated` event.\\n *\\n */\\n function _proposeGlobalStruct(\\n GlobalProposal.GlobalProposalDetail memory globalProposal,\\n address creator\\n ) internal virtual returns (Proposal.ProposalDetail memory proposal) {\\n proposal = globalProposal.intoProposalDetail(\\n _resolveTargets({ targetOptions: globalProposal.targetOptions, strict: true })\\n );\\n proposal.validate(_proposalExpiryDuration);\\n\\n bytes32 proposalHash = proposal.hash();\\n uint256 round_ = _createVotingRound(0);\\n _saveVotingRound(vote[0][round_], proposalHash, globalProposal.expiryTimestamp);\\n\\n if (round_ != proposal.nonce) revert ErrInvalidProposalNonce(msg.sig);\\n emit GlobalProposalCreated(round_, proposalHash, proposal, globalProposal.hash(), globalProposal, creator);\\n }\\n\\n /**\\n * @dev Returns corresponding address of target options. Return address(0) on non-existent target.\\n */\\n function resolveTargets(\\n GlobalProposal.TargetOption[] calldata targetOptions\\n ) external view returns (address[] memory targets) {\\n return _resolveTargets({ targetOptions: targetOptions, strict: false });\\n }\\n\\n /**\\n * @dev Internal helper of {resolveTargets}.\\n *\\n * @param strict When the param is set to `true`, revert on non-existent target.\\n */\\n function _resolveTargets(\\n GlobalProposal.TargetOption[] memory targetOptions,\\n bool strict\\n ) internal view returns (address[] memory targets) {\\n targets = new address[](targetOptions.length);\\n\\n for (uint256 i; i < targetOptions.length; ) {\\n targets[i] = _targetOptionsMap[targetOptions[i]];\\n if (strict && targets[i] == address(0)) revert ErrInvalidArguments(msg.sig);\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @dev Updates list of `targetOptions` to `targets`.\\n *\\n * Requirement:\\n * - Only allow self-call through proposal.\\n * */\\n function updateManyTargetOption(\\n GlobalProposal.TargetOption[] memory targetOptions,\\n address[] memory targets\\n ) external {\\n // HACK: Cannot reuse the existing library due to too deep stack\\n if (msg.sender != address(this)) revert ErrOnlySelfCall(msg.sig);\\n _updateManyTargetOption(targetOptions, targets);\\n }\\n\\n /**\\n * @dev Updates list of `targetOptions` to `targets`.\\n */\\n function _updateManyTargetOption(\\n GlobalProposal.TargetOption[] memory targetOptions,\\n address[] memory targets\\n ) internal {\\n for (uint256 i; i < targetOptions.length; ) {\\n if (targets[i] == address(this)) revert ErrInvalidArguments(msg.sig);\\n _updateTargetOption(targetOptions[i], targets[i]);\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @dev Updates `targetOption` to `target`.\\n *\\n * Requirement:\\n * - Emit a `TargetOptionUpdated` event.\\n */\\n function _updateTargetOption(GlobalProposal.TargetOption targetOption, address target) internal {\\n _targetOptionsMap[targetOption] = target;\\n emit TargetOptionUpdated(targetOption, target);\\n }\\n}\\n\",\"keccak256\":\"0x986444cade6313dd1ce4137f3338e4fc296769f5cf669f057cd2838e5ae0e54f\",\"license\":\"MIT\"},\"contracts/extensions/sequential-governance/governance-proposal/CommonGovernanceProposal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../CoreGovernance.sol\\\";\\n\\nabstract contract CommonGovernanceProposal is CoreGovernance {\\n using Proposal for Proposal.ProposalDetail;\\n\\n /**\\n * @dev Error thrown when an invalid proposal is encountered.\\n * @param actual The actual value of the proposal.\\n * @param expected The expected value of the proposal.\\n */\\n error ErrInvalidProposal(bytes32 actual, bytes32 expected);\\n\\n /**\\n * @dev Casts votes by signatures.\\n *\\n * Note: This method does not verify the proposal hash with the vote hash. Please consider checking it before.\\n *\\n */\\n function _castVotesBySignatures(\\n Proposal.ProposalDetail memory _proposal,\\n Ballot.VoteType[] calldata _supports,\\n Signature[] calldata _signatures,\\n bytes32 _forDigest,\\n bytes32 _againstDigest\\n ) internal {\\n if (!(_supports.length != 0 && _supports.length == _signatures.length)) revert ErrLengthMismatch(msg.sig);\\n\\n uint256 _minimumForVoteWeight = _getMinimumVoteWeight();\\n uint256 _minimumAgainstVoteWeight = _getTotalWeights() - _minimumForVoteWeight + 1;\\n\\n address _lastSigner;\\n address _signer;\\n Signature calldata _sig;\\n bool _hasValidVotes;\\n for (uint256 _i; _i < _signatures.length; ) {\\n _sig = _signatures[_i];\\n\\n if (_supports[_i] == Ballot.VoteType.For) {\\n _signer = ECDSA.recover(_forDigest, _sig.v, _sig.r, _sig.s);\\n } else if (_supports[_i] == Ballot.VoteType.Against) {\\n _signer = ECDSA.recover(_againstDigest, _sig.v, _sig.r, _sig.s);\\n } else revert ErrUnsupportedVoteType(msg.sig);\\n\\n if (_lastSigner >= _signer) revert ErrInvalidOrder(msg.sig);\\n _lastSigner = _signer;\\n\\n uint256 _weight = _getWeight(_signer);\\n if (_weight > 0) {\\n _hasValidVotes = true;\\n if (\\n _castVote(_proposal, _supports[_i], _minimumForVoteWeight, _minimumAgainstVoteWeight, _signer, _sig, _weight)\\n ) {\\n return;\\n }\\n }\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n\\n if (!_hasValidVotes) revert ErrInvalidSignatures(msg.sig);\\n }\\n\\n /**\\n * @dev Returns the voted signatures for the proposals.\\n *\\n * Note: The signatures can be empty in case the proposal is voted on the current network.\\n *\\n */\\n function _getProposalSignatures(\\n uint256 _chainId,\\n uint256 _round\\n )\\n internal\\n view\\n returns (address[] memory _voters, Ballot.VoteType[] memory _supports, Signature[] memory _signatures)\\n {\\n ProposalVote storage _vote = vote[_chainId][_round];\\n\\n uint256 _forLength = _vote.forVoteds.length;\\n uint256 _againstLength = _vote.againstVoteds.length;\\n uint256 _voterLength = _forLength + _againstLength;\\n\\n _supports = new Ballot.VoteType[](_voterLength);\\n _signatures = new Signature[](_voterLength);\\n _voters = new address[](_voterLength);\\n for (uint256 _i; _i < _forLength; ) {\\n _supports[_i] = Ballot.VoteType.For;\\n _signatures[_i] = vote[_chainId][_round].sig[_vote.forVoteds[_i]];\\n _voters[_i] = _vote.forVoteds[_i];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n for (uint256 _i; _i < _againstLength; ) {\\n _supports[_i + _forLength] = Ballot.VoteType.Against;\\n _signatures[_i + _forLength] = vote[_chainId][_round].sig[_vote.againstVoteds[_i]];\\n _voters[_i + _forLength] = _vote.againstVoteds[_i];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n }\\n\\n /**\\n * @dev Returns whether the voter `_voter` casted vote for the proposal.\\n */\\n function _proposalVoted(uint256 _chainId, uint256 _round, address _voter) internal view returns (bool) {\\n return _voted(vote[_chainId][_round], _voter);\\n }\\n\\n /**\\n * @dev Returns the weight of a governor.\\n */\\n function _getWeight(address _governor) internal view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0x63f6dc95ae1797ce7eb097ce186a671722ace1024f0dc1d9085cffe1f714a316\",\"license\":\"MIT\"},\"contracts/extensions/sequential-governance/governance-proposal/GlobalGovernanceProposal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../../libraries/Proposal.sol\\\";\\nimport \\\"../GlobalCoreGovernance.sol\\\";\\nimport \\\"./CommonGovernanceProposal.sol\\\";\\n\\nabstract contract GlobalGovernanceProposal is GlobalCoreGovernance, CommonGovernanceProposal {\\n using Proposal for Proposal.ProposalDetail;\\n using GlobalProposal for GlobalProposal.GlobalProposalDetail;\\n\\n /**\\n * @dev Proposes and votes by signature.\\n */\\n function _proposeGlobalProposalStructAndCastVotes(\\n GlobalProposal.GlobalProposalDetail calldata globalProposal,\\n Ballot.VoteType[] calldata supports_,\\n Signature[] calldata signatures,\\n bytes32 domainSeparator,\\n address creator\\n ) internal returns (Proposal.ProposalDetail memory proposal) {\\n proposal = _proposeGlobalStruct(globalProposal, creator);\\n bytes32 _globalProposalHash = globalProposal.hash();\\n _castVotesBySignatures(\\n proposal,\\n supports_,\\n signatures,\\n ECDSA.toTypedDataHash(domainSeparator, Ballot.hash(_globalProposalHash, Ballot.VoteType.For)),\\n ECDSA.toTypedDataHash(domainSeparator, Ballot.hash(_globalProposalHash, Ballot.VoteType.Against))\\n );\\n }\\n\\n /**\\n * @dev Proposes a global proposal struct and casts votes by signature.\\n */\\n function _castGlobalProposalBySignatures(\\n GlobalProposal.GlobalProposalDetail calldata globalProposal,\\n Ballot.VoteType[] calldata supports_,\\n Signature[] calldata signatures,\\n bytes32 domainSeparator\\n ) internal {\\n Proposal.ProposalDetail memory _proposal = globalProposal.intoProposalDetail(\\n _resolveTargets({ targetOptions: globalProposal.targetOptions, strict: true })\\n );\\n\\n bytes32 proposalHash = _proposal.hash();\\n if (vote[0][_proposal.nonce].hash != proposalHash)\\n revert ErrInvalidProposal(proposalHash, vote[0][_proposal.nonce].hash);\\n\\n bytes32 globalProposalHash = globalProposal.hash();\\n _castVotesBySignatures(\\n _proposal,\\n supports_,\\n signatures,\\n ECDSA.toTypedDataHash(domainSeparator, Ballot.hash(globalProposalHash, Ballot.VoteType.For)),\\n ECDSA.toTypedDataHash(domainSeparator, Ballot.hash(globalProposalHash, Ballot.VoteType.Against))\\n );\\n }\\n\\n /**\\n * @dev See {CommonGovernanceProposal-_getProposalSignatures}\\n */\\n function getGlobalProposalSignatures(\\n uint256 round_\\n ) external view returns (address[] memory voters, Ballot.VoteType[] memory supports_, Signature[] memory signatures) {\\n return _getProposalSignatures(0, round_);\\n }\\n\\n /**\\n * @dev See {CommonGovernanceProposal-_proposalVoted}\\n */\\n function globalProposalVoted(uint256 round_, address voter) external view returns (bool) {\\n return _proposalVoted(0, round_, voter);\\n }\\n}\\n\",\"keccak256\":\"0xf51a22e3494d132120453a9818cadf548b2dc779fd0ca004945ae8909bd94fbb\",\"license\":\"MIT\"},\"contracts/extensions/sequential-governance/governance-proposal/GovernanceProposal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../CoreGovernance.sol\\\";\\nimport \\\"./CommonGovernanceProposal.sol\\\";\\n\\nabstract contract GovernanceProposal is CoreGovernance, CommonGovernanceProposal {\\n using Proposal for Proposal.ProposalDetail;\\n\\n /**\\n * @dev Proposes a proposal struct and casts votes by signature.\\n */\\n function _proposeProposalStructAndCastVotes(\\n Proposal.ProposalDetail calldata _proposal,\\n Ballot.VoteType[] calldata _supports,\\n Signature[] calldata _signatures,\\n bytes32 _domainSeparator,\\n address _creator\\n ) internal {\\n _proposeProposalStruct(_proposal, _creator);\\n bytes32 _proposalHash = _proposal.hash();\\n _castVotesBySignatures(\\n _proposal,\\n _supports,\\n _signatures,\\n ECDSA.toTypedDataHash(_domainSeparator, Ballot.hash(_proposalHash, Ballot.VoteType.For)),\\n ECDSA.toTypedDataHash(_domainSeparator, Ballot.hash(_proposalHash, Ballot.VoteType.Against))\\n );\\n }\\n\\n /**\\n * @dev Proposes a proposal struct and casts votes by signature.\\n */\\n function _castProposalBySignatures(\\n Proposal.ProposalDetail calldata _proposal,\\n Ballot.VoteType[] calldata _supports,\\n Signature[] calldata _signatures,\\n bytes32 _domainSeparator\\n ) internal {\\n bytes32 _proposalHash = _proposal.hash();\\n\\n if (vote[_proposal.chainId][_proposal.nonce].hash != _proposalHash) {\\n revert ErrInvalidProposal(_proposalHash, vote[_proposal.chainId][_proposal.nonce].hash);\\n }\\n\\n _castVotesBySignatures(\\n _proposal,\\n _supports,\\n _signatures,\\n ECDSA.toTypedDataHash(_domainSeparator, Ballot.hash(_proposalHash, Ballot.VoteType.For)),\\n ECDSA.toTypedDataHash(_domainSeparator, Ballot.hash(_proposalHash, Ballot.VoteType.Against))\\n );\\n }\\n\\n /**\\n * @dev See `castProposalVoteForCurrentNetwork`.\\n */\\n function _castProposalVoteForCurrentNetwork(\\n address _voter,\\n Proposal.ProposalDetail memory _proposal,\\n Ballot.VoteType _support\\n ) internal {\\n if (_proposal.chainId != block.chainid) revert ErrInvalidChainId(msg.sig, _proposal.chainId, block.chainid);\\n\\n bytes32 proposalHash = _proposal.hash();\\n if (vote[_proposal.chainId][_proposal.nonce].hash != proposalHash)\\n revert ErrInvalidProposal(proposalHash, vote[_proposal.chainId][_proposal.nonce].hash);\\n\\n uint256 _minimumForVoteWeight = _getMinimumVoteWeight();\\n uint256 _minimumAgainstVoteWeight = _getTotalWeights() - _minimumForVoteWeight + 1;\\n Signature memory _emptySignature;\\n _castVote(\\n _proposal,\\n _support,\\n _minimumForVoteWeight,\\n _minimumAgainstVoteWeight,\\n _voter,\\n _emptySignature,\\n _getWeight(_voter)\\n );\\n }\\n\\n /**\\n * @dev See {CommonGovernanceProposal-_getProposalSignatures}\\n */\\n function getProposalSignatures(\\n uint256 _chainId,\\n uint256 _round\\n )\\n external\\n view\\n returns (address[] memory _voters, Ballot.VoteType[] memory _supports, Signature[] memory _signatures)\\n {\\n return _getProposalSignatures(_chainId, _round);\\n }\\n\\n /**\\n * @dev See {CommonGovernanceProposal-_proposalVoted}\\n */\\n function proposalVoted(uint256 _chainId, uint256 _round, address _voter) external view returns (bool) {\\n return _proposalVoted(_chainId, _round, _voter);\\n }\\n}\\n\",\"keccak256\":\"0xc5a693d61c5d0e24f8d23022ded81e734742a7948c7e59831e1f4bb3e1928416\",\"license\":\"MIT\"},\"contracts/interfaces/IQuorum.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IQuorum {\\n /// @dev Emitted when the threshold is updated\\n event ThresholdUpdated(\\n uint256 indexed nonce,\\n uint256 indexed numerator,\\n uint256 indexed denominator,\\n uint256 previousNumerator,\\n uint256 previousDenominator\\n );\\n\\n /**\\n * @dev Returns the threshold.\\n */\\n function getThreshold() external view returns (uint256 _num, uint256 _denom);\\n\\n /**\\n * @dev Checks whether the `_voteWeight` passes the threshold.\\n */\\n function checkThreshold(uint256 _voteWeight) external view returns (bool);\\n\\n /**\\n * @dev Returns the minimum vote weight to pass the threshold.\\n */\\n function minimumVoteWeight() external view returns (uint256);\\n\\n /**\\n * @dev Sets the threshold.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `ThresholdUpdated` event.\\n *\\n */\\n function setThreshold(\\n uint256 _numerator,\\n uint256 _denominator\\n ) external returns (uint256 _previousNum, uint256 _previousDenom);\\n}\\n\",\"keccak256\":\"0x6b7920b04a73a0e1ff7404aa1a3b5fc738fc0b6154839480f666fd69b55123f0\",\"license\":\"MIT\"},\"contracts/interfaces/bridge/IBridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IBridgeManagerEvents } from \\\"./events/IBridgeManagerEvents.sol\\\";\\n\\n/**\\n * @title IBridgeManager\\n * @dev The interface for managing bridge operators.\\n */\\ninterface IBridgeManager is IBridgeManagerEvents {\\n /**\\n * @dev The domain separator used for computing hash digests in the contract.\\n */\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n\\n /**\\n * @dev Returns the total number of bridge operators.\\n * @return The total number of bridge operators.\\n */\\n function totalBridgeOperators() external view returns (uint256);\\n\\n /**\\n * @dev Checks if the given address is a bridge operator.\\n * @param addr The address to check.\\n * @return A boolean indicating whether the address is a bridge operator.\\n */\\n function isBridgeOperator(address addr) external view returns (bool);\\n\\n /**\\n * @dev Retrieves the full information of all registered bridge operators.\\n *\\n * This external function allows external callers to obtain the full information of all the registered bridge operators.\\n * The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.\\n *\\n * @return governors An array of addresses representing the governors of each bridge operator.\\n * @return bridgeOperators An array of addresses representing the registered bridge operators.\\n * @return weights An array of uint256 values representing the vote weights of each bridge operator.\\n *\\n * Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator.\\n *\\n * Example Usage:\\n * ```\\n * (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos();\\n * for (uint256 i = 0; i < bridgeOperators.length; i++) {\\n * // Access individual information for each bridge operator.\\n * address governor = governors[i];\\n * address bridgeOperator = bridgeOperators[i];\\n * uint256 weight = weights[i];\\n * // ... (Process or use the information as required) ...\\n * }\\n * ```\\n *\\n */\\n function getFullBridgeOperatorInfos()\\n external\\n view\\n returns (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights);\\n\\n /**\\n * @dev Returns total weights of the governor list.\\n */\\n function sumGovernorsWeight(address[] calldata governors) external view returns (uint256 sum);\\n\\n /**\\n * @dev Returns total weights.\\n */\\n function getTotalWeights() external view returns (uint256);\\n\\n /**\\n * @dev Returns an array of all bridge operators.\\n * @return An array containing the addresses of all bridge operators.\\n */\\n function getBridgeOperators() external view returns (address[] memory);\\n\\n /**\\n * @dev Returns an array of bridge operators correspoding to governor addresses.\\n * @return bridgeOperators_ An array containing the addresses of all bridge operators.\\n */\\n function getBridgeOperatorOf(address[] calldata gorvernors) external view returns (address[] memory bridgeOperators_);\\n\\n /**\\n * @dev Retrieves the governors corresponding to a given array of bridge operators.\\n * This external function allows external callers to obtain the governors associated with a given array of bridge operators.\\n * The function takes an input array `bridgeOperators` containing bridge operator addresses and returns an array of corresponding governors.\\n * @param bridgeOperators An array of bridge operator addresses for which governors are to be retrieved.\\n * @return governors An array of addresses representing the governors corresponding to the provided bridge operators.\\n */\\n function getGovernorsOf(address[] calldata bridgeOperators) external view returns (address[] memory governors);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific governor.\\n * @param governor The address of the governor to get the vote weight for.\\n * @return voteWeight The vote weight of the specified governor.\\n */\\n function getGovernorWeight(address governor) external view returns (uint256);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific bridge operator.\\n * @param bridgeOperator The address of the bridge operator to get the vote weight for.\\n * @return weight The vote weight of the specified bridge operator.\\n */\\n function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint256 weight);\\n\\n /**\\n * @dev Returns the weights of a list of governor addresses.\\n */\\n function getGovernorWeights(address[] calldata governors) external view returns (uint256[] memory weights);\\n\\n /**\\n * @dev Returns an array of all governors.\\n * @return An array containing the addresses of all governors.\\n */\\n function getGovernors() external view returns (address[] memory);\\n\\n /**\\n * @dev Adds multiple bridge operators.\\n * @param governors An array of addresses of hot/cold wallets for bridge operator to update their node address.\\n * @param bridgeOperators An array of addresses representing the bridge operators to add.\\n * @return addeds An array of booleans indicating whether each bridge operator was added successfully.\\n *\\n * Note: return boolean array `addeds` indicates whether a group (voteWeight, governor, operator) are recorded.\\n * It is expected that FE/BE staticcall to the function first to get the return values and handle it correctly.\\n * Governors are expected to see the outcome of this function and decide if they want to vote for the proposal or not.\\n *\\n * Example Usage:\\n * Making an `eth_call` in ethers.js\\n * ```\\n * const {addeds} = await bridgeManagerContract.callStatic.addBridgeOperators(\\n * voteWeights,\\n * governors,\\n * bridgeOperators,\\n * // overriding the caller to the contract itself since we use `onlySelfCall` guard\\n * {from: bridgeManagerContract.address}\\n * )\\n * const filteredOperators = bridgeOperators.filter((_, index) => addeds[index]);\\n * const filteredWeights = weights.filter((_, index) => addeds[index]);\\n * const filteredGovernors = governors.filter((_, index) => addeds[index]);\\n * // ... (Process or use the information as required) ...\\n * ```\\n */\\n function addBridgeOperators(\\n uint96[] calldata voteWeights,\\n address[] calldata governors,\\n address[] calldata bridgeOperators\\n ) external returns (bool[] memory addeds);\\n\\n /**\\n * @dev Removes multiple bridge operators.\\n * @param bridgeOperators An array of addresses representing the bridge operators to remove.\\n * @return removeds An array of booleans indicating whether each bridge operator was removed successfully.\\n *\\n * * Note: return boolean array `removeds` indicates whether a group (voteWeight, governor, operator) are recorded.\\n * It is expected that FE/BE staticcall to the function first to get the return values and handle it correctly.\\n * Governors are expected to see the outcome of this function and decide if they want to vote for the proposal or not.\\n *\\n * Example Usage:\\n * Making an `eth_call` in ethers.js\\n * ```\\n * const {removeds} = await bridgeManagerContract.callStatic.removeBridgeOperators(\\n * bridgeOperators,\\n * // overriding the caller to the contract itself since we use `onlySelfCall` guard\\n * {from: bridgeManagerContract.address}\\n * )\\n * const filteredOperators = bridgeOperators.filter((_, index) => removeds[index]);\\n * // ... (Process or use the information as required) ...\\n * ```\\n */\\n function removeBridgeOperators(address[] calldata bridgeOperators) external returns (bool[] memory removeds);\\n\\n /**\\n * @dev Governor updates their corresponding governor and/or operator address.\\n * Requirements:\\n * - The caller must the governor of the operator that is requested changes.\\n * @param bridgeOperator The address of the bridge operator to update.\\n */\\n function updateBridgeOperator(address bridgeOperator) external;\\n}\\n\",\"keccak256\":\"0x0ae26d2b1ed9b67b4eed4f1957ef3c399be7a944b6fa36ff9a0b476de5c3eb7a\",\"license\":\"MIT\"},\"contracts/interfaces/bridge/IBridgeManagerCallback.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @title IBridgeManagerCallback\\n * @dev Interface for the callback functions to be implemented by the Bridge Manager contract.\\n */\\ninterface IBridgeManagerCallback is IERC165 {\\n /**\\n * @dev Handles the event when bridge operators are added.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @param addeds The corresponding boolean values indicating whether the operators were added or not.\\n * @return selector The selector of the function being called.\\n */\\n function onBridgeOperatorsAdded(\\n address[] memory bridgeOperators,\\n bool[] memory addeds\\n ) external returns (bytes4 selector);\\n\\n /**\\n * @dev Handles the event when bridge operators are removed.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @param removeds The corresponding boolean values indicating whether the operators were removed or not.\\n * @return selector The selector of the function being called.\\n */\\n function onBridgeOperatorsRemoved(\\n address[] memory bridgeOperators,\\n bool[] memory removeds\\n ) external returns (bytes4 selector);\\n\\n /**\\n * @dev Handles the event when a bridge operator is updated.\\n * @param currentBridgeOperator The address of the current bridge operator.\\n * @param newbridgeOperator The new address of the bridge operator.\\n * @return selector The selector of the function being called.\\n */\\n function onBridgeOperatorUpdated(\\n address currentBridgeOperator,\\n address newbridgeOperator\\n ) external returns (bytes4 selector);\\n}\\n\",\"keccak256\":\"0xfd6868a1041577a463b6c96713edcb18063dc817154d09710abfd5783e4629ee\",\"license\":\"MIT\"},\"contracts/interfaces/bridge/IBridgeManagerCallbackRegister.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeManagerCallbackRegister {\\n /**\\n * @dev Emitted when the contract notifies multiple registers with statuses and return data.\\n */\\n event Notified(bytes callData, address[] registers, bool[] statuses, bytes[] returnDatas);\\n\\n /**\\n * @dev Retrieves the addresses of registered callbacks.\\n * @return registers An array containing the addresses of registered callbacks.\\n */\\n function getCallbackRegisters() external view returns (address[] memory registers);\\n\\n /**\\n * @dev Registers multiple callbacks with the bridge.\\n * @param registers The array of callback addresses to register.\\n * @return registereds An array indicating the success status of each registration.\\n */\\n function registerCallbacks(address[] calldata registers) external returns (bool[] memory registereds);\\n\\n /**\\n * @dev Unregisters multiple callbacks from the bridge.\\n * @param registers The array of callback addresses to unregister.\\n * @return unregistereds An array indicating the success status of each unregistration.\\n */\\n function unregisterCallbacks(address[] calldata registers) external returns (bool[] memory unregistereds);\\n}\\n\",\"keccak256\":\"0xadbcf65ee9d55f4aa037216d71a279fe41855fe572a4a8734e6f69954aea98f4\",\"license\":\"MIT\"},\"contracts/interfaces/bridge/events/IBridgeManagerEvents.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeManagerEvents {\\n /**\\n * @dev The structure representing information about a bridge operator.\\n * @param addr The address of the bridge operator.\\n * @param voteWeight The vote weight assigned to the bridge operator.\\n */\\n struct BridgeOperatorInfo {\\n address addr;\\n uint96 voteWeight;\\n }\\n\\n /**\\n * @dev Emitted when new bridge operators are added.\\n * @param statuses The array of boolean values represents whether the corresponding bridge operator is added successfully.\\n * @param voteWeights The array of vote weights assigned to the added bridge operators.\\n * @param governors The array of addresses representing the governors associated with the added bridge operators.\\n * @param bridgeOperators The array of addresses representing the added bridge operators.\\n */\\n event BridgeOperatorsAdded(bool[] statuses, uint96[] voteWeights, address[] governors, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when bridge operators are removed.\\n * @param statuses The array of boolean values representing the statuses of the removed bridge operators.\\n * @param bridgeOperators The array of addresses representing the removed bridge operators.\\n */\\n event BridgeOperatorsRemoved(bool[] statuses, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is updated.\\n * @param governor The address of the governor initiating the update.\\n * @param fromBridgeOperator The address of the bridge operator being updated.\\n * @param toBridgeOperator The updated address of the bridge operator.\\n */\\n event BridgeOperatorUpdated(\\n address indexed governor,\\n address indexed fromBridgeOperator,\\n address indexed toBridgeOperator\\n );\\n}\\n\",\"keccak256\":\"0x217fff41c4a9ca72d142c5a2120bb1b5e67bf5bf5aa0f6128450116aebc07b8d\",\"license\":\"MIT\"},\"contracts/interfaces/collections/IHasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport { ContractType } from \\\"../../utils/ContractType.sol\\\";\\n\\ninterface IHasContracts {\\n /// @dev Error of invalid role.\\n error ErrContractTypeNotFound(ContractType contractType);\\n\\n /// @dev Emitted when a contract is updated.\\n event ContractUpdated(ContractType indexed contractType, address indexed addr);\\n\\n /**\\n * @dev Returns the address of a contract with a specific role.\\n * Throws an error if no contract is set for the specified role.\\n *\\n * @param contractType The role of the contract to retrieve.\\n * @return contract_ The address of the contract with the specified role.\\n */\\n function getContract(ContractType contractType) external view returns (address contract_);\\n\\n /**\\n * @dev Sets the address of a contract with a specific role.\\n * Emits the event {ContractUpdated}.\\n * @param contractType The role of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function setContract(ContractType contractType, address addr) external;\\n}\\n\",\"keccak256\":\"0x99d8213d857e30d367155abd15dc42730afdfbbac3a22dfb3b95ffea2083a92e\",\"license\":\"MIT\"},\"contracts/interfaces/consumers/ChainTypeConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface ChainTypeConsumer {\\n enum ChainType {\\n RoninChain,\\n Mainchain\\n }\\n}\\n\",\"keccak256\":\"0xe0d20e00c8d237f8e0fb881abf1ff1ef114173bcb428f06f689c581666a22db7\",\"license\":\"MIT\"},\"contracts/interfaces/consumers/SignatureConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface SignatureConsumer {\\n struct Signature {\\n uint8 v;\\n bytes32 r;\\n bytes32 s;\\n }\\n}\\n\",\"keccak256\":\"0xd370e350722067097dec1a5c31bda6e47e83417fa5c3288293bb910028cd136b\",\"license\":\"MIT\"},\"contracts/interfaces/consumers/VoteStatusConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface VoteStatusConsumer {\\n enum VoteStatus {\\n Pending,\\n Approved,\\n Executed,\\n Rejected,\\n Expired\\n }\\n}\\n\",\"keccak256\":\"0xa5045232c0c053fcf31fb3fe71942344444159c48d5f1b2063dbb06b6a1c9752\",\"license\":\"MIT\"},\"contracts/libraries/AddressArrayUtils.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\nlibrary AddressArrayUtils {\\n /**\\n * @dev Error thrown when a duplicated element is detected in an array.\\n * @param msgSig The function signature that invoke the error.\\n */\\n error ErrDuplicated(bytes4 msgSig);\\n\\n /**\\n * @dev Returns whether or not there's a duplicate. Runs in O(n^2).\\n * @param A Array to search\\n * @return Returns true if duplicate, false otherwise\\n */\\n function hasDuplicate(address[] memory A) internal pure returns (bool) {\\n if (A.length == 0) {\\n return false;\\n }\\n unchecked {\\n for (uint256 i = 0; i < A.length - 1; i++) {\\n for (uint256 j = i + 1; j < A.length; j++) {\\n if (A[i] == A[j]) {\\n return true;\\n }\\n }\\n }\\n }\\n return false;\\n }\\n\\n /**\\n * @dev Returns whether two arrays of addresses are equal or not.\\n */\\n function isEqual(address[] memory _this, address[] memory _other) internal pure returns (bool yes_) {\\n // Hashing two arrays and compare their hash\\n assembly {\\n let _thisHash := keccak256(add(_this, 32), mul(mload(_this), 32))\\n let _otherHash := keccak256(add(_other, 32), mul(mload(_other), 32))\\n yes_ := eq(_thisHash, _otherHash)\\n }\\n }\\n\\n /**\\n * @dev Return the concatenated array from a and b.\\n */\\n function extend(address[] memory a, address[] memory b) internal pure returns (address[] memory c) {\\n uint256 lengthA = a.length;\\n uint256 lengthB = b.length;\\n unchecked {\\n c = new address[](lengthA + lengthB);\\n }\\n uint256 i;\\n for (; i < lengthA; ) {\\n c[i] = a[i];\\n unchecked {\\n ++i;\\n }\\n }\\n for (uint256 j; j < lengthB; ) {\\n c[i] = b[j];\\n unchecked {\\n ++i;\\n ++j;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xaf760162653a85d6e1b24df4d33c74076f778470112f421a02050fb981242001\",\"license\":\"UNLICENSED\"},\"contracts/libraries/Ballot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\n\\nlibrary Ballot {\\n using ECDSA for bytes32;\\n\\n enum VoteType {\\n For,\\n Against\\n }\\n\\n // keccak256(\\\"Ballot(bytes32 proposalHash,uint8 support)\\\");\\n bytes32 private constant BALLOT_TYPEHASH = 0xd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2;\\n\\n function hash(bytes32 _proposalHash, VoteType _support) internal pure returns (bytes32 digest) {\\n // return keccak256(abi.encode(BALLOT_TYPEHASH, _proposalHash, _support));\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, BALLOT_TYPEHASH)\\n mstore(add(ptr, 0x20), _proposalHash)\\n mstore(add(ptr, 0x40), _support)\\n digest := keccak256(ptr, 0x60)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xaa1e66bcd86baa6f18c7c5e9b67496535f229cbd2e2ecb4c66bcbfed2b1365de\",\"license\":\"MIT\"},\"contracts/libraries/BridgeOperatorsBallot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"../utils/CommonErrors.sol\\\";\\n\\nlibrary BridgeOperatorsBallot {\\n /**\\n * @dev Error thrown when an invalid order of the bridge operator is detected.\\n */\\n error ErrInvalidOrderOfBridgeOperator();\\n\\n struct BridgeOperatorSet {\\n uint256 period;\\n uint256 epoch;\\n address[] operators;\\n }\\n\\n // keccak256(\\\"BridgeOperatorsBallot(uint256 period,uint256 epoch,address[] operators)\\\");\\n bytes32 public constant BRIDGE_OPERATORS_BALLOT_TYPEHASH =\\n 0xd679a49e9e099fa9ed83a5446aaec83e746b03ec6723d6f5efb29d37d7f0b78a;\\n\\n /**\\n * @dev Verifies whether the ballot is valid or not.\\n *\\n * Requirements:\\n * - The ballot is not for an empty operator set.\\n * - The operator address list is in order.\\n *\\n */\\n function verifyBallot(BridgeOperatorSet calldata _ballot) internal pure {\\n if (_ballot.operators.length == 0) revert ErrEmptyArray();\\n\\n address _addr = _ballot.operators[0];\\n for (uint _i = 1; _i < _ballot.operators.length; ) {\\n if (_addr >= _ballot.operators[_i]) revert ErrInvalidOrderOfBridgeOperator();\\n _addr = _ballot.operators[_i];\\n unchecked {\\n ++_i;\\n }\\n }\\n }\\n\\n /**\\n * @dev Returns hash of the ballot.\\n */\\n function hash(BridgeOperatorSet memory self) internal pure returns (bytes32 digest_) {\\n bytes32 operatorsHash;\\n address[] memory operators = self.operators;\\n\\n // return keccak256(abi.encode(BRIDGE_OPERATORS_BALLOT_TYPEHASH, _ballot.period, _ballot.epoch, _operatorsHash));\\n assembly {\\n operatorsHash := keccak256(add(operators, 32), mul(mload(operators), 32))\\n let ptr := mload(0x40)\\n mstore(ptr, BRIDGE_OPERATORS_BALLOT_TYPEHASH)\\n mstore(add(ptr, 0x20), mload(self)) // _ballot.period\\n mstore(add(ptr, 0x40), mload(add(self, 0x20))) // _ballot.epoch\\n mstore(add(ptr, 0x60), operatorsHash)\\n digest_ := keccak256(ptr, 0x80)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7671f6e599d5a33fa1e97538b1c8e04159337da5701eb6fa07b29d0566f57f81\",\"license\":\"MIT\"},\"contracts/libraries/GlobalProposal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./Proposal.sol\\\";\\n\\nlibrary GlobalProposal {\\n /**\\n * @dev Error thrown when attempting to interact with an unsupported target.\\n */\\n error ErrUnsupportedTarget(bytes32 proposalHash, uint256 targetNumber);\\n\\n enum TargetOption {\\n /* 0 */ BridgeManager,\\n /* 1 */ GatewayContract,\\n /* 2 */ BridgeReward,\\n /* 3 */ BridgeSlash\\n }\\n\\n struct GlobalProposalDetail {\\n // Nonce to make sure proposals are executed in order\\n uint256 nonce;\\n uint256 expiryTimestamp;\\n TargetOption[] targetOptions;\\n uint256[] values;\\n bytes[] calldatas;\\n uint256[] gasAmounts;\\n }\\n\\n // keccak256(\\\"GlobalProposalDetail(uint256 nonce,uint256 expiryTimestamp,uint8[] targetOptions,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)\\\");\\n bytes32 public constant TYPE_HASH = 0x1463f426c05aff2c1a7a0957a71c9898bc8b47142540538e79ee25ee91141350;\\n\\n /**\\n * @dev Returns struct hash of the proposal.\\n */\\n function hash(GlobalProposalDetail memory self) internal pure returns (bytes32 digest_) {\\n uint256[] memory values = self.values;\\n TargetOption[] memory targets = self.targetOptions;\\n bytes32[] memory calldataHashList = new bytes32[](self.calldatas.length);\\n uint256[] memory gasAmounts = self.gasAmounts;\\n\\n for (uint256 i; i < calldataHashList.length; ) {\\n calldataHashList[i] = keccak256(self.calldatas[i]);\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n /*\\n * return\\n * keccak256(\\n * abi.encode(\\n * TYPE_HASH,\\n * _proposal.nonce,\\n * _proposal.expiryTimestamp,\\n * _targetsHash,\\n * _valuesHash,\\n * _calldatasHash,\\n * _gasAmountsHash\\n * )\\n * );\\n */\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, TYPE_HASH)\\n mstore(add(ptr, 0x20), mload(self)) // _proposal.nonce\\n mstore(add(ptr, 0x40), mload(add(self, 0x20))) // _proposal.expiryTimestamp\\n\\n let arrayHashed\\n arrayHashed := keccak256(add(targets, 32), mul(mload(targets), 32)) // targetsHash\\n mstore(add(ptr, 0x60), arrayHashed)\\n arrayHashed := keccak256(add(values, 32), mul(mload(values), 32)) // _valuesHash\\n mstore(add(ptr, 0x80), arrayHashed)\\n arrayHashed := keccak256(add(calldataHashList, 32), mul(mload(calldataHashList), 32)) // _calldatasHash\\n mstore(add(ptr, 0xa0), arrayHashed)\\n arrayHashed := keccak256(add(gasAmounts, 32), mul(mload(gasAmounts), 32)) // _gasAmountsHash\\n mstore(add(ptr, 0xc0), arrayHashed)\\n digest_ := keccak256(ptr, 0xe0)\\n }\\n }\\n\\n /**\\n * @dev Converts into the normal proposal.\\n */\\n function intoProposalDetail(\\n GlobalProposalDetail memory self,\\n address[] memory targets\\n ) internal pure returns (Proposal.ProposalDetail memory detail_) {\\n detail_.nonce = self.nonce;\\n detail_.expiryTimestamp = self.expiryTimestamp;\\n detail_.chainId = 0;\\n detail_.targets = new address[](self.targetOptions.length);\\n detail_.values = self.values;\\n detail_.calldatas = self.calldatas;\\n detail_.gasAmounts = self.gasAmounts;\\n\\n for (uint256 i; i < self.targetOptions.length; ) {\\n detail_.targets[i] = targets[i];\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9c5479df6c49da6ce1addc4779b4e5a1a203148062594f9f70a416dea20b83e1\",\"license\":\"MIT\"},\"contracts/libraries/IsolatedGovernance.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../interfaces/consumers/VoteStatusConsumer.sol\\\";\\nimport \\\"../utils/CommonErrors.sol\\\";\\n\\nlibrary IsolatedGovernance {\\n struct Vote {\\n VoteStatusConsumer.VoteStatus status;\\n bytes32 finalHash;\\n /// @dev Mapping from voter => receipt hash\\n mapping(address => bytes32) voteHashOf;\\n /// @dev The timestamp that voting is expired (no expiration=0)\\n uint256 expiredAt;\\n /// @dev The timestamp that voting is created\\n uint256 createdAt;\\n /// @dev The list of voters\\n address[] voters;\\n }\\n\\n /**\\n * @dev Casts vote for the receipt with the receipt hash `_hash`.\\n *\\n * Requirements:\\n * - The voter has not voted for the round.\\n *\\n */\\n function castVote(Vote storage _v, address _voter, bytes32 _hash) internal {\\n if (_v.expiredAt > 0 && _v.expiredAt <= block.timestamp) {\\n _v.status = VoteStatusConsumer.VoteStatus.Expired;\\n }\\n\\n if (voted(_v, _voter)) revert ErrAlreadyVoted(_voter);\\n\\n _v.voteHashOf[_voter] = _hash;\\n _v.voters.push(_voter);\\n }\\n\\n /**\\n * @dev Updates vote with the requirement of minimum vote weight.\\n */\\n function syncVoteStatus(\\n Vote storage _v,\\n uint256 _minimumVoteWeight,\\n uint256 _votedWeightForHash,\\n bytes32 _hash\\n ) internal returns (VoteStatusConsumer.VoteStatus _status) {\\n if (_votedWeightForHash >= _minimumVoteWeight && _v.status == VoteStatusConsumer.VoteStatus.Pending) {\\n _v.status = VoteStatusConsumer.VoteStatus.Approved;\\n _v.finalHash = _hash;\\n }\\n\\n return _v.status;\\n }\\n\\n /**\\n * @dev Returns the list of vote's addresses that voted for the hash `_hash`.\\n */\\n function filterByHash(Vote storage _v, bytes32 _hash) internal view returns (address[] memory _voters) {\\n uint256 _count;\\n _voters = new address[](_v.voters.length);\\n\\n unchecked {\\n for (uint _i; _i < _voters.length; ++_i) {\\n address _voter = _v.voters[_i];\\n if (_v.voteHashOf[_voter] == _hash) {\\n _voters[_count++] = _voter;\\n }\\n }\\n }\\n\\n assembly {\\n mstore(_voters, _count)\\n }\\n }\\n\\n /**\\n * @dev Returns whether the voter casted for the proposal.\\n */\\n function voted(Vote storage _v, address _voter) internal view returns (bool) {\\n return _v.voteHashOf[_voter] != bytes32(0);\\n }\\n}\\n\",\"keccak256\":\"0xa6a1e04b914580c099ac87f65ec24c35445eee34809e3decf1c57b6c52942d36\",\"license\":\"MIT\"},\"contracts/libraries/Proposal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ErrInvalidChainId, ErrLengthMismatch } from \\\"../utils/CommonErrors.sol\\\";\\n\\nlibrary Proposal {\\n /**\\n * @dev Error thrown when there is insufficient gas to execute a function.\\n */\\n error ErrInsufficientGas(bytes32 proposalHash);\\n\\n /**\\n * @dev Error thrown when an invalid expiry timestamp is provided.\\n */\\n error ErrInvalidExpiryTimestamp();\\n\\n struct ProposalDetail {\\n // Nonce to make sure proposals are executed in order\\n uint256 nonce;\\n // Value 0: all chain should run this proposal\\n // Other values: only specifc chain has to execute\\n uint256 chainId;\\n uint256 expiryTimestamp;\\n address[] targets;\\n uint256[] values;\\n bytes[] calldatas;\\n uint256[] gasAmounts;\\n }\\n\\n // keccak256(\\\"ProposalDetail(uint256 nonce,uint256 chainId,uint256 expiryTimestamp,address[] targets,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)\\\");\\n bytes32 public constant TYPE_HASH = 0xd051578048e6ff0bbc9fca3b65a42088dbde10f36ca841de566711087ad9b08a;\\n\\n /**\\n * @dev Validates the proposal.\\n */\\n function validate(ProposalDetail memory _proposal, uint256 _maxExpiryDuration) internal view {\\n if (\\n !(_proposal.targets.length > 0 &&\\n _proposal.targets.length == _proposal.values.length &&\\n _proposal.targets.length == _proposal.calldatas.length &&\\n _proposal.targets.length == _proposal.gasAmounts.length)\\n ) {\\n revert ErrLengthMismatch(msg.sig);\\n }\\n\\n if (_proposal.expiryTimestamp > block.timestamp + _maxExpiryDuration) {\\n revert ErrInvalidExpiryTimestamp();\\n }\\n }\\n\\n /**\\n * @dev Returns struct hash of the proposal.\\n */\\n function hash(ProposalDetail memory _proposal) internal pure returns (bytes32 digest_) {\\n uint256[] memory _values = _proposal.values;\\n address[] memory _targets = _proposal.targets;\\n bytes32[] memory _calldataHashList = new bytes32[](_proposal.calldatas.length);\\n uint256[] memory _gasAmounts = _proposal.gasAmounts;\\n\\n for (uint256 _i; _i < _calldataHashList.length; ) {\\n _calldataHashList[_i] = keccak256(_proposal.calldatas[_i]);\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n\\n // return\\n // keccak256(\\n // abi.encode(\\n // TYPE_HASH,\\n // _proposal.nonce,\\n // _proposal.chainId,\\n // _targetsHash,\\n // _valuesHash,\\n // _calldatasHash,\\n // _gasAmountsHash\\n // )\\n // );\\n // /\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, TYPE_HASH)\\n mstore(add(ptr, 0x20), mload(_proposal)) // _proposal.nonce\\n mstore(add(ptr, 0x40), mload(add(_proposal, 0x20))) // _proposal.chainId\\n mstore(add(ptr, 0x60), mload(add(_proposal, 0x40))) // expiry timestamp\\n\\n let arrayHashed\\n arrayHashed := keccak256(add(_targets, 32), mul(mload(_targets), 32)) // targetsHash\\n mstore(add(ptr, 0x80), arrayHashed)\\n arrayHashed := keccak256(add(_values, 32), mul(mload(_values), 32)) // _valuesHash\\n mstore(add(ptr, 0xa0), arrayHashed)\\n arrayHashed := keccak256(add(_calldataHashList, 32), mul(mload(_calldataHashList), 32)) // _calldatasHash\\n mstore(add(ptr, 0xc0), arrayHashed)\\n arrayHashed := keccak256(add(_gasAmounts, 32), mul(mload(_gasAmounts), 32)) // _gasAmountsHash\\n mstore(add(ptr, 0xe0), arrayHashed)\\n digest_ := keccak256(ptr, 0x100)\\n }\\n }\\n\\n /**\\n * @dev Returns whether the proposal is executable for the current chain.\\n *\\n * @notice Does not check whether the call result is successful or not. Please use `execute` instead.\\n *\\n */\\n function executable(ProposalDetail memory _proposal) internal view returns (bool _result) {\\n return _proposal.chainId == 0 || _proposal.chainId == block.chainid;\\n }\\n\\n /**\\n * @dev Executes the proposal.\\n */\\n function execute(\\n ProposalDetail memory _proposal\\n ) internal returns (bool[] memory _successCalls, bytes[] memory _returnDatas) {\\n if (!executable(_proposal)) revert ErrInvalidChainId(msg.sig, _proposal.chainId, block.chainid);\\n\\n _successCalls = new bool[](_proposal.targets.length);\\n _returnDatas = new bytes[](_proposal.targets.length);\\n for (uint256 _i = 0; _i < _proposal.targets.length; ) {\\n if (gasleft() <= _proposal.gasAmounts[_i]) revert ErrInsufficientGas(hash(_proposal));\\n\\n (_successCalls[_i], _returnDatas[_i]) = _proposal.targets[_i].call{\\n value: _proposal.values[_i],\\n gas: _proposal.gasAmounts[_i]\\n }(_proposal.calldatas[_i]);\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbc29aa4e69db7eef0034fdb795181124f86bcf2bc07b5e4a202100dbdce7f7a1\",\"license\":\"MIT\"},\"contracts/ronin/gateway/RoninBridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ContractType, RoleAccess, ErrUnauthorized, BridgeManager } from \\\"../../extensions/bridge-operator-governance/BridgeManager.sol\\\";\\nimport { Ballot, GlobalProposal, Proposal, GovernanceProposal } from \\\"../../extensions/sequential-governance/governance-proposal/GovernanceProposal.sol\\\";\\nimport { CoreGovernance, GlobalCoreGovernance, GlobalGovernanceProposal } from \\\"../../extensions/sequential-governance/governance-proposal/GlobalGovernanceProposal.sol\\\";\\nimport { IsolatedGovernance } from \\\"../../libraries/IsolatedGovernance.sol\\\";\\nimport { BridgeOperatorsBallot } from \\\"../../libraries/BridgeOperatorsBallot.sol\\\";\\nimport { VoteStatusConsumer } from \\\"../../interfaces/consumers/VoteStatusConsumer.sol\\\";\\nimport { ErrQueryForEmptyVote } from \\\"../../utils/CommonErrors.sol\\\";\\n\\ncontract RoninBridgeManager is BridgeManager, GovernanceProposal, GlobalGovernanceProposal {\\n using IsolatedGovernance for IsolatedGovernance.Vote;\\n\\n constructor(\\n uint256 num,\\n uint256 denom,\\n uint256 roninChainId,\\n uint256 expiryDuration,\\n address bridgeContract,\\n address[] memory callbackRegisters,\\n address[] memory bridgeOperators,\\n address[] memory governors,\\n uint96[] memory voteWeights,\\n GlobalProposal.TargetOption[] memory targetOptions,\\n address[] memory targets\\n )\\n payable\\n CoreGovernance(expiryDuration)\\n GlobalCoreGovernance(targetOptions, targets)\\n BridgeManager(num, denom, roninChainId, bridgeContract, callbackRegisters, bridgeOperators, governors, voteWeights)\\n {}\\n\\n /**\\n * CURRENT NETWORK\\n */\\n\\n /**\\n * @dev See `CoreGovernance-_proposeProposal`.\\n *\\n * Requirements:\\n * - The method caller is governor.\\n *\\n */\\n function propose(\\n uint256 _chainId,\\n uint256 _expiryTimestamp,\\n address[] calldata _targets,\\n uint256[] calldata _values,\\n bytes[] calldata _calldatas,\\n uint256[] calldata _gasAmounts\\n ) external onlyGovernor {\\n _proposeProposal(_chainId, _expiryTimestamp, _targets, _values, _calldatas, _gasAmounts, msg.sender);\\n }\\n\\n /**\\n * @dev See `GovernanceProposal-_proposeProposalStructAndCastVotes`.\\n *\\n * Requirements:\\n * - The method caller is governor.\\n * - The proposal is for the current network.\\n *\\n */\\n function proposeProposalStructAndCastVotes(\\n Proposal.ProposalDetail calldata _proposal,\\n Ballot.VoteType[] calldata _supports,\\n Signature[] calldata _signatures\\n ) external onlyGovernor {\\n _proposeProposalStructAndCastVotes(_proposal, _supports, _signatures, DOMAIN_SEPARATOR, msg.sender);\\n }\\n\\n /**\\n * @dev Proposes and casts vote for a proposal on the current network.\\n *\\n * Requirements:\\n * - The method caller is governor.\\n * - The proposal is for the current network.\\n *\\n */\\n function proposeProposalForCurrentNetwork(\\n uint256 expiryTimestamp,\\n address[] calldata targets,\\n uint256[] calldata values,\\n bytes[] calldata calldatas,\\n uint256[] calldata gasAmounts,\\n Ballot.VoteType support\\n ) external onlyGovernor {\\n address _voter = msg.sender;\\n Proposal.ProposalDetail memory _proposal = _proposeProposal({\\n chainId: block.chainid,\\n expiryTimestamp: expiryTimestamp,\\n targets: targets,\\n values: values,\\n calldatas: calldatas,\\n gasAmounts: gasAmounts,\\n creator: _voter\\n });\\n _castProposalVoteForCurrentNetwork(_voter, _proposal, support);\\n }\\n\\n /**\\n * @dev Casts vote for a proposal on the current network.\\n *\\n * Requirements:\\n * - The method caller is governor.\\n *\\n */\\n function castProposalVoteForCurrentNetwork(\\n Proposal.ProposalDetail calldata proposal,\\n Ballot.VoteType support\\n ) external onlyGovernor {\\n _castProposalVoteForCurrentNetwork(msg.sender, proposal, support);\\n }\\n\\n /**\\n * @dev See `GovernanceProposal-_castProposalBySignatures`.\\n */\\n function castProposalBySignatures(\\n Proposal.ProposalDetail calldata proposal,\\n Ballot.VoteType[] calldata supports_,\\n Signature[] calldata signatures\\n ) external {\\n _castProposalBySignatures(proposal, supports_, signatures, DOMAIN_SEPARATOR);\\n }\\n\\n /**\\n * GLOBAL NETWORK\\n */\\n\\n /**\\n * @dev See `CoreGovernance-_proposeGlobal`.\\n *\\n * Requirements:\\n * - The method caller is governor.\\n *\\n */\\n function proposeGlobal(\\n uint256 expiryTimestamp,\\n GlobalProposal.TargetOption[] calldata targetOptions,\\n uint256[] calldata values,\\n bytes[] calldata calldatas,\\n uint256[] calldata gasAmounts\\n ) external onlyGovernor {\\n _proposeGlobal({\\n expiryTimestamp: expiryTimestamp,\\n targetOptions: targetOptions,\\n values: values,\\n calldatas: calldatas,\\n gasAmounts: gasAmounts,\\n creator: msg.sender\\n });\\n }\\n\\n /**\\n * @dev See `GovernanceProposal-_proposeGlobalProposalStructAndCastVotes`.\\n *\\n * Requirements:\\n * - The method caller is governor.\\n *\\n */\\n function proposeGlobalProposalStructAndCastVotes(\\n GlobalProposal.GlobalProposalDetail calldata globalProposal,\\n Ballot.VoteType[] calldata supports_,\\n Signature[] calldata signatures\\n ) external onlyGovernor {\\n _proposeGlobalProposalStructAndCastVotes({\\n globalProposal: globalProposal,\\n supports_: supports_,\\n signatures: signatures,\\n domainSeparator: DOMAIN_SEPARATOR,\\n creator: msg.sender\\n });\\n }\\n\\n /**\\n * @dev See `GovernanceProposal-_castGlobalProposalBySignatures`.\\n */\\n function castGlobalProposalBySignatures(\\n GlobalProposal.GlobalProposalDetail calldata globalProposal,\\n Ballot.VoteType[] calldata supports_,\\n Signature[] calldata signatures\\n ) external {\\n _castGlobalProposalBySignatures({\\n globalProposal: globalProposal,\\n supports_: supports_,\\n signatures: signatures,\\n domainSeparator: DOMAIN_SEPARATOR\\n });\\n }\\n\\n /**\\n * COMMON METHODS\\n */\\n\\n /**\\n * @dev Deletes the expired proposal by its chainId and nonce, without creating a new proposal.\\n *\\n * Requirements:\\n * - The proposal is already created.\\n *\\n */\\n function deleteExpired(uint256 _chainId, uint256 _round) external {\\n ProposalVote storage _vote = vote[_chainId][_round];\\n if (_vote.hash == 0) revert ErrQueryForEmptyVote();\\n\\n _tryDeleteExpiredVotingRound(_vote);\\n }\\n\\n /**\\n * @dev Returns the expiry duration for a new proposal.\\n */\\n function getProposalExpiryDuration() external view returns (uint256) {\\n return _getProposalExpiryDuration();\\n }\\n\\n /**\\n * @dev Internal function to get the chain type of the contract.\\n * @return The chain type, indicating the type of the chain the contract operates on (e.g., RoninChain).\\n */\\n function _getChainType() internal pure override returns (ChainType) {\\n return ChainType.RoninChain;\\n }\\n\\n /**\\n * @dev Internal function to get the total weights of all governors.\\n * @return The total weights of all governors combined.\\n */\\n function _getTotalWeights() internal view virtual override returns (uint256) {\\n return getTotalWeights();\\n }\\n\\n /**\\n * @dev Internal function to get the minimum vote weight required for governance actions.\\n * @return The minimum vote weight required for governance actions.\\n */\\n function _getMinimumVoteWeight() internal view virtual override returns (uint256) {\\n return minimumVoteWeight();\\n }\\n\\n /**\\n * @dev Internal function to get the vote weight of a specific governor.\\n * @param _governor The address of the governor to get the vote weight for.\\n * @return The vote weight of the specified governor.\\n */\\n function _getWeight(address _governor) internal view virtual override returns (uint256) {\\n return _getGovernorWeight(_governor);\\n }\\n}\\n\",\"keccak256\":\"0x22cdabc7ef2bd060c4634f37e37905ceb4b6eda5ba4fa9bf04ffe2575128ab12\",\"license\":\"MIT\"},\"contracts/types/Types.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.17;\\n\\nimport { LibTUint256Slot } from \\\"./operations/LibTUint256Slot.sol\\\";\\n\\ntype TUint256Slot is bytes32;\\n\\nusing {\\n LibTUint256Slot.add,\\n LibTUint256Slot.sub,\\n LibTUint256Slot.mul,\\n LibTUint256Slot.div,\\n LibTUint256Slot.load,\\n LibTUint256Slot.store,\\n LibTUint256Slot.addAssign,\\n LibTUint256Slot.subAssign,\\n LibTUint256Slot.preDecrement,\\n LibTUint256Slot.postDecrement,\\n LibTUint256Slot.preIncrement,\\n LibTUint256Slot.postIncrement\\n} for TUint256Slot global;\\n\",\"keccak256\":\"0x20ab58f1c9ae4936f9dd9891d064301d78ef508c1dd2ce0c19a7b5b81d530e36\",\"license\":\"MIT\"},\"contracts/types/operations/LibTUint256Slot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.17;\\n\\nimport { TUint256Slot } from \\\"../Types.sol\\\";\\n\\n/**\\n * @title LibTUint256Slot\\n * @dev Library for handling unsigned 256-bit integers.\\n */\\nlibrary LibTUint256Slot {\\n /// @dev value is equal to bytes4(keccak256(\\\"Panic(uint256)\\\"))\\n /// @dev see: https://github.com/foundry-rs/forge-std/blob/master/src/StdError.sol\\n uint256 private constant PANIC_ERROR_SIGNATURE = 0x4e487b71;\\n /// @dev error code for {Arithmetic over/underflow} error\\n uint256 private constant ARITHMETIC_ERROR_CODE = 0x11;\\n /// @dev error code for {Division or modulo by 0} error\\n uint256 private constant DIVISION_ERROR_CODE = 0x12;\\n\\n /**\\n * @dev Loads the value of the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @return val The loaded value.\\n */\\n function load(TUint256Slot self) internal view returns (uint256 val) {\\n assembly {\\n val := sload(self)\\n }\\n }\\n\\n /**\\n * @dev Stores a value into the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @param other The value to be stored.\\n */\\n function store(TUint256Slot self, uint256 other) internal {\\n assembly {\\n sstore(self, other)\\n }\\n }\\n\\n /**\\n * @dev Multiplies the TUint256Slot variable by a given value.\\n * @param self The TUint256Slot variable.\\n * @param other The value to multiply by.\\n * @return res The resulting value after multiplication.\\n */\\n function mul(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n if iszero(iszero(storedVal)) {\\n res := mul(storedVal, other)\\n\\n // Overflow check\\n if iszero(eq(other, div(res, storedVal))) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, ARITHMETIC_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n }\\n }\\n }\\n\\n /**\\n * @dev Divides the TUint256Slot variable by a given value.\\n * @param self The TUint256Slot variable.\\n * @param other The value to divide by.\\n * @return res The resulting value after division.\\n */\\n function div(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n // revert if divide by zero\\n if iszero(other) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, DIVISION_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n res := div(storedVal, other)\\n }\\n }\\n\\n /**\\n * @dev Subtracts a given value from the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @param other The value to subtract.\\n * @return res The resulting value after subtraction.\\n */\\n function sub(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n\\n // Underflow check\\n if lt(storedVal, other) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, ARITHMETIC_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n\\n res := sub(storedVal, other)\\n }\\n }\\n\\n /**\\n * @dev Adds a given value to the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @param other The value to add.\\n * @return res The resulting value after addition.\\n */\\n function add(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n res := add(storedVal, other)\\n\\n // Overflow check\\n if lt(res, other) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, ARITHMETIC_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n }\\n }\\n\\n /**\\n * @dev Increments the TUint256Slot variable by 1 and returns the new value.\\n * @param self The TUint256Slot variable.\\n * @return res The resulting value after incrementing.\\n */\\n function preIncrement(TUint256Slot self) internal returns (uint256 res) {\\n res = addAssign(self, 1);\\n }\\n\\n /**\\n * @dev Increments the TUint256Slot variable by 1 and returns the original value.\\n * @param self The TUint256Slot variable.\\n * @return res The original value before incrementing.\\n */\\n function postIncrement(TUint256Slot self) internal returns (uint256 res) {\\n res = load(self);\\n store(self, res + 1);\\n }\\n\\n /**\\n * @dev Decrements the TUint256Slot variable by 1 and returns the new value.\\n * @param self The TUint256Slot variable.\\n * @return res The resulting value after decrementing.\\n */\\n function preDecrement(TUint256Slot self) internal returns (uint256 res) {\\n res = subAssign(self, 1);\\n }\\n\\n /**\\n * @dev Decrements the TUint256Slot variable by 1 and returns the new value.\\n * @param self The TUint256Slot variable.\\n * @return res The resulting value before decrementing.\\n */\\n function postDecrement(TUint256Slot self) internal returns (uint256 res) {\\n res = load(self);\\n store(self, res - 1);\\n }\\n\\n /**\\n * @dev Adds a given value to the TUint256Slot variable and stores the result.\\n * @param self The TUint256Slot variable.\\n * @param other The value to add.\\n * @return res The resulting value after addition and storage.\\n */\\n function addAssign(TUint256Slot self, uint256 other) internal returns (uint256 res) {\\n store(self, res = add(self, other));\\n }\\n\\n /**\\n * @dev Subtracts a given value from the TUint256Slot variable and stores the result.\\n * @param self The TUint256Slot variable.\\n * @param other The value to subtract.\\n * @return res The resulting value after subtraction and storage.\\n */\\n function subAssign(TUint256Slot self, uint256 other) internal returns (uint256 res) {\\n store(self, res = sub(self, other));\\n }\\n}\\n\",\"keccak256\":\"0xe10c089459baf373494d76b00e582d49f6e43c500ab0f1657d53afc2fa472cbb\",\"license\":\"MIT\"},\"contracts/utils/CommonErrors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ContractType } from \\\"./ContractType.sol\\\";\\nimport { RoleAccess } from \\\"./RoleAccess.sol\\\";\\n\\nerror ErrSyncTooFarPeriod(uint256 period, uint256 latestRewardedPeriod);\\n/**\\n * @dev Error thrown when an address is expected to be an already created externally owned account (EOA).\\n * This error indicates that the provided address is invalid for certain contract operations that require already created EOA.\\n */\\nerror ErrAddressIsNotCreatedEOA(address addr, bytes32 codehash);\\n/**\\n * @dev Error raised when a bridge operator update operation fails.\\n * @param bridgeOperator The address of the bridge operator that failed to update.\\n */\\nerror ErrBridgeOperatorUpdateFailed(address bridgeOperator);\\n/**\\n * @dev Error thrown when attempting to add a bridge operator that already exists in the contract.\\n * This error indicates that the provided bridge operator address is already registered as a bridge operator in the contract.\\n */\\nerror ErrBridgeOperatorAlreadyExisted(address bridgeOperator);\\n/**\\n * @dev The error indicating an unsupported interface.\\n * @param interfaceId The bytes4 interface identifier that is not supported.\\n * @param addr The address where the unsupported interface was encountered.\\n */\\nerror ErrUnsupportedInterface(bytes4 interfaceId, address addr);\\n/**\\n * @dev Error thrown when the return data from a callback function is invalid.\\n * @param callbackFnSig The signature of the callback function that returned invalid data.\\n * @param register The address of the register where the callback function was invoked.\\n * @param returnData The invalid return data received from the callback function.\\n */\\nerror ErrInvalidReturnData(bytes4 callbackFnSig, address register, bytes returnData);\\n/**\\n * @dev Error of set to non-contract.\\n */\\nerror ErrZeroCodeContract(address addr);\\n/**\\n * @dev Error indicating that arguments are invalid.\\n */\\nerror ErrInvalidArguments(bytes4 msgSig);\\n/**\\n * @dev Error indicating that given address is null when it should not.\\n */\\nerror ErrZeroAddress(bytes4 msgSig);\\n/**\\n * @dev Error indicating that the provided threshold is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that the invalid threshold applies to.\\n */\\nerror ErrInvalidThreshold(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a function can only be called by the contract itself.\\n * @param msgSig The function signature (bytes4) that can only be called by the contract itself.\\n */\\nerror ErrOnlySelfCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n * @param expectedRole The role required to perform the function.\\n */\\nerror ErrUnauthorized(bytes4 msgSig, RoleAccess expectedRole);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n */\\nerror ErrUnauthorizedCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4).\\n * @param expectedContractType The contract type required to perform the function.\\n * @param actual The actual address that called to the function.\\n */\\nerror ErrUnexpectedInternalCall(bytes4 msgSig, ContractType expectedContractType, address actual);\\n\\n/**\\n * @dev Error indicating that an array is empty when it should contain elements.\\n */\\nerror ErrEmptyArray();\\n\\n/**\\n * @dev Error indicating a mismatch in the length of input parameters or arrays for a specific function.\\n * @param msgSig The function signature (bytes4) that has a length mismatch.\\n */\\nerror ErrLengthMismatch(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a proxy call to an external contract has failed.\\n * @param msgSig The function signature (bytes4) of the proxy call that failed.\\n * @param extCallSig The function signature (bytes4) of the external contract call that failed.\\n */\\nerror ErrProxyCallFailed(bytes4 msgSig, bytes4 extCallSig);\\n\\n/**\\n * @dev Error indicating that a function tried to call a precompiled contract that is not allowed.\\n * @param msgSig The function signature (bytes4) that attempted to call a precompiled contract.\\n */\\nerror ErrCallPrecompiled(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a native token transfer has failed.\\n * @param msgSig The function signature (bytes4) of the token transfer that failed.\\n */\\nerror ErrNativeTransferFailed(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that an order is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid order.\\n */\\nerror ErrInvalidOrder(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the chain ID is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid chain ID.\\n * @param actual Current chain ID that executing function.\\n * @param expected Expected chain ID required for the tx to success.\\n */\\nerror ErrInvalidChainId(bytes4 msgSig, uint256 actual, uint256 expected);\\n\\n/**\\n * @dev Error indicating that a vote type is not supported.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an unsupported vote type.\\n */\\nerror ErrUnsupportedVoteType(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the proposal nonce is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid proposal nonce.\\n */\\nerror ErrInvalidProposalNonce(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a voter has already voted.\\n * @param voter The address of the voter who has already voted.\\n */\\nerror ErrAlreadyVoted(address voter);\\n\\n/**\\n * @dev Error indicating that a signature is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid signature.\\n */\\nerror ErrInvalidSignatures(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a relay call has failed.\\n * @param msgSig The function signature (bytes4) of the relay call that failed.\\n */\\nerror ErrRelayFailed(bytes4 msgSig);\\n/**\\n * @dev Error indicating that a vote weight is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid vote weight.\\n */\\nerror ErrInvalidVoteWeight(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a query was made for an outdated bridge operator set.\\n */\\nerror ErrQueryForOutdatedBridgeOperatorSet();\\n\\n/**\\n * @dev Error indicating that a request is invalid.\\n */\\nerror ErrInvalidRequest();\\n\\n/**\\n * @dev Error indicating that a token standard is invalid.\\n */\\nerror ErrInvalidTokenStandard();\\n\\n/**\\n * @dev Error indicating that a token is not supported.\\n */\\nerror ErrUnsupportedToken();\\n\\n/**\\n * @dev Error indicating that a receipt kind is invalid.\\n */\\nerror ErrInvalidReceiptKind();\\n\\n/**\\n * @dev Error indicating that a receipt is invalid.\\n */\\nerror ErrInvalidReceipt();\\n\\n/**\\n * @dev Error indicating that an address is not payable.\\n */\\nerror ErrNonpayableAddress(address);\\n\\n/**\\n * @dev Error indicating that the period is already processed, i.e. scattered reward.\\n */\\nerror ErrPeriodAlreadyProcessed(uint256 requestingPeriod, uint256 latestPeriod);\\n\\n/**\\n * @dev Error thrown when an invalid vote hash is provided.\\n */\\nerror ErrInvalidVoteHash();\\n\\n/**\\n * @dev Error thrown when querying for an empty vote.\\n */\\nerror ErrQueryForEmptyVote();\\n\\n/**\\n * @dev Error thrown when querying for an expired vote.\\n */\\nerror ErrQueryForExpiredVote();\\n\\n/**\\n * @dev Error thrown when querying for a non-existent vote.\\n */\\nerror ErrQueryForNonExistentVote();\\n\",\"keccak256\":\"0x3914292a405307cba9e93085edcaf5f1203ca2d55abf998bf1d2af1e86f5a4c6\",\"license\":\"MIT\"},\"contracts/utils/ContractType.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum ContractType {\\n /* 0 */ UNKNOWN,\\n /* 1 */ PAUSE_ENFORCER,\\n /* 2 */ BRIDGE,\\n /* 3 */ BRIDGE_TRACKING,\\n /* 4 */ GOVERNANCE_ADMIN,\\n /* 5 */ MAINTENANCE,\\n /* 6 */ SLASH_INDICATOR,\\n /* 7 */ STAKING_VESTING,\\n /* 8 */ VALIDATOR,\\n /* 9 */ STAKING,\\n /* 10 */ RONIN_TRUSTED_ORGANIZATION,\\n /* 11 */ BRIDGE_MANAGER,\\n /* 12 */ BRIDGE_SLASH,\\n /* 13 */ BRIDGE_REWARD\\n}\\n\",\"keccak256\":\"0xf72feff9afafcb5cadc1b05c6e0b998ea5d66c7ece57c3e482e560d0a1bb4079\",\"license\":\"MIT\"},\"contracts/utils/IdentityGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { AddressArrayUtils } from \\\"../libraries/AddressArrayUtils.sol\\\";\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport { TransparentUpgradeableProxyV2 } from \\\"../extensions/TransparentUpgradeableProxyV2.sol\\\";\\nimport { ErrAddressIsNotCreatedEOA, ErrZeroAddress, ErrOnlySelfCall, ErrZeroCodeContract, ErrUnsupportedInterface } from \\\"./CommonErrors.sol\\\";\\n\\nabstract contract IdentityGuard {\\n using AddressArrayUtils for address[];\\n\\n /// @dev value is equal to keccak256(abi.encode())\\n /// @dev see: https://eips.ethereum.org/EIPS/eip-1052\\n bytes32 internal constant CREATED_ACCOUNT_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\\n\\n /**\\n * @dev Modifier to restrict functions to only be called by this contract.\\n * @dev Reverts if the caller is not this contract.\\n */\\n modifier onlySelfCall() virtual {\\n _requireSelfCall();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to ensure that the elements in the `arr` array are non-duplicates.\\n * It calls the internal `_checkDuplicate` function to perform the duplicate check.\\n *\\n * Requirements:\\n * - The elements in the `arr` array must not contain any duplicates.\\n */\\n modifier nonDuplicate(address[] memory arr) virtual {\\n _requireNonDuplicate(arr);\\n _;\\n }\\n\\n /**\\n * @dev Internal method to check the method caller.\\n * @dev Reverts if the method caller is not this contract.\\n */\\n function _requireSelfCall() internal view virtual {\\n if (msg.sender != address(this)) revert ErrOnlySelfCall(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to check if a contract address has code.\\n * @param addr The address of the contract to check.\\n * @dev Throws an error if the contract address has no code.\\n */\\n function _requireHasCode(address addr) internal view {\\n if (addr.code.length == 0) revert ErrZeroCodeContract(addr);\\n }\\n\\n /**\\n * @dev Checks if an address is zero and reverts if it is.\\n * @param addr The address to check.\\n */\\n function _requireNonZeroAddress(address addr) internal pure {\\n if (addr == address(0)) revert ErrZeroAddress(msg.sig);\\n }\\n\\n /**\\n * @dev Check if arr is empty and revert if it is.\\n * Checks if an array contains any duplicate addresses and reverts if duplicates are found.\\n * @param arr The array of addresses to check.\\n */\\n function _requireNonDuplicate(address[] memory arr) internal pure {\\n if (arr.hasDuplicate()) revert AddressArrayUtils.ErrDuplicated(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to require that the provided address is a created externally owned account (EOA).\\n * This internal function is used to ensure that the provided address is a valid externally owned account (EOA).\\n * It checks the codehash of the address against a predefined constant to confirm that the address is a created EOA.\\n * @notice This method only works with non-state EOA accounts\\n */\\n function _requireCreatedEOA(address addr) internal view {\\n _requireNonZeroAddress(addr);\\n bytes32 codehash = addr.codehash;\\n if (codehash != CREATED_ACCOUNT_HASH) revert ErrAddressIsNotCreatedEOA(addr, codehash);\\n }\\n\\n /**\\n * @dev Internal function to require that the specified contract supports the given interface. This method handle in\\n * both case that the callee is either or not the proxy admin of the caller. If the contract does not support the\\n * interface `interfaceId` or EIP165, a revert with the corresponding error message is triggered.\\n *\\n * @param contractAddr The address of the contract to check for interface support.\\n * @param interfaceId The interface ID to check for support.\\n */\\n function _requireSupportsInterface(address contractAddr, bytes4 interfaceId) internal view {\\n bytes memory supportsInterfaceParams = abi.encodeCall(IERC165.supportsInterface, (interfaceId));\\n (bool success, bytes memory returnOrRevertData) = contractAddr.staticcall(supportsInterfaceParams);\\n if (!success) {\\n (success, returnOrRevertData) = contractAddr.staticcall(\\n abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (supportsInterfaceParams))\\n );\\n if (!success) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n if (!abi.decode(returnOrRevertData, (bool))) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n}\\n\",\"keccak256\":\"0x2d0dfcef3636945bc1785c1fa5a05f5203c79cbb81b2eee92a3ac6a2378c2ce5\",\"license\":\"MIT\"},\"contracts/utils/RoleAccess.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum RoleAccess {\\n /* 0 */ UNKNOWN,\\n /* 1 */ ADMIN,\\n /* 2 */ COINBASE,\\n /* 3 */ GOVERNOR,\\n /* 4 */ CANDIDATE_ADMIN,\\n /* 5 */ WITHDRAWAL_MIGRATOR,\\n /* 6 */ __DEPRECATED_BRIDGE_OPERATOR,\\n /* 7 */ BLOCK_PRODUCER,\\n /* 8 */ VALIDATOR_CANDIDATE\\n}\\n\",\"keccak256\":\"0xa98cec38c640c4e37f475debbcd366226f1188c3f5ea6e29de768bd33e021873\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60a0604052604051620078183803806200781883398101604081905262000026916200144b565b8181898d8d8d8c8c8c8c8c836200003d8162000236565b50506200007d60017f92872d32822c9d44b36a2537d3e0d4c46fc4de1ce154ccfaed560a8a58445f1d60001b6200035360201b620013141790919060201c565b620000ba887fc55405a488814eaa0e2a685a0131142785b8d033d311c8c8244e34a7c12ca40f60001b6200035360201b620013141790919060201c565b620000f7877fac1ff16a4f04f2a37a9ba5252a69baa100b460e517d1f8019c054a5ad698f9ff60001b6200035360201b620013141790919060201c565b6200010460028662000357565b604080516020808201839052600c60608301526b212924a223a2afa0a226a4a760a11b6080808401919091528284018a905283518084038201815260a0840185528051908301207f599a80fcaa47b95e2323ab4d34d34e0cc9feda4b843edafcc30c7bdf60ea15bf60c08501527f9d3fa1662ea89365eb7af36506f0ad5413bd7e078960d8481ff4718763aaa8e960e08501527fad7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5610100850152610120808501919091528451808503909101815261014090930190935281519101209052620001ef81838562000401565b50505050505050505062000209816200089860201b60201c565b5062000217600030620008cb565b62000223828262000967565b50505050505050505050505050620018c5565b606081620002448162000a2a565b8251806001600160401b0381111562000261576200026162001276565b6040519080825280602002602001820160405280156200028b578160200160208202803683370190505b509250806000036200029e57506200034d565b600080516020620077f883398151915260006314d72edb60e21b815b848110156200034757878181518110620002d857620002d8620015b7565b60200260200101519250620002f38362000a7160201b60201c565b620002ff838362000aa9565b62000319838562000c8860201b620013181790919060201c565b8782815181106200032e576200032e620015b7565b91151560209283029190910190910152600101620002ba565b50505050505b50919050565b9055565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600d811115620003905762000390620015cd565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600d811115620003d457620003d4620015cd565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b60606200041d828462000ca860201b6200132d1790919060201c565b620004288162000a2a565b82518551811480156200043b5750845181145b6200046c576040516306b5667560e21b81526001600160e01b03196000351660048201526024015b60405180910390fd5b806001600160401b0381111562000487576200048762001276565b604051908082528060200260200182016040528015620004b1578160200160208202803683370190505b50925080600003620004c4575062000890565b604080518082019091526000808252602082018190527f546f6b46ab35b030b6816596b352aef78857377176c8b24baa2046a62cf1998c917f8400683eb2cb350596d73644c0c89fe45f108600003457374f4ab3e87b4f3aa3917fd38c234075fde25875da8a6b7e36b58b86681d483271a99eeeee1d78e258a24d917f88547008e60f5748911f2e59feb3093b7e4c2e87b2dd69d61f112fcc932de8e3919081908190815b89811015620007d1578d8181518110620005875762000587620015b7565b602002602001015194508c8181518110620005a657620005a6620015b7565b60200260200101519350620005c18562000dc660201b60201c565b620005cc8462000dc6565b8e8181518110620005e157620005e1620015b7565b60200260200101516001600160601b03166000036200062257604051637f11b8a360e11b81526001600160e01b031960003516600482015260240162000463565b6200063c858a62000e3460201b620014371790919060201c565b806200065d57506200065d848a62000e3460201b620014371790919060201c565b806200067e57506200067e858862000e3460201b620014371790919060201c565b806200069f57506200069f848862000e3460201b620014371790919060201c565b158c8281518110620006b557620006b5620015b7565b6020026020010190151590811515815250508b8181518110620006dc57620006dc620015b7565b602002602001015115620007c85762000704858a62000c8860201b620013181790919060201c565b506200071f848862000c8860201b620013181790919060201c565b506001600160a01b03848116600081815260208b90526040902080546001600160a01b0319169288169290921790915582528e518f9082908110620007685762000768620015b7565b6020908102919091018101516001600160601b03169083018190526200078f9084620015e3565b6001600160a01b038087166000908152602089815260409091208551918601516001600160601b0316600160a01b029190921617905592505b60010162000569565b506200080f827f6924fe71b0c8b61aea02ca498b5f53b29bd95726278b1fe4eb791bb24a42644c60001b62000e5760201b620014591790919060201c565b5062000847635ebae8a060e01b8d8d604051602001620008319291906200167f565b60408051601f1981840301815291905262000e71565b7f897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b788b8f8f8f6040516200087e9493929190620016b1565b60405180910390a15050505050505050505b509392505050565b600281905560405181907fe5cd1c123a8cf63fa1b7229678db61fe8ae99dbbd27889370b6667c8cae97da190600090a250565b8060036000846003811115620008e557620008e5620015cd565b6003811115620008f957620008f9620015cd565b8152602081019190915260400160002080546001600160a01b0319166001600160a01b0392831617905581168260038111156200093a576200093a620015cd565b6040517f356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d90600090a35050565b60005b825181101562000a2557306001600160a01b0316828281518110620009935762000993620015b7565b60200260200101516001600160a01b031603620009d25760405163053265f160e01b81526001600160e01b031960003516600482015260240162000463565b62000a1c838281518110620009eb57620009eb620015b7565b602002602001015183838151811062000a085762000a08620015b7565b6020026020010151620008cb60201b60201c565b6001016200096a565b505050565b62000a40816200109160201b620014701760201c565b1562000a6e57604051630d697db160e11b81526001600160e01b031960003516600482015260240162000463565b50565b806001600160a01b03163b60000362000a6e57604051630bfc64a360e21b81526001600160a01b038216600482015260240162000463565b6040516001600160e01b03198216602482015260009060440160408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b1790525190915060009081906001600160a01b0386169062000b0d90859062001767565b600060405180830381855afa9150503d806000811462000b4a576040519150601f19603f3d011682016040523d82523d6000602084013e62000b4f565b606091505b50915091508162000c3157846001600160a01b03168360405160240162000b779190620017b3565b60408051601f198184030181529181526020820180516001600160e01b03166325da93a560e11b1790525162000bae919062001767565b600060405180830381855afa9150503d806000811462000beb576040519150601f19603f3d011682016040523d82523d6000602084013e62000bf0565b606091505b5090925090508162000c315760405163069d427960e11b81526001600160e01b0319851660048201526001600160a01b038616602482015260440162000463565b8080602001905181019062000c479190620017c8565b62000c815760405163069d427960e11b81526001600160e01b0319851660048201526001600160a01b038616602482015260440162000463565b5050505050565b600062000c9f836001600160a01b0384166200113c565b90505b92915050565b81518151606091908082016001600160401b0381111562000ccd5762000ccd62001276565b60405190808252806020026020018201604052801562000cf7578160200160208202803683370190505b50925060005b8281101562000d595785818151811062000d1b5762000d1b620015b7565b602002602001015184828151811062000d385762000d38620015b7565b6001600160a01b039092166020928302919091019091015260010162000cfd565b60005b8281101562000dbc5785818151811062000d7a5762000d7a620015b7565b602002602001015185838151811062000d975762000d97620015b7565b6001600160a01b03909216602092830291909101909101526001918201910162000d5c565b5050505092915050565b62000dd1816200118e565b6001600160a01b0381163f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470811462000e3057604051633c88494760e01b81526001600160a01b03831660048201526024810182905260440162000463565b5050565b6001600160a01b0381166000908152600183016020526040812054151562000c9f565b600062000ca28362000e6a8185620011c5565b9250829055565b600062000e98600080516020620077f8833981519152620011e560201b6200150f1760201c565b8051909150600081900362000ead5750505050565b6000816001600160401b0381111562000eca5762000eca62001276565b60405190808252806020026020018201604052801562000ef4578160200160208202803683370190505b5090506000826001600160401b0381111562000f145762000f1462001276565b60405190808252806020026020018201604052801562000f4957816020015b606081526020019060019003908162000f335790505b5090506000868660405160200162000f63929190620017ec565b604051602081830303815290604052905060005b84811015620010485785818151811062000f955762000f95620015b7565b60200260200101516001600160a01b03168260405162000fb6919062001767565b6000604051808303816000865af19150503d806000811462000ff5576040519150601f19603f3d011682016040523d82523d6000602084013e62000ffa565b606091505b50858381518110620010105762001010620015b7565b602002602001018584815181106200102c576200102c620015b7565b6020908102919091010191909152901515905260010162000f77565b507fc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b63818685856040516200108094939291906200181f565b60405180910390a150505050505050565b60008151600003620010a557506000919050565b60005b60018351038110156200113357600181015b83518110156200112957838181518110620010d957620010d9620015b7565b60200260200101516001600160a01b0316848381518110620010ff57620010ff620015b7565b60200260200101516001600160a01b03160362001120575060019392505050565b600101620010ba565b50600101620010a8565b50600092915050565b6000818152600183016020526040812054620011855750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000ca2565b50600062000ca2565b6001600160a01b03811662000a6e5760405163104c66df60e31b81526001600160e01b031960003516600482015260240162000463565b815481018181101562000ca257634e487b7160005260116020526024601cfd5b60606000620011f483620011fb565b9392505050565b6060816000018054806020026020016040519081016040528092919081815260200182805480156200124d57602002820191906000526020600020905b81548152602001906001019080831162001238575b50505050509050919050565b80516001600160a01b03811681146200127157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620012b757620012b762001276565b604052919050565b60006001600160401b03821115620012db57620012db62001276565b5060051b60200190565b600082601f830112620012f757600080fd5b81516020620013106200130a83620012bf565b6200128c565b82815260059290921b840181019181810190868411156200133057600080fd5b8286015b848110156200135657620013488162001259565b835291830191830162001334565b509695505050505050565b600082601f8301126200137357600080fd5b81516020620013866200130a83620012bf565b82815260059290921b84018101918181019086841115620013a657600080fd5b8286015b84811015620013565780516001600160601b0381168114620013cc5760008081fd5b8352918301918301620013aa565b600082601f830112620013ec57600080fd5b81516020620013ff6200130a83620012bf565b82815260059290921b840181019181810190868411156200141f57600080fd5b8286015b8481101562001356578051600481106200143d5760008081fd5b835291830191830162001423565b60008060008060008060008060008060006101608c8e0312156200146e57600080fd5b8b519a5060208c0151995060408c0151985060608c015197506200149560808d0162001259565b60a08d01519097506001600160401b03811115620014b257600080fd5b620014c08e828f01620012e5565b60c08e015190975090506001600160401b03811115620014df57600080fd5b620014ed8e828f01620012e5565b60e08e015190965090506001600160401b038111156200150c57600080fd5b6200151a8e828f01620012e5565b6101008e015190955090506001600160401b038111156200153a57600080fd5b620015488e828f0162001361565b6101208e015190945090506001600160401b038111156200156857600080fd5b620015768e828f01620013da565b6101408e015190935090506001600160401b038111156200159657600080fd5b620015a48e828f01620012e5565b9150509295989b509295989b9093969950565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b8082018082111562000ca257634e487b7160e01b600052601160045260246000fd5b600081518084526020808501945080840160005b83811015620016405781516001600160a01b03168752958201959082019060010162001619565b509495945050505050565b600081518084526020808501945080840160005b83811015620016405781511515875295820195908201906001016200165f565b60408152600062001694604083018562001605565b8281036020840152620016a881856200164b565b95945050505050565b608081526000620016c660808301876200164b565b82810360208481019190915286518083528782019282019060005b81811015620017085784516001600160601b031683529383019391830191600101620016e1565b505084810360408601526200171e818862001605565b92505050828103606084015262001736818562001605565b979650505050505050565b60005b838110156200175e57818101518382015260200162001744565b50506000910152565b600082516200177b81846020870162001741565b9190910192915050565b600081518084526200179f81602086016020860162001741565b601f01601f19169290920160200192915050565b60208152600062000c9f602083018462001785565b600060208284031215620017db57600080fd5b81518015158114620011f457600080fd5b6001600160e01b03198316815281516000906200181181600485016020870162001741565b919091016004019392505050565b60808152600062001834608083018762001785565b60208382038185015262001849828862001605565b915083820360408501526200185f82876200164b565b915083820360608501528185518084528284019150828160051b85010183880160005b83811015620018b457601f19878403018552620018a183835162001785565b9486019492509085019060010162001882565b50909b9a5050505050505050505050565b608051615efb620018fd600039600081816103bd015281816106a2015281816108a5015281816109ab01526112000152615efb6000f3fe608060405234801561001057600080fd5b50600436106102685760003560e01c80639a7d338211610151578063bc96180b116100c3578063de981f1b11610087578063de981f1b1461061b578063e75235b814610646578063e9c034981461064e578063f80b535214610661578063fb4f637114610669578063fdc4fa471461067c57600080fd5b8063bc96180b146105b6578063c441c4a8146105be578063cc7e6b3b146105d5578063d78392f8146105f5578063dafae4081461060857600080fd5b8063ada86b2411610115578063ada86b24146104f2578063b384abef146104fa578063b405aaf214610555578063b9c3620914610568578063bc4e068f14610590578063bc9182fd146105a357600080fd5b80639a7d33821461049e5780639b19dbfd146104b15780639b2ee437146104b9578063a1819f9a146104cc578063a8a0e32c146104df57600080fd5b80632faf925d116101ea578063663ac011116101ae578063663ac011146103e75780637de5dedd146103fa578063800eaab314610402578063828fc1a114610415578063865e6fd314610428578063901979d51461043b57600080fd5b80632faf925d1461037257806334d5f37b1461038557806335da8121146103a55780633644e515146103b8578063562d5304146103df57600080fd5b80630f7c3189116102315780630f7c3189146102f25780631c905e39146103075780631f425338146103295780632c5e65201461033c5780632d6d7d731461035f57600080fd5b80624054b81461026d57806301a5f43f1461028257806309fcd8c7146102ab5780630a44fa43146102be5780630b881830146102df575b600080fd5b61028061027b366004614aa3565b61068f565b005b610295610290366004614b37565b6106ce565b6040516102a29190614c0d565b60405180910390f35b6102806102b9366004614c20565b610781565b6102d16102cc366004614cef565b610816565b6040519081526020016102a2565b6102806102ed366004614aa3565b61089b565b6102fa6108c9565b6040516102a29190614d69565b61031a610315366004614d7c565b6108e7565b6040516102a293929190614dc8565b610295610337366004614cef565b610903565b61034f61034a366004614e90565b610950565b60405190151581526020016102a2565b6102fa61036d366004614cef565b61095d565b610280610380366004614ec5565b6109a1565b6102d1610393366004614f1e565b60006020819052908152604090205481565b6102956103b3366004614cef565b6109cf565b6102d17f000000000000000000000000000000000000000000000000000000000000000081565b6102d1610a15565b6102806103f5366004614f46565b610a2e565b6102d1610b1b565b6102806104103660046151b1565b610b97565b61034f610423366004615214565b610bdc565b61028061043636600461524f565b610bea565b6102d1610449366004615279565b6001600160a01b039081166000908152600080516020615e8f83398151915260209081526040808320549093168252600080516020615e6f83398151915290522054600160a01b90046001600160601b031690565b6102806104ac366004614d7c565b610c05565b6102fa610c51565b6102806104c7366004615279565b610c5b565b6102806104da366004615294565b610df2565b6102806104ed36600461536d565b610eb9565b6102d1610ed5565b610544610508366004614d7c565b600160208181526000938452604080852090915291835291208054918101546002820154600383015460069093015460ff909416939192909185565b6040516102a29594939291906153b1565b61034f610563366004615279565b610eed565b61057b610576366004614d7c565b610f07565b604080519283526020830191909152016102a2565b61031a61059e366004614f1e565b610f28565b6102fa6105b13660046153e6565b610f45565b6102d1611036565b6105c6611041565b6040516102a29392919061544a565b6105e86105e3366004614cef565b61106b565b6040516102a2919061548d565b6102d1610603366004615279565b6110a9565b61034f610616366004614f1e565b6110b4565b61062e6106293660046154a0565b6110f1565b6040516001600160a01b0390911681526020016102a2565b61057b61116c565b61029561065c366004614cef565b61119d565b6102fa6111e3565b610280610677366004614ec5565b6111ed565b6102fa61068a366004614cef565b61122d565b6106983361151c565b6106c785858585857f000000000000000000000000000000000000000000000000000000000000000033611558565b5050505050565b60606106d86115fd565b61077687878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82529093508a92508991829185019084908082843760009201919091525050604080516020808a0282810182019093528982529093508992508891829185019084908082843760009201919091525061162d92505050565b979650505050505050565b61078a3361151c565b61080b8989898989808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506107d092508a91508b9050615586565b8787808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152503392506119a9915050565b505050505050505050565b60008282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506108579250839150611b069050565b610893848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611b3b92505050565b949350505050565b6106c785858585857f0000000000000000000000000000000000000000000000000000000000000000611be2565b60606108e2600080516020615e0f83398151915261150f565b905090565b60608060606108f68585611c96565b9250925092509250925092565b606061090d6115fd565b61094983838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061207f92505050565b9392505050565b6000610893848484612141565b606061094983838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250612177915050565b92915050565b6106c785858585857f00000000000000000000000000000000000000000000000000000000000000006122d1565b60606109d96115fd565b6109498383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506123f492505050565b60006108e2600080516020615eaf8339815191526124e6565b610a373361151c565b60003390506000610b00468d8d8d80806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050508c8c80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610ac592508d91508e9050615586565b8a8a808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508b92506124f0915050565b9050610b0d8282856125ff565b505050505050505050505050565b6000610b33600080516020615e2f8339815191525490565b6001610b4b600080516020615e2f8339815191525490565b610b79610b64600080516020615ecf8339815191525490565b600080516020615e4f83398151915290612715565b610b8391906155a9565b610b8d91906155bc565b6108e291906155cf565b333014610bce576000356001600160e01b0319166040516307337e1960e41b8152600401610bc591906155f1565b60405180910390fd5b610bd88282612740565b5050565b600061094960008484612141565b610bf26115fd565b610bfb816127ee565b610bd88282612824565b6000828152600160208181526040808420858552909152822090810154909103610c425760405163713b099760e11b815260040160405180910390fd5b610c4b816128c8565b50505050565b60606108e2612add565b610c643361151c565b610c6d81612af6565b336000908152600080516020615e6f83398151915260208190526040909120546001600160a01b039081169083168103610cc557604051630669b93360e31b81526001600160a01b0384166004820152602401610bc5565b600080516020615eaf8339815191526000610ce08284612b5c565b8015610cf15750610cf18286611318565b905080610d1c5760405163080fab4b60e31b81526001600160a01b0386166004820152602401610bc5565b6001600160a01b038381166000818152600080516020615e8f8339815191526020818152604080842080546001600160a01b0319908116909155958b16808552818520805488163390811790915585528a8352938190208054909616841790955584519081019390935292820152610daf906364b18d0960e11b906060015b604051602081830303815290604052612b71565b6040516001600160a01b03808816919086169033907fcef34cd748f30a1b7a2f214fd1651779f79bc6c1be02785cad5c1f0ee877213d90600090a4505050505050565b610dfb3361151c565b610eac8a8a8a8a8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c918291850190849080828437600092019190915250610e7192508a91508b9050615586565b8787808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152503392506124f0915050565b5050505050505050505050565b610ec23361151c565b610bd833610ecf84615681565b836125ff565b60006108e2600080516020615ecf8339815191525490565b600061099b600080516020615eaf83398151915283611437565b600080610f126115fd565b610f1c8484612d66565b915091505b9250929050565b6060806060610f38600085611c96565b9250925092509193909250565b8051606090806001600160401b03811115610f6257610f62615023565b604051908082528060200260200182016040528015610f8b578160200160208202803683370190505b509150600080516020615e6f83398151915260005b8281101561102e57816000868381518110610fbd57610fbd615755565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060000160009054906101000a90046001600160a01b031684828151811061100e5761100e615755565b6001600160a01b0390921660209283029190910190910152600101610fa0565b505050919050565b60006108e260025490565b606080606061104e612e5b565b925061105983610f45565b915061106483612e86565b9050909192565b6060610949838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612e8692505050565b600061099b82612f6b565b60006110cf610b64600080516020615ecf8339815191525490565b600080516020615e2f833981519152546110e9908461576b565b101592915050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600d81111561112857611128614d9e565b60ff1681526020810191909152604001600020546001600160a01b0316905080611167578160405163409140df60e11b8152600401610bc59190615782565b919050565b600080611185600080516020615e4f8339815191525490565b600080516020615e2f83398151915254915091509091565b60606111a76115fd565b610949838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612fa392505050565b60606108e2612e5b565b6111f63361151c565b61122585858585857f000000000000000000000000000000000000000000000000000000000000000033613288565b505050505050565b606081806001600160401b0381111561124857611248615023565b604051908082528060200260200182016040528015611271578160200160208202803683370190505b509150600080516020615e8f83398151915260005b8281101561130b578160008787848181106112a3576112a3615755565b90506020020160208101906112b89190615279565b6001600160a01b03908116825260208201929092526040016000205485519116908590839081106112eb576112eb615755565b6001600160a01b0390921660209283029190910190910152600101611286565b50505092915050565b9055565b6000610949836001600160a01b0384166132d7565b81518151606091908082016001600160401b0381111561134f5761134f615023565b604051908082528060200260200182016040528015611378578160200160208202803683370190505b50925060005b828110156113d25785818151811061139857611398615755565b60200260200101518482815181106113b2576113b2615755565b6001600160a01b039092166020928302919091019091015260010161137e565b60005b8281101561142d578581815181106113ef576113ef615755565b602002602001015185838151811061140957611409615755565b6001600160a01b0390921660209283029190910190910152600191820191016113d5565b5050505092915050565b6001600160a01b03811660009081526001830160205260408120541515610949565b600061099b836114698585613326565b9250829055565b6000815160000361148357506000919050565b60005b600183510381101561150657600181015b83518110156114fd578381815181106114b2576114b2615755565b60200260200101516001600160a01b03168483815181106114d5576114d5615755565b60200260200101516001600160a01b0316036114f5575060019392505050565b600101611497565b50600101611486565b50600092915050565b6060600061094983613345565b61152581612f6b565b600003611555576000356001600160e01b0319166003604051620f948f60ea1b8152600401610bc592919061579c565b50565b61156a61156488615681565b826133a1565b50600061157e61157989615681565b6134a0565b90506115f361158c89615681565b888888886115df8961159f8960006135df565b60405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6115ee8a61159f8a60016135df565b613618565b5050505050505050565b33301461162b576000356001600160e01b0319166040516307337e1960e41b8152600401610bc591906155f1565b565b6060611639838361132d565b61164281611b06565b82518551811480156116545750845181145b61167f576000356001600160e01b0319166040516306b5667560e21b8152600401610bc591906155f1565b806001600160401b0381111561169757611697615023565b6040519080825280602002602001820160405280156116c0578160200160208202803683370190505b509250806000036116d157506119a1565b604080518082019091526000808252602082018190527f546f6b46ab35b030b6816596b352aef78857377176c8b24baa2046a62cf1998c91600080516020615e8f83398151915291600080516020615eaf83398151915291600080516020615e6f833981519152919081908190815b89811015611922578d818151811061175a5761175a615755565b602002602001015194508c818151811061177657611776615755565b6020026020010151935061178985612af6565b61179284612af6565b8e81815181106117a4576117a4615755565b60200260200101516001600160601b03166000036117e3576000356001600160e01b031916604051637f11b8a360e11b8152600401610bc591906155f1565b6117ed8986611437565b806117fd57506117fd8985611437565b8061180d575061180d8786611437565b8061181d575061181d8785611437565b158c828151811061183057611830615755565b6020026020010190151590811515815250508b818151811061185457611854615755565b60200260200101511561191a5761186b8986611318565b506118768785611318565b506001600160a01b03848116600081815260208b90526040902080546001600160a01b0319169288169290921790915582528e518f90829081106118bc576118bc615755565b6020908102919091018101516001600160601b03169083018190526118e190846155a9565b6001600160a01b038087166000908152602089815260409091208551918601516001600160601b0316600160a01b029190921617905592505b600101611740565b5061193b600080516020615ecf83398151915283611459565b5061195a635ebae8a060e01b8d8d604051602001610d9b9291906157ca565b7f897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b788b8f8f8f60405161198f94939291906157f8565b60405180910390a15050505050505050505b509392505050565b60006119b5600061387d565b905060006040518060c001604052808381526020018a8152602001898980806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093855250505060208083018a905260408084018a9052606090930188905282518b820281810183019094528b81529394509092611a6692611a5f928d918d9182919085019084908082843760009201919091525060019250612177915050565b839061392d565b9050611a7d60025482613a1f90919063ffffffff16565b6000611a88826134a0565b6000858152600080516020615def83398151915260205260409020600181018290556006018c9055905080847f771d78ae9e5fca95a532fb0971d575d0ce9b59d14823c063e08740137e0e0eca84611adf87613ac0565b878a604051611af1949392919061599a565b60405180910390a35050505050505050505050565b611b0f81611470565b15611555576000356001600160e01b031916604051630d697db160e11b8152600401610bc591906155f1565b600081611b4781611b06565b6000611b60600080516020615eaf8339815191526124e6565b9050600080516020615e6f83398151915260005b82811015611bd957816000878381518110611b9157611b91615755565b6020908102919091018101516001600160a01b0316825281019190915260400160002054611bcf90600160a01b90046001600160601b0316866155a9565b9450600101611b74565b50505050919050565b6000611bf061157988615681565b6020808901356000908152600180835260408083208c35845290935291902001549091508114611c5f576020808801356000908152600180835260408083208b3584529093529082902001549051632bee7fdb60e21b8152610bc5918391600401918252602082015260400190565b611c8d611c6b88615681565b87878787611c7e8861159f8960006135df565b6115ee8961159f8a60016135df565b50505050505050565b60008281526001602090815260408083208484529091528120600481015460058201546060938493849390929091611cce82846155a9565b9050806001600160401b03811115611ce857611ce8615023565b604051908082528060200260200182016040528015611d11578160200160208202803683370190505b509550806001600160401b03811115611d2c57611d2c615023565b604051908082528060200260200182016040528015611d7757816020015b6040805160608101825260008082526020808301829052928201528252600019909201910181611d4a5790505b509450806001600160401b03811115611d9257611d92615023565b604051908082528060200260200182016040528015611dbb578160200160208202803683370190505b50965060005b83811015611f10576000878281518110611ddd57611ddd615755565b60200260200101906001811115611df657611df6614d9e565b90816001811115611e0957611e09614d9e565b90525060008a81526001602090815260408083208c845290915281206004870180546007909201929184908110611e4257611e42615755565b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815460ff16815260018201549381019390935260020154908201528651879083908110611ea057611ea0615755565b6020026020010181905250846004018181548110611ec057611ec0615755565b9060005260206000200160009054906101000a90046001600160a01b0316888281518110611ef057611ef0615755565b6001600160a01b0390921660209283029190910190910152600101611dc1565b5060005b8281101561207357600187611f2986846155a9565b81518110611f3957611f39615755565b60200260200101906001811115611f5257611f52614d9e565b90816001811115611f6557611f65614d9e565b90525060008a81526001602090815260408083208c845290915281206005870180546007909201929184908110611f9e57611f9e615755565b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815460ff168152600182015493810193909352600201549082015286611ff386846155a9565b8151811061200357612003615755565b602002602001018190525084600501818154811061202357612023615755565b6000918252602090912001546001600160a01b03168861204386846155a9565b8151811061205357612053615755565b6001600160a01b0390921660209283029190910190910152600101611f14565b50505050509250925092565b60608161208b81611b06565b8251806001600160401b038111156120a5576120a5615023565b6040519080825280602002602001820160405280156120ce578160200160208202803683370190505b509250600080516020615e0f83398151915260005b82811015611bd95761211786828151811061210057612100615755565b602002602001015183612b5c90919063ffffffff16565b85828151811061212957612129615755565b911515602092830291909101909101526001016120e3565b600083815260016020908152604080832085845282528083206001600160a01b038516845260080190915281205460ff16610893565b606082516001600160401b0381111561219257612192615023565b6040519080825280602002602001820160405280156121bb578160200160208202803683370190505b50905060005b83518110156122ca57600360008583815181106121e0576121e0615755565b602002602001015160038111156121f9576121f9614d9e565b600381111561220a5761220a614d9e565b815260200190815260200160002060009054906101000a90046001600160a01b031682828151811061223e5761223e615755565b60200260200101906001600160a01b031690816001600160a01b031681525050828015612296575060006001600160a01b031682828151811061228357612283615755565b60200260200101516001600160a01b0316145b156122c2576000356001600160e01b03191660405163053265f160e01b8152600401610bc591906155f1565b6001016121c1565b5092915050565b600061232f6123206122e660408a018a615a88565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525060019250612177915050565b61232989615ad1565b9061392d565b9050600061233c826134a0565b60008080526001602081815285518352600080516020615def83398151915290526040909120015490915081146123b95760008080526001602081815284518352600080516020615def833981519152905260409182902001549051632bee7fdb60e21b8152610bc5918391600401918252602082015260400190565b60006123cc6123c78a615ad1565b613ac0565b905061080b83898989896123e58a61159f8960006135df565b6115ee8b61159f8a60016135df565b60608161240081611b06565b8251806001600160401b0381111561241a5761241a615023565b604051908082528060200260200182016040528015612443578160200160208202803683370190505b5092508060000361245457506124e0565b600080516020615e0f83398151915260006314d72edb60e21b815b848110156124da5787818151811061248957612489615755565b6020026020010151925061249c836127ee565b6124a68383613bf7565b6124b08484611318565b8782815181106124c2576124c2615755565b9115156020928302919091019091015260010161246f565b50505050505b50919050565b600061099b825490565b6124f861499a565b8760000361252c576000356001600160e01b03191660004660405163092048d160e11b8152600401610bc593929190615b9b565b60006125378961387d565b90506040518060e001604052808281526020018a815260200189815260200188815260200187815260200186815260200185815250915061258360025483613a1f90919063ffffffff16565b600061258e836134a0565b60008b81526001602081815260408084208785529091529091209081018290556006018a9055905080828b7fa57d40f1496988cf60ab7c9d5ba4ff83647f67d3898d441a3aaf21b651678fd986886040516125ea929190615bbd565b60405180910390a45050979650505050505050565b4682602001511461263857602082015160405163092048d160e11b8152610bc5916001600160e01b031960003516914690600401615b9b565b6000612643836134a0565b60208085015160009081526001808352604080832088518452909352919020015490915081146126b257602080840151600090815260018083526040808320875184529093529082902001549051632bee7fdb60e21b8152610bc5918391600401918252602082015260400190565b60006126bc613d8a565b90506000816126c9613d94565b6126d391906155bc565b6126de9060016155a9565b60408051606081018252600080825260208201819052918101919091529091506115f3868685858b866127108e6110a9565b613d9e565b6000825480156122ca57828102915080820483146122ca57634e487b7160005260116020526024601cfd5b60005b82518110156127e957306001600160a01b031682828151811061276857612768615755565b60200260200101516001600160a01b0316036127a5576000356001600160e01b03191660405163053265f160e01b8152600401610bc591906155f1565b6127e18382815181106127ba576127ba615755565b60200260200101518383815181106127d4576127d4615755565b60200260200101516140e7565b600101612743565b505050565b806001600160a01b03163b60000361155557604051630bfc64a360e21b81526001600160a01b0382166004820152602401610bc5565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600d81111561285a5761285a614d9e565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600d81111561289b5761289b614d9e565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b600080825460ff1660048111156128e1576128e1614d9e565b1480156128f2575042826006015411155b905080156111675760018201546040517f58f98006a7f2f253f8ae8f8b7cec9008ca05359633561cd7c22f3005682d4a5590600090a260005b60048301548110156129de5782600801600084600401838154811061295257612952615755565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff19169055600484018054600786019291908490811061299b5761299b615755565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff1916815560018181018390556002909101919091550161292b565b5060005b6005830154811015612a9557826008016000846005018381548110612a0957612a09615755565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff191690556005840180546007860192919084908110612a5257612a52615755565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff191681556001818101839055600290910191909155016129e2565b50815460ff191682556000600183018190556002830181905560038301819055612ac39060048401906149d7565b612ad16005830160006149d7565b60006006830155919050565b60606108e2600080516020615eaf83398151915261150f565b612aff8161417a565b6001600160a01b0381163f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708114610bd857604051633c88494760e01b81526001600160a01b038316600482015260248101829052604401610bc5565b6000610949836001600160a01b0384166141af565b6000612b8a600080516020615e0f83398151915261150f565b80519091506000819003612b9e5750505050565b6000816001600160401b03811115612bb857612bb8615023565b604051908082528060200260200182016040528015612be1578160200160208202803683370190505b5090506000826001600160401b03811115612bfe57612bfe615023565b604051908082528060200260200182016040528015612c3157816020015b6060815260200190600190039081612c1c5790505b50905060008686604051602001612c49929190615be7565b604051602081830303815290604052905060005b84811015612d1f57858181518110612c7757612c77615755565b60200260200101516001600160a01b031682604051612c969190615c18565b6000604051808303816000865af19150503d8060008114612cd3576040519150601f19603f3d011682016040523d82523d6000602084013e612cd8565b606091505b50858381518110612ceb57612ceb615755565b60200260200101858481518110612d0457612d04615755565b60209081029190910101919091529015159052600101612c5d565b507fc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b6381868585604051612d559493929190615c34565b60405180910390a150505050505050565b60008082841115612d98576000356001600160e01b0319166040516387f6f09560e01b8152600401610bc591906155f1565b600080516020615e4f833981519152549150612dc0600080516020615e2f8339815191525490565b9050612dd9600080516020615e4f833981519152859055565b612df0600080516020615e2f833981519152849055565b8284612e1b7f92872d32822c9d44b36a2537d3e0d4c46fc4de1ce154ccfaed560a8a58445f1d6142a2565b60408051868152602081018690527f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a49250929050565b60606108e27f546f6b46ab35b030b6816596b352aef78857377176c8b24baa2046a62cf1998c61150f565b8051606090806001600160401b03811115612ea357612ea3615023565b604051908082528060200260200182016040528015612ecc578160200160208202803683370190505b509150600080516020615e6f83398151915260005b8281101561102e57816000868381518110612efe57612efe615755565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060000160149054906101000a90046001600160601b03166001600160601b0316848281518110612f5857612f58615755565b6020908102919091010152600101612ee1565b6001600160a01b03166000908152600080516020615e6f8339815191526020526040902054600160a01b90046001600160601b031690565b606081612faf81611b06565b8251806001600160401b03811115612fc957612fc9615023565b604051908082528060200260200182016040528015612ff2578160200160208202803683370190505b5092508060000361300357506124e0565b60408051808201909152600080825260208201819052600080516020615e8f833981519152917f546f6b46ab35b030b6816596b352aef78857377176c8b24baa2046a62cf1998c91600080516020615eaf83398151915291600080516020615e6f833981519152919081908190815b89811015613208578c818151811061308c5761308c615755565b6020908102919091018101516001600160a01b038082166000908152928c9052604090922054909116955093506130c28561417a565b6130cb8461417a565b6001600160a01b0385811660009081526020888152604091829020825180840190935254808416808452600160a01b9091046001600160601b0316918301919091529093509085161461313f576000356001600160e01b03191660405163053265f160e01b8152600401610bc591906155f1565b6131498785611437565b801561315a575061315a8886611437565b8c828151811061316c5761316c615755565b6020026020010190151590811515815250508b818151811061319057613190615755565b602002602001015115613200576131a78886612b5c565b506131b28785612b5c565b506001600160a01b03808516600090815260208b8152604080832080546001600160a01b03191690559288168252888152918120558201516131fd906001600160601b0316846155a9565b92505b600101613072565b50613221600080516020615ecf833981519152836142bd565b5061324063c48549de60e01b8d8d604051602001610d9b9291906157ca565b7fdf3dcd7987202f64648f3acdbf12401e3a2bb23e77e19f99826b5475cbb863698b8d604051613271929190615c81565b60405180910390a150505050505050505050919050565b61329061499a565b6132a261329c89615ad1565b836142cd565b905060006132b26123c78a615ad1565b90506132cb82898989896123e58a61159f8960006135df565b50979650505050505050565b600081815260018301602052604081205461331e5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561099b565b50600061099b565b815481018181101561099b57634e487b7160005260116020526024601cfd5b60608160000180548060200260200160405190810160405280929190818152602001828054801561339557602002820191906000526020600020905b815481526020019060010190808311613381575b50505050509050919050565b60208201516000908082036133dc576000356001600160e01b03191660004660405163092048d160e11b8152600401610bc593929190615b9b565b6002546133ea908590613a1f565b60006133f5856134a0565b90506134008261387d565b6000838152600160208181526040808420858552909152918290209188015190820184905560069091015592508451831461345c576000356001600160e01b03191660405163d4cec26960e01b8152600401610bc591906155f1565b8083837fa57d40f1496988cf60ab7c9d5ba4ff83647f67d3898d441a3aaf21b651678fd98888604051613490929190615bbd565b60405180910390a4505092915050565b6080810151606082015160a083015151600092919083906001600160401b038111156134ce576134ce615023565b6040519080825280602002602001820160405280156134f7578160200160208202803683370190505b5060c086015190915060005b8251811015613556578660a00151818151811061352257613522615755565b60200260200101518051906020012083828151811061354357613543615755565b6020908102919091010152600101613503565b50604080517fd051578048e6ff0bbc9fca3b65a42088dbde10f36ca841de566711087ad9b08a8152875160208083019190915280890151828401529790910151606082015283518702938701939093206080840152835186029386019390932060a0830152805185029085012060c082015281518402919093012060e083015250610100902090565b604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b841580159061362657508483145b613651576000356001600160e01b0319166040516306b5667560e21b8152600401610bc591906155f1565b600061365b613d8a565b9050600081613668613d94565b61367291906155bc565b61367d9060016155a9565b9050600080366000805b89811015613841578a8a828181106136a1576136a1615755565b606002919091019350600090508d8d838181106136c0576136c0615755565b90506020020160208101906136d59190615ca6565b60018111156136e6576136e6614d9e565b036137125761370b896136fc6020860186615cd2565b856020013586604001356143cd565b9350613789565b60018d8d8381811061372657613726615755565b905060200201602081019061373b9190615ca6565b600181111561374c5761374c614d9e565b036137625761370b886136fc6020860186615cd2565b6000356001600160e01b031916604051630612418f60e11b8152600401610bc591906155f1565b836001600160a01b0316856001600160a01b0316106137c9576000356001600160e01b031916604051635d3dcd3160e01b8152600401610bc591906155f1565b83945060006137d7856110a9565b9050801561383857600192506138268f8f8f858181106137f9576137f9615755565b905060200201602081019061380e9190615ca6565b8a8a89613820368b90038b018b615ced565b87613d9e565b15613838575050505050505050611c8d565b50600101613687565b508061386e576000356001600160e01b03191660405163726b3acb60e01b8152600401610bc591906155f1565b50505050505050505050505050565b600081815260208190526040812054908190036138ac5750600090815260208190526040902060019081905590565b60008281526001602090815260408083208484529091528120906138cf826128c8565b905080613926576000825460ff1660048111156138ee576138ee614d9e565b0361390c5760405163757a436360e01b815260040160405180910390fd5b600084815260208190526040902080546001019081905592505b5050919050565b61393561499a565b82518152602080840151604080840191909152600091830191909152830151516001600160401b0381111561396c5761396c615023565b604051908082528060200260200182016040528015613995578160200160208202803683370190505b5060608083019190915283015160808083019190915283015160a08083019190915283015160c082015260005b8360400151518110156122ca578281815181106139e1576139e1615755565b6020026020010151826060015182815181106139ff576139ff615755565b6001600160a01b03909216602092830291909101909101526001016139c2565b6000826060015151118015613a3d5750816080015151826060015151145b8015613a5257508160a0015151826060015151145b8015613a6757508160c0015151826060015151145b613a92576000356001600160e01b0319166040516306b5667560e21b8152600401610bc591906155f1565b613a9c81426155a9565b82604001511115610bd85760405163ad89be9d60e01b815260040160405180910390fd5b60608101516040820151608083015151600092919083906001600160401b03811115613aee57613aee615023565b604051908082528060200260200182016040528015613b17578160200160208202803683370190505b5060a086015190915060005b8251811015613b765786608001518181518110613b4257613b42615755565b602002602001015180519060200120838281518110613b6357613b63615755565b6020908102919091010152600101613b23565b50604080517f1463f426c05aff2c1a7a0957a71c9898bc8b47142540538e79ee25ee911413508152875160208083019190915297880151918101919091528351870293870193909320606084015283518602938601939093206080830152805185029085012060a082015281518402919093012060c08301525060e0902090565b600081604051602401613c0a91906155f1565b60408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b1790525190915060009081906001600160a01b03861690613c53908590615c18565b600060405180830381855afa9150503d8060008114613c8e576040519150601f19603f3d011682016040523d82523d6000602084013e613c93565b606091505b509150915081613d5557846001600160a01b031683604051602401613cb89190615d4d565b60408051601f198184030181529181526020820180516001600160e01b03166325da93a560e11b17905251613ced9190615c18565b600060405180830381855afa9150503d8060008114613d28576040519150601f19603f3d011682016040523d82523d6000602084013e613d2d565b606091505b50909250905081613d5557838560405163069d427960e11b8152600401610bc5929190615d60565b80806020019051810190613d699190615d83565b6106c757838560405163069d427960e11b8152600401610bc5929190615d60565b60006108e2610b1b565b60006108e2610ed5565b60208088015188516000828152600184526040808220838352909452928320613dc6816128c8565b15613dd75760019350505050610776565b6020808c015160009081529081905260409020548214613e18576000356001600160e01b03191660405163d4cec26960e01b8152600401610bc591906155f1565b6000815460ff166004811115613e3057613e30614d9e565b14613e4e576040516322de95ff60e21b815260040160405180910390fd5b6001600160a01b038716600090815260088201602052604090205460ff1615613e955760405163025fd59560e41b81526001600160a01b0388166004820152602401610bc5565b6001600160a01b03871660009081526008820160209081526040909120805460ff19166001179055860151151580613ed05750604086015115155b80613ede5750855160ff1615155b15613f25576001600160a01b03871660009081526007820160209081526040918290208851815460ff191660ff909116178155908801516001820155908701516002909101555b866001600160a01b031681600101547f1203f9e81c814a35f5f4cc24087b2a24c6fb7986a9f1406b68a9484882c93a238c88604051613f65929190615da5565b60405180910390a3600080808c6001811115613f8357613f83614d9e565b03613fd8576004830180546001810182556000918252602082200180546001600160a01b0319166001600160a01b038c16179055600384018054899290613fcb9084906155a9565b925050819055915061403d565b60018c6001811115613fec57613fec614d9e565b03613762576005830180546001810182556000918252602082200180546001600160a01b0319166001600160a01b038c161790556002840180548992906140349084906155a9565b92505081905590505b8a821061409157825460ff19166001908117845580840154604051919750907f5c819725ea53655a3b898f3df59b66489761935454e9212ca1e5ebd759953d0b90600090a261408c838e6143f5565b6140d7565b8981106140d757825460ff19166003178355600180840154604051919750907f55295d4ce992922fa2e5ffbf3a3dcdb367de0a15e125ace083456017fd22060f90600090a25b5050505050979650505050505050565b80600360008460038111156140fe576140fe614d9e565b600381111561410f5761410f614d9e565b8152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600381111561414d5761414d614d9e565b6040517f356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d90600090a35050565b6001600160a01b038116611555576000356001600160e01b03191660405163104c66df60e31b8152600401610bc591906155f1565b600081815260018301602052604081205480156142985760006141d36001836155bc565b85549091506000906141e7906001906155bc565b905081811461424c57600086600001828154811061420757614207615755565b906000526020600020015490508087600001848154811061422a5761422a615755565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061425d5761425d615db3565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061099b565b600091505061099b565b60006142ac825490565b9050611167826113148360016155a9565b600061099b836114698585614462565b6142d561499a565b6142ee6142e784604001516001612177565b849061392d565b905061430560025482613a1f90919063ffffffff16565b6000614310826134a0565b9050600061431e600061387d565b6000818152600080516020615def83398151915260209081526040909120908701516001820185905560069091015590508251811461437e576000356001600160e01b03191660405163d4cec26960e01b8152600401610bc591906155f1565b81817f771d78ae9e5fca95a532fb0971d575d0ce9b59d14823c063e08740137e0e0eca856143ab89613ac0565b89896040516143bd949392919061599a565b60405180910390a3505092915050565b60008060006143de8787878761448b565b915091506143eb81614578565b5095945050505050565b6143fe8161472e565b15610bd857815460ff1916600217825560008061441a83614748565b9150915083600101547fe134987599ae266ec90edeff1b26125b287dbb57b10822649432d1bb26537fba8383604051614454929190615dc9565b60405180910390a250505050565b600082548281101561448157634e487b7160005260116020526024601cfd5b9190910392915050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156144c2575060009050600361456f565b8460ff16601b141580156144da57508460ff16601c14155b156144eb575060009050600461456f565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561453f573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166145685760006001925092505061456f565b9150600090505b94509492505050565b600081600481111561458c5761458c614d9e565b036145945750565b60018160048111156145a8576145a8614d9e565b036145f55760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610bc5565b600281600481111561460957614609614d9e565b036146565760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610bc5565b600381600481111561466a5761466a614d9e565b036146c25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610bc5565b60048160048111156146d6576146d6614d9e565b036115555760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610bc5565b600081602001516000148061099b57505060200151461490565b6060806147548361472e565b61478657602083015160405163092048d160e11b8152610bc5916001600160e01b031960003516914690600401615b9b565b8260600151516001600160401b038111156147a3576147a3615023565b6040519080825280602002602001820160405280156147cc578160200160208202803683370190505b5091508260600151516001600160401b038111156147ec576147ec615023565b60405190808252806020026020018201604052801561481f57816020015b606081526020019060019003908161480a5790505b50905060005b836060015151811015614994578360c00151818151811061484857614848615755565b60200260200101515a1161487b5761485f846134a0565b6040516307aec4ab60e21b8152600401610bc591815260200190565b8360600151818151811061489157614891615755565b60200260200101516001600160a01b0316846080015182815181106148b8576148b8615755565b60200260200101518560c0015183815181106148d6576148d6615755565b6020026020010151908660a0015184815181106148f5576148f5615755565b602002602001015160405161490a9190615c18565b600060405180830381858888f193505050503d8060008114614948576040519150601f19603f3d011682016040523d82523d6000602084013e61494d565b606091505b5084838151811061496057614960615755565b6020026020010184848151811061497957614979615755565b60209081029190910101919091529015159052600101614825565b50915091565b6040518060e00160405280600081526020016000815260200160008152602001606081526020016060815260200160608152602001606081525090565b508054600082559060005260206000209081019061155591905b80821115614a0557600081556001016149f1565b5090565b600060e082840312156124e057600080fd5b60008083601f840112614a2d57600080fd5b5081356001600160401b03811115614a4457600080fd5b6020830191508360208260051b8501011115610f2157600080fd5b60008083601f840112614a7157600080fd5b5081356001600160401b03811115614a8857600080fd5b602083019150836020606083028501011115610f2157600080fd5b600080600080600060608688031215614abb57600080fd5b85356001600160401b0380821115614ad257600080fd5b614ade89838a01614a09565b96506020880135915080821115614af457600080fd5b614b0089838a01614a1b565b90965094506040880135915080821115614b1957600080fd5b50614b2688828901614a5f565b969995985093965092949392505050565b60008060008060008060608789031215614b5057600080fd5b86356001600160401b0380821115614b6757600080fd5b614b738a838b01614a1b565b90985096506020890135915080821115614b8c57600080fd5b614b988a838b01614a1b565b90965094506040890135915080821115614bb157600080fd5b50614bbe89828a01614a1b565b979a9699509497509295939492505050565b600081518084526020808501945080840160005b83811015614c02578151151587529582019590820190600101614be4565b509495945050505050565b6020815260006109496020830184614bd0565b600080600080600080600080600060a08a8c031215614c3e57600080fd5b8935985060208a01356001600160401b0380821115614c5c57600080fd5b614c688d838e01614a1b565b909a50985060408c0135915080821115614c8157600080fd5b614c8d8d838e01614a1b565b909850965060608c0135915080821115614ca657600080fd5b614cb28d838e01614a1b565b909650945060808c0135915080821115614ccb57600080fd5b50614cd88c828d01614a1b565b915080935050809150509295985092959850929598565b60008060208385031215614d0257600080fd5b82356001600160401b03811115614d1857600080fd5b614d2485828601614a1b565b90969095509350505050565b600081518084526020808501945080840160005b83811015614c025781516001600160a01b031687529582019590820190600101614d44565b6020815260006109496020830184614d30565b60008060408385031215614d8f57600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60028110614dc457614dc4614d9e565b9052565b60006060808352614ddb81840187614d30565b83810360208581019190915286518083528782019282019060005b81811015614e1957614e09838651614db4565b9383019391830191600101614df6565b505060409250858103838701528087518083528383019150838901925060005b81811015614e69578351805160ff1684528581015186850152860151868401529284019291860191600101614e39565b50909a9950505050505050505050565b80356001600160a01b038116811461116757600080fd5b600080600060608486031215614ea557600080fd5b8335925060208401359150614ebc60408501614e79565b90509250925092565b600080600080600060608688031215614edd57600080fd5b85356001600160401b0380821115614ef457600080fd5b9087019060c0828a031215614f0857600080fd5b90955060208701359080821115614af457600080fd5b600060208284031215614f3057600080fd5b5035919050565b80356002811061116757600080fd5b60008060008060008060008060008060c08b8d031215614f6557600080fd5b8a35995060208b01356001600160401b0380821115614f8357600080fd5b614f8f8e838f01614a1b565b909b50995060408d0135915080821115614fa857600080fd5b614fb48e838f01614a1b565b909950975060608d0135915080821115614fcd57600080fd5b614fd98e838f01614a1b565b909750955060808d0135915080821115614ff257600080fd5b50614fff8d828e01614a1b565b9094509250615012905060a08c01614f37565b90509295989b9194979a5092959850565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b038111828210171561505b5761505b615023565b60405290565b60405160c081016001600160401b038111828210171561505b5761505b615023565b604051601f8201601f191681016001600160401b03811182821017156150ab576150ab615023565b604052919050565b60006001600160401b038211156150cc576150cc615023565b5060051b60200190565b600082601f8301126150e757600080fd5b813560206150fc6150f7836150b3565b615083565b82815260059290921b8401810191818101908684111561511b57600080fd5b8286015b84811015615144578035600481106151375760008081fd5b835291830191830161511f565b509695505050505050565b600082601f83011261516057600080fd5b813560206151706150f7836150b3565b82815260059290921b8401810191818101908684111561518f57600080fd5b8286015b84811015615144576151a481614e79565b8352918301918301615193565b600080604083850312156151c457600080fd5b82356001600160401b03808211156151db57600080fd5b6151e7868387016150d6565b935060208501359150808211156151fd57600080fd5b5061520a8582860161514f565b9150509250929050565b6000806040838503121561522757600080fd5b8235915061523760208401614e79565b90509250929050565b8035600e811061116757600080fd5b6000806040838503121561526257600080fd5b61526b83615240565b915061523760208401614e79565b60006020828403121561528b57600080fd5b61094982614e79565b60008060008060008060008060008060c08b8d0312156152b357600080fd5b8a35995060208b0135985060408b01356001600160401b03808211156152d857600080fd5b6152e48e838f01614a1b565b909a50985060608d01359150808211156152fd57600080fd5b6153098e838f01614a1b565b909850965060808d013591508082111561532257600080fd5b61532e8e838f01614a1b565b909650945060a08d013591508082111561534757600080fd5b506153548d828e01614a1b565b915080935050809150509295989b9194979a5092959850565b6000806040838503121561538057600080fd5b82356001600160401b0381111561539657600080fd5b6153a285828601614a09565b92505061523760208401614f37565b60a08101600587106153c5576153c5614d9e565b95815260208101949094526040840192909252606083015260809091015290565b6000602082840312156153f857600080fd5b81356001600160401b0381111561540e57600080fd5b6108938482850161514f565b600081518084526020808501945080840160005b83811015614c025781518752958201959082019060010161542e565b60608152600061545d6060830186614d30565b828103602084015261546f8186614d30565b90508281036040840152615483818561541a565b9695505050505050565b602081526000610949602083018461541a565b6000602082840312156154b257600080fd5b61094982615240565b60006154c96150f7846150b3565b8381529050602080820190600585901b8401868111156154e857600080fd5b845b8181101561557b5780356001600160401b038082111561550a5760008081fd5b8188019150601f8a818401126155205760008081fd5b82358281111561553257615532615023565b615543818301601f19168801615083565b92508083528b8782860101111561555c57600091508182fd5b80878501888501376000908301870152508552509282019282016154ea565b505050509392505050565b60006109493684846154bb565b634e487b7160e01b600052601160045260246000fd5b8082018082111561099b5761099b615593565b8181038181111561099b5761099b615593565b6000826155ec57634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031991909116815260200190565b600082601f83011261561757600080fd5b813560206156276150f7836150b3565b82815260059290921b8401810191818101908684111561564657600080fd5b8286015b84811015615144578035835291830191830161564a565b600082601f83011261567257600080fd5b610949838335602085016154bb565b600060e0823603121561569357600080fd5b61569b615039565b82358152602083013560208201526040830135604082015260608301356001600160401b03808211156156cd57600080fd5b6156d93683870161514f565b606084015260808501359150808211156156f257600080fd5b6156fe36838701615606565b608084015260a085013591508082111561571757600080fd5b61572336838701615661565b60a084015260c085013591508082111561573c57600080fd5b5061574936828601615606565b60c08301525092915050565b634e487b7160e01b600052603260045260246000fd5b808202811582820484141761099b5761099b615593565b60208101600e831061579657615796614d9e565b91905290565b6001600160e01b03198316815260408101600983106157bd576157bd614d9e565b8260208301529392505050565b6040815260006157dd6040830185614d30565b82810360208401526157ef8185614bd0565b95945050505050565b60808152600061580b6080830187614bd0565b82810360208481019190915286518083528782019282019060005b8181101561584b5784516001600160601b031683529383019391830191600101615826565b5050848103604086015261585f8188614d30565b9250505082810360608401526107768185614d30565b60005b83811015615890578181015183820152602001615878565b50506000910152565b600081518084526158b1816020860160208601615875565b601f01601f19169290920160200192915050565b600081518084526020808501808196508360051b8101915082860160005b8581101561590d5782840389526158fb848351615899565b988501989350908401906001016158e3565b5091979650505050505050565b8051825260208101516020830152604081015160408301526000606082015160e0606085015261594d60e0850182614d30565b905060808301518482036080860152615966828261541a565b91505060a083015184820360a086015261598082826158c5565b91505060c083015184820360c08601526157ef828261541a565b6080815260006159ad608083018761591a565b60208681850152838203604085015260c08201865183528187015182840152604087015160c0604085015281815180845260e0860191508483019350600092505b80831015615a1e57835160048110615a0857615a08614d9e565b82529284019260019290920191908401906159ee565b50606089015193508481036060860152615a38818561541a565b935050505060808601518282036080840152615a5482826158c5565b91505060a086015182820360a0840152615a6e828261541a565b93505050506157ef60608301846001600160a01b03169052565b6000808335601e19843603018112615a9f57600080fd5b8301803591506001600160401b03821115615ab957600080fd5b6020019150600581901b3603821315610f2157600080fd5b600060c08236031215615ae357600080fd5b615aeb615061565b823581526020830135602082015260408301356001600160401b0380821115615b1357600080fd5b615b1f368387016150d6565b60408401526060850135915080821115615b3857600080fd5b615b4436838701615606565b60608401526080850135915080821115615b5d57600080fd5b615b6936838701615661565b608084015260a0850135915080821115615b8257600080fd5b50615b8f36828601615606565b60a08301525092915050565b6001600160e01b03199390931683526020830191909152604082015260600190565b604081526000615bd0604083018561591a565b905060018060a01b03831660208301529392505050565b6001600160e01b0319831681528151600090615c0a816004850160208701615875565b919091016004019392505050565b60008251615c2a818460208701615875565b9190910192915050565b608081526000615c476080830187615899565b8281036020840152615c598187614d30565b90508281036040840152615c6d8186614bd0565b9050828103606084015261077681856158c5565b604081526000615c946040830185614bd0565b82810360208401526157ef8185614d30565b600060208284031215615cb857600080fd5b61094982614f37565b803560ff8116811461116757600080fd5b600060208284031215615ce457600080fd5b61094982615cc1565b600060608284031215615cff57600080fd5b604051606081018181106001600160401b0382111715615d2157615d21615023565b604052615d2d83615cc1565b815260208301356020820152604083013560408201528091505092915050565b6020815260006109496020830184615899565b6001600160e01b03199290921682526001600160a01b0316602082015260400190565b600060208284031215615d9557600080fd5b8151801515811461094957600080fd5b604081016157bd8285614db4565b634e487b7160e01b600052603160045260246000fd5b604081526000615ddc6040830185614bd0565b82810360208401526157ef81856158c556fea6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb495da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd976240ac1ff16a4f04f2a37a9ba5252a69baa100b460e517d1f8019c054a5ad698f9ffc55405a488814eaa0e2a685a0131142785b8d033d311c8c8244e34a7c12ca40f88547008e60f5748911f2e59feb3093b7e4c2e87b2dd69d61f112fcc932de8e38400683eb2cb350596d73644c0c89fe45f108600003457374f4ab3e87b4f3aa3d38c234075fde25875da8a6b7e36b58b86681d483271a99eeeee1d78e258a24d6924fe71b0c8b61aea02ca498b5f53b29bd95726278b1fe4eb791bb24a42644ca164736f6c6343000811000a5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd976240", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102685760003560e01c80639a7d338211610151578063bc96180b116100c3578063de981f1b11610087578063de981f1b1461061b578063e75235b814610646578063e9c034981461064e578063f80b535214610661578063fb4f637114610669578063fdc4fa471461067c57600080fd5b8063bc96180b146105b6578063c441c4a8146105be578063cc7e6b3b146105d5578063d78392f8146105f5578063dafae4081461060857600080fd5b8063ada86b2411610115578063ada86b24146104f2578063b384abef146104fa578063b405aaf214610555578063b9c3620914610568578063bc4e068f14610590578063bc9182fd146105a357600080fd5b80639a7d33821461049e5780639b19dbfd146104b15780639b2ee437146104b9578063a1819f9a146104cc578063a8a0e32c146104df57600080fd5b80632faf925d116101ea578063663ac011116101ae578063663ac011146103e75780637de5dedd146103fa578063800eaab314610402578063828fc1a114610415578063865e6fd314610428578063901979d51461043b57600080fd5b80632faf925d1461037257806334d5f37b1461038557806335da8121146103a55780633644e515146103b8578063562d5304146103df57600080fd5b80630f7c3189116102315780630f7c3189146102f25780631c905e39146103075780631f425338146103295780632c5e65201461033c5780632d6d7d731461035f57600080fd5b80624054b81461026d57806301a5f43f1461028257806309fcd8c7146102ab5780630a44fa43146102be5780630b881830146102df575b600080fd5b61028061027b366004614aa3565b61068f565b005b610295610290366004614b37565b6106ce565b6040516102a29190614c0d565b60405180910390f35b6102806102b9366004614c20565b610781565b6102d16102cc366004614cef565b610816565b6040519081526020016102a2565b6102806102ed366004614aa3565b61089b565b6102fa6108c9565b6040516102a29190614d69565b61031a610315366004614d7c565b6108e7565b6040516102a293929190614dc8565b610295610337366004614cef565b610903565b61034f61034a366004614e90565b610950565b60405190151581526020016102a2565b6102fa61036d366004614cef565b61095d565b610280610380366004614ec5565b6109a1565b6102d1610393366004614f1e565b60006020819052908152604090205481565b6102956103b3366004614cef565b6109cf565b6102d17f000000000000000000000000000000000000000000000000000000000000000081565b6102d1610a15565b6102806103f5366004614f46565b610a2e565b6102d1610b1b565b6102806104103660046151b1565b610b97565b61034f610423366004615214565b610bdc565b61028061043636600461524f565b610bea565b6102d1610449366004615279565b6001600160a01b039081166000908152600080516020615e8f83398151915260209081526040808320549093168252600080516020615e6f83398151915290522054600160a01b90046001600160601b031690565b6102806104ac366004614d7c565b610c05565b6102fa610c51565b6102806104c7366004615279565b610c5b565b6102806104da366004615294565b610df2565b6102806104ed36600461536d565b610eb9565b6102d1610ed5565b610544610508366004614d7c565b600160208181526000938452604080852090915291835291208054918101546002820154600383015460069093015460ff909416939192909185565b6040516102a29594939291906153b1565b61034f610563366004615279565b610eed565b61057b610576366004614d7c565b610f07565b604080519283526020830191909152016102a2565b61031a61059e366004614f1e565b610f28565b6102fa6105b13660046153e6565b610f45565b6102d1611036565b6105c6611041565b6040516102a29392919061544a565b6105e86105e3366004614cef565b61106b565b6040516102a2919061548d565b6102d1610603366004615279565b6110a9565b61034f610616366004614f1e565b6110b4565b61062e6106293660046154a0565b6110f1565b6040516001600160a01b0390911681526020016102a2565b61057b61116c565b61029561065c366004614cef565b61119d565b6102fa6111e3565b610280610677366004614ec5565b6111ed565b6102fa61068a366004614cef565b61122d565b6106983361151c565b6106c785858585857f000000000000000000000000000000000000000000000000000000000000000033611558565b5050505050565b60606106d86115fd565b61077687878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82529093508a92508991829185019084908082843760009201919091525050604080516020808a0282810182019093528982529093508992508891829185019084908082843760009201919091525061162d92505050565b979650505050505050565b61078a3361151c565b61080b8989898989808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506107d092508a91508b9050615586565b8787808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152503392506119a9915050565b505050505050505050565b60008282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506108579250839150611b069050565b610893848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611b3b92505050565b949350505050565b6106c785858585857f0000000000000000000000000000000000000000000000000000000000000000611be2565b60606108e2600080516020615e0f83398151915261150f565b905090565b60608060606108f68585611c96565b9250925092509250925092565b606061090d6115fd565b61094983838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061207f92505050565b9392505050565b6000610893848484612141565b606061094983838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250612177915050565b92915050565b6106c785858585857f00000000000000000000000000000000000000000000000000000000000000006122d1565b60606109d96115fd565b6109498383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506123f492505050565b60006108e2600080516020615eaf8339815191526124e6565b610a373361151c565b60003390506000610b00468d8d8d80806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050508c8c80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610ac592508d91508e9050615586565b8a8a808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508b92506124f0915050565b9050610b0d8282856125ff565b505050505050505050505050565b6000610b33600080516020615e2f8339815191525490565b6001610b4b600080516020615e2f8339815191525490565b610b79610b64600080516020615ecf8339815191525490565b600080516020615e4f83398151915290612715565b610b8391906155a9565b610b8d91906155bc565b6108e291906155cf565b333014610bce576000356001600160e01b0319166040516307337e1960e41b8152600401610bc591906155f1565b60405180910390fd5b610bd88282612740565b5050565b600061094960008484612141565b610bf26115fd565b610bfb816127ee565b610bd88282612824565b6000828152600160208181526040808420858552909152822090810154909103610c425760405163713b099760e11b815260040160405180910390fd5b610c4b816128c8565b50505050565b60606108e2612add565b610c643361151c565b610c6d81612af6565b336000908152600080516020615e6f83398151915260208190526040909120546001600160a01b039081169083168103610cc557604051630669b93360e31b81526001600160a01b0384166004820152602401610bc5565b600080516020615eaf8339815191526000610ce08284612b5c565b8015610cf15750610cf18286611318565b905080610d1c5760405163080fab4b60e31b81526001600160a01b0386166004820152602401610bc5565b6001600160a01b038381166000818152600080516020615e8f8339815191526020818152604080842080546001600160a01b0319908116909155958b16808552818520805488163390811790915585528a8352938190208054909616841790955584519081019390935292820152610daf906364b18d0960e11b906060015b604051602081830303815290604052612b71565b6040516001600160a01b03808816919086169033907fcef34cd748f30a1b7a2f214fd1651779f79bc6c1be02785cad5c1f0ee877213d90600090a4505050505050565b610dfb3361151c565b610eac8a8a8a8a8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c918291850190849080828437600092019190915250610e7192508a91508b9050615586565b8787808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152503392506124f0915050565b5050505050505050505050565b610ec23361151c565b610bd833610ecf84615681565b836125ff565b60006108e2600080516020615ecf8339815191525490565b600061099b600080516020615eaf83398151915283611437565b600080610f126115fd565b610f1c8484612d66565b915091505b9250929050565b6060806060610f38600085611c96565b9250925092509193909250565b8051606090806001600160401b03811115610f6257610f62615023565b604051908082528060200260200182016040528015610f8b578160200160208202803683370190505b509150600080516020615e6f83398151915260005b8281101561102e57816000868381518110610fbd57610fbd615755565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060000160009054906101000a90046001600160a01b031684828151811061100e5761100e615755565b6001600160a01b0390921660209283029190910190910152600101610fa0565b505050919050565b60006108e260025490565b606080606061104e612e5b565b925061105983610f45565b915061106483612e86565b9050909192565b6060610949838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612e8692505050565b600061099b82612f6b565b60006110cf610b64600080516020615ecf8339815191525490565b600080516020615e2f833981519152546110e9908461576b565b101592915050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600d81111561112857611128614d9e565b60ff1681526020810191909152604001600020546001600160a01b0316905080611167578160405163409140df60e11b8152600401610bc59190615782565b919050565b600080611185600080516020615e4f8339815191525490565b600080516020615e2f83398151915254915091509091565b60606111a76115fd565b610949838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612fa392505050565b60606108e2612e5b565b6111f63361151c565b61122585858585857f000000000000000000000000000000000000000000000000000000000000000033613288565b505050505050565b606081806001600160401b0381111561124857611248615023565b604051908082528060200260200182016040528015611271578160200160208202803683370190505b509150600080516020615e8f83398151915260005b8281101561130b578160008787848181106112a3576112a3615755565b90506020020160208101906112b89190615279565b6001600160a01b03908116825260208201929092526040016000205485519116908590839081106112eb576112eb615755565b6001600160a01b0390921660209283029190910190910152600101611286565b50505092915050565b9055565b6000610949836001600160a01b0384166132d7565b81518151606091908082016001600160401b0381111561134f5761134f615023565b604051908082528060200260200182016040528015611378578160200160208202803683370190505b50925060005b828110156113d25785818151811061139857611398615755565b60200260200101518482815181106113b2576113b2615755565b6001600160a01b039092166020928302919091019091015260010161137e565b60005b8281101561142d578581815181106113ef576113ef615755565b602002602001015185838151811061140957611409615755565b6001600160a01b0390921660209283029190910190910152600191820191016113d5565b5050505092915050565b6001600160a01b03811660009081526001830160205260408120541515610949565b600061099b836114698585613326565b9250829055565b6000815160000361148357506000919050565b60005b600183510381101561150657600181015b83518110156114fd578381815181106114b2576114b2615755565b60200260200101516001600160a01b03168483815181106114d5576114d5615755565b60200260200101516001600160a01b0316036114f5575060019392505050565b600101611497565b50600101611486565b50600092915050565b6060600061094983613345565b61152581612f6b565b600003611555576000356001600160e01b0319166003604051620f948f60ea1b8152600401610bc592919061579c565b50565b61156a61156488615681565b826133a1565b50600061157e61157989615681565b6134a0565b90506115f361158c89615681565b888888886115df8961159f8960006135df565b60405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6115ee8a61159f8a60016135df565b613618565b5050505050505050565b33301461162b576000356001600160e01b0319166040516307337e1960e41b8152600401610bc591906155f1565b565b6060611639838361132d565b61164281611b06565b82518551811480156116545750845181145b61167f576000356001600160e01b0319166040516306b5667560e21b8152600401610bc591906155f1565b806001600160401b0381111561169757611697615023565b6040519080825280602002602001820160405280156116c0578160200160208202803683370190505b509250806000036116d157506119a1565b604080518082019091526000808252602082018190527f546f6b46ab35b030b6816596b352aef78857377176c8b24baa2046a62cf1998c91600080516020615e8f83398151915291600080516020615eaf83398151915291600080516020615e6f833981519152919081908190815b89811015611922578d818151811061175a5761175a615755565b602002602001015194508c818151811061177657611776615755565b6020026020010151935061178985612af6565b61179284612af6565b8e81815181106117a4576117a4615755565b60200260200101516001600160601b03166000036117e3576000356001600160e01b031916604051637f11b8a360e11b8152600401610bc591906155f1565b6117ed8986611437565b806117fd57506117fd8985611437565b8061180d575061180d8786611437565b8061181d575061181d8785611437565b158c828151811061183057611830615755565b6020026020010190151590811515815250508b818151811061185457611854615755565b60200260200101511561191a5761186b8986611318565b506118768785611318565b506001600160a01b03848116600081815260208b90526040902080546001600160a01b0319169288169290921790915582528e518f90829081106118bc576118bc615755565b6020908102919091018101516001600160601b03169083018190526118e190846155a9565b6001600160a01b038087166000908152602089815260409091208551918601516001600160601b0316600160a01b029190921617905592505b600101611740565b5061193b600080516020615ecf83398151915283611459565b5061195a635ebae8a060e01b8d8d604051602001610d9b9291906157ca565b7f897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b788b8f8f8f60405161198f94939291906157f8565b60405180910390a15050505050505050505b509392505050565b60006119b5600061387d565b905060006040518060c001604052808381526020018a8152602001898980806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093855250505060208083018a905260408084018a9052606090930188905282518b820281810183019094528b81529394509092611a6692611a5f928d918d9182919085019084908082843760009201919091525060019250612177915050565b839061392d565b9050611a7d60025482613a1f90919063ffffffff16565b6000611a88826134a0565b6000858152600080516020615def83398151915260205260409020600181018290556006018c9055905080847f771d78ae9e5fca95a532fb0971d575d0ce9b59d14823c063e08740137e0e0eca84611adf87613ac0565b878a604051611af1949392919061599a565b60405180910390a35050505050505050505050565b611b0f81611470565b15611555576000356001600160e01b031916604051630d697db160e11b8152600401610bc591906155f1565b600081611b4781611b06565b6000611b60600080516020615eaf8339815191526124e6565b9050600080516020615e6f83398151915260005b82811015611bd957816000878381518110611b9157611b91615755565b6020908102919091018101516001600160a01b0316825281019190915260400160002054611bcf90600160a01b90046001600160601b0316866155a9565b9450600101611b74565b50505050919050565b6000611bf061157988615681565b6020808901356000908152600180835260408083208c35845290935291902001549091508114611c5f576020808801356000908152600180835260408083208b3584529093529082902001549051632bee7fdb60e21b8152610bc5918391600401918252602082015260400190565b611c8d611c6b88615681565b87878787611c7e8861159f8960006135df565b6115ee8961159f8a60016135df565b50505050505050565b60008281526001602090815260408083208484529091528120600481015460058201546060938493849390929091611cce82846155a9565b9050806001600160401b03811115611ce857611ce8615023565b604051908082528060200260200182016040528015611d11578160200160208202803683370190505b509550806001600160401b03811115611d2c57611d2c615023565b604051908082528060200260200182016040528015611d7757816020015b6040805160608101825260008082526020808301829052928201528252600019909201910181611d4a5790505b509450806001600160401b03811115611d9257611d92615023565b604051908082528060200260200182016040528015611dbb578160200160208202803683370190505b50965060005b83811015611f10576000878281518110611ddd57611ddd615755565b60200260200101906001811115611df657611df6614d9e565b90816001811115611e0957611e09614d9e565b90525060008a81526001602090815260408083208c845290915281206004870180546007909201929184908110611e4257611e42615755565b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815460ff16815260018201549381019390935260020154908201528651879083908110611ea057611ea0615755565b6020026020010181905250846004018181548110611ec057611ec0615755565b9060005260206000200160009054906101000a90046001600160a01b0316888281518110611ef057611ef0615755565b6001600160a01b0390921660209283029190910190910152600101611dc1565b5060005b8281101561207357600187611f2986846155a9565b81518110611f3957611f39615755565b60200260200101906001811115611f5257611f52614d9e565b90816001811115611f6557611f65614d9e565b90525060008a81526001602090815260408083208c845290915281206005870180546007909201929184908110611f9e57611f9e615755565b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815460ff168152600182015493810193909352600201549082015286611ff386846155a9565b8151811061200357612003615755565b602002602001018190525084600501818154811061202357612023615755565b6000918252602090912001546001600160a01b03168861204386846155a9565b8151811061205357612053615755565b6001600160a01b0390921660209283029190910190910152600101611f14565b50505050509250925092565b60608161208b81611b06565b8251806001600160401b038111156120a5576120a5615023565b6040519080825280602002602001820160405280156120ce578160200160208202803683370190505b509250600080516020615e0f83398151915260005b82811015611bd95761211786828151811061210057612100615755565b602002602001015183612b5c90919063ffffffff16565b85828151811061212957612129615755565b911515602092830291909101909101526001016120e3565b600083815260016020908152604080832085845282528083206001600160a01b038516845260080190915281205460ff16610893565b606082516001600160401b0381111561219257612192615023565b6040519080825280602002602001820160405280156121bb578160200160208202803683370190505b50905060005b83518110156122ca57600360008583815181106121e0576121e0615755565b602002602001015160038111156121f9576121f9614d9e565b600381111561220a5761220a614d9e565b815260200190815260200160002060009054906101000a90046001600160a01b031682828151811061223e5761223e615755565b60200260200101906001600160a01b031690816001600160a01b031681525050828015612296575060006001600160a01b031682828151811061228357612283615755565b60200260200101516001600160a01b0316145b156122c2576000356001600160e01b03191660405163053265f160e01b8152600401610bc591906155f1565b6001016121c1565b5092915050565b600061232f6123206122e660408a018a615a88565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525060019250612177915050565b61232989615ad1565b9061392d565b9050600061233c826134a0565b60008080526001602081815285518352600080516020615def83398151915290526040909120015490915081146123b95760008080526001602081815284518352600080516020615def833981519152905260409182902001549051632bee7fdb60e21b8152610bc5918391600401918252602082015260400190565b60006123cc6123c78a615ad1565b613ac0565b905061080b83898989896123e58a61159f8960006135df565b6115ee8b61159f8a60016135df565b60608161240081611b06565b8251806001600160401b0381111561241a5761241a615023565b604051908082528060200260200182016040528015612443578160200160208202803683370190505b5092508060000361245457506124e0565b600080516020615e0f83398151915260006314d72edb60e21b815b848110156124da5787818151811061248957612489615755565b6020026020010151925061249c836127ee565b6124a68383613bf7565b6124b08484611318565b8782815181106124c2576124c2615755565b9115156020928302919091019091015260010161246f565b50505050505b50919050565b600061099b825490565b6124f861499a565b8760000361252c576000356001600160e01b03191660004660405163092048d160e11b8152600401610bc593929190615b9b565b60006125378961387d565b90506040518060e001604052808281526020018a815260200189815260200188815260200187815260200186815260200185815250915061258360025483613a1f90919063ffffffff16565b600061258e836134a0565b60008b81526001602081815260408084208785529091529091209081018290556006018a9055905080828b7fa57d40f1496988cf60ab7c9d5ba4ff83647f67d3898d441a3aaf21b651678fd986886040516125ea929190615bbd565b60405180910390a45050979650505050505050565b4682602001511461263857602082015160405163092048d160e11b8152610bc5916001600160e01b031960003516914690600401615b9b565b6000612643836134a0565b60208085015160009081526001808352604080832088518452909352919020015490915081146126b257602080840151600090815260018083526040808320875184529093529082902001549051632bee7fdb60e21b8152610bc5918391600401918252602082015260400190565b60006126bc613d8a565b90506000816126c9613d94565b6126d391906155bc565b6126de9060016155a9565b60408051606081018252600080825260208201819052918101919091529091506115f3868685858b866127108e6110a9565b613d9e565b6000825480156122ca57828102915080820483146122ca57634e487b7160005260116020526024601cfd5b60005b82518110156127e957306001600160a01b031682828151811061276857612768615755565b60200260200101516001600160a01b0316036127a5576000356001600160e01b03191660405163053265f160e01b8152600401610bc591906155f1565b6127e18382815181106127ba576127ba615755565b60200260200101518383815181106127d4576127d4615755565b60200260200101516140e7565b600101612743565b505050565b806001600160a01b03163b60000361155557604051630bfc64a360e21b81526001600160a01b0382166004820152602401610bc5565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600d81111561285a5761285a614d9e565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600d81111561289b5761289b614d9e565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b600080825460ff1660048111156128e1576128e1614d9e565b1480156128f2575042826006015411155b905080156111675760018201546040517f58f98006a7f2f253f8ae8f8b7cec9008ca05359633561cd7c22f3005682d4a5590600090a260005b60048301548110156129de5782600801600084600401838154811061295257612952615755565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff19169055600484018054600786019291908490811061299b5761299b615755565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff1916815560018181018390556002909101919091550161292b565b5060005b6005830154811015612a9557826008016000846005018381548110612a0957612a09615755565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff191690556005840180546007860192919084908110612a5257612a52615755565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff191681556001818101839055600290910191909155016129e2565b50815460ff191682556000600183018190556002830181905560038301819055612ac39060048401906149d7565b612ad16005830160006149d7565b60006006830155919050565b60606108e2600080516020615eaf83398151915261150f565b612aff8161417a565b6001600160a01b0381163f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708114610bd857604051633c88494760e01b81526001600160a01b038316600482015260248101829052604401610bc5565b6000610949836001600160a01b0384166141af565b6000612b8a600080516020615e0f83398151915261150f565b80519091506000819003612b9e5750505050565b6000816001600160401b03811115612bb857612bb8615023565b604051908082528060200260200182016040528015612be1578160200160208202803683370190505b5090506000826001600160401b03811115612bfe57612bfe615023565b604051908082528060200260200182016040528015612c3157816020015b6060815260200190600190039081612c1c5790505b50905060008686604051602001612c49929190615be7565b604051602081830303815290604052905060005b84811015612d1f57858181518110612c7757612c77615755565b60200260200101516001600160a01b031682604051612c969190615c18565b6000604051808303816000865af19150503d8060008114612cd3576040519150601f19603f3d011682016040523d82523d6000602084013e612cd8565b606091505b50858381518110612ceb57612ceb615755565b60200260200101858481518110612d0457612d04615755565b60209081029190910101919091529015159052600101612c5d565b507fc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b6381868585604051612d559493929190615c34565b60405180910390a150505050505050565b60008082841115612d98576000356001600160e01b0319166040516387f6f09560e01b8152600401610bc591906155f1565b600080516020615e4f833981519152549150612dc0600080516020615e2f8339815191525490565b9050612dd9600080516020615e4f833981519152859055565b612df0600080516020615e2f833981519152849055565b8284612e1b7f92872d32822c9d44b36a2537d3e0d4c46fc4de1ce154ccfaed560a8a58445f1d6142a2565b60408051868152602081018690527f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a49250929050565b60606108e27f546f6b46ab35b030b6816596b352aef78857377176c8b24baa2046a62cf1998c61150f565b8051606090806001600160401b03811115612ea357612ea3615023565b604051908082528060200260200182016040528015612ecc578160200160208202803683370190505b509150600080516020615e6f83398151915260005b8281101561102e57816000868381518110612efe57612efe615755565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060000160149054906101000a90046001600160601b03166001600160601b0316848281518110612f5857612f58615755565b6020908102919091010152600101612ee1565b6001600160a01b03166000908152600080516020615e6f8339815191526020526040902054600160a01b90046001600160601b031690565b606081612faf81611b06565b8251806001600160401b03811115612fc957612fc9615023565b604051908082528060200260200182016040528015612ff2578160200160208202803683370190505b5092508060000361300357506124e0565b60408051808201909152600080825260208201819052600080516020615e8f833981519152917f546f6b46ab35b030b6816596b352aef78857377176c8b24baa2046a62cf1998c91600080516020615eaf83398151915291600080516020615e6f833981519152919081908190815b89811015613208578c818151811061308c5761308c615755565b6020908102919091018101516001600160a01b038082166000908152928c9052604090922054909116955093506130c28561417a565b6130cb8461417a565b6001600160a01b0385811660009081526020888152604091829020825180840190935254808416808452600160a01b9091046001600160601b0316918301919091529093509085161461313f576000356001600160e01b03191660405163053265f160e01b8152600401610bc591906155f1565b6131498785611437565b801561315a575061315a8886611437565b8c828151811061316c5761316c615755565b6020026020010190151590811515815250508b818151811061319057613190615755565b602002602001015115613200576131a78886612b5c565b506131b28785612b5c565b506001600160a01b03808516600090815260208b8152604080832080546001600160a01b03191690559288168252888152918120558201516131fd906001600160601b0316846155a9565b92505b600101613072565b50613221600080516020615ecf833981519152836142bd565b5061324063c48549de60e01b8d8d604051602001610d9b9291906157ca565b7fdf3dcd7987202f64648f3acdbf12401e3a2bb23e77e19f99826b5475cbb863698b8d604051613271929190615c81565b60405180910390a150505050505050505050919050565b61329061499a565b6132a261329c89615ad1565b836142cd565b905060006132b26123c78a615ad1565b90506132cb82898989896123e58a61159f8960006135df565b50979650505050505050565b600081815260018301602052604081205461331e5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561099b565b50600061099b565b815481018181101561099b57634e487b7160005260116020526024601cfd5b60608160000180548060200260200160405190810160405280929190818152602001828054801561339557602002820191906000526020600020905b815481526020019060010190808311613381575b50505050509050919050565b60208201516000908082036133dc576000356001600160e01b03191660004660405163092048d160e11b8152600401610bc593929190615b9b565b6002546133ea908590613a1f565b60006133f5856134a0565b90506134008261387d565b6000838152600160208181526040808420858552909152918290209188015190820184905560069091015592508451831461345c576000356001600160e01b03191660405163d4cec26960e01b8152600401610bc591906155f1565b8083837fa57d40f1496988cf60ab7c9d5ba4ff83647f67d3898d441a3aaf21b651678fd98888604051613490929190615bbd565b60405180910390a4505092915050565b6080810151606082015160a083015151600092919083906001600160401b038111156134ce576134ce615023565b6040519080825280602002602001820160405280156134f7578160200160208202803683370190505b5060c086015190915060005b8251811015613556578660a00151818151811061352257613522615755565b60200260200101518051906020012083828151811061354357613543615755565b6020908102919091010152600101613503565b50604080517fd051578048e6ff0bbc9fca3b65a42088dbde10f36ca841de566711087ad9b08a8152875160208083019190915280890151828401529790910151606082015283518702938701939093206080840152835186029386019390932060a0830152805185029085012060c082015281518402919093012060e083015250610100902090565b604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b841580159061362657508483145b613651576000356001600160e01b0319166040516306b5667560e21b8152600401610bc591906155f1565b600061365b613d8a565b9050600081613668613d94565b61367291906155bc565b61367d9060016155a9565b9050600080366000805b89811015613841578a8a828181106136a1576136a1615755565b606002919091019350600090508d8d838181106136c0576136c0615755565b90506020020160208101906136d59190615ca6565b60018111156136e6576136e6614d9e565b036137125761370b896136fc6020860186615cd2565b856020013586604001356143cd565b9350613789565b60018d8d8381811061372657613726615755565b905060200201602081019061373b9190615ca6565b600181111561374c5761374c614d9e565b036137625761370b886136fc6020860186615cd2565b6000356001600160e01b031916604051630612418f60e11b8152600401610bc591906155f1565b836001600160a01b0316856001600160a01b0316106137c9576000356001600160e01b031916604051635d3dcd3160e01b8152600401610bc591906155f1565b83945060006137d7856110a9565b9050801561383857600192506138268f8f8f858181106137f9576137f9615755565b905060200201602081019061380e9190615ca6565b8a8a89613820368b90038b018b615ced565b87613d9e565b15613838575050505050505050611c8d565b50600101613687565b508061386e576000356001600160e01b03191660405163726b3acb60e01b8152600401610bc591906155f1565b50505050505050505050505050565b600081815260208190526040812054908190036138ac5750600090815260208190526040902060019081905590565b60008281526001602090815260408083208484529091528120906138cf826128c8565b905080613926576000825460ff1660048111156138ee576138ee614d9e565b0361390c5760405163757a436360e01b815260040160405180910390fd5b600084815260208190526040902080546001019081905592505b5050919050565b61393561499a565b82518152602080840151604080840191909152600091830191909152830151516001600160401b0381111561396c5761396c615023565b604051908082528060200260200182016040528015613995578160200160208202803683370190505b5060608083019190915283015160808083019190915283015160a08083019190915283015160c082015260005b8360400151518110156122ca578281815181106139e1576139e1615755565b6020026020010151826060015182815181106139ff576139ff615755565b6001600160a01b03909216602092830291909101909101526001016139c2565b6000826060015151118015613a3d5750816080015151826060015151145b8015613a5257508160a0015151826060015151145b8015613a6757508160c0015151826060015151145b613a92576000356001600160e01b0319166040516306b5667560e21b8152600401610bc591906155f1565b613a9c81426155a9565b82604001511115610bd85760405163ad89be9d60e01b815260040160405180910390fd5b60608101516040820151608083015151600092919083906001600160401b03811115613aee57613aee615023565b604051908082528060200260200182016040528015613b17578160200160208202803683370190505b5060a086015190915060005b8251811015613b765786608001518181518110613b4257613b42615755565b602002602001015180519060200120838281518110613b6357613b63615755565b6020908102919091010152600101613b23565b50604080517f1463f426c05aff2c1a7a0957a71c9898bc8b47142540538e79ee25ee911413508152875160208083019190915297880151918101919091528351870293870193909320606084015283518602938601939093206080830152805185029085012060a082015281518402919093012060c08301525060e0902090565b600081604051602401613c0a91906155f1565b60408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b1790525190915060009081906001600160a01b03861690613c53908590615c18565b600060405180830381855afa9150503d8060008114613c8e576040519150601f19603f3d011682016040523d82523d6000602084013e613c93565b606091505b509150915081613d5557846001600160a01b031683604051602401613cb89190615d4d565b60408051601f198184030181529181526020820180516001600160e01b03166325da93a560e11b17905251613ced9190615c18565b600060405180830381855afa9150503d8060008114613d28576040519150601f19603f3d011682016040523d82523d6000602084013e613d2d565b606091505b50909250905081613d5557838560405163069d427960e11b8152600401610bc5929190615d60565b80806020019051810190613d699190615d83565b6106c757838560405163069d427960e11b8152600401610bc5929190615d60565b60006108e2610b1b565b60006108e2610ed5565b60208088015188516000828152600184526040808220838352909452928320613dc6816128c8565b15613dd75760019350505050610776565b6020808c015160009081529081905260409020548214613e18576000356001600160e01b03191660405163d4cec26960e01b8152600401610bc591906155f1565b6000815460ff166004811115613e3057613e30614d9e565b14613e4e576040516322de95ff60e21b815260040160405180910390fd5b6001600160a01b038716600090815260088201602052604090205460ff1615613e955760405163025fd59560e41b81526001600160a01b0388166004820152602401610bc5565b6001600160a01b03871660009081526008820160209081526040909120805460ff19166001179055860151151580613ed05750604086015115155b80613ede5750855160ff1615155b15613f25576001600160a01b03871660009081526007820160209081526040918290208851815460ff191660ff909116178155908801516001820155908701516002909101555b866001600160a01b031681600101547f1203f9e81c814a35f5f4cc24087b2a24c6fb7986a9f1406b68a9484882c93a238c88604051613f65929190615da5565b60405180910390a3600080808c6001811115613f8357613f83614d9e565b03613fd8576004830180546001810182556000918252602082200180546001600160a01b0319166001600160a01b038c16179055600384018054899290613fcb9084906155a9565b925050819055915061403d565b60018c6001811115613fec57613fec614d9e565b03613762576005830180546001810182556000918252602082200180546001600160a01b0319166001600160a01b038c161790556002840180548992906140349084906155a9565b92505081905590505b8a821061409157825460ff19166001908117845580840154604051919750907f5c819725ea53655a3b898f3df59b66489761935454e9212ca1e5ebd759953d0b90600090a261408c838e6143f5565b6140d7565b8981106140d757825460ff19166003178355600180840154604051919750907f55295d4ce992922fa2e5ffbf3a3dcdb367de0a15e125ace083456017fd22060f90600090a25b5050505050979650505050505050565b80600360008460038111156140fe576140fe614d9e565b600381111561410f5761410f614d9e565b8152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600381111561414d5761414d614d9e565b6040517f356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d90600090a35050565b6001600160a01b038116611555576000356001600160e01b03191660405163104c66df60e31b8152600401610bc591906155f1565b600081815260018301602052604081205480156142985760006141d36001836155bc565b85549091506000906141e7906001906155bc565b905081811461424c57600086600001828154811061420757614207615755565b906000526020600020015490508087600001848154811061422a5761422a615755565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061425d5761425d615db3565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061099b565b600091505061099b565b60006142ac825490565b9050611167826113148360016155a9565b600061099b836114698585614462565b6142d561499a565b6142ee6142e784604001516001612177565b849061392d565b905061430560025482613a1f90919063ffffffff16565b6000614310826134a0565b9050600061431e600061387d565b6000818152600080516020615def83398151915260209081526040909120908701516001820185905560069091015590508251811461437e576000356001600160e01b03191660405163d4cec26960e01b8152600401610bc591906155f1565b81817f771d78ae9e5fca95a532fb0971d575d0ce9b59d14823c063e08740137e0e0eca856143ab89613ac0565b89896040516143bd949392919061599a565b60405180910390a3505092915050565b60008060006143de8787878761448b565b915091506143eb81614578565b5095945050505050565b6143fe8161472e565b15610bd857815460ff1916600217825560008061441a83614748565b9150915083600101547fe134987599ae266ec90edeff1b26125b287dbb57b10822649432d1bb26537fba8383604051614454929190615dc9565b60405180910390a250505050565b600082548281101561448157634e487b7160005260116020526024601cfd5b9190910392915050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156144c2575060009050600361456f565b8460ff16601b141580156144da57508460ff16601c14155b156144eb575060009050600461456f565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561453f573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166145685760006001925092505061456f565b9150600090505b94509492505050565b600081600481111561458c5761458c614d9e565b036145945750565b60018160048111156145a8576145a8614d9e565b036145f55760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610bc5565b600281600481111561460957614609614d9e565b036146565760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610bc5565b600381600481111561466a5761466a614d9e565b036146c25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610bc5565b60048160048111156146d6576146d6614d9e565b036115555760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610bc5565b600081602001516000148061099b57505060200151461490565b6060806147548361472e565b61478657602083015160405163092048d160e11b8152610bc5916001600160e01b031960003516914690600401615b9b565b8260600151516001600160401b038111156147a3576147a3615023565b6040519080825280602002602001820160405280156147cc578160200160208202803683370190505b5091508260600151516001600160401b038111156147ec576147ec615023565b60405190808252806020026020018201604052801561481f57816020015b606081526020019060019003908161480a5790505b50905060005b836060015151811015614994578360c00151818151811061484857614848615755565b60200260200101515a1161487b5761485f846134a0565b6040516307aec4ab60e21b8152600401610bc591815260200190565b8360600151818151811061489157614891615755565b60200260200101516001600160a01b0316846080015182815181106148b8576148b8615755565b60200260200101518560c0015183815181106148d6576148d6615755565b6020026020010151908660a0015184815181106148f5576148f5615755565b602002602001015160405161490a9190615c18565b600060405180830381858888f193505050503d8060008114614948576040519150601f19603f3d011682016040523d82523d6000602084013e61494d565b606091505b5084838151811061496057614960615755565b6020026020010184848151811061497957614979615755565b60209081029190910101919091529015159052600101614825565b50915091565b6040518060e00160405280600081526020016000815260200160008152602001606081526020016060815260200160608152602001606081525090565b508054600082559060005260206000209081019061155591905b80821115614a0557600081556001016149f1565b5090565b600060e082840312156124e057600080fd5b60008083601f840112614a2d57600080fd5b5081356001600160401b03811115614a4457600080fd5b6020830191508360208260051b8501011115610f2157600080fd5b60008083601f840112614a7157600080fd5b5081356001600160401b03811115614a8857600080fd5b602083019150836020606083028501011115610f2157600080fd5b600080600080600060608688031215614abb57600080fd5b85356001600160401b0380821115614ad257600080fd5b614ade89838a01614a09565b96506020880135915080821115614af457600080fd5b614b0089838a01614a1b565b90965094506040880135915080821115614b1957600080fd5b50614b2688828901614a5f565b969995985093965092949392505050565b60008060008060008060608789031215614b5057600080fd5b86356001600160401b0380821115614b6757600080fd5b614b738a838b01614a1b565b90985096506020890135915080821115614b8c57600080fd5b614b988a838b01614a1b565b90965094506040890135915080821115614bb157600080fd5b50614bbe89828a01614a1b565b979a9699509497509295939492505050565b600081518084526020808501945080840160005b83811015614c02578151151587529582019590820190600101614be4565b509495945050505050565b6020815260006109496020830184614bd0565b600080600080600080600080600060a08a8c031215614c3e57600080fd5b8935985060208a01356001600160401b0380821115614c5c57600080fd5b614c688d838e01614a1b565b909a50985060408c0135915080821115614c8157600080fd5b614c8d8d838e01614a1b565b909850965060608c0135915080821115614ca657600080fd5b614cb28d838e01614a1b565b909650945060808c0135915080821115614ccb57600080fd5b50614cd88c828d01614a1b565b915080935050809150509295985092959850929598565b60008060208385031215614d0257600080fd5b82356001600160401b03811115614d1857600080fd5b614d2485828601614a1b565b90969095509350505050565b600081518084526020808501945080840160005b83811015614c025781516001600160a01b031687529582019590820190600101614d44565b6020815260006109496020830184614d30565b60008060408385031215614d8f57600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60028110614dc457614dc4614d9e565b9052565b60006060808352614ddb81840187614d30565b83810360208581019190915286518083528782019282019060005b81811015614e1957614e09838651614db4565b9383019391830191600101614df6565b505060409250858103838701528087518083528383019150838901925060005b81811015614e69578351805160ff1684528581015186850152860151868401529284019291860191600101614e39565b50909a9950505050505050505050565b80356001600160a01b038116811461116757600080fd5b600080600060608486031215614ea557600080fd5b8335925060208401359150614ebc60408501614e79565b90509250925092565b600080600080600060608688031215614edd57600080fd5b85356001600160401b0380821115614ef457600080fd5b9087019060c0828a031215614f0857600080fd5b90955060208701359080821115614af457600080fd5b600060208284031215614f3057600080fd5b5035919050565b80356002811061116757600080fd5b60008060008060008060008060008060c08b8d031215614f6557600080fd5b8a35995060208b01356001600160401b0380821115614f8357600080fd5b614f8f8e838f01614a1b565b909b50995060408d0135915080821115614fa857600080fd5b614fb48e838f01614a1b565b909950975060608d0135915080821115614fcd57600080fd5b614fd98e838f01614a1b565b909750955060808d0135915080821115614ff257600080fd5b50614fff8d828e01614a1b565b9094509250615012905060a08c01614f37565b90509295989b9194979a5092959850565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b038111828210171561505b5761505b615023565b60405290565b60405160c081016001600160401b038111828210171561505b5761505b615023565b604051601f8201601f191681016001600160401b03811182821017156150ab576150ab615023565b604052919050565b60006001600160401b038211156150cc576150cc615023565b5060051b60200190565b600082601f8301126150e757600080fd5b813560206150fc6150f7836150b3565b615083565b82815260059290921b8401810191818101908684111561511b57600080fd5b8286015b84811015615144578035600481106151375760008081fd5b835291830191830161511f565b509695505050505050565b600082601f83011261516057600080fd5b813560206151706150f7836150b3565b82815260059290921b8401810191818101908684111561518f57600080fd5b8286015b84811015615144576151a481614e79565b8352918301918301615193565b600080604083850312156151c457600080fd5b82356001600160401b03808211156151db57600080fd5b6151e7868387016150d6565b935060208501359150808211156151fd57600080fd5b5061520a8582860161514f565b9150509250929050565b6000806040838503121561522757600080fd5b8235915061523760208401614e79565b90509250929050565b8035600e811061116757600080fd5b6000806040838503121561526257600080fd5b61526b83615240565b915061523760208401614e79565b60006020828403121561528b57600080fd5b61094982614e79565b60008060008060008060008060008060c08b8d0312156152b357600080fd5b8a35995060208b0135985060408b01356001600160401b03808211156152d857600080fd5b6152e48e838f01614a1b565b909a50985060608d01359150808211156152fd57600080fd5b6153098e838f01614a1b565b909850965060808d013591508082111561532257600080fd5b61532e8e838f01614a1b565b909650945060a08d013591508082111561534757600080fd5b506153548d828e01614a1b565b915080935050809150509295989b9194979a5092959850565b6000806040838503121561538057600080fd5b82356001600160401b0381111561539657600080fd5b6153a285828601614a09565b92505061523760208401614f37565b60a08101600587106153c5576153c5614d9e565b95815260208101949094526040840192909252606083015260809091015290565b6000602082840312156153f857600080fd5b81356001600160401b0381111561540e57600080fd5b6108938482850161514f565b600081518084526020808501945080840160005b83811015614c025781518752958201959082019060010161542e565b60608152600061545d6060830186614d30565b828103602084015261546f8186614d30565b90508281036040840152615483818561541a565b9695505050505050565b602081526000610949602083018461541a565b6000602082840312156154b257600080fd5b61094982615240565b60006154c96150f7846150b3565b8381529050602080820190600585901b8401868111156154e857600080fd5b845b8181101561557b5780356001600160401b038082111561550a5760008081fd5b8188019150601f8a818401126155205760008081fd5b82358281111561553257615532615023565b615543818301601f19168801615083565b92508083528b8782860101111561555c57600091508182fd5b80878501888501376000908301870152508552509282019282016154ea565b505050509392505050565b60006109493684846154bb565b634e487b7160e01b600052601160045260246000fd5b8082018082111561099b5761099b615593565b8181038181111561099b5761099b615593565b6000826155ec57634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031991909116815260200190565b600082601f83011261561757600080fd5b813560206156276150f7836150b3565b82815260059290921b8401810191818101908684111561564657600080fd5b8286015b84811015615144578035835291830191830161564a565b600082601f83011261567257600080fd5b610949838335602085016154bb565b600060e0823603121561569357600080fd5b61569b615039565b82358152602083013560208201526040830135604082015260608301356001600160401b03808211156156cd57600080fd5b6156d93683870161514f565b606084015260808501359150808211156156f257600080fd5b6156fe36838701615606565b608084015260a085013591508082111561571757600080fd5b61572336838701615661565b60a084015260c085013591508082111561573c57600080fd5b5061574936828601615606565b60c08301525092915050565b634e487b7160e01b600052603260045260246000fd5b808202811582820484141761099b5761099b615593565b60208101600e831061579657615796614d9e565b91905290565b6001600160e01b03198316815260408101600983106157bd576157bd614d9e565b8260208301529392505050565b6040815260006157dd6040830185614d30565b82810360208401526157ef8185614bd0565b95945050505050565b60808152600061580b6080830187614bd0565b82810360208481019190915286518083528782019282019060005b8181101561584b5784516001600160601b031683529383019391830191600101615826565b5050848103604086015261585f8188614d30565b9250505082810360608401526107768185614d30565b60005b83811015615890578181015183820152602001615878565b50506000910152565b600081518084526158b1816020860160208601615875565b601f01601f19169290920160200192915050565b600081518084526020808501808196508360051b8101915082860160005b8581101561590d5782840389526158fb848351615899565b988501989350908401906001016158e3565b5091979650505050505050565b8051825260208101516020830152604081015160408301526000606082015160e0606085015261594d60e0850182614d30565b905060808301518482036080860152615966828261541a565b91505060a083015184820360a086015261598082826158c5565b91505060c083015184820360c08601526157ef828261541a565b6080815260006159ad608083018761591a565b60208681850152838203604085015260c08201865183528187015182840152604087015160c0604085015281815180845260e0860191508483019350600092505b80831015615a1e57835160048110615a0857615a08614d9e565b82529284019260019290920191908401906159ee565b50606089015193508481036060860152615a38818561541a565b935050505060808601518282036080840152615a5482826158c5565b91505060a086015182820360a0840152615a6e828261541a565b93505050506157ef60608301846001600160a01b03169052565b6000808335601e19843603018112615a9f57600080fd5b8301803591506001600160401b03821115615ab957600080fd5b6020019150600581901b3603821315610f2157600080fd5b600060c08236031215615ae357600080fd5b615aeb615061565b823581526020830135602082015260408301356001600160401b0380821115615b1357600080fd5b615b1f368387016150d6565b60408401526060850135915080821115615b3857600080fd5b615b4436838701615606565b60608401526080850135915080821115615b5d57600080fd5b615b6936838701615661565b608084015260a0850135915080821115615b8257600080fd5b50615b8f36828601615606565b60a08301525092915050565b6001600160e01b03199390931683526020830191909152604082015260600190565b604081526000615bd0604083018561591a565b905060018060a01b03831660208301529392505050565b6001600160e01b0319831681528151600090615c0a816004850160208701615875565b919091016004019392505050565b60008251615c2a818460208701615875565b9190910192915050565b608081526000615c476080830187615899565b8281036020840152615c598187614d30565b90508281036040840152615c6d8186614bd0565b9050828103606084015261077681856158c5565b604081526000615c946040830185614bd0565b82810360208401526157ef8185614d30565b600060208284031215615cb857600080fd5b61094982614f37565b803560ff8116811461116757600080fd5b600060208284031215615ce457600080fd5b61094982615cc1565b600060608284031215615cff57600080fd5b604051606081018181106001600160401b0382111715615d2157615d21615023565b604052615d2d83615cc1565b815260208301356020820152604083013560408201528091505092915050565b6020815260006109496020830184615899565b6001600160e01b03199290921682526001600160a01b0316602082015260400190565b600060208284031215615d9557600080fd5b8151801515811461094957600080fd5b604081016157bd8285614db4565b634e487b7160e01b600052603160045260246000fd5b604081526000615ddc6040830185614bd0565b82810360208401526157ef81856158c556fea6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb495da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd976240ac1ff16a4f04f2a37a9ba5252a69baa100b460e517d1f8019c054a5ad698f9ffc55405a488814eaa0e2a685a0131142785b8d033d311c8c8244e34a7c12ca40f88547008e60f5748911f2e59feb3093b7e4c2e87b2dd69d61f112fcc932de8e38400683eb2cb350596d73644c0c89fe45f108600003457374f4ab3e87b4f3aa3d38c234075fde25875da8a6b7e36b58b86681d483271a99eeeee1d78e258a24d6924fe71b0c8b61aea02ca498b5f53b29bd95726278b1fe4eb791bb24a42644ca164736f6c6343000811000a", + "address": "0x8AaAD4782890eb879A0fC132A6AdF9E5eE708faF", + "args": "0x7d4c1d780000000000000000000000000000000000000000000000000000000000000007000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000007e50000000000000000000000000000000000000000000000000000000000127500000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca00000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000003600000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000002e82d2b56f858f79deef11b160bfc4631873da2b000000000000000000000000bcb61783dd2403fe8cc9b89b27b1a9bb03d040cb000000000000000000000000b266bf53cf7eac4e2065a404598dcb0e15e9462c000000000000000000000000cc5fc5b6c8595f56306da736f6cd02ed9141c84a0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000d24d87ddc1917165435b306aac68d99e0f49a3fa000000000000000000000000b033ba62ec622dc54d0abfe0254e79692147ca26000000000000000000000000087d08e3ba42e64e3948962dd1371f906d1278b900000000000000000000000052ec2e6bbce45afff8955da6410bb13812f4289f000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000005000000000000000000000000cee681c9108c42c710c6a8a949307d5f13c9f3ca0000000000000000000000006e19cf519b7b83f7ce719b6d30232485d9609d950000000000000000000000007fc81d20f7d1f53d0ea094fcbdd1b531b71225eb000000000000000000000000880c5da7bff9740464287ebfe381be1cccce4fea0000000000000000000000001ad54d61f47acbcba99fb6540a1694eb2f47ab95", + "ast": "", + "blockNumber": 26511796, + "bytecode": "0x608060405260405162000eed38038062000eed833981016040819052620000269162000429565b8282828281620000398282600062000053565b506200004790508262000085565b5050505050506200055c565b6200005e83620000f7565b6000825111806200006c5750805b1562000080576200007e838362000139565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f620000c760008051602062000ea6833981519152546001600160a01b031690565b604080516001600160a01b03928316815291841660208301520160405180910390a1620000f48162000168565b50565b620001028162000206565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606062000161838360405180606001604052806027815260200162000ec6602791396200029d565b9392505050565b6001600160a01b038116620001d35760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b8060008051602062000ea68339815191525b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002118162000383565b620002755760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620001ca565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc620001e5565b6060620002aa8462000383565b620003075760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401620001ca565b600080856001600160a01b03168560405162000324919062000509565b600060405180830381855af49150503d806000811462000361576040519150601f19603f3d011682016040523d82523d6000602084013e62000366565b606091505b5090925090506200037982828662000392565b9695505050505050565b6001600160a01b03163b151590565b60608315620003a357508162000161565b825115620003b45782518084602001fd5b8160405162461bcd60e51b8152600401620001ca919062000527565b80516001600160a01b0381168114620003e857600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200042057818101518382015260200162000406565b50506000910152565b6000806000606084860312156200043f57600080fd5b6200044a84620003d0565b92506200045a60208501620003d0565b60408501519092506001600160401b03808211156200047857600080fd5b818601915086601f8301126200048d57600080fd5b815181811115620004a257620004a2620003ed565b604051601f8201601f19908116603f01168101908382118183101715620004cd57620004cd620003ed565b81604052828152896020848701011115620004e757600080fd5b620004fa83602083016020880162000403565b80955050505050509250925092565b600082516200051d81846020870162000403565b9190910192915050565b60208152600082518060208401526200054881604085016020870162000403565b601f01601f19169190910160400192915050565b61093a806200056c6000396000f3fe6080604052600436106100595760003560e01c80633659cfe6146100705780634bb5274a146100905780634f1ef286146100a35780635c60da1b146100b65780638f283970146100e7578063f851a4401461010757610068565b366100685761006661011c565b005b61006661011c565b34801561007c57600080fd5b5061006661008b3660046106c7565b610136565b61006661009e3660046106f8565b610173565b6100666100b13660046107a8565b6101b8565b3480156100c257600080fd5b506100cb61021f565b6040516001600160a01b03909116815260200160405180910390f35b3480156100f357600080fd5b506100666101023660046106c7565b610250565b34801561011357600080fd5b506100cb610270565b610124610291565b61013461012f610326565b610330565b565b61013e61034f565b6001600160a01b0316330361016b5761016881604051806020016040528060008152506000610370565b50565b61016861011c565b61017b61034f565b6001600160a01b0316330361016b576000610194610326565b9050600080835160208501845af43d6000803e8080156101b3573d6000f35b3d6000fd5b6101c061034f565b6001600160a01b03163303610217576102128383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525060019250610370915050565b505050565b61021261011c565b600061022961034f565b6001600160a01b0316330361024557610240610326565b905090565b61024d61011c565b90565b61025861034f565b6001600160a01b0316330361016b576101688161039b565b600061027a61034f565b6001600160a01b031633036102455761024061034f565b61029961034f565b6001600160a01b031633036101345760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006102406103ef565b3660008037600080366000845af43d6000803e8080156101b3573d6000f35b600060008051602061089e8339815191525b546001600160a01b0316919050565b61037983610405565b6000825111806103865750805b15610212576103958383610445565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103c461034f565b604080516001600160a01b03928316815291841660208301520160405180910390a161016881610471565b60006000805160206108be833981519152610361565b61040e81610508565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061046a83836040518060600160405280602781526020016108de60279139610588565b9392505050565b6001600160a01b0381166104d65760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b606482015260840161031d565b8060008051602061089e8339815191525b80546001600160a01b0319166001600160a01b039290921691909117905550565b61051181610663565b6105735760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161031d565b806000805160206108be8339815191526104e7565b606061059384610663565b6105ee5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161031d565b600080856001600160a01b031685604051610609919061084e565b600060405180830381855af49150503d8060008114610644576040519150601f19603f3d011682016040523d82523d6000602084013e610649565b606091505b5091509150610659828286610672565b9695505050505050565b6001600160a01b03163b151590565b6060831561068157508161046a565b8251156106915782518084602001fd5b8160405162461bcd60e51b815260040161031d919061086a565b80356001600160a01b03811681146106c257600080fd5b919050565b6000602082840312156106d957600080fd5b61046a826106ab565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561070a57600080fd5b81356001600160401b038082111561072157600080fd5b818401915084601f83011261073557600080fd5b813581811115610747576107476106e2565b604051601f8201601f19908116603f0116810190838211818310171561076f5761076f6106e2565b8160405282815287602084870101111561078857600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000806000604084860312156107bd57600080fd5b6107c6846106ab565b925060208401356001600160401b03808211156107e257600080fd5b818601915086601f8301126107f657600080fd5b81358181111561080557600080fd5b87602082850101111561081757600080fd5b6020830194508093505050509250925092565b60005b8381101561084557818101518382015260200161082d565b50506000910152565b6000825161086081846020870161082a565b9190910192915050565b602081526000825180602084015261088981604085016020870161082a565b601f01601f1916919091016040019291505056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212205d5db908d6bad5bfc298cb89bc49c38963bb1499be9336506651cff965fb333264736f6c63430008170033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "chainId": 2021, + "contractAbsolutePath": "TransparentUpgradeableProxyV2.sol:TransparentUpgradeableProxyV2", + "deployedBytecode": "0x6080604052600436106100595760003560e01c80633659cfe6146100705780634bb5274a146100905780634f1ef286146100a35780635c60da1b146100b65780638f283970146100e7578063f851a4401461010757610068565b366100685761006661011c565b005b61006661011c565b34801561007c57600080fd5b5061006661008b3660046106c7565b610136565b61006661009e3660046106f8565b610173565b6100666100b13660046107a8565b6101b8565b3480156100c257600080fd5b506100cb61021f565b6040516001600160a01b03909116815260200160405180910390f35b3480156100f357600080fd5b506100666101023660046106c7565b610250565b34801561011357600080fd5b506100cb610270565b610124610291565b61013461012f610326565b610330565b565b61013e61034f565b6001600160a01b0316330361016b5761016881604051806020016040528060008152506000610370565b50565b61016861011c565b61017b61034f565b6001600160a01b0316330361016b576000610194610326565b9050600080835160208501845af43d6000803e8080156101b3573d6000f35b3d6000fd5b6101c061034f565b6001600160a01b03163303610217576102128383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525060019250610370915050565b505050565b61021261011c565b600061022961034f565b6001600160a01b0316330361024557610240610326565b905090565b61024d61011c565b90565b61025861034f565b6001600160a01b0316330361016b576101688161039b565b600061027a61034f565b6001600160a01b031633036102455761024061034f565b61029961034f565b6001600160a01b031633036101345760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006102406103ef565b3660008037600080366000845af43d6000803e8080156101b3573d6000f35b600060008051602061089e8339815191525b546001600160a01b0316919050565b61037983610405565b6000825111806103865750805b15610212576103958383610445565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103c461034f565b604080516001600160a01b03928316815291841660208301520160405180910390a161016881610471565b60006000805160206108be833981519152610361565b61040e81610508565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061046a83836040518060600160405280602781526020016108de60279139610588565b9392505050565b6001600160a01b0381166104d65760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b606482015260840161031d565b8060008051602061089e8339815191525b80546001600160a01b0319166001600160a01b039290921691909117905550565b61051181610663565b6105735760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161031d565b806000805160206108be8339815191526104e7565b606061059384610663565b6105ee5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161031d565b600080856001600160a01b031685604051610609919061084e565b600060405180830381855af49150503d8060008114610644576040519150601f19603f3d011682016040523d82523d6000602084013e610649565b606091505b5091509150610659828286610672565b9695505050505050565b6001600160a01b03163b151590565b6060831561068157508161046a565b8251156106915782518084602001fd5b8160405162461bcd60e51b815260040161031d919061086a565b80356001600160a01b03811681146106c257600080fd5b919050565b6000602082840312156106d957600080fd5b61046a826106ab565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561070a57600080fd5b81356001600160401b038082111561072157600080fd5b818401915084601f83011261073557600080fd5b813581811115610747576107476106e2565b604051601f8201601f19908116603f0116810190838211818310171561076f5761076f6106e2565b8160405282815287602084870101111561078857600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000806000604084860312156107bd57600080fd5b6107c6846106ab565b925060208401356001600160401b03808211156107e257600080fd5b818601915086601f8301126107f657600080fd5b81358181111561080557600080fd5b87602082850101111561081757600080fd5b6020830194508093505050509250925092565b60005b8381101561084557818101518382015260200161082d565b50506000910152565b6000825161086081846020870161082a565b9190910192915050565b602081526000825180602084015261088981604085016020870161082a565b601f01601f1916919091016040019291505056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212205d5db908d6bad5bfc298cb89bc49c38963bb1499be9336506651cff965fb333264736f6c63430008170033", + "deployer": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", "devdoc": { - "errors": { - "ErrAddressIsNotCreatedEOA(address,bytes32)": [ - { - "details": "Error thrown when an address is expected to be an already created externally owned account (EOA). This error indicates that the provided address is invalid for certain contract operations that require already created EOA." - } - ], - "ErrAlreadyVoted(address)": [ - { - "details": "Error indicating that a voter has already voted.", - "params": { - "voter": "The address of the voter who has already voted." - } - } - ], - "ErrBridgeOperatorAlreadyExisted(address)": [ - { - "details": "Error thrown when attempting to add a bridge operator that already exists in the contract. This error indicates that the provided bridge operator address is already registered as a bridge operator in the contract." - } - ], - "ErrBridgeOperatorUpdateFailed(address)": [ - { - "details": "Error raised when a bridge operator update operation fails.", - "params": { - "bridgeOperator": "The address of the bridge operator that failed to update." - } - } - ], - "ErrContractTypeNotFound(uint8)": [ - { - "details": "Error of invalid role." - } - ], - "ErrCurrentProposalIsNotCompleted()": [ - { - "details": "Error thrown when the current proposal is not completed." - } - ], - "ErrDuplicated(bytes4)": [ - { - "details": "Error thrown when a duplicated element is detected in an array.", - "params": { - "msgSig": "The function signature that invoke the error." - } - } - ], - "ErrInsufficientGas(bytes32)": [ - { - "details": "Error thrown when there is insufficient gas to execute a function." - } - ], - "ErrInvalidArguments(bytes4)": [ - { - "details": "Error indicating that arguments are invalid." - } - ], - "ErrInvalidChainId(bytes4,uint256,uint256)": [ - { - "details": "Error indicating that the chain ID is invalid.", - "params": { - "actual": "Current chain ID that executing function.", - "expected": "Expected chain ID required for the tx to success.", - "msgSig": "The function signature (bytes4) of the operation that encountered an invalid chain ID." - } - } - ], - "ErrInvalidExpiryTimestamp()": [ - { - "details": "Error thrown when an invalid expiry timestamp is provided." - } - ], - "ErrInvalidOrder(bytes4)": [ - { - "details": "Error indicating that an order is invalid.", - "params": { - "msgSig": "The function signature (bytes4) of the operation that encountered an invalid order." - } - } - ], - "ErrInvalidProposal(bytes32,bytes32)": [ - { - "details": "Error thrown when an invalid proposal is encountered.", - "params": { - "actual": "The actual value of the proposal.", - "expected": "The expected value of the proposal." - } - } - ], - "ErrInvalidProposalNonce(bytes4)": [ - { - "details": "Error indicating that the proposal nonce is invalid.", - "params": { - "msgSig": "The function signature (bytes4) of the operation that encountered an invalid proposal nonce." - } - } - ], - "ErrInvalidSignatures(bytes4)": [ - { - "details": "Error indicating that a signature is invalid for a specific function signature.", - "params": { - "msgSig": "The function signature (bytes4) that encountered an invalid signature." - } - } - ], - "ErrInvalidThreshold(bytes4)": [ - { - "details": "Error indicating that the provided threshold is invalid for a specific function signature.", - "params": { - "msgSig": "The function signature (bytes4) that the invalid threshold applies to." - } - } - ], - "ErrInvalidVoteWeight(bytes4)": [ - { - "details": "Error indicating that a vote weight is invalid for a specific function signature.", - "params": { - "msgSig": "The function signature (bytes4) that encountered an invalid vote weight." - } - } - ], - "ErrLengthMismatch(bytes4)": [ - { - "details": "Error indicating a mismatch in the length of input parameters or arrays for a specific function.", - "params": { - "msgSig": "The function signature (bytes4) that has a length mismatch." - } - } - ], - "ErrOnlySelfCall(bytes4)": [ - { - "details": "Error indicating that a function can only be called by the contract itself.", - "params": { - "msgSig": "The function signature (bytes4) that can only be called by the contract itself." - } - } - ], - "ErrQueryForEmptyVote()": [ - { - "details": "Error thrown when querying for an empty vote." - } - ], - "ErrUnauthorized(bytes4,uint8)": [ - { - "details": "Error indicating that the caller is unauthorized to perform a specific function.", - "params": { - "expectedRole": "The role required to perform the function.", - "msgSig": "The function signature (bytes4) that the caller is unauthorized to perform." - } - } - ], - "ErrUnsupportedInterface(bytes4,address)": [ - { - "details": "The error indicating an unsupported interface.", - "params": { - "addr": "The address where the unsupported interface was encountered.", - "interfaceId": "The bytes4 interface identifier that is not supported." - } - } - ], - "ErrUnsupportedVoteType(bytes4)": [ - { - "details": "Error indicating that a vote type is not supported.", - "params": { - "msgSig": "The function signature (bytes4) of the operation that encountered an unsupported vote type." - } - } - ], - "ErrVoteIsFinalized()": [ - { - "details": "Error thrown when attempting to interact with a finalized vote." - } - ], - "ErrZeroAddress(bytes4)": [ - { - "details": "Error indicating that given address is null when it should not." - } - ], - "ErrZeroCodeContract(address)": [ - { - "details": "Error of set to non-contract." - } - ] - }, + "version": 1, "kind": "dev", "methods": { - "addBridgeOperators(uint96[],address[],address[])": { - "details": "Adds multiple bridge operators.", - "params": { - "bridgeOperators": "An array of addresses representing the bridge operators to add.", - "governors": "An array of addresses of hot/cold wallets for bridge operator to update their node address." - }, - "returns": { - "addeds": "An array of booleans indicating whether each bridge operator was added successfully. Note: return boolean array `addeds` indicates whether a group (voteWeight, governor, operator) are recorded. It is expected that FE/BE staticcall to the function first to get the return values and handle it correctly. Governors are expected to see the outcome of this function and decide if they want to vote for the proposal or not. Example Usage: Making an `eth_call` in ethers.js ``` const {addeds} = await bridgeManagerContract.callStatic.addBridgeOperators( voteWeights, governors, bridgeOperators, // overriding the caller to the contract itself since we use `onlySelfCall` guard {from: bridgeManagerContract.address} ) const filteredOperators = bridgeOperators.filter((_, index) => addeds[index]); const filteredWeights = weights.filter((_, index) => addeds[index]); const filteredGovernors = governors.filter((_, index) => addeds[index]); // ... (Process or use the information as required) ... ```" - } - }, - "castGlobalProposalBySignatures((uint256,uint256,uint8[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])": { - "details": "See `GovernanceProposal-_castGlobalProposalBySignatures`." - }, - "castProposalBySignatures((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])": { - "details": "See `GovernanceProposal-_castProposalBySignatures`." - }, - "castProposalVoteForCurrentNetwork((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8)": { - "details": "Casts vote for a proposal on the current network. Requirements: - The method caller is governor." - }, - "checkThreshold(uint256)": { - "details": "Checks whether the `_voteWeight` passes the threshold." - }, - "deleteExpired(uint256,uint256)": { - "details": "Deletes the expired proposal by its chainId and nonce, without creating a new proposal. Requirements: - The proposal is already created." - }, - "getBridgeOperatorOf(address[])": { - "details": "Returns an array of bridge operators correspoding to governor addresses.", - "returns": { - "bridgeOperators": "An array containing the addresses of all bridge operators." - } - }, - "getBridgeOperatorWeight(address)": { - "details": "External function to retrieve the vote weight of a specific bridge operator.", - "params": { - "bridgeOperator": "The address of the bridge operator to get the vote weight for." - }, - "returns": { - "weight": "The vote weight of the specified bridge operator." - } - }, - "getBridgeOperators()": { - "details": "Returns an array of all bridge operators.", - "returns": { - "_0": "An array containing the addresses of all bridge operators." - } - }, - "getCallbackRegisters()": { - "details": "Retrieves the addresses of registered callbacks.", - "returns": { - "registers": "An array containing the addresses of registered callbacks." - } - }, - "getContract(uint8)": { - "details": "Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.", - "params": { - "contractType": "The role of the contract to retrieve." - }, - "returns": { - "contract_": "The address of the contract with the specified role." - } - }, - "getFullBridgeOperatorInfos()": { - "details": "Retrieves the full information of all registered bridge operators. This external function allows external callers to obtain the full information of all the registered bridge operators. The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.", - "returns": { - "bridgeOperators": "An array of addresses representing the registered bridge operators.", - "governors": "An array of addresses representing the governors of each bridge operator.", - "weights": "An array of uint256 values representing the vote weights of each bridge operator. Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator. Example Usage: ``` (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos(); for (uint256 i = 0; i < bridgeOperators.length; i++) { // Access individual information for each bridge operator. address governor = governors[i]; address bridgeOperator = bridgeOperators[i]; uint256 weight = weights[i]; // ... (Process or use the information as required) ... } ```" - } - }, - "getGlobalProposalSignatures(uint256)": { - "details": "See {CommonGovernanceProposal-_getProposalSignatures}" - }, - "getGovernorWeight(address)": { - "details": "External function to retrieve the vote weight of a specific governor.", - "params": { - "governor": "The address of the governor to get the vote weight for." - }, - "returns": { - "weight": "voteWeight The vote weight of the specified governor." - } + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" }, - "getGovernorWeights(address[])": { - "details": "Returns the weights of a list of governor addresses." + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." }, - "getGovernors()": { - "details": "Returns an array of all governors.", - "returns": { - "_0": "An array containing the addresses of all governors." - } - }, - "getGovernorsOf(address[])": { - "details": "Retrieves the governors corresponding to a given array of bridge operators. This external function allows external callers to obtain the governors associated with a given array of bridge operators. The function takes an input array `bridgeOperators` containing bridge operator addresses and returns an array of corresponding governors.", - "params": { - "bridgeOperators": "An array of bridge operator addresses for which governors are to be retrieved." - }, - "returns": { - "governors": "An array of addresses representing the governors corresponding to the provided bridge operators." - } - }, - "getProposalExpiryDuration()": { - "details": "Returns the expiry duration for a new proposal." - }, - "getProposalSignatures(uint256,uint256)": { - "details": "See {CommonGovernanceProposal-_getProposalSignatures}" - }, - "getThreshold()": { - "details": "Returns the threshold." - }, - "getTotalWeights()": { - "details": "Returns total weights." - }, - "globalProposalVoted(uint256,address)": { - "details": "See {CommonGovernanceProposal-_proposalVoted}" - }, - "isBridgeOperator(address)": { - "details": "Checks if the given address is a bridge operator.", - "params": { - "addr": "The address to check." - }, - "returns": { - "_0": "A boolean indicating whether the address is a bridge operator." - } - }, - "minimumVoteWeight()": { - "details": "Returns the minimum vote weight to pass the threshold." - }, - "proposalVoted(uint256,uint256,address)": { - "details": "See {CommonGovernanceProposal-_proposalVoted}" - }, - "propose(uint256,uint256,address[],uint256[],bytes[],uint256[])": { - "details": "See `CoreGovernance-_proposeProposal`. Requirements: - The method caller is governor." - }, - "proposeGlobal(uint256,uint8[],uint256[],bytes[],uint256[])": { - "details": "See `CoreGovernance-_proposeGlobal`. Requirements: - The method caller is governor." - }, - "proposeGlobalProposalStructAndCastVotes((uint256,uint256,uint8[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])": { - "details": "See `GovernanceProposal-_proposeGlobalProposalStructAndCastVotes`. Requirements: - The method caller is governor." - }, - "proposeProposalForCurrentNetwork(uint256,address[],uint256[],bytes[],uint256[],uint8)": { - "details": "Proposes and casts vote for a proposal on the current network. Requirements: - The method caller is governor. - The proposal is for the current network." - }, - "proposeProposalStructAndCastVotes((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])": { - "details": "See `GovernanceProposal-_proposeProposalStructAndCastVotes`. Requirements: - The method caller is governor. - The proposal is for the current network." - }, - "registerCallbacks(address[])": { - "details": "Registers multiple callbacks with the bridge.", - "params": { - "registers": "The array of callback addresses to register." - }, - "returns": { - "registereds": "An array indicating the success status of each registration." - } - }, - "removeBridgeOperators(address[])": { - "details": "Removes multiple bridge operators.", - "params": { - "bridgeOperators": "An array of addresses representing the bridge operators to remove." - }, - "returns": { - "removeds": "An array of booleans indicating whether each bridge operator was removed successfully. * Note: return boolean array `removeds` indicates whether a group (voteWeight, governor, operator) are recorded. It is expected that FE/BE staticcall to the function first to get the return values and handle it correctly. Governors are expected to see the outcome of this function and decide if they want to vote for the proposal or not. Example Usage: Making an `eth_call` in ethers.js ``` const {removeds} = await bridgeManagerContract.callStatic.removeBridgeOperators( bridgeOperators, // overriding the caller to the contract itself since we use `onlySelfCall` guard {from: bridgeManagerContract.address} ) const filteredOperators = bridgeOperators.filter((_, index) => removeds[index]); // ... (Process or use the information as required) ... ```" - } - }, - "resolveTargets(uint8[])": { - "details": "Returns corresponding address of target options. Return address(0) on non-existent target." - }, - "setContract(uint8,address)": { - "details": "Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.", - "params": { - "addr": "The address of the contract to set.", - "contractType": "The role of the contract to set." - } - }, - "setThreshold(uint256,uint256)": { - "details": "Sets the threshold. Requirements: - The method caller is admin. Emits the `ThresholdUpdated` event." - }, - "sumGovernorsWeight(address[])": { - "details": "Returns total weights of the governor list." - }, - "totalBridgeOperators()": { - "details": "Returns the total number of bridge operators.", - "returns": { - "_0": "The total number of bridge operators." - } + "functionDelegateCall(bytes)": { + "details": "Calls a function from the current implementation as specified by `_data`, which should be an encoded function call. Requirements: - Only the admin can call this function. Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider reviewing the encoded data `_data` and the method which is called before using this." }, - "unregisterCallbacks(address[])": { - "details": "Unregisters multiple callbacks from the bridge.", - "params": { - "registers": "The array of callback addresses to unregister." - }, - "returns": { - "unregistereds": "An array indicating the success status of each unregistration." - } - }, - "updateBridgeOperator(address)": { - "details": "Governor updates their corresponding governor and/or operator address. Requirements: - The caller must the governor of the operator that is requested changes.", - "params": { - "bridgeOperator": "The address of the bridge operator to update." - } + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" }, - "updateManyTargetOption(uint8[],address[])": { - "details": "Updates list of `targetOptions` to `targets`. Requirement: - Only allow self-call through proposal. " - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "round(uint256)": { - "notice": "chain id = 0 for global proposal" + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." }, - "updateBridgeOperator(address)": { - "notice": "This method checks authorization by querying the corresponding operator of the msg.sender and then attempts to remove it from the `_bridgeOperatorSet` for gas optimization. In case we allow a governor can leave their operator address blank null `address(0)`, consider add authorization check." + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." } }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 8162, - "contract": "contracts/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", - "label": "round", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_uint256,t_uint256)" - }, - { - "astId": 8170, - "contract": "contracts/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", - "label": "vote", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_mapping(t_uint256,t_struct(ProposalVote)8100_storage))" - }, - { - "astId": 8172, - "contract": "contracts/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", - "label": "_proposalExpiryDuration", - "offset": 0, - "slot": "2", - "type": "t_uint256" - }, - { - "astId": 8909, - "contract": "contracts/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", - "label": "_targetOptionsMap", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_enum(TargetOption)15064,t_address)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_address)dyn_storage": { - "base": "t_address", - "encoding": "dynamic_array", - "label": "address[]", - "numberOfBytes": "32" + "events": { + "AdminChanged(address,address)": { + "details": "Emitted when the admin account has changed." }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" + "BeaconUpgraded(address)": { + "details": "Emitted when the beacon is upgraded." }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_enum(TargetOption)15064": { - "encoding": "inplace", - "label": "enum GlobalProposal.TargetOption", - "numberOfBytes": "1" - }, - "t_enum(VoteStatus)12751": { - "encoding": "inplace", - "label": "enum VoteStatusConsumer.VoteStatus", - "numberOfBytes": "1" - }, - "t_mapping(t_address,t_bool)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_mapping(t_address,t_struct(Signature)12742_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct SignatureConsumer.Signature)", - "numberOfBytes": "32", - "value": "t_struct(Signature)12742_storage" - }, - "t_mapping(t_enum(TargetOption)15064,t_address)": { - "encoding": "mapping", - "key": "t_enum(TargetOption)15064", - "label": "mapping(enum GlobalProposal.TargetOption => address)", - "numberOfBytes": "32", - "value": "t_address" - }, - "t_mapping(t_uint256,t_mapping(t_uint256,t_struct(ProposalVote)8100_storage))": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => mapping(uint256 => struct CoreGovernance.ProposalVote))", - "numberOfBytes": "32", - "value": "t_mapping(t_uint256,t_struct(ProposalVote)8100_storage)" - }, - "t_mapping(t_uint256,t_struct(ProposalVote)8100_storage)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => struct CoreGovernance.ProposalVote)", - "numberOfBytes": "32", - "value": "t_struct(ProposalVote)8100_storage" - }, - "t_mapping(t_uint256,t_uint256)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_struct(ProposalVote)8100_storage": { - "encoding": "inplace", - "label": "struct CoreGovernance.ProposalVote", - "members": [ - { - "astId": 8076, - "contract": "contracts/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", - "label": "status", - "offset": 0, - "slot": "0", - "type": "t_enum(VoteStatus)12751" - }, - { - "astId": 8078, - "contract": "contracts/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", - "label": "hash", - "offset": 0, - "slot": "1", - "type": "t_bytes32" - }, - { - "astId": 8080, - "contract": "contracts/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", - "label": "againstVoteWeight", - "offset": 0, - "slot": "2", - "type": "t_uint256" - }, - { - "astId": 8082, - "contract": "contracts/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", - "label": "forVoteWeight", - "offset": 0, - "slot": "3", - "type": "t_uint256" - }, - { - "astId": 8085, - "contract": "contracts/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", - "label": "forVoteds", - "offset": 0, - "slot": "4", - "type": "t_array(t_address)dyn_storage" - }, - { - "astId": 8088, - "contract": "contracts/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", - "label": "againstVoteds", - "offset": 0, - "slot": "5", - "type": "t_array(t_address)dyn_storage" - }, - { - "astId": 8090, - "contract": "contracts/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", - "label": "expiryTimestamp", - "offset": 0, - "slot": "6", - "type": "t_uint256" - }, - { - "astId": 8095, - "contract": "contracts/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", - "label": "sig", - "offset": 0, - "slot": "7", - "type": "t_mapping(t_address,t_struct(Signature)12742_storage)" - }, - { - "astId": 8099, - "contract": "contracts/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", - "label": "voted", - "offset": 0, - "slot": "8", - "type": "t_mapping(t_address,t_bool)" - } - ], - "numberOfBytes": "288" - }, - "t_struct(Signature)12742_storage": { - "encoding": "inplace", - "label": "struct SignatureConsumer.Signature", - "members": [ - { - "astId": 12737, - "contract": "contracts/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", - "label": "v", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 12739, - "contract": "contracts/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", - "label": "r", - "offset": 0, - "slot": "1", - "type": "t_bytes32" - }, - { - "astId": 12741, - "contract": "contracts/ronin/gateway/RoninBridgeManager.sol:RoninBridgeManager", - "label": "s", - "offset": 0, - "slot": "2", - "type": "t_bytes32" - } - ], - "numberOfBytes": "96" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" + "Upgraded(address)": { + "details": "Emitted when the implementation is upgraded." } } + }, + "isFoundry": true, + "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"functionDelegateCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"events\":{\"AdminChanged(address,address)\":{\"details\":\"Emitted when the admin account has changed.\"},\"BeaconUpgraded(address)\":{\"details\":\"Emitted when the beacon is upgraded.\"},\"Upgraded(address)\":{\"details\":\"Emitted when the implementation is upgraded.\"}},\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"functionDelegateCall(bytes)\":{\"details\":\"Calls a function from the current implementation as specified by `_data`, which should be an encoded function call. Requirements: - Only the admin can call this function. Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider reviewing the encoded data `_data` and the method which is called before using this.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/extensions/TransparentUpgradeableProxyV2.sol\":\"TransparentUpgradeableProxyV2\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[\":@fdk/=lib/foundry-deployment-kit/script/\",\":@openzeppelin/=lib/openzeppelin-contracts/\",\":@prb/math/=lib/prb-math/\",\":@prb/test/=lib/prb-test/src/\",\":@ronin/contracts/=src/\",\":@ronin/script/=script/\",\":@ronin/test/=test/\",\":contract-libs/=lib/foundry-deployment-kit/lib/contract-libs/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/foundry-deployment-kit/lib/forge-std/src/\",\":foundry-deployment-kit/=lib/foundry-deployment-kit/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/contracts/\",\":prb-math/=lib/prb-math/src/\",\":prb-test/=lib/prb-test/src/\",\":solady/=lib/solady/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0xa6a787e7a901af6511e19aa53e1a00352db215a011d2c7a438d0582dd5da76f9\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"src/extensions/TransparentUpgradeableProxyV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\\\";\\n\\ncontract TransparentUpgradeableProxyV2 is TransparentUpgradeableProxy {\\n constructor(address _logic, address admin_, bytes memory _data) payable TransparentUpgradeableProxy(_logic, admin_, _data) { }\\n\\n /**\\n * @dev Calls a function from the current implementation as specified by `_data`, which should be an encoded function call.\\n *\\n * Requirements:\\n * - Only the admin can call this function.\\n *\\n * Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid\\n * triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider\\n * reviewing the encoded data `_data` and the method which is called before using this.\\n *\\n */\\n function functionDelegateCall(bytes memory _data) public payable ifAdmin {\\n address _addr = _implementation();\\n assembly {\\n let _result := delegatecall(gas(), _addr, add(_data, 32), mload(_data), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n switch _result\\n case 0 { revert(0, returndatasize()) }\\n default { return(0, returndatasize()) }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x45fc7b71d09da99414b977a56e586b3604670d865e5f36f395d5c98bc4ba64af\",\"license\":\"MIT\"}},\"version\":1}", + "nonce": 192803, + "numDeployments": 1, + "storageLayout": { + "storage": [], + "types": {} + }, + "timestamp": 1713240519, + "userdoc": { + "version": 1, + "kind": "user" } } \ No newline at end of file From 0c61572069ad0b6b07aab4d8af82ae77e59da797 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 16 Apr 2024 15:16:56 +0700 Subject: [PATCH 177/180] chore: remove old bridge manager --- ...ager.json => RoninBridgeManagerProxy.json} | 0 .../sepolia/MainchainBridgeManager.json | 2161 ----------------- 2 files changed, 2161 deletions(-) rename deployments/ronin-testnet/{RoninBridgeManager.json => RoninBridgeManagerProxy.json} (100%) delete mode 100644 deployments/sepolia/MainchainBridgeManager.json diff --git a/deployments/ronin-testnet/RoninBridgeManager.json b/deployments/ronin-testnet/RoninBridgeManagerProxy.json similarity index 100% rename from deployments/ronin-testnet/RoninBridgeManager.json rename to deployments/ronin-testnet/RoninBridgeManagerProxy.json diff --git a/deployments/sepolia/MainchainBridgeManager.json b/deployments/sepolia/MainchainBridgeManager.json deleted file mode 100644 index 07911706..00000000 --- a/deployments/sepolia/MainchainBridgeManager.json +++ /dev/null @@ -1,2161 +0,0 @@ -{ - "abi": [ - { - "type": "constructor", - "inputs": [ - { - "name": "num", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "denom", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "roninChainId", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "bridgeContract", - "type": "address", - "internalType": "address" - }, - { - "name": "callbackRegisters", - "type": "address[]", - "internalType": "address[]" - }, - { - "name": "bridgeOperators", - "type": "address[]", - "internalType": "address[]" - }, - { - "name": "governors", - "type": "address[]", - "internalType": "address[]" - }, - { - "name": "voteWeights", - "type": "uint96[]", - "internalType": "uint96[]" - }, - { - "name": "targetOptions", - "type": "uint8[]", - "internalType": "enum GlobalProposal.TargetOption[]" - }, - { - "name": "targets", - "type": "address[]", - "internalType": "address[]" - } - ], - "stateMutability": "payable" - }, - { - "type": "function", - "name": "DOMAIN_SEPARATOR", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "addBridgeOperators", - "inputs": [ - { - "name": "voteWeights", - "type": "uint96[]", - "internalType": "uint96[]" - }, - { - "name": "governors", - "type": "address[]", - "internalType": "address[]" - }, - { - "name": "bridgeOperators", - "type": "address[]", - "internalType": "address[]" - } - ], - "outputs": [ - { - "name": "addeds", - "type": "bool[]", - "internalType": "bool[]" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "checkThreshold", - "inputs": [ - { - "name": "_voteWeight", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getBridgeOperatorOf", - "inputs": [ - { - "name": "governors", - "type": "address[]", - "internalType": "address[]" - } - ], - "outputs": [ - { - "name": "bridgeOperators", - "type": "address[]", - "internalType": "address[]" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getBridgeOperatorWeight", - "inputs": [ - { - "name": "bridgeOperator", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "weight", - "type": "uint96", - "internalType": "uint96" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getBridgeOperators", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address[]", - "internalType": "address[]" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getCallbackRegisters", - "inputs": [], - "outputs": [ - { - "name": "registers", - "type": "address[]", - "internalType": "address[]" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getContract", - "inputs": [ - { - "name": "contractType", - "type": "uint8", - "internalType": "enum ContractType" - } - ], - "outputs": [ - { - "name": "contract_", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getFullBridgeOperatorInfos", - "inputs": [], - "outputs": [ - { - "name": "governors", - "type": "address[]", - "internalType": "address[]" - }, - { - "name": "bridgeOperators", - "type": "address[]", - "internalType": "address[]" - }, - { - "name": "weights", - "type": "uint96[]", - "internalType": "uint96[]" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getGovernorWeight", - "inputs": [ - { - "name": "governor", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "weight", - "type": "uint96", - "internalType": "uint96" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getGovernorWeights", - "inputs": [ - { - "name": "governors", - "type": "address[]", - "internalType": "address[]" - } - ], - "outputs": [ - { - "name": "weights", - "type": "uint96[]", - "internalType": "uint96[]" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getGovernors", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address[]", - "internalType": "address[]" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getGovernorsOf", - "inputs": [ - { - "name": "bridgeOperators", - "type": "address[]", - "internalType": "address[]" - } - ], - "outputs": [ - { - "name": "governors", - "type": "address[]", - "internalType": "address[]" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getProposalExpiryDuration", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getThreshold", - "inputs": [], - "outputs": [ - { - "name": "num_", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "denom_", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getTotalWeight", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "globalProposalRelayed", - "inputs": [ - { - "name": "_round", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "isBridgeOperator", - "inputs": [ - { - "name": "addr", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "minimumVoteWeight", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "registerCallbacks", - "inputs": [ - { - "name": "registers", - "type": "address[]", - "internalType": "address[]" - } - ], - "outputs": [ - { - "name": "registereds", - "type": "bool[]", - "internalType": "bool[]" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "relayGlobalProposal", - "inputs": [ - { - "name": "globalProposal", - "type": "tuple", - "internalType": "struct GlobalProposal.GlobalProposalDetail", - "components": [ - { - "name": "nonce", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "expiryTimestamp", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "targetOptions", - "type": "uint8[]", - "internalType": "enum GlobalProposal.TargetOption[]" - }, - { - "name": "values", - "type": "uint256[]", - "internalType": "uint256[]" - }, - { - "name": "calldatas", - "type": "bytes[]", - "internalType": "bytes[]" - }, - { - "name": "gasAmounts", - "type": "uint256[]", - "internalType": "uint256[]" - } - ] - }, - { - "name": "supports_", - "type": "uint8[]", - "internalType": "enum Ballot.VoteType[]" - }, - { - "name": "signatures", - "type": "tuple[]", - "internalType": "struct SignatureConsumer.Signature[]", - "components": [ - { - "name": "v", - "type": "uint8", - "internalType": "uint8" - }, - { - "name": "r", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "s", - "type": "bytes32", - "internalType": "bytes32" - } - ] - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "relayProposal", - "inputs": [ - { - "name": "proposal", - "type": "tuple", - "internalType": "struct Proposal.ProposalDetail", - "components": [ - { - "name": "nonce", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "chainId", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "expiryTimestamp", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "targets", - "type": "address[]", - "internalType": "address[]" - }, - { - "name": "values", - "type": "uint256[]", - "internalType": "uint256[]" - }, - { - "name": "calldatas", - "type": "bytes[]", - "internalType": "bytes[]" - }, - { - "name": "gasAmounts", - "type": "uint256[]", - "internalType": "uint256[]" - } - ] - }, - { - "name": "supports_", - "type": "uint8[]", - "internalType": "enum Ballot.VoteType[]" - }, - { - "name": "signatures", - "type": "tuple[]", - "internalType": "struct SignatureConsumer.Signature[]", - "components": [ - { - "name": "v", - "type": "uint8", - "internalType": "uint8" - }, - { - "name": "r", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "s", - "type": "bytes32", - "internalType": "bytes32" - } - ] - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "removeBridgeOperators", - "inputs": [ - { - "name": "bridgeOperators", - "type": "address[]", - "internalType": "address[]" - } - ], - "outputs": [ - { - "name": "removeds", - "type": "bool[]", - "internalType": "bool[]" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "resolveTargets", - "inputs": [ - { - "name": "targetOptions", - "type": "uint8[]", - "internalType": "enum GlobalProposal.TargetOption[]" - } - ], - "outputs": [ - { - "name": "targets", - "type": "address[]", - "internalType": "address[]" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "round", - "inputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "setContract", - "inputs": [ - { - "name": "contractType", - "type": "uint8", - "internalType": "enum ContractType" - }, - { - "name": "addr", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "setThreshold", - "inputs": [ - { - "name": "numerator", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "denominator", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "sumGovernorsWeight", - "inputs": [ - { - "name": "governors", - "type": "address[]", - "internalType": "address[]" - } - ], - "outputs": [ - { - "name": "sum", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "totalBridgeOperator", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "unregisterCallbacks", - "inputs": [ - { - "name": "registers", - "type": "address[]", - "internalType": "address[]" - } - ], - "outputs": [ - { - "name": "unregistereds", - "type": "bool[]", - "internalType": "bool[]" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "updateBridgeOperator", - "inputs": [ - { - "name": "newBridgeOperator", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "updateManyTargetOption", - "inputs": [ - { - "name": "targetOptions", - "type": "uint8[]", - "internalType": "enum GlobalProposal.TargetOption[]" - }, - { - "name": "targets", - "type": "address[]", - "internalType": "address[]" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "vote", - "inputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "status", - "type": "uint8", - "internalType": "enum VoteStatusConsumer.VoteStatus" - }, - { - "name": "hash", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "againstVoteWeight", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "forVoteWeight", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "expiryTimestamp", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "event", - "name": "BridgeOperatorUpdated", - "inputs": [ - { - "name": "governor", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "fromBridgeOperator", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "toBridgeOperator", - "type": "address", - "indexed": true, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "BridgeOperatorsAdded", - "inputs": [ - { - "name": "statuses", - "type": "bool[]", - "indexed": false, - "internalType": "bool[]" - }, - { - "name": "voteWeights", - "type": "uint96[]", - "indexed": false, - "internalType": "uint96[]" - }, - { - "name": "governors", - "type": "address[]", - "indexed": false, - "internalType": "address[]" - }, - { - "name": "bridgeOperators", - "type": "address[]", - "indexed": false, - "internalType": "address[]" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "BridgeOperatorsRemoved", - "inputs": [ - { - "name": "statuses", - "type": "bool[]", - "indexed": false, - "internalType": "bool[]" - }, - { - "name": "bridgeOperators", - "type": "address[]", - "indexed": false, - "internalType": "address[]" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ContractUpdated", - "inputs": [ - { - "name": "contractType", - "type": "uint8", - "indexed": true, - "internalType": "enum ContractType" - }, - { - "name": "addr", - "type": "address", - "indexed": true, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "GlobalProposalCreated", - "inputs": [ - { - "name": "round", - "type": "uint256", - "indexed": true, - "internalType": "uint256" - }, - { - "name": "proposalHash", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - }, - { - "name": "proposal", - "type": "tuple", - "indexed": false, - "internalType": "struct Proposal.ProposalDetail", - "components": [ - { - "name": "nonce", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "chainId", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "expiryTimestamp", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "targets", - "type": "address[]", - "internalType": "address[]" - }, - { - "name": "values", - "type": "uint256[]", - "internalType": "uint256[]" - }, - { - "name": "calldatas", - "type": "bytes[]", - "internalType": "bytes[]" - }, - { - "name": "gasAmounts", - "type": "uint256[]", - "internalType": "uint256[]" - } - ] - }, - { - "name": "globalProposalHash", - "type": "bytes32", - "indexed": false, - "internalType": "bytes32" - }, - { - "name": "globalProposal", - "type": "tuple", - "indexed": false, - "internalType": "struct GlobalProposal.GlobalProposalDetail", - "components": [ - { - "name": "nonce", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "expiryTimestamp", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "targetOptions", - "type": "uint8[]", - "internalType": "enum GlobalProposal.TargetOption[]" - }, - { - "name": "values", - "type": "uint256[]", - "internalType": "uint256[]" - }, - { - "name": "calldatas", - "type": "bytes[]", - "internalType": "bytes[]" - }, - { - "name": "gasAmounts", - "type": "uint256[]", - "internalType": "uint256[]" - } - ] - }, - { - "name": "creator", - "type": "address", - "indexed": false, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "Notified", - "inputs": [ - { - "name": "callData", - "type": "bytes", - "indexed": false, - "internalType": "bytes" - }, - { - "name": "registers", - "type": "address[]", - "indexed": false, - "internalType": "address[]" - }, - { - "name": "statuses", - "type": "bool[]", - "indexed": false, - "internalType": "bool[]" - }, - { - "name": "returnDatas", - "type": "bytes[]", - "indexed": false, - "internalType": "bytes[]" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ProposalApproved", - "inputs": [ - { - "name": "proposalHash", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ProposalCreated", - "inputs": [ - { - "name": "chainId", - "type": "uint256", - "indexed": true, - "internalType": "uint256" - }, - { - "name": "round", - "type": "uint256", - "indexed": true, - "internalType": "uint256" - }, - { - "name": "proposalHash", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - }, - { - "name": "proposal", - "type": "tuple", - "indexed": false, - "internalType": "struct Proposal.ProposalDetail", - "components": [ - { - "name": "nonce", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "chainId", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "expiryTimestamp", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "targets", - "type": "address[]", - "internalType": "address[]" - }, - { - "name": "values", - "type": "uint256[]", - "internalType": "uint256[]" - }, - { - "name": "calldatas", - "type": "bytes[]", - "internalType": "bytes[]" - }, - { - "name": "gasAmounts", - "type": "uint256[]", - "internalType": "uint256[]" - } - ] - }, - { - "name": "creator", - "type": "address", - "indexed": false, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ProposalExecuted", - "inputs": [ - { - "name": "proposalHash", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - }, - { - "name": "successCalls", - "type": "bool[]", - "indexed": false, - "internalType": "bool[]" - }, - { - "name": "returnDatas", - "type": "bytes[]", - "indexed": false, - "internalType": "bytes[]" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ProposalExpired", - "inputs": [ - { - "name": "proposalHash", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ProposalExpiryDurationChanged", - "inputs": [ - { - "name": "duration", - "type": "uint256", - "indexed": true, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ProposalRejected", - "inputs": [ - { - "name": "proposalHash", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ProposalVoted", - "inputs": [ - { - "name": "proposalHash", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - }, - { - "name": "voter", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "support", - "type": "uint8", - "indexed": false, - "internalType": "enum Ballot.VoteType" - }, - { - "name": "weight", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "TargetOptionUpdated", - "inputs": [ - { - "name": "targetOption", - "type": "uint8", - "indexed": true, - "internalType": "enum GlobalProposal.TargetOption" - }, - { - "name": "addr", - "type": "address", - "indexed": true, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ThresholdUpdated", - "inputs": [ - { - "name": "nonce", - "type": "uint256", - "indexed": true, - "internalType": "uint256" - }, - { - "name": "numerator", - "type": "uint256", - "indexed": true, - "internalType": "uint256" - }, - { - "name": "denominator", - "type": "uint256", - "indexed": true, - "internalType": "uint256" - }, - { - "name": "previousNumerator", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "previousDenominator", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "error", - "name": "ErrBridgeOperatorAlreadyExisted", - "inputs": [ - { - "name": "bridgeOperator", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "ErrBridgeOperatorUpdateFailed", - "inputs": [ - { - "name": "bridgeOperator", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "ErrContractTypeNotFound", - "inputs": [ - { - "name": "contractType", - "type": "uint8", - "internalType": "enum ContractType" - } - ] - }, - { - "type": "error", - "name": "ErrCurrentProposalIsNotCompleted", - "inputs": [] - }, - { - "type": "error", - "name": "ErrDuplicated", - "inputs": [ - { - "name": "msgSig", - "type": "bytes4", - "internalType": "bytes4" - } - ] - }, - { - "type": "error", - "name": "ErrInsufficientGas", - "inputs": [ - { - "name": "proposalHash", - "type": "bytes32", - "internalType": "bytes32" - } - ] - }, - { - "type": "error", - "name": "ErrInvalidArguments", - "inputs": [ - { - "name": "msgSig", - "type": "bytes4", - "internalType": "bytes4" - } - ] - }, - { - "type": "error", - "name": "ErrInvalidChainId", - "inputs": [ - { - "name": "msgSig", - "type": "bytes4", - "internalType": "bytes4" - }, - { - "name": "actual", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "expected", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "ErrInvalidExpiryTimestamp", - "inputs": [] - }, - { - "type": "error", - "name": "ErrInvalidOrder", - "inputs": [ - { - "name": "msgSig", - "type": "bytes4", - "internalType": "bytes4" - } - ] - }, - { - "type": "error", - "name": "ErrInvalidProposalNonce", - "inputs": [ - { - "name": "msgSig", - "type": "bytes4", - "internalType": "bytes4" - } - ] - }, - { - "type": "error", - "name": "ErrInvalidThreshold", - "inputs": [ - { - "name": "msgSig", - "type": "bytes4", - "internalType": "bytes4" - } - ] - }, - { - "type": "error", - "name": "ErrInvalidVoteWeight", - "inputs": [ - { - "name": "msgSig", - "type": "bytes4", - "internalType": "bytes4" - } - ] - }, - { - "type": "error", - "name": "ErrLengthMismatch", - "inputs": [ - { - "name": "msgSig", - "type": "bytes4", - "internalType": "bytes4" - } - ] - }, - { - "type": "error", - "name": "ErrOnlySelfCall", - "inputs": [ - { - "name": "msgSig", - "type": "bytes4", - "internalType": "bytes4" - } - ] - }, - { - "type": "error", - "name": "ErrRelayFailed", - "inputs": [ - { - "name": "msgSig", - "type": "bytes4", - "internalType": "bytes4" - } - ] - }, - { - "type": "error", - "name": "ErrUnauthorized", - "inputs": [ - { - "name": "msgSig", - "type": "bytes4", - "internalType": "bytes4" - }, - { - "name": "expectedRole", - "type": "uint8", - "internalType": "enum RoleAccess" - } - ] - }, - { - "type": "error", - "name": "ErrUnsupportedInterface", - "inputs": [ - { - "name": "interfaceId", - "type": "bytes4", - "internalType": "bytes4" - }, - { - "name": "addr", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "ErrUnsupportedVoteType", - "inputs": [ - { - "name": "msgSig", - "type": "bytes4", - "internalType": "bytes4" - } - ] - }, - { - "type": "error", - "name": "ErrVoteIsFinalized", - "inputs": [] - }, - { - "type": "error", - "name": "ErrZeroAddress", - "inputs": [ - { - "name": "msgSig", - "type": "bytes4", - "internalType": "bytes4" - } - ] - }, - { - "type": "error", - "name": "ErrZeroCodeContract", - "inputs": [ - { - "name": "addr", - "type": "address", - "internalType": "address" - } - ] - } - ], - "address": "0x5396b75c9eb8D1153D2B8a0Bb9a8c4B1541f758d", - "args": "0x0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000007e500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000ba8e32d874948df4cbe72284de91cc4968293bce000000000000000000000000000000000000000000000000000000000000000100000000000000000000000045e8f1acfc89f45720cf11e807ed85b730c67c7e0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "ast": "", - "blockNumber": 5632711, - "bytecode": "0x60a06040526040516200659938038062006599833981016040819052620000269162001523565b8181600160ff1b8c8c8c8c8c8c8c8c836200004181620001a3565b505060016000805160206200657983398151915255620000628888620002b2565b50620000729050600286620003c7565b604080516020808201839052600c60608301526b212924a223a2afa0a226a4a760a11b6080808401919091528284018a905283518084038201815260a0840185528051908301207f599a80fcaa47b95e2323ab4d34d34e0cc9feda4b843edafcc30c7bdf60ea15bf60c08501527f9d3fa1662ea89365eb7af36506f0ad5413bd7e078960d8481ff4718763aaa8e960e08501527fad7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a56101008501526101208085019190915284518085039091018152610140909301909352815191012090526200015d81838562000471565b50505050505050505062000177816200089160201b60201c565b5062000185600030620008c4565b62000191828262000960565b5050505050505050505050506200196e565b606081620001b18162000a23565b8251806001600160401b03811115620001ce57620001ce62001334565b604051908082528060200260200182016040528015620001f8578160200160208202803683370190505b509250806000036200020b5750620002ac565b6000805160206200653983398151915260006314d72edb60e21b815b84811015620002a6578781815181106200024557620002456200165e565b60200260200101519250620002608362000a5f60201b60201c565b6200026c838362000a97565b62000278848462000c76565b8782815181106200028d576200028d6200165e565b9115156020928302919091019091015260010162000227565b50505050505b50919050565b60008082841115620002ea576040516387f6f09560e01b81526001600160e01b03196000351660048201526024015b60405180910390fd5b60008051602062006559833981519152549150620003267fac1ff16a4f04f2a37a9ba5252a69baa100b460e517d1f8019c054a5ad698f9ff5490565b90506200034160008051602062006559833981519152859055565b6200036b7fac1ff16a4f04f2a37a9ba5252a69baa100b460e517d1f8019c054a5ad698f9ff849055565b8284620003876000805160206200657983398151915262000c96565b60408051868152602081018690527f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a49250929050565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f81111562000400576200040062001674565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f81111562000444576200044462001674565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b60606200047f838362000cbe565b6200048a8162000a23565b82518551811480156200049d5750845181145b620004ca576040516306b5667560e21b81526001600160e01b0319600035166004820152602401620002e1565b806001600160401b03811115620004e557620004e562001334565b6040519080825280602002602001820160405280156200050f578160200160208202803683370190505b5092508060000362000522575062000889565b604080518082019091526000808252602082018190527f546f6b46ab35b030b6816596b352aef78857377176c8b24baa2046a62cf1998c917f8400683eb2cb350596d73644c0c89fe45f108600003457374f4ab3e87b4f3aa3917fd38c234075fde25875da8a6b7e36b58b86681d483271a99eeeee1d78e258a24d917f88547008e60f5748911f2e59feb3093b7e4c2e87b2dd69d61f112fcc932de8e3919081908190815b89811015620007db578d8181518110620005e557620005e56200165e565b602002602001015194508c81815181106200060457620006046200165e565b602002602001015193506200061f8562000ddc60201b60201c565b6200062a8462000ddc565b8e81815181106200063f576200063f6200165e565b60200260200101516001600160601b03166000036200068057604051637f11b8a360e11b81526001600160e01b0319600035166004820152602401620002e1565b6200068c898662000e13565b806200069f57506200069f898562000e13565b80620006b25750620006b2878662000e13565b80620006c55750620006c5878562000e13565b158c8281518110620006db57620006db6200165e565b6020026020010190151590811515815250508b81815181106200070257620007026200165e565b602002602001015115620007d2576200071c898662000c76565b5062000729878562000c76565b506001600160a01b03848116600081815260208b90526040902080546001600160a01b0319169288169290921790915582528e518f90829081106200077257620007726200165e565b6020908102919091018101516001600160601b03169083018190526200079990846200168a565b6001600160a01b038087166000908152602089815260409091208551918601516001600160601b0316600160a01b029190921617905592505b600101620005c7565b50620008087f6924fe71b0c8b61aea02ca498b5f53b29bd95726278b1fe4eb791bb24a42644c8362000e36565b5062000840635ebae8a060e01b8d8d6040516020016200082a92919062001728565b60408051601f1981840301815291905262000e50565b7f897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b788b8f8f8f6040516200087794939291906200175a565b60405180910390a15050505050505050505b509392505050565b600281905560405181907fe5cd1c123a8cf63fa1b7229678db61fe8ae99dbbd27889370b6667c8cae97da190600090a250565b8060036000846004811115620008de57620008de62001674565b6004811115620008f257620008f262001674565b8152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600481111562000933576200093362001674565b6040517f356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d90600090a35050565b60005b825181101562000a1e57306001600160a01b03168282815181106200098c576200098c6200165e565b60200260200101516001600160a01b031603620009cb5760405163053265f160e01b81526001600160e01b0319600035166004820152602401620002e1565b62000a15838281518110620009e457620009e46200165e565b602002602001015183838151811062000a015762000a016200165e565b6020026020010151620008c460201b60201c565b60010162000963565b505050565b62000a2e816200118b565b1562000a5c57604051630d697db160e11b81526001600160e01b0319600035166004820152602401620002e1565b50565b806001600160a01b03163b60000362000a5c57604051630bfc64a360e21b81526001600160a01b0382166004820152602401620002e1565b6040516001600160e01b03198216602482015260009060440160408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b1790525190915060009081906001600160a01b0386169062000afb90859062001810565b600060405180830381855afa9150503d806000811462000b38576040519150601f19603f3d011682016040523d82523d6000602084013e62000b3d565b606091505b50915091508162000c1f57846001600160a01b03168360405160240162000b6591906200185c565b60408051601f198184030181529181526020820180516001600160e01b03166325da93a560e11b1790525162000b9c919062001810565b600060405180830381855afa9150503d806000811462000bd9576040519150601f19603f3d011682016040523d82523d6000602084013e62000bde565b606091505b5090925090508162000c1f5760405163069d427960e11b81526001600160e01b0319851660048201526001600160a01b0386166024820152604401620002e1565b8080602001905181019062000c35919062001871565b62000c6f5760405163069d427960e11b81526001600160e01b0319851660048201526001600160a01b0386166024820152604401620002e1565b5050505050565b600062000c8d836001600160a01b03841662001236565b90505b92915050565b600062000ca1825490565b905062000cb98262000cb58360016200168a565b9055565b919050565b81518151606091908082016001600160401b0381111562000ce35762000ce362001334565b60405190808252806020026020018201604052801562000d0d578160200160208202803683370190505b50925060005b8281101562000d6f5785818151811062000d315762000d316200165e565b602002602001015184828151811062000d4e5762000d4e6200165e565b6001600160a01b039092166020928302919091019091015260010162000d13565b60005b8281101562000dd25785818151811062000d905762000d906200165e565b602002602001015185838151811062000dad5762000dad6200165e565b6001600160a01b03909216602092830291909101909101526001918201910162000d72565b5050505092915050565b6001600160a01b03811662000a5c5760405163104c66df60e31b81526001600160e01b0319600035166004820152602401620002e1565b6001600160a01b0381166000908152600183016020526040812054151562000c8d565b600062000c908362000e49818562001288565b9250829055565b600062000e6c60008051602062006539833981519152620012a8565b8051909150600081900362000e815750505050565b6000816001600160401b0381111562000e9e5762000e9e62001334565b60405190808252806020026020018201604052801562000ec8578160200160208202803683370190505b5090506000826001600160401b0381111562000ee85762000ee862001334565b60405190808252806020026020018201604052801562000f1d57816020015b606081526020019060019003908162000f075790505b5090506000868660405160200162000f3792919062001895565b604051602081830303815290604052905060008160405160240162000f5d91906200185c565b60408051601f198184030181529190526020810180516001600160e01b03166325da93a560e11b179052905060005b85811015620011415786818151811062000faa5762000faa6200165e565b60200260200101516001600160a01b03168360405162000fcb919062001810565b6000604051808303816000865af19150503d80600081146200100a576040519150601f19603f3d011682016040523d82523d6000602084013e6200100f565b606091505b508683815181106200102557620010256200165e565b602002602001018684815181106200104157620010416200165e565b60200260200101829052821515151581525050508481815181106200106a576200106a6200165e565b602002602001015162001138578681815181106200108c576200108c6200165e565b60200260200101516001600160a01b031682604051620010ad919062001810565b6000604051808303816000865af19150503d8060008114620010ec576040519150601f19603f3d011682016040523d82523d6000602084013e620010f1565b606091505b508683815181106200110757620011076200165e565b602002602001018684815181106200112357620011236200165e565b60200260200101829052821515151581525050505b60010162000f8c565b507fc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b6382878686604051620011799493929190620018c8565b60405180910390a15050505050505050565b600081516000036200119f57506000919050565b60005b60018351038110156200122d57600181015b83518110156200122357838181518110620011d357620011d36200165e565b60200260200101516001600160a01b0316848381518110620011f957620011f96200165e565b60200260200101516001600160a01b0316036200121a575060019392505050565b600101620011b4565b50600101620011a2565b50600092915050565b60008181526001830160205260408120546200127f5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000c90565b50600062000c90565b815481018181101562000c9057634e487b7160005260116020526024601cfd5b60606000620012b783620012be565b9392505050565b6060816000018054806020026020016040519081016040528092919081815260200182805480156200131057602002820191906000526020600020905b815481526020019060010190808311620012fb575b50505050509050919050565b80516001600160a01b038116811462000cb957600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171562001375576200137562001334565b604052919050565b60006001600160401b0382111562001399576200139962001334565b5060051b60200190565b600082601f830112620013b557600080fd5b81516020620013ce620013c8836200137d565b6200134a565b8083825260208201915060208460051b870101935086841115620013f157600080fd5b602086015b8481101562001418576200140a816200131c565b8352918301918301620013f6565b509695505050505050565b600082601f8301126200143557600080fd5b8151602062001448620013c8836200137d565b8083825260208201915060208460051b8701019350868411156200146b57600080fd5b602086015b84811015620014185780516001600160601b0381168114620014925760008081fd5b835291830191830162001470565b600082601f830112620014b257600080fd5b81516020620014c5620013c8836200137d565b80838252602082019150600560208560051b880101945087851115620014ea57600080fd5b602087015b8581101562001516578051828110620015085760008081fd5b8452928401928401620014ef565b5090979650505050505050565b6000806000806000806000806000806101408b8d0312156200154457600080fd5b8a51995060208b0151985060408b015197506200156460608c016200131c565b60808c01519097506001600160401b03808211156200158257600080fd5b620015908e838f01620013a3565b975060a08d0151915080821115620015a757600080fd5b620015b58e838f01620013a3565b965060c08d0151915080821115620015cc57600080fd5b620015da8e838f01620013a3565b955060e08d0151915080821115620015f157600080fd5b620015ff8e838f0162001423565b94506101008d01519150808211156200161757600080fd5b620016258e838f01620014a0565b93506101208d01519150808211156200163d57600080fd5b506200164c8d828e01620013a3565b9150509295989b9194979a5092959850565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b8082018082111562000c9057634e487b7160e01b600052601160045260246000fd5b60008151808452602080850194506020840160005b83811015620016e85781516001600160a01b031687529582019590820190600101620016c1565b509495945050505050565b60008151808452602080850194506020840160005b83811015620016e857815115158752958201959082019060010162001708565b6040815260006200173d6040830185620016ac565b8281036020840152620017518185620016f3565b95945050505050565b6080815260006200176f6080830187620016f3565b82810360208481019190915286518083528782019282019060005b81811015620017b15784516001600160601b0316835293830193918301916001016200178a565b50508481036040860152620017c78188620016ac565b925050508281036060840152620017df8185620016ac565b979650505050505050565b60005b8381101562001807578181015183820152602001620017ed565b50506000910152565b6000825162001824818460208701620017ea565b9190910192915050565b6000815180845262001848816020860160208601620017ea565b601f01601f19169290920160200192915050565b60208152600062000c8d60208301846200182e565b6000602082840312156200188457600080fd5b81518015158114620012b757600080fd5b6001600160e01b0319831681528151600090620018ba816004850160208701620017ea565b919091016004019392505050565b608081526000620018dd60808301876200182e565b602083820381850152620018f28288620016ac565b91508382036040850152620019088287620016f3565b915083820360608501528185518084528284019150828160051b85010183880160005b838110156200195d57601f198784030185526200194a8383516200182e565b948601949250908501906001016200192b565b50909b9a5050505050505050505050565b608051614ba162001998600039600081816102c5015281816107c501526108510152614ba16000f3fe608060405234801561001057600080fd5b50600436106101fb5760003560e01c80639b19dbfd1161011a578063cc7e6b3b116100ad578063de981f1b1161007c578063de981f1b1461050c578063e75235b814610537578063e9c034981461053f578063f80b535214610552578063fdc4fa471461055a57600080fd5b8063cc7e6b3b146104be578063d0a50db0146104de578063d78392f8146104e6578063dafae408146104f957600080fd5b8063b9c36209116100e9578063b9c3620914610464578063bc9182fd1461048c578063bc96180b1461049f578063c441c4a8146104a757600080fd5b80639b19dbfd146103db5780639b2ee437146103e3578063b384abef146103f6578063b405aaf21461045157600080fd5b80633644e515116101925780637de5dedd116101615780637de5dedd14610332578063800eaab31461033a578063865e6fd31461034d578063901979d51461036057600080fd5b80633644e515146102c05780635e05cf9e146102e7578063776fb1ec146102fc5780637d465f791461031f57600080fd5b80631f425338116101ce5780631f425338146102675780632d6d7d731461027a57806334d5f37b1461028d57806335da8121146102ad57600080fd5b806301a5f43f1461020057806306aba0e1146102295780630a44fa431461023f5780630f7c318914610252575b600080fd5b61021361020e366004613b79565b61056d565b6040516102209190613c50565b60405180910390f35b610231610620565b604051908152602001610220565b61023161024d366004613c63565b61063d565b61025a6106c2565b6040516102209190613cde565b610213610275366004613c63565b6106db565b61025a610288366004613c63565b610728565b61023161029b366004613cf1565b60006020819052908152604090205481565b6102136102bb366004613c63565b61076c565b6102317f000000000000000000000000000000000000000000000000000000000000000081565b6102fa6102f5366004613d4e565b6107b2565b005b61030f61030a366004613cf1565b6107f1565b6040519015158152602001610220565b6102fa61032d366004613dea565b61083e565b610231610876565b6102fa610348366004613fe8565b6108f2565b6102fa61035b36600461405a565b610937565b6103c361036e36600461408d565b6001600160a01b039081166000908152600080516020614b0c83398151915260209081526040808320549093168252600080516020614aec83398151915290522054600160a01b90046001600160601b031690565b6040516001600160601b039091168152602001610220565b61025a610952565b6102fa6103f136600461408d565b61095c565b6104406104043660046140a8565b600160208181526000938452604080852090915291835291208054918101546002820154600383015460069093015460ff909416939192909185565b6040516102209594939291906140f0565b61030f61045f36600461408d565b610af3565b6104776104723660046140a8565b610b0d565b60408051928352602083019190915201610220565b61025a61049a36600461411e565b610b2e565b610231610c1f565b6104af610c2a565b6040516102209392919061418c565b6104d16104cc366004613c63565b610c54565b60405161022091906141cf565b610231610c92565b6103c36104f436600461408d565b610cab565b61030f610507366004613cf1565b610cb6565b61051f61051a3660046141e2565b610cf3565b6040516001600160a01b039091168152602001610220565b610477610d6e565b61021361054d366004613c63565b610d9f565b61025a610de5565b61025a610568366004613c63565b610def565b6060610577610ed6565b61061587878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82529093508a92508991829185019084908082843760009201919091525050604080516020808a02828101820190935289825290935089925088918291850190849080828437600092019190915250610f0692505050565b979650505050505050565b6000610638600080516020614b4c8339815191525490565b905090565b600082828080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061067e92508391506112829050565b6106ba8484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506112ba92505050565b949350505050565b6060610638600080516020614a8c83398151915261133e565b60606106e5610ed6565b61072183838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061134b92505050565b9392505050565b606061072183838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250611416915050565b92915050565b6060610776610ed6565b61072183838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061157092505050565b6107bb33611662565b6107ea85858585857f0000000000000000000000000000000000000000000000000000000000000000336116a4565b5050505050565b60008060008381527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff166004811115610836576108366140ca565b141592915050565b61084733611662565b6107ea85858585857f000000000000000000000000000000000000000000000000000000000000000033611749565b600061088e600080516020614aac8339815191525490565b60016108a6600080516020614aac8339815191525490565b6108d46108bf600080516020614b4c8339815191525490565b600080516020614acc833981519152906117a5565b6108de9190614213565b6108e89190614226565b6106389190614239565b333014610929576000356001600160e01b0319166040516307337e1960e41b8152600401610920919061425b565b60405180910390fd5b61093382826117d0565b5050565b61093f610ed6565b6109488161187e565b61093382826118b4565b6060610638611958565b61096533611662565b61096e81611971565b336000908152600080516020614aec83398151915260208190526040909120546001600160a01b0390811690831681036109c657604051630669b93360e31b81526001600160a01b0384166004820152602401610920565b600080516020614b2c83398151915260006109e182846119a6565b80156109f257506109f282866119bb565b905080610a1d5760405163080fab4b60e31b81526001600160a01b0386166004820152602401610920565b6001600160a01b038381166000818152600080516020614b0c8339815191526020818152604080842080546001600160a01b0319908116909155958b16808552818520805488163390811790915585528a8352938190208054909616841790955584519081019390935292820152610ab0906364b18d0960e11b906060015b6040516020818303038152906040526119d0565b6040516001600160a01b03808816919086169033907fcef34cd748f30a1b7a2f214fd1651779f79bc6c1be02785cad5c1f0ee877213d90600090a4505050505050565b6000610766600080516020614b2c83398151915283611cd8565b600080610b18610ed6565b610b228484611cfa565b915091505b9250929050565b8051606090806001600160401b03811115610b4b57610b4b613e2d565b604051908082528060200260200182016040528015610b74578160200160208202803683370190505b509150600080516020614aec83398151915260005b82811015610c1757816000868381518110610ba657610ba6614270565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060000160009054906101000a90046001600160a01b0316848281518110610bf757610bf7614270565b6001600160a01b0390921660209283029190910190910152600101610b89565b505050919050565b600061063860025490565b6060806060610c37611def565b9250610c4283610b2e565b9150610c4d83611e1a565b9050909192565b6060610721838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611e1a92505050565b6000610638600080516020614b2c833981519152611f03565b600061076682611f0d565b6000610cd16108bf600080516020614b4c8339815191525490565b600080516020614aac83398151915254610ceb9084614286565b101592915050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115610d2a57610d2a6140ca565b60ff1681526020810191909152604001600020546001600160a01b0316905080610d69578160405163409140df60e11b8152600401610920919061429d565b919050565b600080610d87600080516020614acc8339815191525490565b600080516020614aac83398151915254915091509091565b6060610da9610ed6565b610721838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611f4592505050565b6060610638611def565b606081806001600160401b03811115610e0a57610e0a613e2d565b604051908082528060200260200182016040528015610e33578160200160208202803683370190505b509150600080516020614b0c83398151915260005b82811015610ecd57816000878784818110610e6557610e65614270565b9050602002016020810190610e7a919061408d565b6001600160a01b0390811682526020820192909252604001600020548551911690859083908110610ead57610ead614270565b6001600160a01b0390921660209283029190910190910152600101610e48565b50505092915050565b333014610f04576000356001600160e01b0319166040516307337e1960e41b8152600401610920919061425b565b565b6060610f12838361222a565b610f1b81611282565b8251855181148015610f2d5750845181145b610f58576000356001600160e01b0319166040516306b5667560e21b8152600401610920919061425b565b806001600160401b03811115610f7057610f70613e2d565b604051908082528060200260200182016040528015610f99578160200160208202803683370190505b50925080600003610faa575061127a565b604080518082019091526000808252602082018190527f546f6b46ab35b030b6816596b352aef78857377176c8b24baa2046a62cf1998c91600080516020614b0c83398151915291600080516020614b2c83398151915291600080516020614aec833981519152919081908190815b898110156111fb578d818151811061103357611033614270565b602002602001015194508c818151811061104f5761104f614270565b6020026020010151935061106285611971565b61106b84611971565b8e818151811061107d5761107d614270565b60200260200101516001600160601b03166000036110bc576000356001600160e01b031916604051637f11b8a360e11b8152600401610920919061425b565b6110c68986611cd8565b806110d657506110d68985611cd8565b806110e657506110e68786611cd8565b806110f657506110f68785611cd8565b158c828151811061110957611109614270565b6020026020010190151590811515815250508b818151811061112d5761112d614270565b6020026020010151156111f35761114489866119bb565b5061114f87856119bb565b506001600160a01b03848116600081815260208b90526040902080546001600160a01b0319169288169290921790915582528e518f908290811061119557611195614270565b6020908102919091018101516001600160601b03169083018190526111ba9084614213565b6001600160a01b038087166000908152602089815260409091208551918601516001600160601b0316600160a01b029190921617905592505b600101611019565b50611214600080516020614b4c83398151915283612334565b50611233635ebae8a060e01b8d8d604051602001610a9c9291906142b7565b7f897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b788b8f8f8f60405161126894939291906142e5565b60405180910390a15050505050505050505b509392505050565b61128b8161234b565b156112b7576000356001600160e01b031916604051630d697db160e11b8152600401610920919061425b565b50565b6000816112c681611282565b600080516020614aec83398151915260005b8451811015610c17578160008683815181106112f6576112f6614270565b6020908102919091018101516001600160a01b031682528101919091526040016000205461133490600160a01b90046001600160601b031685614213565b93506001016112d8565b60606000610721836123ea565b60608161135781611282565b8251806001600160401b0381111561137157611371613e2d565b60405190808252806020026020018201604052801561139a578160200160208202803683370190505b509250600080516020614a8c83398151915260005b8281101561140d576113e38682815181106113cc576113cc614270565b6020026020010151836119a690919063ffffffff16565b8582815181106113f5576113f5614270565b911515602092830291909101909101526001016113af565b50505050919050565b606082516001600160401b0381111561143157611431613e2d565b60405190808252806020026020018201604052801561145a578160200160208202803683370190505b50905060005b8351811015611569576003600085838151811061147f5761147f614270565b60200260200101516004811115611498576114986140ca565b60048111156114a9576114a96140ca565b815260200190815260200160002060009054906101000a90046001600160a01b03168282815181106114dd576114dd614270565b60200260200101906001600160a01b031690816001600160a01b031681525050828015611535575060006001600160a01b031682828151811061152257611522614270565b60200260200101516001600160a01b0316145b15611561576000356001600160e01b03191660405163053265f160e01b8152600401610920919061425b565b600101611460565b5092915050565b60608161157c81611282565b8251806001600160401b0381111561159657611596613e2d565b6040519080825280602002602001820160405280156115bf578160200160208202803683370190505b509250806000036115d0575061165c565b600080516020614a8c83398151915260006314d72edb60e21b815b848110156116565787818151811061160557611605614270565b602002602001015192506116188361187e565b6116228383612446565b61162c84846119bb565b87828151811061163e5761163e614270565b911515602092830291909101909101526001016115eb565b50505050505b50919050565b61166b81611f0d565b6001600160601b03166000036112b7576000356001600160e01b0319166003604051620f948f60ea1b8152600401610920929190614332565b6116b66116b0886144a3565b826125d9565b5060006116ca6116c5896144a3565b6126df565b905061173f6116d8896144a3565b8888888861172b896116eb89600061281e565b60405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b61173a8a6116eb8a600161281e565b612857565b5050505050505050565b600061175d61175789614577565b83612c4e565b9050600061177261176d8a614577565b612d98565b905061179a828989898961178b8a6116eb89600061281e565b61173a8b6116eb8a600161281e565b505050505050505050565b600082548015611569578281029150808204831461156957634e487b7160005260116020526024601cfd5b60005b825181101561187957306001600160a01b03168282815181106117f8576117f8614270565b60200260200101516001600160a01b031603611835576000356001600160e01b03191660405163053265f160e01b8152600401610920919061425b565b61187183828151811061184a5761184a614270565b602002602001015183838151811061186457611864614270565b6020026020010151612ecf565b6001016117d3565b505050565b806001600160a01b03163b6000036112b757604051630bfc64a360e21b81526001600160a01b0382166004820152602401610920565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f8111156118ea576118ea6140ca565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f81111561192b5761192b6140ca565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b6060610638600080516020614b2c83398151915261133e565b6001600160a01b0381166112b7576000356001600160e01b03191660405163104c66df60e31b8152600401610920919061425b565b6000610721836001600160a01b038416612f62565b6000610721836001600160a01b038416613055565b60006119e9600080516020614a8c83398151915261133e565b805190915060008190036119fd5750505050565b6000816001600160401b03811115611a1757611a17613e2d565b604051908082528060200260200182016040528015611a40578160200160208202803683370190505b5090506000826001600160401b03811115611a5d57611a5d613e2d565b604051908082528060200260200182016040528015611a9057816020015b6060815260200190600190039081611a7b5790505b50905060008686604051602001611aa8929190614665565b6040516020818303038152906040529050600081604051602401611acc91906146c2565b60408051601f198184030181529190526020810180516001600160e01b03166325da93a560e11b179052905060005b85811015611c9057868181518110611b1557611b15614270565b60200260200101516001600160a01b031683604051611b3491906146d5565b6000604051808303816000865af19150503d8060008114611b71576040519150601f19603f3d011682016040523d82523d6000602084013e611b76565b606091505b50868381518110611b8957611b89614270565b60200260200101868481518110611ba257611ba2614270565b6020026020010182905282151515158152505050848181518110611bc857611bc8614270565b6020026020010151611c8857868181518110611be657611be6614270565b60200260200101516001600160a01b031682604051611c0591906146d5565b6000604051808303816000865af19150503d8060008114611c42576040519150601f19603f3d011682016040523d82523d6000602084013e611c47565b606091505b50868381518110611c5a57611c5a614270565b60200260200101868481518110611c7357611c73614270565b60200260200101829052821515151581525050505b600101611afb565b507fc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b6382878686604051611cc6949392919061473e565b60405180910390a15050505050505050565b6001600160a01b03811660009081526001830160205260408120541515610721565b60008082841115611d2c576000356001600160e01b0319166040516387f6f09560e01b8152600401610920919061425b565b600080516020614acc833981519152549150611d54600080516020614aac8339815191525490565b9050611d6d600080516020614acc833981519152859055565b611d84600080516020614aac833981519152849055565b8284611daf7f92872d32822c9d44b36a2537d3e0d4c46fc4de1ce154ccfaed560a8a58445f1d6130a8565b60408051868152602081018690527f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a49250929050565b60606106387f546f6b46ab35b030b6816596b352aef78857377176c8b24baa2046a62cf1998c61133e565b8051606090806001600160401b03811115611e3757611e37613e2d565b604051908082528060200260200182016040528015611e60578160200160208202803683370190505b509150600080516020614aec83398151915260005b82811015610c1757816000868381518110611e9257611e92614270565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060000160149054906101000a90046001600160601b0316848281518110611ee357611ee3614270565b6001600160601b0390921660209283029190910190910152600101611e75565b6000610766825490565b6001600160a01b03166000908152600080516020614aec8339815191526020526040902054600160a01b90046001600160601b031690565b606081611f5181611282565b8251806001600160401b03811115611f6b57611f6b613e2d565b604051908082528060200260200182016040528015611f94578160200160208202803683370190505b50925080600003611fa5575061165c565b60408051808201909152600080825260208201819052600080516020614b0c833981519152917f546f6b46ab35b030b6816596b352aef78857377176c8b24baa2046a62cf1998c91600080516020614b2c83398151915291600080516020614aec833981519152919081908190815b898110156121aa578c818151811061202e5761202e614270565b6020908102919091018101516001600160a01b038082166000908152928c90526040909220549091169550935061206485611971565b61206d84611971565b6001600160a01b0385811660009081526020888152604091829020825180840190935254808416808452600160a01b9091046001600160601b031691830191909152909350908516146120e1576000356001600160e01b03191660405163053265f160e01b8152600401610920919061425b565b6120eb8785611cd8565b80156120fc57506120fc8886611cd8565b8c828151811061210e5761210e614270565b6020026020010190151590811515815250508b818151811061213257612132614270565b6020026020010151156121a25761214988866119a6565b5061215487856119a6565b506001600160a01b03808516600090815260208b8152604080832080546001600160a01b031916905592881682528881529181205582015161219f906001600160601b031684614213565b92505b600101612014565b506121c3600080516020614b4c833981519152836130c3565b506121e263c48549de60e01b8d8d604051602001610a9c9291906142b7565b7fdf3dcd7987202f64648f3acdbf12401e3a2bb23e77e19f99826b5475cbb863698b8d60405161221392919061478b565b60405180910390a150505050505050505050919050565b81518151606091908082016001600160401b0381111561224c5761224c613e2d565b604051908082528060200260200182016040528015612275578160200160208202803683370190505b50925060005b828110156122cf5785818151811061229557612295614270565b60200260200101518482815181106122af576122af614270565b6001600160a01b039092166020928302919091019091015260010161227b565b60005b8281101561232a578581815181106122ec576122ec614270565b602002602001015185838151811061230657612306614270565b6001600160a01b0390921660209283029190910190910152600191820191016122d2565b5050505092915050565b60006107668361234485856130d3565b9250829055565b6000815160000361235e57506000919050565b60005b60018351038110156123e157600181015b83518110156123d85783818151811061238d5761238d614270565b60200260200101516001600160a01b03168483815181106123b0576123b0614270565b60200260200101516001600160a01b0316036123d0575060019392505050565b600101612372565b50600101612361565b50600092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561243a57602002820191906000526020600020905b815481526020019060010190808311612426575b50505050509050919050565b600081604051602401612459919061425b565b60408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b1790525190915060009081906001600160a01b038616906124a29085906146d5565b600060405180830381855afa9150503d80600081146124dd576040519150601f19603f3d011682016040523d82523d6000602084013e6124e2565b606091505b5091509150816125a457846001600160a01b03168360405160240161250791906146c2565b60408051601f198184030181529181526020820180516001600160e01b03166325da93a560e11b1790525161253c91906146d5565b600060405180830381855afa9150503d8060008114612577576040519150601f19603f3d011682016040523d82523d6000602084013e61257c565b606091505b509092509050816125a457838560405163069d427960e11b81526004016109209291906147b0565b808060200190518101906125b891906147d3565b6107ea57838560405163069d427960e11b81526004016109209291906147b0565b602082015160009080820361261b5760405163092048d160e11b8152600080356001600160e01b03191660048301526024820152466044820152606401610920565b6002546126299085906130f2565b6000612634856126df565b905061263f82613193565b6000838152600160208181526040808420858552909152918290209188015190820184905560069091015592508451831461269b576000356001600160e01b03191660405163d4cec26960e01b8152600401610920919061425b565b8083837fa57d40f1496988cf60ab7c9d5ba4ff83647f67d3898d441a3aaf21b651678fd988886040516126cf9291906148e2565b60405180910390a4505092915050565b6080810151606082015160a083015151600092919083906001600160401b0381111561270d5761270d613e2d565b604051908082528060200260200182016040528015612736578160200160208202803683370190505b5060c086015190915060005b8251811015612795578660a00151818151811061276157612761614270565b60200260200101518051906020012083828151811061278257612782614270565b6020908102919091010152600101612742565b50604080517fd051578048e6ff0bbc9fca3b65a42088dbde10f36ca841de566711087ad9b08a8152875160208083019190915280890151828401529790910151606082015283518702938701939093206080840152835186029386019390932060a0830152805185029085012060c082015281518402919093012060e083015250610100902090565b604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b841580159061286557508483145b612890576000356001600160e01b0319166040516306b5667560e21b8152600401610920919061425b565b60008080856001600160401b038111156128ac576128ac613e2d565b6040519080825280602002602001820160405280156128d5578160200160208202803683370190505b5090506000866001600160401b038111156128f2576128f2613e2d565b60405190808252806020026020018201604052801561291b578160200160208202803683370190505b50905060008060003660005b8b811015612aac578c8c8281811061294157612941614270565b90506060020191508e8e8281811061295b5761295b614270565b9050602002016020810190612970919061490c565b92506000836001811115612986576129866140ca565b036129f0576129ab8b61299c602085018561492d565b8460200135856040013561322f565b945084878a6129b981614950565b9b50815181106129cb576129cb614270565b60200260200101906001600160a01b031690816001600160a01b031681525050612a61565b6001836001811115612a0457612a046140ca565b03612a3a57612a1a8a61299c602085018561492d565b9450848689612a2881614950565b9a50815181106129cb576129cb614270565b6000356001600160e01b031916604051630612418f60e11b8152600401610920919061425b565b846001600160a01b0316846001600160a01b031610612aa1576000356001600160e01b031916604051635d3dcd3160e01b8152600401610920919061425b565b849350600101612927565b50505085845250508281526020808c015160009081526001825260408082208e51835290925290812090612ade613257565b90506000612aeb85613261565b9050818110612b725780600003612b23576000356001600160e01b031916604051637f11b8a360e11b8152600401610920919061425b565b825460ff1916600190811784558301546040517f5c819725ea53655a3b898f3df59b66489761935454e9212ca1e5ebd759953d0b90600090a2612b66838f61326c565b50505050505050612c45565b600082612b7d6132d9565b612b879190614226565b612b92906001614213565b90506000612b9f86613261565b9050818110612c1e5780600003612bd7576000356001600160e01b031916604051637f11b8a360e11b8152600401610920919061425b565b845460ff1916600317855560018501546040517f55295d4ce992922fa2e5ffbf3a3dcdb367de0a15e125ace083456017fd22060f90600090a2505050505050505050612c45565b6000356001600160e01b031916604051634ccfe64360e11b8152600401610920919061425b565b50505050505050565b612c8e6040518060e00160405280600081526020016000815260200160008152602001606081526020016060815260200160608152602001606081525090565b612ca7612ca084604001516001611416565b84906132e3565b9050612cbe600254826130f290919063ffffffff16565b6000612cc9826126df565b90506000612cd76000613193565b60008181527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602090815260409091209087015160018201859055600690910155905082518114612d49576000356001600160e01b03191660405163d4cec26960e01b8152600401610920919061425b565b81817f771d78ae9e5fca95a532fb0971d575d0ce9b59d14823c063e08740137e0e0eca85612d7689612d98565b8989604051612d889493929190614969565b60405180910390a3505092915050565b60608101516040820151608083015151600092919083906001600160401b03811115612dc657612dc6613e2d565b604051908082528060200260200182016040528015612def578160200160208202803683370190505b5060a086015190915060005b8251811015612e4e5786608001518181518110612e1a57612e1a614270565b602002602001015180519060200120838281518110612e3b57612e3b614270565b6020908102919091010152600101612dfb565b50604080517f1463f426c05aff2c1a7a0957a71c9898bc8b47142540538e79ee25ee911413508152875160208083019190915297880151918101919091528351870293870193909320606084015283518602938601939093206080830152805185029085012060a082015281518402919093012060c08301525060e0902090565b8060036000846004811115612ee657612ee66140ca565b6004811115612ef757612ef76140ca565b8152602081019190915260400160002080546001600160a01b0319166001600160a01b039283161790558116826004811115612f3557612f356140ca565b6040517f356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d90600090a35050565b6000818152600183016020526040812054801561304b576000612f86600183614226565b8554909150600090612f9a90600190614226565b9050818114612fff576000866000018281548110612fba57612fba614270565b9060005260206000200154905080876000018481548110612fdd57612fdd614270565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061301057613010614a50565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610766565b6000915050610766565b600081815260018301602052604081205461309c57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610766565b506000610766565b9055565b60006130b2825490565b9050610d69826130a4836001614213565b600061076683612344858561340d565b815481018181101561076657634e487b7160005260116020526024601cfd5b60008260600151511180156131105750816080015151826060015151145b801561312557508160a0015151826060015151145b801561313a57508160c0015151826060015151145b613165576000356001600160e01b0319166040516306b5667560e21b8152600401610920919061425b565b61316f8142614213565b826040015111156109335760405163ad89be9d60e01b815260040160405180910390fd5b600081815260208190526040812054908190036131c25750600090815260208190526040902060019081905590565b60008281526001602090815260408083208484529091528120906000825460ff1660048111156131f4576131f46140ca565b036132125760405163757a436360e01b815260040160405180910390fd5b505050600090815260208190526040902080546001019081905590565b6000806000613240878787876135e8565b9150915061324d816136d5565b5095945050505050565b6000610638610876565b6000610766826112ba565b6132758161388b565b1561093357815460ff19166002178255600080613291836138a5565b9150915083600101547fe134987599ae266ec90edeff1b26125b287dbb57b10822649432d1bb26537fba83836040516132cb929190614a66565b60405180910390a250505050565b6000610638610620565b6133236040518060e00160405280600081526020016000815260200160008152602001606081526020016060815260200160608152602001606081525090565b82518152602080840151604080840191909152600091830191909152830151516001600160401b0381111561335a5761335a613e2d565b604051908082528060200260200182016040528015613383578160200160208202803683370190505b5060608083019190915283015160808083019190915283015160a08083019190915283015160c082015260005b836040015151811015611569578281815181106133cf576133cf614270565b6020026020010151826060015182815181106133ed576133ed614270565b6001600160a01b03909216602092830291909101909101526001016133b0565b600082548281101561342c57634e487b7160005260116020526024601cfd5b9190910392915050565b60048301548110156134e95782600801600084600401838154811061345d5761345d614270565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff1916905560048401805460078601929190849081106134a6576134a6614270565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff19168155600181810183905560029091019190915501613436565b5060005b60058301548110156135a05782600801600084600501838154811061351457613514614270565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff19169055600584018054600786019291908490811061355d5761355d614270565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff191681556001818101839055600290910191909155016134ed565b50815460ff1916825560006001830181905560028301819055600383018190556135ce906004840190613b03565b6135dc600583016000613b03565b60006006830155919050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561361f57506000905060036136cc565b8460ff16601b1415801561363757508460ff16601c14155b1561364857506000905060046136cc565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561369c573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166136c5576000600192509250506136cc565b9150600090505b94509492505050565b60008160048111156136e9576136e96140ca565b036136f15750565b6001816004811115613705576137056140ca565b036137525760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610920565b6002816004811115613766576137666140ca565b036137b35760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610920565b60038160048111156137c7576137c76140ca565b0361381f5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610920565b6004816004811115613833576138336140ca565b036112b75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610920565b600081602001516000148061076657505060200151461490565b6060806138b18361388b565b6138ef57602083015160405163092048d160e11b81526000356001600160e01b03191660048201526024810191909152466044820152606401610920565b8260600151516001600160401b0381111561390c5761390c613e2d565b604051908082528060200260200182016040528015613935578160200160208202803683370190505b5091508260600151516001600160401b0381111561395557613955613e2d565b60405190808252806020026020018201604052801561398857816020015b60608152602001906001900390816139735790505b50905060005b836060015151811015613afd578360c0015181815181106139b1576139b1614270565b60200260200101515a116139e4576139c8846126df565b6040516307aec4ab60e21b815260040161092091815260200190565b836060015181815181106139fa576139fa614270565b60200260200101516001600160a01b031684608001518281518110613a2157613a21614270565b60200260200101518560c001518381518110613a3f57613a3f614270565b6020026020010151908660a001518481518110613a5e57613a5e614270565b6020026020010151604051613a7391906146d5565b600060405180830381858888f193505050503d8060008114613ab1576040519150601f19603f3d011682016040523d82523d6000602084013e613ab6565b606091505b50848381518110613ac957613ac9614270565b60200260200101848481518110613ae257613ae2614270565b6020908102919091010191909152901515905260010161398e565b50915091565b50805460008255906000526020600020908101906112b791905b80821115613b315760008155600101613b1d565b5090565b60008083601f840112613b4757600080fd5b5081356001600160401b03811115613b5e57600080fd5b6020830191508360208260051b8501011115610b2757600080fd5b60008060008060008060608789031215613b9257600080fd5b86356001600160401b0380821115613ba957600080fd5b613bb58a838b01613b35565b90985096506020890135915080821115613bce57600080fd5b613bda8a838b01613b35565b90965094506040890135915080821115613bf357600080fd5b50613c0089828a01613b35565b979a9699509497509295939492505050565b60008151808452602080850194506020840160005b83811015613c45578151151587529582019590820190600101613c27565b509495945050505050565b6020815260006107216020830184613c12565b60008060208385031215613c7657600080fd5b82356001600160401b03811115613c8c57600080fd5b613c9885828601613b35565b90969095509350505050565b60008151808452602080850194506020840160005b83811015613c455781516001600160a01b031687529582019590820190600101613cb9565b6020815260006107216020830184613ca4565b600060208284031215613d0357600080fd5b5035919050565b60008083601f840112613d1c57600080fd5b5081356001600160401b03811115613d3357600080fd5b602083019150836020606083028501011115610b2757600080fd5b600080600080600060608688031215613d6657600080fd5b85356001600160401b0380821115613d7d57600080fd5b9087019060e0828a031215613d9157600080fd5b90955060208701359080821115613da757600080fd5b613db389838a01613b35565b90965094506040880135915080821115613dcc57600080fd5b50613dd988828901613d0a565b969995985093965092949392505050565b600080600080600060608688031215613e0257600080fd5b85356001600160401b0380821115613e1957600080fd5b9087019060c0828a031215613d9157600080fd5b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b0381118282101715613e6557613e65613e2d565b60405290565b60405160c081016001600160401b0381118282101715613e6557613e65613e2d565b604051601f8201601f191681016001600160401b0381118282101715613eb557613eb5613e2d565b604052919050565b60006001600160401b03821115613ed657613ed6613e2d565b5060051b60200190565b600082601f830112613ef157600080fd5b81356020613f06613f0183613ebd565b613e8d565b80838252602082019150600560208560051b880101945087851115613f2a57600080fd5b602087015b85811015613f53578035828110613f465760008081fd5b8452928401928401613f2f565b5090979650505050505050565b80356001600160a01b0381168114610d6957600080fd5b600082601f830112613f8857600080fd5b81356020613f98613f0183613ebd565b8083825260208201915060208460051b870101935086841115613fba57600080fd5b602086015b84811015613fdd57613fd081613f60565b8352918301918301613fbf565b509695505050505050565b60008060408385031215613ffb57600080fd5b82356001600160401b038082111561401257600080fd5b61401e86838701613ee0565b9350602085013591508082111561403457600080fd5b5061404185828601613f77565b9150509250929050565b803560108110610d6957600080fd5b6000806040838503121561406d57600080fd5b6140768361404b565b915061408460208401613f60565b90509250929050565b60006020828403121561409f57600080fd5b61072182613f60565b600080604083850312156140bb57600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b600581106112b7576112b76140ca565b60a081016140fd876140e0565b95815260208101949094526040840192909252606083015260809091015290565b60006020828403121561413057600080fd5b81356001600160401b0381111561414657600080fd5b6106ba84828501613f77565b60008151808452602080850194506020840160005b83811015613c455781516001600160601b031687529582019590820190600101614167565b60608152600061419f6060830186613ca4565b82810360208401526141b18186613ca4565b905082810360408401526141c58185614152565b9695505050505050565b6020815260006107216020830184614152565b6000602082840312156141f457600080fd5b6107218261404b565b634e487b7160e01b600052601160045260246000fd5b80820180821115610766576107666141fd565b81810381811115610766576107666141fd565b60008261425657634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031991909116815260200190565b634e487b7160e01b600052603260045260246000fd5b8082028115828204841417610766576107666141fd565b60208101601083106142b1576142b16140ca565b91905290565b6040815260006142ca6040830185613ca4565b82810360208401526142dc8185613c12565b95945050505050565b6080815260006142f86080830187613c12565b828103602084015261430a8187614152565b9050828103604084015261431e8186613ca4565b905082810360608401526106158185613ca4565b6001600160e01b03198316815260408101600b8310614353576143536140ca565b8260208301529392505050565b600082601f83011261437157600080fd5b81356020614381613f0183613ebd565b8083825260208201915060208460051b8701019350868411156143a357600080fd5b602086015b84811015613fdd57803583529183019183016143a8565b6000601f83601f8401126143d257600080fd5b823560206143e2613f0183613ebd565b82815260059290921b8501810191818101908784111561440157600080fd5b8287015b848110156144975780356001600160401b03808211156144255760008081fd5b818a0191508a603f83011261443a5760008081fd5b8582013560408282111561445057614450613e2d565b614461828b01601f19168901613e8d565b92508183528c818386010111156144785760008081fd5b8181850189850137506000908201870152845250918301918301614405565b50979650505050505050565b600060e082360312156144b557600080fd5b6144bd613e43565b82358152602083013560208201526040830135604082015260608301356001600160401b03808211156144ef57600080fd5b6144fb36838701613f77565b6060840152608085013591508082111561451457600080fd5b61452036838701614360565b608084015260a085013591508082111561453957600080fd5b614545368387016143bf565b60a084015260c085013591508082111561455e57600080fd5b5061456b36828601614360565b60c08301525092915050565b600060c0823603121561458957600080fd5b614591613e6b565b823581526020830135602082015260408301356001600160401b03808211156145b957600080fd5b6145c536838701613ee0565b604084015260608501359150808211156145de57600080fd5b6145ea36838701614360565b6060840152608085013591508082111561460357600080fd5b61460f368387016143bf565b608084015260a085013591508082111561462857600080fd5b5061463536828601614360565b60a08301525092915050565b60005b8381101561465c578181015183820152602001614644565b50506000910152565b6001600160e01b0319831681528151600090614688816004850160208701614641565b919091016004019392505050565b600081518084526146ae816020860160208601614641565b601f01601f19169290920160200192915050565b6020815260006107216020830184614696565b600082516146e7818460208701614641565b9190910192915050565b60008282518085526020808601955060208260051b8401016020860160005b84811015613f5357601f1986840301895261472c838351614696565b98840198925090830190600101614710565b6080815260006147516080830187614696565b82810360208401526147638187613ca4565b905082810360408401526147778186613c12565b9050828103606084015261061581856146f1565b60408152600061479e6040830185613c12565b82810360208401526142dc8185613ca4565b6001600160e01b03199290921682526001600160a01b0316602082015260400190565b6000602082840312156147e557600080fd5b8151801515811461072157600080fd5b60008151808452602080850194506020840160005b83811015613c455781518752958201959082019060010161480a565b600060e0830182518452602080840151602086015260408401516040860152606084015160e0606087015282815180855261010088019150602083019450600092505b808310156148925784516001600160a01b03168252938301936001929092019190830190614869565b506080860151935086810360808801526148ac81856147f5565b935050505060a083015184820360a08601526148c882826146f1565b91505060c083015184820360c08601526142dc82826147f5565b6040815260006148f56040830185614826565b905060018060a01b03831660208301529392505050565b60006020828403121561491e57600080fd5b81356002811061072157600080fd5b60006020828403121561493f57600080fd5b813560ff8116811461072157600080fd5b600060018201614962576149626141fd565b5060010190565b60808152600061497c6080830187614826565b60208681850152838203604085015260c08201865183528187015182840152604087015160c0604085015281815180845260e0860191508483019350600092505b808310156149e65783516149d0816140e0565b82529284019260019290920191908401906149bd565b50606089015193508481036060860152614a0081856147f5565b935050505060808601518282036080840152614a1c82826146f1565b91505060a086015182820360a0840152614a3682826147f5565b93505050506142dc60608301846001600160a01b03169052565b634e487b7160e01b600052603160045260246000fd5b604081526000614a796040830185613c12565b82810360208401526142dc81856146f156fe5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd976240ac1ff16a4f04f2a37a9ba5252a69baa100b460e517d1f8019c054a5ad698f9ffc55405a488814eaa0e2a685a0131142785b8d033d311c8c8244e34a7c12ca40f88547008e60f5748911f2e59feb3093b7e4c2e87b2dd69d61f112fcc932de8e38400683eb2cb350596d73644c0c89fe45f108600003457374f4ab3e87b4f3aa3d38c234075fde25875da8a6b7e36b58b86681d483271a99eeeee1d78e258a24d6924fe71b0c8b61aea02ca498b5f53b29bd95726278b1fe4eb791bb24a42644ca2646970667358221220cb0e92b2033c9131bafd8c90a491e8241ace110667169406b1c1a69bc857723964736f6c634300081700335da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd976240c55405a488814eaa0e2a685a0131142785b8d033d311c8c8244e34a7c12ca40f92872d32822c9d44b36a2537d3e0d4c46fc4de1ce154ccfaed560a8a58445f1d", - "chainId": 11155111, - "contractAbsolutePath": "MainchainBridgeManager.sol", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101fb5760003560e01c80639b19dbfd1161011a578063cc7e6b3b116100ad578063de981f1b1161007c578063de981f1b1461050c578063e75235b814610537578063e9c034981461053f578063f80b535214610552578063fdc4fa471461055a57600080fd5b8063cc7e6b3b146104be578063d0a50db0146104de578063d78392f8146104e6578063dafae408146104f957600080fd5b8063b9c36209116100e9578063b9c3620914610464578063bc9182fd1461048c578063bc96180b1461049f578063c441c4a8146104a757600080fd5b80639b19dbfd146103db5780639b2ee437146103e3578063b384abef146103f6578063b405aaf21461045157600080fd5b80633644e515116101925780637de5dedd116101615780637de5dedd14610332578063800eaab31461033a578063865e6fd31461034d578063901979d51461036057600080fd5b80633644e515146102c05780635e05cf9e146102e7578063776fb1ec146102fc5780637d465f791461031f57600080fd5b80631f425338116101ce5780631f425338146102675780632d6d7d731461027a57806334d5f37b1461028d57806335da8121146102ad57600080fd5b806301a5f43f1461020057806306aba0e1146102295780630a44fa431461023f5780630f7c318914610252575b600080fd5b61021361020e366004613b79565b61056d565b6040516102209190613c50565b60405180910390f35b610231610620565b604051908152602001610220565b61023161024d366004613c63565b61063d565b61025a6106c2565b6040516102209190613cde565b610213610275366004613c63565b6106db565b61025a610288366004613c63565b610728565b61023161029b366004613cf1565b60006020819052908152604090205481565b6102136102bb366004613c63565b61076c565b6102317f000000000000000000000000000000000000000000000000000000000000000081565b6102fa6102f5366004613d4e565b6107b2565b005b61030f61030a366004613cf1565b6107f1565b6040519015158152602001610220565b6102fa61032d366004613dea565b61083e565b610231610876565b6102fa610348366004613fe8565b6108f2565b6102fa61035b36600461405a565b610937565b6103c361036e36600461408d565b6001600160a01b039081166000908152600080516020614b0c83398151915260209081526040808320549093168252600080516020614aec83398151915290522054600160a01b90046001600160601b031690565b6040516001600160601b039091168152602001610220565b61025a610952565b6102fa6103f136600461408d565b61095c565b6104406104043660046140a8565b600160208181526000938452604080852090915291835291208054918101546002820154600383015460069093015460ff909416939192909185565b6040516102209594939291906140f0565b61030f61045f36600461408d565b610af3565b6104776104723660046140a8565b610b0d565b60408051928352602083019190915201610220565b61025a61049a36600461411e565b610b2e565b610231610c1f565b6104af610c2a565b6040516102209392919061418c565b6104d16104cc366004613c63565b610c54565b60405161022091906141cf565b610231610c92565b6103c36104f436600461408d565b610cab565b61030f610507366004613cf1565b610cb6565b61051f61051a3660046141e2565b610cf3565b6040516001600160a01b039091168152602001610220565b610477610d6e565b61021361054d366004613c63565b610d9f565b61025a610de5565b61025a610568366004613c63565b610def565b6060610577610ed6565b61061587878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82529093508a92508991829185019084908082843760009201919091525050604080516020808a02828101820190935289825290935089925088918291850190849080828437600092019190915250610f0692505050565b979650505050505050565b6000610638600080516020614b4c8339815191525490565b905090565b600082828080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061067e92508391506112829050565b6106ba8484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506112ba92505050565b949350505050565b6060610638600080516020614a8c83398151915261133e565b60606106e5610ed6565b61072183838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061134b92505050565b9392505050565b606061072183838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250611416915050565b92915050565b6060610776610ed6565b61072183838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061157092505050565b6107bb33611662565b6107ea85858585857f0000000000000000000000000000000000000000000000000000000000000000336116a4565b5050505050565b60008060008381527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff166004811115610836576108366140ca565b141592915050565b61084733611662565b6107ea85858585857f000000000000000000000000000000000000000000000000000000000000000033611749565b600061088e600080516020614aac8339815191525490565b60016108a6600080516020614aac8339815191525490565b6108d46108bf600080516020614b4c8339815191525490565b600080516020614acc833981519152906117a5565b6108de9190614213565b6108e89190614226565b6106389190614239565b333014610929576000356001600160e01b0319166040516307337e1960e41b8152600401610920919061425b565b60405180910390fd5b61093382826117d0565b5050565b61093f610ed6565b6109488161187e565b61093382826118b4565b6060610638611958565b61096533611662565b61096e81611971565b336000908152600080516020614aec83398151915260208190526040909120546001600160a01b0390811690831681036109c657604051630669b93360e31b81526001600160a01b0384166004820152602401610920565b600080516020614b2c83398151915260006109e182846119a6565b80156109f257506109f282866119bb565b905080610a1d5760405163080fab4b60e31b81526001600160a01b0386166004820152602401610920565b6001600160a01b038381166000818152600080516020614b0c8339815191526020818152604080842080546001600160a01b0319908116909155958b16808552818520805488163390811790915585528a8352938190208054909616841790955584519081019390935292820152610ab0906364b18d0960e11b906060015b6040516020818303038152906040526119d0565b6040516001600160a01b03808816919086169033907fcef34cd748f30a1b7a2f214fd1651779f79bc6c1be02785cad5c1f0ee877213d90600090a4505050505050565b6000610766600080516020614b2c83398151915283611cd8565b600080610b18610ed6565b610b228484611cfa565b915091505b9250929050565b8051606090806001600160401b03811115610b4b57610b4b613e2d565b604051908082528060200260200182016040528015610b74578160200160208202803683370190505b509150600080516020614aec83398151915260005b82811015610c1757816000868381518110610ba657610ba6614270565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060000160009054906101000a90046001600160a01b0316848281518110610bf757610bf7614270565b6001600160a01b0390921660209283029190910190910152600101610b89565b505050919050565b600061063860025490565b6060806060610c37611def565b9250610c4283610b2e565b9150610c4d83611e1a565b9050909192565b6060610721838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611e1a92505050565b6000610638600080516020614b2c833981519152611f03565b600061076682611f0d565b6000610cd16108bf600080516020614b4c8339815191525490565b600080516020614aac83398151915254610ceb9084614286565b101592915050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115610d2a57610d2a6140ca565b60ff1681526020810191909152604001600020546001600160a01b0316905080610d69578160405163409140df60e11b8152600401610920919061429d565b919050565b600080610d87600080516020614acc8339815191525490565b600080516020614aac83398151915254915091509091565b6060610da9610ed6565b610721838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611f4592505050565b6060610638611def565b606081806001600160401b03811115610e0a57610e0a613e2d565b604051908082528060200260200182016040528015610e33578160200160208202803683370190505b509150600080516020614b0c83398151915260005b82811015610ecd57816000878784818110610e6557610e65614270565b9050602002016020810190610e7a919061408d565b6001600160a01b0390811682526020820192909252604001600020548551911690859083908110610ead57610ead614270565b6001600160a01b0390921660209283029190910190910152600101610e48565b50505092915050565b333014610f04576000356001600160e01b0319166040516307337e1960e41b8152600401610920919061425b565b565b6060610f12838361222a565b610f1b81611282565b8251855181148015610f2d5750845181145b610f58576000356001600160e01b0319166040516306b5667560e21b8152600401610920919061425b565b806001600160401b03811115610f7057610f70613e2d565b604051908082528060200260200182016040528015610f99578160200160208202803683370190505b50925080600003610faa575061127a565b604080518082019091526000808252602082018190527f546f6b46ab35b030b6816596b352aef78857377176c8b24baa2046a62cf1998c91600080516020614b0c83398151915291600080516020614b2c83398151915291600080516020614aec833981519152919081908190815b898110156111fb578d818151811061103357611033614270565b602002602001015194508c818151811061104f5761104f614270565b6020026020010151935061106285611971565b61106b84611971565b8e818151811061107d5761107d614270565b60200260200101516001600160601b03166000036110bc576000356001600160e01b031916604051637f11b8a360e11b8152600401610920919061425b565b6110c68986611cd8565b806110d657506110d68985611cd8565b806110e657506110e68786611cd8565b806110f657506110f68785611cd8565b158c828151811061110957611109614270565b6020026020010190151590811515815250508b818151811061112d5761112d614270565b6020026020010151156111f35761114489866119bb565b5061114f87856119bb565b506001600160a01b03848116600081815260208b90526040902080546001600160a01b0319169288169290921790915582528e518f908290811061119557611195614270565b6020908102919091018101516001600160601b03169083018190526111ba9084614213565b6001600160a01b038087166000908152602089815260409091208551918601516001600160601b0316600160a01b029190921617905592505b600101611019565b50611214600080516020614b4c83398151915283612334565b50611233635ebae8a060e01b8d8d604051602001610a9c9291906142b7565b7f897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b788b8f8f8f60405161126894939291906142e5565b60405180910390a15050505050505050505b509392505050565b61128b8161234b565b156112b7576000356001600160e01b031916604051630d697db160e11b8152600401610920919061425b565b50565b6000816112c681611282565b600080516020614aec83398151915260005b8451811015610c17578160008683815181106112f6576112f6614270565b6020908102919091018101516001600160a01b031682528101919091526040016000205461133490600160a01b90046001600160601b031685614213565b93506001016112d8565b60606000610721836123ea565b60608161135781611282565b8251806001600160401b0381111561137157611371613e2d565b60405190808252806020026020018201604052801561139a578160200160208202803683370190505b509250600080516020614a8c83398151915260005b8281101561140d576113e38682815181106113cc576113cc614270565b6020026020010151836119a690919063ffffffff16565b8582815181106113f5576113f5614270565b911515602092830291909101909101526001016113af565b50505050919050565b606082516001600160401b0381111561143157611431613e2d565b60405190808252806020026020018201604052801561145a578160200160208202803683370190505b50905060005b8351811015611569576003600085838151811061147f5761147f614270565b60200260200101516004811115611498576114986140ca565b60048111156114a9576114a96140ca565b815260200190815260200160002060009054906101000a90046001600160a01b03168282815181106114dd576114dd614270565b60200260200101906001600160a01b031690816001600160a01b031681525050828015611535575060006001600160a01b031682828151811061152257611522614270565b60200260200101516001600160a01b0316145b15611561576000356001600160e01b03191660405163053265f160e01b8152600401610920919061425b565b600101611460565b5092915050565b60608161157c81611282565b8251806001600160401b0381111561159657611596613e2d565b6040519080825280602002602001820160405280156115bf578160200160208202803683370190505b509250806000036115d0575061165c565b600080516020614a8c83398151915260006314d72edb60e21b815b848110156116565787818151811061160557611605614270565b602002602001015192506116188361187e565b6116228383612446565b61162c84846119bb565b87828151811061163e5761163e614270565b911515602092830291909101909101526001016115eb565b50505050505b50919050565b61166b81611f0d565b6001600160601b03166000036112b7576000356001600160e01b0319166003604051620f948f60ea1b8152600401610920929190614332565b6116b66116b0886144a3565b826125d9565b5060006116ca6116c5896144a3565b6126df565b905061173f6116d8896144a3565b8888888861172b896116eb89600061281e565b60405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b61173a8a6116eb8a600161281e565b612857565b5050505050505050565b600061175d61175789614577565b83612c4e565b9050600061177261176d8a614577565b612d98565b905061179a828989898961178b8a6116eb89600061281e565b61173a8b6116eb8a600161281e565b505050505050505050565b600082548015611569578281029150808204831461156957634e487b7160005260116020526024601cfd5b60005b825181101561187957306001600160a01b03168282815181106117f8576117f8614270565b60200260200101516001600160a01b031603611835576000356001600160e01b03191660405163053265f160e01b8152600401610920919061425b565b61187183828151811061184a5761184a614270565b602002602001015183838151811061186457611864614270565b6020026020010151612ecf565b6001016117d3565b505050565b806001600160a01b03163b6000036112b757604051630bfc64a360e21b81526001600160a01b0382166004820152602401610920565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f8111156118ea576118ea6140ca565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f81111561192b5761192b6140ca565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b6060610638600080516020614b2c83398151915261133e565b6001600160a01b0381166112b7576000356001600160e01b03191660405163104c66df60e31b8152600401610920919061425b565b6000610721836001600160a01b038416612f62565b6000610721836001600160a01b038416613055565b60006119e9600080516020614a8c83398151915261133e565b805190915060008190036119fd5750505050565b6000816001600160401b03811115611a1757611a17613e2d565b604051908082528060200260200182016040528015611a40578160200160208202803683370190505b5090506000826001600160401b03811115611a5d57611a5d613e2d565b604051908082528060200260200182016040528015611a9057816020015b6060815260200190600190039081611a7b5790505b50905060008686604051602001611aa8929190614665565b6040516020818303038152906040529050600081604051602401611acc91906146c2565b60408051601f198184030181529190526020810180516001600160e01b03166325da93a560e11b179052905060005b85811015611c9057868181518110611b1557611b15614270565b60200260200101516001600160a01b031683604051611b3491906146d5565b6000604051808303816000865af19150503d8060008114611b71576040519150601f19603f3d011682016040523d82523d6000602084013e611b76565b606091505b50868381518110611b8957611b89614270565b60200260200101868481518110611ba257611ba2614270565b6020026020010182905282151515158152505050848181518110611bc857611bc8614270565b6020026020010151611c8857868181518110611be657611be6614270565b60200260200101516001600160a01b031682604051611c0591906146d5565b6000604051808303816000865af19150503d8060008114611c42576040519150601f19603f3d011682016040523d82523d6000602084013e611c47565b606091505b50868381518110611c5a57611c5a614270565b60200260200101868481518110611c7357611c73614270565b60200260200101829052821515151581525050505b600101611afb565b507fc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b6382878686604051611cc6949392919061473e565b60405180910390a15050505050505050565b6001600160a01b03811660009081526001830160205260408120541515610721565b60008082841115611d2c576000356001600160e01b0319166040516387f6f09560e01b8152600401610920919061425b565b600080516020614acc833981519152549150611d54600080516020614aac8339815191525490565b9050611d6d600080516020614acc833981519152859055565b611d84600080516020614aac833981519152849055565b8284611daf7f92872d32822c9d44b36a2537d3e0d4c46fc4de1ce154ccfaed560a8a58445f1d6130a8565b60408051868152602081018690527f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a49250929050565b60606106387f546f6b46ab35b030b6816596b352aef78857377176c8b24baa2046a62cf1998c61133e565b8051606090806001600160401b03811115611e3757611e37613e2d565b604051908082528060200260200182016040528015611e60578160200160208202803683370190505b509150600080516020614aec83398151915260005b82811015610c1757816000868381518110611e9257611e92614270565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060000160149054906101000a90046001600160601b0316848281518110611ee357611ee3614270565b6001600160601b0390921660209283029190910190910152600101611e75565b6000610766825490565b6001600160a01b03166000908152600080516020614aec8339815191526020526040902054600160a01b90046001600160601b031690565b606081611f5181611282565b8251806001600160401b03811115611f6b57611f6b613e2d565b604051908082528060200260200182016040528015611f94578160200160208202803683370190505b50925080600003611fa5575061165c565b60408051808201909152600080825260208201819052600080516020614b0c833981519152917f546f6b46ab35b030b6816596b352aef78857377176c8b24baa2046a62cf1998c91600080516020614b2c83398151915291600080516020614aec833981519152919081908190815b898110156121aa578c818151811061202e5761202e614270565b6020908102919091018101516001600160a01b038082166000908152928c90526040909220549091169550935061206485611971565b61206d84611971565b6001600160a01b0385811660009081526020888152604091829020825180840190935254808416808452600160a01b9091046001600160601b031691830191909152909350908516146120e1576000356001600160e01b03191660405163053265f160e01b8152600401610920919061425b565b6120eb8785611cd8565b80156120fc57506120fc8886611cd8565b8c828151811061210e5761210e614270565b6020026020010190151590811515815250508b818151811061213257612132614270565b6020026020010151156121a25761214988866119a6565b5061215487856119a6565b506001600160a01b03808516600090815260208b8152604080832080546001600160a01b031916905592881682528881529181205582015161219f906001600160601b031684614213565b92505b600101612014565b506121c3600080516020614b4c833981519152836130c3565b506121e263c48549de60e01b8d8d604051602001610a9c9291906142b7565b7fdf3dcd7987202f64648f3acdbf12401e3a2bb23e77e19f99826b5475cbb863698b8d60405161221392919061478b565b60405180910390a150505050505050505050919050565b81518151606091908082016001600160401b0381111561224c5761224c613e2d565b604051908082528060200260200182016040528015612275578160200160208202803683370190505b50925060005b828110156122cf5785818151811061229557612295614270565b60200260200101518482815181106122af576122af614270565b6001600160a01b039092166020928302919091019091015260010161227b565b60005b8281101561232a578581815181106122ec576122ec614270565b602002602001015185838151811061230657612306614270565b6001600160a01b0390921660209283029190910190910152600191820191016122d2565b5050505092915050565b60006107668361234485856130d3565b9250829055565b6000815160000361235e57506000919050565b60005b60018351038110156123e157600181015b83518110156123d85783818151811061238d5761238d614270565b60200260200101516001600160a01b03168483815181106123b0576123b0614270565b60200260200101516001600160a01b0316036123d0575060019392505050565b600101612372565b50600101612361565b50600092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561243a57602002820191906000526020600020905b815481526020019060010190808311612426575b50505050509050919050565b600081604051602401612459919061425b565b60408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b1790525190915060009081906001600160a01b038616906124a29085906146d5565b600060405180830381855afa9150503d80600081146124dd576040519150601f19603f3d011682016040523d82523d6000602084013e6124e2565b606091505b5091509150816125a457846001600160a01b03168360405160240161250791906146c2565b60408051601f198184030181529181526020820180516001600160e01b03166325da93a560e11b1790525161253c91906146d5565b600060405180830381855afa9150503d8060008114612577576040519150601f19603f3d011682016040523d82523d6000602084013e61257c565b606091505b509092509050816125a457838560405163069d427960e11b81526004016109209291906147b0565b808060200190518101906125b891906147d3565b6107ea57838560405163069d427960e11b81526004016109209291906147b0565b602082015160009080820361261b5760405163092048d160e11b8152600080356001600160e01b03191660048301526024820152466044820152606401610920565b6002546126299085906130f2565b6000612634856126df565b905061263f82613193565b6000838152600160208181526040808420858552909152918290209188015190820184905560069091015592508451831461269b576000356001600160e01b03191660405163d4cec26960e01b8152600401610920919061425b565b8083837fa57d40f1496988cf60ab7c9d5ba4ff83647f67d3898d441a3aaf21b651678fd988886040516126cf9291906148e2565b60405180910390a4505092915050565b6080810151606082015160a083015151600092919083906001600160401b0381111561270d5761270d613e2d565b604051908082528060200260200182016040528015612736578160200160208202803683370190505b5060c086015190915060005b8251811015612795578660a00151818151811061276157612761614270565b60200260200101518051906020012083828151811061278257612782614270565b6020908102919091010152600101612742565b50604080517fd051578048e6ff0bbc9fca3b65a42088dbde10f36ca841de566711087ad9b08a8152875160208083019190915280890151828401529790910151606082015283518702938701939093206080840152835186029386019390932060a0830152805185029085012060c082015281518402919093012060e083015250610100902090565b604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b841580159061286557508483145b612890576000356001600160e01b0319166040516306b5667560e21b8152600401610920919061425b565b60008080856001600160401b038111156128ac576128ac613e2d565b6040519080825280602002602001820160405280156128d5578160200160208202803683370190505b5090506000866001600160401b038111156128f2576128f2613e2d565b60405190808252806020026020018201604052801561291b578160200160208202803683370190505b50905060008060003660005b8b811015612aac578c8c8281811061294157612941614270565b90506060020191508e8e8281811061295b5761295b614270565b9050602002016020810190612970919061490c565b92506000836001811115612986576129866140ca565b036129f0576129ab8b61299c602085018561492d565b8460200135856040013561322f565b945084878a6129b981614950565b9b50815181106129cb576129cb614270565b60200260200101906001600160a01b031690816001600160a01b031681525050612a61565b6001836001811115612a0457612a046140ca565b03612a3a57612a1a8a61299c602085018561492d565b9450848689612a2881614950565b9a50815181106129cb576129cb614270565b6000356001600160e01b031916604051630612418f60e11b8152600401610920919061425b565b846001600160a01b0316846001600160a01b031610612aa1576000356001600160e01b031916604051635d3dcd3160e01b8152600401610920919061425b565b849350600101612927565b50505085845250508281526020808c015160009081526001825260408082208e51835290925290812090612ade613257565b90506000612aeb85613261565b9050818110612b725780600003612b23576000356001600160e01b031916604051637f11b8a360e11b8152600401610920919061425b565b825460ff1916600190811784558301546040517f5c819725ea53655a3b898f3df59b66489761935454e9212ca1e5ebd759953d0b90600090a2612b66838f61326c565b50505050505050612c45565b600082612b7d6132d9565b612b879190614226565b612b92906001614213565b90506000612b9f86613261565b9050818110612c1e5780600003612bd7576000356001600160e01b031916604051637f11b8a360e11b8152600401610920919061425b565b845460ff1916600317855560018501546040517f55295d4ce992922fa2e5ffbf3a3dcdb367de0a15e125ace083456017fd22060f90600090a2505050505050505050612c45565b6000356001600160e01b031916604051634ccfe64360e11b8152600401610920919061425b565b50505050505050565b612c8e6040518060e00160405280600081526020016000815260200160008152602001606081526020016060815260200160608152602001606081525090565b612ca7612ca084604001516001611416565b84906132e3565b9050612cbe600254826130f290919063ffffffff16565b6000612cc9826126df565b90506000612cd76000613193565b60008181527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602090815260409091209087015160018201859055600690910155905082518114612d49576000356001600160e01b03191660405163d4cec26960e01b8152600401610920919061425b565b81817f771d78ae9e5fca95a532fb0971d575d0ce9b59d14823c063e08740137e0e0eca85612d7689612d98565b8989604051612d889493929190614969565b60405180910390a3505092915050565b60608101516040820151608083015151600092919083906001600160401b03811115612dc657612dc6613e2d565b604051908082528060200260200182016040528015612def578160200160208202803683370190505b5060a086015190915060005b8251811015612e4e5786608001518181518110612e1a57612e1a614270565b602002602001015180519060200120838281518110612e3b57612e3b614270565b6020908102919091010152600101612dfb565b50604080517f1463f426c05aff2c1a7a0957a71c9898bc8b47142540538e79ee25ee911413508152875160208083019190915297880151918101919091528351870293870193909320606084015283518602938601939093206080830152805185029085012060a082015281518402919093012060c08301525060e0902090565b8060036000846004811115612ee657612ee66140ca565b6004811115612ef757612ef76140ca565b8152602081019190915260400160002080546001600160a01b0319166001600160a01b039283161790558116826004811115612f3557612f356140ca565b6040517f356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d90600090a35050565b6000818152600183016020526040812054801561304b576000612f86600183614226565b8554909150600090612f9a90600190614226565b9050818114612fff576000866000018281548110612fba57612fba614270565b9060005260206000200154905080876000018481548110612fdd57612fdd614270565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061301057613010614a50565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610766565b6000915050610766565b600081815260018301602052604081205461309c57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610766565b506000610766565b9055565b60006130b2825490565b9050610d69826130a4836001614213565b600061076683612344858561340d565b815481018181101561076657634e487b7160005260116020526024601cfd5b60008260600151511180156131105750816080015151826060015151145b801561312557508160a0015151826060015151145b801561313a57508160c0015151826060015151145b613165576000356001600160e01b0319166040516306b5667560e21b8152600401610920919061425b565b61316f8142614213565b826040015111156109335760405163ad89be9d60e01b815260040160405180910390fd5b600081815260208190526040812054908190036131c25750600090815260208190526040902060019081905590565b60008281526001602090815260408083208484529091528120906000825460ff1660048111156131f4576131f46140ca565b036132125760405163757a436360e01b815260040160405180910390fd5b505050600090815260208190526040902080546001019081905590565b6000806000613240878787876135e8565b9150915061324d816136d5565b5095945050505050565b6000610638610876565b6000610766826112ba565b6132758161388b565b1561093357815460ff19166002178255600080613291836138a5565b9150915083600101547fe134987599ae266ec90edeff1b26125b287dbb57b10822649432d1bb26537fba83836040516132cb929190614a66565b60405180910390a250505050565b6000610638610620565b6133236040518060e00160405280600081526020016000815260200160008152602001606081526020016060815260200160608152602001606081525090565b82518152602080840151604080840191909152600091830191909152830151516001600160401b0381111561335a5761335a613e2d565b604051908082528060200260200182016040528015613383578160200160208202803683370190505b5060608083019190915283015160808083019190915283015160a08083019190915283015160c082015260005b836040015151811015611569578281815181106133cf576133cf614270565b6020026020010151826060015182815181106133ed576133ed614270565b6001600160a01b03909216602092830291909101909101526001016133b0565b600082548281101561342c57634e487b7160005260116020526024601cfd5b9190910392915050565b60048301548110156134e95782600801600084600401838154811061345d5761345d614270565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff1916905560048401805460078601929190849081106134a6576134a6614270565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff19168155600181810183905560029091019190915501613436565b5060005b60058301548110156135a05782600801600084600501838154811061351457613514614270565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff19169055600584018054600786019291908490811061355d5761355d614270565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff191681556001818101839055600290910191909155016134ed565b50815460ff1916825560006001830181905560028301819055600383018190556135ce906004840190613b03565b6135dc600583016000613b03565b60006006830155919050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561361f57506000905060036136cc565b8460ff16601b1415801561363757508460ff16601c14155b1561364857506000905060046136cc565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561369c573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166136c5576000600192509250506136cc565b9150600090505b94509492505050565b60008160048111156136e9576136e96140ca565b036136f15750565b6001816004811115613705576137056140ca565b036137525760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610920565b6002816004811115613766576137666140ca565b036137b35760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610920565b60038160048111156137c7576137c76140ca565b0361381f5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610920565b6004816004811115613833576138336140ca565b036112b75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610920565b600081602001516000148061076657505060200151461490565b6060806138b18361388b565b6138ef57602083015160405163092048d160e11b81526000356001600160e01b03191660048201526024810191909152466044820152606401610920565b8260600151516001600160401b0381111561390c5761390c613e2d565b604051908082528060200260200182016040528015613935578160200160208202803683370190505b5091508260600151516001600160401b0381111561395557613955613e2d565b60405190808252806020026020018201604052801561398857816020015b60608152602001906001900390816139735790505b50905060005b836060015151811015613afd578360c0015181815181106139b1576139b1614270565b60200260200101515a116139e4576139c8846126df565b6040516307aec4ab60e21b815260040161092091815260200190565b836060015181815181106139fa576139fa614270565b60200260200101516001600160a01b031684608001518281518110613a2157613a21614270565b60200260200101518560c001518381518110613a3f57613a3f614270565b6020026020010151908660a001518481518110613a5e57613a5e614270565b6020026020010151604051613a7391906146d5565b600060405180830381858888f193505050503d8060008114613ab1576040519150601f19603f3d011682016040523d82523d6000602084013e613ab6565b606091505b50848381518110613ac957613ac9614270565b60200260200101848481518110613ae257613ae2614270565b6020908102919091010191909152901515905260010161398e565b50915091565b50805460008255906000526020600020908101906112b791905b80821115613b315760008155600101613b1d565b5090565b60008083601f840112613b4757600080fd5b5081356001600160401b03811115613b5e57600080fd5b6020830191508360208260051b8501011115610b2757600080fd5b60008060008060008060608789031215613b9257600080fd5b86356001600160401b0380821115613ba957600080fd5b613bb58a838b01613b35565b90985096506020890135915080821115613bce57600080fd5b613bda8a838b01613b35565b90965094506040890135915080821115613bf357600080fd5b50613c0089828a01613b35565b979a9699509497509295939492505050565b60008151808452602080850194506020840160005b83811015613c45578151151587529582019590820190600101613c27565b509495945050505050565b6020815260006107216020830184613c12565b60008060208385031215613c7657600080fd5b82356001600160401b03811115613c8c57600080fd5b613c9885828601613b35565b90969095509350505050565b60008151808452602080850194506020840160005b83811015613c455781516001600160a01b031687529582019590820190600101613cb9565b6020815260006107216020830184613ca4565b600060208284031215613d0357600080fd5b5035919050565b60008083601f840112613d1c57600080fd5b5081356001600160401b03811115613d3357600080fd5b602083019150836020606083028501011115610b2757600080fd5b600080600080600060608688031215613d6657600080fd5b85356001600160401b0380821115613d7d57600080fd5b9087019060e0828a031215613d9157600080fd5b90955060208701359080821115613da757600080fd5b613db389838a01613b35565b90965094506040880135915080821115613dcc57600080fd5b50613dd988828901613d0a565b969995985093965092949392505050565b600080600080600060608688031215613e0257600080fd5b85356001600160401b0380821115613e1957600080fd5b9087019060c0828a031215613d9157600080fd5b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b0381118282101715613e6557613e65613e2d565b60405290565b60405160c081016001600160401b0381118282101715613e6557613e65613e2d565b604051601f8201601f191681016001600160401b0381118282101715613eb557613eb5613e2d565b604052919050565b60006001600160401b03821115613ed657613ed6613e2d565b5060051b60200190565b600082601f830112613ef157600080fd5b81356020613f06613f0183613ebd565b613e8d565b80838252602082019150600560208560051b880101945087851115613f2a57600080fd5b602087015b85811015613f53578035828110613f465760008081fd5b8452928401928401613f2f565b5090979650505050505050565b80356001600160a01b0381168114610d6957600080fd5b600082601f830112613f8857600080fd5b81356020613f98613f0183613ebd565b8083825260208201915060208460051b870101935086841115613fba57600080fd5b602086015b84811015613fdd57613fd081613f60565b8352918301918301613fbf565b509695505050505050565b60008060408385031215613ffb57600080fd5b82356001600160401b038082111561401257600080fd5b61401e86838701613ee0565b9350602085013591508082111561403457600080fd5b5061404185828601613f77565b9150509250929050565b803560108110610d6957600080fd5b6000806040838503121561406d57600080fd5b6140768361404b565b915061408460208401613f60565b90509250929050565b60006020828403121561409f57600080fd5b61072182613f60565b600080604083850312156140bb57600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b600581106112b7576112b76140ca565b60a081016140fd876140e0565b95815260208101949094526040840192909252606083015260809091015290565b60006020828403121561413057600080fd5b81356001600160401b0381111561414657600080fd5b6106ba84828501613f77565b60008151808452602080850194506020840160005b83811015613c455781516001600160601b031687529582019590820190600101614167565b60608152600061419f6060830186613ca4565b82810360208401526141b18186613ca4565b905082810360408401526141c58185614152565b9695505050505050565b6020815260006107216020830184614152565b6000602082840312156141f457600080fd5b6107218261404b565b634e487b7160e01b600052601160045260246000fd5b80820180821115610766576107666141fd565b81810381811115610766576107666141fd565b60008261425657634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031991909116815260200190565b634e487b7160e01b600052603260045260246000fd5b8082028115828204841417610766576107666141fd565b60208101601083106142b1576142b16140ca565b91905290565b6040815260006142ca6040830185613ca4565b82810360208401526142dc8185613c12565b95945050505050565b6080815260006142f86080830187613c12565b828103602084015261430a8187614152565b9050828103604084015261431e8186613ca4565b905082810360608401526106158185613ca4565b6001600160e01b03198316815260408101600b8310614353576143536140ca565b8260208301529392505050565b600082601f83011261437157600080fd5b81356020614381613f0183613ebd565b8083825260208201915060208460051b8701019350868411156143a357600080fd5b602086015b84811015613fdd57803583529183019183016143a8565b6000601f83601f8401126143d257600080fd5b823560206143e2613f0183613ebd565b82815260059290921b8501810191818101908784111561440157600080fd5b8287015b848110156144975780356001600160401b03808211156144255760008081fd5b818a0191508a603f83011261443a5760008081fd5b8582013560408282111561445057614450613e2d565b614461828b01601f19168901613e8d565b92508183528c818386010111156144785760008081fd5b8181850189850137506000908201870152845250918301918301614405565b50979650505050505050565b600060e082360312156144b557600080fd5b6144bd613e43565b82358152602083013560208201526040830135604082015260608301356001600160401b03808211156144ef57600080fd5b6144fb36838701613f77565b6060840152608085013591508082111561451457600080fd5b61452036838701614360565b608084015260a085013591508082111561453957600080fd5b614545368387016143bf565b60a084015260c085013591508082111561455e57600080fd5b5061456b36828601614360565b60c08301525092915050565b600060c0823603121561458957600080fd5b614591613e6b565b823581526020830135602082015260408301356001600160401b03808211156145b957600080fd5b6145c536838701613ee0565b604084015260608501359150808211156145de57600080fd5b6145ea36838701614360565b6060840152608085013591508082111561460357600080fd5b61460f368387016143bf565b608084015260a085013591508082111561462857600080fd5b5061463536828601614360565b60a08301525092915050565b60005b8381101561465c578181015183820152602001614644565b50506000910152565b6001600160e01b0319831681528151600090614688816004850160208701614641565b919091016004019392505050565b600081518084526146ae816020860160208601614641565b601f01601f19169290920160200192915050565b6020815260006107216020830184614696565b600082516146e7818460208701614641565b9190910192915050565b60008282518085526020808601955060208260051b8401016020860160005b84811015613f5357601f1986840301895261472c838351614696565b98840198925090830190600101614710565b6080815260006147516080830187614696565b82810360208401526147638187613ca4565b905082810360408401526147778186613c12565b9050828103606084015261061581856146f1565b60408152600061479e6040830185613c12565b82810360208401526142dc8185613ca4565b6001600160e01b03199290921682526001600160a01b0316602082015260400190565b6000602082840312156147e557600080fd5b8151801515811461072157600080fd5b60008151808452602080850194506020840160005b83811015613c455781518752958201959082019060010161480a565b600060e0830182518452602080840151602086015260408401516040860152606084015160e0606087015282815180855261010088019150602083019450600092505b808310156148925784516001600160a01b03168252938301936001929092019190830190614869565b506080860151935086810360808801526148ac81856147f5565b935050505060a083015184820360a08601526148c882826146f1565b91505060c083015184820360c08601526142dc82826147f5565b6040815260006148f56040830185614826565b905060018060a01b03831660208301529392505050565b60006020828403121561491e57600080fd5b81356002811061072157600080fd5b60006020828403121561493f57600080fd5b813560ff8116811461072157600080fd5b600060018201614962576149626141fd565b5060010190565b60808152600061497c6080830187614826565b60208681850152838203604085015260c08201865183528187015182840152604087015160c0604085015281815180845260e0860191508483019350600092505b808310156149e65783516149d0816140e0565b82529284019260019290920191908401906149bd565b50606089015193508481036060860152614a0081856147f5565b935050505060808601518282036080840152614a1c82826146f1565b91505060a086015182820360a0840152614a3682826147f5565b93505050506142dc60608301846001600160a01b03169052565b634e487b7160e01b600052603160045260246000fd5b604081526000614a796040830185613c12565b82810360208401526142dc81856146f156fe5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd976240ac1ff16a4f04f2a37a9ba5252a69baa100b460e517d1f8019c054a5ad698f9ffc55405a488814eaa0e2a685a0131142785b8d033d311c8c8244e34a7c12ca40f88547008e60f5748911f2e59feb3093b7e4c2e87b2dd69d61f112fcc932de8e38400683eb2cb350596d73644c0c89fe45f108600003457374f4ab3e87b4f3aa3d38c234075fde25875da8a6b7e36b58b86681d483271a99eeeee1d78e258a24d6924fe71b0c8b61aea02ca498b5f53b29bd95726278b1fe4eb791bb24a42644ca2646970667358221220cb0e92b2033c9131bafd8c90a491e8241ace110667169406b1c1a69bc857723964736f6c63430008170033", - "deployer": "0x31762cdd4Aa65CD6f5F09D7a05a56211720A1168", - "devdoc": { - "version": 1, - "kind": "dev", - "methods": { - "addBridgeOperators(uint96[],address[],address[])": { - "details": "Adds multiple bridge operators.", - "params": { - "bridgeOperators": "An array of addresses representing the bridge operators to add.", - "governors": "An array of addresses of hot/cold wallets for bridge operator to update their node address." - }, - "returns": { - "addeds": "An array of booleans indicating whether each bridge operator was added successfully. Note: return boolean array `addeds` indicates whether a group (voteWeight, governor, operator) are recorded. It is expected that FE/BE staticcall to the function first to get the return values and handle it correctly. Governors are expected to see the outcome of this function and decide if they want to vote for the proposal or not. Example Usage: Making an `eth_call` in ethers.js ``` const {addeds} = await bridgeManagerContract.callStatic.addBridgeOperators( voteWeights, governors, bridgeOperators, // overriding the caller to the contract itself since we use `onlySelfCall` guard {from: bridgeManagerContract.address} ) const filteredOperators = bridgeOperators.filter((_, index) => addeds[index]); const filteredWeights = weights.filter((_, index) => addeds[index]); const filteredGovernors = governors.filter((_, index) => addeds[index]); // ... (Process or use the information as required) ... ```" - } - }, - "checkThreshold(uint256)": { - "details": "Checks whether the `_voteWeight` passes the threshold." - }, - "getBridgeOperatorOf(address[])": { - "details": "Returns an array of bridge operators correspoding to governor addresses.", - "returns": { - "bridgeOperators": "An array containing the addresses of all bridge operators." - } - }, - "getBridgeOperatorWeight(address)": { - "details": "External function to retrieve the vote weight of a specific bridge operator.", - "params": { - "bridgeOperator": "The address of the bridge operator to get the vote weight for." - }, - "returns": { - "weight": "The vote weight of the specified bridge operator." - } - }, - "getBridgeOperators()": { - "details": "Returns an array of all bridge operators.", - "returns": { - "_0": "An array containing the addresses of all bridge operators." - } - }, - "getCallbackRegisters()": { - "details": "Retrieves the addresses of registered callbacks.", - "returns": { - "registers": "An array containing the addresses of registered callbacks." - } - }, - "getContract(uint8)": { - "details": "Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.", - "params": { - "contractType": "The role of the contract to retrieve." - }, - "returns": { - "contract_": "The address of the contract with the specified role." - } - }, - "getFullBridgeOperatorInfos()": { - "details": "Retrieves the full information of all registered bridge operators. This external function allows external callers to obtain the full information of all the registered bridge operators. The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.", - "returns": { - "bridgeOperators": "An array of addresses representing the registered bridge operators.", - "governors": "An array of addresses representing the governors of each bridge operator.", - "weights": "An array of uint256 values representing the vote weights of each bridge operator. Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator. Example Usage: ``` (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos(); for (uint256 i = 0; i < bridgeOperators.length; i++) { // Access individual information for each bridge operator. address governor = governors[i]; address bridgeOperator = bridgeOperators[i]; uint256 weight = weights[i]; // ... (Process or use the information as required) ... } ```" - } - }, - "getGovernorWeight(address)": { - "details": "External function to retrieve the vote weight of a specific governor.", - "params": { - "governor": "The address of the governor to get the vote weight for." - }, - "returns": { - "weight": "voteWeight The vote weight of the specified governor." - } - }, - "getGovernorWeights(address[])": { - "details": "Returns the weights of a list of governor addresses." - }, - "getGovernors()": { - "details": "Returns an array of all governors.", - "returns": { - "_0": "An array containing the addresses of all governors." - } - }, - "getGovernorsOf(address[])": { - "details": "Retrieves the governors corresponding to a given array of bridge operators. This external function allows external callers to obtain the governors associated with a given array of bridge operators. The function takes an input array `bridgeOperators` containing bridge operator addresses and returns an array of corresponding governors.", - "params": { - "bridgeOperators": "An array of bridge operator addresses for which governors are to be retrieved." - }, - "returns": { - "governors": "An array of addresses representing the governors corresponding to the provided bridge operators." - } - }, - "getProposalExpiryDuration()": { - "details": "Returns the expiry duration for a new proposal." - }, - "getThreshold()": { - "details": "Returns the threshold." - }, - "getTotalWeight()": { - "details": "Returns total weights." - }, - "globalProposalRelayed(uint256)": { - "details": "Returns whether the voter `_voter` casted vote for the proposal." - }, - "isBridgeOperator(address)": { - "details": "Checks if the given address is a bridge operator.", - "params": { - "addr": "The address to check." - }, - "returns": { - "_0": "A boolean indicating whether the address is a bridge operator." - } - }, - "minimumVoteWeight()": { - "details": "Returns the minimum vote weight to pass the threshold." - }, - "registerCallbacks(address[])": { - "details": "Registers multiple callbacks with the bridge.", - "params": { - "registers": "The array of callback addresses to register." - }, - "returns": { - "registereds": "An array indicating the success status of each registration." - } - }, - "relayGlobalProposal((uint256,uint256,uint8[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])": { - "details": "See `GovernanceRelay-_relayGlobalProposal`. Requirements: - The method caller is governor." - }, - "relayProposal((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])": { - "details": "See `GovernanceRelay-_relayProposal`. Requirements: - The method caller is governor." - }, - "removeBridgeOperators(address[])": { - "details": "Removes multiple bridge operators.", - "params": { - "bridgeOperators": "An array of addresses representing the bridge operators to remove." - }, - "returns": { - "removeds": "An array of booleans indicating whether each bridge operator was removed successfully. * Note: return boolean array `removeds` indicates whether a group (voteWeight, governor, operator) are recorded. It is expected that FE/BE staticcall to the function first to get the return values and handle it correctly. Governors are expected to see the outcome of this function and decide if they want to vote for the proposal or not. Example Usage: Making an `eth_call` in ethers.js ``` const {removeds} = await bridgeManagerContract.callStatic.removeBridgeOperators( bridgeOperators, // overriding the caller to the contract itself since we use `onlySelfCall` guard {from: bridgeManagerContract.address} ) const filteredOperators = bridgeOperators.filter((_, index) => removeds[index]); // ... (Process or use the information as required) ... ```" - } - }, - "resolveTargets(uint8[])": { - "details": "Returns corresponding address of target options. Return address(0) on non-existent target." - }, - "setContract(uint8,address)": { - "details": "Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.", - "params": { - "addr": "The address of the contract to set.", - "contractType": "The role of the contract to set." - } - }, - "setThreshold(uint256,uint256)": { - "details": "Sets the threshold. Requirements: - The method caller is admin. Emits the `ThresholdUpdated` event." - }, - "sumGovernorsWeight(address[])": { - "details": "Returns total weights of the governor list." - }, - "totalBridgeOperator()": { - "details": "Returns the total number of bridge operators.", - "returns": { - "_0": "The total number of bridge operators." - } - }, - "unregisterCallbacks(address[])": { - "details": "Unregisters multiple callbacks from the bridge.", - "params": { - "registers": "The array of callback addresses to unregister." - }, - "returns": { - "unregistereds": "An array indicating the success status of each unregistration." - } - }, - "updateBridgeOperator(address)": { - "details": "Governor updates their corresponding governor and/or operator address. Requirements: - The caller must the governor of the operator that is requested changes.", - "params": { - "bridgeOperator": "The address of the bridge operator to update." - } - }, - "updateManyTargetOption(uint8[],address[])": { - "details": "Updates list of `targetOptions` to `targets`. Requirement: - Only allow self-call through proposal. " - } - }, - "events": { - "BridgeOperatorUpdated(address,address,address)": { - "details": "Emitted when a bridge operator is updated.", - "params": { - "fromBridgeOperator": "The address of the bridge operator being updated.", - "governor": "The address of the governor initiating the update.", - "toBridgeOperator": "The updated address of the bridge operator." - } - }, - "BridgeOperatorsAdded(bool[],uint96[],address[],address[])": { - "details": "Emitted when new bridge operators are added.", - "params": { - "bridgeOperators": "The array of addresses representing the added bridge operators.", - "governors": "The array of addresses representing the governors associated with the added bridge operators.", - "statuses": "The array of boolean values represents whether the corresponding bridge operator is added successfully.", - "voteWeights": "The array of vote weights assigned to the added bridge operators." - } - }, - "BridgeOperatorsRemoved(bool[],address[])": { - "details": "Emitted when bridge operators are removed.", - "params": { - "bridgeOperators": "The array of addresses representing the removed bridge operators.", - "statuses": "The array of boolean values representing the statuses of the removed bridge operators." - } - }, - "ContractUpdated(uint8,address)": { - "details": "Emitted when a contract is updated." - }, - "GlobalProposalCreated(uint256,bytes32,(uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),bytes32,(uint256,uint256,uint8[],uint256[],bytes[],uint256[]),address)": { - "details": "Emitted when a proposal is created" - }, - "Notified(bytes,address[],bool[],bytes[])": { - "details": "Emitted when the contract notifies multiple registers with statuses and return data." - }, - "ProposalApproved(bytes32)": { - "details": "Emitted when the proposal is approved" - }, - "ProposalCreated(uint256,uint256,bytes32,(uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),address)": { - "details": "Emitted when a proposal is created" - }, - "ProposalExecuted(bytes32,bool[],bytes[])": { - "details": "Emitted when the proposal is executed" - }, - "ProposalExpired(bytes32)": { - "details": "Emitted when the vote is expired" - }, - "ProposalExpiryDurationChanged(uint256)": { - "details": "Emitted when the proposal expiry duration is changed." - }, - "ProposalRejected(bytes32)": { - "details": "Emitted when the vote is reject" - }, - "ProposalVoted(bytes32,address,uint8,uint256)": { - "details": "Emitted when the proposal is voted" - }, - "TargetOptionUpdated(uint8,address)": { - "details": "Emitted when the target options are updated" - }, - "ThresholdUpdated(uint256,uint256,uint256,uint256,uint256)": { - "details": "Emitted when the threshold is updated" - } - }, - "errors": { - "ErrBridgeOperatorAlreadyExisted(address)": [ - { - "details": "Error thrown when attempting to add a bridge operator that already exists in the contract. This error indicates that the provided bridge operator address is already registered as a bridge operator in the contract." - } - ], - "ErrBridgeOperatorUpdateFailed(address)": [ - { - "details": "Error raised when a bridge operator update operation fails.", - "params": { - "bridgeOperator": "The address of the bridge operator that failed to update." - } - } - ], - "ErrContractTypeNotFound(uint8)": [ - { - "details": "Error of invalid role." - } - ], - "ErrCurrentProposalIsNotCompleted()": [ - { - "details": "Error thrown when the current proposal is not completed." - } - ], - "ErrDuplicated(bytes4)": [ - { - "details": "Error thrown when a duplicated element is detected in an array.", - "params": { - "msgSig": "The function signature that invoke the error." - } - } - ], - "ErrInsufficientGas(bytes32)": [ - { - "details": "Error thrown when there is insufficient gas to execute a function." - } - ], - "ErrInvalidArguments(bytes4)": [ - { - "details": "Error indicating that arguments are invalid." - } - ], - "ErrInvalidChainId(bytes4,uint256,uint256)": [ - { - "details": "Error indicating that the chain ID is invalid.", - "params": { - "actual": "Current chain ID that executing function.", - "expected": "Expected chain ID required for the tx to success.", - "msgSig": "The function signature (bytes4) of the operation that encountered an invalid chain ID." - } - } - ], - "ErrInvalidExpiryTimestamp()": [ - { - "details": "Error thrown when an invalid expiry timestamp is provided." - } - ], - "ErrInvalidOrder(bytes4)": [ - { - "details": "Error indicating that an order is invalid.", - "params": { - "msgSig": "The function signature (bytes4) of the operation that encountered an invalid order." - } - } - ], - "ErrInvalidProposalNonce(bytes4)": [ - { - "details": "Error indicating that the proposal nonce is invalid.", - "params": { - "msgSig": "The function signature (bytes4) of the operation that encountered an invalid proposal nonce." - } - } - ], - "ErrInvalidThreshold(bytes4)": [ - { - "details": "Error indicating that the provided threshold is invalid for a specific function signature.", - "params": { - "msgSig": "The function signature (bytes4) that the invalid threshold applies to." - } - } - ], - "ErrInvalidVoteWeight(bytes4)": [ - { - "details": "Error indicating that a vote weight is invalid for a specific function signature.", - "params": { - "msgSig": "The function signature (bytes4) that encountered an invalid vote weight." - } - } - ], - "ErrLengthMismatch(bytes4)": [ - { - "details": "Error indicating a mismatch in the length of input parameters or arrays for a specific function.", - "params": { - "msgSig": "The function signature (bytes4) that has a length mismatch." - } - } - ], - "ErrOnlySelfCall(bytes4)": [ - { - "details": "Error indicating that a function can only be called by the contract itself.", - "params": { - "msgSig": "The function signature (bytes4) that can only be called by the contract itself." - } - } - ], - "ErrRelayFailed(bytes4)": [ - { - "details": "Error indicating that a relay call has failed.", - "params": { - "msgSig": "The function signature (bytes4) of the relay call that failed." - } - } - ], - "ErrUnauthorized(bytes4,uint8)": [ - { - "details": "Error indicating that the caller is unauthorized to perform a specific function.", - "params": { - "expectedRole": "The role required to perform the function.", - "msgSig": "The function signature (bytes4) that the caller is unauthorized to perform." - } - } - ], - "ErrUnsupportedInterface(bytes4,address)": [ - { - "details": "The error indicating an unsupported interface.", - "params": { - "addr": "The address where the unsupported interface was encountered.", - "interfaceId": "The bytes4 interface identifier that is not supported." - } - } - ], - "ErrUnsupportedVoteType(bytes4)": [ - { - "details": "Error indicating that a vote type is not supported.", - "params": { - "msgSig": "The function signature (bytes4) of the operation that encountered an unsupported vote type." - } - } - ], - "ErrVoteIsFinalized()": [ - { - "details": "Error thrown when attempting to interact with a finalized vote." - } - ], - "ErrZeroAddress(bytes4)": [ - { - "details": "Error indicating that given address is null when it should not." - } - ], - "ErrZeroCodeContract(address)": [ - { - "details": "Error of set to non-contract." - } - ] - } - }, - "isFoundry": true, - "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"roninChainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"bridgeContract\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"callbackRegisters\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"internalType\":\"uint96[]\",\"name\":\"voteWeights\",\"type\":\"uint96[]\"},{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeOperator\",\"type\":\"address\"}],\"name\":\"ErrBridgeOperatorAlreadyExisted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeOperator\",\"type\":\"address\"}],\"name\":\"ErrBridgeOperatorUpdateFailed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"ErrContractTypeNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrCurrentProposalIsNotCompleted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrDuplicated\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ErrInsufficientGas\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidArguments\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"}],\"name\":\"ErrInvalidChainId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidExpiryTimestamp\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidOrder\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidProposalNonce\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidThreshold\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidVoteWeight\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrLengthMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrOnlySelfCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrRelayFailed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum RoleAccess\",\"name\":\"expectedRole\",\"type\":\"uint8\"}],\"name\":\"ErrUnauthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrUnsupportedInterface\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrUnsupportedVoteType\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrVoteIsFinalized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrZeroAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrZeroCodeContract\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fromBridgeOperator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"toBridgeOperator\",\"type\":\"address\"}],\"name\":\"BridgeOperatorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"statuses\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"uint96[]\",\"name\":\"voteWeights\",\"type\":\"uint96[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"BridgeOperatorsAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"statuses\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"BridgeOperatorsRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ContractUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"round\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"indexed\":false,\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"globalProposalHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"indexed\":false,\"internalType\":\"struct GlobalProposal.GlobalProposalDetail\",\"name\":\"globalProposal\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"}],\"name\":\"GlobalProposalCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"statuses\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"returnDatas\",\"type\":\"bytes[]\"}],\"name\":\"Notified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ProposalApproved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"round\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"indexed\":false,\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"}],\"name\":\"ProposalCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"successCalls\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"returnDatas\",\"type\":\"bytes[]\"}],\"name\":\"ProposalExecuted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ProposalExpired\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"ProposalExpiryDurationChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ProposalRejected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"enum Ballot.VoteType\",\"name\":\"support\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\"}],\"name\":\"ProposalVoted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum GlobalProposal.TargetOption\",\"name\":\"targetOption\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"TargetOptionUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"numerator\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"denominator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousNumerator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousDenominator\",\"type\":\"uint256\"}],\"name\":\"ThresholdUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96[]\",\"name\":\"voteWeights\",\"type\":\"uint96[]\"},{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"addBridgeOperators\",\"outputs\":[{\"internalType\":\"bool[]\",\"name\":\"addeds\",\"type\":\"bool[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_voteWeight\",\"type\":\"uint256\"}],\"name\":\"checkThreshold\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"}],\"name\":\"getBridgeOperatorOf\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeOperator\",\"type\":\"address\"}],\"name\":\"getBridgeOperatorWeight\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"weight\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBridgeOperators\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCallbackRegisters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"getContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"contract_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFullBridgeOperatorInfos\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"},{\"internalType\":\"uint96[]\",\"name\":\"weights\",\"type\":\"uint96[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"}],\"name\":\"getGovernorWeight\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"weight\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"}],\"name\":\"getGovernorWeights\",\"outputs\":[{\"internalType\":\"uint96[]\",\"name\":\"weights\",\"type\":\"uint96[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGovernors\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"getGovernorsOf\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getProposalExpiryDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"num_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"globalProposalRelayed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isBridgeOperator\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minimumVoteWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"}],\"name\":\"registerCallbacks\",\"outputs\":[{\"internalType\":\"bool[]\",\"name\":\"registereds\",\"type\":\"bool[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"internalType\":\"struct GlobalProposal.GlobalProposalDetail\",\"name\":\"globalProposal\",\"type\":\"tuple\"},{\"internalType\":\"enum Ballot.VoteType[]\",\"name\":\"supports_\",\"type\":\"uint8[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"signatures\",\"type\":\"tuple[]\"}],\"name\":\"relayGlobalProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"internalType\":\"enum Ballot.VoteType[]\",\"name\":\"supports_\",\"type\":\"uint8[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"signatures\",\"type\":\"tuple[]\"}],\"name\":\"relayProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"removeBridgeOperators\",\"outputs\":[{\"internalType\":\"bool[]\",\"name\":\"removeds\",\"type\":\"bool[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"}],\"name\":\"resolveTargets\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"round\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"numerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denominator\",\"type\":\"uint256\"}],\"name\":\"setThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"}],\"name\":\"sumGovernorsWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"sum\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalBridgeOperator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"}],\"name\":\"unregisterCallbacks\",\"outputs\":[{\"internalType\":\"bool[]\",\"name\":\"unregistereds\",\"type\":\"bool[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newBridgeOperator\",\"type\":\"address\"}],\"name\":\"updateBridgeOperator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"}],\"name\":\"updateManyTargetOption\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"vote\",\"outputs\":[{\"internalType\":\"enum VoteStatusConsumer.VoteStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"againstVoteWeight\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"forVoteWeight\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"ErrBridgeOperatorAlreadyExisted(address)\":[{\"details\":\"Error thrown when attempting to add a bridge operator that already exists in the contract. This error indicates that the provided bridge operator address is already registered as a bridge operator in the contract.\"}],\"ErrBridgeOperatorUpdateFailed(address)\":[{\"details\":\"Error raised when a bridge operator update operation fails.\",\"params\":{\"bridgeOperator\":\"The address of the bridge operator that failed to update.\"}}],\"ErrContractTypeNotFound(uint8)\":[{\"details\":\"Error of invalid role.\"}],\"ErrCurrentProposalIsNotCompleted()\":[{\"details\":\"Error thrown when the current proposal is not completed.\"}],\"ErrDuplicated(bytes4)\":[{\"details\":\"Error thrown when a duplicated element is detected in an array.\",\"params\":{\"msgSig\":\"The function signature that invoke the error.\"}}],\"ErrInsufficientGas(bytes32)\":[{\"details\":\"Error thrown when there is insufficient gas to execute a function.\"}],\"ErrInvalidArguments(bytes4)\":[{\"details\":\"Error indicating that arguments are invalid.\"}],\"ErrInvalidChainId(bytes4,uint256,uint256)\":[{\"details\":\"Error indicating that the chain ID is invalid.\",\"params\":{\"actual\":\"Current chain ID that executing function.\",\"expected\":\"Expected chain ID required for the tx to success.\",\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid chain ID.\"}}],\"ErrInvalidExpiryTimestamp()\":[{\"details\":\"Error thrown when an invalid expiry timestamp is provided.\"}],\"ErrInvalidOrder(bytes4)\":[{\"details\":\"Error indicating that an order is invalid.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid order.\"}}],\"ErrInvalidProposalNonce(bytes4)\":[{\"details\":\"Error indicating that the proposal nonce is invalid.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid proposal nonce.\"}}],\"ErrInvalidThreshold(bytes4)\":[{\"details\":\"Error indicating that the provided threshold is invalid for a specific function signature.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that the invalid threshold applies to.\"}}],\"ErrInvalidVoteWeight(bytes4)\":[{\"details\":\"Error indicating that a vote weight is invalid for a specific function signature.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that encountered an invalid vote weight.\"}}],\"ErrLengthMismatch(bytes4)\":[{\"details\":\"Error indicating a mismatch in the length of input parameters or arrays for a specific function.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that has a length mismatch.\"}}],\"ErrOnlySelfCall(bytes4)\":[{\"details\":\"Error indicating that a function can only be called by the contract itself.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that can only be called by the contract itself.\"}}],\"ErrRelayFailed(bytes4)\":[{\"details\":\"Error indicating that a relay call has failed.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the relay call that failed.\"}}],\"ErrUnauthorized(bytes4,uint8)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"expectedRole\":\"The role required to perform the function.\",\"msgSig\":\"The function signature (bytes4) that the caller is unauthorized to perform.\"}}],\"ErrUnsupportedInterface(bytes4,address)\":[{\"details\":\"The error indicating an unsupported interface.\",\"params\":{\"addr\":\"The address where the unsupported interface was encountered.\",\"interfaceId\":\"The bytes4 interface identifier that is not supported.\"}}],\"ErrUnsupportedVoteType(bytes4)\":[{\"details\":\"Error indicating that a vote type is not supported.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the operation that encountered an unsupported vote type.\"}}],\"ErrVoteIsFinalized()\":[{\"details\":\"Error thrown when attempting to interact with a finalized vote.\"}],\"ErrZeroAddress(bytes4)\":[{\"details\":\"Error indicating that given address is null when it should not.\"}],\"ErrZeroCodeContract(address)\":[{\"details\":\"Error of set to non-contract.\"}]},\"events\":{\"BridgeOperatorUpdated(address,address,address)\":{\"details\":\"Emitted when a bridge operator is updated.\",\"params\":{\"fromBridgeOperator\":\"The address of the bridge operator being updated.\",\"governor\":\"The address of the governor initiating the update.\",\"toBridgeOperator\":\"The updated address of the bridge operator.\"}},\"BridgeOperatorsAdded(bool[],uint96[],address[],address[])\":{\"details\":\"Emitted when new bridge operators are added.\",\"params\":{\"bridgeOperators\":\"The array of addresses representing the added bridge operators.\",\"governors\":\"The array of addresses representing the governors associated with the added bridge operators.\",\"statuses\":\"The array of boolean values represents whether the corresponding bridge operator is added successfully.\",\"voteWeights\":\"The array of vote weights assigned to the added bridge operators.\"}},\"BridgeOperatorsRemoved(bool[],address[])\":{\"details\":\"Emitted when bridge operators are removed.\",\"params\":{\"bridgeOperators\":\"The array of addresses representing the removed bridge operators.\",\"statuses\":\"The array of boolean values representing the statuses of the removed bridge operators.\"}},\"ContractUpdated(uint8,address)\":{\"details\":\"Emitted when a contract is updated.\"},\"GlobalProposalCreated(uint256,bytes32,(uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),bytes32,(uint256,uint256,uint8[],uint256[],bytes[],uint256[]),address)\":{\"details\":\"Emitted when a proposal is created\"},\"Notified(bytes,address[],bool[],bytes[])\":{\"details\":\"Emitted when the contract notifies multiple registers with statuses and return data.\"},\"ProposalApproved(bytes32)\":{\"details\":\"Emitted when the proposal is approved\"},\"ProposalCreated(uint256,uint256,bytes32,(uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),address)\":{\"details\":\"Emitted when a proposal is created\"},\"ProposalExecuted(bytes32,bool[],bytes[])\":{\"details\":\"Emitted when the proposal is executed\"},\"ProposalExpired(bytes32)\":{\"details\":\"Emitted when the vote is expired\"},\"ProposalExpiryDurationChanged(uint256)\":{\"details\":\"Emitted when the proposal expiry duration is changed.\"},\"ProposalRejected(bytes32)\":{\"details\":\"Emitted when the vote is reject\"},\"ProposalVoted(bytes32,address,uint8,uint256)\":{\"details\":\"Emitted when the proposal is voted\"},\"TargetOptionUpdated(uint8,address)\":{\"details\":\"Emitted when the target options are updated\"},\"ThresholdUpdated(uint256,uint256,uint256,uint256,uint256)\":{\"details\":\"Emitted when the threshold is updated\"}},\"kind\":\"dev\",\"methods\":{\"addBridgeOperators(uint96[],address[],address[])\":{\"details\":\"Adds multiple bridge operators.\",\"params\":{\"bridgeOperators\":\"An array of addresses representing the bridge operators to add.\",\"governors\":\"An array of addresses of hot/cold wallets for bridge operator to update their node address.\"},\"returns\":{\"addeds\":\"An array of booleans indicating whether each bridge operator was added successfully. Note: return boolean array `addeds` indicates whether a group (voteWeight, governor, operator) are recorded. It is expected that FE/BE staticcall to the function first to get the return values and handle it correctly. Governors are expected to see the outcome of this function and decide if they want to vote for the proposal or not. Example Usage: Making an `eth_call` in ethers.js ``` const {addeds} = await bridgeManagerContract.callStatic.addBridgeOperators( voteWeights, governors, bridgeOperators, // overriding the caller to the contract itself since we use `onlySelfCall` guard {from: bridgeManagerContract.address} ) const filteredOperators = bridgeOperators.filter((_, index) => addeds[index]); const filteredWeights = weights.filter((_, index) => addeds[index]); const filteredGovernors = governors.filter((_, index) => addeds[index]); // ... (Process or use the information as required) ... ```\"}},\"checkThreshold(uint256)\":{\"details\":\"Checks whether the `_voteWeight` passes the threshold.\"},\"getBridgeOperatorOf(address[])\":{\"details\":\"Returns an array of bridge operators correspoding to governor addresses.\",\"returns\":{\"bridgeOperators\":\"An array containing the addresses of all bridge operators.\"}},\"getBridgeOperatorWeight(address)\":{\"details\":\"External function to retrieve the vote weight of a specific bridge operator.\",\"params\":{\"bridgeOperator\":\"The address of the bridge operator to get the vote weight for.\"},\"returns\":{\"weight\":\"The vote weight of the specified bridge operator.\"}},\"getBridgeOperators()\":{\"details\":\"Returns an array of all bridge operators.\",\"returns\":{\"_0\":\"An array containing the addresses of all bridge operators.\"}},\"getCallbackRegisters()\":{\"details\":\"Retrieves the addresses of registered callbacks.\",\"returns\":{\"registers\":\"An array containing the addresses of registered callbacks.\"}},\"getContract(uint8)\":{\"details\":\"Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.\",\"params\":{\"contractType\":\"The role of the contract to retrieve.\"},\"returns\":{\"contract_\":\"The address of the contract with the specified role.\"}},\"getFullBridgeOperatorInfos()\":{\"details\":\"Retrieves the full information of all registered bridge operators. This external function allows external callers to obtain the full information of all the registered bridge operators. The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.\",\"returns\":{\"bridgeOperators\":\"An array of addresses representing the registered bridge operators.\",\"governors\":\"An array of addresses representing the governors of each bridge operator.\",\"weights\":\"An array of uint256 values representing the vote weights of each bridge operator. Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator. Example Usage: ``` (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos(); for (uint256 i = 0; i < bridgeOperators.length; i++) { // Access individual information for each bridge operator. address governor = governors[i]; address bridgeOperator = bridgeOperators[i]; uint256 weight = weights[i]; // ... (Process or use the information as required) ... } ```\"}},\"getGovernorWeight(address)\":{\"details\":\"External function to retrieve the vote weight of a specific governor.\",\"params\":{\"governor\":\"The address of the governor to get the vote weight for.\"},\"returns\":{\"weight\":\"voteWeight The vote weight of the specified governor.\"}},\"getGovernorWeights(address[])\":{\"details\":\"Returns the weights of a list of governor addresses.\"},\"getGovernors()\":{\"details\":\"Returns an array of all governors.\",\"returns\":{\"_0\":\"An array containing the addresses of all governors.\"}},\"getGovernorsOf(address[])\":{\"details\":\"Retrieves the governors corresponding to a given array of bridge operators. This external function allows external callers to obtain the governors associated with a given array of bridge operators. The function takes an input array `bridgeOperators` containing bridge operator addresses and returns an array of corresponding governors.\",\"params\":{\"bridgeOperators\":\"An array of bridge operator addresses for which governors are to be retrieved.\"},\"returns\":{\"governors\":\"An array of addresses representing the governors corresponding to the provided bridge operators.\"}},\"getProposalExpiryDuration()\":{\"details\":\"Returns the expiry duration for a new proposal.\"},\"getThreshold()\":{\"details\":\"Returns the threshold.\"},\"getTotalWeight()\":{\"details\":\"Returns total weights.\"},\"globalProposalRelayed(uint256)\":{\"details\":\"Returns whether the voter `_voter` casted vote for the proposal.\"},\"isBridgeOperator(address)\":{\"details\":\"Checks if the given address is a bridge operator.\",\"params\":{\"addr\":\"The address to check.\"},\"returns\":{\"_0\":\"A boolean indicating whether the address is a bridge operator.\"}},\"minimumVoteWeight()\":{\"details\":\"Returns the minimum vote weight to pass the threshold.\"},\"registerCallbacks(address[])\":{\"details\":\"Registers multiple callbacks with the bridge.\",\"params\":{\"registers\":\"The array of callback addresses to register.\"},\"returns\":{\"registereds\":\"An array indicating the success status of each registration.\"}},\"relayGlobalProposal((uint256,uint256,uint8[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])\":{\"details\":\"See `GovernanceRelay-_relayGlobalProposal`. Requirements: - The method caller is governor.\"},\"relayProposal((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])\":{\"details\":\"See `GovernanceRelay-_relayProposal`. Requirements: - The method caller is governor.\"},\"removeBridgeOperators(address[])\":{\"details\":\"Removes multiple bridge operators.\",\"params\":{\"bridgeOperators\":\"An array of addresses representing the bridge operators to remove.\"},\"returns\":{\"removeds\":\"An array of booleans indicating whether each bridge operator was removed successfully. * Note: return boolean array `removeds` indicates whether a group (voteWeight, governor, operator) are recorded. It is expected that FE/BE staticcall to the function first to get the return values and handle it correctly. Governors are expected to see the outcome of this function and decide if they want to vote for the proposal or not. Example Usage: Making an `eth_call` in ethers.js ``` const {removeds} = await bridgeManagerContract.callStatic.removeBridgeOperators( bridgeOperators, // overriding the caller to the contract itself since we use `onlySelfCall` guard {from: bridgeManagerContract.address} ) const filteredOperators = bridgeOperators.filter((_, index) => removeds[index]); // ... (Process or use the information as required) ... ```\"}},\"resolveTargets(uint8[])\":{\"details\":\"Returns corresponding address of target options. Return address(0) on non-existent target.\"},\"setContract(uint8,address)\":{\"details\":\"Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.\",\"params\":{\"addr\":\"The address of the contract to set.\",\"contractType\":\"The role of the contract to set.\"}},\"setThreshold(uint256,uint256)\":{\"details\":\"Sets the threshold. Requirements: - The method caller is admin. Emits the `ThresholdUpdated` event.\"},\"sumGovernorsWeight(address[])\":{\"details\":\"Returns total weights of the governor list.\"},\"totalBridgeOperator()\":{\"details\":\"Returns the total number of bridge operators.\",\"returns\":{\"_0\":\"The total number of bridge operators.\"}},\"unregisterCallbacks(address[])\":{\"details\":\"Unregisters multiple callbacks from the bridge.\",\"params\":{\"registers\":\"The array of callback addresses to unregister.\"},\"returns\":{\"unregistereds\":\"An array indicating the success status of each unregistration.\"}},\"updateBridgeOperator(address)\":{\"details\":\"Governor updates their corresponding governor and/or operator address. Requirements: - The caller must the governor of the operator that is requested changes.\",\"params\":{\"bridgeOperator\":\"The address of the bridge operator to update.\"}},\"updateManyTargetOption(uint8[],address[])\":{\"details\":\"Updates list of `targetOptions` to `targets`. Requirement: - Only allow self-call through proposal. \"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"round(uint256)\":{\"notice\":\"chain id = 0 for global proposal\"},\"updateBridgeOperator(address)\":{\"notice\":\"This method checks authorization by querying the corresponding operator of the msg.sender and then attempts to remove it from the `_bridgeOperatorSet` for gas optimization. In case we allow a governor can leave their operator address blank null `address(0)`, consider add authorization check.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/mainchain/MainchainBridgeManager.sol\":\"MainchainBridgeManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@openzeppelin/=lib/openzeppelin-contracts/\",\":@prb/math/=lib/prb-math/\",\":@prb/test/=lib/prb-test/src/\",\":@ronin/contracts/=src/\",\":@ronin/script/=script/\",\":@ronin/test/=test/\",\":contract-libs/=lib/foundry-deployment-kit/lib/contract-libs/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":foundry-deployment-kit/=lib/foundry-deployment-kit/script/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/contracts/\",\":prb-math/=lib/prb-math/src/\",\":prb-test/=lib/prb-test/src/\",\":solady/=lib/solady/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol\":{\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://383fb7b8181016ac5ccf07bc9cdb7c1b5045ea36e2cc4df52bcbf20396fc7688\",\"dweb:/ipfs/QmYJ7Cg4WmE3rR8KGQxjUCXFfTH6TcwZ2Z1f6tPrq7jHFr\"]},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://96b6d77a20bebd4eb06b801d3d020c7e82be13bd535cb0d0a6b7181c51dab5d5\",\"dweb:/ipfs/QmPUR9Cv9jNFdQX6PtBfaBW1ZCnKwiu65R2VD5kbdanDyn\"]},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://89c2a0f70157c13845be5cb49b078a6374fee3a78fa950052a3af26190255da8\",\"dweb:/ipfs/QmUcvMEQH1oMM2pUyMuDiBUKdvvnTz1NRB8bmPHrVq8725\"]},\"lib/openzeppelin-contracts/contracts/proxy/Proxy.sol\":{\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8831721b6f4cc26534d190f9f1631c3f59c9ff38efdd911f85e0882b8e360472\",\"dweb:/ipfs/QmQZnLErZNStirSQ13ZNWQgvEYUtGE5tXYwn4QUPaVUfPN\"]},\"lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol\":{\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ada1e030c0231db8d143b44ce92b4d1158eedb087880cad6d8cc7bd7ebe7b354\",\"dweb:/ipfs/QmWZ2NHZweRpz1U9GF6R1h65ri76dnX7fNxLBeM2t5N5Ce\"]},\"lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"keccak256\":\"0xa6a787e7a901af6511e19aa53e1a00352db215a011d2c7a438d0582dd5da76f9\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a6c4477d480bac20d681ade0e712b77ad828acf530a1d5c0abc5fb78068a05a1\",\"dweb:/ipfs/QmdBqsK8CcUceTeWzhHwFDEvKMoHimwtV96Lbim7ZBtCb8\"]},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://35c47bece3c03caaa07fab37dd2bb3413bfbca20db7bd9895024390e0a469487\",\"dweb:/ipfs/QmPGWT2x3QHcKxqe6gRmAkdakhbaRgx3DLzcakHz5M4eXG\"]},\"lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol\":{\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://39e096c60a6eb1c6a257122d515496bd92d0c6a693a8f07acb6aa4b1263e95d4\",\"dweb:/ipfs/QmPs5trJBacCiSkezP6tpevapuRYWNY6mqSFzsMCJj7e6B\"]},\"lib/openzeppelin-contracts/contracts/utils/Strings.sol\":{\"keccak256\":\"0xaf159a8b1923ad2a26d516089bceca9bdeaeacd04be50983ea00ba63070f08a3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6f2cf1c531122bc7ca96b8c8db6a60deae60441e5223065e792553d4849b5638\",\"dweb:/ipfs/QmPBdJmBBABMDCfyDjCbdxgiqRavgiSL88SYPGibgbPas9\"]},\"lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol\":{\"keccak256\":\"0xdb7f5c28fc61cda0bd8ab60ce288e206b791643bcd3ba464a70cbec18895a2f5\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bf52bdf22a33263f5ca6227a35faeac3b81e7d2c692fbcc6a079d488710c5900\",\"dweb:/ipfs/QmcmsjkP4yq3UhiJbvyzwufaY2EKh1zhHaRK8ATag2cpD2\"]},\"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol\":{\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://be161e54f24e5c6fae81a12db1a8ae87bc5ae1b0ddc805d82a1440a68455088f\",\"dweb:/ipfs/QmP7C3CHdY9urF4dEMb9wmsp1wMxHF6nhA2yQE5SKiPAdy\"]},\"lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol\":{\"keccak256\":\"0x5050943b32b6a8f282573d166b2e9d87ab7eb4dbba4ab6acf36ecb54fe6995e4\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d4831d777a29ebdf9f2caecd70e74b97bff1b70e53622fd0a02aed01e21c8271\",\"dweb:/ipfs/QmUqurVVnCc7XkMxb2k23TVQUtuhHZduJ3hTZarTJrqU24\"]},\"src/extensions/TransparentUpgradeableProxyV2.sol\":{\"keccak256\":\"0x6609392ea7d3174439b5715100bee82528fe6e4aff28927d48c27db8475e88c5\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://370c93bc1e962fcf8eab41d217d901716769f05c51a2cb25aae12abc84e871da\",\"dweb:/ipfs/QmQYL5QrJmXCdi5UN9K7imt1iPm9ydZQm6ifShpt451afd\"]},\"src/extensions/bridge-operator-governance/BridgeManager.sol\":{\"keccak256\":\"0xed4094d87c13f38dc4b76b52b8b238447d99cdc2ad452f322ddc891b1217d572\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c8a37c078764f764094af3e4aba17aeb529e4985a316f7a9902001bb3b0c5872\",\"dweb:/ipfs/QmdSgZNaxS2RfQQ49AZWwo2ZmAt1ViQGShd1zFUTzum7sp\"]},\"src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol\":{\"keccak256\":\"0x0fd58e2e9955d95cfde1ccd8b120fbb3d5bbf7b41143c09217833bd1d01590ce\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a470ffde7a16e1d32cf2ef09fac248bdd012eabd166d3a42e35891d23aa4027d\",\"dweb:/ipfs/QmWjL7fG82GCvg8UFJVb5PMskwqRDKfggk1WwVKQ1heG8e\"]},\"src/extensions/collections/HasContracts.sol\":{\"keccak256\":\"0x9e1dceb68827adfb8c8184662f29ab5fe14e292a632878150e3b0b6c61bc1dce\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b8903232a7a609b250a1ff2e9522a2366979652145af74637f9c0089916e3da3\",\"dweb:/ipfs/QmVoxZamJEhjYhr9RKVSAKGzakgqmFLfZXhZcDGor7DZe5\"]},\"src/extensions/collections/HasProxyAdmin.sol\":{\"keccak256\":\"0x0916021d04ea0c93c54978dc2fd46575fd2bd867369fbf9ce49f316939ddaf25\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2e220c59eb50b4e206d0a126f8cd2f7f2aa6865f56a0b4b091149e6928bf97b8\",\"dweb:/ipfs/QmRBk5hhn1w2MghZ8pRfaU1CvgRAZN7nZvxySSPDvkVuGp\"]},\"src/extensions/sequential-governance/CoreGovernance.sol\":{\"keccak256\":\"0xc6056209e8f6a0d9edced67388a4037c6fafffb68a3c7b2fe5759c487bb1d81c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://97bcdb2a935279c899a9cc27e4b3f372b255b6851723be8c80b2e9f3865647e9\",\"dweb:/ipfs/QmQdFFXdC2vmwbPyAetmZYNvVbshXGwaWq4waiQRhsmpsT\"]},\"src/extensions/sequential-governance/GlobalCoreGovernance.sol\":{\"keccak256\":\"0x986444cade6313dd1ce4137f3338e4fc296769f5cf669f057cd2838e5ae0e54f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2b742e41b4155f872f00e387f971139713f8d5bc8a4d351b026041b8766af6dc\",\"dweb:/ipfs/QmSz3QV64W8MKvuWmdy6rCQXMBX3bz8vcfV8UKYHsQbuvf\"]},\"src/extensions/sequential-governance/governance-relay/CommonGovernanceRelay.sol\":{\"keccak256\":\"0x80c58038f403fd189647669c2f5f913c9c5dd16be3d1b60b296903ce70c9634b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6fd2c38ba6888b6c6f32365c3d3501e038f727176fcc3329fefdd909996ab247\",\"dweb:/ipfs/QmYZ31EScGv4Moonfahgi8o6TXVLSWUiAKJLZZtrQobUhZ\"]},\"src/extensions/sequential-governance/governance-relay/GlobalGovernanceRelay.sol\":{\"keccak256\":\"0xe2c192ec663e10953b2754fa154fef64e26b8c470d25272883a9c149623746c8\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://41908a736c62c8145e0d5dd74d8495a06e0132e8d9b60618c97df40da7ae39c7\",\"dweb:/ipfs/QmY4qMLFfngaBTCXoE6fcGSYBrs3q8bKVTgEpkFfL43F8Y\"]},\"src/extensions/sequential-governance/governance-relay/GovernanceRelay.sol\":{\"keccak256\":\"0xb21d764010845c562d1554168cf103b332755764107f6510eeddc1f03c82bc33\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://cbd0a15ebd973a1ad8122f78b6b5dc14f980e803773b6541220ce43a3cf8b4f8\",\"dweb:/ipfs/QmXNyjv68auW56WDchsyPMMekFr3nLsDvWWRXCTKxSoFkb\"]},\"src/interfaces/IQuorum.sol\":{\"keccak256\":\"0x6b7920b04a73a0e1ff7404aa1a3b5fc738fc0b6154839480f666fd69b55123f0\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a8c81134e4632e1240aead39fd5393b376a4be53668caf2a390f511f3c6d422d\",\"dweb:/ipfs/QmWPaQPP1WkpdPjLhK7wFXsih8HWs6kRQqjX5zGLu6McGH\"]},\"src/interfaces/bridge/IBridgeManager.sol\":{\"keccak256\":\"0x9339ce2f14bc1e4d0e368a351506ff5735bcbc0a2e41aa633149198bbed76a60\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c234bc4f4faa82434fcfeab5b50af61b7027a75f3f773b70b542860d10607574\",\"dweb:/ipfs/QmYPcxU5UMEEoxQphF8KA6P7jCRuGAXRjvoiu3McYfuxER\"]},\"src/interfaces/bridge/IBridgeManagerCallback.sol\":{\"keccak256\":\"0xfd6868a1041577a463b6c96713edcb18063dc817154d09710abfd5783e4629ee\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://acaccf9b0280ec924dfdd641d122da9c0d6944c6bcf55019682ab5f7a925ab32\",\"dweb:/ipfs/QmR4ta1PNirxkJEiSqJVfEo9CRxQjvdfKZMGzf84nekZos\"]},\"src/interfaces/bridge/IBridgeManagerCallbackRegister.sol\":{\"keccak256\":\"0xadbcf65ee9d55f4aa037216d71a279fe41855fe572a4a8734e6f69954aea98f4\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://db7b04d27323d7c0de57def768f65c448022c500f475985b555a53ae5b0c8249\",\"dweb:/ipfs/QmNq4UJripZ7rWJqrccBU7Yq3raJvuNTqqMQkn73DrQSYp\"]},\"src/interfaces/bridge/events/IBridgeManagerEvents.sol\":{\"keccak256\":\"0x217fff41c4a9ca72d142c5a2120bb1b5e67bf5bf5aa0f6128450116aebc07b8d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c34d339fa8e240c62ea8da11b4fe8745fbe5b6091dbcd40505160ae952f33e16\",\"dweb:/ipfs/QmR6CBz9VAvCSTR7uS3R4yocptsHPz3aodqdDEwSc2xZaE\"]},\"src/interfaces/collections/IHasContracts.sol\":{\"keccak256\":\"0x99d8213d857e30d367155abd15dc42730afdfbbac3a22dfb3b95ffea2083a92e\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://03390ff29b496e244faf4eab55565712f0aea5fecdcb915e3c5866ef29d5686d\",\"dweb:/ipfs/QmdGpXn3VSxfNvjFBxfho7rc41JTq5m6bonrfmpzShhRVs\"]},\"src/interfaces/consumers/ChainTypeConsumer.sol\":{\"keccak256\":\"0xe0d20e00c8d237f8e0fb881abf1ff1ef114173bcb428f06f689c581666a22db7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://178ba522d7a09f458f3d6f9b9f3acf2c588304c72b1b0ede593990903a750967\",\"dweb:/ipfs/QmTXgtbHY3s8NH1VZZNnojgRJ8YEa1kVYTQUxVPb9dqNBD\"]},\"src/interfaces/consumers/SignatureConsumer.sol\":{\"keccak256\":\"0xd370e350722067097dec1a5c31bda6e47e83417fa5c3288293bb910028cd136b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ba168a64188bbbecbac288295bd9d5ce6dc215f876b144271428a6f91cba792a\",\"dweb:/ipfs/QmX3bM7QUo2xHxsXetU9RtXG11sKktvrdGovSJfxPEy5QN\"]},\"src/interfaces/consumers/VoteStatusConsumer.sol\":{\"keccak256\":\"0xa5045232c0c053fcf31fb3fe71942344444159c48d5f1b2063dbb06b6a1c9752\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://7f183bc758fb7940f123cb2ea15053d1da707cbeb2e3938542673aab624411e5\",\"dweb:/ipfs/QmfCDeKmeMnTX75odzbKTvY7GekebXwNEbXr7beSNYYKrT\"]},\"src/libraries/AddressArrayUtils.sol\":{\"keccak256\":\"0xaf760162653a85d6e1b24df4d33c74076f778470112f421a02050fb981242001\",\"license\":\"UNLICENSED\",\"urls\":[\"bzz-raw://3a413f290b8e81540bc6feb739bcfbacf56419b2e657bbce5be43826569b4406\",\"dweb:/ipfs/QmWRjGLBXs7WK92oPm51QpjxMYGuMTBx85Pv7QcGbUZE72\"]},\"src/libraries/Ballot.sol\":{\"keccak256\":\"0xaa1e66bcd86baa6f18c7c5e9b67496535f229cbd2e2ecb4c66bcbfed2b1365de\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://63338c46e5de170c10778edc9027c803a9e1a351dc90b675aad399136352c31a\",\"dweb:/ipfs/QmbnADhMhgWtVTpcTiBHYwxxym3NqQi6sEcvDyfbopNwyb\"]},\"src/libraries/GlobalProposal.sol\":{\"keccak256\":\"0x2716e1baf467abab71d89efa01ce0dc9164531ab4221d2758233a81b6d906474\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8178e89a15d5afd8abee8cc8d33321dad28f3a28d1684c15e861b8a6294d9ca1\",\"dweb:/ipfs/QmfHoZtWeU4mVw4k7wKVPsKp3Gx5YAUx6yj3oNHRpZEeDt\"]},\"src/libraries/Proposal.sol\":{\"keccak256\":\"0xbc29aa4e69db7eef0034fdb795181124f86bcf2bc07b5e4a202100dbdce7f7a1\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://18f09131ea8d57d43a8fdb470c74ccaec1204c7120f15229b616c1e3acba1770\",\"dweb:/ipfs/Qmc3qJgPhoJeKVUEtHwjofnX3r3ndceDsxm82r1hcgzfyd\"]},\"src/mainchain/MainchainBridgeManager.sol\":{\"keccak256\":\"0xb365eb9fefd1c284a86aa97f0bd0d7eb5406d09c87832d1048b2c18d6c08d48a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://3a10046c0d4ed56a61f9e4139c7de2b697f67eb51155945508e33a4255dcee33\",\"dweb:/ipfs/Qmen2Wwj8pM6XYdKGAAiJKQ8JZ5JiWRnbHdUmnSBoXSBJY\"]},\"src/types/Types.sol\":{\"keccak256\":\"0x20ab58f1c9ae4936f9dd9891d064301d78ef508c1dd2ce0c19a7b5b81d530e36\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://edd3ba3207e3891e18a7287453e2f260c13eb0f0f1998aad8f37479041e9872a\",\"dweb:/ipfs/QmS2AHHdKzp9Z2Y1tgA4v9DFBDF9i4M8oyBVGryYA9ftJQ\"]},\"src/types/operations/LibTUint256Slot.sol\":{\"keccak256\":\"0xe10c089459baf373494d76b00e582d49f6e43c500ab0f1657d53afc2fa472cbb\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2fc230e404242474f7433259c92641b34a387b5cfed7690ec495fa87271734c6\",\"dweb:/ipfs/Qme3tC8svJqFBeWHdXgsvbp1DtPycighFXVT4yUBmEcjJg\"]},\"src/utils/CommonErrors.sol\":{\"keccak256\":\"0x22942c8fea2d1ca863ac1f9c1662d714b8ac0856684e36f8aaf19508648c1053\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d7e47ff198edb68a65d65938c67f860c041a4b7f64cff5b101a333869096044b\",\"dweb:/ipfs/QmTFwEY7jPiUSKc3GvYDY7qHqXJzUYCmSjoVrcgFhi8gZz\"]},\"src/utils/ContractType.sol\":{\"keccak256\":\"0x7f547a44265f4c4b03d8971f7fc5eaa2e6064ea8cd509c1b761108f9800dab68\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://130e3f8353d9f34098fbf2867c3bf812a5184904d0113d55c5c820eb64f2547b\",\"dweb:/ipfs/QmeFSUbPi8fyG1W7kKegFRtCqALjQBXQyVvQ4sjpi6SWH3\"]},\"src/utils/IdentityGuard.sol\":{\"keccak256\":\"0x2d0dfcef3636945bc1785c1fa5a05f5203c79cbb81b2eee92a3ac6a2378c2ce5\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5e4cedc10e50bfaacdc732eab78768b5e0abbc8336eeaffa15de2a7be90de504\",\"dweb:/ipfs/QmR17AgM71NkH5ZeLpmaRMzPyXAKyhafoK2TZUnLw2z3Mv\"]},\"src/utils/RoleAccess.sol\":{\"keccak256\":\"0x7da4631824b53be17e246102ad59458f91f2395710561ac9bface18d35fb2502\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://070d8254ea4d6fde54ae02e121bb84bdb63a3c5a8513d2d364ad5038f6a95493\",\"dweb:/ipfs/QmfXpp3t8XcGFXewoVRmoQMKJb9vPo95Kj4vsGfNBf7gSH\"]}},\"version\":1}", - "nonce": 4, - "numDeployments": 1, - "storageLayout": { - "storage": [ - { - "astId": 135934, - "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", - "label": "round", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_uint256,t_uint256)" - }, - { - "astId": 135942, - "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", - "label": "vote", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_mapping(t_uint256,t_struct(ProposalVote)135872_storage))" - }, - { - "astId": 135944, - "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", - "label": "_proposalExpiryDuration", - "offset": 0, - "slot": "2", - "type": "t_uint256" - }, - { - "astId": 136681, - "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", - "label": "_targetOptionsMap", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_enum(TargetOption)140705,t_address)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_address)dyn_storage": { - "encoding": "dynamic_array", - "label": "address[]", - "numberOfBytes": "32", - "base": "t_address" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_enum(TargetOption)140705": { - "encoding": "inplace", - "label": "enum GlobalProposal.TargetOption", - "numberOfBytes": "1" - }, - "t_enum(VoteStatus)139658": { - "encoding": "inplace", - "label": "enum VoteStatusConsumer.VoteStatus", - "numberOfBytes": "1" - }, - "t_mapping(t_address,t_bool)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_mapping(t_address,t_struct(Signature)139649_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct SignatureConsumer.Signature)", - "numberOfBytes": "32", - "value": "t_struct(Signature)139649_storage" - }, - "t_mapping(t_enum(TargetOption)140705,t_address)": { - "encoding": "mapping", - "key": "t_enum(TargetOption)140705", - "label": "mapping(enum GlobalProposal.TargetOption => address)", - "numberOfBytes": "32", - "value": "t_address" - }, - "t_mapping(t_uint256,t_mapping(t_uint256,t_struct(ProposalVote)135872_storage))": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => mapping(uint256 => struct CoreGovernance.ProposalVote))", - "numberOfBytes": "32", - "value": "t_mapping(t_uint256,t_struct(ProposalVote)135872_storage)" - }, - "t_mapping(t_uint256,t_struct(ProposalVote)135872_storage)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => struct CoreGovernance.ProposalVote)", - "numberOfBytes": "32", - "value": "t_struct(ProposalVote)135872_storage" - }, - "t_mapping(t_uint256,t_uint256)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_struct(ProposalVote)135872_storage": { - "encoding": "inplace", - "label": "struct CoreGovernance.ProposalVote", - "numberOfBytes": "288", - "members": [ - { - "astId": 135848, - "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", - "label": "status", - "offset": 0, - "slot": "0", - "type": "t_enum(VoteStatus)139658" - }, - { - "astId": 135850, - "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", - "label": "hash", - "offset": 0, - "slot": "1", - "type": "t_bytes32" - }, - { - "astId": 135852, - "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", - "label": "againstVoteWeight", - "offset": 0, - "slot": "2", - "type": "t_uint256" - }, - { - "astId": 135854, - "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", - "label": "forVoteWeight", - "offset": 0, - "slot": "3", - "type": "t_uint256" - }, - { - "astId": 135857, - "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", - "label": "forVoteds", - "offset": 0, - "slot": "4", - "type": "t_array(t_address)dyn_storage" - }, - { - "astId": 135860, - "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", - "label": "againstVoteds", - "offset": 0, - "slot": "5", - "type": "t_array(t_address)dyn_storage" - }, - { - "astId": 135862, - "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", - "label": "expiryTimestamp", - "offset": 0, - "slot": "6", - "type": "t_uint256" - }, - { - "astId": 135867, - "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", - "label": "sig", - "offset": 0, - "slot": "7", - "type": "t_mapping(t_address,t_struct(Signature)139649_storage)" - }, - { - "astId": 135871, - "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", - "label": "voted", - "offset": 0, - "slot": "8", - "type": "t_mapping(t_address,t_bool)" - } - ] - }, - "t_struct(Signature)139649_storage": { - "encoding": "inplace", - "label": "struct SignatureConsumer.Signature", - "numberOfBytes": "96", - "members": [ - { - "astId": 139644, - "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", - "label": "v", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 139646, - "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", - "label": "r", - "offset": 0, - "slot": "1", - "type": "t_bytes32" - }, - { - "astId": 139648, - "contract": "src/mainchain/MainchainBridgeManager.sol:MainchainBridgeManager", - "label": "s", - "offset": 0, - "slot": "2", - "type": "t_bytes32" - } - ] - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - }, - "timestamp": 1712300364, - "userdoc": { - "version": 1, - "kind": "user", - "methods": { - "round(uint256)": { - "notice": "chain id = 0 for global proposal" - }, - "updateBridgeOperator(address)": { - "notice": "This method checks authorization by querying the corresponding operator of the msg.sender and then attempts to remove it from the `_bridgeOperatorSet` for gas optimization. In case we allow a governor can leave their operator address blank null `address(0)`, consider add authorization check." - } - } - } -} \ No newline at end of file From 73ad9e61caf00450f20e951aa09f12fb9fef7131 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 16 Apr 2024 16:10:43 +0700 Subject: [PATCH 178/180] chore: fmt --- .../20240411-helper.s.sol | 2 +- ...240411-p2-upgrade-bridge-ronin-chain.s.sol | 34 +++++++++---------- ...0240411-p3-upgrade-bridge-main-chain.s.sol | 2 +- .../verify-script.s.sol | 2 +- .../PostCheck_BridgeManager_Proposal.s.sol | 2 +- src/mainchain/MainchainGatewayV3.sol | 3 +- 6 files changed, 23 insertions(+), 22 deletions(-) diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol index 4003c57e..2497d517 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-helper.s.sol @@ -38,7 +38,7 @@ contract Migration__20240409_Helper is Migration { function _helperVoteForCurrentNetwork(LegacyProposalDetail memory proposal) internal { for (uint i; i < _voters.length - 1; ++i) { vm.broadcast(_voters[i]); - address(_currRoninBridgeManager).call{gas: (proposal.targets.length + 1) * 1_000_000 }( + address(_currRoninBridgeManager).call{ gas: (proposal.targets.length + 1) * 1_000_000 }( abi.encodeWithSignature( "castProposalVoteForCurrentNetwork((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8)", proposal, Ballot.VoteType.For ) diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol index d9f34280..d3a7a726 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p2-upgrade-bridge-ronin-chain.s.sol @@ -100,23 +100,23 @@ contract Migration__20240409_P2_UpgradeBridgeRoninchain is Migration__20240409_H // ); // } - // ((45, 2021, 1714451658 [1.714e9], [0x1aD54D61F47acBcBA99fb6540A1694EB2F47AB95], [0], [0x8f283970000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac5753], [1000000 [1e6]]), 0) - - LegacyProposalDetail memory proposal; - proposal.nonce = 45; - proposal.chainId = 2021; - proposal.expiryTimestamp = 1714451658; - proposal.targets = targets; - proposal.values = values; - proposal.calldatas = calldatas; - proposal.gasAmounts = gasAmounts; - - vm.broadcast(gaVoters[2]); - address(roninGA).call{gas: 10_000_000}( - abi.encodeWithSignature( - "castProposalVoteForCurrentNetwork((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8)", proposal, Ballot.VoteType.For - ) - ); + // ((45, 2021, 1714451658 [1.714e9], [0x1aD54D61F47acBcBA99fb6540A1694EB2F47AB95], [0], [0x8f283970000000000000000000000000b0507f2f22697022ecb25963a00d3d076dac5753], [1000000 [1e6]]), 0) + + LegacyProposalDetail memory proposal; + proposal.nonce = 45; + proposal.chainId = 2021; + proposal.expiryTimestamp = 1714451658; + proposal.targets = targets; + proposal.values = values; + proposal.calldatas = calldatas; + proposal.gasAmounts = gasAmounts; + + vm.broadcast(gaVoters[2]); + address(roninGA).call{ gas: 10_000_000 }( + abi.encodeWithSignature( + "castProposalVoteForCurrentNetwork((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8)", proposal, Ballot.VoteType.For + ) + ); } function _upgradeBridgeRoninchain() private { diff --git a/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol b/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol index 9af25467..e8014b9a 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/20240411-p3-upgrade-bridge-main-chain.s.sol @@ -189,7 +189,7 @@ contract Migration__20240409_P3_UpgradeBridgeMainchain is Migration, Migration__ SignatureConsumer.Signature[] memory signatures = _generateSignaturesFor(getDomain(), hashLegacyProposal(proposal), _loadGovernorPKs(), Ballot.VoteType.For); vm.broadcast(_governor); - address(_currMainchainBridgeManager).call{gas: (proposal.targets.length + 1) * 1_000_000}( + address(_currMainchainBridgeManager).call{ gas: (proposal.targets.length + 1) * 1_000_000 }( abi.encodeWithSignature( "relayProposal((uint256,uint256,uint256,address[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])", proposal, supports_, signatures ) diff --git a/script/20240411-upgrade-v3.2.0-testnet/verify-script.s.sol b/script/20240411-upgrade-v3.2.0-testnet/verify-script.s.sol index a40ff287..09c47032 100644 --- a/script/20240411-upgrade-v3.2.0-testnet/verify-script.s.sol +++ b/script/20240411-upgrade-v3.2.0-testnet/verify-script.s.sol @@ -12,7 +12,7 @@ contract Verify_Script_20240411 is Migration__20240409_P2_UpgradeBridgeRoninchai function run() public override(Migration__20240409_P2_UpgradeBridgeRoninchain, Migration__20240409_P3_UpgradeBridgeMainchain) { TNetwork currentNetwork = network(); TNetwork companionNetwork = config.getCompanionNetwork(currentNetwork); - Migration__20240409_P2_UpgradeBridgeRoninchain.run(); + // Migration__20240409_P2_UpgradeBridgeRoninchain.run(); CONFIG.createFork(companionNetwork); CONFIG.switchTo(companionNetwork); diff --git a/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol b/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol index 0bff45bb..f9082dfb 100644 --- a/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol +++ b/script/post-check/bridge-manager/proposal/PostCheck_BridgeManager_Proposal.s.sol @@ -194,7 +194,7 @@ abstract contract PostCheck_BridgeManager_Proposal is BasePostCheck { calldatas: abi.encodeCall( TransparentUpgradeableProxyV2.functionDelegateCall, (abi.encodeCall(IBridgeManager.addBridgeOperators, (_voteWeights, _addingGovernors, _addingOperators))) - ).toSingletonArray(), + ).toSingletonArray(), gasAmounts: uint256(1_000_000).toSingletonArray(), nonce: manager.round(0) + 1 }); diff --git a/src/mainchain/MainchainGatewayV3.sol b/src/mainchain/MainchainGatewayV3.sol index 042d79cd..22cb4d9e 100644 --- a/src/mainchain/MainchainGatewayV3.sol +++ b/src/mainchain/MainchainGatewayV3.sol @@ -518,6 +518,7 @@ contract MainchainGatewayV3 is } function supportsInterface(bytes4 interfaceId) public view override(AccessControlEnumerable, IERC165, ERC1155Receiver) returns (bool) { - return interfaceId == type(IMainchainGatewayV3).interfaceId || interfaceId == type(IBridgeManagerCallback).interfaceId || super.supportsInterface(interfaceId); + return + interfaceId == type(IMainchainGatewayV3).interfaceId || interfaceId == type(IBridgeManagerCallback).interfaceId || super.supportsInterface(interfaceId); } } From 600f81d2bc4e5fb7d6dfabd2eea1400b7440c92b Mon Sep 17 00:00:00 2001 From: nxqbao Date: Tue, 16 Apr 2024 16:11:21 +0700 Subject: [PATCH 179/180] chore: chmod --- verify.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 verify.sh diff --git a/verify.sh b/verify.sh old mode 100644 new mode 100755 From 97b0ac33cf60cffa28f801a275cf5c4b83f6c305 Mon Sep 17 00:00:00 2001 From: nxqbao Date: Wed, 17 Apr 2024 13:14:03 +0700 Subject: [PATCH 180/180] chore: correct sepolia artifact --- .../sepolia/MainchainBridgeManagerLogic.json | 16 ++++++++-------- .../sepolia/MainchainBridgeManagerProxy.json | 10 +++++----- .../MainchainGatewayPauseEnforcerLogic.json | 10 +++++----- deployments/sepolia/MainchainGatewayV3Logic.json | 16 ++++++++-------- deployments/sepolia/WethUnwrapper.json | 10 +++++----- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/deployments/sepolia/MainchainBridgeManagerLogic.json b/deployments/sepolia/MainchainBridgeManagerLogic.json index 5aa46af1..9b154417 100644 --- a/deployments/sepolia/MainchainBridgeManagerLogic.json +++ b/deployments/sepolia/MainchainBridgeManagerLogic.json @@ -1648,14 +1648,14 @@ ] } ], - "address": "0x31b070817dbF268Bfe1484bD1b4D902c8c4f62df", + "address": "0x8A6e09c0E369086B3AC219aB66F990b0A7d3E1Da", "args": "0x", "ast": "", - "blockNumber": 5709352, - "bytecode": "0x60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61519e80620000f46000396000f3fe608060405234801561001057600080fd5b50600436106102065760003560e01c80639b19dbfd1161011a578063cc7e6b3b116100ad578063de981f1b1161007c578063de981f1b146104ae578063e75235b8146104c1578063e9c03498146104de578063f80b5352146104f1578063f896f070146104f957600080fd5b8063cc7e6b3b14610460578063d0a50db014610480578063d78392f814610488578063dafae4081461049b57600080fd5b8063b405aaf2116100e9578063b405aaf21461041b578063b9c362091461042e578063bc96180b14610441578063c441c4a81461044957600080fd5b80639b19dbfd14610392578063a64a83801461039a578063aee1767f146103ad578063b384abef146103c057600080fd5b80633644e5151161019d5780637f7fe0581161016c5780637f7fe05814610303578063800eaab31461032e578063865e6fd3146103415780638dc0dbc614610354578063901979d51461036757600080fd5b80633644e515146102bc57806362077409146102c5578063776fb1ec146102d85780637de5dedd146102fb57600080fd5b80631f425338116101d95780631f425338146102635780632d6d7d731461027657806334d5f37b1461028957806335da8121146102a957600080fd5b806301a5f43f1461020b57806306aba0e1146102205780630a44fa431461023b5780630f7c31891461024e575b600080fd5b61021e610219366004613fd0565b61050c565b005b6102286105bb565b6040519081526020015b60405180910390f35b610228610249366004614069565b6105ca565b61025661064f565b60405161023291906140ef565b61021e610271366004614069565b610668565b610256610284366004614069565b61070a565b610228610297366004614102565b60026020526000908152604090205481565b61021e6102b7366004614069565b610751565b61022860015481565b61021e6102d336600461415f565b610799565b6102eb6102e6366004614102565b6107c9565b6040519015158152602001610232565b610228610816565b610316610311366004614212565b61086c565b6040516001600160a01b039091168152602001610232565b61021e61033c3660046143c4565b6108ed565b61021e61034f366004614436565b610925565b61021e610362366004614469565b610940565b61037a610375366004614212565b61096a565b6040516001600160601b039091168152602001610232565b6102566109a0565b61021e6103a8366004614102565b610a0b565b6103166103bb366004614212565b610a1f565b61040a6103ce3660046144ad565b600360208181526000938452604080852090915291835291208054600182015460028301549383015460069093015460ff909216939092909185565b6040516102329594939291906144e5565b6102eb610429366004614212565b610a31565b61021e61043c3660046144ad565b610a69565b600454610228565b610451610a7b565b60405161023293929190614554565b61047361046e366004614069565b610b55565b6040516102329190614597565b610228610b93565b61037a610496366004614212565b610ba6565b6102eb6104a9366004614102565b610bb1565b6103166104bc3660046145aa565b610c03565b6104c9610c7e565b60408051928352602083019190915201610232565b61021e6104ec366004614069565b610cc6565b610256610d0f565b61021e61050736600461463a565b610d72565b610514610eac565b6105b286868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808a0282810182019093528982529093508992508891829185019084908082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250610f0892505050565b50505050505050565b60006105c561126a565b905090565b600082828080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061060b925083915061127d9050565b6106478484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506112b292505050565b949350505050565b60606105c5600080516020615149833981519152611337565b610670610eac565b8181808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506106af925083915061127d9050565b60008051602061514983398151915260005b83811015610703576106fa8585838181106106de576106de61475f565b90506020020160208101906106f39190614212565b839061134b565b506001016106c1565b5050505050565b606061074883838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250611360915050565b90505b92915050565b610759610eac565b6107958282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506114b392505050565b5050565b6107a233611570565b6107bb6107b56060870160408801614212565b336115b2565b61070385858585853361160d565b60008060008381527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff602052604090205460ff16600481111561080e5761080e6144cf565b141592915050565b600080610821611641565b905060008061082e610c7e565b9150915080600182856004015485610846919061478b565b61085091906147a2565b61085a91906147b5565b61086491906147c8565b935050505090565b600080600061088261087c611641565b85611665565b91509150816108b45760405163141e2e1f60e11b81526001600160a01b03851660048201526024015b60405180910390fd5b6108bc611641565b60010181815481106108d0576108d061475f565b6000918252602090912001546001600160a01b0316949350505050565b33301461091b576000356001600160e01b0319166040516307337e1960e41b81526004016108ab91906147ea565b61079582826116ca565b61092d610eac565b61093681611773565b61079582826117a9565b61094933611570565b61095c6107b56080870160608801614212565b61070385858585853361184d565b600080610975611641565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b031690565b60606109aa611641565b600101805480602002602001604051908101604052809291908181526020018280548015610a0157602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116109e3575b5050505050905090565b610a13610eac565b610a1c81611881565b50565b6000610a2a826118ee565b5092915050565b600080610a3c611641565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b0316151590565b610a71610eac565b610795828261196e565b60608060606000610a8a611641565b805460408051602080840282018101909252828152929350839190830182828015610ade57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610ac0575b5050505050935080600101805480602002602001604051908101604052809291908181526020018280548015610b3d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b1f575b50505050509250610b4d84611a70565b915050909192565b6060610748838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611a7092505050565b6000610b9d611641565b60010154919050565b600061074b82611b5c565b60007ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00610bdc61126a565b8160010154610beb919061478b565b6002820154610bfa908561478b565b10159392505050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115610c3a57610c3a6144cf565b60ff1681526020810191909152604001600020546001600160a01b0316905080610c79578160405163409140df60e11b81526004016108ab91906147ff565b919050565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f01547ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f02549091565b610cce610eac565b610d0a828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611b9192505050565b505050565b6060610d19611641565b805460408051602080840282018101909252828152929190830182828015610a01576020028201919060005260206000209081546001600160a01b031681526001909101906020018083116109e3575050505050905090565b600054610100900460ff1615808015610d925750600054600160ff909116105b80610dac5750303b158015610dac575060005460ff166001145b610e0f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016108ab565b6000805460ff191660011790558015610e32576000805461ff0019166101001790555b610e3f600160ff1b611f77565b610e498383611fa7565b610e598b8b8b8b8b8b8b8b611fd8565b8015610e9f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610f06576000356001600160e01b0319166001604051620f948f60ea1b81526004016108ab929190614819565b565b6060610f148383612029565b610f1d8161127d565b6000610f27611641565b845187519192509081148015610f3d5750855181145b610f68576000356001600160e01b0319166040516306b5667560e21b81526004016108ab91906147ea565b806001600160401b03811115610f8057610f8061422d565b604051908082528060200260200182016040528015610fa9578160200160208202803683370190505b50935080600003610fbb575050611262565b60008060008060005b858110156111ce578a8181518110610fde57610fde61475f565b60200260200101519450898181518110610ffa57610ffa61475f565b602002602001015193508b81815181106110165761101661475f565b6020026020010151925061102985612133565b61103284612133565b826001600160601b031660000361106a576000356001600160e01b031916604051637f11b8a360e11b81526004016108ab91906147ea565b6001600160a01b03808616600081815260038a01602090815260408083205494891683528083205460028d0190925280832054938352909120546001600160601b0393841693918216926110c2929081169116614847565b6110cc9190614847565b6110d69190614847565b6001600160601b03166000148982815181106110f4576110f461475f565b6020026020010190151590811515815250508881815181106111185761111861475f565b6020026020010151156111c6578654600181810189556000898152602080822090930180546001600160a01b03808b166001600160a01b0319928316811790935591835260028c018552604080842080546001600160601b038b166001600160601b03199182168117909255868f018054978801815586528786209096018054948c1694909316841790925591835260038c0190945290208054909116821790556111c390836147a2565b91505b600101610fc4565b50808660040160008282546111e391906147a2565b909155505060405161121e906347c28ec560e11b9061120a908c908f908d9060200161489a565b604051602081830303815290604052612168565b7f897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b78888c8c8c60405161125394939291906148d3565b60405180910390a15050505050505b509392505050565b6000611274611641565b60040154905090565b61128681612195565b15610a1c576000356001600160e01b031916604051630d697db160e11b81526004016108ab91906147ea565b6000816112be8161127d565b60006112c8611641565b905060005b845181101561132f578160020160008683815181106112ee576112ee61475f565b6020908102919091018101516001600160a01b0316825281019190915260400160002054611325906001600160601b0316856147a2565b93506001016112cd565b505050919050565b6060600061134483612234565b9392505050565b6000610748836001600160a01b038416612290565b606082516001600160401b0381111561137b5761137b61422d565b6040519080825280602002602001820160405280156113a4578160200160208202803683370190505b50905060005b8351811015610a2a57600560008583815181106113c9576113c961475f565b602002602001015160058111156113e2576113e26144cf565b60058111156113f3576113f36144cf565b815260200190815260200160002060009054906101000a90046001600160a01b03168282815181106114275761142761475f565b60200260200101906001600160a01b031690816001600160a01b03168152505082801561147f575060006001600160a01b031682828151811061146c5761146c61475f565b60200260200101516001600160a01b0316145b156114ab576000356001600160e01b03191660405163053265f160e01b81526004016108ab91906147ea565b6001016113aa565b806114bd8161127d565b600080516020615149833981519152600080805b8551811015611568578581815181106114ec576114ec61475f565b602002602001015192506114ff83611773565b611510836312c0151560e21b612383565b61151a8484612516565b604080516001600160a01b038616815282151560208201529193507fb85c58eeff9fe423669ae0841666f4c8499e8731b8275eb462e4fa1720ec420e910160405180910390a16001016114d1565b505050505050565b61157981611b5c565b6001600160601b0316600003610a1c576000356001600160e01b0319166003604051620f948f60ea1b81526004016108ab929190614819565b6001600160a01b038216158015906115dc5750816001600160a01b0316816001600160a01b031614155b15610795576040516301df97c360e51b81526001600160a01b038084166004830152821660248201526044016108ab565b600061162161161b88614a6e565b8361252b565b90506105b2818787878761163c6116378e614a6e565b61263d565b61277c565b7fc648703095712c0419b6431ae642c061f0a105ac2d7c3d9604061ef4ebc3830090565b60008060005b84548110156116b8578481815481106116865761168661475f565b6000918252602090912001546001600160a01b03908116908516036116b0576001925090506116c3565b60010161166b565b506000600019915091505b9250929050565b60005b8251811015610d0a57306001600160a01b03168282815181106116f2576116f261475f565b60200260200101516001600160a01b03160361172f576000356001600160e01b03191660405163053265f160e01b81526004016108ab91906147ea565b61176b8382815181106117445761174461475f565b602002602001015183838151811061175e5761175e61475f565b6020026020010151612c48565b6001016116cd565b806001600160a01b03163b600003610a1c57604051630bfc64a360e21b81526001600160a01b03821660048201526024016108ab565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f8111156117df576117df6144cf565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115611820576118206144cf565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b61185f61185987614b49565b82612cdb565b5061156861186c87614b49565b8686868661163c61187c8d614b49565b612de2565b60038110156118a3576040516305f4dee960e31b815260040160405180910390fd5b60006118ad611641565b600581018390556040518381529091507f22d5bb5059ffe2949a098666fc198587200c8118483074120d3ca7050c7753f19060200160405180910390a15050565b6000806000806119086118ff611641565b60010186611665565b9150915081611935576040516326527e1760e01b81526001600160a01b03861660048201526024016108ab565b61193d611641565b80548290811061194f5761194f61475f565b6000918252602090912001546001600160a01b03169590945092505050565b8082118061197d575060018111155b156119a9576000356001600160e01b0319166040516387f6f09560e01b81526004016108ab91906147ea565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f0180547ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f028054928590558390557ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00805490929084908690856000611a2c83614c2f565b9091555060408051868152602081018690527f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a45050505050565b60606000611a7c611641565b905082516001600160401b03811115611a9757611a9761422d565b604051908082528060200260200182016040528015611ac0578160200160208202803683370190505b50915060005b8351811015611b5557816002016000858381518110611ae757611ae761475f565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160601b0316838281518110611b3557611b3561475f565b6001600160601b0390921660209283029190910190910152600101611ac6565b5050919050565b6000611b66611641565b6001600160a01b0390921660009081526002929092016020525060409020546001600160601b031690565b606081611b9d8161127d565b6000611ba7611641565b8451909150806001600160401b03811115611bc457611bc461422d565b604051908082528060200260200182016040528015611bed578160200160208202803683370190505b50935080600003611bff575050611f71565b60058201548254611c119083906147b5565b1015611c305760405163b2e765cb60e01b815260040160405180910390fd5b60008060008060005b85811015611ef757898181518110611c5357611c5361475f565b60200260200101519350611c66846118ee565b9095509150611c7485612133565b611c7d84612133565b6001600160a01b03851660009081526002880160205260409020546001600160601b031615801590611cd157506001600160a01b03841660009081526003880160205260409020546001600160601b031615155b898281518110611ce357611ce361475f565b602002602001019015159081151581525050888181518110611d0757611d0761475f565b602002602001015115611eef576001600160a01b038516600090815260028801602052604081205488546001600160601b039091169190611d4a906001906147b5565b9050886000018181548110611d6157611d6161475f565b60009182526020909120015489546001600160a01b03909116908a9086908110611d8d57611d8d61475f565b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790558854899080611dc757611dc7614c48565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038916825260028b0190526040902080546001600160601b031916905560018901805482908110611e2757611e2761475f565b60009182526020909120015460018a0180546001600160a01b039092169186908110611e5557611e5561475f565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555088600101805480611e9657611e96614c48565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038816825260038b0190526040902080546001600160601b0319169055611eea82866147a2565b945050505b600101611c39565b5081866004016000828254611f0c91906147b5565b9091555050604051611f3190636242a4ef60e11b9061120a908c908c90602001614c5e565b7fdf3dcd7987202f64648f3acdbf12401e3a2bb23e77e19f99826b5475cbb86369888a604051611f62929190614c8c565b60405180910390a15050505050505b50919050565b600054610100900460ff16611f9e5760405162461bcd60e51b81526004016108ab90614cb1565b610a1c81612f2c565b600054610100900460ff16611fce5760405162461bcd60e51b81526004016108ab90614cb1565b6107958282612f5c565b600054610100900460ff16611fff5760405162461bcd60e51b81526004016108ab90614cb1565b6120098888612f8e565b61201284612fe5565b61201f8686858585613015565b5050505050505050565b81518151606091908082016001600160401b0381111561204b5761204b61422d565b604051908082528060200260200182016040528015612074578160200160208202803683370190505b50925060005b828110156120ce578581815181106120945761209461475f565b60200260200101518482815181106120ae576120ae61475f565b6001600160a01b039092166020928302919091019091015260010161207a565b60005b82811015612129578581815181106120eb576120eb61475f565b60200260200101518583815181106121055761210561475f565b6001600160a01b0390921660209283029190910190910152600191820191016120d1565b5050505092915050565b6001600160a01b038116610a1c576000356001600160e01b03191660405163104c66df60e31b81526004016108ab91906147ea565b612172828261313f565b610795573382826040516319b5fdcb60e31b81526004016108ab93929190614d4c565b600081516000036121a857506000919050565b60005b600183510381101561222b57600181015b8351811015612222578381815181106121d7576121d761475f565b60200260200101516001600160a01b03168483815181106121fa576121fa61475f565b60200260200101516001600160a01b03160361221a575060019392505050565b6001016121bc565b506001016121ab565b50600092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561228457602002820191906000526020600020905b815481526020019060010190808311612270575b50505050509050919050565b600081815260018301602052604081205480156123795760006122b46001836147b5565b85549091506000906122c8906001906147b5565b905081811461232d5760008660000182815481106122e8576122e861475f565b906000526020600020015490508087600001848154811061230b5761230b61475f565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061233e5761233e614c48565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061074b565b600091505061074b565b60008160405160240161239691906147ea565b60408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b1790525190915060009081906001600160a01b038616906123df908590614d80565b600060405180830381855afa9150503d806000811461241a576040519150601f19603f3d011682016040523d82523d6000602084013e61241f565b606091505b5091509150816124e157846001600160a01b0316836040516024016124449190614d9c565b60408051601f198184030181529181526020820180516001600160e01b03166325da93a560e11b179052516124799190614d80565b600060405180830381855afa9150503d80600081146124b4576040519150601f19603f3d011682016040523d82523d6000602084013e6124b9565b606091505b509092509050816124e157838560405163069d427960e11b81526004016108ab929190614daf565b808060200190518101906124f59190614dd2565b61070357838560405163069d427960e11b81526004016108ab929190614daf565b6000610748836001600160a01b038416613471565b612533613f0c565b61254c61254584606001516001611360565b84906134c0565b9050612563600454826135c690919063ffffffff16565b600061256e82612de2565b9050600061257c6000613667565b60008181527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff6020908152604090912090870151600182018590556006909101559050825181146125ee576000356001600160e01b03191660405163d4cec26960e01b81526004016108ab91906147ea565b81817fe5af2d3fb7bcab8f865476bc675bf1bbb8b5a749c827ee1cd215dc9c2b8f92d78561261b8961263d565b898960405161262d9493929190614f5d565b60405180910390a3505092915050565b6080810151606082015160a083015151600092919083906001600160401b0381111561266b5761266b61422d565b604051908082528060200260200182016040528015612694578160200160208202803683370190505b5060c086015190915060005b82518110156126f3578660a0015181815181106126bf576126bf61475f565b6020026020010151805190602001208382815181106126e0576126e061475f565b60209081029190910101526001016126a0565b50604080517fde480f0c53a3651c08fbab1dffbc45fe574f31188827fe52cb9035da9fe57e4a8152875160208083019190915280890151828401529790910151606082015283518702938701939093206080840152835186029386019390932060a0830152805185029085012060c082015281518402919093012060e083015250610100902090565b831580159061278a57508382145b6127b5576000356001600160e01b0319166040516306b5667560e21b81526004016108ab91906147ea565b60006128426127c360015490565b612802846000604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b60405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b9050600061289161285260015490565b612802856001604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b90506000846001600160401b038111156128ad576128ad61422d565b6040519080825280602002602001820160405280156128d6578160200160208202803683370190505b5090506000856001600160401b038111156128f3576128f361422d565b60405190808252806020026020018201604052801561291c578160200160208202803683370190505b50905060008060008060003660005b8c811015612ab0578d8d828181106129455761294561475f565b90506060020191508f8f8281811061295f5761295f61475f565b9050602002016020810190612974919061501e565b9250600083600181111561298a5761298a6144cf565b036129f4576129af8b6129a0602085018561503f565b84602001358560400135613703565b94508489886129bd81614c2f565b9950815181106129cf576129cf61475f565b60200260200101906001600160a01b031690816001600160a01b031681525050612a65565b6001836001811115612a0857612a086144cf565b03612a3e57612a1e8a6129a0602085018561503f565b9450848887612a2c81614c2f565b9850815181106129cf576129cf61475f565b6000356001600160e01b031916604051630612418f60e11b81526004016108ab91906147ea565b846001600160a01b0316846001600160a01b031610612aa5576000356001600160e01b031916604051635d3dcd3160e01b81526004016108ab91906147ea565b84935060010161292b565b505050928552508252506020808b015160009081526003825260408082208d51835290925290812090612ae161372b565b90506000612aee85613735565b9050818110612b755780600003612b26576000356001600160e01b031916604051637f11b8a360e11b81526004016108ab91906147ea565b825460ff1916600190811784558301546040517f5c819725ea53655a3b898f3df59b66489761935454e9212ca1e5ebd759953d0b90600090a2612b69838e613740565b50505050505050611568565b600082612b806137ad565b612b8a91906147b5565b612b959060016147a2565b90506000612ba286613735565b9050818110612c215780600003612bda576000356001600160e01b031916604051637f11b8a360e11b81526004016108ab91906147ea565b845460ff1916600317855560018501546040517f55295d4ce992922fa2e5ffbf3a3dcdb367de0a15e125ace083456017fd22060f90600090a2505050505050505050611568565b6000356001600160e01b031916604051634ccfe64360e11b81526004016108ab91906147ea565b8060056000846005811115612c5f57612c5f6144cf565b6005811115612c7057612c706144cf565b8152602081019190915260400160002080546001600160a01b0319166001600160a01b039283161790558116826005811115612cae57612cae6144cf565b6040517f356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d90600090a35050565b6020820151600090808203612d1d5760405163092048d160e11b8152600080356001600160e01b031916600483015260248201524660448201526064016108ab565b600454612d2b9085906135c6565b6000612d3685612de2565b9050612d4182613667565b6000838152600360209081526040808320848452909152908190209087015160018201849055600690910155925084518314612d9e576000356001600160e01b03191660405163d4cec26960e01b81526004016108ab91906147ea565b8083837fd1221ffb98610024a29755d7db3c71692310f43a7cfcce7ee488a8c7e9e0bfa48888604051612dd2929190615062565b60405180910390a4505092915050565b60a0810151608082015160c083015151600092919083906001600160401b03811115612e1057612e1061422d565b604051908082528060200260200182016040528015612e39578160200160208202803683370190505b5060e086015190915060005b8251811015612e98578660c001518181518110612e6457612e6461475f565b602002602001015180519060200120838281518110612e8557612e8561475f565b6020908102919091010152600101612e45565b50604080517f1b59eeec7c321899dc1e7a5b3d876c9a445dffc6d2f96ba842d7489908fdee1281528751602080830191909152808901518284015291880151606080830191909152909701516080880152835181029381019390932060a0870152835183029383019390932060c0860152805182029082012060e08501528151810291012061010083015250610120902090565b600054610100900460ff16612f535760405162461bcd60e51b81526004016108ab90614cb1565b610a1c816137b7565b600054610100900460ff16612f835760405162461bcd60e51b81526004016108ab90614cb1565b61091b600030612c48565b600054610100900460ff16612fb55760405162461bcd60e51b81526004016108ab90614cb1565b60017ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00908155610d0a838361196e565b600054610100900460ff1661300c5760405162461bcd60e51b81526004016108ab90614cb1565b610a1c816114b3565b600054610100900460ff1661303c5760405162461bcd60e51b81526004016108ab90614cb1565b6130476002856117a9565b604080516020808201839052600e60608301526d212924a223a2afa6a0a720a3a2a960911b6080808401919091528284018990528351808403909101815260a0830184528051908201207f599a80fcaa47b95e2323ab4d34d34e0cc9feda4b843edafcc30c7bdf60ea15bf60c08401527fe4d2346818310a10fac5a6d073d3dce255578caf4aa81ddcbcc7c2b98405eef060e08401527f2a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4de61010084015261012080840191909152835180840390910181526101409092019092528051910120600155613134818385610f08565b506107036003611881565b6001600061315a600080516020615149833981519152611337565b8051909150600081900361316f57505061074b565b6000816001600160401b038111156131895761318961422d565b6040519080825280602002602001820160405280156131b2578160200160208202803683370190505b5090506000826001600160401b038111156131cf576131cf61422d565b60405190808252806020026020018201604052801561320257816020015b60608152602001906001900390816131ed5790505b5090506000878760405160200161321a92919061508c565b604051602081830303815290604052905060008160405160240161323e9190614d9c565b60408051601f198184030181529190526020810180516001600160e01b03166325da93a560e11b179052905060005b85811015613427578681815181106132875761328761475f565b60200260200101516001600160a01b0316836040516132a69190614d80565b6000604051808303816000865af19150503d80600081146132e3576040519150601f19603f3d011682016040523d82523d6000602084013e6132e8565b606091505b508683815181106132fb576132fb61475f565b602002602001018684815181106133145761331461475f565b602002602001018290528215151515815250505084818151811061333a5761333a61475f565b602002602001015161341f578681815181106133585761335861475f565b60200260200101516001600160a01b0316826040516133779190614d80565b6000604051808303816000865af19150503d80600081146133b4576040519150601f19603f3d011682016040523d82523d6000602084013e6133b9565b606091505b508683815181106133cc576133cc61475f565b602002602001018684815181106133e5576133e561475f565b602002602001018290528215151515815250505087801561341c57508481815181106134135761341361475f565b60200260200101515b97505b60010161326d565b507fc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b638287868660405161345d94939291906150bd565b60405180910390a150505050505092915050565b60008181526001830160205260408120546134b85750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561074b565b50600061074b565b6134c8613f0c565b8251815260006020808301919091528301516040808301919091528301516001600160a01b0316606080830191909152830151516001600160401b038111156135135761351361422d565b60405190808252806020026020018201604052801561353c578160200160208202803683370190505b5060808083019190915283015160a08083019190915283015160c08083019190915283015160e082015260005b836060015151811015610a2a578281815181106135885761358861475f565b6020026020010151826080015182815181106135a6576135a661475f565b6001600160a01b0390921660209283029190910190910152600101613569565b60008260800151511180156135e457508160a0015151826080015151145b80156135f957508160c0015151826080015151145b801561360e57508160e0015151826080015151145b613639576000356001600160e01b0319166040516306b5667560e21b81526004016108ab91906147ea565b61364381426147a2565b826040015111156107955760405163ad89be9d60e01b815260040160405180910390fd5b600081815260026020526040812054908190036136965750600090815260026020526040902060019081905590565b60008281526003602090815260408083208484529091528120906000825460ff1660048111156136c8576136c86144cf565b036136e65760405163757a436360e01b815260040160405180910390fd5b505050600090815260026020526040902080546001019081905590565b60008060006137148787878761399c565b9150915061372181613a89565b5095945050505050565b60006105c5610816565b600061074b826112b2565b61374981613c3f565b1561079557815460ff1916600217825560008061376583613c59565b9150915083600101547fe134987599ae266ec90edeff1b26125b287dbb57b10822649432d1bb26537fba838360405161379f92919061510a565b60405180910390a250505050565b60006105c56105bb565b600481905560405181907fe5cd1c123a8cf63fa1b7229678db61fe8ae99dbbd27889370b6667c8cae97da190600090a250565b600483015481101561389d578260080160008460040183815481106138115761381161475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff19169055600484018054600786019291908490811061385a5761385a61475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff191681556001818101839055600290910191909155016137ea565b5060005b6005830154811015613954578260080160008460050183815481106138c8576138c861475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff1916905560058401805460078601929190849081106139115761391161475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff191681556001818101839055600290910191909155016138a1565b50815460ff191682556000600183018190556002830181905560038301819055613982906004840190613f5a565b613990600583016000613f5a565b60006006830155919050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156139d35750600090506003613a80565b8460ff16601b141580156139eb57508460ff16601c14155b156139fc5750600090506004613a80565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613a50573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613a7957600060019250925050613a80565b9150600090505b94509492505050565b6000816004811115613a9d57613a9d6144cf565b03613aa55750565b6001816004811115613ab957613ab96144cf565b03613b065760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016108ab565b6002816004811115613b1a57613b1a6144cf565b03613b675760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016108ab565b6003816004811115613b7b57613b7b6144cf565b03613bd35760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016108ab565b6004816004811115613be757613be76144cf565b03610a1c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016108ab565b600081602001516000148061074b57505060200151461490565b606080613c6583613c3f565b613ca357602083015160405163092048d160e11b81526000356001600160e01b031916600482015260248101919091524660448201526064016108ab565b8260800151516001600160401b03811115613cc057613cc061422d565b604051908082528060200260200182016040528015613ce9578160200160208202803683370190505b5091508260800151516001600160401b03811115613d0957613d0961422d565b604051908082528060200260200182016040528015613d3c57816020015b6060815260200190600190039081613d275790505b50905060005b836080015151811015613f06578360e001518181518110613d6557613d6561475f565b60200260200101515a11613d9857613d7c84612de2565b6040516307aec4ab60e21b81526004016108ab91815260200190565b83608001518181518110613dae57613dae61475f565b60200260200101516001600160a01b03168460a001518281518110613dd557613dd561475f565b60200260200101518560e001518381518110613df357613df361475f565b6020026020010151908660c001518481518110613e1257613e1261475f565b6020026020010151604051613e279190614d80565b600060405180830381858888f193505050503d8060008114613e65576040519150601f19603f3d011682016040523d82523d6000602084013e613e6a565b606091505b50848381518110613e7d57613e7d61475f565b60200260200101848481518110613e9657613e9661475f565b6020026020010182905282151515158152505050828181518110613ebc57613ebc61475f565b6020026020010151613efe5780828281518110613edb57613edb61475f565b60200260200101516040516376df417560e11b81526004016108ab92919061512f565b600101613d42565b50915091565b60405180610100016040528060008152602001600081526020016000815260200160006001600160a01b03168152602001606081526020016060815260200160608152602001606081525090565b5080546000825590600052602060002090810190610a1c91905b80821115613f885760008155600101613f74565b5090565b60008083601f840112613f9e57600080fd5b5081356001600160401b03811115613fb557600080fd5b6020830191508360208260051b85010111156116c357600080fd5b60008060008060008060608789031215613fe957600080fd5b86356001600160401b038082111561400057600080fd5b61400c8a838b01613f8c565b9098509650602089013591508082111561402557600080fd5b6140318a838b01613f8c565b9096509450604089013591508082111561404a57600080fd5b5061405789828a01613f8c565b979a9699509497509295939492505050565b6000806020838503121561407c57600080fd5b82356001600160401b0381111561409257600080fd5b61409e85828601613f8c565b90969095509350505050565b60008151808452602080850194506020840160005b838110156140e45781516001600160a01b0316875295820195908201906001016140bf565b509495945050505050565b60208152600061074860208301846140aa565b60006020828403121561411457600080fd5b5035919050565b60008083601f84011261412d57600080fd5b5081356001600160401b0381111561414457600080fd5b6020830191508360206060830285010111156116c357600080fd5b60008060008060006060868803121561417757600080fd5b85356001600160401b038082111561418e57600080fd5b9087019060e0828a0312156141a257600080fd5b909550602087013590808211156141b857600080fd5b6141c489838a01613f8c565b909650945060408801359150808211156141dd57600080fd5b506141ea8882890161411b565b969995985093965092949392505050565b80356001600160a01b0381168114610c7957600080fd5b60006020828403121561422457600080fd5b610748826141fb565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b03811182821017156142655761426561422d565b60405290565b60405161010081016001600160401b03811182821017156142655761426561422d565b604051601f8201601f191681016001600160401b03811182821017156142b6576142b661422d565b604052919050565b60006001600160401b038211156142d7576142d761422d565b5060051b60200190565b600082601f8301126142f257600080fd5b81356020614307614302836142be565b61428e565b8083825260208201915060208460051b87010193508684111561432957600080fd5b602086015b84811015614353578035600681106143465760008081fd5b835291830191830161432e565b509695505050505050565b600082601f83011261436f57600080fd5b8135602061437f614302836142be565b8083825260208201915060208460051b8701019350868411156143a157600080fd5b602086015b84811015614353576143b7816141fb565b83529183019183016143a6565b600080604083850312156143d757600080fd5b82356001600160401b03808211156143ee57600080fd5b6143fa868387016142e1565b9350602085013591508082111561441057600080fd5b5061441d8582860161435e565b9150509250929050565b803560108110610c7957600080fd5b6000806040838503121561444957600080fd5b61445283614427565b9150614460602084016141fb565b90509250929050565b60008060008060006060868803121561448157600080fd5b85356001600160401b038082111561449857600080fd5b90870190610100828a0312156141a257600080fd5b600080604083850312156144c057600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60a08101600587106144f9576144f96144cf565b95815260208101949094526040840192909252606083015260809091015290565b60008151808452602080850194506020840160005b838110156140e45781516001600160601b03168752958201959082019060010161452f565b60608152600061456760608301866140aa565b828103602084015261457981866140aa565b9050828103604084015261458d818561451a565b9695505050505050565b602081526000610748602083018461451a565b6000602082840312156145bc57600080fd5b61074882614427565b600082601f8301126145d657600080fd5b813560206145e6614302836142be565b8083825260208201915060208460051b87010193508684111561460857600080fd5b602086015b848110156143535780356001600160601b038116811461462d5760008081fd5b835291830191830161460d565b6000806000806000806000806000806101408b8d03121561465a57600080fd5b8a35995060208b0135985060408b0135975061467860608c016141fb565b965060808b01356001600160401b038082111561469457600080fd5b6146a08e838f0161435e565b975060a08d01359150808211156146b657600080fd5b6146c28e838f0161435e565b965060c08d01359150808211156146d857600080fd5b6146e48e838f0161435e565b955060e08d01359150808211156146fa57600080fd5b6147068e838f016145c5565b94506101008d013591508082111561471d57600080fd5b6147298e838f016142e1565b93506101208d013591508082111561474057600080fd5b5061474d8d828e0161435e565b9150509295989b9194979a5092959850565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761074b5761074b614775565b8082018082111561074b5761074b614775565b8181038181111561074b5761074b614775565b6000826147e557634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031991909116815260200190565b6020810160108310614813576148136144cf565b91905290565b6001600160e01b03198316815260408101600b831061483a5761483a6144cf565b8260208301529392505050565b6001600160601b03818116838216019080821115610a2a57610a2a614775565b60008151808452602080850194506020840160005b838110156140e457815115158752958201959082019060010161487c565b6060815260006148ad60608301866140aa565b82810360208401526148bf818661451a565b9050828103604084015261458d8185614867565b6080815260006148e66080830187614867565b82810360208401526148f8818761451a565b9050828103604084015261490c81866140aa565b9050828103606084015261492081856140aa565b979650505050505050565b600082601f83011261493c57600080fd5b8135602061494c614302836142be565b8083825260208201915060208460051b87010193508684111561496e57600080fd5b602086015b848110156143535780358352918301918301614973565b6000601f83601f84011261499d57600080fd5b823560206149ad614302836142be565b82815260059290921b850181019181810190878411156149cc57600080fd5b8287015b84811015614a625780356001600160401b03808211156149f05760008081fd5b818a0191508a603f830112614a055760008081fd5b85820135604082821115614a1b57614a1b61422d565b614a2c828b01601f1916890161428e565b92508183528c81838601011115614a435760008081fd5b81818501898501375060009082018701528452509183019183016149d0565b50979650505050505050565b600060e08236031215614a8057600080fd5b614a88614243565b8235815260208301356020820152614aa2604084016141fb565b604082015260608301356001600160401b0380821115614ac157600080fd5b614acd368387016142e1565b60608401526080850135915080821115614ae657600080fd5b614af23683870161492b565b608084015260a0850135915080821115614b0b57600080fd5b614b173683870161498a565b60a084015260c0850135915080821115614b3057600080fd5b50614b3d3682860161492b565b60c08301525092915050565b60006101008236031215614b5c57600080fd5b614b6461426b565b823581526020830135602082015260408301356040820152614b88606084016141fb565b606082015260808301356001600160401b0380821115614ba757600080fd5b614bb33683870161435e565b608084015260a0850135915080821115614bcc57600080fd5b614bd83683870161492b565b60a084015260c0850135915080821115614bf157600080fd5b614bfd3683870161498a565b60c084015260e0850135915080821115614c1657600080fd5b50614c233682860161492b565b60e08301525092915050565b600060018201614c4157614c41614775565b5060010190565b634e487b7160e01b600052603160045260246000fd5b604081526000614c7160408301856140aa565b8281036020840152614c838185614867565b95945050505050565b604081526000614c9f6040830185614867565b8281036020840152614c8381856140aa565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60005b83811015614d17578181015183820152602001614cff565b50506000910152565b60008151808452614d38816020860160208601614cfc565b601f01601f19169290920160200192915050565b6001600160a01b03841681526001600160e01b031983166020820152606060408201819052600090614c8390830184614d20565b60008251614d92818460208701614cfc565b9190910192915050565b6020815260006107486020830184614d20565b6001600160e01b03199290921682526001600160a01b0316602082015260400190565b600060208284031215614de457600080fd5b8151801515811461134457600080fd5b60008151808452602080850194506020840160005b838110156140e457815187529582019590820190600101614e09565b60008282518085526020808601955060208260051b8401016020860160005b84811015614e7257601f19868403018952614e60838351614d20565b98840198925090830190600101614e44565b5090979650505050505050565b60006101008251845260208301516020850152604083015160408501526060830151614eb660608601826001600160a01b03169052565b506080830151816080860152614ece828601826140aa565b91505060a083015184820360a0860152614ee88282614df4565b91505060c083015184820360c0860152614f028282614e25565b91505060e083015184820360e0860152614c838282614df4565b60008151808452602080850194506020840160005b838110156140e457815160068110614f4b57614f4b6144cf565b87529582019590820190600101614f31565b608081526000614f706080830187614e7f565b8560208401528281036040840152845181526020850151602082015260018060a01b036040860151166040820152606085015160e06060830152614fb760e0830182614f1c565b905060808601518282036080840152614fd08282614df4565b91505060a086015182820360a0840152614fea8282614e25565b91505060c086015182820360c08401526150048282614df4565b9350505050614c8360608301846001600160a01b03169052565b60006020828403121561503057600080fd5b81356002811061134457600080fd5b60006020828403121561505157600080fd5b813560ff8116811461134457600080fd5b6040815260006150756040830185614e7f565b905060018060a01b03831660208301529392505050565b6001600160e01b03198316815281516000906150af816004850160208701614cfc565b919091016004019392505050565b6080815260006150d06080830187614d20565b82810360208401526150e281876140aa565b905082810360408401526150f68186614867565b905082810360608401526149208185614e25565b60408152600061511d6040830185614867565b8281036020840152614c838185614e25565b8281526040602082015260006106476040830184614d2056fe5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd976240a26469706673582212200c6f63384302c679c24a323da0191d39419570db3a104ad821b83178df1126da64736f6c63430008170033", + "blockNumber": 5709370, + "bytecode": "0x60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61519e80620000f46000396000f3fe608060405234801561001057600080fd5b50600436106102065760003560e01c80639b19dbfd1161011a578063cc7e6b3b116100ad578063de981f1b1161007c578063de981f1b146104ae578063e75235b8146104c1578063e9c03498146104de578063f80b5352146104f1578063f896f070146104f957600080fd5b8063cc7e6b3b14610460578063d0a50db014610480578063d78392f814610488578063dafae4081461049b57600080fd5b8063b405aaf2116100e9578063b405aaf21461041b578063b9c362091461042e578063bc96180b14610441578063c441c4a81461044957600080fd5b80639b19dbfd14610392578063a64a83801461039a578063aee1767f146103ad578063b384abef146103c057600080fd5b80633644e5151161019d5780637f7fe0581161016c5780637f7fe05814610303578063800eaab31461032e578063865e6fd3146103415780638dc0dbc614610354578063901979d51461036757600080fd5b80633644e515146102bc57806362077409146102c5578063776fb1ec146102d85780637de5dedd146102fb57600080fd5b80631f425338116101d95780631f425338146102635780632d6d7d731461027657806334d5f37b1461028957806335da8121146102a957600080fd5b806301a5f43f1461020b57806306aba0e1146102205780630a44fa431461023b5780630f7c31891461024e575b600080fd5b61021e610219366004613fd0565b61050c565b005b6102286105bb565b6040519081526020015b60405180910390f35b610228610249366004614069565b6105ca565b61025661064f565b60405161023291906140ef565b61021e610271366004614069565b610668565b610256610284366004614069565b61070a565b610228610297366004614102565b60026020526000908152604090205481565b61021e6102b7366004614069565b610751565b61022860015481565b61021e6102d336600461415f565b610799565b6102eb6102e6366004614102565b6107c9565b6040519015158152602001610232565b610228610816565b610316610311366004614212565b61086c565b6040516001600160a01b039091168152602001610232565b61021e61033c3660046143c4565b6108ed565b61021e61034f366004614436565b610925565b61021e610362366004614469565b610940565b61037a610375366004614212565b61096a565b6040516001600160601b039091168152602001610232565b6102566109a0565b61021e6103a8366004614102565b610a0b565b6103166103bb366004614212565b610a1f565b61040a6103ce3660046144ad565b600360208181526000938452604080852090915291835291208054600182015460028301549383015460069093015460ff909216939092909185565b6040516102329594939291906144e5565b6102eb610429366004614212565b610a31565b61021e61043c3660046144ad565b610a69565b600454610228565b610451610a7b565b60405161023293929190614554565b61047361046e366004614069565b610b55565b6040516102329190614597565b610228610b93565b61037a610496366004614212565b610ba6565b6102eb6104a9366004614102565b610bb1565b6103166104bc3660046145aa565b610c03565b6104c9610c7e565b60408051928352602083019190915201610232565b61021e6104ec366004614069565b610cc6565b610256610d0f565b61021e61050736600461463a565b610d72565b610514610eac565b6105b286868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808a0282810182019093528982529093508992508891829185019084908082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250610f0892505050565b50505050505050565b60006105c561126a565b905090565b600082828080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061060b925083915061127d9050565b6106478484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506112b292505050565b949350505050565b60606105c5600080516020615149833981519152611337565b610670610eac565b8181808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506106af925083915061127d9050565b60008051602061514983398151915260005b83811015610703576106fa8585838181106106de576106de61475f565b90506020020160208101906106f39190614212565b839061134b565b506001016106c1565b5050505050565b606061074883838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250611360915050565b90505b92915050565b610759610eac565b6107958282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506114b392505050565b5050565b6107a233611570565b6107bb6107b56060870160408801614212565b336115b2565b61070385858585853361160d565b60008060008381527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff602052604090205460ff16600481111561080e5761080e6144cf565b141592915050565b600080610821611641565b905060008061082e610c7e565b9150915080600182856004015485610846919061478b565b61085091906147a2565b61085a91906147b5565b61086491906147c8565b935050505090565b600080600061088261087c611641565b85611665565b91509150816108b45760405163141e2e1f60e11b81526001600160a01b03851660048201526024015b60405180910390fd5b6108bc611641565b60010181815481106108d0576108d061475f565b6000918252602090912001546001600160a01b0316949350505050565b33301461091b576000356001600160e01b0319166040516307337e1960e41b81526004016108ab91906147ea565b61079582826116ca565b61092d610eac565b61093681611773565b61079582826117a9565b61094933611570565b61095c6107b56080870160608801614212565b61070385858585853361184d565b600080610975611641565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b031690565b60606109aa611641565b600101805480602002602001604051908101604052809291908181526020018280548015610a0157602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116109e3575b5050505050905090565b610a13610eac565b610a1c81611881565b50565b6000610a2a826118ee565b5092915050565b600080610a3c611641565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b0316151590565b610a71610eac565b610795828261196e565b60608060606000610a8a611641565b805460408051602080840282018101909252828152929350839190830182828015610ade57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610ac0575b5050505050935080600101805480602002602001604051908101604052809291908181526020018280548015610b3d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b1f575b50505050509250610b4d84611a70565b915050909192565b6060610748838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611a7092505050565b6000610b9d611641565b60010154919050565b600061074b82611b5c565b60007ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00610bdc61126a565b8160010154610beb919061478b565b6002820154610bfa908561478b565b10159392505050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115610c3a57610c3a6144cf565b60ff1681526020810191909152604001600020546001600160a01b0316905080610c79578160405163409140df60e11b81526004016108ab91906147ff565b919050565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f01547ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f02549091565b610cce610eac565b610d0a828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611b9192505050565b505050565b6060610d19611641565b805460408051602080840282018101909252828152929190830182828015610a01576020028201919060005260206000209081546001600160a01b031681526001909101906020018083116109e3575050505050905090565b600054610100900460ff1615808015610d925750600054600160ff909116105b80610dac5750303b158015610dac575060005460ff166001145b610e0f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016108ab565b6000805460ff191660011790558015610e32576000805461ff0019166101001790555b610e3f600160ff1b611f77565b610e498383611fa7565b610e598b8b8b8b8b8b8b8b611fd8565b8015610e9f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610f06576000356001600160e01b0319166001604051620f948f60ea1b81526004016108ab929190614819565b565b6060610f148383612029565b610f1d8161127d565b6000610f27611641565b845187519192509081148015610f3d5750855181145b610f68576000356001600160e01b0319166040516306b5667560e21b81526004016108ab91906147ea565b806001600160401b03811115610f8057610f8061422d565b604051908082528060200260200182016040528015610fa9578160200160208202803683370190505b50935080600003610fbb575050611262565b60008060008060005b858110156111ce578a8181518110610fde57610fde61475f565b60200260200101519450898181518110610ffa57610ffa61475f565b602002602001015193508b81815181106110165761101661475f565b6020026020010151925061102985612133565b61103284612133565b826001600160601b031660000361106a576000356001600160e01b031916604051637f11b8a360e11b81526004016108ab91906147ea565b6001600160a01b03808616600081815260038a01602090815260408083205494891683528083205460028d0190925280832054938352909120546001600160601b0393841693918216926110c2929081169116614847565b6110cc9190614847565b6110d69190614847565b6001600160601b03166000148982815181106110f4576110f461475f565b6020026020010190151590811515815250508881815181106111185761111861475f565b6020026020010151156111c6578654600181810189556000898152602080822090930180546001600160a01b03808b166001600160a01b0319928316811790935591835260028c018552604080842080546001600160601b038b166001600160601b03199182168117909255868f018054978801815586528786209096018054948c1694909316841790925591835260038c0190945290208054909116821790556111c390836147a2565b91505b600101610fc4565b50808660040160008282546111e391906147a2565b909155505060405161121e906347c28ec560e11b9061120a908c908f908d9060200161489a565b604051602081830303815290604052612168565b7f897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b78888c8c8c60405161125394939291906148d3565b60405180910390a15050505050505b509392505050565b6000611274611641565b60040154905090565b61128681612195565b15610a1c576000356001600160e01b031916604051630d697db160e11b81526004016108ab91906147ea565b6000816112be8161127d565b60006112c8611641565b905060005b845181101561132f578160020160008683815181106112ee576112ee61475f565b6020908102919091018101516001600160a01b0316825281019190915260400160002054611325906001600160601b0316856147a2565b93506001016112cd565b505050919050565b6060600061134483612234565b9392505050565b6000610748836001600160a01b038416612290565b606082516001600160401b0381111561137b5761137b61422d565b6040519080825280602002602001820160405280156113a4578160200160208202803683370190505b50905060005b8351811015610a2a57600560008583815181106113c9576113c961475f565b602002602001015160058111156113e2576113e26144cf565b60058111156113f3576113f36144cf565b815260200190815260200160002060009054906101000a90046001600160a01b03168282815181106114275761142761475f565b60200260200101906001600160a01b031690816001600160a01b03168152505082801561147f575060006001600160a01b031682828151811061146c5761146c61475f565b60200260200101516001600160a01b0316145b156114ab576000356001600160e01b03191660405163053265f160e01b81526004016108ab91906147ea565b6001016113aa565b806114bd8161127d565b600080516020615149833981519152600080805b8551811015611568578581815181106114ec576114ec61475f565b602002602001015192506114ff83611773565b611510836312c0151560e21b612383565b61151a8484612516565b604080516001600160a01b038616815282151560208201529193507fb85c58eeff9fe423669ae0841666f4c8499e8731b8275eb462e4fa1720ec420e910160405180910390a16001016114d1565b505050505050565b61157981611b5c565b6001600160601b0316600003610a1c576000356001600160e01b0319166003604051620f948f60ea1b81526004016108ab929190614819565b6001600160a01b038216158015906115dc5750816001600160a01b0316816001600160a01b031614155b15610795576040516301df97c360e51b81526001600160a01b038084166004830152821660248201526044016108ab565b600061162161161b88614a6e565b8361252b565b90506105b2818787878761163c6116378e614a6e565b61263d565b61277c565b7fc648703095712c0419b6431ae642c061f0a105ac2d7c3d9604061ef4ebc3830090565b60008060005b84548110156116b8578481815481106116865761168661475f565b6000918252602090912001546001600160a01b03908116908516036116b0576001925090506116c3565b60010161166b565b506000600019915091505b9250929050565b60005b8251811015610d0a57306001600160a01b03168282815181106116f2576116f261475f565b60200260200101516001600160a01b03160361172f576000356001600160e01b03191660405163053265f160e01b81526004016108ab91906147ea565b61176b8382815181106117445761174461475f565b602002602001015183838151811061175e5761175e61475f565b6020026020010151612c48565b6001016116cd565b806001600160a01b03163b600003610a1c57604051630bfc64a360e21b81526001600160a01b03821660048201526024016108ab565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f8111156117df576117df6144cf565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115611820576118206144cf565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b61185f61185987614b49565b82612cdb565b5061156861186c87614b49565b8686868661163c61187c8d614b49565b612de2565b60038110156118a3576040516305f4dee960e31b815260040160405180910390fd5b60006118ad611641565b600581018390556040518381529091507f22d5bb5059ffe2949a098666fc198587200c8118483074120d3ca7050c7753f19060200160405180910390a15050565b6000806000806119086118ff611641565b60010186611665565b9150915081611935576040516326527e1760e01b81526001600160a01b03861660048201526024016108ab565b61193d611641565b80548290811061194f5761194f61475f565b6000918252602090912001546001600160a01b03169590945092505050565b8082118061197d575060018111155b156119a9576000356001600160e01b0319166040516387f6f09560e01b81526004016108ab91906147ea565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f0180547ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f028054928590558390557ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00805490929084908690856000611a2c83614c2f565b9091555060408051868152602081018690527f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a45050505050565b60606000611a7c611641565b905082516001600160401b03811115611a9757611a9761422d565b604051908082528060200260200182016040528015611ac0578160200160208202803683370190505b50915060005b8351811015611b5557816002016000858381518110611ae757611ae761475f565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160601b0316838281518110611b3557611b3561475f565b6001600160601b0390921660209283029190910190910152600101611ac6565b5050919050565b6000611b66611641565b6001600160a01b0390921660009081526002929092016020525060409020546001600160601b031690565b606081611b9d8161127d565b6000611ba7611641565b8451909150806001600160401b03811115611bc457611bc461422d565b604051908082528060200260200182016040528015611bed578160200160208202803683370190505b50935080600003611bff575050611f71565b60058201548254611c119083906147b5565b1015611c305760405163b2e765cb60e01b815260040160405180910390fd5b60008060008060005b85811015611ef757898181518110611c5357611c5361475f565b60200260200101519350611c66846118ee565b9095509150611c7485612133565b611c7d84612133565b6001600160a01b03851660009081526002880160205260409020546001600160601b031615801590611cd157506001600160a01b03841660009081526003880160205260409020546001600160601b031615155b898281518110611ce357611ce361475f565b602002602001019015159081151581525050888181518110611d0757611d0761475f565b602002602001015115611eef576001600160a01b038516600090815260028801602052604081205488546001600160601b039091169190611d4a906001906147b5565b9050886000018181548110611d6157611d6161475f565b60009182526020909120015489546001600160a01b03909116908a9086908110611d8d57611d8d61475f565b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790558854899080611dc757611dc7614c48565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038916825260028b0190526040902080546001600160601b031916905560018901805482908110611e2757611e2761475f565b60009182526020909120015460018a0180546001600160a01b039092169186908110611e5557611e5561475f565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555088600101805480611e9657611e96614c48565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038816825260038b0190526040902080546001600160601b0319169055611eea82866147a2565b945050505b600101611c39565b5081866004016000828254611f0c91906147b5565b9091555050604051611f3190636242a4ef60e11b9061120a908c908c90602001614c5e565b7fdf3dcd7987202f64648f3acdbf12401e3a2bb23e77e19f99826b5475cbb86369888a604051611f62929190614c8c565b60405180910390a15050505050505b50919050565b600054610100900460ff16611f9e5760405162461bcd60e51b81526004016108ab90614cb1565b610a1c81612f2c565b600054610100900460ff16611fce5760405162461bcd60e51b81526004016108ab90614cb1565b6107958282612f5c565b600054610100900460ff16611fff5760405162461bcd60e51b81526004016108ab90614cb1565b6120098888612f8e565b61201284612fe5565b61201f8686858585613015565b5050505050505050565b81518151606091908082016001600160401b0381111561204b5761204b61422d565b604051908082528060200260200182016040528015612074578160200160208202803683370190505b50925060005b828110156120ce578581815181106120945761209461475f565b60200260200101518482815181106120ae576120ae61475f565b6001600160a01b039092166020928302919091019091015260010161207a565b60005b82811015612129578581815181106120eb576120eb61475f565b60200260200101518583815181106121055761210561475f565b6001600160a01b0390921660209283029190910190910152600191820191016120d1565b5050505092915050565b6001600160a01b038116610a1c576000356001600160e01b03191660405163104c66df60e31b81526004016108ab91906147ea565b612172828261313f565b610795573382826040516319b5fdcb60e31b81526004016108ab93929190614d4c565b600081516000036121a857506000919050565b60005b600183510381101561222b57600181015b8351811015612222578381815181106121d7576121d761475f565b60200260200101516001600160a01b03168483815181106121fa576121fa61475f565b60200260200101516001600160a01b03160361221a575060019392505050565b6001016121bc565b506001016121ab565b50600092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561228457602002820191906000526020600020905b815481526020019060010190808311612270575b50505050509050919050565b600081815260018301602052604081205480156123795760006122b46001836147b5565b85549091506000906122c8906001906147b5565b905081811461232d5760008660000182815481106122e8576122e861475f565b906000526020600020015490508087600001848154811061230b5761230b61475f565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061233e5761233e614c48565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061074b565b600091505061074b565b60008160405160240161239691906147ea565b60408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b1790525190915060009081906001600160a01b038616906123df908590614d80565b600060405180830381855afa9150503d806000811461241a576040519150601f19603f3d011682016040523d82523d6000602084013e61241f565b606091505b5091509150816124e157846001600160a01b0316836040516024016124449190614d9c565b60408051601f198184030181529181526020820180516001600160e01b03166325da93a560e11b179052516124799190614d80565b600060405180830381855afa9150503d80600081146124b4576040519150601f19603f3d011682016040523d82523d6000602084013e6124b9565b606091505b509092509050816124e157838560405163069d427960e11b81526004016108ab929190614daf565b808060200190518101906124f59190614dd2565b61070357838560405163069d427960e11b81526004016108ab929190614daf565b6000610748836001600160a01b038416613471565b612533613f0c565b61254c61254584606001516001611360565b84906134c0565b9050612563600454826135c690919063ffffffff16565b600061256e82612de2565b9050600061257c6000613667565b60008181527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff6020908152604090912090870151600182018590556006909101559050825181146125ee576000356001600160e01b03191660405163d4cec26960e01b81526004016108ab91906147ea565b81817fe5af2d3fb7bcab8f865476bc675bf1bbb8b5a749c827ee1cd215dc9c2b8f92d78561261b8961263d565b898960405161262d9493929190614f5d565b60405180910390a3505092915050565b6080810151606082015160a083015151600092919083906001600160401b0381111561266b5761266b61422d565b604051908082528060200260200182016040528015612694578160200160208202803683370190505b5060c086015190915060005b82518110156126f3578660a0015181815181106126bf576126bf61475f565b6020026020010151805190602001208382815181106126e0576126e061475f565b60209081029190910101526001016126a0565b50604080517fde480f0c53a3651c08fbab1dffbc45fe574f31188827fe52cb9035da9fe57e4a8152875160208083019190915280890151828401529790910151606082015283518702938701939093206080840152835186029386019390932060a0830152805185029085012060c082015281518402919093012060e083015250610100902090565b831580159061278a57508382145b6127b5576000356001600160e01b0319166040516306b5667560e21b81526004016108ab91906147ea565b60006128426127c360015490565b612802846000604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b60405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b9050600061289161285260015490565b612802856001604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b90506000846001600160401b038111156128ad576128ad61422d565b6040519080825280602002602001820160405280156128d6578160200160208202803683370190505b5090506000856001600160401b038111156128f3576128f361422d565b60405190808252806020026020018201604052801561291c578160200160208202803683370190505b50905060008060008060003660005b8c811015612ab0578d8d828181106129455761294561475f565b90506060020191508f8f8281811061295f5761295f61475f565b9050602002016020810190612974919061501e565b9250600083600181111561298a5761298a6144cf565b036129f4576129af8b6129a0602085018561503f565b84602001358560400135613703565b94508489886129bd81614c2f565b9950815181106129cf576129cf61475f565b60200260200101906001600160a01b031690816001600160a01b031681525050612a65565b6001836001811115612a0857612a086144cf565b03612a3e57612a1e8a6129a0602085018561503f565b9450848887612a2c81614c2f565b9850815181106129cf576129cf61475f565b6000356001600160e01b031916604051630612418f60e11b81526004016108ab91906147ea565b846001600160a01b0316846001600160a01b031610612aa5576000356001600160e01b031916604051635d3dcd3160e01b81526004016108ab91906147ea565b84935060010161292b565b505050928552508252506020808b015160009081526003825260408082208d51835290925290812090612ae161372b565b90506000612aee85613735565b9050818110612b755780600003612b26576000356001600160e01b031916604051637f11b8a360e11b81526004016108ab91906147ea565b825460ff1916600190811784558301546040517f5c819725ea53655a3b898f3df59b66489761935454e9212ca1e5ebd759953d0b90600090a2612b69838e613740565b50505050505050611568565b600082612b806137ad565b612b8a91906147b5565b612b959060016147a2565b90506000612ba286613735565b9050818110612c215780600003612bda576000356001600160e01b031916604051637f11b8a360e11b81526004016108ab91906147ea565b845460ff1916600317855560018501546040517f55295d4ce992922fa2e5ffbf3a3dcdb367de0a15e125ace083456017fd22060f90600090a2505050505050505050611568565b6000356001600160e01b031916604051634ccfe64360e11b81526004016108ab91906147ea565b8060056000846005811115612c5f57612c5f6144cf565b6005811115612c7057612c706144cf565b8152602081019190915260400160002080546001600160a01b0319166001600160a01b039283161790558116826005811115612cae57612cae6144cf565b6040517f356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d90600090a35050565b6020820151600090808203612d1d5760405163092048d160e11b8152600080356001600160e01b031916600483015260248201524660448201526064016108ab565b600454612d2b9085906135c6565b6000612d3685612de2565b9050612d4182613667565b6000838152600360209081526040808320848452909152908190209087015160018201849055600690910155925084518314612d9e576000356001600160e01b03191660405163d4cec26960e01b81526004016108ab91906147ea565b8083837fd1221ffb98610024a29755d7db3c71692310f43a7cfcce7ee488a8c7e9e0bfa48888604051612dd2929190615062565b60405180910390a4505092915050565b60a0810151608082015160c083015151600092919083906001600160401b03811115612e1057612e1061422d565b604051908082528060200260200182016040528015612e39578160200160208202803683370190505b5060e086015190915060005b8251811015612e98578660c001518181518110612e6457612e6461475f565b602002602001015180519060200120838281518110612e8557612e8561475f565b6020908102919091010152600101612e45565b50604080517f1b59eeec7c321899dc1e7a5b3d876c9a445dffc6d2f96ba842d7489908fdee1281528751602080830191909152808901518284015291880151606080830191909152909701516080880152835181029381019390932060a0870152835183029383019390932060c0860152805182029082012060e08501528151810291012061010083015250610120902090565b600054610100900460ff16612f535760405162461bcd60e51b81526004016108ab90614cb1565b610a1c816137b7565b600054610100900460ff16612f835760405162461bcd60e51b81526004016108ab90614cb1565b61091b600030612c48565b600054610100900460ff16612fb55760405162461bcd60e51b81526004016108ab90614cb1565b60017ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00908155610d0a838361196e565b600054610100900460ff1661300c5760405162461bcd60e51b81526004016108ab90614cb1565b610a1c816114b3565b600054610100900460ff1661303c5760405162461bcd60e51b81526004016108ab90614cb1565b6130476002856117a9565b604080516020808201839052600e60608301526d212924a223a2afa6a0a720a3a2a960911b6080808401919091528284018990528351808403909101815260a0830184528051908201207f599a80fcaa47b95e2323ab4d34d34e0cc9feda4b843edafcc30c7bdf60ea15bf60c08401527fe4d2346818310a10fac5a6d073d3dce255578caf4aa81ddcbcc7c2b98405eef060e08401527f2a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4de61010084015261012080840191909152835180840390910181526101409092019092528051910120600155613134818385610f08565b506107036003611881565b6001600061315a600080516020615149833981519152611337565b8051909150600081900361316f57505061074b565b6000816001600160401b038111156131895761318961422d565b6040519080825280602002602001820160405280156131b2578160200160208202803683370190505b5090506000826001600160401b038111156131cf576131cf61422d565b60405190808252806020026020018201604052801561320257816020015b60608152602001906001900390816131ed5790505b5090506000878760405160200161321a92919061508c565b604051602081830303815290604052905060008160405160240161323e9190614d9c565b60408051601f198184030181529190526020810180516001600160e01b03166325da93a560e11b179052905060005b85811015613427578681815181106132875761328761475f565b60200260200101516001600160a01b0316836040516132a69190614d80565b6000604051808303816000865af19150503d80600081146132e3576040519150601f19603f3d011682016040523d82523d6000602084013e6132e8565b606091505b508683815181106132fb576132fb61475f565b602002602001018684815181106133145761331461475f565b602002602001018290528215151515815250505084818151811061333a5761333a61475f565b602002602001015161341f578681815181106133585761335861475f565b60200260200101516001600160a01b0316826040516133779190614d80565b6000604051808303816000865af19150503d80600081146133b4576040519150601f19603f3d011682016040523d82523d6000602084013e6133b9565b606091505b508683815181106133cc576133cc61475f565b602002602001018684815181106133e5576133e561475f565b602002602001018290528215151515815250505087801561341c57508481815181106134135761341361475f565b60200260200101515b97505b60010161326d565b507fc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b638287868660405161345d94939291906150bd565b60405180910390a150505050505092915050565b60008181526001830160205260408120546134b85750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561074b565b50600061074b565b6134c8613f0c565b8251815260006020808301919091528301516040808301919091528301516001600160a01b0316606080830191909152830151516001600160401b038111156135135761351361422d565b60405190808252806020026020018201604052801561353c578160200160208202803683370190505b5060808083019190915283015160a08083019190915283015160c08083019190915283015160e082015260005b836060015151811015610a2a578281815181106135885761358861475f565b6020026020010151826080015182815181106135a6576135a661475f565b6001600160a01b0390921660209283029190910190910152600101613569565b60008260800151511180156135e457508160a0015151826080015151145b80156135f957508160c0015151826080015151145b801561360e57508160e0015151826080015151145b613639576000356001600160e01b0319166040516306b5667560e21b81526004016108ab91906147ea565b61364381426147a2565b826040015111156107955760405163ad89be9d60e01b815260040160405180910390fd5b600081815260026020526040812054908190036136965750600090815260026020526040902060019081905590565b60008281526003602090815260408083208484529091528120906000825460ff1660048111156136c8576136c86144cf565b036136e65760405163757a436360e01b815260040160405180910390fd5b505050600090815260026020526040902080546001019081905590565b60008060006137148787878761399c565b9150915061372181613a89565b5095945050505050565b60006105c5610816565b600061074b826112b2565b61374981613c3f565b1561079557815460ff1916600217825560008061376583613c59565b9150915083600101547fe134987599ae266ec90edeff1b26125b287dbb57b10822649432d1bb26537fba838360405161379f92919061510a565b60405180910390a250505050565b60006105c56105bb565b600481905560405181907fe5cd1c123a8cf63fa1b7229678db61fe8ae99dbbd27889370b6667c8cae97da190600090a250565b600483015481101561389d578260080160008460040183815481106138115761381161475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff19169055600484018054600786019291908490811061385a5761385a61475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff191681556001818101839055600290910191909155016137ea565b5060005b6005830154811015613954578260080160008460050183815481106138c8576138c861475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff1916905560058401805460078601929190849081106139115761391161475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff191681556001818101839055600290910191909155016138a1565b50815460ff191682556000600183018190556002830181905560038301819055613982906004840190613f5a565b613990600583016000613f5a565b60006006830155919050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156139d35750600090506003613a80565b8460ff16601b141580156139eb57508460ff16601c14155b156139fc5750600090506004613a80565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613a50573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613a7957600060019250925050613a80565b9150600090505b94509492505050565b6000816004811115613a9d57613a9d6144cf565b03613aa55750565b6001816004811115613ab957613ab96144cf565b03613b065760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016108ab565b6002816004811115613b1a57613b1a6144cf565b03613b675760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016108ab565b6003816004811115613b7b57613b7b6144cf565b03613bd35760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016108ab565b6004816004811115613be757613be76144cf565b03610a1c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016108ab565b600081602001516000148061074b57505060200151461490565b606080613c6583613c3f565b613ca357602083015160405163092048d160e11b81526000356001600160e01b031916600482015260248101919091524660448201526064016108ab565b8260800151516001600160401b03811115613cc057613cc061422d565b604051908082528060200260200182016040528015613ce9578160200160208202803683370190505b5091508260800151516001600160401b03811115613d0957613d0961422d565b604051908082528060200260200182016040528015613d3c57816020015b6060815260200190600190039081613d275790505b50905060005b836080015151811015613f06578360e001518181518110613d6557613d6561475f565b60200260200101515a11613d9857613d7c84612de2565b6040516307aec4ab60e21b81526004016108ab91815260200190565b83608001518181518110613dae57613dae61475f565b60200260200101516001600160a01b03168460a001518281518110613dd557613dd561475f565b60200260200101518560e001518381518110613df357613df361475f565b6020026020010151908660c001518481518110613e1257613e1261475f565b6020026020010151604051613e279190614d80565b600060405180830381858888f193505050503d8060008114613e65576040519150601f19603f3d011682016040523d82523d6000602084013e613e6a565b606091505b50848381518110613e7d57613e7d61475f565b60200260200101848481518110613e9657613e9661475f565b6020026020010182905282151515158152505050828181518110613ebc57613ebc61475f565b6020026020010151613efe5780828281518110613edb57613edb61475f565b60200260200101516040516376df417560e11b81526004016108ab92919061512f565b600101613d42565b50915091565b60405180610100016040528060008152602001600081526020016000815260200160006001600160a01b03168152602001606081526020016060815260200160608152602001606081525090565b5080546000825590600052602060002090810190610a1c91905b80821115613f885760008155600101613f74565b5090565b60008083601f840112613f9e57600080fd5b5081356001600160401b03811115613fb557600080fd5b6020830191508360208260051b85010111156116c357600080fd5b60008060008060008060608789031215613fe957600080fd5b86356001600160401b038082111561400057600080fd5b61400c8a838b01613f8c565b9098509650602089013591508082111561402557600080fd5b6140318a838b01613f8c565b9096509450604089013591508082111561404a57600080fd5b5061405789828a01613f8c565b979a9699509497509295939492505050565b6000806020838503121561407c57600080fd5b82356001600160401b0381111561409257600080fd5b61409e85828601613f8c565b90969095509350505050565b60008151808452602080850194506020840160005b838110156140e45781516001600160a01b0316875295820195908201906001016140bf565b509495945050505050565b60208152600061074860208301846140aa565b60006020828403121561411457600080fd5b5035919050565b60008083601f84011261412d57600080fd5b5081356001600160401b0381111561414457600080fd5b6020830191508360206060830285010111156116c357600080fd5b60008060008060006060868803121561417757600080fd5b85356001600160401b038082111561418e57600080fd5b9087019060e0828a0312156141a257600080fd5b909550602087013590808211156141b857600080fd5b6141c489838a01613f8c565b909650945060408801359150808211156141dd57600080fd5b506141ea8882890161411b565b969995985093965092949392505050565b80356001600160a01b0381168114610c7957600080fd5b60006020828403121561422457600080fd5b610748826141fb565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b03811182821017156142655761426561422d565b60405290565b60405161010081016001600160401b03811182821017156142655761426561422d565b604051601f8201601f191681016001600160401b03811182821017156142b6576142b661422d565b604052919050565b60006001600160401b038211156142d7576142d761422d565b5060051b60200190565b600082601f8301126142f257600080fd5b81356020614307614302836142be565b61428e565b8083825260208201915060208460051b87010193508684111561432957600080fd5b602086015b84811015614353578035600681106143465760008081fd5b835291830191830161432e565b509695505050505050565b600082601f83011261436f57600080fd5b8135602061437f614302836142be565b8083825260208201915060208460051b8701019350868411156143a157600080fd5b602086015b84811015614353576143b7816141fb565b83529183019183016143a6565b600080604083850312156143d757600080fd5b82356001600160401b03808211156143ee57600080fd5b6143fa868387016142e1565b9350602085013591508082111561441057600080fd5b5061441d8582860161435e565b9150509250929050565b803560108110610c7957600080fd5b6000806040838503121561444957600080fd5b61445283614427565b9150614460602084016141fb565b90509250929050565b60008060008060006060868803121561448157600080fd5b85356001600160401b038082111561449857600080fd5b90870190610100828a0312156141a257600080fd5b600080604083850312156144c057600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60a08101600587106144f9576144f96144cf565b95815260208101949094526040840192909252606083015260809091015290565b60008151808452602080850194506020840160005b838110156140e45781516001600160601b03168752958201959082019060010161452f565b60608152600061456760608301866140aa565b828103602084015261457981866140aa565b9050828103604084015261458d818561451a565b9695505050505050565b602081526000610748602083018461451a565b6000602082840312156145bc57600080fd5b61074882614427565b600082601f8301126145d657600080fd5b813560206145e6614302836142be565b8083825260208201915060208460051b87010193508684111561460857600080fd5b602086015b848110156143535780356001600160601b038116811461462d5760008081fd5b835291830191830161460d565b6000806000806000806000806000806101408b8d03121561465a57600080fd5b8a35995060208b0135985060408b0135975061467860608c016141fb565b965060808b01356001600160401b038082111561469457600080fd5b6146a08e838f0161435e565b975060a08d01359150808211156146b657600080fd5b6146c28e838f0161435e565b965060c08d01359150808211156146d857600080fd5b6146e48e838f0161435e565b955060e08d01359150808211156146fa57600080fd5b6147068e838f016145c5565b94506101008d013591508082111561471d57600080fd5b6147298e838f016142e1565b93506101208d013591508082111561474057600080fd5b5061474d8d828e0161435e565b9150509295989b9194979a5092959850565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761074b5761074b614775565b8082018082111561074b5761074b614775565b8181038181111561074b5761074b614775565b6000826147e557634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031991909116815260200190565b6020810160108310614813576148136144cf565b91905290565b6001600160e01b03198316815260408101600b831061483a5761483a6144cf565b8260208301529392505050565b6001600160601b03818116838216019080821115610a2a57610a2a614775565b60008151808452602080850194506020840160005b838110156140e457815115158752958201959082019060010161487c565b6060815260006148ad60608301866140aa565b82810360208401526148bf818661451a565b9050828103604084015261458d8185614867565b6080815260006148e66080830187614867565b82810360208401526148f8818761451a565b9050828103604084015261490c81866140aa565b9050828103606084015261492081856140aa565b979650505050505050565b600082601f83011261493c57600080fd5b8135602061494c614302836142be565b8083825260208201915060208460051b87010193508684111561496e57600080fd5b602086015b848110156143535780358352918301918301614973565b6000601f83601f84011261499d57600080fd5b823560206149ad614302836142be565b82815260059290921b850181019181810190878411156149cc57600080fd5b8287015b84811015614a625780356001600160401b03808211156149f05760008081fd5b818a0191508a603f830112614a055760008081fd5b85820135604082821115614a1b57614a1b61422d565b614a2c828b01601f1916890161428e565b92508183528c81838601011115614a435760008081fd5b81818501898501375060009082018701528452509183019183016149d0565b50979650505050505050565b600060e08236031215614a8057600080fd5b614a88614243565b8235815260208301356020820152614aa2604084016141fb565b604082015260608301356001600160401b0380821115614ac157600080fd5b614acd368387016142e1565b60608401526080850135915080821115614ae657600080fd5b614af23683870161492b565b608084015260a0850135915080821115614b0b57600080fd5b614b173683870161498a565b60a084015260c0850135915080821115614b3057600080fd5b50614b3d3682860161492b565b60c08301525092915050565b60006101008236031215614b5c57600080fd5b614b6461426b565b823581526020830135602082015260408301356040820152614b88606084016141fb565b606082015260808301356001600160401b0380821115614ba757600080fd5b614bb33683870161435e565b608084015260a0850135915080821115614bcc57600080fd5b614bd83683870161492b565b60a084015260c0850135915080821115614bf157600080fd5b614bfd3683870161498a565b60c084015260e0850135915080821115614c1657600080fd5b50614c233682860161492b565b60e08301525092915050565b600060018201614c4157614c41614775565b5060010190565b634e487b7160e01b600052603160045260246000fd5b604081526000614c7160408301856140aa565b8281036020840152614c838185614867565b95945050505050565b604081526000614c9f6040830185614867565b8281036020840152614c8381856140aa565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60005b83811015614d17578181015183820152602001614cff565b50506000910152565b60008151808452614d38816020860160208601614cfc565b601f01601f19169290920160200192915050565b6001600160a01b03841681526001600160e01b031983166020820152606060408201819052600090614c8390830184614d20565b60008251614d92818460208701614cfc565b9190910192915050565b6020815260006107486020830184614d20565b6001600160e01b03199290921682526001600160a01b0316602082015260400190565b600060208284031215614de457600080fd5b8151801515811461134457600080fd5b60008151808452602080850194506020840160005b838110156140e457815187529582019590820190600101614e09565b60008282518085526020808601955060208260051b8401016020860160005b84811015614e7257601f19868403018952614e60838351614d20565b98840198925090830190600101614e44565b5090979650505050505050565b60006101008251845260208301516020850152604083015160408501526060830151614eb660608601826001600160a01b03169052565b506080830151816080860152614ece828601826140aa565b91505060a083015184820360a0860152614ee88282614df4565b91505060c083015184820360c0860152614f028282614e25565b91505060e083015184820360e0860152614c838282614df4565b60008151808452602080850194506020840160005b838110156140e457815160068110614f4b57614f4b6144cf565b87529582019590820190600101614f31565b608081526000614f706080830187614e7f565b8560208401528281036040840152845181526020850151602082015260018060a01b036040860151166040820152606085015160e06060830152614fb760e0830182614f1c565b905060808601518282036080840152614fd08282614df4565b91505060a086015182820360a0840152614fea8282614e25565b91505060c086015182820360c08401526150048282614df4565b9350505050614c8360608301846001600160a01b03169052565b60006020828403121561503057600080fd5b81356002811061134457600080fd5b60006020828403121561505157600080fd5b813560ff8116811461134457600080fd5b6040815260006150756040830185614e7f565b905060018060a01b03831660208301529392505050565b6001600160e01b03198316815281516000906150af816004850160208701614cfc565b919091016004019392505050565b6080815260006150d06080830187614d20565b82810360208401526150e281876140aa565b905082810360408401526150f68186614867565b905082810360608401526149208185614e25565b60408152600061511d6040830185614867565b8281036020840152614c838185614e25565b8281526040602082015260006106476040830184614d2056fe5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd976240a26469706673582212200bc26b64e43b490eeae165d45d8ba67887875e399107a0c8239224bc05fd68d764736f6c63430008170033", "chainId": 11155111, "contractAbsolutePath": "MainchainBridgeManager.sol", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102065760003560e01c80639b19dbfd1161011a578063cc7e6b3b116100ad578063de981f1b1161007c578063de981f1b146104ae578063e75235b8146104c1578063e9c03498146104de578063f80b5352146104f1578063f896f070146104f957600080fd5b8063cc7e6b3b14610460578063d0a50db014610480578063d78392f814610488578063dafae4081461049b57600080fd5b8063b405aaf2116100e9578063b405aaf21461041b578063b9c362091461042e578063bc96180b14610441578063c441c4a81461044957600080fd5b80639b19dbfd14610392578063a64a83801461039a578063aee1767f146103ad578063b384abef146103c057600080fd5b80633644e5151161019d5780637f7fe0581161016c5780637f7fe05814610303578063800eaab31461032e578063865e6fd3146103415780638dc0dbc614610354578063901979d51461036757600080fd5b80633644e515146102bc57806362077409146102c5578063776fb1ec146102d85780637de5dedd146102fb57600080fd5b80631f425338116101d95780631f425338146102635780632d6d7d731461027657806334d5f37b1461028957806335da8121146102a957600080fd5b806301a5f43f1461020b57806306aba0e1146102205780630a44fa431461023b5780630f7c31891461024e575b600080fd5b61021e610219366004613fd0565b61050c565b005b6102286105bb565b6040519081526020015b60405180910390f35b610228610249366004614069565b6105ca565b61025661064f565b60405161023291906140ef565b61021e610271366004614069565b610668565b610256610284366004614069565b61070a565b610228610297366004614102565b60026020526000908152604090205481565b61021e6102b7366004614069565b610751565b61022860015481565b61021e6102d336600461415f565b610799565b6102eb6102e6366004614102565b6107c9565b6040519015158152602001610232565b610228610816565b610316610311366004614212565b61086c565b6040516001600160a01b039091168152602001610232565b61021e61033c3660046143c4565b6108ed565b61021e61034f366004614436565b610925565b61021e610362366004614469565b610940565b61037a610375366004614212565b61096a565b6040516001600160601b039091168152602001610232565b6102566109a0565b61021e6103a8366004614102565b610a0b565b6103166103bb366004614212565b610a1f565b61040a6103ce3660046144ad565b600360208181526000938452604080852090915291835291208054600182015460028301549383015460069093015460ff909216939092909185565b6040516102329594939291906144e5565b6102eb610429366004614212565b610a31565b61021e61043c3660046144ad565b610a69565b600454610228565b610451610a7b565b60405161023293929190614554565b61047361046e366004614069565b610b55565b6040516102329190614597565b610228610b93565b61037a610496366004614212565b610ba6565b6102eb6104a9366004614102565b610bb1565b6103166104bc3660046145aa565b610c03565b6104c9610c7e565b60408051928352602083019190915201610232565b61021e6104ec366004614069565b610cc6565b610256610d0f565b61021e61050736600461463a565b610d72565b610514610eac565b6105b286868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808a0282810182019093528982529093508992508891829185019084908082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250610f0892505050565b50505050505050565b60006105c561126a565b905090565b600082828080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061060b925083915061127d9050565b6106478484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506112b292505050565b949350505050565b60606105c5600080516020615149833981519152611337565b610670610eac565b8181808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506106af925083915061127d9050565b60008051602061514983398151915260005b83811015610703576106fa8585838181106106de576106de61475f565b90506020020160208101906106f39190614212565b839061134b565b506001016106c1565b5050505050565b606061074883838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250611360915050565b90505b92915050565b610759610eac565b6107958282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506114b392505050565b5050565b6107a233611570565b6107bb6107b56060870160408801614212565b336115b2565b61070385858585853361160d565b60008060008381527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff602052604090205460ff16600481111561080e5761080e6144cf565b141592915050565b600080610821611641565b905060008061082e610c7e565b9150915080600182856004015485610846919061478b565b61085091906147a2565b61085a91906147b5565b61086491906147c8565b935050505090565b600080600061088261087c611641565b85611665565b91509150816108b45760405163141e2e1f60e11b81526001600160a01b03851660048201526024015b60405180910390fd5b6108bc611641565b60010181815481106108d0576108d061475f565b6000918252602090912001546001600160a01b0316949350505050565b33301461091b576000356001600160e01b0319166040516307337e1960e41b81526004016108ab91906147ea565b61079582826116ca565b61092d610eac565b61093681611773565b61079582826117a9565b61094933611570565b61095c6107b56080870160608801614212565b61070385858585853361184d565b600080610975611641565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b031690565b60606109aa611641565b600101805480602002602001604051908101604052809291908181526020018280548015610a0157602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116109e3575b5050505050905090565b610a13610eac565b610a1c81611881565b50565b6000610a2a826118ee565b5092915050565b600080610a3c611641565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b0316151590565b610a71610eac565b610795828261196e565b60608060606000610a8a611641565b805460408051602080840282018101909252828152929350839190830182828015610ade57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610ac0575b5050505050935080600101805480602002602001604051908101604052809291908181526020018280548015610b3d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b1f575b50505050509250610b4d84611a70565b915050909192565b6060610748838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611a7092505050565b6000610b9d611641565b60010154919050565b600061074b82611b5c565b60007ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00610bdc61126a565b8160010154610beb919061478b565b6002820154610bfa908561478b565b10159392505050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115610c3a57610c3a6144cf565b60ff1681526020810191909152604001600020546001600160a01b0316905080610c79578160405163409140df60e11b81526004016108ab91906147ff565b919050565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f01547ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f02549091565b610cce610eac565b610d0a828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611b9192505050565b505050565b6060610d19611641565b805460408051602080840282018101909252828152929190830182828015610a01576020028201919060005260206000209081546001600160a01b031681526001909101906020018083116109e3575050505050905090565b600054610100900460ff1615808015610d925750600054600160ff909116105b80610dac5750303b158015610dac575060005460ff166001145b610e0f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016108ab565b6000805460ff191660011790558015610e32576000805461ff0019166101001790555b610e3f600160ff1b611f77565b610e498383611fa7565b610e598b8b8b8b8b8b8b8b611fd8565b8015610e9f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610f06576000356001600160e01b0319166001604051620f948f60ea1b81526004016108ab929190614819565b565b6060610f148383612029565b610f1d8161127d565b6000610f27611641565b845187519192509081148015610f3d5750855181145b610f68576000356001600160e01b0319166040516306b5667560e21b81526004016108ab91906147ea565b806001600160401b03811115610f8057610f8061422d565b604051908082528060200260200182016040528015610fa9578160200160208202803683370190505b50935080600003610fbb575050611262565b60008060008060005b858110156111ce578a8181518110610fde57610fde61475f565b60200260200101519450898181518110610ffa57610ffa61475f565b602002602001015193508b81815181106110165761101661475f565b6020026020010151925061102985612133565b61103284612133565b826001600160601b031660000361106a576000356001600160e01b031916604051637f11b8a360e11b81526004016108ab91906147ea565b6001600160a01b03808616600081815260038a01602090815260408083205494891683528083205460028d0190925280832054938352909120546001600160601b0393841693918216926110c2929081169116614847565b6110cc9190614847565b6110d69190614847565b6001600160601b03166000148982815181106110f4576110f461475f565b6020026020010190151590811515815250508881815181106111185761111861475f565b6020026020010151156111c6578654600181810189556000898152602080822090930180546001600160a01b03808b166001600160a01b0319928316811790935591835260028c018552604080842080546001600160601b038b166001600160601b03199182168117909255868f018054978801815586528786209096018054948c1694909316841790925591835260038c0190945290208054909116821790556111c390836147a2565b91505b600101610fc4565b50808660040160008282546111e391906147a2565b909155505060405161121e906347c28ec560e11b9061120a908c908f908d9060200161489a565b604051602081830303815290604052612168565b7f897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b78888c8c8c60405161125394939291906148d3565b60405180910390a15050505050505b509392505050565b6000611274611641565b60040154905090565b61128681612195565b15610a1c576000356001600160e01b031916604051630d697db160e11b81526004016108ab91906147ea565b6000816112be8161127d565b60006112c8611641565b905060005b845181101561132f578160020160008683815181106112ee576112ee61475f565b6020908102919091018101516001600160a01b0316825281019190915260400160002054611325906001600160601b0316856147a2565b93506001016112cd565b505050919050565b6060600061134483612234565b9392505050565b6000610748836001600160a01b038416612290565b606082516001600160401b0381111561137b5761137b61422d565b6040519080825280602002602001820160405280156113a4578160200160208202803683370190505b50905060005b8351811015610a2a57600560008583815181106113c9576113c961475f565b602002602001015160058111156113e2576113e26144cf565b60058111156113f3576113f36144cf565b815260200190815260200160002060009054906101000a90046001600160a01b03168282815181106114275761142761475f565b60200260200101906001600160a01b031690816001600160a01b03168152505082801561147f575060006001600160a01b031682828151811061146c5761146c61475f565b60200260200101516001600160a01b0316145b156114ab576000356001600160e01b03191660405163053265f160e01b81526004016108ab91906147ea565b6001016113aa565b806114bd8161127d565b600080516020615149833981519152600080805b8551811015611568578581815181106114ec576114ec61475f565b602002602001015192506114ff83611773565b611510836312c0151560e21b612383565b61151a8484612516565b604080516001600160a01b038616815282151560208201529193507fb85c58eeff9fe423669ae0841666f4c8499e8731b8275eb462e4fa1720ec420e910160405180910390a16001016114d1565b505050505050565b61157981611b5c565b6001600160601b0316600003610a1c576000356001600160e01b0319166003604051620f948f60ea1b81526004016108ab929190614819565b6001600160a01b038216158015906115dc5750816001600160a01b0316816001600160a01b031614155b15610795576040516301df97c360e51b81526001600160a01b038084166004830152821660248201526044016108ab565b600061162161161b88614a6e565b8361252b565b90506105b2818787878761163c6116378e614a6e565b61263d565b61277c565b7fc648703095712c0419b6431ae642c061f0a105ac2d7c3d9604061ef4ebc3830090565b60008060005b84548110156116b8578481815481106116865761168661475f565b6000918252602090912001546001600160a01b03908116908516036116b0576001925090506116c3565b60010161166b565b506000600019915091505b9250929050565b60005b8251811015610d0a57306001600160a01b03168282815181106116f2576116f261475f565b60200260200101516001600160a01b03160361172f576000356001600160e01b03191660405163053265f160e01b81526004016108ab91906147ea565b61176b8382815181106117445761174461475f565b602002602001015183838151811061175e5761175e61475f565b6020026020010151612c48565b6001016116cd565b806001600160a01b03163b600003610a1c57604051630bfc64a360e21b81526001600160a01b03821660048201526024016108ab565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f8111156117df576117df6144cf565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115611820576118206144cf565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b61185f61185987614b49565b82612cdb565b5061156861186c87614b49565b8686868661163c61187c8d614b49565b612de2565b60038110156118a3576040516305f4dee960e31b815260040160405180910390fd5b60006118ad611641565b600581018390556040518381529091507f22d5bb5059ffe2949a098666fc198587200c8118483074120d3ca7050c7753f19060200160405180910390a15050565b6000806000806119086118ff611641565b60010186611665565b9150915081611935576040516326527e1760e01b81526001600160a01b03861660048201526024016108ab565b61193d611641565b80548290811061194f5761194f61475f565b6000918252602090912001546001600160a01b03169590945092505050565b8082118061197d575060018111155b156119a9576000356001600160e01b0319166040516387f6f09560e01b81526004016108ab91906147ea565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f0180547ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f028054928590558390557ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00805490929084908690856000611a2c83614c2f565b9091555060408051868152602081018690527f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a45050505050565b60606000611a7c611641565b905082516001600160401b03811115611a9757611a9761422d565b604051908082528060200260200182016040528015611ac0578160200160208202803683370190505b50915060005b8351811015611b5557816002016000858381518110611ae757611ae761475f565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160601b0316838281518110611b3557611b3561475f565b6001600160601b0390921660209283029190910190910152600101611ac6565b5050919050565b6000611b66611641565b6001600160a01b0390921660009081526002929092016020525060409020546001600160601b031690565b606081611b9d8161127d565b6000611ba7611641565b8451909150806001600160401b03811115611bc457611bc461422d565b604051908082528060200260200182016040528015611bed578160200160208202803683370190505b50935080600003611bff575050611f71565b60058201548254611c119083906147b5565b1015611c305760405163b2e765cb60e01b815260040160405180910390fd5b60008060008060005b85811015611ef757898181518110611c5357611c5361475f565b60200260200101519350611c66846118ee565b9095509150611c7485612133565b611c7d84612133565b6001600160a01b03851660009081526002880160205260409020546001600160601b031615801590611cd157506001600160a01b03841660009081526003880160205260409020546001600160601b031615155b898281518110611ce357611ce361475f565b602002602001019015159081151581525050888181518110611d0757611d0761475f565b602002602001015115611eef576001600160a01b038516600090815260028801602052604081205488546001600160601b039091169190611d4a906001906147b5565b9050886000018181548110611d6157611d6161475f565b60009182526020909120015489546001600160a01b03909116908a9086908110611d8d57611d8d61475f565b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790558854899080611dc757611dc7614c48565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038916825260028b0190526040902080546001600160601b031916905560018901805482908110611e2757611e2761475f565b60009182526020909120015460018a0180546001600160a01b039092169186908110611e5557611e5561475f565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555088600101805480611e9657611e96614c48565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038816825260038b0190526040902080546001600160601b0319169055611eea82866147a2565b945050505b600101611c39565b5081866004016000828254611f0c91906147b5565b9091555050604051611f3190636242a4ef60e11b9061120a908c908c90602001614c5e565b7fdf3dcd7987202f64648f3acdbf12401e3a2bb23e77e19f99826b5475cbb86369888a604051611f62929190614c8c565b60405180910390a15050505050505b50919050565b600054610100900460ff16611f9e5760405162461bcd60e51b81526004016108ab90614cb1565b610a1c81612f2c565b600054610100900460ff16611fce5760405162461bcd60e51b81526004016108ab90614cb1565b6107958282612f5c565b600054610100900460ff16611fff5760405162461bcd60e51b81526004016108ab90614cb1565b6120098888612f8e565b61201284612fe5565b61201f8686858585613015565b5050505050505050565b81518151606091908082016001600160401b0381111561204b5761204b61422d565b604051908082528060200260200182016040528015612074578160200160208202803683370190505b50925060005b828110156120ce578581815181106120945761209461475f565b60200260200101518482815181106120ae576120ae61475f565b6001600160a01b039092166020928302919091019091015260010161207a565b60005b82811015612129578581815181106120eb576120eb61475f565b60200260200101518583815181106121055761210561475f565b6001600160a01b0390921660209283029190910190910152600191820191016120d1565b5050505092915050565b6001600160a01b038116610a1c576000356001600160e01b03191660405163104c66df60e31b81526004016108ab91906147ea565b612172828261313f565b610795573382826040516319b5fdcb60e31b81526004016108ab93929190614d4c565b600081516000036121a857506000919050565b60005b600183510381101561222b57600181015b8351811015612222578381815181106121d7576121d761475f565b60200260200101516001600160a01b03168483815181106121fa576121fa61475f565b60200260200101516001600160a01b03160361221a575060019392505050565b6001016121bc565b506001016121ab565b50600092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561228457602002820191906000526020600020905b815481526020019060010190808311612270575b50505050509050919050565b600081815260018301602052604081205480156123795760006122b46001836147b5565b85549091506000906122c8906001906147b5565b905081811461232d5760008660000182815481106122e8576122e861475f565b906000526020600020015490508087600001848154811061230b5761230b61475f565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061233e5761233e614c48565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061074b565b600091505061074b565b60008160405160240161239691906147ea565b60408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b1790525190915060009081906001600160a01b038616906123df908590614d80565b600060405180830381855afa9150503d806000811461241a576040519150601f19603f3d011682016040523d82523d6000602084013e61241f565b606091505b5091509150816124e157846001600160a01b0316836040516024016124449190614d9c565b60408051601f198184030181529181526020820180516001600160e01b03166325da93a560e11b179052516124799190614d80565b600060405180830381855afa9150503d80600081146124b4576040519150601f19603f3d011682016040523d82523d6000602084013e6124b9565b606091505b509092509050816124e157838560405163069d427960e11b81526004016108ab929190614daf565b808060200190518101906124f59190614dd2565b61070357838560405163069d427960e11b81526004016108ab929190614daf565b6000610748836001600160a01b038416613471565b612533613f0c565b61254c61254584606001516001611360565b84906134c0565b9050612563600454826135c690919063ffffffff16565b600061256e82612de2565b9050600061257c6000613667565b60008181527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff6020908152604090912090870151600182018590556006909101559050825181146125ee576000356001600160e01b03191660405163d4cec26960e01b81526004016108ab91906147ea565b81817fe5af2d3fb7bcab8f865476bc675bf1bbb8b5a749c827ee1cd215dc9c2b8f92d78561261b8961263d565b898960405161262d9493929190614f5d565b60405180910390a3505092915050565b6080810151606082015160a083015151600092919083906001600160401b0381111561266b5761266b61422d565b604051908082528060200260200182016040528015612694578160200160208202803683370190505b5060c086015190915060005b82518110156126f3578660a0015181815181106126bf576126bf61475f565b6020026020010151805190602001208382815181106126e0576126e061475f565b60209081029190910101526001016126a0565b50604080517fde480f0c53a3651c08fbab1dffbc45fe574f31188827fe52cb9035da9fe57e4a8152875160208083019190915280890151828401529790910151606082015283518702938701939093206080840152835186029386019390932060a0830152805185029085012060c082015281518402919093012060e083015250610100902090565b831580159061278a57508382145b6127b5576000356001600160e01b0319166040516306b5667560e21b81526004016108ab91906147ea565b60006128426127c360015490565b612802846000604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b60405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b9050600061289161285260015490565b612802856001604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b90506000846001600160401b038111156128ad576128ad61422d565b6040519080825280602002602001820160405280156128d6578160200160208202803683370190505b5090506000856001600160401b038111156128f3576128f361422d565b60405190808252806020026020018201604052801561291c578160200160208202803683370190505b50905060008060008060003660005b8c811015612ab0578d8d828181106129455761294561475f565b90506060020191508f8f8281811061295f5761295f61475f565b9050602002016020810190612974919061501e565b9250600083600181111561298a5761298a6144cf565b036129f4576129af8b6129a0602085018561503f565b84602001358560400135613703565b94508489886129bd81614c2f565b9950815181106129cf576129cf61475f565b60200260200101906001600160a01b031690816001600160a01b031681525050612a65565b6001836001811115612a0857612a086144cf565b03612a3e57612a1e8a6129a0602085018561503f565b9450848887612a2c81614c2f565b9850815181106129cf576129cf61475f565b6000356001600160e01b031916604051630612418f60e11b81526004016108ab91906147ea565b846001600160a01b0316846001600160a01b031610612aa5576000356001600160e01b031916604051635d3dcd3160e01b81526004016108ab91906147ea565b84935060010161292b565b505050928552508252506020808b015160009081526003825260408082208d51835290925290812090612ae161372b565b90506000612aee85613735565b9050818110612b755780600003612b26576000356001600160e01b031916604051637f11b8a360e11b81526004016108ab91906147ea565b825460ff1916600190811784558301546040517f5c819725ea53655a3b898f3df59b66489761935454e9212ca1e5ebd759953d0b90600090a2612b69838e613740565b50505050505050611568565b600082612b806137ad565b612b8a91906147b5565b612b959060016147a2565b90506000612ba286613735565b9050818110612c215780600003612bda576000356001600160e01b031916604051637f11b8a360e11b81526004016108ab91906147ea565b845460ff1916600317855560018501546040517f55295d4ce992922fa2e5ffbf3a3dcdb367de0a15e125ace083456017fd22060f90600090a2505050505050505050611568565b6000356001600160e01b031916604051634ccfe64360e11b81526004016108ab91906147ea565b8060056000846005811115612c5f57612c5f6144cf565b6005811115612c7057612c706144cf565b8152602081019190915260400160002080546001600160a01b0319166001600160a01b039283161790558116826005811115612cae57612cae6144cf565b6040517f356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d90600090a35050565b6020820151600090808203612d1d5760405163092048d160e11b8152600080356001600160e01b031916600483015260248201524660448201526064016108ab565b600454612d2b9085906135c6565b6000612d3685612de2565b9050612d4182613667565b6000838152600360209081526040808320848452909152908190209087015160018201849055600690910155925084518314612d9e576000356001600160e01b03191660405163d4cec26960e01b81526004016108ab91906147ea565b8083837fd1221ffb98610024a29755d7db3c71692310f43a7cfcce7ee488a8c7e9e0bfa48888604051612dd2929190615062565b60405180910390a4505092915050565b60a0810151608082015160c083015151600092919083906001600160401b03811115612e1057612e1061422d565b604051908082528060200260200182016040528015612e39578160200160208202803683370190505b5060e086015190915060005b8251811015612e98578660c001518181518110612e6457612e6461475f565b602002602001015180519060200120838281518110612e8557612e8561475f565b6020908102919091010152600101612e45565b50604080517f1b59eeec7c321899dc1e7a5b3d876c9a445dffc6d2f96ba842d7489908fdee1281528751602080830191909152808901518284015291880151606080830191909152909701516080880152835181029381019390932060a0870152835183029383019390932060c0860152805182029082012060e08501528151810291012061010083015250610120902090565b600054610100900460ff16612f535760405162461bcd60e51b81526004016108ab90614cb1565b610a1c816137b7565b600054610100900460ff16612f835760405162461bcd60e51b81526004016108ab90614cb1565b61091b600030612c48565b600054610100900460ff16612fb55760405162461bcd60e51b81526004016108ab90614cb1565b60017ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00908155610d0a838361196e565b600054610100900460ff1661300c5760405162461bcd60e51b81526004016108ab90614cb1565b610a1c816114b3565b600054610100900460ff1661303c5760405162461bcd60e51b81526004016108ab90614cb1565b6130476002856117a9565b604080516020808201839052600e60608301526d212924a223a2afa6a0a720a3a2a960911b6080808401919091528284018990528351808403909101815260a0830184528051908201207f599a80fcaa47b95e2323ab4d34d34e0cc9feda4b843edafcc30c7bdf60ea15bf60c08401527fe4d2346818310a10fac5a6d073d3dce255578caf4aa81ddcbcc7c2b98405eef060e08401527f2a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4de61010084015261012080840191909152835180840390910181526101409092019092528051910120600155613134818385610f08565b506107036003611881565b6001600061315a600080516020615149833981519152611337565b8051909150600081900361316f57505061074b565b6000816001600160401b038111156131895761318961422d565b6040519080825280602002602001820160405280156131b2578160200160208202803683370190505b5090506000826001600160401b038111156131cf576131cf61422d565b60405190808252806020026020018201604052801561320257816020015b60608152602001906001900390816131ed5790505b5090506000878760405160200161321a92919061508c565b604051602081830303815290604052905060008160405160240161323e9190614d9c565b60408051601f198184030181529190526020810180516001600160e01b03166325da93a560e11b179052905060005b85811015613427578681815181106132875761328761475f565b60200260200101516001600160a01b0316836040516132a69190614d80565b6000604051808303816000865af19150503d80600081146132e3576040519150601f19603f3d011682016040523d82523d6000602084013e6132e8565b606091505b508683815181106132fb576132fb61475f565b602002602001018684815181106133145761331461475f565b602002602001018290528215151515815250505084818151811061333a5761333a61475f565b602002602001015161341f578681815181106133585761335861475f565b60200260200101516001600160a01b0316826040516133779190614d80565b6000604051808303816000865af19150503d80600081146133b4576040519150601f19603f3d011682016040523d82523d6000602084013e6133b9565b606091505b508683815181106133cc576133cc61475f565b602002602001018684815181106133e5576133e561475f565b602002602001018290528215151515815250505087801561341c57508481815181106134135761341361475f565b60200260200101515b97505b60010161326d565b507fc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b638287868660405161345d94939291906150bd565b60405180910390a150505050505092915050565b60008181526001830160205260408120546134b85750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561074b565b50600061074b565b6134c8613f0c565b8251815260006020808301919091528301516040808301919091528301516001600160a01b0316606080830191909152830151516001600160401b038111156135135761351361422d565b60405190808252806020026020018201604052801561353c578160200160208202803683370190505b5060808083019190915283015160a08083019190915283015160c08083019190915283015160e082015260005b836060015151811015610a2a578281815181106135885761358861475f565b6020026020010151826080015182815181106135a6576135a661475f565b6001600160a01b0390921660209283029190910190910152600101613569565b60008260800151511180156135e457508160a0015151826080015151145b80156135f957508160c0015151826080015151145b801561360e57508160e0015151826080015151145b613639576000356001600160e01b0319166040516306b5667560e21b81526004016108ab91906147ea565b61364381426147a2565b826040015111156107955760405163ad89be9d60e01b815260040160405180910390fd5b600081815260026020526040812054908190036136965750600090815260026020526040902060019081905590565b60008281526003602090815260408083208484529091528120906000825460ff1660048111156136c8576136c86144cf565b036136e65760405163757a436360e01b815260040160405180910390fd5b505050600090815260026020526040902080546001019081905590565b60008060006137148787878761399c565b9150915061372181613a89565b5095945050505050565b60006105c5610816565b600061074b826112b2565b61374981613c3f565b1561079557815460ff1916600217825560008061376583613c59565b9150915083600101547fe134987599ae266ec90edeff1b26125b287dbb57b10822649432d1bb26537fba838360405161379f92919061510a565b60405180910390a250505050565b60006105c56105bb565b600481905560405181907fe5cd1c123a8cf63fa1b7229678db61fe8ae99dbbd27889370b6667c8cae97da190600090a250565b600483015481101561389d578260080160008460040183815481106138115761381161475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff19169055600484018054600786019291908490811061385a5761385a61475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff191681556001818101839055600290910191909155016137ea565b5060005b6005830154811015613954578260080160008460050183815481106138c8576138c861475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff1916905560058401805460078601929190849081106139115761391161475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff191681556001818101839055600290910191909155016138a1565b50815460ff191682556000600183018190556002830181905560038301819055613982906004840190613f5a565b613990600583016000613f5a565b60006006830155919050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156139d35750600090506003613a80565b8460ff16601b141580156139eb57508460ff16601c14155b156139fc5750600090506004613a80565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613a50573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613a7957600060019250925050613a80565b9150600090505b94509492505050565b6000816004811115613a9d57613a9d6144cf565b03613aa55750565b6001816004811115613ab957613ab96144cf565b03613b065760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016108ab565b6002816004811115613b1a57613b1a6144cf565b03613b675760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016108ab565b6003816004811115613b7b57613b7b6144cf565b03613bd35760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016108ab565b6004816004811115613be757613be76144cf565b03610a1c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016108ab565b600081602001516000148061074b57505060200151461490565b606080613c6583613c3f565b613ca357602083015160405163092048d160e11b81526000356001600160e01b031916600482015260248101919091524660448201526064016108ab565b8260800151516001600160401b03811115613cc057613cc061422d565b604051908082528060200260200182016040528015613ce9578160200160208202803683370190505b5091508260800151516001600160401b03811115613d0957613d0961422d565b604051908082528060200260200182016040528015613d3c57816020015b6060815260200190600190039081613d275790505b50905060005b836080015151811015613f06578360e001518181518110613d6557613d6561475f565b60200260200101515a11613d9857613d7c84612de2565b6040516307aec4ab60e21b81526004016108ab91815260200190565b83608001518181518110613dae57613dae61475f565b60200260200101516001600160a01b03168460a001518281518110613dd557613dd561475f565b60200260200101518560e001518381518110613df357613df361475f565b6020026020010151908660c001518481518110613e1257613e1261475f565b6020026020010151604051613e279190614d80565b600060405180830381858888f193505050503d8060008114613e65576040519150601f19603f3d011682016040523d82523d6000602084013e613e6a565b606091505b50848381518110613e7d57613e7d61475f565b60200260200101848481518110613e9657613e9661475f565b6020026020010182905282151515158152505050828181518110613ebc57613ebc61475f565b6020026020010151613efe5780828281518110613edb57613edb61475f565b60200260200101516040516376df417560e11b81526004016108ab92919061512f565b600101613d42565b50915091565b60405180610100016040528060008152602001600081526020016000815260200160006001600160a01b03168152602001606081526020016060815260200160608152602001606081525090565b5080546000825590600052602060002090810190610a1c91905b80821115613f885760008155600101613f74565b5090565b60008083601f840112613f9e57600080fd5b5081356001600160401b03811115613fb557600080fd5b6020830191508360208260051b85010111156116c357600080fd5b60008060008060008060608789031215613fe957600080fd5b86356001600160401b038082111561400057600080fd5b61400c8a838b01613f8c565b9098509650602089013591508082111561402557600080fd5b6140318a838b01613f8c565b9096509450604089013591508082111561404a57600080fd5b5061405789828a01613f8c565b979a9699509497509295939492505050565b6000806020838503121561407c57600080fd5b82356001600160401b0381111561409257600080fd5b61409e85828601613f8c565b90969095509350505050565b60008151808452602080850194506020840160005b838110156140e45781516001600160a01b0316875295820195908201906001016140bf565b509495945050505050565b60208152600061074860208301846140aa565b60006020828403121561411457600080fd5b5035919050565b60008083601f84011261412d57600080fd5b5081356001600160401b0381111561414457600080fd5b6020830191508360206060830285010111156116c357600080fd5b60008060008060006060868803121561417757600080fd5b85356001600160401b038082111561418e57600080fd5b9087019060e0828a0312156141a257600080fd5b909550602087013590808211156141b857600080fd5b6141c489838a01613f8c565b909650945060408801359150808211156141dd57600080fd5b506141ea8882890161411b565b969995985093965092949392505050565b80356001600160a01b0381168114610c7957600080fd5b60006020828403121561422457600080fd5b610748826141fb565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b03811182821017156142655761426561422d565b60405290565b60405161010081016001600160401b03811182821017156142655761426561422d565b604051601f8201601f191681016001600160401b03811182821017156142b6576142b661422d565b604052919050565b60006001600160401b038211156142d7576142d761422d565b5060051b60200190565b600082601f8301126142f257600080fd5b81356020614307614302836142be565b61428e565b8083825260208201915060208460051b87010193508684111561432957600080fd5b602086015b84811015614353578035600681106143465760008081fd5b835291830191830161432e565b509695505050505050565b600082601f83011261436f57600080fd5b8135602061437f614302836142be565b8083825260208201915060208460051b8701019350868411156143a157600080fd5b602086015b84811015614353576143b7816141fb565b83529183019183016143a6565b600080604083850312156143d757600080fd5b82356001600160401b03808211156143ee57600080fd5b6143fa868387016142e1565b9350602085013591508082111561441057600080fd5b5061441d8582860161435e565b9150509250929050565b803560108110610c7957600080fd5b6000806040838503121561444957600080fd5b61445283614427565b9150614460602084016141fb565b90509250929050565b60008060008060006060868803121561448157600080fd5b85356001600160401b038082111561449857600080fd5b90870190610100828a0312156141a257600080fd5b600080604083850312156144c057600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60a08101600587106144f9576144f96144cf565b95815260208101949094526040840192909252606083015260809091015290565b60008151808452602080850194506020840160005b838110156140e45781516001600160601b03168752958201959082019060010161452f565b60608152600061456760608301866140aa565b828103602084015261457981866140aa565b9050828103604084015261458d818561451a565b9695505050505050565b602081526000610748602083018461451a565b6000602082840312156145bc57600080fd5b61074882614427565b600082601f8301126145d657600080fd5b813560206145e6614302836142be565b8083825260208201915060208460051b87010193508684111561460857600080fd5b602086015b848110156143535780356001600160601b038116811461462d5760008081fd5b835291830191830161460d565b6000806000806000806000806000806101408b8d03121561465a57600080fd5b8a35995060208b0135985060408b0135975061467860608c016141fb565b965060808b01356001600160401b038082111561469457600080fd5b6146a08e838f0161435e565b975060a08d01359150808211156146b657600080fd5b6146c28e838f0161435e565b965060c08d01359150808211156146d857600080fd5b6146e48e838f0161435e565b955060e08d01359150808211156146fa57600080fd5b6147068e838f016145c5565b94506101008d013591508082111561471d57600080fd5b6147298e838f016142e1565b93506101208d013591508082111561474057600080fd5b5061474d8d828e0161435e565b9150509295989b9194979a5092959850565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761074b5761074b614775565b8082018082111561074b5761074b614775565b8181038181111561074b5761074b614775565b6000826147e557634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031991909116815260200190565b6020810160108310614813576148136144cf565b91905290565b6001600160e01b03198316815260408101600b831061483a5761483a6144cf565b8260208301529392505050565b6001600160601b03818116838216019080821115610a2a57610a2a614775565b60008151808452602080850194506020840160005b838110156140e457815115158752958201959082019060010161487c565b6060815260006148ad60608301866140aa565b82810360208401526148bf818661451a565b9050828103604084015261458d8185614867565b6080815260006148e66080830187614867565b82810360208401526148f8818761451a565b9050828103604084015261490c81866140aa565b9050828103606084015261492081856140aa565b979650505050505050565b600082601f83011261493c57600080fd5b8135602061494c614302836142be565b8083825260208201915060208460051b87010193508684111561496e57600080fd5b602086015b848110156143535780358352918301918301614973565b6000601f83601f84011261499d57600080fd5b823560206149ad614302836142be565b82815260059290921b850181019181810190878411156149cc57600080fd5b8287015b84811015614a625780356001600160401b03808211156149f05760008081fd5b818a0191508a603f830112614a055760008081fd5b85820135604082821115614a1b57614a1b61422d565b614a2c828b01601f1916890161428e565b92508183528c81838601011115614a435760008081fd5b81818501898501375060009082018701528452509183019183016149d0565b50979650505050505050565b600060e08236031215614a8057600080fd5b614a88614243565b8235815260208301356020820152614aa2604084016141fb565b604082015260608301356001600160401b0380821115614ac157600080fd5b614acd368387016142e1565b60608401526080850135915080821115614ae657600080fd5b614af23683870161492b565b608084015260a0850135915080821115614b0b57600080fd5b614b173683870161498a565b60a084015260c0850135915080821115614b3057600080fd5b50614b3d3682860161492b565b60c08301525092915050565b60006101008236031215614b5c57600080fd5b614b6461426b565b823581526020830135602082015260408301356040820152614b88606084016141fb565b606082015260808301356001600160401b0380821115614ba757600080fd5b614bb33683870161435e565b608084015260a0850135915080821115614bcc57600080fd5b614bd83683870161492b565b60a084015260c0850135915080821115614bf157600080fd5b614bfd3683870161498a565b60c084015260e0850135915080821115614c1657600080fd5b50614c233682860161492b565b60e08301525092915050565b600060018201614c4157614c41614775565b5060010190565b634e487b7160e01b600052603160045260246000fd5b604081526000614c7160408301856140aa565b8281036020840152614c838185614867565b95945050505050565b604081526000614c9f6040830185614867565b8281036020840152614c8381856140aa565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60005b83811015614d17578181015183820152602001614cff565b50506000910152565b60008151808452614d38816020860160208601614cfc565b601f01601f19169290920160200192915050565b6001600160a01b03841681526001600160e01b031983166020820152606060408201819052600090614c8390830184614d20565b60008251614d92818460208701614cfc565b9190910192915050565b6020815260006107486020830184614d20565b6001600160e01b03199290921682526001600160a01b0316602082015260400190565b600060208284031215614de457600080fd5b8151801515811461134457600080fd5b60008151808452602080850194506020840160005b838110156140e457815187529582019590820190600101614e09565b60008282518085526020808601955060208260051b8401016020860160005b84811015614e7257601f19868403018952614e60838351614d20565b98840198925090830190600101614e44565b5090979650505050505050565b60006101008251845260208301516020850152604083015160408501526060830151614eb660608601826001600160a01b03169052565b506080830151816080860152614ece828601826140aa565b91505060a083015184820360a0860152614ee88282614df4565b91505060c083015184820360c0860152614f028282614e25565b91505060e083015184820360e0860152614c838282614df4565b60008151808452602080850194506020840160005b838110156140e457815160068110614f4b57614f4b6144cf565b87529582019590820190600101614f31565b608081526000614f706080830187614e7f565b8560208401528281036040840152845181526020850151602082015260018060a01b036040860151166040820152606085015160e06060830152614fb760e0830182614f1c565b905060808601518282036080840152614fd08282614df4565b91505060a086015182820360a0840152614fea8282614e25565b91505060c086015182820360c08401526150048282614df4565b9350505050614c8360608301846001600160a01b03169052565b60006020828403121561503057600080fd5b81356002811061134457600080fd5b60006020828403121561505157600080fd5b813560ff8116811461134457600080fd5b6040815260006150756040830185614e7f565b905060018060a01b03831660208301529392505050565b6001600160e01b03198316815281516000906150af816004850160208701614cfc565b919091016004019392505050565b6080815260006150d06080830187614d20565b82810360208401526150e281876140aa565b905082810360408401526150f68186614867565b905082810360608401526149208185614e25565b60408152600061511d6040830185614867565b8281036020840152614c838185614e25565b8281526040602082015260006106476040830184614d2056fe5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd976240a26469706673582212200c6f63384302c679c24a323da0191d39419570db3a104ad821b83178df1126da64736f6c63430008170033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102065760003560e01c80639b19dbfd1161011a578063cc7e6b3b116100ad578063de981f1b1161007c578063de981f1b146104ae578063e75235b8146104c1578063e9c03498146104de578063f80b5352146104f1578063f896f070146104f957600080fd5b8063cc7e6b3b14610460578063d0a50db014610480578063d78392f814610488578063dafae4081461049b57600080fd5b8063b405aaf2116100e9578063b405aaf21461041b578063b9c362091461042e578063bc96180b14610441578063c441c4a81461044957600080fd5b80639b19dbfd14610392578063a64a83801461039a578063aee1767f146103ad578063b384abef146103c057600080fd5b80633644e5151161019d5780637f7fe0581161016c5780637f7fe05814610303578063800eaab31461032e578063865e6fd3146103415780638dc0dbc614610354578063901979d51461036757600080fd5b80633644e515146102bc57806362077409146102c5578063776fb1ec146102d85780637de5dedd146102fb57600080fd5b80631f425338116101d95780631f425338146102635780632d6d7d731461027657806334d5f37b1461028957806335da8121146102a957600080fd5b806301a5f43f1461020b57806306aba0e1146102205780630a44fa431461023b5780630f7c31891461024e575b600080fd5b61021e610219366004613fd0565b61050c565b005b6102286105bb565b6040519081526020015b60405180910390f35b610228610249366004614069565b6105ca565b61025661064f565b60405161023291906140ef565b61021e610271366004614069565b610668565b610256610284366004614069565b61070a565b610228610297366004614102565b60026020526000908152604090205481565b61021e6102b7366004614069565b610751565b61022860015481565b61021e6102d336600461415f565b610799565b6102eb6102e6366004614102565b6107c9565b6040519015158152602001610232565b610228610816565b610316610311366004614212565b61086c565b6040516001600160a01b039091168152602001610232565b61021e61033c3660046143c4565b6108ed565b61021e61034f366004614436565b610925565b61021e610362366004614469565b610940565b61037a610375366004614212565b61096a565b6040516001600160601b039091168152602001610232565b6102566109a0565b61021e6103a8366004614102565b610a0b565b6103166103bb366004614212565b610a1f565b61040a6103ce3660046144ad565b600360208181526000938452604080852090915291835291208054600182015460028301549383015460069093015460ff909216939092909185565b6040516102329594939291906144e5565b6102eb610429366004614212565b610a31565b61021e61043c3660046144ad565b610a69565b600454610228565b610451610a7b565b60405161023293929190614554565b61047361046e366004614069565b610b55565b6040516102329190614597565b610228610b93565b61037a610496366004614212565b610ba6565b6102eb6104a9366004614102565b610bb1565b6103166104bc3660046145aa565b610c03565b6104c9610c7e565b60408051928352602083019190915201610232565b61021e6104ec366004614069565b610cc6565b610256610d0f565b61021e61050736600461463a565b610d72565b610514610eac565b6105b286868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808a0282810182019093528982529093508992508891829185019084908082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250610f0892505050565b50505050505050565b60006105c561126a565b905090565b600082828080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061060b925083915061127d9050565b6106478484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506112b292505050565b949350505050565b60606105c5600080516020615149833981519152611337565b610670610eac565b8181808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506106af925083915061127d9050565b60008051602061514983398151915260005b83811015610703576106fa8585838181106106de576106de61475f565b90506020020160208101906106f39190614212565b839061134b565b506001016106c1565b5050505050565b606061074883838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250611360915050565b90505b92915050565b610759610eac565b6107958282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506114b392505050565b5050565b6107a233611570565b6107bb6107b56060870160408801614212565b336115b2565b61070385858585853361160d565b60008060008381527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff602052604090205460ff16600481111561080e5761080e6144cf565b141592915050565b600080610821611641565b905060008061082e610c7e565b9150915080600182856004015485610846919061478b565b61085091906147a2565b61085a91906147b5565b61086491906147c8565b935050505090565b600080600061088261087c611641565b85611665565b91509150816108b45760405163141e2e1f60e11b81526001600160a01b03851660048201526024015b60405180910390fd5b6108bc611641565b60010181815481106108d0576108d061475f565b6000918252602090912001546001600160a01b0316949350505050565b33301461091b576000356001600160e01b0319166040516307337e1960e41b81526004016108ab91906147ea565b61079582826116ca565b61092d610eac565b61093681611773565b61079582826117a9565b61094933611570565b61095c6107b56080870160608801614212565b61070385858585853361184d565b600080610975611641565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b031690565b60606109aa611641565b600101805480602002602001604051908101604052809291908181526020018280548015610a0157602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116109e3575b5050505050905090565b610a13610eac565b610a1c81611881565b50565b6000610a2a826118ee565b5092915050565b600080610a3c611641565b6001600160a01b0390931660009081526003909301602052505060409020546001600160601b0316151590565b610a71610eac565b610795828261196e565b60608060606000610a8a611641565b805460408051602080840282018101909252828152929350839190830182828015610ade57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610ac0575b5050505050935080600101805480602002602001604051908101604052809291908181526020018280548015610b3d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b1f575b50505050509250610b4d84611a70565b915050909192565b6060610748838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611a7092505050565b6000610b9d611641565b60010154919050565b600061074b82611b5c565b60007ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00610bdc61126a565b8160010154610beb919061478b565b6002820154610bfa908561478b565b10159392505050565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115610c3a57610c3a6144cf565b60ff1681526020810191909152604001600020546001600160a01b0316905080610c79578160405163409140df60e11b81526004016108ab91906147ff565b919050565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f01547ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f02549091565b610cce610eac565b610d0a828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611b9192505050565b505050565b6060610d19611641565b805460408051602080840282018101909252828152929190830182828015610a01576020028201919060005260206000209081546001600160a01b031681526001909101906020018083116109e3575050505050905090565b600054610100900460ff1615808015610d925750600054600160ff909116105b80610dac5750303b158015610dac575060005460ff166001145b610e0f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016108ab565b6000805460ff191660011790558015610e32576000805461ff0019166101001790555b610e3f600160ff1b611f77565b610e498383611fa7565b610e598b8b8b8b8b8b8b8b611fd8565b8015610e9f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610f06576000356001600160e01b0319166001604051620f948f60ea1b81526004016108ab929190614819565b565b6060610f148383612029565b610f1d8161127d565b6000610f27611641565b845187519192509081148015610f3d5750855181145b610f68576000356001600160e01b0319166040516306b5667560e21b81526004016108ab91906147ea565b806001600160401b03811115610f8057610f8061422d565b604051908082528060200260200182016040528015610fa9578160200160208202803683370190505b50935080600003610fbb575050611262565b60008060008060005b858110156111ce578a8181518110610fde57610fde61475f565b60200260200101519450898181518110610ffa57610ffa61475f565b602002602001015193508b81815181106110165761101661475f565b6020026020010151925061102985612133565b61103284612133565b826001600160601b031660000361106a576000356001600160e01b031916604051637f11b8a360e11b81526004016108ab91906147ea565b6001600160a01b03808616600081815260038a01602090815260408083205494891683528083205460028d0190925280832054938352909120546001600160601b0393841693918216926110c2929081169116614847565b6110cc9190614847565b6110d69190614847565b6001600160601b03166000148982815181106110f4576110f461475f565b6020026020010190151590811515815250508881815181106111185761111861475f565b6020026020010151156111c6578654600181810189556000898152602080822090930180546001600160a01b03808b166001600160a01b0319928316811790935591835260028c018552604080842080546001600160601b038b166001600160601b03199182168117909255868f018054978801815586528786209096018054948c1694909316841790925591835260038c0190945290208054909116821790556111c390836147a2565b91505b600101610fc4565b50808660040160008282546111e391906147a2565b909155505060405161121e906347c28ec560e11b9061120a908c908f908d9060200161489a565b604051602081830303815290604052612168565b7f897810999654e525e272b5909785c4d0ceaee1bbf9c87d9091a37558b0423b78888c8c8c60405161125394939291906148d3565b60405180910390a15050505050505b509392505050565b6000611274611641565b60040154905090565b61128681612195565b15610a1c576000356001600160e01b031916604051630d697db160e11b81526004016108ab91906147ea565b6000816112be8161127d565b60006112c8611641565b905060005b845181101561132f578160020160008683815181106112ee576112ee61475f565b6020908102919091018101516001600160a01b0316825281019190915260400160002054611325906001600160601b0316856147a2565b93506001016112cd565b505050919050565b6060600061134483612234565b9392505050565b6000610748836001600160a01b038416612290565b606082516001600160401b0381111561137b5761137b61422d565b6040519080825280602002602001820160405280156113a4578160200160208202803683370190505b50905060005b8351811015610a2a57600560008583815181106113c9576113c961475f565b602002602001015160058111156113e2576113e26144cf565b60058111156113f3576113f36144cf565b815260200190815260200160002060009054906101000a90046001600160a01b03168282815181106114275761142761475f565b60200260200101906001600160a01b031690816001600160a01b03168152505082801561147f575060006001600160a01b031682828151811061146c5761146c61475f565b60200260200101516001600160a01b0316145b156114ab576000356001600160e01b03191660405163053265f160e01b81526004016108ab91906147ea565b6001016113aa565b806114bd8161127d565b600080516020615149833981519152600080805b8551811015611568578581815181106114ec576114ec61475f565b602002602001015192506114ff83611773565b611510836312c0151560e21b612383565b61151a8484612516565b604080516001600160a01b038616815282151560208201529193507fb85c58eeff9fe423669ae0841666f4c8499e8731b8275eb462e4fa1720ec420e910160405180910390a16001016114d1565b505050505050565b61157981611b5c565b6001600160601b0316600003610a1c576000356001600160e01b0319166003604051620f948f60ea1b81526004016108ab929190614819565b6001600160a01b038216158015906115dc5750816001600160a01b0316816001600160a01b031614155b15610795576040516301df97c360e51b81526001600160a01b038084166004830152821660248201526044016108ab565b600061162161161b88614a6e565b8361252b565b90506105b2818787878761163c6116378e614a6e565b61263d565b61277c565b7fc648703095712c0419b6431ae642c061f0a105ac2d7c3d9604061ef4ebc3830090565b60008060005b84548110156116b8578481815481106116865761168661475f565b6000918252602090912001546001600160a01b03908116908516036116b0576001925090506116c3565b60010161166b565b506000600019915091505b9250929050565b60005b8251811015610d0a57306001600160a01b03168282815181106116f2576116f261475f565b60200260200101516001600160a01b03160361172f576000356001600160e01b03191660405163053265f160e01b81526004016108ab91906147ea565b61176b8382815181106117445761174461475f565b602002602001015183838151811061175e5761175e61475f565b6020026020010151612c48565b6001016116cd565b806001600160a01b03163b600003610a1c57604051630bfc64a360e21b81526001600160a01b03821660048201526024016108ab565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f8111156117df576117df6144cf565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f811115611820576118206144cf565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b61185f61185987614b49565b82612cdb565b5061156861186c87614b49565b8686868661163c61187c8d614b49565b612de2565b60038110156118a3576040516305f4dee960e31b815260040160405180910390fd5b60006118ad611641565b600581018390556040518381529091507f22d5bb5059ffe2949a098666fc198587200c8118483074120d3ca7050c7753f19060200160405180910390a15050565b6000806000806119086118ff611641565b60010186611665565b9150915081611935576040516326527e1760e01b81526001600160a01b03861660048201526024016108ab565b61193d611641565b80548290811061194f5761194f61475f565b6000918252602090912001546001600160a01b03169590945092505050565b8082118061197d575060018111155b156119a9576000356001600160e01b0319166040516387f6f09560e01b81526004016108ab91906147ea565b7ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f0180547ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f028054928590558390557ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00805490929084908690856000611a2c83614c2f565b9091555060408051868152602081018690527f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a45050505050565b60606000611a7c611641565b905082516001600160401b03811115611a9757611a9761422d565b604051908082528060200260200182016040528015611ac0578160200160208202803683370190505b50915060005b8351811015611b5557816002016000858381518110611ae757611ae761475f565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160601b0316838281518110611b3557611b3561475f565b6001600160601b0390921660209283029190910190910152600101611ac6565b5050919050565b6000611b66611641565b6001600160a01b0390921660009081526002929092016020525060409020546001600160601b031690565b606081611b9d8161127d565b6000611ba7611641565b8451909150806001600160401b03811115611bc457611bc461422d565b604051908082528060200260200182016040528015611bed578160200160208202803683370190505b50935080600003611bff575050611f71565b60058201548254611c119083906147b5565b1015611c305760405163b2e765cb60e01b815260040160405180910390fd5b60008060008060005b85811015611ef757898181518110611c5357611c5361475f565b60200260200101519350611c66846118ee565b9095509150611c7485612133565b611c7d84612133565b6001600160a01b03851660009081526002880160205260409020546001600160601b031615801590611cd157506001600160a01b03841660009081526003880160205260409020546001600160601b031615155b898281518110611ce357611ce361475f565b602002602001019015159081151581525050888181518110611d0757611d0761475f565b602002602001015115611eef576001600160a01b038516600090815260028801602052604081205488546001600160601b039091169190611d4a906001906147b5565b9050886000018181548110611d6157611d6161475f565b60009182526020909120015489546001600160a01b03909116908a9086908110611d8d57611d8d61475f565b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790558854899080611dc757611dc7614c48565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038916825260028b0190526040902080546001600160601b031916905560018901805482908110611e2757611e2761475f565b60009182526020909120015460018a0180546001600160a01b039092169186908110611e5557611e5561475f565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555088600101805480611e9657611e96614c48565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038816825260038b0190526040902080546001600160601b0319169055611eea82866147a2565b945050505b600101611c39565b5081866004016000828254611f0c91906147b5565b9091555050604051611f3190636242a4ef60e11b9061120a908c908c90602001614c5e565b7fdf3dcd7987202f64648f3acdbf12401e3a2bb23e77e19f99826b5475cbb86369888a604051611f62929190614c8c565b60405180910390a15050505050505b50919050565b600054610100900460ff16611f9e5760405162461bcd60e51b81526004016108ab90614cb1565b610a1c81612f2c565b600054610100900460ff16611fce5760405162461bcd60e51b81526004016108ab90614cb1565b6107958282612f5c565b600054610100900460ff16611fff5760405162461bcd60e51b81526004016108ab90614cb1565b6120098888612f8e565b61201284612fe5565b61201f8686858585613015565b5050505050505050565b81518151606091908082016001600160401b0381111561204b5761204b61422d565b604051908082528060200260200182016040528015612074578160200160208202803683370190505b50925060005b828110156120ce578581815181106120945761209461475f565b60200260200101518482815181106120ae576120ae61475f565b6001600160a01b039092166020928302919091019091015260010161207a565b60005b82811015612129578581815181106120eb576120eb61475f565b60200260200101518583815181106121055761210561475f565b6001600160a01b0390921660209283029190910190910152600191820191016120d1565b5050505092915050565b6001600160a01b038116610a1c576000356001600160e01b03191660405163104c66df60e31b81526004016108ab91906147ea565b612172828261313f565b610795573382826040516319b5fdcb60e31b81526004016108ab93929190614d4c565b600081516000036121a857506000919050565b60005b600183510381101561222b57600181015b8351811015612222578381815181106121d7576121d761475f565b60200260200101516001600160a01b03168483815181106121fa576121fa61475f565b60200260200101516001600160a01b03160361221a575060019392505050565b6001016121bc565b506001016121ab565b50600092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561228457602002820191906000526020600020905b815481526020019060010190808311612270575b50505050509050919050565b600081815260018301602052604081205480156123795760006122b46001836147b5565b85549091506000906122c8906001906147b5565b905081811461232d5760008660000182815481106122e8576122e861475f565b906000526020600020015490508087600001848154811061230b5761230b61475f565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061233e5761233e614c48565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061074b565b600091505061074b565b60008160405160240161239691906147ea565b60408051601f198184030181529181526020820180516001600160e01b03166301ffc9a760e01b1790525190915060009081906001600160a01b038616906123df908590614d80565b600060405180830381855afa9150503d806000811461241a576040519150601f19603f3d011682016040523d82523d6000602084013e61241f565b606091505b5091509150816124e157846001600160a01b0316836040516024016124449190614d9c565b60408051601f198184030181529181526020820180516001600160e01b03166325da93a560e11b179052516124799190614d80565b600060405180830381855afa9150503d80600081146124b4576040519150601f19603f3d011682016040523d82523d6000602084013e6124b9565b606091505b509092509050816124e157838560405163069d427960e11b81526004016108ab929190614daf565b808060200190518101906124f59190614dd2565b61070357838560405163069d427960e11b81526004016108ab929190614daf565b6000610748836001600160a01b038416613471565b612533613f0c565b61254c61254584606001516001611360565b84906134c0565b9050612563600454826135c690919063ffffffff16565b600061256e82612de2565b9050600061257c6000613667565b60008181527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff6020908152604090912090870151600182018590556006909101559050825181146125ee576000356001600160e01b03191660405163d4cec26960e01b81526004016108ab91906147ea565b81817fe5af2d3fb7bcab8f865476bc675bf1bbb8b5a749c827ee1cd215dc9c2b8f92d78561261b8961263d565b898960405161262d9493929190614f5d565b60405180910390a3505092915050565b6080810151606082015160a083015151600092919083906001600160401b0381111561266b5761266b61422d565b604051908082528060200260200182016040528015612694578160200160208202803683370190505b5060c086015190915060005b82518110156126f3578660a0015181815181106126bf576126bf61475f565b6020026020010151805190602001208382815181106126e0576126e061475f565b60209081029190910101526001016126a0565b50604080517fde480f0c53a3651c08fbab1dffbc45fe574f31188827fe52cb9035da9fe57e4a8152875160208083019190915280890151828401529790910151606082015283518702938701939093206080840152835186029386019390932060a0830152805185029085012060c082015281518402919093012060e083015250610100902090565b831580159061278a57508382145b6127b5576000356001600160e01b0319166040516306b5667560e21b81526004016108ab91906147ea565b60006128426127c360015490565b612802846000604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b60405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b9050600061289161285260015490565b612802856001604080517fd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2815260208101939093528201526060902090565b90506000846001600160401b038111156128ad576128ad61422d565b6040519080825280602002602001820160405280156128d6578160200160208202803683370190505b5090506000856001600160401b038111156128f3576128f361422d565b60405190808252806020026020018201604052801561291c578160200160208202803683370190505b50905060008060008060003660005b8c811015612ab0578d8d828181106129455761294561475f565b90506060020191508f8f8281811061295f5761295f61475f565b9050602002016020810190612974919061501e565b9250600083600181111561298a5761298a6144cf565b036129f4576129af8b6129a0602085018561503f565b84602001358560400135613703565b94508489886129bd81614c2f565b9950815181106129cf576129cf61475f565b60200260200101906001600160a01b031690816001600160a01b031681525050612a65565b6001836001811115612a0857612a086144cf565b03612a3e57612a1e8a6129a0602085018561503f565b9450848887612a2c81614c2f565b9850815181106129cf576129cf61475f565b6000356001600160e01b031916604051630612418f60e11b81526004016108ab91906147ea565b846001600160a01b0316846001600160a01b031610612aa5576000356001600160e01b031916604051635d3dcd3160e01b81526004016108ab91906147ea565b84935060010161292b565b505050928552508252506020808b015160009081526003825260408082208d51835290925290812090612ae161372b565b90506000612aee85613735565b9050818110612b755780600003612b26576000356001600160e01b031916604051637f11b8a360e11b81526004016108ab91906147ea565b825460ff1916600190811784558301546040517f5c819725ea53655a3b898f3df59b66489761935454e9212ca1e5ebd759953d0b90600090a2612b69838e613740565b50505050505050611568565b600082612b806137ad565b612b8a91906147b5565b612b959060016147a2565b90506000612ba286613735565b9050818110612c215780600003612bda576000356001600160e01b031916604051637f11b8a360e11b81526004016108ab91906147ea565b845460ff1916600317855560018501546040517f55295d4ce992922fa2e5ffbf3a3dcdb367de0a15e125ace083456017fd22060f90600090a2505050505050505050611568565b6000356001600160e01b031916604051634ccfe64360e11b81526004016108ab91906147ea565b8060056000846005811115612c5f57612c5f6144cf565b6005811115612c7057612c706144cf565b8152602081019190915260400160002080546001600160a01b0319166001600160a01b039283161790558116826005811115612cae57612cae6144cf565b6040517f356c8c57e9e84b99b1cb58b13c985b2c979f78cbdf4d0fa70fe2a98bb09a099d90600090a35050565b6020820151600090808203612d1d5760405163092048d160e11b8152600080356001600160e01b031916600483015260248201524660448201526064016108ab565b600454612d2b9085906135c6565b6000612d3685612de2565b9050612d4182613667565b6000838152600360209081526040808320848452909152908190209087015160018201849055600690910155925084518314612d9e576000356001600160e01b03191660405163d4cec26960e01b81526004016108ab91906147ea565b8083837fd1221ffb98610024a29755d7db3c71692310f43a7cfcce7ee488a8c7e9e0bfa48888604051612dd2929190615062565b60405180910390a4505092915050565b60a0810151608082015160c083015151600092919083906001600160401b03811115612e1057612e1061422d565b604051908082528060200260200182016040528015612e39578160200160208202803683370190505b5060e086015190915060005b8251811015612e98578660c001518181518110612e6457612e6461475f565b602002602001015180519060200120838281518110612e8557612e8561475f565b6020908102919091010152600101612e45565b50604080517f1b59eeec7c321899dc1e7a5b3d876c9a445dffc6d2f96ba842d7489908fdee1281528751602080830191909152808901518284015291880151606080830191909152909701516080880152835181029381019390932060a0870152835183029383019390932060c0860152805182029082012060e08501528151810291012061010083015250610120902090565b600054610100900460ff16612f535760405162461bcd60e51b81526004016108ab90614cb1565b610a1c816137b7565b600054610100900460ff16612f835760405162461bcd60e51b81526004016108ab90614cb1565b61091b600030612c48565b600054610100900460ff16612fb55760405162461bcd60e51b81526004016108ab90614cb1565b60017ff3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00908155610d0a838361196e565b600054610100900460ff1661300c5760405162461bcd60e51b81526004016108ab90614cb1565b610a1c816114b3565b600054610100900460ff1661303c5760405162461bcd60e51b81526004016108ab90614cb1565b6130476002856117a9565b604080516020808201839052600e60608301526d212924a223a2afa6a0a720a3a2a960911b6080808401919091528284018990528351808403909101815260a0830184528051908201207f599a80fcaa47b95e2323ab4d34d34e0cc9feda4b843edafcc30c7bdf60ea15bf60c08401527fe4d2346818310a10fac5a6d073d3dce255578caf4aa81ddcbcc7c2b98405eef060e08401527f2a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4de61010084015261012080840191909152835180840390910181526101409092019092528051910120600155613134818385610f08565b506107036003611881565b6001600061315a600080516020615149833981519152611337565b8051909150600081900361316f57505061074b565b6000816001600160401b038111156131895761318961422d565b6040519080825280602002602001820160405280156131b2578160200160208202803683370190505b5090506000826001600160401b038111156131cf576131cf61422d565b60405190808252806020026020018201604052801561320257816020015b60608152602001906001900390816131ed5790505b5090506000878760405160200161321a92919061508c565b604051602081830303815290604052905060008160405160240161323e9190614d9c565b60408051601f198184030181529190526020810180516001600160e01b03166325da93a560e11b179052905060005b85811015613427578681815181106132875761328761475f565b60200260200101516001600160a01b0316836040516132a69190614d80565b6000604051808303816000865af19150503d80600081146132e3576040519150601f19603f3d011682016040523d82523d6000602084013e6132e8565b606091505b508683815181106132fb576132fb61475f565b602002602001018684815181106133145761331461475f565b602002602001018290528215151515815250505084818151811061333a5761333a61475f565b602002602001015161341f578681815181106133585761335861475f565b60200260200101516001600160a01b0316826040516133779190614d80565b6000604051808303816000865af19150503d80600081146133b4576040519150601f19603f3d011682016040523d82523d6000602084013e6133b9565b606091505b508683815181106133cc576133cc61475f565b602002602001018684815181106133e5576133e561475f565b602002602001018290528215151515815250505087801561341c57508481815181106134135761341361475f565b60200260200101515b97505b60010161326d565b507fc0b07a27e66788f39cc91405f012f34066b16f31b4bda9438c52f2dae0cc5b638287868660405161345d94939291906150bd565b60405180910390a150505050505092915050565b60008181526001830160205260408120546134b85750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561074b565b50600061074b565b6134c8613f0c565b8251815260006020808301919091528301516040808301919091528301516001600160a01b0316606080830191909152830151516001600160401b038111156135135761351361422d565b60405190808252806020026020018201604052801561353c578160200160208202803683370190505b5060808083019190915283015160a08083019190915283015160c08083019190915283015160e082015260005b836060015151811015610a2a578281815181106135885761358861475f565b6020026020010151826080015182815181106135a6576135a661475f565b6001600160a01b0390921660209283029190910190910152600101613569565b60008260800151511180156135e457508160a0015151826080015151145b80156135f957508160c0015151826080015151145b801561360e57508160e0015151826080015151145b613639576000356001600160e01b0319166040516306b5667560e21b81526004016108ab91906147ea565b61364381426147a2565b826040015111156107955760405163ad89be9d60e01b815260040160405180910390fd5b600081815260026020526040812054908190036136965750600090815260026020526040902060019081905590565b60008281526003602090815260408083208484529091528120906000825460ff1660048111156136c8576136c86144cf565b036136e65760405163757a436360e01b815260040160405180910390fd5b505050600090815260026020526040902080546001019081905590565b60008060006137148787878761399c565b9150915061372181613a89565b5095945050505050565b60006105c5610816565b600061074b826112b2565b61374981613c3f565b1561079557815460ff1916600217825560008061376583613c59565b9150915083600101547fe134987599ae266ec90edeff1b26125b287dbb57b10822649432d1bb26537fba838360405161379f92919061510a565b60405180910390a250505050565b60006105c56105bb565b600481905560405181907fe5cd1c123a8cf63fa1b7229678db61fe8ae99dbbd27889370b6667c8cae97da190600090a250565b600483015481101561389d578260080160008460040183815481106138115761381161475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff19169055600484018054600786019291908490811061385a5761385a61475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff191681556001818101839055600290910191909155016137ea565b5060005b6005830154811015613954578260080160008460050183815481106138c8576138c861475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff1916905560058401805460078601929190849081106139115761391161475f565b60009182526020808320909101546001600160a01b031683528201929092526040018120805460ff191681556001818101839055600290910191909155016138a1565b50815460ff191682556000600183018190556002830181905560038301819055613982906004840190613f5a565b613990600583016000613f5a565b60006006830155919050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156139d35750600090506003613a80565b8460ff16601b141580156139eb57508460ff16601c14155b156139fc5750600090506004613a80565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613a50573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613a7957600060019250925050613a80565b9150600090505b94509492505050565b6000816004811115613a9d57613a9d6144cf565b03613aa55750565b6001816004811115613ab957613ab96144cf565b03613b065760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016108ab565b6002816004811115613b1a57613b1a6144cf565b03613b675760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016108ab565b6003816004811115613b7b57613b7b6144cf565b03613bd35760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016108ab565b6004816004811115613be757613be76144cf565b03610a1c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016108ab565b600081602001516000148061074b57505060200151461490565b606080613c6583613c3f565b613ca357602083015160405163092048d160e11b81526000356001600160e01b031916600482015260248101919091524660448201526064016108ab565b8260800151516001600160401b03811115613cc057613cc061422d565b604051908082528060200260200182016040528015613ce9578160200160208202803683370190505b5091508260800151516001600160401b03811115613d0957613d0961422d565b604051908082528060200260200182016040528015613d3c57816020015b6060815260200190600190039081613d275790505b50905060005b836080015151811015613f06578360e001518181518110613d6557613d6561475f565b60200260200101515a11613d9857613d7c84612de2565b6040516307aec4ab60e21b81526004016108ab91815260200190565b83608001518181518110613dae57613dae61475f565b60200260200101516001600160a01b03168460a001518281518110613dd557613dd561475f565b60200260200101518560e001518381518110613df357613df361475f565b6020026020010151908660c001518481518110613e1257613e1261475f565b6020026020010151604051613e279190614d80565b600060405180830381858888f193505050503d8060008114613e65576040519150601f19603f3d011682016040523d82523d6000602084013e613e6a565b606091505b50848381518110613e7d57613e7d61475f565b60200260200101848481518110613e9657613e9661475f565b6020026020010182905282151515158152505050828181518110613ebc57613ebc61475f565b6020026020010151613efe5780828281518110613edb57613edb61475f565b60200260200101516040516376df417560e11b81526004016108ab92919061512f565b600101613d42565b50915091565b60405180610100016040528060008152602001600081526020016000815260200160006001600160a01b03168152602001606081526020016060815260200160608152602001606081525090565b5080546000825590600052602060002090810190610a1c91905b80821115613f885760008155600101613f74565b5090565b60008083601f840112613f9e57600080fd5b5081356001600160401b03811115613fb557600080fd5b6020830191508360208260051b85010111156116c357600080fd5b60008060008060008060608789031215613fe957600080fd5b86356001600160401b038082111561400057600080fd5b61400c8a838b01613f8c565b9098509650602089013591508082111561402557600080fd5b6140318a838b01613f8c565b9096509450604089013591508082111561404a57600080fd5b5061405789828a01613f8c565b979a9699509497509295939492505050565b6000806020838503121561407c57600080fd5b82356001600160401b0381111561409257600080fd5b61409e85828601613f8c565b90969095509350505050565b60008151808452602080850194506020840160005b838110156140e45781516001600160a01b0316875295820195908201906001016140bf565b509495945050505050565b60208152600061074860208301846140aa565b60006020828403121561411457600080fd5b5035919050565b60008083601f84011261412d57600080fd5b5081356001600160401b0381111561414457600080fd5b6020830191508360206060830285010111156116c357600080fd5b60008060008060006060868803121561417757600080fd5b85356001600160401b038082111561418e57600080fd5b9087019060e0828a0312156141a257600080fd5b909550602087013590808211156141b857600080fd5b6141c489838a01613f8c565b909650945060408801359150808211156141dd57600080fd5b506141ea8882890161411b565b969995985093965092949392505050565b80356001600160a01b0381168114610c7957600080fd5b60006020828403121561422457600080fd5b610748826141fb565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b03811182821017156142655761426561422d565b60405290565b60405161010081016001600160401b03811182821017156142655761426561422d565b604051601f8201601f191681016001600160401b03811182821017156142b6576142b661422d565b604052919050565b60006001600160401b038211156142d7576142d761422d565b5060051b60200190565b600082601f8301126142f257600080fd5b81356020614307614302836142be565b61428e565b8083825260208201915060208460051b87010193508684111561432957600080fd5b602086015b84811015614353578035600681106143465760008081fd5b835291830191830161432e565b509695505050505050565b600082601f83011261436f57600080fd5b8135602061437f614302836142be565b8083825260208201915060208460051b8701019350868411156143a157600080fd5b602086015b84811015614353576143b7816141fb565b83529183019183016143a6565b600080604083850312156143d757600080fd5b82356001600160401b03808211156143ee57600080fd5b6143fa868387016142e1565b9350602085013591508082111561441057600080fd5b5061441d8582860161435e565b9150509250929050565b803560108110610c7957600080fd5b6000806040838503121561444957600080fd5b61445283614427565b9150614460602084016141fb565b90509250929050565b60008060008060006060868803121561448157600080fd5b85356001600160401b038082111561449857600080fd5b90870190610100828a0312156141a257600080fd5b600080604083850312156144c057600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b60a08101600587106144f9576144f96144cf565b95815260208101949094526040840192909252606083015260809091015290565b60008151808452602080850194506020840160005b838110156140e45781516001600160601b03168752958201959082019060010161452f565b60608152600061456760608301866140aa565b828103602084015261457981866140aa565b9050828103604084015261458d818561451a565b9695505050505050565b602081526000610748602083018461451a565b6000602082840312156145bc57600080fd5b61074882614427565b600082601f8301126145d657600080fd5b813560206145e6614302836142be565b8083825260208201915060208460051b87010193508684111561460857600080fd5b602086015b848110156143535780356001600160601b038116811461462d5760008081fd5b835291830191830161460d565b6000806000806000806000806000806101408b8d03121561465a57600080fd5b8a35995060208b0135985060408b0135975061467860608c016141fb565b965060808b01356001600160401b038082111561469457600080fd5b6146a08e838f0161435e565b975060a08d01359150808211156146b657600080fd5b6146c28e838f0161435e565b965060c08d01359150808211156146d857600080fd5b6146e48e838f0161435e565b955060e08d01359150808211156146fa57600080fd5b6147068e838f016145c5565b94506101008d013591508082111561471d57600080fd5b6147298e838f016142e1565b93506101208d013591508082111561474057600080fd5b5061474d8d828e0161435e565b9150509295989b9194979a5092959850565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761074b5761074b614775565b8082018082111561074b5761074b614775565b8181038181111561074b5761074b614775565b6000826147e557634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031991909116815260200190565b6020810160108310614813576148136144cf565b91905290565b6001600160e01b03198316815260408101600b831061483a5761483a6144cf565b8260208301529392505050565b6001600160601b03818116838216019080821115610a2a57610a2a614775565b60008151808452602080850194506020840160005b838110156140e457815115158752958201959082019060010161487c565b6060815260006148ad60608301866140aa565b82810360208401526148bf818661451a565b9050828103604084015261458d8185614867565b6080815260006148e66080830187614867565b82810360208401526148f8818761451a565b9050828103604084015261490c81866140aa565b9050828103606084015261492081856140aa565b979650505050505050565b600082601f83011261493c57600080fd5b8135602061494c614302836142be565b8083825260208201915060208460051b87010193508684111561496e57600080fd5b602086015b848110156143535780358352918301918301614973565b6000601f83601f84011261499d57600080fd5b823560206149ad614302836142be565b82815260059290921b850181019181810190878411156149cc57600080fd5b8287015b84811015614a625780356001600160401b03808211156149f05760008081fd5b818a0191508a603f830112614a055760008081fd5b85820135604082821115614a1b57614a1b61422d565b614a2c828b01601f1916890161428e565b92508183528c81838601011115614a435760008081fd5b81818501898501375060009082018701528452509183019183016149d0565b50979650505050505050565b600060e08236031215614a8057600080fd5b614a88614243565b8235815260208301356020820152614aa2604084016141fb565b604082015260608301356001600160401b0380821115614ac157600080fd5b614acd368387016142e1565b60608401526080850135915080821115614ae657600080fd5b614af23683870161492b565b608084015260a0850135915080821115614b0b57600080fd5b614b173683870161498a565b60a084015260c0850135915080821115614b3057600080fd5b50614b3d3682860161492b565b60c08301525092915050565b60006101008236031215614b5c57600080fd5b614b6461426b565b823581526020830135602082015260408301356040820152614b88606084016141fb565b606082015260808301356001600160401b0380821115614ba757600080fd5b614bb33683870161435e565b608084015260a0850135915080821115614bcc57600080fd5b614bd83683870161492b565b60a084015260c0850135915080821115614bf157600080fd5b614bfd3683870161498a565b60c084015260e0850135915080821115614c1657600080fd5b50614c233682860161492b565b60e08301525092915050565b600060018201614c4157614c41614775565b5060010190565b634e487b7160e01b600052603160045260246000fd5b604081526000614c7160408301856140aa565b8281036020840152614c838185614867565b95945050505050565b604081526000614c9f6040830185614867565b8281036020840152614c8381856140aa565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60005b83811015614d17578181015183820152602001614cff565b50506000910152565b60008151808452614d38816020860160208601614cfc565b601f01601f19169290920160200192915050565b6001600160a01b03841681526001600160e01b031983166020820152606060408201819052600090614c8390830184614d20565b60008251614d92818460208701614cfc565b9190910192915050565b6020815260006107486020830184614d20565b6001600160e01b03199290921682526001600160a01b0316602082015260400190565b600060208284031215614de457600080fd5b8151801515811461134457600080fd5b60008151808452602080850194506020840160005b838110156140e457815187529582019590820190600101614e09565b60008282518085526020808601955060208260051b8401016020860160005b84811015614e7257601f19868403018952614e60838351614d20565b98840198925090830190600101614e44565b5090979650505050505050565b60006101008251845260208301516020850152604083015160408501526060830151614eb660608601826001600160a01b03169052565b506080830151816080860152614ece828601826140aa565b91505060a083015184820360a0860152614ee88282614df4565b91505060c083015184820360c0860152614f028282614e25565b91505060e083015184820360e0860152614c838282614df4565b60008151808452602080850194506020840160005b838110156140e457815160068110614f4b57614f4b6144cf565b87529582019590820190600101614f31565b608081526000614f706080830187614e7f565b8560208401528281036040840152845181526020850151602082015260018060a01b036040860151166040820152606085015160e06060830152614fb760e0830182614f1c565b905060808601518282036080840152614fd08282614df4565b91505060a086015182820360a0840152614fea8282614e25565b91505060c086015182820360c08401526150048282614df4565b9350505050614c8360608301846001600160a01b03169052565b60006020828403121561503057600080fd5b81356002811061134457600080fd5b60006020828403121561505157600080fd5b813560ff8116811461134457600080fd5b6040815260006150756040830185614e7f565b905060018060a01b03831660208301529392505050565b6001600160e01b03198316815281516000906150af816004850160208701614cfc565b919091016004019392505050565b6080815260006150d06080830187614d20565b82810360208401526150e281876140aa565b905082810360408401526150f68186614867565b905082810360608401526149208185614e25565b60408152600061511d6040830185614867565b8281036020840152614c838185614e25565b8281526040602082015260006106476040830184614d2056fe5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd976240a26469706673582212200bc26b64e43b490eeae165d45d8ba67887875e399107a0c8239224bc05fd68d764736f6c63430008170033", "deployer": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", "devdoc": { "version": 1, @@ -2026,9 +2026,9 @@ } }, "isFoundry": true, - "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"ErrBelowMinRequiredGovernors\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"ErrContractTypeNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrCurrentProposalIsNotCompleted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrDuplicated\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"name\":\"ErrExistOneInternalCallFailed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"}],\"name\":\"ErrGovernorNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"required\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ErrGovernorNotMatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ErrInsufficientGas\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidArguments\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"}],\"name\":\"ErrInvalidChainId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidExpiryTimestamp\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidInput\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidOrder\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidProposalNonce\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidThreshold\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidVoteWeight\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrLengthMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"callIndex\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"revertMsg\",\"type\":\"bytes\"}],\"name\":\"ErrLooseProposalInternallyRevert\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"ErrNonExecutorCannotRelay\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrOnlySelfCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"ErrOperatorNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrRelayFailed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum RoleAccess\",\"name\":\"expectedRole\",\"type\":\"uint8\"}],\"name\":\"ErrUnauthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrUnsupportedInterface\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrUnsupportedVoteType\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrVoteIsFinalized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrZeroAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrZeroCodeContract\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"BridgeOperatorAddingFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"BridgeOperatorRemovingFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fromBridgeOperator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"toBridgeOperator\",\"type\":\"address\"}],\"name\":\"BridgeOperatorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"statuses\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"uint96[]\",\"name\":\"voteWeights\",\"type\":\"uint96[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"BridgeOperatorsAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"statuses\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"BridgeOperatorsRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"name\":\"CallbackRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ContractUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"round\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"indexed\":false,\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"globalProposalHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"indexed\":false,\"internalType\":\"struct GlobalProposal.GlobalProposalDetail\",\"name\":\"globalProposal\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"}],\"name\":\"GlobalProposalCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"}],\"name\":\"MinRequiredGovernorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"statuses\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"returnDatas\",\"type\":\"bytes[]\"}],\"name\":\"Notified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ProposalApproved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"round\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"indexed\":false,\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"}],\"name\":\"ProposalCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"successCalls\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"returnDatas\",\"type\":\"bytes[]\"}],\"name\":\"ProposalExecuted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ProposalExpired\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"ProposalExpiryDurationChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ProposalRejected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"enum Ballot.VoteType\",\"name\":\"support\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\"}],\"name\":\"ProposalVoted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum GlobalProposal.TargetOption\",\"name\":\"targetOption\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"TargetOptionUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"numerator\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"denominator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousNumerator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousDenominator\",\"type\":\"uint256\"}],\"name\":\"ThresholdUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96[]\",\"name\":\"voteWeights\",\"type\":\"uint96[]\"},{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"addBridgeOperators\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"voteWeight\",\"type\":\"uint256\"}],\"name\":\"checkThreshold\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeOperator\",\"type\":\"address\"}],\"name\":\"getBridgeOperatorWeight\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"weight\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBridgeOperators\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCallbackRegisters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"getContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"contract_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFullBridgeOperatorInfos\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"},{\"internalType\":\"uint96[]\",\"name\":\"weights\",\"type\":\"uint96[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"getGovernorOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"}],\"name\":\"getGovernorWeight\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"weight\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"}],\"name\":\"getGovernorWeights\",\"outputs\":[{\"internalType\":\"uint96[]\",\"name\":\"weights\",\"type\":\"uint96[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGovernors\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"}],\"name\":\"getOperatorOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getProposalExpiryDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"globalProposalRelayed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"roninChainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"bridgeContract\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"callbackRegisters\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"internalType\":\"uint96[]\",\"name\":\"voteWeights\",\"type\":\"uint96[]\"},{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isBridgeOperator\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minimumVoteWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"}],\"name\":\"registerCallbacks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"internalType\":\"struct GlobalProposal.GlobalProposalDetail\",\"name\":\"globalProposal\",\"type\":\"tuple\"},{\"internalType\":\"enum Ballot.VoteType[]\",\"name\":\"supports_\",\"type\":\"uint8[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"signatures\",\"type\":\"tuple[]\"}],\"name\":\"relayGlobalProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"internalType\":\"enum Ballot.VoteType[]\",\"name\":\"supports_\",\"type\":\"uint8[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"signatures\",\"type\":\"tuple[]\"}],\"name\":\"relayProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"removeBridgeOperators\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"}],\"name\":\"resolveTargets\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"round\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"}],\"name\":\"setMinRequiredGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom\",\"type\":\"uint256\"}],\"name\":\"setThreshold\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"}],\"name\":\"sumGovernorsWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"sum\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalBridgeOperator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"}],\"name\":\"unregisterCallbacks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"}],\"name\":\"updateManyTargetOption\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"vote\",\"outputs\":[{\"internalType\":\"enum VoteStatusConsumer.VoteStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"againstVoteWeight\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"forVoteWeight\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"ErrContractTypeNotFound(uint8)\":[{\"details\":\"Error of invalid role.\"}],\"ErrCurrentProposalIsNotCompleted()\":[{\"details\":\"Error thrown when the current proposal is not completed.\"}],\"ErrDuplicated(bytes4)\":[{\"details\":\"Error thrown when a duplicated element is detected in an array.\",\"params\":{\"msgSig\":\"The function signature that invoke the error.\"}}],\"ErrInsufficientGas(bytes32)\":[{\"details\":\"Error thrown when there is insufficient gas to execute a function.\"}],\"ErrInvalidArguments(bytes4)\":[{\"details\":\"Error indicating that arguments are invalid.\"}],\"ErrInvalidChainId(bytes4,uint256,uint256)\":[{\"details\":\"Error indicating that the chain ID is invalid.\",\"params\":{\"actual\":\"Current chain ID that executing function.\",\"expected\":\"Expected chain ID required for the tx to success.\",\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid chain ID.\"}}],\"ErrInvalidExpiryTimestamp()\":[{\"details\":\"Error thrown when an invalid expiry timestamp is provided.\"}],\"ErrInvalidOrder(bytes4)\":[{\"details\":\"Error indicating that an order is invalid.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid order.\"}}],\"ErrInvalidProposalNonce(bytes4)\":[{\"details\":\"Error indicating that the proposal nonce is invalid.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid proposal nonce.\"}}],\"ErrInvalidThreshold(bytes4)\":[{\"details\":\"Error indicating that the provided threshold is invalid for a specific function signature.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that the invalid threshold applies to.\"}}],\"ErrInvalidVoteWeight(bytes4)\":[{\"details\":\"Error indicating that a vote weight is invalid for a specific function signature.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that encountered an invalid vote weight.\"}}],\"ErrLengthMismatch(bytes4)\":[{\"details\":\"Error indicating a mismatch in the length of input parameters or arrays for a specific function.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that has a length mismatch.\"}}],\"ErrLooseProposalInternallyRevert(uint256,bytes)\":[{\"details\":\"Error thrown when the proposal reverts when execute the internal call no. `callIndex` with revert message is `revertMsg`.\"}],\"ErrNonExecutorCannotRelay(address,address)\":[{\"details\":\"Error of the `caller` to relay is not the specified `executor`.\"}],\"ErrOnlySelfCall(bytes4)\":[{\"details\":\"Error indicating that a function can only be called by the contract itself.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that can only be called by the contract itself.\"}}],\"ErrRelayFailed(bytes4)\":[{\"details\":\"Error indicating that a relay call has failed.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the relay call that failed.\"}}],\"ErrUnauthorized(bytes4,uint8)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"expectedRole\":\"The role required to perform the function.\",\"msgSig\":\"The function signature (bytes4) that the caller is unauthorized to perform.\"}}],\"ErrUnsupportedInterface(bytes4,address)\":[{\"details\":\"The error indicating an unsupported interface.\",\"params\":{\"addr\":\"The address where the unsupported interface was encountered.\",\"interfaceId\":\"The bytes4 interface identifier that is not supported.\"}}],\"ErrUnsupportedVoteType(bytes4)\":[{\"details\":\"Error indicating that a vote type is not supported.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the operation that encountered an unsupported vote type.\"}}],\"ErrVoteIsFinalized()\":[{\"details\":\"Error thrown when attempting to interact with a finalized vote.\"}],\"ErrZeroAddress(bytes4)\":[{\"details\":\"Error indicating that given address is null when it should not.\"}],\"ErrZeroCodeContract(address)\":[{\"details\":\"Error of set to non-contract.\"}]},\"events\":{\"BridgeOperatorAddingFailed(address)\":{\"details\":\"Emitted when a bridge operator is failed to add.\"},\"BridgeOperatorRemovingFailed(address)\":{\"details\":\"Emitted when a bridge operator is failed to remove.\"},\"BridgeOperatorUpdated(address,address,address)\":{\"details\":\"Emitted when a bridge operator is updated.\"},\"BridgeOperatorsAdded(bool[],uint96[],address[],address[])\":{\"details\":\"Emitted when new bridge operators are added.\"},\"BridgeOperatorsRemoved(bool[],address[])\":{\"details\":\"Emitted when bridge operators are removed.\"},\"ContractUpdated(uint8,address)\":{\"details\":\"Emitted when a contract is updated.\"},\"GlobalProposalCreated(uint256,bytes32,(uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),bytes32,(uint256,uint256,address,uint8[],uint256[],bytes[],uint256[]),address)\":{\"details\":\"Emitted when a proposal is created\"},\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"MinRequiredGovernorUpdated(uint256)\":{\"details\":\"Emitted when the minimum number of required governors is updated.\"},\"Notified(bytes,address[],bool[],bytes[])\":{\"details\":\"Emitted when the contract notifies multiple registers with statuses and return data.\"},\"ProposalApproved(bytes32)\":{\"details\":\"Emitted when the proposal is approved\"},\"ProposalCreated(uint256,uint256,bytes32,(uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),address)\":{\"details\":\"Emitted when a proposal is created\"},\"ProposalExecuted(bytes32,bool[],bytes[])\":{\"details\":\"Emitted when the proposal is executed\"},\"ProposalExpired(bytes32)\":{\"details\":\"Emitted when the vote is expired\"},\"ProposalExpiryDurationChanged(uint256)\":{\"details\":\"Emitted when the proposal expiry duration is changed.\"},\"ProposalRejected(bytes32)\":{\"details\":\"Emitted when the vote is reject\"},\"ProposalVoted(bytes32,address,uint8,uint256)\":{\"details\":\"Emitted when the proposal is voted\"},\"TargetOptionUpdated(uint8,address)\":{\"details\":\"Emitted when the target options are updated\"},\"ThresholdUpdated(uint256,uint256,uint256,uint256,uint256)\":{\"details\":\"Emitted when the threshold is updated\"}},\"kind\":\"dev\",\"methods\":{\"addBridgeOperators(uint96[],address[],address[])\":{\"details\":\"Adds multiple bridge operators.\",\"params\":{\"bridgeOperators\":\"An array of addresses representing the bridge operators to add.\",\"governors\":\"An array of addresses of hot/cold wallets for bridge operator to update their node address.\"}},\"checkThreshold(uint256)\":{\"details\":\"Checks whether the `_voteWeight` passes the threshold.\"},\"getBridgeOperatorWeight(address)\":{\"details\":\"External function to retrieve the vote weight of a specific bridge operator.\",\"params\":{\"bridgeOperator\":\"The address of the bridge operator to get the vote weight for.\"},\"returns\":{\"weight\":\"The vote weight of the specified bridge operator.\"}},\"getBridgeOperators()\":{\"details\":\"Returns an array of all bridge operators.\",\"returns\":{\"_0\":\"An array containing the addresses of all bridge operators.\"}},\"getCallbackRegisters()\":{\"details\":\"Retrieves the addresses of registered callbacks.\",\"returns\":{\"registers\":\"An array containing the addresses of registered callbacks.\"}},\"getContract(uint8)\":{\"details\":\"Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.\",\"params\":{\"contractType\":\"The role of the contract to retrieve.\"},\"returns\":{\"contract_\":\"The address of the contract with the specified role.\"}},\"getFullBridgeOperatorInfos()\":{\"details\":\"Retrieves the full information of all registered bridge operators. This external function allows external callers to obtain the full information of all the registered bridge operators. The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.\",\"returns\":{\"bridgeOperators\":\"An array of addresses representing the registered bridge operators.\",\"governors\":\"An array of addresses representing the governors of each bridge operator.\",\"weights\":\"An array of uint256 values representing the vote weights of each bridge operator. Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator. Example Usage: ``` (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos(); for (uint256 i = 0; i < bridgeOperators.length; i++) { // Access individual information for each bridge operator. address governor = governors[i]; address bridgeOperator = bridgeOperators[i]; uint256 weight = weights[i]; // ... (Process or use the information as required) ... } ```\"}},\"getGovernorOf(address)\":{\"details\":\"Returns the corresponding `governor` of a `operator`.\"},\"getGovernorWeight(address)\":{\"details\":\"External function to retrieve the vote weight of a specific governor.\",\"params\":{\"governor\":\"The address of the governor to get the vote weight for.\"},\"returns\":{\"weight\":\"voteWeight The vote weight of the specified governor.\"}},\"getGovernorWeights(address[])\":{\"details\":\"Returns the weights of a list of governor addresses.\"},\"getGovernors()\":{\"details\":\"Returns an array of all governors.\",\"returns\":{\"_0\":\"An array containing the addresses of all governors.\"}},\"getOperatorOf(address)\":{\"details\":\"Returns the corresponding `operator` of a `governor`.\"},\"getProposalExpiryDuration()\":{\"details\":\"Returns the expiry duration for a new proposal.\"},\"getThreshold()\":{\"details\":\"Returns the threshold.\"},\"getTotalWeight()\":{\"details\":\"Returns total weights.\"},\"globalProposalRelayed(uint256)\":{\"details\":\"Returns whether the voter `_voter` casted vote for the proposal.\"},\"isBridgeOperator(address)\":{\"details\":\"Checks if the given address is a bridge operator.\",\"params\":{\"addr\":\"The address to check.\"},\"returns\":{\"_0\":\"A boolean indicating whether the address is a bridge operator.\"}},\"minimumVoteWeight()\":{\"details\":\"Returns the minimum vote weight to pass the threshold.\"},\"registerCallbacks(address[])\":{\"details\":\"Registers multiple callbacks with the bridge.\",\"params\":{\"registers\":\"The array of callback addresses to register.\"}},\"relayGlobalProposal((uint256,uint256,address,uint8[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])\":{\"details\":\"See `GovernanceRelay-_relayGlobalProposal`. Requirements: - The method caller is governor.\"},\"relayProposal((uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])\":{\"details\":\"See `GovernanceRelay-_relayProposal`. Requirements: - The method caller is governor.\"},\"removeBridgeOperators(address[])\":{\"details\":\"Removes multiple bridge operators.\",\"params\":{\"bridgeOperators\":\"An array of addresses representing the bridge operators to remove.\"}},\"resolveTargets(uint8[])\":{\"details\":\"Returns corresponding address of target options. Return address(0) on non-existent target.\"},\"setContract(uint8,address)\":{\"details\":\"Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.\",\"params\":{\"addr\":\"The address of the contract to set.\",\"contractType\":\"The role of the contract to set.\"}},\"setMinRequiredGovernor(uint256)\":{\"details\":\"Self-call to update the minimum required governor.\",\"params\":{\"min\":\"The minimum number, this must not less than 3.\"}},\"setThreshold(uint256,uint256)\":{\"details\":\"Sets the threshold. Requirements: - The method caller is admin. Emits the `ThresholdUpdated` event.\"},\"sumGovernorsWeight(address[])\":{\"details\":\"Returns total weights of the governor list.\"},\"totalBridgeOperator()\":{\"details\":\"Returns the total number of bridge operators.\",\"returns\":{\"_0\":\"The total number of bridge operators.\"}},\"unregisterCallbacks(address[])\":{\"details\":\"Unregisters multiple callbacks from the bridge.\",\"params\":{\"registers\":\"The array of callback addresses to unregister.\"}},\"updateManyTargetOption(uint8[],address[])\":{\"details\":\"Updates list of `targetOptions` to `targets`. Requirement: - Only allow self-call through proposal.\"}},\"version\":1},\"userdoc\":{\"errors\":{\"ErrBelowMinRequiredGovernors()\":[{\"notice\":\"Error indicating that the governors list will go below minimum number of required governor.\"}],\"ErrGovernorNotFound(address)\":[{\"notice\":\"Error indicating that cannot find the querying governor\"}],\"ErrGovernorNotMatch(address,address)\":[{\"notice\":\"Error indicating that the msg.sender is not match the required governor\"}],\"ErrInvalidInput()\":[{\"notice\":\"Common invalid input error\"}],\"ErrOperatorNotFound(address)\":[{\"notice\":\"Error indicating that cannot find the querying operator\"}]},\"kind\":\"user\",\"methods\":{\"round(uint256)\":{\"notice\":\"chain id = 0 for global proposal\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/mainchain/MainchainBridgeManager.sol\":\"MainchainBridgeManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@fdk/=lib/foundry-deployment-kit/script/\",\":@openzeppelin/=lib/openzeppelin-contracts/\",\":@prb/math/=lib/prb-math/\",\":@prb/test/=lib/prb-test/src/\",\":@ronin/contracts/=src/\",\":@ronin/script/=script/\",\":@ronin/test/=test/\",\":contract-libs/=lib/foundry-deployment-kit/lib/contract-libs/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/foundry-deployment-kit/lib/forge-std/src/\",\":foundry-deployment-kit/=lib/foundry-deployment-kit/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/contracts/\",\":prb-math/=lib/prb-math/src/\",\":prb-test/=lib/prb-test/src/\",\":solady/=lib/solady/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0xa6a787e7a901af6511e19aa53e1a00352db215a011d2c7a438d0582dd5da76f9\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2a21b14ff90012878752f230d3ffd5c3405e5938d06c97a7d89c0a64561d0d66\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _HEX_SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n // Inspired by OraclizeAPI's implementation - MIT licence\\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\\n\\n if (value == 0) {\\n return \\\"0\\\";\\n }\\n uint256 temp = value;\\n uint256 digits;\\n while (temp != 0) {\\n digits++;\\n temp /= 10;\\n }\\n bytes memory buffer = new bytes(digits);\\n while (value != 0) {\\n digits -= 1;\\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\\n value /= 10;\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n if (value == 0) {\\n return \\\"0x00\\\";\\n }\\n uint256 temp = value;\\n uint256 length = 0;\\n while (temp != 0) {\\n length++;\\n temp >>= 8;\\n }\\n return toHexString(value, length);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xaf159a8b1923ad2a26d516089bceca9bdeaeacd04be50983ea00ba63070f08a3\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.3) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSA {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n } else if (error == RecoverError.InvalidSignatureV) {\\n revert(\\\"ECDSA: invalid signature 'v' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n if (v != 27 && v != 28) {\\n return (address(0), RecoverError.InvalidSignatureV);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", Strings.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0xdb7f5c28fc61cda0bd8ab60ce288e206b791643bcd3ba464a70cbec18895a2f5\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n *\\n * [WARNING]\\n * ====\\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.\\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\\n *\\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.\\n * ====\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n bytes32 lastValue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastValue;\\n // Update the index for the moved value\\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n return set._values[index];\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function _values(Set storage set) private view returns (bytes32[] memory) {\\n return set._values;\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\\n return _values(set._inner);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(AddressSet storage set) internal view returns (address[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n address[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(UintSet storage set) internal view returns (uint256[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n uint256[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0x5050943b32b6a8f282573d166b2e9d87ab7eb4dbba4ab6acf36ecb54fe6995e4\",\"license\":\"MIT\"},\"src/extensions/TransparentUpgradeableProxyV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\\\";\\n\\ncontract TransparentUpgradeableProxyV2 is TransparentUpgradeableProxy {\\n constructor(address _logic, address admin_, bytes memory _data) payable TransparentUpgradeableProxy(_logic, admin_, _data) { }\\n\\n /**\\n * @dev Calls a function from the current implementation as specified by `_data`, which should be an encoded function call.\\n *\\n * Requirements:\\n * - Only the admin can call this function.\\n *\\n * Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid\\n * triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider\\n * reviewing the encoded data `_data` and the method which is called before using this.\\n *\\n */\\n function functionDelegateCall(bytes memory _data) public payable ifAdmin {\\n address _addr = _implementation();\\n assembly {\\n let _result := delegatecall(gas(), _addr, add(_data, 32), mload(_data), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n switch _result\\n case 0 { revert(0, returndatasize()) }\\n default { return(0, returndatasize()) }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x45fc7b71d09da99414b977a56e586b3604670d865e5f36f395d5c98bc4ba64af\",\"license\":\"MIT\"},\"src/extensions/bridge-operator-governance/BridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.23;\\n\\nimport { Initializable } from \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport { IBridgeManagerCallback, BridgeManagerCallbackRegister } from \\\"./BridgeManagerCallbackRegister.sol\\\";\\nimport { IHasContracts, HasContracts } from \\\"../../extensions/collections/HasContracts.sol\\\";\\n\\nimport { IBridgeManager } from \\\"../../interfaces/bridge/IBridgeManager.sol\\\";\\nimport { AddressArrayUtils } from \\\"../../libraries/AddressArrayUtils.sol\\\";\\nimport { ContractType } from \\\"../../utils/ContractType.sol\\\";\\nimport { RoleAccess } from \\\"../../utils/RoleAccess.sol\\\";\\nimport { TUint256Slot } from \\\"../../types/Types.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\nimport \\\"./BridgeManagerQuorum.sol\\\";\\n\\nabstract contract BridgeManager is IBridgeManager, BridgeManagerQuorum, BridgeManagerCallbackRegister {\\n using AddressArrayUtils for address[];\\n\\n struct BridgeManagerStorage {\\n /// @notice List of the governors.\\n /// @dev We do not use EnumerableSet here to maintain identical order of `governors` and `operators`. If `.contains` is needed, use the corresponding weight mapping.\\n address[] _governors;\\n address[] _operators;\\n /// @dev Mapping from address to the governor weight\\n mapping(address governor => uint96 weight) _governorWeight;\\n /// @dev Mapping from address to the operator weight. This must always be identical `_governorWeight`.\\n mapping(address operator => uint96 weight) _operatorWeight;\\n /// @dev Total weight of all governors / operators.\\n uint256 _totalWeight;\\n /// @dev The minimum number of governors that must exist in the contract, to avoid the contract become non-accessible.\\n uint256 _minRequiredGovernor;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"ronin.storage.BridgeManagerStorageLocation\\\")) - 1)) & ~bytes32(uint256(0xff))\\n bytes32 private constant $$_BridgeManagerStorageLocation = 0xc648703095712c0419b6431ae642c061f0a105ac2d7c3d9604061ef4ebc38300;\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n bytes32 public DOMAIN_SEPARATOR;\\n\\n modifier onlyGovernor() virtual {\\n _requireGovernor(msg.sender);\\n _;\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n function __BridgeManager_init(\\n uint256 num,\\n uint256 denom,\\n uint256 roninChainId,\\n address bridgeContract,\\n address[] memory callbackRegisters,\\n address[] memory bridgeOperators,\\n address[] memory governors,\\n uint96[] memory voteWeights\\n ) internal onlyInitializing {\\n __BridgeManagerQuorum_init_unchained(num, denom);\\n __BridgeManagerCallbackRegister_init_unchained(callbackRegisters);\\n __BridgeManager_init_unchained(roninChainId, bridgeContract, bridgeOperators, governors, voteWeights);\\n }\\n\\n function __BridgeManager_init_unchained(\\n uint256 roninChainId,\\n address bridgeContract,\\n address[] memory bridgeOperators,\\n address[] memory governors,\\n uint96[] memory voteWeights\\n ) internal onlyInitializing {\\n _setContract(ContractType.BRIDGE, bridgeContract);\\n\\n DOMAIN_SEPARATOR = keccak256(\\n abi.encode(\\n keccak256(\\\"EIP712Domain(string name,string version,bytes32 salt)\\\"),\\n keccak256(\\\"BridgeManager\\\"), // name hash\\n keccak256(\\\"3\\\"), // version hash\\n keccak256(abi.encode(\\\"BRIDGE_MANAGER\\\", roninChainId)) // salt\\n )\\n );\\n\\n _addBridgeOperators(voteWeights, governors, bridgeOperators);\\n _setMinRequiredGovernor(3);\\n }\\n\\n function _getBridgeManagerStorage() private pure returns (BridgeManagerStorage storage $) {\\n assembly {\\n $.slot := $$_BridgeManagerStorageLocation\\n }\\n }\\n\\n // ===================== CONFIG ========================\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function setContract(ContractType contractType, address addr) external override onlyProxyAdmin {\\n _requireHasCode(addr);\\n _setContract(contractType, addr);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function setMinRequiredGovernor(uint min) external override onlyProxyAdmin {\\n _setMinRequiredGovernor(min);\\n }\\n\\n function _setMinRequiredGovernor(uint min) internal {\\n if (min < 3) revert ErrInvalidInput();\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n $._minRequiredGovernor = min;\\n emit MinRequiredGovernorUpdated(min);\\n }\\n\\n /**\\n * @dev Internal function to require that the caller has governor role access.\\n */\\n function _requireGovernor(address addr) internal view {\\n if (_getGovernorWeight(addr) == 0) {\\n revert ErrUnauthorized(msg.sig, RoleAccess.GOVERNOR);\\n }\\n }\\n\\n // ===================== WEIGHTS METHOD ========================\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getTotalWeight() public view returns (uint256) {\\n return _totalWeight();\\n }\\n\\n function _totalWeight() internal view override returns (uint256) {\\n return _getBridgeManagerStorage()._totalWeight;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getGovernorWeights(address[] calldata governors) external view returns (uint96[] memory weights) {\\n weights = _getGovernorWeights(governors);\\n }\\n\\n /**\\n * @dev Internal function to get the vote weights of a given array of governors.\\n */\\n function _getGovernorWeights(address[] memory governors) internal view returns (uint96[] memory weights) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n weights = new uint96[](governors.length);\\n\\n for (uint256 i; i < governors.length; i++) {\\n weights[i] = $._governorWeight[governors[i]];\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getGovernorWeight(address governor) external view returns (uint96 weight) {\\n weight = _getGovernorWeight(governor);\\n }\\n\\n /**\\n * @dev Internal function to retrieve the vote weight of a specific governor.\\n */\\n function _getGovernorWeight(address governor) internal view returns (uint96) {\\n return _getBridgeManagerStorage()._governorWeight[governor];\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function sumGovernorsWeight(address[] calldata governors) external view nonDuplicate(governors) returns (uint256 sum) {\\n sum = _sumGovernorsWeight(governors);\\n }\\n\\n /**\\n * @dev Internal function to calculate the sum of vote weights for a given array of governors.\\n * @param governors The non-duplicated input.\\n */\\n function _sumGovernorsWeight(address[] memory governors) internal view nonDuplicate(governors) returns (uint256 sum) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n for (uint256 i; i < governors.length; i++) {\\n sum += $._governorWeight[governors[i]];\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint96 weight) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n return $._operatorWeight[bridgeOperator];\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function minimumVoteWeight() public view virtual returns (uint256) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n (uint256 numerator, uint256 denominator) = getThreshold();\\n return (numerator * $._totalWeight + denominator - 1) / denominator;\\n }\\n\\n // ===================== MANAGER CRUD ========================\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function addBridgeOperators(uint96[] calldata voteWeights, address[] calldata governors, address[] calldata bridgeOperators) external onlyProxyAdmin {\\n _addBridgeOperators(voteWeights, governors, bridgeOperators);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function removeBridgeOperators(address[] calldata bridgeOperators) external onlyProxyAdmin {\\n _removeBridgeOperators(bridgeOperators);\\n }\\n\\n /**\\n * @dev Internal function to add bridge operators.\\n *\\n * This function adds the specified `bridgeOperators` to the bridge operator set and establishes the associated mappings.\\n *\\n * Requirements:\\n * - The caller must have the necessary permission to add bridge operators.\\n * - The lengths of `voteWeights`, `governors`, and `bridgeOperators` arrays must be equal.\\n *\\n * @return addeds An array of boolean values indicating whether each bridge operator was successfully added.\\n */\\n function _addBridgeOperators(\\n uint96[] memory voteWeights,\\n address[] memory newGovernors,\\n address[] memory newOperators\\n ) internal nonDuplicate(newGovernors.extend(newOperators)) returns (bool[] memory addeds) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n uint256 length = newOperators.length;\\n if (!(length == voteWeights.length && length == newGovernors.length)) revert ErrLengthMismatch(msg.sig);\\n addeds = new bool[](length);\\n\\n // simply skip add operations if inputs are empty.\\n if (length == 0) return addeds;\\n\\n address iGovernor;\\n address iOperator;\\n uint96 iVoteWeight;\\n uint256 accumulatedWeight;\\n\\n for (uint256 i; i < length; i++) {\\n iGovernor = newGovernors[i];\\n iOperator = newOperators[i];\\n iVoteWeight = voteWeights[i];\\n\\n // Check non-zero inputs\\n _requireNonZeroAddress(iGovernor);\\n _requireNonZeroAddress(iOperator);\\n if (iVoteWeight == 0) revert ErrInvalidVoteWeight(msg.sig);\\n\\n // Check not yet added operators\\n addeds[i] = ($._governorWeight[iGovernor] + $._governorWeight[iOperator] + $._operatorWeight[iOperator] + $._operatorWeight[iGovernor]) == 0;\\n\\n // Only add the valid operator\\n if (addeds[i]) {\\n // Add governor to list, update governor weight\\n $._governors.push(iGovernor);\\n $._governorWeight[iGovernor] = iVoteWeight;\\n\\n // Add operator to list, update governor weight\\n $._operators.push(iOperator);\\n $._operatorWeight[iOperator] = iVoteWeight;\\n\\n accumulatedWeight += iVoteWeight;\\n }\\n }\\n\\n $._totalWeight += accumulatedWeight;\\n\\n _notifyRegisters(IBridgeManagerCallback.onBridgeOperatorsAdded.selector, abi.encode(newOperators, voteWeights, addeds));\\n\\n emit BridgeOperatorsAdded(addeds, voteWeights, newGovernors, newOperators);\\n }\\n\\n /**\\n * @dev Internal function to remove bridge operators.\\n *\\n * This function removes the specified `bridgeOperators` from the bridge operator set and related mappings.\\n *\\n * Requirements:\\n * - The caller must have the necessary permission to remove bridge operators.\\n *\\n * @param removingOperators An array of addresses representing the bridge operators to be removed.\\n * @return removeds An array of boolean values indicating whether each bridge operator was successfully removed.\\n */\\n function _removeBridgeOperators(address[] memory removingOperators) internal nonDuplicate(removingOperators) returns (bool[] memory removeds) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n uint256 length = removingOperators.length;\\n removeds = new bool[](length);\\n\\n // simply skip remove operations if inputs are empty.\\n if (length == 0) return removeds;\\n if ($._governors.length - length < $._minRequiredGovernor) {\\n revert ErrBelowMinRequiredGovernors();\\n }\\n\\n address iGovernor;\\n address iOperator;\\n uint256 accumulatedWeight;\\n uint idx;\\n\\n for (uint256 i; i < length; i++) {\\n iOperator = removingOperators[i];\\n\\n // Check non-zero inputs\\n (iGovernor, idx) = _getGovernorOf(iOperator);\\n _requireNonZeroAddress(iGovernor);\\n _requireNonZeroAddress(iOperator);\\n\\n // Check existing operators\\n removeds[i] = $._governorWeight[iGovernor] > 0 && $._operatorWeight[iOperator] > 0;\\n\\n // Only remove the valid operator\\n if (removeds[i]) {\\n uint removingVoteWeight = $._governorWeight[iGovernor];\\n\\n // Remove governor from list, update governor weight\\n uint lastIdx = $._governors.length - 1;\\n $._governors[idx] = $._governors[lastIdx];\\n $._governors.pop();\\n delete $._governorWeight[iGovernor];\\n\\n // Remove operator from list, update operator weight\\n $._operators[idx] = $._operators[lastIdx];\\n $._operators.pop();\\n delete $._operatorWeight[iOperator];\\n\\n accumulatedWeight += removingVoteWeight;\\n }\\n }\\n\\n $._totalWeight -= accumulatedWeight;\\n\\n _notifyRegisters(IBridgeManagerCallback.onBridgeOperatorsRemoved.selector, abi.encode(removingOperators, removeds));\\n\\n emit BridgeOperatorsRemoved(removeds, removingOperators);\\n }\\n\\n function _findInArray(address[] storage $_array, address addr) internal view returns (bool found, uint idx) {\\n for (uint i; i < $_array.length; i++) {\\n if (addr == $_array[i]) {\\n return (true, i);\\n }\\n }\\n\\n return (false, type(uint256).max);\\n }\\n\\n // ================= MANAGER VIEW METHODS =============\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function totalBridgeOperator() external view returns (uint256) {\\n return _getBridgeManagerStorage()._operators.length;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function isBridgeOperator(address addr) external view returns (bool) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n return $._operatorWeight[addr] > 0;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getBridgeOperators() external view returns (address[] memory) {\\n return _getBridgeManagerStorage()._operators;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getGovernors() external view returns (address[] memory) {\\n return _getBridgeManagerStorage()._governors;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getOperatorOf(address governor) external view returns (address operator) {\\n (bool found, uint idx) = _findInArray(_getBridgeManagerStorage()._governors, governor);\\n if (!found) revert ErrGovernorNotFound(governor);\\n\\n return _getBridgeManagerStorage()._operators[idx];\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getGovernorOf(address operator) external view returns (address governor) {\\n (governor,) = _getGovernorOf(operator);\\n }\\n\\n function _getGovernorOf(address operator) internal view returns (address governor, uint idx) {\\n (bool found, uint foundId) = _findInArray(_getBridgeManagerStorage()._operators, operator);\\n if (!found) revert ErrOperatorNotFound(operator);\\n\\n return (_getBridgeManagerStorage()._governors[foundId], foundId);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getFullBridgeOperatorInfos() external view returns (address[] memory governors, address[] memory bridgeOperators, uint96[] memory weights) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n governors = $._governors;\\n bridgeOperators = $._operators;\\n weights = _getGovernorWeights(governors);\\n }\\n}\\n\",\"keccak256\":\"0xa66d73d33f953f3262714999043f99fb7b7542d1d29c481e376d9ecd2b15b28b\",\"license\":\"MIT\"},\"src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { Initializable } from \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport { EnumerableSet } from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\nimport { IBridgeManagerCallbackRegister } from \\\"../../interfaces/bridge/IBridgeManagerCallbackRegister.sol\\\";\\nimport { IBridgeManagerCallback } from \\\"../../interfaces/bridge/IBridgeManagerCallback.sol\\\";\\nimport { HasContracts } from \\\"../../extensions/collections/HasContracts.sol\\\";\\nimport { TransparentUpgradeableProxyV2, IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\n\\n/**\\n * @title BridgeManagerCallbackRegister\\n * @dev A contract that manages callback registrations and execution for a bridge.\\n */\\nabstract contract BridgeManagerCallbackRegister is IBridgeManagerCallbackRegister, IdentityGuard, Initializable, HasContracts {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n /**\\n * @dev Storage slot for the address set of callback registers.\\n * @dev Value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeAdmin.callbackRegisters.slot\\\") - 1.\\n */\\n bytes32 private constant CALLBACK_REGISTERS_SLOT = 0x5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd976240;\\n\\n function __BridgeManagerCallbackRegister_init_unchained(address[] memory callbackRegisters) internal onlyInitializing {\\n _registerCallbacks(callbackRegisters);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallbackRegister\\n */\\n function registerCallbacks(address[] calldata registers) external onlyProxyAdmin {\\n _registerCallbacks(registers);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallbackRegister\\n */\\n function unregisterCallbacks(address[] calldata registers) external onlyProxyAdmin nonDuplicate(registers) {\\n EnumerableSet.AddressSet storage _callbackRegisters = _getCallbackRegisters();\\n\\n for (uint256 i; i < registers.length; i++) {\\n _callbackRegisters.remove(registers[i]);\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallbackRegister\\n */\\n function getCallbackRegisters() external view returns (address[] memory registers) {\\n registers = _getCallbackRegisters().values();\\n }\\n\\n /**\\n * @dev Internal function to register multiple callbacks with the bridge.\\n * @param registers The array of callback addresses to register.\\n */\\n function _registerCallbacks(address[] memory registers) internal nonDuplicate(registers) {\\n EnumerableSet.AddressSet storage _callbackRegisters = _getCallbackRegisters();\\n address register;\\n bool regSuccess;\\n\\n for (uint256 i; i < registers.length; i++) {\\n register = registers[i];\\n\\n _requireHasCode(register);\\n _requireSupportsInterface(register, type(IBridgeManagerCallback).interfaceId);\\n\\n regSuccess = _callbackRegisters.add(register);\\n\\n emit CallbackRegistered(register, regSuccess);\\n }\\n }\\n\\n /**\\n * @dev Same as {_notifyRegistersUnsafe} but revert when there at least one failed internal call.\\n */\\n function _notifyRegisters(bytes4 callbackFnSig, bytes memory inputs) internal {\\n if (!_notifyRegistersUnsafe(callbackFnSig, inputs)) {\\n revert ErrExistOneInternalCallFailed(msg.sender, callbackFnSig, inputs);\\n }\\n }\\n\\n /**\\n * @dev Internal function to notify all registered callbacks with the provided function signature and data.\\n * @param callbackFnSig The function signature of the callback method.\\n * @param inputs The data to pass to the callback method.\\n * @return allSuccess Return true if all internal calls are success\\n */\\n function _notifyRegistersUnsafe(bytes4 callbackFnSig, bytes memory inputs) internal returns (bool allSuccess) {\\n allSuccess = true;\\n\\n address[] memory registers = _getCallbackRegisters().values();\\n uint256 length = registers.length;\\n if (length == 0) return allSuccess;\\n\\n bool[] memory successes = new bool[](length);\\n bytes[] memory returnDatas = new bytes[](length);\\n bytes memory callData = abi.encodePacked(callbackFnSig, inputs);\\n bytes memory proxyCallData = abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (callData));\\n\\n for (uint256 i; i < length; i++) {\\n // First, attempt to call normally\\n (successes[i], returnDatas[i]) = registers[i].call(callData);\\n\\n // If cannot call normally, attempt to call as the recipient is the proxy, and this caller is its admin.\\n if (!successes[i]) {\\n (successes[i], returnDatas[i]) = registers[i].call(proxyCallData);\\n allSuccess = allSuccess && successes[i];\\n }\\n }\\n\\n emit Notified(callData, registers, successes, returnDatas);\\n }\\n\\n /**\\n * @dev Internal function to retrieve the address set of callback registers.\\n * @return callbackRegisters The storage reference to the callback registers.\\n */\\n function _getCallbackRegisters() internal pure returns (EnumerableSet.AddressSet storage callbackRegisters) {\\n assembly (\\\"memory-safe\\\") {\\n callbackRegisters.slot := CALLBACK_REGISTERS_SLOT\\n }\\n }\\n}\\n\",\"keccak256\":\"0xee1c849d6b50cda917d6c918a23116cc288488958f58ef215707204e7c2f847f\",\"license\":\"MIT\"},\"src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.23;\\n\\nimport { Initializable } from \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport { IQuorum } from \\\"../../interfaces/IQuorum.sol\\\";\\nimport { IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\nimport { HasContracts } from \\\"../../extensions/collections/HasContracts.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\n\\nabstract contract BridgeManagerQuorum is IQuorum, IdentityGuard, Initializable, HasContracts {\\n struct BridgeManagerQuorumStorage {\\n uint256 _nonce;\\n uint256 _numerator;\\n uint256 _denominator;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"ronin.storage.BridgeManagerQuorumStorage\\\")) - 1)) & ~bytes32(uint256(0xff))\\n bytes32 private constant $$_BridgeManagerQuorumStorage = 0xf3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00;\\n\\n function __BridgeManagerQuorum_init_unchained(uint256 num, uint256 denom) internal onlyInitializing {\\n BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage();\\n $._nonce = 1;\\n\\n _setThreshold(num, denom);\\n }\\n\\n function _getBridgeManagerQuorumStorage() private pure returns (BridgeManagerQuorumStorage storage $) {\\n assembly {\\n $.slot := $$_BridgeManagerQuorumStorage\\n }\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function setThreshold(uint256 num, uint256 denom) external override onlyProxyAdmin {\\n _setThreshold(num, denom);\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function getThreshold() public view virtual returns (uint256 num, uint256 denom) {\\n BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage();\\n return ($._numerator, $._denominator);\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function checkThreshold(uint256 voteWeight) external view virtual returns (bool) {\\n BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage();\\n\\n return voteWeight * $._denominator >= $._numerator * _totalWeight();\\n }\\n\\n /**\\n * @dev Sets threshold and returns the old one.\\n *\\n * Emits the `ThresholdUpdated` event.\\n *\\n */\\n function _setThreshold(uint256 num, uint256 denom) internal virtual {\\n if (num > denom || denom <= 1) revert ErrInvalidThreshold(msg.sig);\\n\\n BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage();\\n\\n uint256 prevNum = $._numerator;\\n uint256 prevDenom = $._denominator;\\n\\n $._numerator = num;\\n $._denominator = denom;\\n\\n emit ThresholdUpdated($._nonce++, num, denom, prevNum, prevDenom);\\n }\\n\\n function _totalWeight() internal view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0xd49face0efa89eac09d2d6a5eb69598fd706ba1aac8d431b22212643a507b74e\",\"license\":\"MIT\"},\"src/extensions/collections/HasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { HasProxyAdmin } from \\\"./HasProxyAdmin.sol\\\";\\nimport \\\"../../interfaces/collections/IHasContracts.sol\\\";\\nimport { IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\nimport { ErrUnexpectedInternalCall } from \\\"../../utils/CommonErrors.sol\\\";\\n\\n/**\\n * @title HasContracts\\n * @dev A contract that provides functionality to manage multiple contracts with different roles.\\n */\\nabstract contract HasContracts is HasProxyAdmin, IHasContracts, IdentityGuard {\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.collections.HasContracts.slot\\\") - 1\\n bytes32 private constant _STORAGE_SLOT = 0xdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb;\\n\\n /**\\n * @dev Modifier to restrict access to functions only to contracts with a specific role.\\n * @param contractType The contract type that allowed to call\\n */\\n modifier onlyContract(ContractType contractType) virtual {\\n _requireContract(contractType);\\n _;\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function setContract(ContractType contractType, address addr) external virtual onlyProxyAdmin {\\n _requireHasCode(addr);\\n _setContract(contractType, addr);\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function getContract(ContractType contractType) public view returns (address contract_) {\\n contract_ = _getContractMap()[uint8(contractType)];\\n if (contract_ == address(0)) revert ErrContractTypeNotFound(contractType);\\n }\\n\\n /**\\n * @dev Internal function to set the address of a contract with a specific role.\\n * @param contractType The contract type of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function _setContract(ContractType contractType, address addr) internal virtual {\\n _getContractMap()[uint8(contractType)] = addr;\\n emit ContractUpdated(contractType, addr);\\n }\\n\\n /**\\n * @dev Internal function to access the mapping of contract addresses with roles.\\n * @return contracts_ The mapping of contract addresses with roles.\\n */\\n function _getContractMap() private pure returns (mapping(uint8 => address) storage contracts_) {\\n assembly {\\n contracts_.slot := _STORAGE_SLOT\\n }\\n }\\n\\n /**\\n * @dev Internal function to check if the calling contract has a specific role.\\n * @param contractType The contract type that the calling contract must have.\\n * @dev Throws an error if the calling contract does not have the specified role.\\n */\\n function _requireContract(ContractType contractType) private view {\\n if (msg.sender != getContract(contractType)) {\\n revert ErrUnexpectedInternalCall(msg.sig, contractType, msg.sender);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7dbefa31230e6e4bd319f02d94893cbfd07ee12a0e016f5fadc57660df01891\",\"license\":\"MIT\"},\"src/extensions/collections/HasProxyAdmin.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/StorageSlot.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\n\\nabstract contract HasProxyAdmin {\\n // bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n modifier onlyProxyAdmin() {\\n _requireProxyAdmin();\\n _;\\n }\\n\\n /**\\n * @dev Returns proxy admin.\\n */\\n function _getProxyAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n function _requireProxyAdmin() internal view {\\n if (msg.sender != _getProxyAdmin()) revert ErrUnauthorized(msg.sig, RoleAccess.ADMIN);\\n }\\n}\\n\",\"keccak256\":\"0xad3db02c99a960b60151f2ad45eed46073d14fe1ed861f496c7aeefacbbc528e\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/CoreGovernance.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport \\\"../../libraries/Proposal.sol\\\";\\nimport \\\"../../libraries/GlobalProposal.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\nimport \\\"../../libraries/Ballot.sol\\\";\\nimport \\\"../../interfaces/consumers/ChainTypeConsumer.sol\\\";\\nimport \\\"../../interfaces/consumers/SignatureConsumer.sol\\\";\\nimport \\\"../../interfaces/consumers/VoteStatusConsumer.sol\\\";\\n\\nabstract contract CoreGovernance is Initializable, SignatureConsumer, VoteStatusConsumer, ChainTypeConsumer {\\n using Proposal for Proposal.ProposalDetail;\\n\\n /**\\n * @dev Error thrown when attempting to interact with a finalized vote.\\n */\\n error ErrVoteIsFinalized();\\n\\n /**\\n * @dev Error thrown when the current proposal is not completed.\\n */\\n error ErrCurrentProposalIsNotCompleted();\\n\\n struct ProposalVote {\\n VoteStatus status;\\n bytes32 hash;\\n uint256 againstVoteWeight; // Total weight of against votes\\n uint256 forVoteWeight; // Total weight of for votes\\n address[] forVoteds; // Array of addresses voting for\\n address[] againstVoteds; // Array of addresses voting against\\n uint256 expiryTimestamp;\\n mapping(address => Signature) sig;\\n mapping(address => bool) voted;\\n }\\n\\n /// @dev Emitted when a proposal is created\\n event ProposalCreated(uint256 indexed chainId, uint256 indexed round, bytes32 indexed proposalHash, Proposal.ProposalDetail proposal, address creator);\\n /// @dev Emitted when the proposal is voted\\n event ProposalVoted(bytes32 indexed proposalHash, address indexed voter, Ballot.VoteType support, uint256 weight);\\n /// @dev Emitted when the proposal is approved\\n event ProposalApproved(bytes32 indexed proposalHash);\\n /// @dev Emitted when the vote is reject\\n event ProposalRejected(bytes32 indexed proposalHash);\\n /// @dev Emitted when the vote is expired\\n event ProposalExpired(bytes32 indexed proposalHash);\\n /// @dev Emitted when the proposal is executed\\n event ProposalExecuted(bytes32 indexed proposalHash, bool[] successCalls, bytes[] returnDatas);\\n /// @dev Emitted when the proposal expiry duration is changed.\\n event ProposalExpiryDurationChanged(uint256 indexed duration);\\n\\n /// @dev Mapping from chain id => vote round\\n /// @notice chain id = 0 for global proposal\\n mapping(uint256 => uint256) public round;\\n /// @dev Mapping from chain id => vote round => proposal vote\\n mapping(uint256 => mapping(uint256 => ProposalVote)) public vote;\\n\\n uint256 internal _proposalExpiryDuration;\\n\\n function __CoreGovernance_init(uint256 expiryDuration) internal onlyInitializing {\\n __CoreGovernance_init_unchained(expiryDuration);\\n }\\n\\n function __CoreGovernance_init_unchained(uint256 expiryDuration) internal onlyInitializing {\\n _setProposalExpiryDuration(expiryDuration);\\n }\\n\\n /**\\n * @dev Creates new voting round by calculating the `_round` number of chain `_chainId`.\\n * Increases the `_round` number if the previous one is not expired. Delete the previous proposal\\n * if it is expired and not increase the `_round`.\\n */\\n function _createVotingRound(uint256 _chainId) internal returns (uint256 _round) {\\n _round = round[_chainId];\\n // Skip checking for the first ever round\\n if (_round == 0) {\\n _round = round[_chainId] = 1;\\n } else {\\n ProposalVote storage _latestProposalVote = vote[_chainId][_round];\\n bool _isExpired = _tryDeleteExpiredVotingRound(_latestProposalVote);\\n // Skip increasing round number if the latest round is expired, allow the vote to be overridden\\n if (!_isExpired) {\\n if (_latestProposalVote.status == VoteStatus.Pending) revert ErrCurrentProposalIsNotCompleted();\\n unchecked {\\n _round = ++round[_chainId];\\n }\\n }\\n }\\n }\\n\\n /**\\n * @dev Saves new round voting for the proposal `_proposalHash` of chain `_chainId`.\\n */\\n function _saveVotingRound(ProposalVote storage _vote, bytes32 _proposalHash, uint256 _expiryTimestamp) internal {\\n _vote.hash = _proposalHash;\\n _vote.expiryTimestamp = _expiryTimestamp;\\n }\\n\\n /**\\n * @dev Proposes proposal struct.\\n *\\n * Requirements:\\n * - The chain id is not equal to 0.\\n * - The proposal nonce is equal to the new round.\\n *\\n * Emits the `ProposalCreated` event.\\n *\\n */\\n function _proposeProposalStruct(Proposal.ProposalDetail memory proposal, address creator) internal virtual returns (uint256 round_) {\\n uint256 chainId = proposal.chainId;\\n if (chainId == 0) revert ErrInvalidChainId(msg.sig, 0, block.chainid);\\n proposal.validate(_proposalExpiryDuration);\\n\\n bytes32 proposalHash = proposal.hash();\\n round_ = _createVotingRound(chainId);\\n _saveVotingRound(vote[chainId][round_], proposalHash, proposal.expiryTimestamp);\\n if (round_ != proposal.nonce) revert ErrInvalidProposalNonce(msg.sig);\\n emit ProposalCreated(chainId, round_, proposalHash, proposal, creator);\\n }\\n\\n /**\\n * @dev Casts vote for the proposal with data and returns whether the voting is done.\\n *\\n * Requirements:\\n * - The proposal nonce is equal to the round.\\n * - The vote is not finalized.\\n * - The voter has not voted for the round.\\n *\\n * Emits the `ProposalVoted` event. Emits the `ProposalApproved`, `ProposalExecuted` or `ProposalRejected` once the\\n * proposal is approved, executed or rejected.\\n *\\n */\\n function _castVote(\\n Proposal.ProposalDetail memory proposal,\\n Ballot.VoteType support,\\n uint256 minimumForVoteWeight,\\n uint256 minimumAgainstVoteWeight,\\n address voter,\\n Signature memory signature,\\n uint256 voterWeight\\n ) internal virtual returns (bool done) {\\n uint256 chainId = proposal.chainId;\\n uint256 round_ = proposal.nonce;\\n ProposalVote storage _vote = vote[chainId][round_];\\n\\n if (_tryDeleteExpiredVotingRound(_vote)) {\\n return true;\\n }\\n\\n if (round[proposal.chainId] != round_) revert ErrInvalidProposalNonce(msg.sig);\\n if (_vote.status != VoteStatus.Pending) revert ErrVoteIsFinalized();\\n if (_voted(_vote, voter)) revert ErrAlreadyVoted(voter);\\n\\n _vote.voted[voter] = true;\\n // Stores the signature if it is not empty\\n if (signature.r > 0 || signature.s > 0 || signature.v > 0) {\\n _vote.sig[voter] = signature;\\n }\\n emit ProposalVoted(_vote.hash, voter, support, voterWeight);\\n\\n uint256 _forVoteWeight;\\n uint256 _againstVoteWeight;\\n if (support == Ballot.VoteType.For) {\\n _vote.forVoteds.push(voter);\\n _forVoteWeight = _vote.forVoteWeight += voterWeight;\\n } else if (support == Ballot.VoteType.Against) {\\n _vote.againstVoteds.push(voter);\\n _againstVoteWeight = _vote.againstVoteWeight += voterWeight;\\n } else {\\n revert ErrUnsupportedVoteType(msg.sig);\\n }\\n\\n if (_forVoteWeight >= minimumForVoteWeight) {\\n done = true;\\n _vote.status = VoteStatus.Approved;\\n emit ProposalApproved(_vote.hash);\\n if (proposal.isAutoExecute()) {\\n _tryExecute(_vote, proposal);\\n }\\n } else if (_againstVoteWeight >= minimumAgainstVoteWeight) {\\n done = true;\\n _vote.status = VoteStatus.Rejected;\\n emit ProposalRejected(_vote.hash);\\n }\\n }\\n\\n /**\\n * @dev The specified executor executes the proposal on an approved proposal.\\n */\\n function _executeWithCaller(Proposal.ProposalDetail memory proposal, address caller) internal {\\n bytes32 proposalHash = proposal.hash();\\n ProposalVote storage _vote = vote[proposal.chainId][proposal.nonce];\\n\\n if (_vote.hash != proposalHash) {\\n revert ErrInvalidProposal(proposalHash, _vote.hash);\\n }\\n\\n if (_vote.status != VoteStatus.Approved) revert ErrProposalNotApproved();\\n if (caller != proposal.executor) revert ErrInvalidExecutor();\\n\\n _tryExecute(_vote, proposal);\\n }\\n\\n /**\\n * @dev When the contract is on Ronin chain, checks whether the proposal is expired and delete it if is expired.\\n *\\n * Emits the event `ProposalExpired` if the vote is expired.\\n *\\n * Note: This function assumes the vote `_proposalVote` is already created, consider verifying the vote's existence\\n * before or it will emit an unexpected event of `ProposalExpired`.\\n */\\n function _tryDeleteExpiredVotingRound(ProposalVote storage proposalVote) internal returns (bool isExpired) {\\n isExpired = _getChainType() == ChainType.RoninChain && proposalVote.status == VoteStatus.Pending && proposalVote.expiryTimestamp <= block.timestamp;\\n\\n if (isExpired) {\\n emit ProposalExpired(proposalVote.hash);\\n\\n for (uint256 _i; _i < proposalVote.forVoteds.length;) {\\n delete proposalVote.voted[proposalVote.forVoteds[_i]];\\n delete proposalVote.sig[proposalVote.forVoteds[_i]];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n for (uint256 _i; _i < proposalVote.againstVoteds.length;) {\\n delete proposalVote.voted[proposalVote.againstVoteds[_i]];\\n delete proposalVote.sig[proposalVote.againstVoteds[_i]];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n delete proposalVote.status;\\n delete proposalVote.hash;\\n delete proposalVote.againstVoteWeight;\\n delete proposalVote.forVoteWeight;\\n delete proposalVote.forVoteds;\\n delete proposalVote.againstVoteds;\\n delete proposalVote.expiryTimestamp;\\n }\\n }\\n\\n /**\\n * @dev Executes the proposal and update the vote status once the proposal is executable.\\n */\\n function _tryExecute(ProposalVote storage vote_, Proposal.ProposalDetail memory proposal) internal {\\n if (proposal.executable()) {\\n vote_.status = VoteStatus.Executed;\\n (bool[] memory _successCalls, bytes[] memory _returnDatas) = proposal.execute();\\n emit ProposalExecuted(vote_.hash, _successCalls, _returnDatas);\\n }\\n }\\n\\n /**\\n * @dev Sets the expiry duration for a new proposal.\\n */\\n function _setProposalExpiryDuration(uint256 expiryDuration) internal {\\n _proposalExpiryDuration = expiryDuration;\\n emit ProposalExpiryDurationChanged(expiryDuration);\\n }\\n\\n /**\\n * @dev Returns whether the voter casted for the proposal.\\n */\\n function _voted(ProposalVote storage vote_, address voter) internal view returns (bool) {\\n return vote_.voted[voter];\\n }\\n\\n /**\\n * @dev Returns total weight from validators.\\n */\\n function _getTotalWeight() internal view virtual returns (uint256);\\n\\n /**\\n * @dev Returns minimum vote to pass a proposal.\\n */\\n function _getMinimumVoteWeight() internal view virtual returns (uint256);\\n\\n /**\\n * @dev Returns current context is running on whether Ronin chain or on mainchain.\\n */\\n function _getChainType() internal view virtual returns (ChainType);\\n}\\n\",\"keccak256\":\"0xa8dfef02fbfbda8ec1cc681a59719d1d570fb8b652f6775b7d9af9c3e32fed26\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/GlobalCoreGovernance.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../libraries/Proposal.sol\\\";\\nimport \\\"../../libraries/GlobalProposal.sol\\\";\\nimport \\\"./CoreGovernance.sol\\\";\\n\\nabstract contract GlobalCoreGovernance is CoreGovernance {\\n using Proposal for Proposal.ProposalDetail;\\n using GlobalProposal for GlobalProposal.GlobalProposalDetail;\\n\\n mapping(GlobalProposal.TargetOption => address) internal _targetOptionsMap;\\n\\n /// @dev Emitted when a proposal is created\\n event GlobalProposalCreated(\\n uint256 indexed round,\\n bytes32 indexed proposalHash,\\n Proposal.ProposalDetail proposal,\\n bytes32 globalProposalHash,\\n GlobalProposal.GlobalProposalDetail globalProposal,\\n address creator\\n );\\n\\n /// @dev Emitted when the target options are updated\\n event TargetOptionUpdated(GlobalProposal.TargetOption indexed targetOption, address indexed addr);\\n\\n function __GlobalCoreGovernance_init(GlobalProposal.TargetOption[] memory targetOptions, address[] memory addrs) internal onlyInitializing {\\n __GlobalCoreGovernance_init_unchained(targetOptions, addrs);\\n }\\n\\n function __GlobalCoreGovernance_init_unchained(GlobalProposal.TargetOption[] memory targetOptions, address[] memory addrs) internal onlyInitializing {\\n _updateTargetOption(GlobalProposal.TargetOption.BridgeManager, address(this));\\n _updateManyTargetOption(targetOptions, addrs);\\n }\\n\\n /**\\n * @dev Proposes for a global proposal.\\n *\\n * Emits the `GlobalProposalCreated` event.\\n *\\n */\\n function _proposeGlobal(\\n uint256 expiryTimestamp,\\n GlobalProposal.TargetOption[] calldata targetOptions,\\n address executor,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n uint256[] memory gasAmounts,\\n address creator\\n ) internal virtual {\\n uint256 round_ = _createVotingRound(0);\\n GlobalProposal.GlobalProposalDetail memory globalProposal =\\n GlobalProposal.GlobalProposalDetail(round_, expiryTimestamp, executor, targetOptions, values, calldatas, gasAmounts);\\n Proposal.ProposalDetail memory proposal = globalProposal.intoProposalDetail(_resolveTargets({ targetOptions: targetOptions, strict: true }));\\n proposal.validate(_proposalExpiryDuration);\\n\\n bytes32 proposalHash = proposal.hash();\\n _saveVotingRound(vote[0][round_], proposalHash, expiryTimestamp);\\n emit GlobalProposalCreated(round_, proposalHash, proposal, globalProposal.hash(), globalProposal, creator);\\n }\\n\\n /**\\n * @dev Proposes global proposal struct.\\n *\\n * Requirements:\\n * - The proposal nonce is equal to the new round.\\n *\\n * Emits the `GlobalProposalCreated` event.\\n *\\n */\\n function _proposeGlobalStruct(\\n GlobalProposal.GlobalProposalDetail memory globalProposal,\\n address creator\\n ) internal virtual returns (Proposal.ProposalDetail memory proposal) {\\n proposal = globalProposal.intoProposalDetail(_resolveTargets({ targetOptions: globalProposal.targetOptions, strict: true }));\\n proposal.validate(_proposalExpiryDuration);\\n\\n bytes32 proposalHash = proposal.hash();\\n uint256 round_ = _createVotingRound(0);\\n _saveVotingRound(vote[0][round_], proposalHash, globalProposal.expiryTimestamp);\\n\\n if (round_ != proposal.nonce) revert ErrInvalidProposalNonce(msg.sig);\\n emit GlobalProposalCreated(round_, proposalHash, proposal, globalProposal.hash(), globalProposal, creator);\\n }\\n\\n /**\\n * @dev Returns corresponding address of target options. Return address(0) on non-existent target.\\n */\\n function resolveTargets(GlobalProposal.TargetOption[] calldata targetOptions) external view returns (address[] memory targets) {\\n return _resolveTargets({ targetOptions: targetOptions, strict: false });\\n }\\n\\n /**\\n * @dev Internal helper of {resolveTargets}.\\n *\\n * @param strict When the param is set to `true`, revert on non-existent target.\\n */\\n function _resolveTargets(GlobalProposal.TargetOption[] memory targetOptions, bool strict) internal view returns (address[] memory targets) {\\n targets = new address[](targetOptions.length);\\n\\n for (uint256 i; i < targetOptions.length; ++i) {\\n targets[i] = _targetOptionsMap[targetOptions[i]];\\n if (strict && targets[i] == address(0)) revert ErrInvalidArguments(msg.sig);\\n }\\n }\\n\\n /**\\n * @dev Updates list of `targetOptions` to `targets`.\\n *\\n * Requirement:\\n * - Only allow self-call through proposal.\\n *\\n */\\n function updateManyTargetOption(GlobalProposal.TargetOption[] memory targetOptions, address[] memory targets) external {\\n // HACK: Cannot reuse the existing library due to too deep stack\\n if (msg.sender != address(this)) revert ErrOnlySelfCall(msg.sig);\\n _updateManyTargetOption(targetOptions, targets);\\n }\\n\\n /**\\n * @dev Updates list of `targetOptions` to `targets`.\\n */\\n function _updateManyTargetOption(GlobalProposal.TargetOption[] memory targetOptions, address[] memory targets) internal {\\n for (uint256 i; i < targetOptions.length; ++i) {\\n if (targets[i] == address(this)) revert ErrInvalidArguments(msg.sig);\\n _updateTargetOption(targetOptions[i], targets[i]);\\n }\\n }\\n\\n /**\\n * @dev Updates `targetOption` to `target`.\\n *\\n * Requirement:\\n * - Emit a `TargetOptionUpdated` event.\\n */\\n function _updateTargetOption(GlobalProposal.TargetOption targetOption, address target) internal {\\n _targetOptionsMap[targetOption] = target;\\n emit TargetOptionUpdated(targetOption, target);\\n }\\n}\\n\",\"keccak256\":\"0xe5db4e1b31d9ff83e8962d17a815d39e72f5945023e6309172d875b47d5a1c3d\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/governance-relay/CommonGovernanceRelay.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../CoreGovernance.sol\\\";\\n\\nabstract contract CommonGovernanceRelay is CoreGovernance {\\n using Proposal for Proposal.ProposalDetail;\\n using GlobalProposal for GlobalProposal.GlobalProposalDetail;\\n\\n /**\\n * @dev Relays votes by signatures.\\n *\\n * @notice Does not store the voter signature into storage.\\n *\\n */\\n function _relayVotesBySignatures(\\n Proposal.ProposalDetail memory _proposal,\\n Ballot.VoteType[] calldata _supports,\\n Signature[] calldata _signatures,\\n bytes32 proposalHash\\n ) internal {\\n if (!(_supports.length > 0 && _supports.length == _signatures.length)) revert ErrLengthMismatch(msg.sig);\\n\\n bytes32 _forDigest = ECDSA.toTypedDataHash(_proposalDomainSeparator(), Ballot.hash(proposalHash, Ballot.VoteType.For));\\n bytes32 _againstDigest = ECDSA.toTypedDataHash(_proposalDomainSeparator(), Ballot.hash(proposalHash, Ballot.VoteType.Against));\\n\\n address[] memory _forVoteSigners = new address[](_signatures.length);\\n address[] memory _againstVoteSigners = new address[](_signatures.length);\\n\\n {\\n uint256 _forVoteCount;\\n uint256 _againstVoteCount;\\n\\n {\\n address _signer;\\n address _lastSigner;\\n Ballot.VoteType _support;\\n Signature calldata _sig;\\n\\n for (uint256 _i; _i < _signatures.length;) {\\n _sig = _signatures[_i];\\n _support = _supports[_i];\\n\\n if (_support == Ballot.VoteType.For) {\\n _signer = ECDSA.recover(_forDigest, _sig.v, _sig.r, _sig.s);\\n _forVoteSigners[_forVoteCount++] = _signer;\\n } else if (_support == Ballot.VoteType.Against) {\\n _signer = ECDSA.recover(_againstDigest, _sig.v, _sig.r, _sig.s);\\n _againstVoteSigners[_againstVoteCount++] = _signer;\\n } else {\\n revert ErrUnsupportedVoteType(msg.sig);\\n }\\n\\n if (_lastSigner >= _signer) revert ErrInvalidOrder(msg.sig);\\n _lastSigner = _signer;\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n }\\n\\n assembly {\\n mstore(_forVoteSigners, _forVoteCount)\\n mstore(_againstVoteSigners, _againstVoteCount)\\n }\\n }\\n\\n ProposalVote storage _vote = vote[_proposal.chainId][_proposal.nonce];\\n uint256 _minimumForVoteWeight = _getMinimumVoteWeight();\\n uint256 _totalForVoteWeight = _sumWeight(_forVoteSigners);\\n if (_totalForVoteWeight >= _minimumForVoteWeight) {\\n if (_totalForVoteWeight == 0) revert ErrInvalidVoteWeight(msg.sig);\\n _vote.status = VoteStatus.Approved;\\n emit ProposalApproved(_vote.hash);\\n _tryExecute(_vote, _proposal);\\n return;\\n }\\n\\n uint256 _minimumAgainstVoteWeight = _getTotalWeight() - _minimumForVoteWeight + 1;\\n uint256 _totalAgainstVoteWeight = _sumWeight(_againstVoteSigners);\\n if (_totalAgainstVoteWeight >= _minimumAgainstVoteWeight) {\\n if (_totalAgainstVoteWeight == 0) revert ErrInvalidVoteWeight(msg.sig);\\n _vote.status = VoteStatus.Rejected;\\n emit ProposalRejected(_vote.hash);\\n return;\\n }\\n\\n revert ErrRelayFailed(msg.sig);\\n }\\n\\n /**\\n * @dev Returns the weight of the governor list.\\n */\\n function _sumWeight(address[] memory _governors) internal view virtual returns (uint256);\\n\\n function _proposalDomainSeparator() internal view virtual returns (bytes32);\\n}\\n\",\"keccak256\":\"0x48b03ea86a3e312de4242115554d2188891719bcd3a20d8e4504b03319ba6993\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/governance-relay/GlobalGovernanceRelay.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../GlobalCoreGovernance.sol\\\";\\nimport \\\"./CommonGovernanceRelay.sol\\\";\\n\\nabstract contract GlobalGovernanceRelay is CommonGovernanceRelay, GlobalCoreGovernance {\\n using GlobalProposal for GlobalProposal.GlobalProposalDetail;\\n\\n /**\\n * @dev Returns whether the voter `_voter` casted vote for the proposal.\\n */\\n function globalProposalRelayed(uint256 _round) external view returns (bool) {\\n return vote[0][_round].status != VoteStatus.Pending;\\n }\\n\\n /**\\n * @dev Relays voted global proposal.\\n *\\n * Requirements:\\n * - The relay proposal is finalized.\\n *\\n */\\n function _relayGlobalProposal(\\n GlobalProposal.GlobalProposalDetail calldata globalProposal,\\n Ballot.VoteType[] calldata supports_,\\n Signature[] calldata signatures,\\n address creator\\n ) internal {\\n Proposal.ProposalDetail memory _proposal = _proposeGlobalStruct(globalProposal, creator);\\n _relayVotesBySignatures(_proposal, supports_, signatures, globalProposal.hash());\\n }\\n}\\n\",\"keccak256\":\"0x1d168ae3300e07f3b6312c61ea3d6021a12722c7122d9f2f3f782909d47e05d4\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/governance-relay/GovernanceRelay.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../CoreGovernance.sol\\\";\\nimport \\\"./CommonGovernanceRelay.sol\\\";\\n\\nabstract contract GovernanceRelay is CoreGovernance, CommonGovernanceRelay {\\n using Proposal for Proposal.ProposalDetail;\\n using GlobalProposal for GlobalProposal.GlobalProposalDetail;\\n\\n /**\\n * @dev Relays voted proposal.\\n *\\n * Requirements:\\n * - The relay proposal is finalized.\\n *\\n */\\n function _relayProposal(\\n Proposal.ProposalDetail calldata _proposal,\\n Ballot.VoteType[] calldata _supports,\\n Signature[] calldata _signatures,\\n address _creator\\n ) internal {\\n _proposeProposalStruct(_proposal, _creator);\\n _relayVotesBySignatures(_proposal, _supports, _signatures, _proposal.hash());\\n }\\n}\\n\",\"keccak256\":\"0x050da96d4079cfb515a09ee8a61d5b6c782adf4559b2c66b618bd51f41ca1cd4\",\"license\":\"MIT\"},\"src/interfaces/IQuorum.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IQuorum {\\n /// @dev Emitted when the threshold is updated\\n event ThresholdUpdated(uint256 indexed nonce, uint256 indexed numerator, uint256 indexed denominator, uint256 previousNumerator, uint256 previousDenominator);\\n\\n /**\\n * @dev Returns the threshold.\\n */\\n function getThreshold() external view returns (uint256 _num, uint256 _denom);\\n\\n /**\\n * @dev Checks whether the `_voteWeight` passes the threshold.\\n */\\n function checkThreshold(uint256 _voteWeight) external view returns (bool);\\n\\n /**\\n * @dev Returns the minimum vote weight to pass the threshold.\\n */\\n function minimumVoteWeight() external view returns (uint256);\\n\\n /**\\n * @dev Sets the threshold.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `ThresholdUpdated` event.\\n *\\n */\\n function setThreshold(uint256 numerator, uint256 denominator) external;\\n}\\n\",\"keccak256\":\"0xc924e9480f59acc9bc8c033f05d3be9451de5cee0c224d76d4542fa5b67fa10f\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IBridgeManagerEvents } from \\\"./events/IBridgeManagerEvents.sol\\\";\\n\\n/**\\n * @title IBridgeManager\\n * @dev The interface for managing bridge operators.\\n */\\ninterface IBridgeManager is IBridgeManagerEvents {\\n /// @notice Error indicating that cannot find the querying operator\\n error ErrOperatorNotFound(address operator);\\n /// @notice Error indicating that cannot find the querying governor\\n error ErrGovernorNotFound(address governor);\\n /// @notice Error indicating that the msg.sender is not match the required governor\\n error ErrGovernorNotMatch(address required, address sender);\\n /// @notice Error indicating that the governors list will go below minimum number of required governor.\\n error ErrBelowMinRequiredGovernors();\\n /// @notice Common invalid input error\\n error ErrInvalidInput();\\n\\n /**\\n * @dev The domain separator used for computing hash digests in the contract.\\n */\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n\\n /**\\n * @dev Returns the total number of bridge operators.\\n * @return The total number of bridge operators.\\n */\\n function totalBridgeOperator() external view returns (uint256);\\n\\n /**\\n * @dev Checks if the given address is a bridge operator.\\n * @param addr The address to check.\\n * @return A boolean indicating whether the address is a bridge operator.\\n */\\n function isBridgeOperator(address addr) external view returns (bool);\\n\\n /**\\n * @dev Retrieves the full information of all registered bridge operators.\\n *\\n * This external function allows external callers to obtain the full information of all the registered bridge operators.\\n * The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.\\n *\\n * @return governors An array of addresses representing the governors of each bridge operator.\\n * @return bridgeOperators An array of addresses representing the registered bridge operators.\\n * @return weights An array of uint256 values representing the vote weights of each bridge operator.\\n *\\n * Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator.\\n *\\n * Example Usage:\\n * ```\\n * (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos();\\n * for (uint256 i = 0; i < bridgeOperators.length; i++) {\\n * // Access individual information for each bridge operator.\\n * address governor = governors[i];\\n * address bridgeOperator = bridgeOperators[i];\\n * uint256 weight = weights[i];\\n * // ... (Process or use the information as required) ...\\n * }\\n * ```\\n *\\n */\\n function getFullBridgeOperatorInfos() external view returns (address[] memory governors, address[] memory bridgeOperators, uint96[] memory weights);\\n\\n /**\\n * @dev Returns total weights of the governor list.\\n */\\n function sumGovernorsWeight(address[] calldata governors) external view returns (uint256 sum);\\n\\n /**\\n * @dev Returns total weights.\\n */\\n function getTotalWeight() external view returns (uint256);\\n\\n /**\\n * @dev Returns an array of all bridge operators.\\n * @return An array containing the addresses of all bridge operators.\\n */\\n function getBridgeOperators() external view returns (address[] memory);\\n\\n /**\\n * @dev Returns the corresponding `operator` of a `governor`.\\n */\\n function getOperatorOf(address governor) external view returns (address operator);\\n\\n /**\\n * @dev Returns the corresponding `governor` of a `operator`.\\n */\\n function getGovernorOf(address operator) external view returns (address governor);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific governor.\\n * @param governor The address of the governor to get the vote weight for.\\n * @return voteWeight The vote weight of the specified governor.\\n */\\n function getGovernorWeight(address governor) external view returns (uint96);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific bridge operator.\\n * @param bridgeOperator The address of the bridge operator to get the vote weight for.\\n * @return weight The vote weight of the specified bridge operator.\\n */\\n function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint96 weight);\\n\\n /**\\n * @dev Returns the weights of a list of governor addresses.\\n */\\n function getGovernorWeights(address[] calldata governors) external view returns (uint96[] memory weights);\\n\\n /**\\n * @dev Returns an array of all governors.\\n * @return An array containing the addresses of all governors.\\n */\\n function getGovernors() external view returns (address[] memory);\\n\\n /**\\n * @dev Adds multiple bridge operators.\\n * @param governors An array of addresses of hot/cold wallets for bridge operator to update their node address.\\n * @param bridgeOperators An array of addresses representing the bridge operators to add.\\n */\\n function addBridgeOperators(uint96[] calldata voteWeights, address[] calldata governors, address[] calldata bridgeOperators) external;\\n\\n /**\\n * @dev Removes multiple bridge operators.\\n * @param bridgeOperators An array of addresses representing the bridge operators to remove.\\n */\\n function removeBridgeOperators(address[] calldata bridgeOperators) external;\\n\\n /**\\n * @dev Self-call to update the minimum required governor.\\n * @param min The minimum number, this must not less than 3.\\n */\\n function setMinRequiredGovernor(uint min) external;\\n}\\n\",\"keccak256\":\"0xefc46318a240371031e77ef3c355e2c18432e4479145378de6782277f9b44923\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManagerCallback.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @title IBridgeManagerCallback\\n * @dev Interface for the callback functions to be implemented by the Bridge Manager contract.\\n */\\ninterface IBridgeManagerCallback is IERC165 {\\n /**\\n * @dev Handles the event when bridge operators are added.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @param addeds The corresponding boolean values indicating whether the operators were added or not.\\n * @return selector The selector of the function being called.\\n */\\n function onBridgeOperatorsAdded(address[] memory bridgeOperators, uint96[] calldata weights, bool[] memory addeds) external returns (bytes4 selector);\\n\\n /**\\n * @dev Handles the event when bridge operators are removed.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @param removeds The corresponding boolean values indicating whether the operators were removed or not.\\n * @return selector The selector of the function being called.\\n */\\n function onBridgeOperatorsRemoved(address[] memory bridgeOperators, bool[] memory removeds) external returns (bytes4 selector);\\n}\\n\",\"keccak256\":\"0x6c8ce7e2478e28c5ed5e6f5d8305a77d6d5f9125a47adfb77632940b9a0f3625\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManagerCallbackRegister.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeManagerCallbackRegister {\\n error ErrExistOneInternalCallFailed(address sender, bytes4 msgSig, bytes callData);\\n\\n event CallbackRegistered(address, bool);\\n /**\\n * @dev Emitted when the contract notifies multiple registers with statuses and return data.\\n */\\n event Notified(bytes callData, address[] registers, bool[] statuses, bytes[] returnDatas);\\n\\n /**\\n * @dev Retrieves the addresses of registered callbacks.\\n * @return registers An array containing the addresses of registered callbacks.\\n */\\n function getCallbackRegisters() external view returns (address[] memory registers);\\n\\n /**\\n * @dev Registers multiple callbacks with the bridge.\\n * @param registers The array of callback addresses to register.\\n */\\n function registerCallbacks(address[] calldata registers) external;\\n\\n /**\\n * @dev Unregisters multiple callbacks from the bridge.\\n * @param registers The array of callback addresses to unregister.\\n */\\n function unregisterCallbacks(address[] calldata registers) external;\\n}\\n\",\"keccak256\":\"0x493f7a40fc058eb6654a636316be99c2ddd9ee26ee215ff86c7107a7fa20ff97\",\"license\":\"MIT\"},\"src/interfaces/bridge/events/IBridgeManagerEvents.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeManagerEvents {\\n /**\\n * @dev Emitted when new bridge operators are added.\\n */\\n event BridgeOperatorsAdded(bool[] statuses, uint96[] voteWeights, address[] governors, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is failed to add.\\n */\\n event BridgeOperatorAddingFailed(address indexed operator);\\n\\n /**\\n * @dev Emitted when bridge operators are removed.\\n */\\n event BridgeOperatorsRemoved(bool[] statuses, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is failed to remove.\\n */\\n event BridgeOperatorRemovingFailed(address indexed operator);\\n\\n /**\\n * @dev Emitted when a bridge operator is updated.\\n */\\n event BridgeOperatorUpdated(address indexed governor, address indexed fromBridgeOperator, address indexed toBridgeOperator);\\n\\n /**\\n * @dev Emitted when the minimum number of required governors is updated.\\n */\\n event MinRequiredGovernorUpdated(uint min);\\n}\\n\",\"keccak256\":\"0x38bc3709c98a7c08fb9b6fa3e07a725903dcb0bd07de8a828bac6c3bcf7d997d\",\"license\":\"MIT\"},\"src/interfaces/collections/IHasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport { ContractType } from \\\"../../utils/ContractType.sol\\\";\\n\\ninterface IHasContracts {\\n /// @dev Error of invalid role.\\n error ErrContractTypeNotFound(ContractType contractType);\\n\\n /// @dev Emitted when a contract is updated.\\n event ContractUpdated(ContractType indexed contractType, address indexed addr);\\n\\n /**\\n * @dev Returns the address of a contract with a specific role.\\n * Throws an error if no contract is set for the specified role.\\n *\\n * @param contractType The role of the contract to retrieve.\\n * @return contract_ The address of the contract with the specified role.\\n */\\n function getContract(ContractType contractType) external view returns (address contract_);\\n\\n /**\\n * @dev Sets the address of a contract with a specific role.\\n * Emits the event {ContractUpdated}.\\n * @param contractType The role of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function setContract(ContractType contractType, address addr) external;\\n}\\n\",\"keccak256\":\"0x99d8213d857e30d367155abd15dc42730afdfbbac3a22dfb3b95ffea2083a92e\",\"license\":\"MIT\"},\"src/interfaces/consumers/ChainTypeConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface ChainTypeConsumer {\\n enum ChainType {\\n RoninChain,\\n Mainchain\\n }\\n}\\n\",\"keccak256\":\"0xe0d20e00c8d237f8e0fb881abf1ff1ef114173bcb428f06f689c581666a22db7\",\"license\":\"MIT\"},\"src/interfaces/consumers/SignatureConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface SignatureConsumer {\\n struct Signature {\\n uint8 v;\\n bytes32 r;\\n bytes32 s;\\n }\\n}\\n\",\"keccak256\":\"0xd370e350722067097dec1a5c31bda6e47e83417fa5c3288293bb910028cd136b\",\"license\":\"MIT\"},\"src/interfaces/consumers/VoteStatusConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface VoteStatusConsumer {\\n enum VoteStatus {\\n Pending,\\n Approved,\\n Executed,\\n Rejected,\\n Expired\\n }\\n}\\n\",\"keccak256\":\"0xa5045232c0c053fcf31fb3fe71942344444159c48d5f1b2063dbb06b6a1c9752\",\"license\":\"MIT\"},\"src/libraries/AddressArrayUtils.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\nlibrary AddressArrayUtils {\\n /**\\n * @dev Error thrown when a duplicated element is detected in an array.\\n * @param msgSig The function signature that invoke the error.\\n */\\n error ErrDuplicated(bytes4 msgSig);\\n\\n /**\\n * @dev Returns whether or not there's a duplicate. Runs in O(n^2).\\n * @param A Array to search\\n * @return Returns true if duplicate, false otherwise\\n */\\n function hasDuplicate(address[] memory A) internal pure returns (bool) {\\n if (A.length == 0) {\\n return false;\\n }\\n unchecked {\\n for (uint256 i = 0; i < A.length - 1; i++) {\\n for (uint256 j = i + 1; j < A.length; j++) {\\n if (A[i] == A[j]) {\\n return true;\\n }\\n }\\n }\\n }\\n return false;\\n }\\n\\n /**\\n * @dev Returns whether two arrays of addresses are equal or not.\\n */\\n function isEqual(address[] memory _this, address[] memory _other) internal pure returns (bool yes_) {\\n // Hashing two arrays and compare their hash\\n assembly {\\n let _thisHash := keccak256(add(_this, 32), mul(mload(_this), 32))\\n let _otherHash := keccak256(add(_other, 32), mul(mload(_other), 32))\\n yes_ := eq(_thisHash, _otherHash)\\n }\\n }\\n\\n /**\\n * @dev Return the concatenated array from a and b.\\n */\\n function extend(address[] memory a, address[] memory b) internal pure returns (address[] memory c) {\\n uint256 lengthA = a.length;\\n uint256 lengthB = b.length;\\n unchecked {\\n c = new address[](lengthA + lengthB);\\n }\\n uint256 i;\\n for (; i < lengthA;) {\\n c[i] = a[i];\\n unchecked {\\n ++i;\\n }\\n }\\n for (uint256 j; j < lengthB;) {\\n c[i] = b[j];\\n unchecked {\\n ++i;\\n ++j;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce5d578861167da47a965c8a0e1592b808aad6eb79ccb1873bf2e2280ddb85ee\",\"license\":\"UNLICENSED\"},\"src/libraries/Ballot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\n\\nlibrary Ballot {\\n using ECDSA for bytes32;\\n\\n enum VoteType {\\n For,\\n Against\\n }\\n\\n // keccak256(\\\"Ballot(bytes32 proposalHash,uint8 support)\\\");\\n bytes32 private constant BALLOT_TYPEHASH = 0xd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2;\\n\\n function hash(bytes32 _proposalHash, VoteType _support) internal pure returns (bytes32 digest) {\\n // return keccak256(abi.encode(BALLOT_TYPEHASH, _proposalHash, _support));\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, BALLOT_TYPEHASH)\\n mstore(add(ptr, 0x20), _proposalHash)\\n mstore(add(ptr, 0x40), _support)\\n digest := keccak256(ptr, 0x60)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xaa1e66bcd86baa6f18c7c5e9b67496535f229cbd2e2ecb4c66bcbfed2b1365de\",\"license\":\"MIT\"},\"src/libraries/GlobalProposal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./Proposal.sol\\\";\\n\\nlibrary GlobalProposal {\\n /**\\n * @dev Error thrown when attempting to interact with an unsupported target.\\n */\\n error ErrUnsupportedTarget(bytes32 proposalHash, uint256 targetNumber);\\n\\n enum TargetOption {\\n BridgeManager, // 0\\n GatewayContract, // 1\\n BridgeReward, // 2\\n BridgeSlash, // 3\\n BridgeTracking, // 4\\n PauseEnforcer // 5\\n\\n }\\n\\n struct GlobalProposalDetail {\\n // Nonce to make sure proposals are executed in order\\n uint256 nonce;\\n uint256 expiryTimestamp;\\n address executor;\\n TargetOption[] targetOptions;\\n uint256[] values;\\n bytes[] calldatas;\\n uint256[] gasAmounts;\\n }\\n\\n // keccak256(\\\"GlobalProposalDetail(uint256 nonce,uint256 expiryTimestamp,address executor,uint8[] targetOptions,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)\\\");\\n bytes32 internal constant TYPE_HASH = 0xde480f0c53a3651c08fbab1dffbc45fe574f31188827fe52cb9035da9fe57e4a;\\n\\n /**\\n * @dev Returns struct hash of the proposal.\\n */\\n function hash(GlobalProposalDetail memory self) internal pure returns (bytes32 digest_) {\\n uint256[] memory values = self.values;\\n TargetOption[] memory targets = self.targetOptions;\\n bytes32[] memory calldataHashList = new bytes32[](self.calldatas.length);\\n uint256[] memory gasAmounts = self.gasAmounts;\\n\\n for (uint256 i; i < calldataHashList.length;) {\\n calldataHashList[i] = keccak256(self.calldatas[i]);\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n /*\\n * return\\n * keccak256(\\n * abi.encode(\\n * TYPE_HASH,\\n * proposal.nonce,\\n * proposal.expiryTimestamp,\\n * proposal.executor,\\n * targetsHash,\\n * valuesHash,\\n * calldatasHash,\\n * gasAmountsHash\\n * )\\n * );\\n */\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, TYPE_HASH)\\n mstore(add(ptr, 0x20), mload(self)) // proposal.nonce\\n mstore(add(ptr, 0x40), mload(add(self, 0x20))) // proposal.expiryTimestamp\\n mstore(add(ptr, 0x60), mload(add(self, 0x40))) // proposal.executor\\n\\n let arrayHashed\\n arrayHashed := keccak256(add(targets, 32), mul(mload(targets), 32)) // targetsHash\\n mstore(add(ptr, 0x80), arrayHashed)\\n arrayHashed := keccak256(add(values, 32), mul(mload(values), 32)) // valuesHash\\n mstore(add(ptr, 0xa0), arrayHashed)\\n arrayHashed := keccak256(add(calldataHashList, 32), mul(mload(calldataHashList), 32)) // calldatasHash\\n mstore(add(ptr, 0xc0), arrayHashed)\\n arrayHashed := keccak256(add(gasAmounts, 32), mul(mload(gasAmounts), 32)) // gasAmountsHash\\n mstore(add(ptr, 0xe0), arrayHashed)\\n digest_ := keccak256(ptr, 0x100)\\n }\\n }\\n\\n /**\\n * @dev Converts into the normal proposal.\\n */\\n function intoProposalDetail(GlobalProposalDetail memory self, address[] memory targets) internal pure returns (Proposal.ProposalDetail memory detail_) {\\n detail_.nonce = self.nonce;\\n detail_.chainId = 0;\\n detail_.expiryTimestamp = self.expiryTimestamp;\\n detail_.executor = self.executor;\\n\\n detail_.targets = new address[](self.targetOptions.length);\\n detail_.values = self.values;\\n detail_.calldatas = self.calldatas;\\n detail_.gasAmounts = self.gasAmounts;\\n\\n for (uint256 i; i < self.targetOptions.length; ++i) {\\n detail_.targets[i] = targets[i];\\n }\\n }\\n}\\n\",\"keccak256\":\"0x76d362e1a4c8ef6d1aac45aae0f443a218cb256176ad5fbe952b2ff7c2132e6e\",\"license\":\"MIT\"},\"src/libraries/Proposal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ErrInvalidChainId, ErrLengthMismatch } from \\\"../utils/CommonErrors.sol\\\";\\n\\nlibrary Proposal {\\n /**\\n * @dev Error thrown when there is insufficient gas to execute a function.\\n */\\n error ErrInsufficientGas(bytes32 proposalHash);\\n\\n /**\\n * @dev Error thrown when an invalid expiry timestamp is provided.\\n */\\n error ErrInvalidExpiryTimestamp();\\n\\n /**\\n * @dev Error thrown when the proposal reverts when execute the internal call no. `callIndex` with revert message is `revertMsg`.\\n */\\n error ErrLooseProposalInternallyRevert(uint256 callIndex, bytes revertMsg);\\n\\n struct ProposalDetail {\\n // Nonce to make sure proposals are executed in order\\n uint256 nonce;\\n // Value 0: all chain should run this proposal\\n // Other values: only specific chain has to execute\\n uint256 chainId;\\n uint256 expiryTimestamp;\\n // The address that execute the proposal after the proposal passes.\\n // Leave this address as address(0) to auto-execute by the last valid vote.\\n address executor;\\n address[] targets;\\n uint256[] values;\\n bytes[] calldatas;\\n uint256[] gasAmounts;\\n }\\n\\n // keccak256(\\\"ProposalDetail(uint256 nonce,uint256 chainId,uint256 expiryTimestamp,address executor,address[] targets,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)\\\");\\n bytes32 internal constant TYPE_HASH = 0x1b59eeec7c321899dc1e7a5b3d876c9a445dffc6d2f96ba842d7489908fdee12;\\n\\n /**\\n * @dev Validates the proposal.\\n */\\n function validate(ProposalDetail memory proposal, uint256 maxExpiryDuration) internal view {\\n if (\\n !(\\n proposal.targets.length > 0 && proposal.targets.length == proposal.values.length && proposal.targets.length == proposal.calldatas.length\\n && proposal.targets.length == proposal.gasAmounts.length\\n )\\n ) {\\n revert ErrLengthMismatch(msg.sig);\\n }\\n\\n if (proposal.expiryTimestamp > block.timestamp + maxExpiryDuration) {\\n revert ErrInvalidExpiryTimestamp();\\n }\\n }\\n\\n /**\\n * @dev Returns struct hash of the proposal.\\n */\\n function hash(ProposalDetail memory proposal) internal pure returns (bytes32 digest_) {\\n uint256[] memory values = proposal.values;\\n address[] memory targets = proposal.targets;\\n bytes32[] memory calldataHashList = new bytes32[](proposal.calldatas.length);\\n uint256[] memory gasAmounts = proposal.gasAmounts;\\n\\n for (uint256 i; i < calldataHashList.length; ++i) {\\n calldataHashList[i] = keccak256(proposal.calldatas[i]);\\n }\\n\\n // return\\n // keccak256(\\n // abi.encode(\\n // TYPE_HASH,\\n // proposal.nonce,\\n // proposal.chainId,\\n // proposal.expiryTimestamp\\n // proposal.executor\\n // targetsHash,\\n // valuesHash,\\n // calldatasHash,\\n // gasAmountsHash\\n // )\\n // );\\n // /\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, TYPE_HASH)\\n mstore(add(ptr, 0x20), mload(proposal)) // proposal.nonce\\n mstore(add(ptr, 0x40), mload(add(proposal, 0x20))) // proposal.chainId\\n mstore(add(ptr, 0x60), mload(add(proposal, 0x40))) // proposal.expiryTimestamp\\n mstore(add(ptr, 0x80), mload(add(proposal, 0x60))) // proposal.executor\\n\\n let arrayHashed\\n arrayHashed := keccak256(add(targets, 32), mul(mload(targets), 32)) // targetsHash\\n mstore(add(ptr, 0xa0), arrayHashed)\\n arrayHashed := keccak256(add(values, 32), mul(mload(values), 32)) // valuesHash\\n mstore(add(ptr, 0xc0), arrayHashed)\\n arrayHashed := keccak256(add(calldataHashList, 32), mul(mload(calldataHashList), 32)) // calldatasHash\\n mstore(add(ptr, 0xe0), arrayHashed)\\n arrayHashed := keccak256(add(gasAmounts, 32), mul(mload(gasAmounts), 32)) // gasAmountsHash\\n mstore(add(ptr, 0x100), arrayHashed)\\n digest_ := keccak256(ptr, 0x120)\\n }\\n }\\n\\n /**\\n * @dev Returns whether the proposal is auto-executed on the last valid vote.\\n */\\n function isAutoExecute(ProposalDetail memory proposal) internal pure returns (bool) {\\n return proposal.executor == address(0);\\n }\\n\\n /**\\n * @dev Returns whether the proposal is executable for the current chain.\\n *\\n * @notice Does not check whether the call result is successful or not. Please use `execute` instead.\\n *\\n */\\n function executable(ProposalDetail memory proposal) internal view returns (bool result) {\\n return proposal.chainId == 0 || proposal.chainId == block.chainid;\\n }\\n\\n /**\\n * @dev Executes the proposal.\\n */\\n function execute(ProposalDetail memory proposal) internal returns (bool[] memory successCalls, bytes[] memory returnDatas) {\\n if (!executable(proposal)) revert ErrInvalidChainId(msg.sig, proposal.chainId, block.chainid);\\n\\n successCalls = new bool[](proposal.targets.length);\\n returnDatas = new bytes[](proposal.targets.length);\\n for (uint256 i = 0; i < proposal.targets.length; ++i) {\\n if (gasleft() <= proposal.gasAmounts[i]) revert ErrInsufficientGas(hash(proposal));\\n\\n (successCalls[i], returnDatas[i]) = proposal.targets[i].call{ value: proposal.values[i], gas: proposal.gasAmounts[i] }(proposal.calldatas[i]);\\n\\n if (!successCalls[i]) {\\n revert ErrLooseProposalInternallyRevert(i, returnDatas[i]);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0ef21852c8a90ebf3ec4d4cc11acd9b6aa1fd932fb6858b2f6cdd3722fab6cb1\",\"license\":\"MIT\"},\"src/mainchain/MainchainBridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { CoreGovernance } from \\\"../extensions/sequential-governance/CoreGovernance.sol\\\";\\nimport { GlobalCoreGovernance, GlobalGovernanceRelay } from \\\"../extensions/sequential-governance/governance-relay/GlobalGovernanceRelay.sol\\\";\\nimport { GovernanceRelay } from \\\"../extensions/sequential-governance/governance-relay/GovernanceRelay.sol\\\";\\nimport { ContractType, BridgeManager } from \\\"../extensions/bridge-operator-governance/BridgeManager.sol\\\";\\nimport { Ballot } from \\\"../libraries/Ballot.sol\\\";\\nimport { Proposal } from \\\"../libraries/Proposal.sol\\\";\\nimport { GlobalProposal } from \\\"../libraries/GlobalProposal.sol\\\";\\nimport \\\"../utils/CommonErrors.sol\\\";\\n\\ncontract MainchainBridgeManager is BridgeManager, GovernanceRelay, GlobalGovernanceRelay {\\n uint256 private constant DEFAULT_EXPIRY_DURATION = 1 << 255;\\n\\n function initialize(\\n uint256 num,\\n uint256 denom,\\n uint256 roninChainId,\\n address bridgeContract,\\n address[] memory callbackRegisters,\\n address[] memory bridgeOperators,\\n address[] memory governors,\\n uint96[] memory voteWeights,\\n GlobalProposal.TargetOption[] memory targetOptions,\\n address[] memory targets\\n ) external initializer {\\n __CoreGovernance_init(DEFAULT_EXPIRY_DURATION);\\n __GlobalCoreGovernance_init(targetOptions, targets);\\n __BridgeManager_init(num, denom, roninChainId, bridgeContract, callbackRegisters, bridgeOperators, governors, voteWeights);\\n }\\n\\n /**\\n * @dev See `GovernanceRelay-_relayProposal`.\\n *\\n * Requirements:\\n * - The method caller is governor.\\n */\\n function relayProposal(\\n Proposal.ProposalDetail calldata proposal,\\n Ballot.VoteType[] calldata supports_,\\n Signature[] calldata signatures\\n ) external onlyGovernor {\\n _requireExecutor(proposal.executor, msg.sender);\\n _relayProposal(proposal, supports_, signatures, msg.sender);\\n }\\n\\n /**\\n * @dev See `GovernanceRelay-_relayGlobalProposal`.\\n *\\n * Requirements:\\n * - The method caller is governor.\\n */\\n function relayGlobalProposal(\\n GlobalProposal.GlobalProposalDetail calldata globalProposal,\\n Ballot.VoteType[] calldata supports_,\\n Signature[] calldata signatures\\n ) external onlyGovernor {\\n _requireExecutor(globalProposal.executor, msg.sender);\\n _relayGlobalProposal({ globalProposal: globalProposal, supports_: supports_, signatures: signatures, creator: msg.sender });\\n }\\n\\n function _requireExecutor(address executor, address caller) internal pure {\\n if (executor != address(0) && caller != executor) {\\n revert ErrNonExecutorCannotRelay(executor, caller);\\n }\\n }\\n\\n /**\\n * @dev Internal function to retrieve the minimum vote weight required for governance actions.\\n * @return minimumVoteWeight The minimum vote weight required for governance actions.\\n */\\n function _getMinimumVoteWeight() internal view override returns (uint256) {\\n return minimumVoteWeight();\\n }\\n\\n /**\\n * @dev Returns the expiry duration for a new proposal.\\n */\\n function getProposalExpiryDuration() external view returns (uint256) {\\n return _proposalExpiryDuration;\\n }\\n\\n /**\\n * @dev Internal function to retrieve the total weights of all governors.\\n * @return totalWeights The total weights of all governors combined.\\n */\\n function _getTotalWeight() internal view override returns (uint256) {\\n return getTotalWeight();\\n }\\n\\n /**\\n * @dev Internal function to calculate the sum of weights for a given array of governors.\\n * @param governors An array containing the addresses of governors to calculate the sum of weights.\\n * @return sumWeights The sum of weights for the provided governors.\\n */\\n function _sumWeight(address[] memory governors) internal view override returns (uint256) {\\n return _sumGovernorsWeight(governors);\\n }\\n\\n /**\\n * @dev Internal function to retrieve the chain type of the contract.\\n * @return chainType The chain type, indicating the type of the chain the contract operates on (e.g., Mainchain).\\n */\\n function _getChainType() internal pure override returns (ChainType) {\\n return ChainType.Mainchain;\\n }\\n\\n function _proposalDomainSeparator() internal view override returns (bytes32) {\\n return DOMAIN_SEPARATOR;\\n }\\n}\\n\",\"keccak256\":\"0xea177997b7100f310369b8fd530ea48ab823b06a53424c14f150cef723584c02\",\"license\":\"MIT\"},\"src/types/Types.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.17;\\n\\nimport { LibTUint256Slot } from \\\"./operations/LibTUint256Slot.sol\\\";\\n\\ntype TUint256Slot is bytes32;\\n\\nusing {\\n LibTUint256Slot.add,\\n LibTUint256Slot.sub,\\n LibTUint256Slot.mul,\\n LibTUint256Slot.div,\\n LibTUint256Slot.load,\\n LibTUint256Slot.store,\\n LibTUint256Slot.addAssign,\\n LibTUint256Slot.subAssign,\\n LibTUint256Slot.preDecrement,\\n LibTUint256Slot.postDecrement,\\n LibTUint256Slot.preIncrement,\\n LibTUint256Slot.postIncrement\\n} for TUint256Slot global;\\n\",\"keccak256\":\"0x20ab58f1c9ae4936f9dd9891d064301d78ef508c1dd2ce0c19a7b5b81d530e36\",\"license\":\"MIT\"},\"src/types/operations/LibTUint256Slot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.17;\\n\\nimport { TUint256Slot } from \\\"../Types.sol\\\";\\n\\n/**\\n * @title LibTUint256Slot\\n * @dev Library for handling unsigned 256-bit integers.\\n */\\nlibrary LibTUint256Slot {\\n /// @dev value is equal to bytes4(keccak256(\\\"Panic(uint256)\\\"))\\n /// @dev see: https://github.com/foundry-rs/forge-std/blob/master/src/StdError.sol\\n uint256 private constant PANIC_ERROR_SIGNATURE = 0x4e487b71;\\n /// @dev error code for {Arithmetic over/underflow} error\\n uint256 private constant ARITHMETIC_ERROR_CODE = 0x11;\\n /// @dev error code for {Division or modulo by 0} error\\n uint256 private constant DIVISION_ERROR_CODE = 0x12;\\n\\n /**\\n * @dev Loads the value of the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @return val The loaded value.\\n */\\n function load(TUint256Slot self) internal view returns (uint256 val) {\\n assembly {\\n val := sload(self)\\n }\\n }\\n\\n /**\\n * @dev Stores a value into the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @param other The value to be stored.\\n */\\n function store(TUint256Slot self, uint256 other) internal {\\n assembly {\\n sstore(self, other)\\n }\\n }\\n\\n /**\\n * @dev Multiplies the TUint256Slot variable by a given value.\\n * @param self The TUint256Slot variable.\\n * @param other The value to multiply by.\\n * @return res The resulting value after multiplication.\\n */\\n function mul(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n if iszero(iszero(storedVal)) {\\n res := mul(storedVal, other)\\n\\n // Overflow check\\n if iszero(eq(other, div(res, storedVal))) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, ARITHMETIC_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n }\\n }\\n }\\n\\n /**\\n * @dev Divides the TUint256Slot variable by a given value.\\n * @param self The TUint256Slot variable.\\n * @param other The value to divide by.\\n * @return res The resulting value after division.\\n */\\n function div(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n // revert if divide by zero\\n if iszero(other) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, DIVISION_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n res := div(storedVal, other)\\n }\\n }\\n\\n /**\\n * @dev Subtracts a given value from the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @param other The value to subtract.\\n * @return res The resulting value after subtraction.\\n */\\n function sub(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n\\n // Underflow check\\n if lt(storedVal, other) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, ARITHMETIC_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n\\n res := sub(storedVal, other)\\n }\\n }\\n\\n /**\\n * @dev Adds a given value to the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @param other The value to add.\\n * @return res The resulting value after addition.\\n */\\n function add(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n res := add(storedVal, other)\\n\\n // Overflow check\\n if lt(res, other) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, ARITHMETIC_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n }\\n }\\n\\n /**\\n * @dev Increments the TUint256Slot variable by 1 and returns the new value.\\n * @param self The TUint256Slot variable.\\n * @return res The resulting value after incrementing.\\n */\\n function preIncrement(TUint256Slot self) internal returns (uint256 res) {\\n res = addAssign(self, 1);\\n }\\n\\n /**\\n * @dev Increments the TUint256Slot variable by 1 and returns the original value.\\n * @param self The TUint256Slot variable.\\n * @return res The original value before incrementing.\\n */\\n function postIncrement(TUint256Slot self) internal returns (uint256 res) {\\n res = load(self);\\n store(self, res + 1);\\n }\\n\\n /**\\n * @dev Decrements the TUint256Slot variable by 1 and returns the new value.\\n * @param self The TUint256Slot variable.\\n * @return res The resulting value after decrementing.\\n */\\n function preDecrement(TUint256Slot self) internal returns (uint256 res) {\\n res = subAssign(self, 1);\\n }\\n\\n /**\\n * @dev Decrements the TUint256Slot variable by 1 and returns the new value.\\n * @param self The TUint256Slot variable.\\n * @return res The resulting value before decrementing.\\n */\\n function postDecrement(TUint256Slot self) internal returns (uint256 res) {\\n res = load(self);\\n store(self, res - 1);\\n }\\n\\n /**\\n * @dev Adds a given value to the TUint256Slot variable and stores the result.\\n * @param self The TUint256Slot variable.\\n * @param other The value to add.\\n * @return res The resulting value after addition and storage.\\n */\\n function addAssign(TUint256Slot self, uint256 other) internal returns (uint256 res) {\\n store(self, res = add(self, other));\\n }\\n\\n /**\\n * @dev Subtracts a given value from the TUint256Slot variable and stores the result.\\n * @param self The TUint256Slot variable.\\n * @param other The value to subtract.\\n * @return res The resulting value after subtraction and storage.\\n */\\n function subAssign(TUint256Slot self, uint256 other) internal returns (uint256 res) {\\n store(self, res = sub(self, other));\\n }\\n}\\n\",\"keccak256\":\"0xe10c089459baf373494d76b00e582d49f6e43c500ab0f1657d53afc2fa472cbb\",\"license\":\"MIT\"},\"src/utils/CommonErrors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ContractType } from \\\"./ContractType.sol\\\";\\nimport { RoleAccess } from \\\"./RoleAccess.sol\\\";\\n\\nerror ErrSyncTooFarPeriod(uint256 period, uint256 latestRewardedPeriod);\\n/**\\n * @dev Error thrown when an address is expected to be an already created externally owned account (EOA).\\n * This error indicates that the provided address is invalid for certain contract operations that require already created EOA.\\n */\\nerror ErrAddressIsNotCreatedEOA(address addr, bytes32 codehash);\\n/**\\n * @dev Error raised when a bridge operator update operation fails.\\n * @param bridgeOperator The address of the bridge operator that failed to update.\\n */\\nerror ErrBridgeOperatorUpdateFailed(address bridgeOperator);\\n/**\\n * @dev Error thrown when attempting to add a bridge operator that already exists in the contract.\\n * This error indicates that the provided bridge operator address is already registered as a bridge operator in the contract.\\n */\\nerror ErrBridgeOperatorAlreadyExisted(address bridgeOperator);\\n/**\\n * @dev The error indicating an unsupported interface.\\n * @param interfaceId The bytes4 interface identifier that is not supported.\\n * @param addr The address where the unsupported interface was encountered.\\n */\\nerror ErrUnsupportedInterface(bytes4 interfaceId, address addr);\\n/**\\n * @dev Error thrown when the return data from a callback function is invalid.\\n * @param callbackFnSig The signature of the callback function that returned invalid data.\\n * @param register The address of the register where the callback function was invoked.\\n * @param returnData The invalid return data received from the callback function.\\n */\\nerror ErrInvalidReturnData(bytes4 callbackFnSig, address register, bytes returnData);\\n/**\\n * @dev Error of set to non-contract.\\n */\\nerror ErrZeroCodeContract(address addr);\\n/**\\n * @dev Error indicating that arguments are invalid.\\n */\\nerror ErrInvalidArguments(bytes4 msgSig);\\n/**\\n * @dev Error indicating that given address is null when it should not.\\n */\\nerror ErrZeroAddress(bytes4 msgSig);\\n/**\\n * @dev Error indicating that the provided threshold is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that the invalid threshold applies to.\\n */\\nerror ErrInvalidThreshold(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a function can only be called by the contract itself.\\n * @param msgSig The function signature (bytes4) that can only be called by the contract itself.\\n */\\nerror ErrOnlySelfCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n * @param expectedRole The role required to perform the function.\\n */\\nerror ErrUnauthorized(bytes4 msgSig, RoleAccess expectedRole);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n */\\nerror ErrUnauthorizedCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4).\\n * @param expectedContractType The contract type required to perform the function.\\n * @param actual The actual address that called to the function.\\n */\\nerror ErrUnexpectedInternalCall(bytes4 msgSig, ContractType expectedContractType, address actual);\\n\\n/**\\n * @dev Error indicating that an array is empty when it should contain elements.\\n */\\nerror ErrEmptyArray();\\n\\n/**\\n * @dev Error indicating a mismatch in the length of input parameters or arrays for a specific function.\\n * @param msgSig The function signature (bytes4) that has a length mismatch.\\n */\\nerror ErrLengthMismatch(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a proxy call to an external contract has failed.\\n * @param msgSig The function signature (bytes4) of the proxy call that failed.\\n * @param extCallSig The function signature (bytes4) of the external contract call that failed.\\n */\\nerror ErrProxyCallFailed(bytes4 msgSig, bytes4 extCallSig);\\n\\n/**\\n * @dev Error indicating that a function tried to call a precompiled contract that is not allowed.\\n * @param msgSig The function signature (bytes4) that attempted to call a precompiled contract.\\n */\\nerror ErrCallPrecompiled(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a native token transfer has failed.\\n * @param msgSig The function signature (bytes4) of the token transfer that failed.\\n */\\nerror ErrNativeTransferFailed(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that an order is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid order.\\n */\\nerror ErrInvalidOrder(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the chain ID is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid chain ID.\\n * @param actual Current chain ID that executing function.\\n * @param expected Expected chain ID required for the tx to success.\\n */\\nerror ErrInvalidChainId(bytes4 msgSig, uint256 actual, uint256 expected);\\n\\n/**\\n * @dev Error indicating that a vote type is not supported.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an unsupported vote type.\\n */\\nerror ErrUnsupportedVoteType(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the proposal nonce is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid proposal nonce.\\n */\\nerror ErrInvalidProposalNonce(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a voter has already voted.\\n * @param voter The address of the voter who has already voted.\\n */\\nerror ErrAlreadyVoted(address voter);\\n\\n/**\\n * @dev Error indicating that a signature is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid signature.\\n */\\nerror ErrInvalidSignatures(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a relay call has failed.\\n * @param msgSig The function signature (bytes4) of the relay call that failed.\\n */\\nerror ErrRelayFailed(bytes4 msgSig);\\n/**\\n * @dev Error indicating that a vote weight is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid vote weight.\\n */\\nerror ErrInvalidVoteWeight(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a query was made for an outdated bridge operator set.\\n */\\nerror ErrQueryForOutdatedBridgeOperatorSet();\\n\\n/**\\n * @dev Error indicating that a request is invalid.\\n */\\nerror ErrInvalidRequest();\\n\\n/**\\n * @dev Error indicating that a token standard is invalid.\\n */\\nerror ErrInvalidTokenStandard();\\n\\n/**\\n * @dev Error indicating that a token is not supported.\\n */\\nerror ErrUnsupportedToken();\\n\\n/**\\n * @dev Error indicating that a receipt kind is invalid.\\n */\\nerror ErrInvalidReceiptKind();\\n\\n/**\\n * @dev Error indicating that a receipt is invalid.\\n */\\nerror ErrInvalidReceipt();\\n\\n/**\\n * @dev Error indicating that an address is not payable.\\n */\\nerror ErrNonpayableAddress(address);\\n\\n/**\\n * @dev Error indicating that the period is already processed, i.e. scattered reward.\\n */\\nerror ErrPeriodAlreadyProcessed(uint256 requestingPeriod, uint256 latestPeriod);\\n\\n/**\\n * @dev Error thrown when an invalid vote hash is provided.\\n */\\nerror ErrInvalidVoteHash();\\n\\n/**\\n * @dev Error thrown when querying for an empty vote.\\n */\\nerror ErrQueryForEmptyVote();\\n\\n/**\\n * @dev Error thrown when querying for an expired vote.\\n */\\nerror ErrQueryForExpiredVote();\\n\\n/**\\n * @dev Error thrown when querying for a non-existent vote.\\n */\\nerror ErrQueryForNonExistentVote();\\n\\n/**\\n * @dev Error indicating that the method is only called once per block.\\n */\\nerror ErrOncePerBlock();\\n\\n/**\\n * @dev Error of method caller must be coinbase\\n */\\nerror ErrCallerMustBeCoinbase();\\n\\n/**\\n * @dev Error thrown when an invalid proposal is encountered.\\n * @param actual The actual value of the proposal.\\n * @param expected The expected value of the proposal.\\n */\\nerror ErrInvalidProposal(bytes32 actual, bytes32 expected);\\n\\n/**\\n * @dev Error of proposal is not approved for executing.\\n */\\nerror ErrProposalNotApproved();\\n\\n/**\\n * @dev Error of the caller is not the specified executor.\\n */\\nerror ErrInvalidExecutor();\\n\\n/**\\n * @dev Error of the `caller` to relay is not the specified `executor`.\\n */\\nerror ErrNonExecutorCannotRelay(address executor, address caller);\\n\",\"keccak256\":\"0x0d9e2fd98f6b704273faad707ed9eadbd4c79551ee3f902bff5b29213a204679\",\"license\":\"MIT\"},\"src/utils/ContractType.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum ContractType {\\n UNKNOWN, // 0\\n PAUSE_ENFORCER, // 1\\n BRIDGE, // 2\\n BRIDGE_TRACKING, // 3\\n GOVERNANCE_ADMIN, // 4\\n MAINTENANCE, // 5\\n SLASH_INDICATOR, // 6\\n STAKING_VESTING, // 7\\n VALIDATOR, // 8\\n STAKING, // 9\\n RONIN_TRUSTED_ORGANIZATION, // 10\\n BRIDGE_MANAGER, // 11\\n BRIDGE_SLASH, // 12\\n BRIDGE_REWARD, // 13\\n FAST_FINALITY_TRACKING, // 14\\n PROFILE // 15\\n\\n}\\n\",\"keccak256\":\"0xec088aa939cd885dbe84e944942d7ea674e1fff8802c1f2ae5d8e84e4578357d\",\"license\":\"MIT\"},\"src/utils/IdentityGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { AddressArrayUtils } from \\\"../libraries/AddressArrayUtils.sol\\\";\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport { TransparentUpgradeableProxyV2 } from \\\"../extensions/TransparentUpgradeableProxyV2.sol\\\";\\nimport { ErrAddressIsNotCreatedEOA, ErrZeroAddress, ErrOnlySelfCall, ErrZeroCodeContract, ErrUnsupportedInterface } from \\\"./CommonErrors.sol\\\";\\n\\nabstract contract IdentityGuard {\\n using AddressArrayUtils for address[];\\n\\n /// @dev value is equal to keccak256(abi.encode())\\n /// @dev see: https://eips.ethereum.org/EIPS/eip-1052\\n bytes32 internal constant CREATED_ACCOUNT_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\\n\\n /**\\n * @dev Modifier to restrict functions to only be called by this contract.\\n * @dev Reverts if the caller is not this contract.\\n */\\n modifier onlySelfCall() virtual {\\n _requireSelfCall();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to ensure that the elements in the `arr` array are non-duplicates.\\n * It calls the internal `_checkDuplicate` function to perform the duplicate check.\\n *\\n * Requirements:\\n * - The elements in the `arr` array must not contain any duplicates.\\n */\\n modifier nonDuplicate(address[] memory arr) virtual {\\n _requireNonDuplicate(arr);\\n _;\\n }\\n\\n /**\\n * @dev Internal method to check the method caller.\\n * @dev Reverts if the method caller is not this contract.\\n */\\n function _requireSelfCall() internal view virtual {\\n if (msg.sender != address(this)) revert ErrOnlySelfCall(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to check if a contract address has code.\\n * @param addr The address of the contract to check.\\n * @dev Throws an error if the contract address has no code.\\n */\\n function _requireHasCode(address addr) internal view {\\n if (addr.code.length == 0) revert ErrZeroCodeContract(addr);\\n }\\n\\n /**\\n * @dev Checks if an address is zero and reverts if it is.\\n * @param addr The address to check.\\n */\\n function _requireNonZeroAddress(address addr) internal pure {\\n if (addr == address(0)) revert ErrZeroAddress(msg.sig);\\n }\\n\\n /**\\n * @dev Check if arr is empty and revert if it is.\\n * Checks if an array contains any duplicate addresses and reverts if duplicates are found.\\n * @param arr The array of addresses to check.\\n */\\n function _requireNonDuplicate(address[] memory arr) internal pure {\\n if (arr.hasDuplicate()) revert AddressArrayUtils.ErrDuplicated(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to require that the provided address is a created externally owned account (EOA).\\n * This internal function is used to ensure that the provided address is a valid externally owned account (EOA).\\n * It checks the codehash of the address against a predefined constant to confirm that the address is a created EOA.\\n * @notice This method only works with non-state EOA accounts\\n */\\n function _requireCreatedEOA(address addr) internal view {\\n _requireNonZeroAddress(addr);\\n bytes32 codehash = addr.codehash;\\n if (codehash != CREATED_ACCOUNT_HASH) revert ErrAddressIsNotCreatedEOA(addr, codehash);\\n }\\n\\n /**\\n * @dev Internal function to require that the specified contract supports the given interface. This method handle in\\n * both case that the callee is either or not the proxy admin of the caller. If the contract does not support the\\n * interface `interfaceId` or EIP165, a revert with the corresponding error message is triggered.\\n *\\n * @param contractAddr The address of the contract to check for interface support.\\n * @param interfaceId The interface ID to check for support.\\n */\\n function _requireSupportsInterface(address contractAddr, bytes4 interfaceId) internal view {\\n bytes memory supportsInterfaceParams = abi.encodeCall(IERC165.supportsInterface, (interfaceId));\\n (bool success, bytes memory returnOrRevertData) = contractAddr.staticcall(supportsInterfaceParams);\\n if (!success) {\\n (success, returnOrRevertData) = contractAddr.staticcall(abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (supportsInterfaceParams)));\\n if (!success) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n if (!abi.decode(returnOrRevertData, (bool))) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n}\\n\",\"keccak256\":\"0x546ab4c9cdb0e7f8e650f140349225305ba1d0706dcaceeb9180c96aa765da59\",\"license\":\"MIT\"},\"src/utils/RoleAccess.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum RoleAccess {\\n UNKNOWN, // 0\\n ADMIN, // 1\\n COINBASE, // 2\\n GOVERNOR, // 3\\n CANDIDATE_ADMIN, // 4\\n WITHDRAWAL_MIGRATOR, // 5\\n __DEPRECATED_BRIDGE_OPERATOR, // 6\\n BLOCK_PRODUCER, // 7\\n VALIDATOR_CANDIDATE, // 8\\n CONSENSUS, // 9\\n TREASURY // 10\\n\\n}\\n\",\"keccak256\":\"0x671ff40dd874c508c4b3879a580996c7987fc018669256f47151e420a55c0e51\",\"license\":\"MIT\"}},\"version\":1}", - "nonce": 23, - "numDeployments": 1, + "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"ErrBelowMinRequiredGovernors\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"ErrContractTypeNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrCurrentProposalIsNotCompleted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrDuplicated\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"name\":\"ErrExistOneInternalCallFailed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"}],\"name\":\"ErrGovernorNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"required\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ErrGovernorNotMatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ErrInsufficientGas\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidArguments\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"}],\"name\":\"ErrInvalidChainId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidExpiryTimestamp\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidInput\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidOrder\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidProposalNonce\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidThreshold\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidVoteWeight\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrLengthMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"callIndex\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"revertMsg\",\"type\":\"bytes\"}],\"name\":\"ErrLooseProposalInternallyRevert\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"ErrNonExecutorCannotRelay\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrOnlySelfCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"ErrOperatorNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrRelayFailed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum RoleAccess\",\"name\":\"expectedRole\",\"type\":\"uint8\"}],\"name\":\"ErrUnauthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrUnsupportedInterface\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrUnsupportedVoteType\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrVoteIsFinalized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrZeroAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrZeroCodeContract\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"BridgeOperatorAddingFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"BridgeOperatorRemovingFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fromBridgeOperator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"toBridgeOperator\",\"type\":\"address\"}],\"name\":\"BridgeOperatorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"statuses\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"uint96[]\",\"name\":\"voteWeights\",\"type\":\"uint96[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"BridgeOperatorsAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"statuses\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"BridgeOperatorsRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"name\":\"CallbackRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ContractUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"round\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"indexed\":false,\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"globalProposalHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"indexed\":false,\"internalType\":\"struct GlobalProposal.GlobalProposalDetail\",\"name\":\"globalProposal\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"}],\"name\":\"GlobalProposalCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"}],\"name\":\"MinRequiredGovernorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"statuses\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"returnDatas\",\"type\":\"bytes[]\"}],\"name\":\"Notified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ProposalApproved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"round\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"indexed\":false,\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"}],\"name\":\"ProposalCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bool[]\",\"name\":\"successCalls\",\"type\":\"bool[]\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"returnDatas\",\"type\":\"bytes[]\"}],\"name\":\"ProposalExecuted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ProposalExpired\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"ProposalExpiryDurationChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"name\":\"ProposalRejected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"enum Ballot.VoteType\",\"name\":\"support\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\"}],\"name\":\"ProposalVoted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum GlobalProposal.TargetOption\",\"name\":\"targetOption\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"TargetOptionUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"numerator\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"denominator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousNumerator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousDenominator\",\"type\":\"uint256\"}],\"name\":\"ThresholdUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96[]\",\"name\":\"voteWeights\",\"type\":\"uint96[]\"},{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"addBridgeOperators\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"voteWeight\",\"type\":\"uint256\"}],\"name\":\"checkThreshold\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeOperator\",\"type\":\"address\"}],\"name\":\"getBridgeOperatorWeight\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"weight\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBridgeOperators\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCallbackRegisters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"getContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"contract_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFullBridgeOperatorInfos\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"},{\"internalType\":\"uint96[]\",\"name\":\"weights\",\"type\":\"uint96[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"getGovernorOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"}],\"name\":\"getGovernorWeight\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"weight\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"}],\"name\":\"getGovernorWeights\",\"outputs\":[{\"internalType\":\"uint96[]\",\"name\":\"weights\",\"type\":\"uint96[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGovernors\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"}],\"name\":\"getOperatorOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getProposalExpiryDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"globalProposalRelayed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"roninChainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"bridgeContract\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"callbackRegisters\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"},{\"internalType\":\"uint96[]\",\"name\":\"voteWeights\",\"type\":\"uint96[]\"},{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isBridgeOperator\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minimumVoteWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"}],\"name\":\"registerCallbacks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"internalType\":\"struct GlobalProposal.GlobalProposalDetail\",\"name\":\"globalProposal\",\"type\":\"tuple\"},{\"internalType\":\"enum Ballot.VoteType[]\",\"name\":\"supports_\",\"type\":\"uint8[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"signatures\",\"type\":\"tuple[]\"}],\"name\":\"relayGlobalProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasAmounts\",\"type\":\"uint256[]\"}],\"internalType\":\"struct Proposal.ProposalDetail\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"internalType\":\"enum Ballot.VoteType[]\",\"name\":\"supports_\",\"type\":\"uint8[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"signatures\",\"type\":\"tuple[]\"}],\"name\":\"relayProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"bridgeOperators\",\"type\":\"address[]\"}],\"name\":\"removeBridgeOperators\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"}],\"name\":\"resolveTargets\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"round\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"}],\"name\":\"setMinRequiredGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom\",\"type\":\"uint256\"}],\"name\":\"setThreshold\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"governors\",\"type\":\"address[]\"}],\"name\":\"sumGovernorsWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"sum\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalBridgeOperator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"registers\",\"type\":\"address[]\"}],\"name\":\"unregisterCallbacks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum GlobalProposal.TargetOption[]\",\"name\":\"targetOptions\",\"type\":\"uint8[]\"},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"}],\"name\":\"updateManyTargetOption\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"vote\",\"outputs\":[{\"internalType\":\"enum VoteStatusConsumer.VoteStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"againstVoteWeight\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"forVoteWeight\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiryTimestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"ErrContractTypeNotFound(uint8)\":[{\"details\":\"Error of invalid role.\"}],\"ErrCurrentProposalIsNotCompleted()\":[{\"details\":\"Error thrown when the current proposal is not completed.\"}],\"ErrDuplicated(bytes4)\":[{\"details\":\"Error thrown when a duplicated element is detected in an array.\",\"params\":{\"msgSig\":\"The function signature that invoke the error.\"}}],\"ErrInsufficientGas(bytes32)\":[{\"details\":\"Error thrown when there is insufficient gas to execute a function.\"}],\"ErrInvalidArguments(bytes4)\":[{\"details\":\"Error indicating that arguments are invalid.\"}],\"ErrInvalidChainId(bytes4,uint256,uint256)\":[{\"details\":\"Error indicating that the chain ID is invalid.\",\"params\":{\"actual\":\"Current chain ID that executing function.\",\"expected\":\"Expected chain ID required for the tx to success.\",\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid chain ID.\"}}],\"ErrInvalidExpiryTimestamp()\":[{\"details\":\"Error thrown when an invalid expiry timestamp is provided.\"}],\"ErrInvalidOrder(bytes4)\":[{\"details\":\"Error indicating that an order is invalid.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid order.\"}}],\"ErrInvalidProposalNonce(bytes4)\":[{\"details\":\"Error indicating that the proposal nonce is invalid.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid proposal nonce.\"}}],\"ErrInvalidThreshold(bytes4)\":[{\"details\":\"Error indicating that the provided threshold is invalid for a specific function signature.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that the invalid threshold applies to.\"}}],\"ErrInvalidVoteWeight(bytes4)\":[{\"details\":\"Error indicating that a vote weight is invalid for a specific function signature.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that encountered an invalid vote weight.\"}}],\"ErrLengthMismatch(bytes4)\":[{\"details\":\"Error indicating a mismatch in the length of input parameters or arrays for a specific function.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that has a length mismatch.\"}}],\"ErrLooseProposalInternallyRevert(uint256,bytes)\":[{\"details\":\"Error thrown when the proposal reverts when execute the internal call no. `callIndex` with revert message is `revertMsg`.\"}],\"ErrNonExecutorCannotRelay(address,address)\":[{\"details\":\"Error of the `caller` to relay is not the specified `executor`.\"}],\"ErrOnlySelfCall(bytes4)\":[{\"details\":\"Error indicating that a function can only be called by the contract itself.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that can only be called by the contract itself.\"}}],\"ErrRelayFailed(bytes4)\":[{\"details\":\"Error indicating that a relay call has failed.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the relay call that failed.\"}}],\"ErrUnauthorized(bytes4,uint8)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"expectedRole\":\"The role required to perform the function.\",\"msgSig\":\"The function signature (bytes4) that the caller is unauthorized to perform.\"}}],\"ErrUnsupportedInterface(bytes4,address)\":[{\"details\":\"The error indicating an unsupported interface.\",\"params\":{\"addr\":\"The address where the unsupported interface was encountered.\",\"interfaceId\":\"The bytes4 interface identifier that is not supported.\"}}],\"ErrUnsupportedVoteType(bytes4)\":[{\"details\":\"Error indicating that a vote type is not supported.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the operation that encountered an unsupported vote type.\"}}],\"ErrVoteIsFinalized()\":[{\"details\":\"Error thrown when attempting to interact with a finalized vote.\"}],\"ErrZeroAddress(bytes4)\":[{\"details\":\"Error indicating that given address is null when it should not.\"}],\"ErrZeroCodeContract(address)\":[{\"details\":\"Error of set to non-contract.\"}]},\"events\":{\"BridgeOperatorAddingFailed(address)\":{\"details\":\"Emitted when a bridge operator is failed to add.\"},\"BridgeOperatorRemovingFailed(address)\":{\"details\":\"Emitted when a bridge operator is failed to remove.\"},\"BridgeOperatorUpdated(address,address,address)\":{\"details\":\"Emitted when a bridge operator is updated.\"},\"BridgeOperatorsAdded(bool[],uint96[],address[],address[])\":{\"details\":\"Emitted when new bridge operators are added.\"},\"BridgeOperatorsRemoved(bool[],address[])\":{\"details\":\"Emitted when bridge operators are removed.\"},\"ContractUpdated(uint8,address)\":{\"details\":\"Emitted when a contract is updated.\"},\"GlobalProposalCreated(uint256,bytes32,(uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),bytes32,(uint256,uint256,address,uint8[],uint256[],bytes[],uint256[]),address)\":{\"details\":\"Emitted when a proposal is created\"},\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"MinRequiredGovernorUpdated(uint256)\":{\"details\":\"Emitted when the minimum number of required governors is updated.\"},\"Notified(bytes,address[],bool[],bytes[])\":{\"details\":\"Emitted when the contract notifies multiple registers with statuses and return data.\"},\"ProposalApproved(bytes32)\":{\"details\":\"Emitted when the proposal is approved\"},\"ProposalCreated(uint256,uint256,bytes32,(uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),address)\":{\"details\":\"Emitted when a proposal is created\"},\"ProposalExecuted(bytes32,bool[],bytes[])\":{\"details\":\"Emitted when the proposal is executed\"},\"ProposalExpired(bytes32)\":{\"details\":\"Emitted when the vote is expired\"},\"ProposalExpiryDurationChanged(uint256)\":{\"details\":\"Emitted when the proposal expiry duration is changed.\"},\"ProposalRejected(bytes32)\":{\"details\":\"Emitted when the vote is reject\"},\"ProposalVoted(bytes32,address,uint8,uint256)\":{\"details\":\"Emitted when the proposal is voted\"},\"TargetOptionUpdated(uint8,address)\":{\"details\":\"Emitted when the target options are updated\"},\"ThresholdUpdated(uint256,uint256,uint256,uint256,uint256)\":{\"details\":\"Emitted when the threshold is updated\"}},\"kind\":\"dev\",\"methods\":{\"addBridgeOperators(uint96[],address[],address[])\":{\"details\":\"Adds multiple bridge operators.\",\"params\":{\"bridgeOperators\":\"An array of addresses representing the bridge operators to add.\",\"governors\":\"An array of addresses of hot/cold wallets for bridge operator to update their node address.\"}},\"checkThreshold(uint256)\":{\"details\":\"Checks whether the `_voteWeight` passes the threshold.\"},\"getBridgeOperatorWeight(address)\":{\"details\":\"External function to retrieve the vote weight of a specific bridge operator.\",\"params\":{\"bridgeOperator\":\"The address of the bridge operator to get the vote weight for.\"},\"returns\":{\"weight\":\"The vote weight of the specified bridge operator.\"}},\"getBridgeOperators()\":{\"details\":\"Returns an array of all bridge operators.\",\"returns\":{\"_0\":\"An array containing the addresses of all bridge operators.\"}},\"getCallbackRegisters()\":{\"details\":\"Retrieves the addresses of registered callbacks.\",\"returns\":{\"registers\":\"An array containing the addresses of registered callbacks.\"}},\"getContract(uint8)\":{\"details\":\"Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.\",\"params\":{\"contractType\":\"The role of the contract to retrieve.\"},\"returns\":{\"contract_\":\"The address of the contract with the specified role.\"}},\"getFullBridgeOperatorInfos()\":{\"details\":\"Retrieves the full information of all registered bridge operators. This external function allows external callers to obtain the full information of all the registered bridge operators. The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.\",\"returns\":{\"bridgeOperators\":\"An array of addresses representing the registered bridge operators.\",\"governors\":\"An array of addresses representing the governors of each bridge operator.\",\"weights\":\"An array of uint256 values representing the vote weights of each bridge operator. Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator. Example Usage: ``` (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos(); for (uint256 i = 0; i < bridgeOperators.length; i++) { // Access individual information for each bridge operator. address governor = governors[i]; address bridgeOperator = bridgeOperators[i]; uint256 weight = weights[i]; // ... (Process or use the information as required) ... } ```\"}},\"getGovernorOf(address)\":{\"details\":\"Returns the corresponding `governor` of a `operator`.\"},\"getGovernorWeight(address)\":{\"details\":\"External function to retrieve the vote weight of a specific governor.\",\"params\":{\"governor\":\"The address of the governor to get the vote weight for.\"},\"returns\":{\"weight\":\"voteWeight The vote weight of the specified governor.\"}},\"getGovernorWeights(address[])\":{\"details\":\"Returns the weights of a list of governor addresses.\"},\"getGovernors()\":{\"details\":\"Returns an array of all governors.\",\"returns\":{\"_0\":\"An array containing the addresses of all governors.\"}},\"getOperatorOf(address)\":{\"details\":\"Returns the corresponding `operator` of a `governor`.\"},\"getProposalExpiryDuration()\":{\"details\":\"Returns the expiry duration for a new proposal.\"},\"getThreshold()\":{\"details\":\"Returns the threshold.\"},\"getTotalWeight()\":{\"details\":\"Returns total weights.\"},\"globalProposalRelayed(uint256)\":{\"details\":\"Returns whether the voter `_voter` casted vote for the proposal.\"},\"isBridgeOperator(address)\":{\"details\":\"Checks if the given address is a bridge operator.\",\"params\":{\"addr\":\"The address to check.\"},\"returns\":{\"_0\":\"A boolean indicating whether the address is a bridge operator.\"}},\"minimumVoteWeight()\":{\"details\":\"Returns the minimum vote weight to pass the threshold.\"},\"registerCallbacks(address[])\":{\"details\":\"Registers multiple callbacks with the bridge.\",\"params\":{\"registers\":\"The array of callback addresses to register.\"}},\"relayGlobalProposal((uint256,uint256,address,uint8[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])\":{\"details\":\"See `GovernanceRelay-_relayGlobalProposal`. Requirements: - The method caller is governor.\"},\"relayProposal((uint256,uint256,uint256,address,address[],uint256[],bytes[],uint256[]),uint8[],(uint8,bytes32,bytes32)[])\":{\"details\":\"See `GovernanceRelay-_relayProposal`. Requirements: - The method caller is governor.\"},\"removeBridgeOperators(address[])\":{\"details\":\"Removes multiple bridge operators.\",\"params\":{\"bridgeOperators\":\"An array of addresses representing the bridge operators to remove.\"}},\"resolveTargets(uint8[])\":{\"details\":\"Returns corresponding address of target options. Return address(0) on non-existent target.\"},\"setContract(uint8,address)\":{\"details\":\"Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.\",\"params\":{\"addr\":\"The address of the contract to set.\",\"contractType\":\"The role of the contract to set.\"}},\"setMinRequiredGovernor(uint256)\":{\"details\":\"Self-call to update the minimum required governor.\",\"params\":{\"min\":\"The minimum number, this must not less than 3.\"}},\"setThreshold(uint256,uint256)\":{\"details\":\"Sets the threshold. Requirements: - The method caller is admin. Emits the `ThresholdUpdated` event.\"},\"sumGovernorsWeight(address[])\":{\"details\":\"Returns total weights of the governor list.\"},\"totalBridgeOperator()\":{\"details\":\"Returns the total number of bridge operators.\",\"returns\":{\"_0\":\"The total number of bridge operators.\"}},\"unregisterCallbacks(address[])\":{\"details\":\"Unregisters multiple callbacks from the bridge.\",\"params\":{\"registers\":\"The array of callback addresses to unregister.\"}},\"updateManyTargetOption(uint8[],address[])\":{\"details\":\"Updates list of `targetOptions` to `targets`. Requirement: - Only allow self-call through proposal.\"}},\"version\":1},\"userdoc\":{\"errors\":{\"ErrBelowMinRequiredGovernors()\":[{\"notice\":\"Error indicating that the governors list will go below minimum number of required governor.\"}],\"ErrGovernorNotFound(address)\":[{\"notice\":\"Error indicating that cannot find the querying governor\"}],\"ErrGovernorNotMatch(address,address)\":[{\"notice\":\"Error indicating that the msg.sender is not match the required governor\"}],\"ErrInvalidInput()\":[{\"notice\":\"Common invalid input error\"}],\"ErrOperatorNotFound(address)\":[{\"notice\":\"Error indicating that cannot find the querying operator\"}]},\"kind\":\"user\",\"methods\":{\"round(uint256)\":{\"notice\":\"chain id = 0 for global proposal\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/mainchain/MainchainBridgeManager.sol\":\"MainchainBridgeManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@fdk/=lib/foundry-deployment-kit/script/\",\":@openzeppelin/=lib/openzeppelin-contracts/\",\":@prb/math/=lib/prb-math/\",\":@prb/test/=lib/prb-test/src/\",\":@ronin/contracts/=src/\",\":@ronin/script/=script/\",\":@ronin/test/=test/\",\":contract-libs/=lib/foundry-deployment-kit/lib/contract-libs/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/foundry-deployment-kit/lib/forge-std/src/\",\":foundry-deployment-kit/=lib/foundry-deployment-kit/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/contracts/\",\":prb-math/=lib/prb-math/src/\",\":prb-test/=lib/prb-test/src/\",\":sample-projects/=node_modules/hardhat/sample-projects/\",\":solady/=lib/solady/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0xa6a787e7a901af6511e19aa53e1a00352db215a011d2c7a438d0582dd5da76f9\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2a21b14ff90012878752f230d3ffd5c3405e5938d06c97a7d89c0a64561d0d66\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _HEX_SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n // Inspired by OraclizeAPI's implementation - MIT licence\\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\\n\\n if (value == 0) {\\n return \\\"0\\\";\\n }\\n uint256 temp = value;\\n uint256 digits;\\n while (temp != 0) {\\n digits++;\\n temp /= 10;\\n }\\n bytes memory buffer = new bytes(digits);\\n while (value != 0) {\\n digits -= 1;\\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\\n value /= 10;\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n if (value == 0) {\\n return \\\"0x00\\\";\\n }\\n uint256 temp = value;\\n uint256 length = 0;\\n while (temp != 0) {\\n length++;\\n temp >>= 8;\\n }\\n return toHexString(value, length);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xaf159a8b1923ad2a26d516089bceca9bdeaeacd04be50983ea00ba63070f08a3\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.3) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSA {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n } else if (error == RecoverError.InvalidSignatureV) {\\n revert(\\\"ECDSA: invalid signature 'v' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n if (v != 27 && v != 28) {\\n return (address(0), RecoverError.InvalidSignatureV);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", Strings.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0xdb7f5c28fc61cda0bd8ab60ce288e206b791643bcd3ba464a70cbec18895a2f5\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n *\\n * [WARNING]\\n * ====\\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.\\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\\n *\\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.\\n * ====\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n bytes32 lastValue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastValue;\\n // Update the index for the moved value\\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n return set._values[index];\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function _values(Set storage set) private view returns (bytes32[] memory) {\\n return set._values;\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\\n return _values(set._inner);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(AddressSet storage set) internal view returns (address[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n address[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(UintSet storage set) internal view returns (uint256[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n uint256[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0x5050943b32b6a8f282573d166b2e9d87ab7eb4dbba4ab6acf36ecb54fe6995e4\",\"license\":\"MIT\"},\"src/extensions/TransparentUpgradeableProxyV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\\\";\\n\\ncontract TransparentUpgradeableProxyV2 is TransparentUpgradeableProxy {\\n constructor(address _logic, address admin_, bytes memory _data) payable TransparentUpgradeableProxy(_logic, admin_, _data) { }\\n\\n /**\\n * @dev Calls a function from the current implementation as specified by `_data`, which should be an encoded function call.\\n *\\n * Requirements:\\n * - Only the admin can call this function.\\n *\\n * Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid\\n * triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider\\n * reviewing the encoded data `_data` and the method which is called before using this.\\n *\\n */\\n function functionDelegateCall(bytes memory _data) public payable ifAdmin {\\n address _addr = _implementation();\\n assembly {\\n let _result := delegatecall(gas(), _addr, add(_data, 32), mload(_data), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n switch _result\\n case 0 { revert(0, returndatasize()) }\\n default { return(0, returndatasize()) }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x45fc7b71d09da99414b977a56e586b3604670d865e5f36f395d5c98bc4ba64af\",\"license\":\"MIT\"},\"src/extensions/bridge-operator-governance/BridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.23;\\n\\nimport { Initializable } from \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport { IBridgeManagerCallback, BridgeManagerCallbackRegister } from \\\"./BridgeManagerCallbackRegister.sol\\\";\\nimport { IHasContracts, HasContracts } from \\\"../../extensions/collections/HasContracts.sol\\\";\\n\\nimport { IBridgeManager } from \\\"../../interfaces/bridge/IBridgeManager.sol\\\";\\nimport { AddressArrayUtils } from \\\"../../libraries/AddressArrayUtils.sol\\\";\\nimport { ContractType } from \\\"../../utils/ContractType.sol\\\";\\nimport { RoleAccess } from \\\"../../utils/RoleAccess.sol\\\";\\nimport { TUint256Slot } from \\\"../../types/Types.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\nimport \\\"./BridgeManagerQuorum.sol\\\";\\n\\nabstract contract BridgeManager is IBridgeManager, BridgeManagerQuorum, BridgeManagerCallbackRegister {\\n using AddressArrayUtils for address[];\\n\\n struct BridgeManagerStorage {\\n /// @notice List of the governors.\\n /// @dev We do not use EnumerableSet here to maintain identical order of `governors` and `operators`. If `.contains` is needed, use the corresponding weight mapping.\\n address[] _governors;\\n address[] _operators;\\n /// @dev Mapping from address to the governor weight\\n mapping(address governor => uint96 weight) _governorWeight;\\n /// @dev Mapping from address to the operator weight. This must always be identical `_governorWeight`.\\n mapping(address operator => uint96 weight) _operatorWeight;\\n /// @dev Total weight of all governors / operators.\\n uint256 _totalWeight;\\n /// @dev The minimum number of governors that must exist in the contract, to avoid the contract become non-accessible.\\n uint256 _minRequiredGovernor;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"ronin.storage.BridgeManagerStorageLocation\\\")) - 1)) & ~bytes32(uint256(0xff))\\n bytes32 private constant $$_BridgeManagerStorageLocation = 0xc648703095712c0419b6431ae642c061f0a105ac2d7c3d9604061ef4ebc38300;\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n bytes32 public DOMAIN_SEPARATOR;\\n\\n modifier onlyGovernor() virtual {\\n _requireGovernor(msg.sender);\\n _;\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n function __BridgeManager_init(\\n uint256 num,\\n uint256 denom,\\n uint256 roninChainId,\\n address bridgeContract,\\n address[] memory callbackRegisters,\\n address[] memory bridgeOperators,\\n address[] memory governors,\\n uint96[] memory voteWeights\\n ) internal onlyInitializing {\\n __BridgeManagerQuorum_init_unchained(num, denom);\\n __BridgeManagerCallbackRegister_init_unchained(callbackRegisters);\\n __BridgeManager_init_unchained(roninChainId, bridgeContract, bridgeOperators, governors, voteWeights);\\n }\\n\\n function __BridgeManager_init_unchained(\\n uint256 roninChainId,\\n address bridgeContract,\\n address[] memory bridgeOperators,\\n address[] memory governors,\\n uint96[] memory voteWeights\\n ) internal onlyInitializing {\\n _setContract(ContractType.BRIDGE, bridgeContract);\\n\\n DOMAIN_SEPARATOR = keccak256(\\n abi.encode(\\n keccak256(\\\"EIP712Domain(string name,string version,bytes32 salt)\\\"),\\n keccak256(\\\"BridgeManager\\\"), // name hash\\n keccak256(\\\"3\\\"), // version hash\\n keccak256(abi.encode(\\\"BRIDGE_MANAGER\\\", roninChainId)) // salt\\n )\\n );\\n\\n _addBridgeOperators(voteWeights, governors, bridgeOperators);\\n _setMinRequiredGovernor(3);\\n }\\n\\n function _getBridgeManagerStorage() private pure returns (BridgeManagerStorage storage $) {\\n assembly {\\n $.slot := $$_BridgeManagerStorageLocation\\n }\\n }\\n\\n // ===================== CONFIG ========================\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function setContract(ContractType contractType, address addr) external override onlyProxyAdmin {\\n _requireHasCode(addr);\\n _setContract(contractType, addr);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function setMinRequiredGovernor(uint min) external override onlyProxyAdmin {\\n _setMinRequiredGovernor(min);\\n }\\n\\n function _setMinRequiredGovernor(uint min) internal {\\n if (min < 3) revert ErrInvalidInput();\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n $._minRequiredGovernor = min;\\n emit MinRequiredGovernorUpdated(min);\\n }\\n\\n /**\\n * @dev Internal function to require that the caller has governor role access.\\n */\\n function _requireGovernor(address addr) internal view {\\n if (_getGovernorWeight(addr) == 0) {\\n revert ErrUnauthorized(msg.sig, RoleAccess.GOVERNOR);\\n }\\n }\\n\\n // ===================== WEIGHTS METHOD ========================\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getTotalWeight() public view returns (uint256) {\\n return _totalWeight();\\n }\\n\\n function _totalWeight() internal view override returns (uint256) {\\n return _getBridgeManagerStorage()._totalWeight;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getGovernorWeights(address[] calldata governors) external view returns (uint96[] memory weights) {\\n weights = _getGovernorWeights(governors);\\n }\\n\\n /**\\n * @dev Internal function to get the vote weights of a given array of governors.\\n */\\n function _getGovernorWeights(address[] memory governors) internal view returns (uint96[] memory weights) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n weights = new uint96[](governors.length);\\n\\n for (uint256 i; i < governors.length; i++) {\\n weights[i] = $._governorWeight[governors[i]];\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getGovernorWeight(address governor) external view returns (uint96 weight) {\\n weight = _getGovernorWeight(governor);\\n }\\n\\n /**\\n * @dev Internal function to retrieve the vote weight of a specific governor.\\n */\\n function _getGovernorWeight(address governor) internal view returns (uint96) {\\n return _getBridgeManagerStorage()._governorWeight[governor];\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function sumGovernorsWeight(address[] calldata governors) external view nonDuplicate(governors) returns (uint256 sum) {\\n sum = _sumGovernorsWeight(governors);\\n }\\n\\n /**\\n * @dev Internal function to calculate the sum of vote weights for a given array of governors.\\n * @param governors The non-duplicated input.\\n */\\n function _sumGovernorsWeight(address[] memory governors) internal view nonDuplicate(governors) returns (uint256 sum) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n for (uint256 i; i < governors.length; i++) {\\n sum += $._governorWeight[governors[i]];\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint96 weight) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n return $._operatorWeight[bridgeOperator];\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function minimumVoteWeight() public view virtual returns (uint256) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n (uint256 numerator, uint256 denominator) = getThreshold();\\n return (numerator * $._totalWeight + denominator - 1) / denominator;\\n }\\n\\n // ===================== MANAGER CRUD ========================\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function addBridgeOperators(uint96[] calldata voteWeights, address[] calldata governors, address[] calldata bridgeOperators) external onlyProxyAdmin {\\n _addBridgeOperators(voteWeights, governors, bridgeOperators);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function removeBridgeOperators(address[] calldata bridgeOperators) external onlyProxyAdmin {\\n _removeBridgeOperators(bridgeOperators);\\n }\\n\\n /**\\n * @dev Internal function to add bridge operators.\\n *\\n * This function adds the specified `bridgeOperators` to the bridge operator set and establishes the associated mappings.\\n *\\n * Requirements:\\n * - The caller must have the necessary permission to add bridge operators.\\n * - The lengths of `voteWeights`, `governors`, and `bridgeOperators` arrays must be equal.\\n *\\n * @return addeds An array of boolean values indicating whether each bridge operator was successfully added.\\n */\\n function _addBridgeOperators(\\n uint96[] memory voteWeights,\\n address[] memory newGovernors,\\n address[] memory newOperators\\n ) internal nonDuplicate(newGovernors.extend(newOperators)) returns (bool[] memory addeds) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n uint256 length = newOperators.length;\\n if (!(length == voteWeights.length && length == newGovernors.length)) revert ErrLengthMismatch(msg.sig);\\n addeds = new bool[](length);\\n\\n // simply skip add operations if inputs are empty.\\n if (length == 0) return addeds;\\n\\n address iGovernor;\\n address iOperator;\\n uint96 iVoteWeight;\\n uint256 accumulatedWeight;\\n\\n for (uint256 i; i < length; i++) {\\n iGovernor = newGovernors[i];\\n iOperator = newOperators[i];\\n iVoteWeight = voteWeights[i];\\n\\n // Check non-zero inputs\\n _requireNonZeroAddress(iGovernor);\\n _requireNonZeroAddress(iOperator);\\n if (iVoteWeight == 0) revert ErrInvalidVoteWeight(msg.sig);\\n\\n // Check not yet added operators\\n addeds[i] = ($._governorWeight[iGovernor] + $._governorWeight[iOperator] + $._operatorWeight[iOperator] + $._operatorWeight[iGovernor]) == 0;\\n\\n // Only add the valid operator\\n if (addeds[i]) {\\n // Add governor to list, update governor weight\\n $._governors.push(iGovernor);\\n $._governorWeight[iGovernor] = iVoteWeight;\\n\\n // Add operator to list, update governor weight\\n $._operators.push(iOperator);\\n $._operatorWeight[iOperator] = iVoteWeight;\\n\\n accumulatedWeight += iVoteWeight;\\n }\\n }\\n\\n $._totalWeight += accumulatedWeight;\\n\\n _notifyRegisters(IBridgeManagerCallback.onBridgeOperatorsAdded.selector, abi.encode(newOperators, voteWeights, addeds));\\n\\n emit BridgeOperatorsAdded(addeds, voteWeights, newGovernors, newOperators);\\n }\\n\\n /**\\n * @dev Internal function to remove bridge operators.\\n *\\n * This function removes the specified `bridgeOperators` from the bridge operator set and related mappings.\\n *\\n * Requirements:\\n * - The caller must have the necessary permission to remove bridge operators.\\n *\\n * @param removingOperators An array of addresses representing the bridge operators to be removed.\\n * @return removeds An array of boolean values indicating whether each bridge operator was successfully removed.\\n */\\n function _removeBridgeOperators(address[] memory removingOperators) internal nonDuplicate(removingOperators) returns (bool[] memory removeds) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n uint256 length = removingOperators.length;\\n removeds = new bool[](length);\\n\\n // simply skip remove operations if inputs are empty.\\n if (length == 0) return removeds;\\n if ($._governors.length - length < $._minRequiredGovernor) {\\n revert ErrBelowMinRequiredGovernors();\\n }\\n\\n address iGovernor;\\n address iOperator;\\n uint256 accumulatedWeight;\\n uint idx;\\n\\n for (uint256 i; i < length; i++) {\\n iOperator = removingOperators[i];\\n\\n // Check non-zero inputs\\n (iGovernor, idx) = _getGovernorOf(iOperator);\\n _requireNonZeroAddress(iGovernor);\\n _requireNonZeroAddress(iOperator);\\n\\n // Check existing operators\\n removeds[i] = $._governorWeight[iGovernor] > 0 && $._operatorWeight[iOperator] > 0;\\n\\n // Only remove the valid operator\\n if (removeds[i]) {\\n uint removingVoteWeight = $._governorWeight[iGovernor];\\n\\n // Remove governor from list, update governor weight\\n uint lastIdx = $._governors.length - 1;\\n $._governors[idx] = $._governors[lastIdx];\\n $._governors.pop();\\n delete $._governorWeight[iGovernor];\\n\\n // Remove operator from list, update operator weight\\n $._operators[idx] = $._operators[lastIdx];\\n $._operators.pop();\\n delete $._operatorWeight[iOperator];\\n\\n accumulatedWeight += removingVoteWeight;\\n }\\n }\\n\\n $._totalWeight -= accumulatedWeight;\\n\\n _notifyRegisters(IBridgeManagerCallback.onBridgeOperatorsRemoved.selector, abi.encode(removingOperators, removeds));\\n\\n emit BridgeOperatorsRemoved(removeds, removingOperators);\\n }\\n\\n function _findInArray(address[] storage $_array, address addr) internal view returns (bool found, uint idx) {\\n for (uint i; i < $_array.length; i++) {\\n if (addr == $_array[i]) {\\n return (true, i);\\n }\\n }\\n\\n return (false, type(uint256).max);\\n }\\n\\n // ================= MANAGER VIEW METHODS =============\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function totalBridgeOperator() external view returns (uint256) {\\n return _getBridgeManagerStorage()._operators.length;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function isBridgeOperator(address addr) external view returns (bool) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n return $._operatorWeight[addr] > 0;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getBridgeOperators() external view returns (address[] memory) {\\n return _getBridgeManagerStorage()._operators;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getGovernors() external view returns (address[] memory) {\\n return _getBridgeManagerStorage()._governors;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getOperatorOf(address governor) external view returns (address operator) {\\n (bool found, uint idx) = _findInArray(_getBridgeManagerStorage()._governors, governor);\\n if (!found) revert ErrGovernorNotFound(governor);\\n\\n return _getBridgeManagerStorage()._operators[idx];\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getGovernorOf(address operator) external view returns (address governor) {\\n (governor,) = _getGovernorOf(operator);\\n }\\n\\n function _getGovernorOf(address operator) internal view returns (address governor, uint idx) {\\n (bool found, uint foundId) = _findInArray(_getBridgeManagerStorage()._operators, operator);\\n if (!found) revert ErrOperatorNotFound(operator);\\n\\n return (_getBridgeManagerStorage()._governors[foundId], foundId);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManager\\n */\\n function getFullBridgeOperatorInfos() external view returns (address[] memory governors, address[] memory bridgeOperators, uint96[] memory weights) {\\n BridgeManagerStorage storage $ = _getBridgeManagerStorage();\\n\\n governors = $._governors;\\n bridgeOperators = $._operators;\\n weights = _getGovernorWeights(governors);\\n }\\n}\\n\",\"keccak256\":\"0xa66d73d33f953f3262714999043f99fb7b7542d1d29c481e376d9ecd2b15b28b\",\"license\":\"MIT\"},\"src/extensions/bridge-operator-governance/BridgeManagerCallbackRegister.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { Initializable } from \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport { EnumerableSet } from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\nimport { IBridgeManagerCallbackRegister } from \\\"../../interfaces/bridge/IBridgeManagerCallbackRegister.sol\\\";\\nimport { IBridgeManagerCallback } from \\\"../../interfaces/bridge/IBridgeManagerCallback.sol\\\";\\nimport { HasContracts } from \\\"../../extensions/collections/HasContracts.sol\\\";\\nimport { TransparentUpgradeableProxyV2, IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\n\\n/**\\n * @title BridgeManagerCallbackRegister\\n * @dev A contract that manages callback registrations and execution for a bridge.\\n */\\nabstract contract BridgeManagerCallbackRegister is IBridgeManagerCallbackRegister, IdentityGuard, Initializable, HasContracts {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n /**\\n * @dev Storage slot for the address set of callback registers.\\n * @dev Value is equal to keccak256(\\\"@ronin.dpos.gateway.BridgeAdmin.callbackRegisters.slot\\\") - 1.\\n */\\n bytes32 private constant CALLBACK_REGISTERS_SLOT = 0x5da136eb38f8d8e354915fc8a767c0dc81d49de5fb65d5477122a82ddd976240;\\n\\n function __BridgeManagerCallbackRegister_init_unchained(address[] memory callbackRegisters) internal onlyInitializing {\\n _registerCallbacks(callbackRegisters);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallbackRegister\\n */\\n function registerCallbacks(address[] calldata registers) external onlyProxyAdmin {\\n _registerCallbacks(registers);\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallbackRegister\\n */\\n function unregisterCallbacks(address[] calldata registers) external onlyProxyAdmin nonDuplicate(registers) {\\n EnumerableSet.AddressSet storage _callbackRegisters = _getCallbackRegisters();\\n\\n for (uint256 i; i < registers.length; i++) {\\n _callbackRegisters.remove(registers[i]);\\n }\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallbackRegister\\n */\\n function getCallbackRegisters() external view returns (address[] memory registers) {\\n registers = _getCallbackRegisters().values();\\n }\\n\\n /**\\n * @dev Internal function to register multiple callbacks with the bridge.\\n * @param registers The array of callback addresses to register.\\n */\\n function _registerCallbacks(address[] memory registers) internal nonDuplicate(registers) {\\n EnumerableSet.AddressSet storage _callbackRegisters = _getCallbackRegisters();\\n address register;\\n bool regSuccess;\\n\\n for (uint256 i; i < registers.length; i++) {\\n register = registers[i];\\n\\n _requireHasCode(register);\\n _requireSupportsInterface(register, type(IBridgeManagerCallback).interfaceId);\\n\\n regSuccess = _callbackRegisters.add(register);\\n\\n emit CallbackRegistered(register, regSuccess);\\n }\\n }\\n\\n /**\\n * @dev Same as {_notifyRegistersUnsafe} but revert when there at least one failed internal call.\\n */\\n function _notifyRegisters(bytes4 callbackFnSig, bytes memory inputs) internal {\\n if (!_notifyRegistersUnsafe(callbackFnSig, inputs)) {\\n revert ErrExistOneInternalCallFailed(msg.sender, callbackFnSig, inputs);\\n }\\n }\\n\\n /**\\n * @dev Internal function to notify all registered callbacks with the provided function signature and data.\\n * @param callbackFnSig The function signature of the callback method.\\n * @param inputs The data to pass to the callback method.\\n * @return allSuccess Return true if all internal calls are success\\n */\\n function _notifyRegistersUnsafe(bytes4 callbackFnSig, bytes memory inputs) internal returns (bool allSuccess) {\\n allSuccess = true;\\n\\n address[] memory registers = _getCallbackRegisters().values();\\n uint256 length = registers.length;\\n if (length == 0) return allSuccess;\\n\\n bool[] memory successes = new bool[](length);\\n bytes[] memory returnDatas = new bytes[](length);\\n bytes memory callData = abi.encodePacked(callbackFnSig, inputs);\\n bytes memory proxyCallData = abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (callData));\\n\\n for (uint256 i; i < length; i++) {\\n // First, attempt to call normally\\n (successes[i], returnDatas[i]) = registers[i].call(callData);\\n\\n // If cannot call normally, attempt to call as the recipient is the proxy, and this caller is its admin.\\n if (!successes[i]) {\\n (successes[i], returnDatas[i]) = registers[i].call(proxyCallData);\\n allSuccess = allSuccess && successes[i];\\n }\\n }\\n\\n emit Notified(callData, registers, successes, returnDatas);\\n }\\n\\n /**\\n * @dev Internal function to retrieve the address set of callback registers.\\n * @return callbackRegisters The storage reference to the callback registers.\\n */\\n function _getCallbackRegisters() internal pure returns (EnumerableSet.AddressSet storage callbackRegisters) {\\n assembly (\\\"memory-safe\\\") {\\n callbackRegisters.slot := CALLBACK_REGISTERS_SLOT\\n }\\n }\\n}\\n\",\"keccak256\":\"0xee1c849d6b50cda917d6c918a23116cc288488958f58ef215707204e7c2f847f\",\"license\":\"MIT\"},\"src/extensions/bridge-operator-governance/BridgeManagerQuorum.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.23;\\n\\nimport { Initializable } from \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport { IQuorum } from \\\"../../interfaces/IQuorum.sol\\\";\\nimport { IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\nimport { HasContracts } from \\\"../../extensions/collections/HasContracts.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\n\\nabstract contract BridgeManagerQuorum is IQuorum, IdentityGuard, Initializable, HasContracts {\\n struct BridgeManagerQuorumStorage {\\n uint256 _nonce;\\n uint256 _numerator;\\n uint256 _denominator;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"ronin.storage.BridgeManagerQuorumStorage\\\")) - 1)) & ~bytes32(uint256(0xff))\\n bytes32 private constant $$_BridgeManagerQuorumStorage = 0xf3019750f3837257cd40d215c9cc111e92586d2855a1e7e25d959613ed013f00;\\n\\n function __BridgeManagerQuorum_init_unchained(uint256 num, uint256 denom) internal onlyInitializing {\\n BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage();\\n $._nonce = 1;\\n\\n _setThreshold(num, denom);\\n }\\n\\n function _getBridgeManagerQuorumStorage() private pure returns (BridgeManagerQuorumStorage storage $) {\\n assembly {\\n $.slot := $$_BridgeManagerQuorumStorage\\n }\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function setThreshold(uint256 num, uint256 denom) external override onlyProxyAdmin {\\n _setThreshold(num, denom);\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function getThreshold() public view virtual returns (uint256 num, uint256 denom) {\\n BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage();\\n return ($._numerator, $._denominator);\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function checkThreshold(uint256 voteWeight) external view virtual returns (bool) {\\n BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage();\\n\\n return voteWeight * $._denominator >= $._numerator * _totalWeight();\\n }\\n\\n /**\\n * @dev Sets threshold and returns the old one.\\n *\\n * Emits the `ThresholdUpdated` event.\\n *\\n */\\n function _setThreshold(uint256 num, uint256 denom) internal virtual {\\n if (num > denom || denom <= 1) revert ErrInvalidThreshold(msg.sig);\\n\\n BridgeManagerQuorumStorage storage $ = _getBridgeManagerQuorumStorage();\\n\\n uint256 prevNum = $._numerator;\\n uint256 prevDenom = $._denominator;\\n\\n $._numerator = num;\\n $._denominator = denom;\\n\\n emit ThresholdUpdated($._nonce++, num, denom, prevNum, prevDenom);\\n }\\n\\n function _totalWeight() internal view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0xd49face0efa89eac09d2d6a5eb69598fd706ba1aac8d431b22212643a507b74e\",\"license\":\"MIT\"},\"src/extensions/collections/HasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { HasProxyAdmin } from \\\"./HasProxyAdmin.sol\\\";\\nimport \\\"../../interfaces/collections/IHasContracts.sol\\\";\\nimport { IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\nimport { ErrUnexpectedInternalCall } from \\\"../../utils/CommonErrors.sol\\\";\\n\\n/**\\n * @title HasContracts\\n * @dev A contract that provides functionality to manage multiple contracts with different roles.\\n */\\nabstract contract HasContracts is HasProxyAdmin, IHasContracts, IdentityGuard {\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.collections.HasContracts.slot\\\") - 1\\n bytes32 private constant _STORAGE_SLOT = 0xdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb;\\n\\n /**\\n * @dev Modifier to restrict access to functions only to contracts with a specific role.\\n * @param contractType The contract type that allowed to call\\n */\\n modifier onlyContract(ContractType contractType) virtual {\\n _requireContract(contractType);\\n _;\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function setContract(ContractType contractType, address addr) external virtual onlyProxyAdmin {\\n _requireHasCode(addr);\\n _setContract(contractType, addr);\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function getContract(ContractType contractType) public view returns (address contract_) {\\n contract_ = _getContractMap()[uint8(contractType)];\\n if (contract_ == address(0)) revert ErrContractTypeNotFound(contractType);\\n }\\n\\n /**\\n * @dev Internal function to set the address of a contract with a specific role.\\n * @param contractType The contract type of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function _setContract(ContractType contractType, address addr) internal virtual {\\n _getContractMap()[uint8(contractType)] = addr;\\n emit ContractUpdated(contractType, addr);\\n }\\n\\n /**\\n * @dev Internal function to access the mapping of contract addresses with roles.\\n * @return contracts_ The mapping of contract addresses with roles.\\n */\\n function _getContractMap() private pure returns (mapping(uint8 => address) storage contracts_) {\\n assembly {\\n contracts_.slot := _STORAGE_SLOT\\n }\\n }\\n\\n /**\\n * @dev Internal function to check if the calling contract has a specific role.\\n * @param contractType The contract type that the calling contract must have.\\n * @dev Throws an error if the calling contract does not have the specified role.\\n */\\n function _requireContract(ContractType contractType) private view {\\n if (msg.sender != getContract(contractType)) {\\n revert ErrUnexpectedInternalCall(msg.sig, contractType, msg.sender);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7dbefa31230e6e4bd319f02d94893cbfd07ee12a0e016f5fadc57660df01891\",\"license\":\"MIT\"},\"src/extensions/collections/HasProxyAdmin.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/StorageSlot.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\n\\nabstract contract HasProxyAdmin {\\n // bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n modifier onlyProxyAdmin() {\\n _requireProxyAdmin();\\n _;\\n }\\n\\n /**\\n * @dev Returns proxy admin.\\n */\\n function _getProxyAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n function _requireProxyAdmin() internal view {\\n if (msg.sender != _getProxyAdmin()) revert ErrUnauthorized(msg.sig, RoleAccess.ADMIN);\\n }\\n}\\n\",\"keccak256\":\"0xad3db02c99a960b60151f2ad45eed46073d14fe1ed861f496c7aeefacbbc528e\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/CoreGovernance.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport \\\"../../libraries/Proposal.sol\\\";\\nimport \\\"../../libraries/GlobalProposal.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\nimport \\\"../../libraries/Ballot.sol\\\";\\nimport \\\"../../interfaces/consumers/ChainTypeConsumer.sol\\\";\\nimport \\\"../../interfaces/consumers/SignatureConsumer.sol\\\";\\nimport \\\"../../interfaces/consumers/VoteStatusConsumer.sol\\\";\\n\\nabstract contract CoreGovernance is Initializable, SignatureConsumer, VoteStatusConsumer, ChainTypeConsumer {\\n using Proposal for Proposal.ProposalDetail;\\n\\n /**\\n * @dev Error thrown when attempting to interact with a finalized vote.\\n */\\n error ErrVoteIsFinalized();\\n\\n /**\\n * @dev Error thrown when the current proposal is not completed.\\n */\\n error ErrCurrentProposalIsNotCompleted();\\n\\n struct ProposalVote {\\n VoteStatus status;\\n bytes32 hash;\\n uint256 againstVoteWeight; // Total weight of against votes\\n uint256 forVoteWeight; // Total weight of for votes\\n address[] forVoteds; // Array of addresses voting for\\n address[] againstVoteds; // Array of addresses voting against\\n uint256 expiryTimestamp;\\n mapping(address => Signature) sig;\\n mapping(address => bool) voted;\\n }\\n\\n /// @dev Emitted when a proposal is created\\n event ProposalCreated(uint256 indexed chainId, uint256 indexed round, bytes32 indexed proposalHash, Proposal.ProposalDetail proposal, address creator);\\n /// @dev Emitted when the proposal is voted\\n event ProposalVoted(bytes32 indexed proposalHash, address indexed voter, Ballot.VoteType support, uint256 weight);\\n /// @dev Emitted when the proposal is approved\\n event ProposalApproved(bytes32 indexed proposalHash);\\n /// @dev Emitted when the vote is reject\\n event ProposalRejected(bytes32 indexed proposalHash);\\n /// @dev Emitted when the vote is expired\\n event ProposalExpired(bytes32 indexed proposalHash);\\n /// @dev Emitted when the proposal is executed\\n event ProposalExecuted(bytes32 indexed proposalHash, bool[] successCalls, bytes[] returnDatas);\\n /// @dev Emitted when the proposal expiry duration is changed.\\n event ProposalExpiryDurationChanged(uint256 indexed duration);\\n\\n /// @dev Mapping from chain id => vote round\\n /// @notice chain id = 0 for global proposal\\n mapping(uint256 => uint256) public round;\\n /// @dev Mapping from chain id => vote round => proposal vote\\n mapping(uint256 => mapping(uint256 => ProposalVote)) public vote;\\n\\n uint256 internal _proposalExpiryDuration;\\n\\n function __CoreGovernance_init(uint256 expiryDuration) internal onlyInitializing {\\n __CoreGovernance_init_unchained(expiryDuration);\\n }\\n\\n function __CoreGovernance_init_unchained(uint256 expiryDuration) internal onlyInitializing {\\n _setProposalExpiryDuration(expiryDuration);\\n }\\n\\n /**\\n * @dev Creates new voting round by calculating the `_round` number of chain `_chainId`.\\n * Increases the `_round` number if the previous one is not expired. Delete the previous proposal\\n * if it is expired and not increase the `_round`.\\n */\\n function _createVotingRound(uint256 _chainId) internal returns (uint256 _round) {\\n _round = round[_chainId];\\n // Skip checking for the first ever round\\n if (_round == 0) {\\n _round = round[_chainId] = 1;\\n } else {\\n ProposalVote storage _latestProposalVote = vote[_chainId][_round];\\n bool _isExpired = _tryDeleteExpiredVotingRound(_latestProposalVote);\\n // Skip increasing round number if the latest round is expired, allow the vote to be overridden\\n if (!_isExpired) {\\n if (_latestProposalVote.status == VoteStatus.Pending) revert ErrCurrentProposalIsNotCompleted();\\n unchecked {\\n _round = ++round[_chainId];\\n }\\n }\\n }\\n }\\n\\n /**\\n * @dev Saves new round voting for the proposal `_proposalHash` of chain `_chainId`.\\n */\\n function _saveVotingRound(ProposalVote storage _vote, bytes32 _proposalHash, uint256 _expiryTimestamp) internal {\\n _vote.hash = _proposalHash;\\n _vote.expiryTimestamp = _expiryTimestamp;\\n }\\n\\n /**\\n * @dev Proposes proposal struct.\\n *\\n * Requirements:\\n * - The chain id is not equal to 0.\\n * - The proposal nonce is equal to the new round.\\n *\\n * Emits the `ProposalCreated` event.\\n *\\n */\\n function _proposeProposalStruct(Proposal.ProposalDetail memory proposal, address creator) internal virtual returns (uint256 round_) {\\n uint256 chainId = proposal.chainId;\\n if (chainId == 0) revert ErrInvalidChainId(msg.sig, 0, block.chainid);\\n proposal.validate(_proposalExpiryDuration);\\n\\n bytes32 proposalHash = proposal.hash();\\n round_ = _createVotingRound(chainId);\\n _saveVotingRound(vote[chainId][round_], proposalHash, proposal.expiryTimestamp);\\n if (round_ != proposal.nonce) revert ErrInvalidProposalNonce(msg.sig);\\n emit ProposalCreated(chainId, round_, proposalHash, proposal, creator);\\n }\\n\\n /**\\n * @dev Casts vote for the proposal with data and returns whether the voting is done.\\n *\\n * Requirements:\\n * - The proposal nonce is equal to the round.\\n * - The vote is not finalized.\\n * - The voter has not voted for the round.\\n *\\n * Emits the `ProposalVoted` event. Emits the `ProposalApproved`, `ProposalExecuted` or `ProposalRejected` once the\\n * proposal is approved, executed or rejected.\\n *\\n */\\n function _castVote(\\n Proposal.ProposalDetail memory proposal,\\n Ballot.VoteType support,\\n uint256 minimumForVoteWeight,\\n uint256 minimumAgainstVoteWeight,\\n address voter,\\n Signature memory signature,\\n uint256 voterWeight\\n ) internal virtual returns (bool done) {\\n uint256 chainId = proposal.chainId;\\n uint256 round_ = proposal.nonce;\\n ProposalVote storage _vote = vote[chainId][round_];\\n\\n if (_tryDeleteExpiredVotingRound(_vote)) {\\n return true;\\n }\\n\\n if (round[proposal.chainId] != round_) revert ErrInvalidProposalNonce(msg.sig);\\n if (_vote.status != VoteStatus.Pending) revert ErrVoteIsFinalized();\\n if (_voted(_vote, voter)) revert ErrAlreadyVoted(voter);\\n\\n _vote.voted[voter] = true;\\n // Stores the signature if it is not empty\\n if (signature.r > 0 || signature.s > 0 || signature.v > 0) {\\n _vote.sig[voter] = signature;\\n }\\n emit ProposalVoted(_vote.hash, voter, support, voterWeight);\\n\\n uint256 _forVoteWeight;\\n uint256 _againstVoteWeight;\\n if (support == Ballot.VoteType.For) {\\n _vote.forVoteds.push(voter);\\n _forVoteWeight = _vote.forVoteWeight += voterWeight;\\n } else if (support == Ballot.VoteType.Against) {\\n _vote.againstVoteds.push(voter);\\n _againstVoteWeight = _vote.againstVoteWeight += voterWeight;\\n } else {\\n revert ErrUnsupportedVoteType(msg.sig);\\n }\\n\\n if (_forVoteWeight >= minimumForVoteWeight) {\\n done = true;\\n _vote.status = VoteStatus.Approved;\\n emit ProposalApproved(_vote.hash);\\n if (proposal.isAutoExecute()) {\\n _tryExecute(_vote, proposal);\\n }\\n } else if (_againstVoteWeight >= minimumAgainstVoteWeight) {\\n done = true;\\n _vote.status = VoteStatus.Rejected;\\n emit ProposalRejected(_vote.hash);\\n }\\n }\\n\\n /**\\n * @dev The specified executor executes the proposal on an approved proposal.\\n */\\n function _executeWithCaller(Proposal.ProposalDetail memory proposal, address caller) internal {\\n bytes32 proposalHash = proposal.hash();\\n ProposalVote storage _vote = vote[proposal.chainId][proposal.nonce];\\n\\n if (_vote.hash != proposalHash) {\\n revert ErrInvalidProposal(proposalHash, _vote.hash);\\n }\\n\\n if (_vote.status != VoteStatus.Approved) revert ErrProposalNotApproved();\\n if (caller != proposal.executor) revert ErrInvalidExecutor();\\n\\n _tryExecute(_vote, proposal);\\n }\\n\\n /**\\n * @dev When the contract is on Ronin chain, checks whether the proposal is expired and delete it if is expired.\\n *\\n * Emits the event `ProposalExpired` if the vote is expired.\\n *\\n * Note: This function assumes the vote `_proposalVote` is already created, consider verifying the vote's existence\\n * before or it will emit an unexpected event of `ProposalExpired`.\\n */\\n function _tryDeleteExpiredVotingRound(ProposalVote storage proposalVote) internal returns (bool isExpired) {\\n isExpired = _getChainType() == ChainType.RoninChain && proposalVote.status == VoteStatus.Pending && proposalVote.expiryTimestamp <= block.timestamp;\\n\\n if (isExpired) {\\n emit ProposalExpired(proposalVote.hash);\\n\\n for (uint256 _i; _i < proposalVote.forVoteds.length;) {\\n delete proposalVote.voted[proposalVote.forVoteds[_i]];\\n delete proposalVote.sig[proposalVote.forVoteds[_i]];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n for (uint256 _i; _i < proposalVote.againstVoteds.length;) {\\n delete proposalVote.voted[proposalVote.againstVoteds[_i]];\\n delete proposalVote.sig[proposalVote.againstVoteds[_i]];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n delete proposalVote.status;\\n delete proposalVote.hash;\\n delete proposalVote.againstVoteWeight;\\n delete proposalVote.forVoteWeight;\\n delete proposalVote.forVoteds;\\n delete proposalVote.againstVoteds;\\n delete proposalVote.expiryTimestamp;\\n }\\n }\\n\\n /**\\n * @dev Executes the proposal and update the vote status once the proposal is executable.\\n */\\n function _tryExecute(ProposalVote storage vote_, Proposal.ProposalDetail memory proposal) internal {\\n if (proposal.executable()) {\\n vote_.status = VoteStatus.Executed;\\n (bool[] memory _successCalls, bytes[] memory _returnDatas) = proposal.execute();\\n emit ProposalExecuted(vote_.hash, _successCalls, _returnDatas);\\n }\\n }\\n\\n /**\\n * @dev Sets the expiry duration for a new proposal.\\n */\\n function _setProposalExpiryDuration(uint256 expiryDuration) internal {\\n _proposalExpiryDuration = expiryDuration;\\n emit ProposalExpiryDurationChanged(expiryDuration);\\n }\\n\\n /**\\n * @dev Returns whether the voter casted for the proposal.\\n */\\n function _voted(ProposalVote storage vote_, address voter) internal view returns (bool) {\\n return vote_.voted[voter];\\n }\\n\\n /**\\n * @dev Returns total weight from validators.\\n */\\n function _getTotalWeight() internal view virtual returns (uint256);\\n\\n /**\\n * @dev Returns minimum vote to pass a proposal.\\n */\\n function _getMinimumVoteWeight() internal view virtual returns (uint256);\\n\\n /**\\n * @dev Returns current context is running on whether Ronin chain or on mainchain.\\n */\\n function _getChainType() internal view virtual returns (ChainType);\\n}\\n\",\"keccak256\":\"0xa8dfef02fbfbda8ec1cc681a59719d1d570fb8b652f6775b7d9af9c3e32fed26\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/GlobalCoreGovernance.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../libraries/Proposal.sol\\\";\\nimport \\\"../../libraries/GlobalProposal.sol\\\";\\nimport \\\"./CoreGovernance.sol\\\";\\n\\nabstract contract GlobalCoreGovernance is CoreGovernance {\\n using Proposal for Proposal.ProposalDetail;\\n using GlobalProposal for GlobalProposal.GlobalProposalDetail;\\n\\n mapping(GlobalProposal.TargetOption => address) internal _targetOptionsMap;\\n\\n /// @dev Emitted when a proposal is created\\n event GlobalProposalCreated(\\n uint256 indexed round,\\n bytes32 indexed proposalHash,\\n Proposal.ProposalDetail proposal,\\n bytes32 globalProposalHash,\\n GlobalProposal.GlobalProposalDetail globalProposal,\\n address creator\\n );\\n\\n /// @dev Emitted when the target options are updated\\n event TargetOptionUpdated(GlobalProposal.TargetOption indexed targetOption, address indexed addr);\\n\\n function __GlobalCoreGovernance_init(GlobalProposal.TargetOption[] memory targetOptions, address[] memory addrs) internal onlyInitializing {\\n __GlobalCoreGovernance_init_unchained(targetOptions, addrs);\\n }\\n\\n function __GlobalCoreGovernance_init_unchained(GlobalProposal.TargetOption[] memory targetOptions, address[] memory addrs) internal onlyInitializing {\\n _updateTargetOption(GlobalProposal.TargetOption.BridgeManager, address(this));\\n _updateManyTargetOption(targetOptions, addrs);\\n }\\n\\n /**\\n * @dev Proposes for a global proposal.\\n *\\n * Emits the `GlobalProposalCreated` event.\\n *\\n */\\n function _proposeGlobal(\\n uint256 expiryTimestamp,\\n GlobalProposal.TargetOption[] calldata targetOptions,\\n address executor,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n uint256[] memory gasAmounts,\\n address creator\\n ) internal virtual {\\n uint256 round_ = _createVotingRound(0);\\n GlobalProposal.GlobalProposalDetail memory globalProposal =\\n GlobalProposal.GlobalProposalDetail(round_, expiryTimestamp, executor, targetOptions, values, calldatas, gasAmounts);\\n Proposal.ProposalDetail memory proposal = globalProposal.intoProposalDetail(_resolveTargets({ targetOptions: targetOptions, strict: true }));\\n proposal.validate(_proposalExpiryDuration);\\n\\n bytes32 proposalHash = proposal.hash();\\n _saveVotingRound(vote[0][round_], proposalHash, expiryTimestamp);\\n emit GlobalProposalCreated(round_, proposalHash, proposal, globalProposal.hash(), globalProposal, creator);\\n }\\n\\n /**\\n * @dev Proposes global proposal struct.\\n *\\n * Requirements:\\n * - The proposal nonce is equal to the new round.\\n *\\n * Emits the `GlobalProposalCreated` event.\\n *\\n */\\n function _proposeGlobalStruct(\\n GlobalProposal.GlobalProposalDetail memory globalProposal,\\n address creator\\n ) internal virtual returns (Proposal.ProposalDetail memory proposal) {\\n proposal = globalProposal.intoProposalDetail(_resolveTargets({ targetOptions: globalProposal.targetOptions, strict: true }));\\n proposal.validate(_proposalExpiryDuration);\\n\\n bytes32 proposalHash = proposal.hash();\\n uint256 round_ = _createVotingRound(0);\\n _saveVotingRound(vote[0][round_], proposalHash, globalProposal.expiryTimestamp);\\n\\n if (round_ != proposal.nonce) revert ErrInvalidProposalNonce(msg.sig);\\n emit GlobalProposalCreated(round_, proposalHash, proposal, globalProposal.hash(), globalProposal, creator);\\n }\\n\\n /**\\n * @dev Returns corresponding address of target options. Return address(0) on non-existent target.\\n */\\n function resolveTargets(GlobalProposal.TargetOption[] calldata targetOptions) external view returns (address[] memory targets) {\\n return _resolveTargets({ targetOptions: targetOptions, strict: false });\\n }\\n\\n /**\\n * @dev Internal helper of {resolveTargets}.\\n *\\n * @param strict When the param is set to `true`, revert on non-existent target.\\n */\\n function _resolveTargets(GlobalProposal.TargetOption[] memory targetOptions, bool strict) internal view returns (address[] memory targets) {\\n targets = new address[](targetOptions.length);\\n\\n for (uint256 i; i < targetOptions.length; ++i) {\\n targets[i] = _targetOptionsMap[targetOptions[i]];\\n if (strict && targets[i] == address(0)) revert ErrInvalidArguments(msg.sig);\\n }\\n }\\n\\n /**\\n * @dev Updates list of `targetOptions` to `targets`.\\n *\\n * Requirement:\\n * - Only allow self-call through proposal.\\n *\\n */\\n function updateManyTargetOption(GlobalProposal.TargetOption[] memory targetOptions, address[] memory targets) external {\\n // HACK: Cannot reuse the existing library due to too deep stack\\n if (msg.sender != address(this)) revert ErrOnlySelfCall(msg.sig);\\n _updateManyTargetOption(targetOptions, targets);\\n }\\n\\n /**\\n * @dev Updates list of `targetOptions` to `targets`.\\n */\\n function _updateManyTargetOption(GlobalProposal.TargetOption[] memory targetOptions, address[] memory targets) internal {\\n for (uint256 i; i < targetOptions.length; ++i) {\\n if (targets[i] == address(this)) revert ErrInvalidArguments(msg.sig);\\n _updateTargetOption(targetOptions[i], targets[i]);\\n }\\n }\\n\\n /**\\n * @dev Updates `targetOption` to `target`.\\n *\\n * Requirement:\\n * - Emit a `TargetOptionUpdated` event.\\n */\\n function _updateTargetOption(GlobalProposal.TargetOption targetOption, address target) internal {\\n _targetOptionsMap[targetOption] = target;\\n emit TargetOptionUpdated(targetOption, target);\\n }\\n}\\n\",\"keccak256\":\"0xe5db4e1b31d9ff83e8962d17a815d39e72f5945023e6309172d875b47d5a1c3d\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/governance-relay/CommonGovernanceRelay.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../CoreGovernance.sol\\\";\\n\\nabstract contract CommonGovernanceRelay is CoreGovernance {\\n using Proposal for Proposal.ProposalDetail;\\n using GlobalProposal for GlobalProposal.GlobalProposalDetail;\\n\\n /**\\n * @dev Relays votes by signatures.\\n *\\n * @notice Does not store the voter signature into storage.\\n *\\n */\\n function _relayVotesBySignatures(\\n Proposal.ProposalDetail memory _proposal,\\n Ballot.VoteType[] calldata _supports,\\n Signature[] calldata _signatures,\\n bytes32 proposalHash\\n ) internal {\\n if (!(_supports.length > 0 && _supports.length == _signatures.length)) revert ErrLengthMismatch(msg.sig);\\n\\n bytes32 _forDigest = ECDSA.toTypedDataHash(_proposalDomainSeparator(), Ballot.hash(proposalHash, Ballot.VoteType.For));\\n bytes32 _againstDigest = ECDSA.toTypedDataHash(_proposalDomainSeparator(), Ballot.hash(proposalHash, Ballot.VoteType.Against));\\n\\n address[] memory _forVoteSigners = new address[](_signatures.length);\\n address[] memory _againstVoteSigners = new address[](_signatures.length);\\n\\n {\\n uint256 _forVoteCount;\\n uint256 _againstVoteCount;\\n\\n {\\n address _signer;\\n address _lastSigner;\\n Ballot.VoteType _support;\\n Signature calldata _sig;\\n\\n for (uint256 _i; _i < _signatures.length;) {\\n _sig = _signatures[_i];\\n _support = _supports[_i];\\n\\n if (_support == Ballot.VoteType.For) {\\n _signer = ECDSA.recover(_forDigest, _sig.v, _sig.r, _sig.s);\\n _forVoteSigners[_forVoteCount++] = _signer;\\n } else if (_support == Ballot.VoteType.Against) {\\n _signer = ECDSA.recover(_againstDigest, _sig.v, _sig.r, _sig.s);\\n _againstVoteSigners[_againstVoteCount++] = _signer;\\n } else {\\n revert ErrUnsupportedVoteType(msg.sig);\\n }\\n\\n if (_lastSigner >= _signer) revert ErrInvalidOrder(msg.sig);\\n _lastSigner = _signer;\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n }\\n\\n assembly {\\n mstore(_forVoteSigners, _forVoteCount)\\n mstore(_againstVoteSigners, _againstVoteCount)\\n }\\n }\\n\\n ProposalVote storage _vote = vote[_proposal.chainId][_proposal.nonce];\\n uint256 _minimumForVoteWeight = _getMinimumVoteWeight();\\n uint256 _totalForVoteWeight = _sumWeight(_forVoteSigners);\\n if (_totalForVoteWeight >= _minimumForVoteWeight) {\\n if (_totalForVoteWeight == 0) revert ErrInvalidVoteWeight(msg.sig);\\n _vote.status = VoteStatus.Approved;\\n emit ProposalApproved(_vote.hash);\\n _tryExecute(_vote, _proposal);\\n return;\\n }\\n\\n uint256 _minimumAgainstVoteWeight = _getTotalWeight() - _minimumForVoteWeight + 1;\\n uint256 _totalAgainstVoteWeight = _sumWeight(_againstVoteSigners);\\n if (_totalAgainstVoteWeight >= _minimumAgainstVoteWeight) {\\n if (_totalAgainstVoteWeight == 0) revert ErrInvalidVoteWeight(msg.sig);\\n _vote.status = VoteStatus.Rejected;\\n emit ProposalRejected(_vote.hash);\\n return;\\n }\\n\\n revert ErrRelayFailed(msg.sig);\\n }\\n\\n /**\\n * @dev Returns the weight of the governor list.\\n */\\n function _sumWeight(address[] memory _governors) internal view virtual returns (uint256);\\n\\n function _proposalDomainSeparator() internal view virtual returns (bytes32);\\n}\\n\",\"keccak256\":\"0x48b03ea86a3e312de4242115554d2188891719bcd3a20d8e4504b03319ba6993\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/governance-relay/GlobalGovernanceRelay.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../GlobalCoreGovernance.sol\\\";\\nimport \\\"./CommonGovernanceRelay.sol\\\";\\n\\nabstract contract GlobalGovernanceRelay is CommonGovernanceRelay, GlobalCoreGovernance {\\n using GlobalProposal for GlobalProposal.GlobalProposalDetail;\\n\\n /**\\n * @dev Returns whether the voter `_voter` casted vote for the proposal.\\n */\\n function globalProposalRelayed(uint256 _round) external view returns (bool) {\\n return vote[0][_round].status != VoteStatus.Pending;\\n }\\n\\n /**\\n * @dev Relays voted global proposal.\\n *\\n * Requirements:\\n * - The relay proposal is finalized.\\n *\\n */\\n function _relayGlobalProposal(\\n GlobalProposal.GlobalProposalDetail calldata globalProposal,\\n Ballot.VoteType[] calldata supports_,\\n Signature[] calldata signatures,\\n address creator\\n ) internal {\\n Proposal.ProposalDetail memory _proposal = _proposeGlobalStruct(globalProposal, creator);\\n _relayVotesBySignatures(_proposal, supports_, signatures, globalProposal.hash());\\n }\\n}\\n\",\"keccak256\":\"0x1d168ae3300e07f3b6312c61ea3d6021a12722c7122d9f2f3f782909d47e05d4\",\"license\":\"MIT\"},\"src/extensions/sequential-governance/governance-relay/GovernanceRelay.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../CoreGovernance.sol\\\";\\nimport \\\"./CommonGovernanceRelay.sol\\\";\\n\\nabstract contract GovernanceRelay is CoreGovernance, CommonGovernanceRelay {\\n using Proposal for Proposal.ProposalDetail;\\n using GlobalProposal for GlobalProposal.GlobalProposalDetail;\\n\\n /**\\n * @dev Relays voted proposal.\\n *\\n * Requirements:\\n * - The relay proposal is finalized.\\n *\\n */\\n function _relayProposal(\\n Proposal.ProposalDetail calldata _proposal,\\n Ballot.VoteType[] calldata _supports,\\n Signature[] calldata _signatures,\\n address _creator\\n ) internal {\\n _proposeProposalStruct(_proposal, _creator);\\n _relayVotesBySignatures(_proposal, _supports, _signatures, _proposal.hash());\\n }\\n}\\n\",\"keccak256\":\"0x050da96d4079cfb515a09ee8a61d5b6c782adf4559b2c66b618bd51f41ca1cd4\",\"license\":\"MIT\"},\"src/interfaces/IQuorum.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IQuorum {\\n /// @dev Emitted when the threshold is updated\\n event ThresholdUpdated(uint256 indexed nonce, uint256 indexed numerator, uint256 indexed denominator, uint256 previousNumerator, uint256 previousDenominator);\\n\\n /**\\n * @dev Returns the threshold.\\n */\\n function getThreshold() external view returns (uint256 _num, uint256 _denom);\\n\\n /**\\n * @dev Checks whether the `_voteWeight` passes the threshold.\\n */\\n function checkThreshold(uint256 _voteWeight) external view returns (bool);\\n\\n /**\\n * @dev Returns the minimum vote weight to pass the threshold.\\n */\\n function minimumVoteWeight() external view returns (uint256);\\n\\n /**\\n * @dev Sets the threshold.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `ThresholdUpdated` event.\\n *\\n */\\n function setThreshold(uint256 numerator, uint256 denominator) external;\\n}\\n\",\"keccak256\":\"0xc924e9480f59acc9bc8c033f05d3be9451de5cee0c224d76d4542fa5b67fa10f\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IBridgeManagerEvents } from \\\"./events/IBridgeManagerEvents.sol\\\";\\n\\n/**\\n * @title IBridgeManager\\n * @dev The interface for managing bridge operators.\\n */\\ninterface IBridgeManager is IBridgeManagerEvents {\\n /// @notice Error indicating that cannot find the querying operator\\n error ErrOperatorNotFound(address operator);\\n /// @notice Error indicating that cannot find the querying governor\\n error ErrGovernorNotFound(address governor);\\n /// @notice Error indicating that the msg.sender is not match the required governor\\n error ErrGovernorNotMatch(address required, address sender);\\n /// @notice Error indicating that the governors list will go below minimum number of required governor.\\n error ErrBelowMinRequiredGovernors();\\n /// @notice Common invalid input error\\n error ErrInvalidInput();\\n\\n /**\\n * @dev The domain separator used for computing hash digests in the contract.\\n */\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n\\n /**\\n * @dev Returns the total number of bridge operators.\\n * @return The total number of bridge operators.\\n */\\n function totalBridgeOperator() external view returns (uint256);\\n\\n /**\\n * @dev Checks if the given address is a bridge operator.\\n * @param addr The address to check.\\n * @return A boolean indicating whether the address is a bridge operator.\\n */\\n function isBridgeOperator(address addr) external view returns (bool);\\n\\n /**\\n * @dev Retrieves the full information of all registered bridge operators.\\n *\\n * This external function allows external callers to obtain the full information of all the registered bridge operators.\\n * The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.\\n *\\n * @return governors An array of addresses representing the governors of each bridge operator.\\n * @return bridgeOperators An array of addresses representing the registered bridge operators.\\n * @return weights An array of uint256 values representing the vote weights of each bridge operator.\\n *\\n * Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator.\\n *\\n * Example Usage:\\n * ```\\n * (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos();\\n * for (uint256 i = 0; i < bridgeOperators.length; i++) {\\n * // Access individual information for each bridge operator.\\n * address governor = governors[i];\\n * address bridgeOperator = bridgeOperators[i];\\n * uint256 weight = weights[i];\\n * // ... (Process or use the information as required) ...\\n * }\\n * ```\\n *\\n */\\n function getFullBridgeOperatorInfos() external view returns (address[] memory governors, address[] memory bridgeOperators, uint96[] memory weights);\\n\\n /**\\n * @dev Returns total weights of the governor list.\\n */\\n function sumGovernorsWeight(address[] calldata governors) external view returns (uint256 sum);\\n\\n /**\\n * @dev Returns total weights.\\n */\\n function getTotalWeight() external view returns (uint256);\\n\\n /**\\n * @dev Returns an array of all bridge operators.\\n * @return An array containing the addresses of all bridge operators.\\n */\\n function getBridgeOperators() external view returns (address[] memory);\\n\\n /**\\n * @dev Returns the corresponding `operator` of a `governor`.\\n */\\n function getOperatorOf(address governor) external view returns (address operator);\\n\\n /**\\n * @dev Returns the corresponding `governor` of a `operator`.\\n */\\n function getGovernorOf(address operator) external view returns (address governor);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific governor.\\n * @param governor The address of the governor to get the vote weight for.\\n * @return voteWeight The vote weight of the specified governor.\\n */\\n function getGovernorWeight(address governor) external view returns (uint96);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific bridge operator.\\n * @param bridgeOperator The address of the bridge operator to get the vote weight for.\\n * @return weight The vote weight of the specified bridge operator.\\n */\\n function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint96 weight);\\n\\n /**\\n * @dev Returns the weights of a list of governor addresses.\\n */\\n function getGovernorWeights(address[] calldata governors) external view returns (uint96[] memory weights);\\n\\n /**\\n * @dev Returns an array of all governors.\\n * @return An array containing the addresses of all governors.\\n */\\n function getGovernors() external view returns (address[] memory);\\n\\n /**\\n * @dev Adds multiple bridge operators.\\n * @param governors An array of addresses of hot/cold wallets for bridge operator to update their node address.\\n * @param bridgeOperators An array of addresses representing the bridge operators to add.\\n */\\n function addBridgeOperators(uint96[] calldata voteWeights, address[] calldata governors, address[] calldata bridgeOperators) external;\\n\\n /**\\n * @dev Removes multiple bridge operators.\\n * @param bridgeOperators An array of addresses representing the bridge operators to remove.\\n */\\n function removeBridgeOperators(address[] calldata bridgeOperators) external;\\n\\n /**\\n * @dev Self-call to update the minimum required governor.\\n * @param min The minimum number, this must not less than 3.\\n */\\n function setMinRequiredGovernor(uint min) external;\\n}\\n\",\"keccak256\":\"0xefc46318a240371031e77ef3c355e2c18432e4479145378de6782277f9b44923\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManagerCallback.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @title IBridgeManagerCallback\\n * @dev Interface for the callback functions to be implemented by the Bridge Manager contract.\\n */\\ninterface IBridgeManagerCallback is IERC165 {\\n /**\\n * @dev Handles the event when bridge operators are added.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @param addeds The corresponding boolean values indicating whether the operators were added or not.\\n * @return selector The selector of the function being called.\\n */\\n function onBridgeOperatorsAdded(address[] memory bridgeOperators, uint96[] calldata weights, bool[] memory addeds) external returns (bytes4 selector);\\n\\n /**\\n * @dev Handles the event when bridge operators are removed.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @param removeds The corresponding boolean values indicating whether the operators were removed or not.\\n * @return selector The selector of the function being called.\\n */\\n function onBridgeOperatorsRemoved(address[] memory bridgeOperators, bool[] memory removeds) external returns (bytes4 selector);\\n}\\n\",\"keccak256\":\"0x6c8ce7e2478e28c5ed5e6f5d8305a77d6d5f9125a47adfb77632940b9a0f3625\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManagerCallbackRegister.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeManagerCallbackRegister {\\n error ErrExistOneInternalCallFailed(address sender, bytes4 msgSig, bytes callData);\\n\\n event CallbackRegistered(address, bool);\\n /**\\n * @dev Emitted when the contract notifies multiple registers with statuses and return data.\\n */\\n event Notified(bytes callData, address[] registers, bool[] statuses, bytes[] returnDatas);\\n\\n /**\\n * @dev Retrieves the addresses of registered callbacks.\\n * @return registers An array containing the addresses of registered callbacks.\\n */\\n function getCallbackRegisters() external view returns (address[] memory registers);\\n\\n /**\\n * @dev Registers multiple callbacks with the bridge.\\n * @param registers The array of callback addresses to register.\\n */\\n function registerCallbacks(address[] calldata registers) external;\\n\\n /**\\n * @dev Unregisters multiple callbacks from the bridge.\\n * @param registers The array of callback addresses to unregister.\\n */\\n function unregisterCallbacks(address[] calldata registers) external;\\n}\\n\",\"keccak256\":\"0x493f7a40fc058eb6654a636316be99c2ddd9ee26ee215ff86c7107a7fa20ff97\",\"license\":\"MIT\"},\"src/interfaces/bridge/events/IBridgeManagerEvents.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeManagerEvents {\\n /**\\n * @dev Emitted when new bridge operators are added.\\n */\\n event BridgeOperatorsAdded(bool[] statuses, uint96[] voteWeights, address[] governors, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is failed to add.\\n */\\n event BridgeOperatorAddingFailed(address indexed operator);\\n\\n /**\\n * @dev Emitted when bridge operators are removed.\\n */\\n event BridgeOperatorsRemoved(bool[] statuses, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is failed to remove.\\n */\\n event BridgeOperatorRemovingFailed(address indexed operator);\\n\\n /**\\n * @dev Emitted when a bridge operator is updated.\\n */\\n event BridgeOperatorUpdated(address indexed governor, address indexed fromBridgeOperator, address indexed toBridgeOperator);\\n\\n /**\\n * @dev Emitted when the minimum number of required governors is updated.\\n */\\n event MinRequiredGovernorUpdated(uint min);\\n}\\n\",\"keccak256\":\"0x38bc3709c98a7c08fb9b6fa3e07a725903dcb0bd07de8a828bac6c3bcf7d997d\",\"license\":\"MIT\"},\"src/interfaces/collections/IHasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport { ContractType } from \\\"../../utils/ContractType.sol\\\";\\n\\ninterface IHasContracts {\\n /// @dev Error of invalid role.\\n error ErrContractTypeNotFound(ContractType contractType);\\n\\n /// @dev Emitted when a contract is updated.\\n event ContractUpdated(ContractType indexed contractType, address indexed addr);\\n\\n /**\\n * @dev Returns the address of a contract with a specific role.\\n * Throws an error if no contract is set for the specified role.\\n *\\n * @param contractType The role of the contract to retrieve.\\n * @return contract_ The address of the contract with the specified role.\\n */\\n function getContract(ContractType contractType) external view returns (address contract_);\\n\\n /**\\n * @dev Sets the address of a contract with a specific role.\\n * Emits the event {ContractUpdated}.\\n * @param contractType The role of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function setContract(ContractType contractType, address addr) external;\\n}\\n\",\"keccak256\":\"0x99d8213d857e30d367155abd15dc42730afdfbbac3a22dfb3b95ffea2083a92e\",\"license\":\"MIT\"},\"src/interfaces/consumers/ChainTypeConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface ChainTypeConsumer {\\n enum ChainType {\\n RoninChain,\\n Mainchain\\n }\\n}\\n\",\"keccak256\":\"0xe0d20e00c8d237f8e0fb881abf1ff1ef114173bcb428f06f689c581666a22db7\",\"license\":\"MIT\"},\"src/interfaces/consumers/SignatureConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface SignatureConsumer {\\n struct Signature {\\n uint8 v;\\n bytes32 r;\\n bytes32 s;\\n }\\n}\\n\",\"keccak256\":\"0xd370e350722067097dec1a5c31bda6e47e83417fa5c3288293bb910028cd136b\",\"license\":\"MIT\"},\"src/interfaces/consumers/VoteStatusConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface VoteStatusConsumer {\\n enum VoteStatus {\\n Pending,\\n Approved,\\n Executed,\\n Rejected,\\n Expired\\n }\\n}\\n\",\"keccak256\":\"0xa5045232c0c053fcf31fb3fe71942344444159c48d5f1b2063dbb06b6a1c9752\",\"license\":\"MIT\"},\"src/libraries/AddressArrayUtils.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\nlibrary AddressArrayUtils {\\n /**\\n * @dev Error thrown when a duplicated element is detected in an array.\\n * @param msgSig The function signature that invoke the error.\\n */\\n error ErrDuplicated(bytes4 msgSig);\\n\\n /**\\n * @dev Returns whether or not there's a duplicate. Runs in O(n^2).\\n * @param A Array to search\\n * @return Returns true if duplicate, false otherwise\\n */\\n function hasDuplicate(address[] memory A) internal pure returns (bool) {\\n if (A.length == 0) {\\n return false;\\n }\\n unchecked {\\n for (uint256 i = 0; i < A.length - 1; i++) {\\n for (uint256 j = i + 1; j < A.length; j++) {\\n if (A[i] == A[j]) {\\n return true;\\n }\\n }\\n }\\n }\\n return false;\\n }\\n\\n /**\\n * @dev Returns whether two arrays of addresses are equal or not.\\n */\\n function isEqual(address[] memory _this, address[] memory _other) internal pure returns (bool yes_) {\\n // Hashing two arrays and compare their hash\\n assembly {\\n let _thisHash := keccak256(add(_this, 32), mul(mload(_this), 32))\\n let _otherHash := keccak256(add(_other, 32), mul(mload(_other), 32))\\n yes_ := eq(_thisHash, _otherHash)\\n }\\n }\\n\\n /**\\n * @dev Return the concatenated array from a and b.\\n */\\n function extend(address[] memory a, address[] memory b) internal pure returns (address[] memory c) {\\n uint256 lengthA = a.length;\\n uint256 lengthB = b.length;\\n unchecked {\\n c = new address[](lengthA + lengthB);\\n }\\n uint256 i;\\n for (; i < lengthA;) {\\n c[i] = a[i];\\n unchecked {\\n ++i;\\n }\\n }\\n for (uint256 j; j < lengthB;) {\\n c[i] = b[j];\\n unchecked {\\n ++i;\\n ++j;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce5d578861167da47a965c8a0e1592b808aad6eb79ccb1873bf2e2280ddb85ee\",\"license\":\"UNLICENSED\"},\"src/libraries/Ballot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\n\\nlibrary Ballot {\\n using ECDSA for bytes32;\\n\\n enum VoteType {\\n For,\\n Against\\n }\\n\\n // keccak256(\\\"Ballot(bytes32 proposalHash,uint8 support)\\\");\\n bytes32 private constant BALLOT_TYPEHASH = 0xd900570327c4c0df8dd6bdd522b7da7e39145dd049d2fd4602276adcd511e3c2;\\n\\n function hash(bytes32 _proposalHash, VoteType _support) internal pure returns (bytes32 digest) {\\n // return keccak256(abi.encode(BALLOT_TYPEHASH, _proposalHash, _support));\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, BALLOT_TYPEHASH)\\n mstore(add(ptr, 0x20), _proposalHash)\\n mstore(add(ptr, 0x40), _support)\\n digest := keccak256(ptr, 0x60)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xaa1e66bcd86baa6f18c7c5e9b67496535f229cbd2e2ecb4c66bcbfed2b1365de\",\"license\":\"MIT\"},\"src/libraries/GlobalProposal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./Proposal.sol\\\";\\n\\nlibrary GlobalProposal {\\n /**\\n * @dev Error thrown when attempting to interact with an unsupported target.\\n */\\n error ErrUnsupportedTarget(bytes32 proposalHash, uint256 targetNumber);\\n\\n enum TargetOption {\\n BridgeManager, // 0\\n GatewayContract, // 1\\n BridgeReward, // 2\\n BridgeSlash, // 3\\n BridgeTracking, // 4\\n PauseEnforcer // 5\\n\\n }\\n\\n struct GlobalProposalDetail {\\n // Nonce to make sure proposals are executed in order\\n uint256 nonce;\\n uint256 expiryTimestamp;\\n address executor;\\n TargetOption[] targetOptions;\\n uint256[] values;\\n bytes[] calldatas;\\n uint256[] gasAmounts;\\n }\\n\\n // keccak256(\\\"GlobalProposalDetail(uint256 nonce,uint256 expiryTimestamp,address executor,uint8[] targetOptions,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)\\\");\\n bytes32 internal constant TYPE_HASH = 0xde480f0c53a3651c08fbab1dffbc45fe574f31188827fe52cb9035da9fe57e4a;\\n\\n /**\\n * @dev Returns struct hash of the proposal.\\n */\\n function hash(GlobalProposalDetail memory self) internal pure returns (bytes32 digest_) {\\n uint256[] memory values = self.values;\\n TargetOption[] memory targets = self.targetOptions;\\n bytes32[] memory calldataHashList = new bytes32[](self.calldatas.length);\\n uint256[] memory gasAmounts = self.gasAmounts;\\n\\n for (uint256 i; i < calldataHashList.length;) {\\n calldataHashList[i] = keccak256(self.calldatas[i]);\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n /*\\n * return\\n * keccak256(\\n * abi.encode(\\n * TYPE_HASH,\\n * proposal.nonce,\\n * proposal.expiryTimestamp,\\n * proposal.executor,\\n * targetsHash,\\n * valuesHash,\\n * calldatasHash,\\n * gasAmountsHash\\n * )\\n * );\\n */\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, TYPE_HASH)\\n mstore(add(ptr, 0x20), mload(self)) // proposal.nonce\\n mstore(add(ptr, 0x40), mload(add(self, 0x20))) // proposal.expiryTimestamp\\n mstore(add(ptr, 0x60), mload(add(self, 0x40))) // proposal.executor\\n\\n let arrayHashed\\n arrayHashed := keccak256(add(targets, 32), mul(mload(targets), 32)) // targetsHash\\n mstore(add(ptr, 0x80), arrayHashed)\\n arrayHashed := keccak256(add(values, 32), mul(mload(values), 32)) // valuesHash\\n mstore(add(ptr, 0xa0), arrayHashed)\\n arrayHashed := keccak256(add(calldataHashList, 32), mul(mload(calldataHashList), 32)) // calldatasHash\\n mstore(add(ptr, 0xc0), arrayHashed)\\n arrayHashed := keccak256(add(gasAmounts, 32), mul(mload(gasAmounts), 32)) // gasAmountsHash\\n mstore(add(ptr, 0xe0), arrayHashed)\\n digest_ := keccak256(ptr, 0x100)\\n }\\n }\\n\\n /**\\n * @dev Converts into the normal proposal.\\n */\\n function intoProposalDetail(GlobalProposalDetail memory self, address[] memory targets) internal pure returns (Proposal.ProposalDetail memory detail_) {\\n detail_.nonce = self.nonce;\\n detail_.chainId = 0;\\n detail_.expiryTimestamp = self.expiryTimestamp;\\n detail_.executor = self.executor;\\n\\n detail_.targets = new address[](self.targetOptions.length);\\n detail_.values = self.values;\\n detail_.calldatas = self.calldatas;\\n detail_.gasAmounts = self.gasAmounts;\\n\\n for (uint256 i; i < self.targetOptions.length; ++i) {\\n detail_.targets[i] = targets[i];\\n }\\n }\\n}\\n\",\"keccak256\":\"0x76d362e1a4c8ef6d1aac45aae0f443a218cb256176ad5fbe952b2ff7c2132e6e\",\"license\":\"MIT\"},\"src/libraries/Proposal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ErrInvalidChainId, ErrLengthMismatch } from \\\"../utils/CommonErrors.sol\\\";\\n\\nlibrary Proposal {\\n /**\\n * @dev Error thrown when there is insufficient gas to execute a function.\\n */\\n error ErrInsufficientGas(bytes32 proposalHash);\\n\\n /**\\n * @dev Error thrown when an invalid expiry timestamp is provided.\\n */\\n error ErrInvalidExpiryTimestamp();\\n\\n /**\\n * @dev Error thrown when the proposal reverts when execute the internal call no. `callIndex` with revert message is `revertMsg`.\\n */\\n error ErrLooseProposalInternallyRevert(uint256 callIndex, bytes revertMsg);\\n\\n struct ProposalDetail {\\n // Nonce to make sure proposals are executed in order\\n uint256 nonce;\\n // Value 0: all chain should run this proposal\\n // Other values: only specific chain has to execute\\n uint256 chainId;\\n uint256 expiryTimestamp;\\n // The address that execute the proposal after the proposal passes.\\n // Leave this address as address(0) to auto-execute by the last valid vote.\\n address executor;\\n address[] targets;\\n uint256[] values;\\n bytes[] calldatas;\\n uint256[] gasAmounts;\\n }\\n\\n // keccak256(\\\"ProposalDetail(uint256 nonce,uint256 chainId,uint256 expiryTimestamp,address executor,address[] targets,uint256[] values,bytes[] calldatas,uint256[] gasAmounts)\\\");\\n bytes32 internal constant TYPE_HASH = 0x1b59eeec7c321899dc1e7a5b3d876c9a445dffc6d2f96ba842d7489908fdee12;\\n\\n /**\\n * @dev Validates the proposal.\\n */\\n function validate(ProposalDetail memory proposal, uint256 maxExpiryDuration) internal view {\\n if (\\n !(\\n proposal.targets.length > 0 && proposal.targets.length == proposal.values.length && proposal.targets.length == proposal.calldatas.length\\n && proposal.targets.length == proposal.gasAmounts.length\\n )\\n ) {\\n revert ErrLengthMismatch(msg.sig);\\n }\\n\\n if (proposal.expiryTimestamp > block.timestamp + maxExpiryDuration) {\\n revert ErrInvalidExpiryTimestamp();\\n }\\n }\\n\\n /**\\n * @dev Returns struct hash of the proposal.\\n */\\n function hash(ProposalDetail memory proposal) internal pure returns (bytes32 digest_) {\\n uint256[] memory values = proposal.values;\\n address[] memory targets = proposal.targets;\\n bytes32[] memory calldataHashList = new bytes32[](proposal.calldatas.length);\\n uint256[] memory gasAmounts = proposal.gasAmounts;\\n\\n for (uint256 i; i < calldataHashList.length; ++i) {\\n calldataHashList[i] = keccak256(proposal.calldatas[i]);\\n }\\n\\n // return\\n // keccak256(\\n // abi.encode(\\n // TYPE_HASH,\\n // proposal.nonce,\\n // proposal.chainId,\\n // proposal.expiryTimestamp\\n // proposal.executor\\n // targetsHash,\\n // valuesHash,\\n // calldatasHash,\\n // gasAmountsHash\\n // )\\n // );\\n // /\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, TYPE_HASH)\\n mstore(add(ptr, 0x20), mload(proposal)) // proposal.nonce\\n mstore(add(ptr, 0x40), mload(add(proposal, 0x20))) // proposal.chainId\\n mstore(add(ptr, 0x60), mload(add(proposal, 0x40))) // proposal.expiryTimestamp\\n mstore(add(ptr, 0x80), mload(add(proposal, 0x60))) // proposal.executor\\n\\n let arrayHashed\\n arrayHashed := keccak256(add(targets, 32), mul(mload(targets), 32)) // targetsHash\\n mstore(add(ptr, 0xa0), arrayHashed)\\n arrayHashed := keccak256(add(values, 32), mul(mload(values), 32)) // valuesHash\\n mstore(add(ptr, 0xc0), arrayHashed)\\n arrayHashed := keccak256(add(calldataHashList, 32), mul(mload(calldataHashList), 32)) // calldatasHash\\n mstore(add(ptr, 0xe0), arrayHashed)\\n arrayHashed := keccak256(add(gasAmounts, 32), mul(mload(gasAmounts), 32)) // gasAmountsHash\\n mstore(add(ptr, 0x100), arrayHashed)\\n digest_ := keccak256(ptr, 0x120)\\n }\\n }\\n\\n /**\\n * @dev Returns whether the proposal is auto-executed on the last valid vote.\\n */\\n function isAutoExecute(ProposalDetail memory proposal) internal pure returns (bool) {\\n return proposal.executor == address(0);\\n }\\n\\n /**\\n * @dev Returns whether the proposal is executable for the current chain.\\n *\\n * @notice Does not check whether the call result is successful or not. Please use `execute` instead.\\n *\\n */\\n function executable(ProposalDetail memory proposal) internal view returns (bool result) {\\n return proposal.chainId == 0 || proposal.chainId == block.chainid;\\n }\\n\\n /**\\n * @dev Executes the proposal.\\n */\\n function execute(ProposalDetail memory proposal) internal returns (bool[] memory successCalls, bytes[] memory returnDatas) {\\n if (!executable(proposal)) revert ErrInvalidChainId(msg.sig, proposal.chainId, block.chainid);\\n\\n successCalls = new bool[](proposal.targets.length);\\n returnDatas = new bytes[](proposal.targets.length);\\n for (uint256 i = 0; i < proposal.targets.length; ++i) {\\n if (gasleft() <= proposal.gasAmounts[i]) revert ErrInsufficientGas(hash(proposal));\\n\\n (successCalls[i], returnDatas[i]) = proposal.targets[i].call{ value: proposal.values[i], gas: proposal.gasAmounts[i] }(proposal.calldatas[i]);\\n\\n if (!successCalls[i]) {\\n revert ErrLooseProposalInternallyRevert(i, returnDatas[i]);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0ef21852c8a90ebf3ec4d4cc11acd9b6aa1fd932fb6858b2f6cdd3722fab6cb1\",\"license\":\"MIT\"},\"src/mainchain/MainchainBridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { CoreGovernance } from \\\"../extensions/sequential-governance/CoreGovernance.sol\\\";\\nimport { GlobalCoreGovernance, GlobalGovernanceRelay } from \\\"../extensions/sequential-governance/governance-relay/GlobalGovernanceRelay.sol\\\";\\nimport { GovernanceRelay } from \\\"../extensions/sequential-governance/governance-relay/GovernanceRelay.sol\\\";\\nimport { ContractType, BridgeManager } from \\\"../extensions/bridge-operator-governance/BridgeManager.sol\\\";\\nimport { Ballot } from \\\"../libraries/Ballot.sol\\\";\\nimport { Proposal } from \\\"../libraries/Proposal.sol\\\";\\nimport { GlobalProposal } from \\\"../libraries/GlobalProposal.sol\\\";\\nimport \\\"../utils/CommonErrors.sol\\\";\\n\\ncontract MainchainBridgeManager is BridgeManager, GovernanceRelay, GlobalGovernanceRelay {\\n uint256 private constant DEFAULT_EXPIRY_DURATION = 1 << 255;\\n\\n function initialize(\\n uint256 num,\\n uint256 denom,\\n uint256 roninChainId,\\n address bridgeContract,\\n address[] memory callbackRegisters,\\n address[] memory bridgeOperators,\\n address[] memory governors,\\n uint96[] memory voteWeights,\\n GlobalProposal.TargetOption[] memory targetOptions,\\n address[] memory targets\\n ) external initializer {\\n __CoreGovernance_init(DEFAULT_EXPIRY_DURATION);\\n __GlobalCoreGovernance_init(targetOptions, targets);\\n __BridgeManager_init(num, denom, roninChainId, bridgeContract, callbackRegisters, bridgeOperators, governors, voteWeights);\\n }\\n\\n /**\\n * @dev See `GovernanceRelay-_relayProposal`.\\n *\\n * Requirements:\\n * - The method caller is governor.\\n */\\n function relayProposal(\\n Proposal.ProposalDetail calldata proposal,\\n Ballot.VoteType[] calldata supports_,\\n Signature[] calldata signatures\\n ) external onlyGovernor {\\n _requireExecutor(proposal.executor, msg.sender);\\n _relayProposal(proposal, supports_, signatures, msg.sender);\\n }\\n\\n /**\\n * @dev See `GovernanceRelay-_relayGlobalProposal`.\\n *\\n * Requirements:\\n * - The method caller is governor.\\n */\\n function relayGlobalProposal(\\n GlobalProposal.GlobalProposalDetail calldata globalProposal,\\n Ballot.VoteType[] calldata supports_,\\n Signature[] calldata signatures\\n ) external onlyGovernor {\\n _requireExecutor(globalProposal.executor, msg.sender);\\n _relayGlobalProposal({ globalProposal: globalProposal, supports_: supports_, signatures: signatures, creator: msg.sender });\\n }\\n\\n function _requireExecutor(address executor, address caller) internal pure {\\n if (executor != address(0) && caller != executor) {\\n revert ErrNonExecutorCannotRelay(executor, caller);\\n }\\n }\\n\\n /**\\n * @dev Internal function to retrieve the minimum vote weight required for governance actions.\\n * @return minimumVoteWeight The minimum vote weight required for governance actions.\\n */\\n function _getMinimumVoteWeight() internal view override returns (uint256) {\\n return minimumVoteWeight();\\n }\\n\\n /**\\n * @dev Returns the expiry duration for a new proposal.\\n */\\n function getProposalExpiryDuration() external view returns (uint256) {\\n return _proposalExpiryDuration;\\n }\\n\\n /**\\n * @dev Internal function to retrieve the total weights of all governors.\\n * @return totalWeights The total weights of all governors combined.\\n */\\n function _getTotalWeight() internal view override returns (uint256) {\\n return getTotalWeight();\\n }\\n\\n /**\\n * @dev Internal function to calculate the sum of weights for a given array of governors.\\n * @param governors An array containing the addresses of governors to calculate the sum of weights.\\n * @return sumWeights The sum of weights for the provided governors.\\n */\\n function _sumWeight(address[] memory governors) internal view override returns (uint256) {\\n return _sumGovernorsWeight(governors);\\n }\\n\\n /**\\n * @dev Internal function to retrieve the chain type of the contract.\\n * @return chainType The chain type, indicating the type of the chain the contract operates on (e.g., Mainchain).\\n */\\n function _getChainType() internal pure override returns (ChainType) {\\n return ChainType.Mainchain;\\n }\\n\\n function _proposalDomainSeparator() internal view override returns (bytes32) {\\n return DOMAIN_SEPARATOR;\\n }\\n}\\n\",\"keccak256\":\"0xea177997b7100f310369b8fd530ea48ab823b06a53424c14f150cef723584c02\",\"license\":\"MIT\"},\"src/types/Types.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.17;\\n\\nimport { LibTUint256Slot } from \\\"./operations/LibTUint256Slot.sol\\\";\\n\\ntype TUint256Slot is bytes32;\\n\\nusing {\\n LibTUint256Slot.add,\\n LibTUint256Slot.sub,\\n LibTUint256Slot.mul,\\n LibTUint256Slot.div,\\n LibTUint256Slot.load,\\n LibTUint256Slot.store,\\n LibTUint256Slot.addAssign,\\n LibTUint256Slot.subAssign,\\n LibTUint256Slot.preDecrement,\\n LibTUint256Slot.postDecrement,\\n LibTUint256Slot.preIncrement,\\n LibTUint256Slot.postIncrement\\n} for TUint256Slot global;\\n\",\"keccak256\":\"0x20ab58f1c9ae4936f9dd9891d064301d78ef508c1dd2ce0c19a7b5b81d530e36\",\"license\":\"MIT\"},\"src/types/operations/LibTUint256Slot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.17;\\n\\nimport { TUint256Slot } from \\\"../Types.sol\\\";\\n\\n/**\\n * @title LibTUint256Slot\\n * @dev Library for handling unsigned 256-bit integers.\\n */\\nlibrary LibTUint256Slot {\\n /// @dev value is equal to bytes4(keccak256(\\\"Panic(uint256)\\\"))\\n /// @dev see: https://github.com/foundry-rs/forge-std/blob/master/src/StdError.sol\\n uint256 private constant PANIC_ERROR_SIGNATURE = 0x4e487b71;\\n /// @dev error code for {Arithmetic over/underflow} error\\n uint256 private constant ARITHMETIC_ERROR_CODE = 0x11;\\n /// @dev error code for {Division or modulo by 0} error\\n uint256 private constant DIVISION_ERROR_CODE = 0x12;\\n\\n /**\\n * @dev Loads the value of the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @return val The loaded value.\\n */\\n function load(TUint256Slot self) internal view returns (uint256 val) {\\n assembly {\\n val := sload(self)\\n }\\n }\\n\\n /**\\n * @dev Stores a value into the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @param other The value to be stored.\\n */\\n function store(TUint256Slot self, uint256 other) internal {\\n assembly {\\n sstore(self, other)\\n }\\n }\\n\\n /**\\n * @dev Multiplies the TUint256Slot variable by a given value.\\n * @param self The TUint256Slot variable.\\n * @param other The value to multiply by.\\n * @return res The resulting value after multiplication.\\n */\\n function mul(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n if iszero(iszero(storedVal)) {\\n res := mul(storedVal, other)\\n\\n // Overflow check\\n if iszero(eq(other, div(res, storedVal))) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, ARITHMETIC_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n }\\n }\\n }\\n\\n /**\\n * @dev Divides the TUint256Slot variable by a given value.\\n * @param self The TUint256Slot variable.\\n * @param other The value to divide by.\\n * @return res The resulting value after division.\\n */\\n function div(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n // revert if divide by zero\\n if iszero(other) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, DIVISION_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n res := div(storedVal, other)\\n }\\n }\\n\\n /**\\n * @dev Subtracts a given value from the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @param other The value to subtract.\\n * @return res The resulting value after subtraction.\\n */\\n function sub(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n\\n // Underflow check\\n if lt(storedVal, other) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, ARITHMETIC_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n\\n res := sub(storedVal, other)\\n }\\n }\\n\\n /**\\n * @dev Adds a given value to the TUint256Slot variable.\\n * @param self The TUint256Slot variable.\\n * @param other The value to add.\\n * @return res The resulting value after addition.\\n */\\n function add(TUint256Slot self, uint256 other) internal view returns (uint256 res) {\\n assembly {\\n let storedVal := sload(self)\\n res := add(storedVal, other)\\n\\n // Overflow check\\n if lt(res, other) {\\n // Store 4 bytes the function selector of Panic(uint256)\\n // Equivalent to revert Panic(uint256)\\n mstore(0x00, PANIC_ERROR_SIGNATURE)\\n // Store 4 bytes of division error code in the next slot\\n mstore(0x20, ARITHMETIC_ERROR_CODE)\\n // Revert 36 bytes of error starting from 0x1c\\n revert(0x1c, 0x24)\\n }\\n }\\n }\\n\\n /**\\n * @dev Increments the TUint256Slot variable by 1 and returns the new value.\\n * @param self The TUint256Slot variable.\\n * @return res The resulting value after incrementing.\\n */\\n function preIncrement(TUint256Slot self) internal returns (uint256 res) {\\n res = addAssign(self, 1);\\n }\\n\\n /**\\n * @dev Increments the TUint256Slot variable by 1 and returns the original value.\\n * @param self The TUint256Slot variable.\\n * @return res The original value before incrementing.\\n */\\n function postIncrement(TUint256Slot self) internal returns (uint256 res) {\\n res = load(self);\\n store(self, res + 1);\\n }\\n\\n /**\\n * @dev Decrements the TUint256Slot variable by 1 and returns the new value.\\n * @param self The TUint256Slot variable.\\n * @return res The resulting value after decrementing.\\n */\\n function preDecrement(TUint256Slot self) internal returns (uint256 res) {\\n res = subAssign(self, 1);\\n }\\n\\n /**\\n * @dev Decrements the TUint256Slot variable by 1 and returns the new value.\\n * @param self The TUint256Slot variable.\\n * @return res The resulting value before decrementing.\\n */\\n function postDecrement(TUint256Slot self) internal returns (uint256 res) {\\n res = load(self);\\n store(self, res - 1);\\n }\\n\\n /**\\n * @dev Adds a given value to the TUint256Slot variable and stores the result.\\n * @param self The TUint256Slot variable.\\n * @param other The value to add.\\n * @return res The resulting value after addition and storage.\\n */\\n function addAssign(TUint256Slot self, uint256 other) internal returns (uint256 res) {\\n store(self, res = add(self, other));\\n }\\n\\n /**\\n * @dev Subtracts a given value from the TUint256Slot variable and stores the result.\\n * @param self The TUint256Slot variable.\\n * @param other The value to subtract.\\n * @return res The resulting value after subtraction and storage.\\n */\\n function subAssign(TUint256Slot self, uint256 other) internal returns (uint256 res) {\\n store(self, res = sub(self, other));\\n }\\n}\\n\",\"keccak256\":\"0xe10c089459baf373494d76b00e582d49f6e43c500ab0f1657d53afc2fa472cbb\",\"license\":\"MIT\"},\"src/utils/CommonErrors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ContractType } from \\\"./ContractType.sol\\\";\\nimport { RoleAccess } from \\\"./RoleAccess.sol\\\";\\n\\nerror ErrSyncTooFarPeriod(uint256 period, uint256 latestRewardedPeriod);\\n/**\\n * @dev Error thrown when an address is expected to be an already created externally owned account (EOA).\\n * This error indicates that the provided address is invalid for certain contract operations that require already created EOA.\\n */\\nerror ErrAddressIsNotCreatedEOA(address addr, bytes32 codehash);\\n/**\\n * @dev Error raised when a bridge operator update operation fails.\\n * @param bridgeOperator The address of the bridge operator that failed to update.\\n */\\nerror ErrBridgeOperatorUpdateFailed(address bridgeOperator);\\n/**\\n * @dev Error thrown when attempting to add a bridge operator that already exists in the contract.\\n * This error indicates that the provided bridge operator address is already registered as a bridge operator in the contract.\\n */\\nerror ErrBridgeOperatorAlreadyExisted(address bridgeOperator);\\n/**\\n * @dev The error indicating an unsupported interface.\\n * @param interfaceId The bytes4 interface identifier that is not supported.\\n * @param addr The address where the unsupported interface was encountered.\\n */\\nerror ErrUnsupportedInterface(bytes4 interfaceId, address addr);\\n/**\\n * @dev Error thrown when the return data from a callback function is invalid.\\n * @param callbackFnSig The signature of the callback function that returned invalid data.\\n * @param register The address of the register where the callback function was invoked.\\n * @param returnData The invalid return data received from the callback function.\\n */\\nerror ErrInvalidReturnData(bytes4 callbackFnSig, address register, bytes returnData);\\n/**\\n * @dev Error of set to non-contract.\\n */\\nerror ErrZeroCodeContract(address addr);\\n/**\\n * @dev Error indicating that arguments are invalid.\\n */\\nerror ErrInvalidArguments(bytes4 msgSig);\\n/**\\n * @dev Error indicating that given address is null when it should not.\\n */\\nerror ErrZeroAddress(bytes4 msgSig);\\n/**\\n * @dev Error indicating that the provided threshold is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that the invalid threshold applies to.\\n */\\nerror ErrInvalidThreshold(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a function can only be called by the contract itself.\\n * @param msgSig The function signature (bytes4) that can only be called by the contract itself.\\n */\\nerror ErrOnlySelfCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n * @param expectedRole The role required to perform the function.\\n */\\nerror ErrUnauthorized(bytes4 msgSig, RoleAccess expectedRole);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n */\\nerror ErrUnauthorizedCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4).\\n * @param expectedContractType The contract type required to perform the function.\\n * @param actual The actual address that called to the function.\\n */\\nerror ErrUnexpectedInternalCall(bytes4 msgSig, ContractType expectedContractType, address actual);\\n\\n/**\\n * @dev Error indicating that an array is empty when it should contain elements.\\n */\\nerror ErrEmptyArray();\\n\\n/**\\n * @dev Error indicating a mismatch in the length of input parameters or arrays for a specific function.\\n * @param msgSig The function signature (bytes4) that has a length mismatch.\\n */\\nerror ErrLengthMismatch(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a proxy call to an external contract has failed.\\n * @param msgSig The function signature (bytes4) of the proxy call that failed.\\n * @param extCallSig The function signature (bytes4) of the external contract call that failed.\\n */\\nerror ErrProxyCallFailed(bytes4 msgSig, bytes4 extCallSig);\\n\\n/**\\n * @dev Error indicating that a function tried to call a precompiled contract that is not allowed.\\n * @param msgSig The function signature (bytes4) that attempted to call a precompiled contract.\\n */\\nerror ErrCallPrecompiled(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a native token transfer has failed.\\n * @param msgSig The function signature (bytes4) of the token transfer that failed.\\n */\\nerror ErrNativeTransferFailed(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that an order is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid order.\\n */\\nerror ErrInvalidOrder(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the chain ID is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid chain ID.\\n * @param actual Current chain ID that executing function.\\n * @param expected Expected chain ID required for the tx to success.\\n */\\nerror ErrInvalidChainId(bytes4 msgSig, uint256 actual, uint256 expected);\\n\\n/**\\n * @dev Error indicating that a vote type is not supported.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an unsupported vote type.\\n */\\nerror ErrUnsupportedVoteType(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the proposal nonce is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid proposal nonce.\\n */\\nerror ErrInvalidProposalNonce(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a voter has already voted.\\n * @param voter The address of the voter who has already voted.\\n */\\nerror ErrAlreadyVoted(address voter);\\n\\n/**\\n * @dev Error indicating that a signature is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid signature.\\n */\\nerror ErrInvalidSignatures(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a relay call has failed.\\n * @param msgSig The function signature (bytes4) of the relay call that failed.\\n */\\nerror ErrRelayFailed(bytes4 msgSig);\\n/**\\n * @dev Error indicating that a vote weight is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid vote weight.\\n */\\nerror ErrInvalidVoteWeight(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a query was made for an outdated bridge operator set.\\n */\\nerror ErrQueryForOutdatedBridgeOperatorSet();\\n\\n/**\\n * @dev Error indicating that a request is invalid.\\n */\\nerror ErrInvalidRequest();\\n\\n/**\\n * @dev Error indicating that a token standard is invalid.\\n */\\nerror ErrInvalidTokenStandard();\\n\\n/**\\n * @dev Error indicating that a token is not supported.\\n */\\nerror ErrUnsupportedToken();\\n\\n/**\\n * @dev Error indicating that a receipt kind is invalid.\\n */\\nerror ErrInvalidReceiptKind();\\n\\n/**\\n * @dev Error indicating that a receipt is invalid.\\n */\\nerror ErrInvalidReceipt();\\n\\n/**\\n * @dev Error indicating that an address is not payable.\\n */\\nerror ErrNonpayableAddress(address);\\n\\n/**\\n * @dev Error indicating that the period is already processed, i.e. scattered reward.\\n */\\nerror ErrPeriodAlreadyProcessed(uint256 requestingPeriod, uint256 latestPeriod);\\n\\n/**\\n * @dev Error thrown when an invalid vote hash is provided.\\n */\\nerror ErrInvalidVoteHash();\\n\\n/**\\n * @dev Error thrown when querying for an empty vote.\\n */\\nerror ErrQueryForEmptyVote();\\n\\n/**\\n * @dev Error thrown when querying for an expired vote.\\n */\\nerror ErrQueryForExpiredVote();\\n\\n/**\\n * @dev Error thrown when querying for a non-existent vote.\\n */\\nerror ErrQueryForNonExistentVote();\\n\\n/**\\n * @dev Error indicating that the method is only called once per block.\\n */\\nerror ErrOncePerBlock();\\n\\n/**\\n * @dev Error of method caller must be coinbase\\n */\\nerror ErrCallerMustBeCoinbase();\\n\\n/**\\n * @dev Error thrown when an invalid proposal is encountered.\\n * @param actual The actual value of the proposal.\\n * @param expected The expected value of the proposal.\\n */\\nerror ErrInvalidProposal(bytes32 actual, bytes32 expected);\\n\\n/**\\n * @dev Error of proposal is not approved for executing.\\n */\\nerror ErrProposalNotApproved();\\n\\n/**\\n * @dev Error of the caller is not the specified executor.\\n */\\nerror ErrInvalidExecutor();\\n\\n/**\\n * @dev Error of the `caller` to relay is not the specified `executor`.\\n */\\nerror ErrNonExecutorCannotRelay(address executor, address caller);\\n\",\"keccak256\":\"0x0d9e2fd98f6b704273faad707ed9eadbd4c79551ee3f902bff5b29213a204679\",\"license\":\"MIT\"},\"src/utils/ContractType.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum ContractType {\\n UNKNOWN, // 0\\n PAUSE_ENFORCER, // 1\\n BRIDGE, // 2\\n BRIDGE_TRACKING, // 3\\n GOVERNANCE_ADMIN, // 4\\n MAINTENANCE, // 5\\n SLASH_INDICATOR, // 6\\n STAKING_VESTING, // 7\\n VALIDATOR, // 8\\n STAKING, // 9\\n RONIN_TRUSTED_ORGANIZATION, // 10\\n BRIDGE_MANAGER, // 11\\n BRIDGE_SLASH, // 12\\n BRIDGE_REWARD, // 13\\n FAST_FINALITY_TRACKING, // 14\\n PROFILE // 15\\n\\n}\\n\",\"keccak256\":\"0xec088aa939cd885dbe84e944942d7ea674e1fff8802c1f2ae5d8e84e4578357d\",\"license\":\"MIT\"},\"src/utils/IdentityGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { AddressArrayUtils } from \\\"../libraries/AddressArrayUtils.sol\\\";\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport { TransparentUpgradeableProxyV2 } from \\\"../extensions/TransparentUpgradeableProxyV2.sol\\\";\\nimport { ErrAddressIsNotCreatedEOA, ErrZeroAddress, ErrOnlySelfCall, ErrZeroCodeContract, ErrUnsupportedInterface } from \\\"./CommonErrors.sol\\\";\\n\\nabstract contract IdentityGuard {\\n using AddressArrayUtils for address[];\\n\\n /// @dev value is equal to keccak256(abi.encode())\\n /// @dev see: https://eips.ethereum.org/EIPS/eip-1052\\n bytes32 internal constant CREATED_ACCOUNT_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\\n\\n /**\\n * @dev Modifier to restrict functions to only be called by this contract.\\n * @dev Reverts if the caller is not this contract.\\n */\\n modifier onlySelfCall() virtual {\\n _requireSelfCall();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to ensure that the elements in the `arr` array are non-duplicates.\\n * It calls the internal `_checkDuplicate` function to perform the duplicate check.\\n *\\n * Requirements:\\n * - The elements in the `arr` array must not contain any duplicates.\\n */\\n modifier nonDuplicate(address[] memory arr) virtual {\\n _requireNonDuplicate(arr);\\n _;\\n }\\n\\n /**\\n * @dev Internal method to check the method caller.\\n * @dev Reverts if the method caller is not this contract.\\n */\\n function _requireSelfCall() internal view virtual {\\n if (msg.sender != address(this)) revert ErrOnlySelfCall(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to check if a contract address has code.\\n * @param addr The address of the contract to check.\\n * @dev Throws an error if the contract address has no code.\\n */\\n function _requireHasCode(address addr) internal view {\\n if (addr.code.length == 0) revert ErrZeroCodeContract(addr);\\n }\\n\\n /**\\n * @dev Checks if an address is zero and reverts if it is.\\n * @param addr The address to check.\\n */\\n function _requireNonZeroAddress(address addr) internal pure {\\n if (addr == address(0)) revert ErrZeroAddress(msg.sig);\\n }\\n\\n /**\\n * @dev Check if arr is empty and revert if it is.\\n * Checks if an array contains any duplicate addresses and reverts if duplicates are found.\\n * @param arr The array of addresses to check.\\n */\\n function _requireNonDuplicate(address[] memory arr) internal pure {\\n if (arr.hasDuplicate()) revert AddressArrayUtils.ErrDuplicated(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to require that the provided address is a created externally owned account (EOA).\\n * This internal function is used to ensure that the provided address is a valid externally owned account (EOA).\\n * It checks the codehash of the address against a predefined constant to confirm that the address is a created EOA.\\n * @notice This method only works with non-state EOA accounts\\n */\\n function _requireCreatedEOA(address addr) internal view {\\n _requireNonZeroAddress(addr);\\n bytes32 codehash = addr.codehash;\\n if (codehash != CREATED_ACCOUNT_HASH) revert ErrAddressIsNotCreatedEOA(addr, codehash);\\n }\\n\\n /**\\n * @dev Internal function to require that the specified contract supports the given interface. This method handle in\\n * both case that the callee is either or not the proxy admin of the caller. If the contract does not support the\\n * interface `interfaceId` or EIP165, a revert with the corresponding error message is triggered.\\n *\\n * @param contractAddr The address of the contract to check for interface support.\\n * @param interfaceId The interface ID to check for support.\\n */\\n function _requireSupportsInterface(address contractAddr, bytes4 interfaceId) internal view {\\n bytes memory supportsInterfaceParams = abi.encodeCall(IERC165.supportsInterface, (interfaceId));\\n (bool success, bytes memory returnOrRevertData) = contractAddr.staticcall(supportsInterfaceParams);\\n if (!success) {\\n (success, returnOrRevertData) = contractAddr.staticcall(abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (supportsInterfaceParams)));\\n if (!success) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n if (!abi.decode(returnOrRevertData, (bool))) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n}\\n\",\"keccak256\":\"0x546ab4c9cdb0e7f8e650f140349225305ba1d0706dcaceeb9180c96aa765da59\",\"license\":\"MIT\"},\"src/utils/RoleAccess.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum RoleAccess {\\n UNKNOWN, // 0\\n ADMIN, // 1\\n COINBASE, // 2\\n GOVERNOR, // 3\\n CANDIDATE_ADMIN, // 4\\n WITHDRAWAL_MIGRATOR, // 5\\n __DEPRECATED_BRIDGE_OPERATOR, // 6\\n BLOCK_PRODUCER, // 7\\n VALIDATOR_CANDIDATE, // 8\\n CONSENSUS, // 9\\n TREASURY // 10\\n\\n}\\n\",\"keccak256\":\"0x671ff40dd874c508c4b3879a580996c7987fc018669256f47151e420a55c0e51\",\"license\":\"MIT\"}},\"version\":1}", + "nonce": 21, + "numDeployments": 2, "storageLayout": { "storage": [ { @@ -2284,7 +2284,7 @@ } } }, - "timestamp": 1713254676, + "timestamp": 1713254892, "userdoc": { "version": 1, "kind": "user", diff --git a/deployments/sepolia/MainchainBridgeManagerProxy.json b/deployments/sepolia/MainchainBridgeManagerProxy.json index 51a6890f..fc87503b 100644 --- a/deployments/sepolia/MainchainBridgeManagerProxy.json +++ b/deployments/sepolia/MainchainBridgeManagerProxy.json @@ -158,10 +158,10 @@ "anonymous": false } ], - "address": "0xdbf1c9FB0cb61Ae76901e55c5C04e77d2BE131A1", + "address": "0x603075B625cc2cf69FbB3546C6acC2451FE792AF", "args": "0xf896f0700000000000000000000000000000000000000000000000000000000000000007000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000007e500000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000003a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000002e82d2b56f858f79deef11b160bfc4631873da2b000000000000000000000000bcb61783dd2403fe8cc9b89b27b1a9bb03d040cb000000000000000000000000b266bf53cf7eac4e2065a404598dcb0e15e9462c000000000000000000000000cc5fc5b6c8595f56306da736f6cd02ed9141c84a0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000d24d87ddc1917165435b306aac68d99e0f49a3fa000000000000000000000000b033ba62ec622dc54d0abfe0254e79692147ca26000000000000000000000000087d08e3ba42e64e3948962dd1371f906d1278b900000000000000000000000052ec2e6bbce45afff8955da6410bb13812f4289f00000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006855f31df1d3d25ce486cf09db49bda535d2a9e00000000000000000000000061ec0ebf966ae84c414bda715e17cef657e039df", "ast": "", - "blockNumber": 5709352, + "blockNumber": 5709370, "bytecode": "0x608060405260405162000edd38038062000edd83398101604081905262000026916200041a565b8282828281620000398282600062000053565b506200004790508262000085565b5050505050506200054d565b6200005e83620000f7565b6000825111806200006c5750805b1562000080576200007e838362000139565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f620000c760008051602062000e96833981519152546001600160a01b031690565b604080516001600160a01b03928316815291841660208301520160405180910390a1620000f48162000168565b50565b620001028162000206565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606062000161838360405180606001604052806027815260200162000eb6602791396200029d565b9392505050565b6001600160a01b038116620001d35760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b8060008051602062000e968339815191525b80546001600160a01b0319166001600160a01b039290921691909117905550565b6001600160a01b0381163b620002755760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620001ca565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc620001e5565b60606001600160a01b0384163b620003075760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401620001ca565b600080856001600160a01b031685604051620003249190620004fa565b600060405180830381855af49150503d806000811462000361576040519150601f19603f3d011682016040523d82523d6000602084013e62000366565b606091505b5090925090506200037982828662000383565b9695505050505050565b606083156200039457508162000161565b825115620003a55782518084602001fd5b8160405162461bcd60e51b8152600401620001ca919062000518565b80516001600160a01b0381168114620003d957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000411578181015183820152602001620003f7565b50506000910152565b6000806000606084860312156200043057600080fd5b6200043b84620003c1565b92506200044b60208501620003c1565b60408501519092506001600160401b03808211156200046957600080fd5b818601915086601f8301126200047e57600080fd5b815181811115620004935762000493620003de565b604051601f8201601f19908116603f01168101908382118183101715620004be57620004be620003de565b81604052828152896020848701011115620004d857600080fd5b620004eb836020830160208801620003f4565b80955050505050509250925092565b600082516200050e818460208701620003f4565b9190910192915050565b602081526000825180602084015262000539816040850160208701620003f4565b601f01601f19169190910160400192915050565b610939806200055d6000396000f3fe6080604052600436106100595760003560e01c80633659cfe6146100705780634bb5274a146100905780634f1ef286146100a35780635c60da1b146100b65780638f283970146100e7578063f851a4401461010757610068565b366100685761006661011c565b005b61006661011c565b34801561007c57600080fd5b5061006661008b366004610704565b610136565b61006661009e366004610735565b610173565b6100666100b13660046107e6565b6101b8565b3480156100c257600080fd5b506100cb61021f565b6040516001600160a01b03909116815260200160405180910390f35b3480156100f357600080fd5b50610066610102366004610704565b610250565b34801561011357600080fd5b506100cb610270565b610124610291565b61013461012f610326565b610330565b565b61013e61034f565b6001600160a01b0316330361016b5761016881604051806020016040528060008152506000610382565b50565b61016861011c565b61017b61034f565b6001600160a01b0316330361016b576000610194610326565b9050600080835160208501845af43d6000803e8080156101b3573d6000f35b3d6000fd5b6101c061034f565b6001600160a01b03163303610217576102128383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525060019250610382915050565b505050565b61021261011c565b600061022961034f565b6001600160a01b0316330361024557610240610326565b905090565b61024d61011c565b90565b61025861034f565b6001600160a01b0316330361016b57610168816103ad565b600061027a61034f565b6001600160a01b031633036102455761024061034f565b61029961034f565b6001600160a01b031633036101345760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b6000610240610401565b3660008037600080366000845af43d6000803e8080156101b3573d6000f35b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b61038b83610429565b6000825111806103985750805b15610212576103a78383610469565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103d661034f565b604080516001600160a01b03928316815291841660208301520160405180910390a161016881610495565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610373565b6104328161053e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061048e83836040518060600160405280602781526020016108dd602791396105d2565b9392505050565b6001600160a01b0381166104fa5760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b606482015260840161031d565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b6001600160a01b0381163b6105ab5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161031d565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc61051d565b60606001600160a01b0384163b61063a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161031d565b600080856001600160a01b031685604051610655919061088d565b600060405180830381855af49150503d8060008114610690576040519150601f19603f3d011682016040523d82523d6000602084013e610695565b606091505b50915091506106a58282866106af565b9695505050505050565b606083156106be57508161048e565b8251156106ce5782518084602001fd5b8160405162461bcd60e51b815260040161031d91906108a9565b80356001600160a01b03811681146106ff57600080fd5b919050565b60006020828403121561071657600080fd5b61048e826106e8565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561074757600080fd5b813567ffffffffffffffff8082111561075f57600080fd5b818401915084601f83011261077357600080fd5b8135818111156107855761078561071f565b604051601f8201601f19908116603f011681019083821181831017156107ad576107ad61071f565b816040528281528760208487010111156107c657600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000806000604084860312156107fb57600080fd5b610804846106e8565b9250602084013567ffffffffffffffff8082111561082157600080fd5b818601915086601f83011261083557600080fd5b81358181111561084457600080fd5b87602082850101111561085657600080fd5b6020830194508093505050509250925092565b60005b8381101561088457818101518382015260200161086c565b50506000910152565b6000825161089f818460208701610869565b9190910192915050565b60208152600082518060208401526108c8816040850160208701610869565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220c665d628940e317f0b6d03df17271fb51c4d35c9dbf89cce5e4d9768343c58a864736f6c63430008170033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", "chainId": 11155111, "contractAbsolutePath": "TransparentUpgradeableProxyV2.sol:TransparentUpgradeableProxyV2", @@ -204,13 +204,13 @@ }, "isFoundry": true, "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"functionDelegateCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"events\":{\"AdminChanged(address,address)\":{\"details\":\"Emitted when the admin account has changed.\"},\"BeaconUpgraded(address)\":{\"details\":\"Emitted when the beacon is upgraded.\"},\"Upgraded(address)\":{\"details\":\"Emitted when the implementation is upgraded.\"}},\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"functionDelegateCall(bytes)\":{\"details\":\"Calls a function from the current implementation as specified by `_data`, which should be an encoded function call. Requirements: - Only the admin can call this function. Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider reviewing the encoded data `_data` and the method which is called before using this.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/extensions/TransparentUpgradeableProxyV2.sol\":\"TransparentUpgradeableProxyV2\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@fdk/=lib/foundry-deployment-kit/script/\",\":@openzeppelin/=lib/openzeppelin-contracts/\",\":@prb/math/=lib/prb-math/\",\":@prb/test/=lib/prb-test/src/\",\":@ronin/contracts/=src/\",\":@ronin/script/=script/\",\":@ronin/test/=test/\",\":contract-libs/=lib/foundry-deployment-kit/lib/contract-libs/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/foundry-deployment-kit/lib/forge-std/src/\",\":foundry-deployment-kit/=lib/foundry-deployment-kit/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/contracts/\",\":prb-math/=lib/prb-math/src/\",\":prb-test/=lib/prb-test/src/\",\":solady/=lib/solady/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0xa6a787e7a901af6511e19aa53e1a00352db215a011d2c7a438d0582dd5da76f9\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"src/extensions/TransparentUpgradeableProxyV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\\\";\\n\\ncontract TransparentUpgradeableProxyV2 is TransparentUpgradeableProxy {\\n constructor(address _logic, address admin_, bytes memory _data) payable TransparentUpgradeableProxy(_logic, admin_, _data) { }\\n\\n /**\\n * @dev Calls a function from the current implementation as specified by `_data`, which should be an encoded function call.\\n *\\n * Requirements:\\n * - Only the admin can call this function.\\n *\\n * Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid\\n * triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider\\n * reviewing the encoded data `_data` and the method which is called before using this.\\n *\\n */\\n function functionDelegateCall(bytes memory _data) public payable ifAdmin {\\n address _addr = _implementation();\\n assembly {\\n let _result := delegatecall(gas(), _addr, add(_data, 32), mload(_data), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n switch _result\\n case 0 { revert(0, returndatasize()) }\\n default { return(0, returndatasize()) }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x45fc7b71d09da99414b977a56e586b3604670d865e5f36f395d5c98bc4ba64af\",\"license\":\"MIT\"}},\"version\":1}", - "nonce": 24, - "numDeployments": 1, + "nonce": 22, + "numDeployments": 2, "storageLayout": { "storage": [], "types": {} }, - "timestamp": 1713254676, + "timestamp": 1713254892, "userdoc": { "version": 1, "kind": "user" diff --git a/deployments/sepolia/MainchainGatewayPauseEnforcerLogic.json b/deployments/sepolia/MainchainGatewayPauseEnforcerLogic.json index 6a29ede2..ffe656b5 100644 --- a/deployments/sepolia/MainchainGatewayPauseEnforcerLogic.json +++ b/deployments/sepolia/MainchainGatewayPauseEnforcerLogic.json @@ -435,10 +435,10 @@ "inputs": [] } ], - "address": "0x3C4e17b9056272Ce1b49F6900d8cFD6171a1869d", + "address": "0x23614572006e2D0DB35E54d4082Aec68d9686450", "args": "0x", "ast": "", - "blockNumber": 5709352, + "blockNumber": 5709370, "bytecode": "0x608060405234801561001057600080fd5b5061001961001e565b6100de565b600254610100900460ff161561008a5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60025460ff90811610156100dc576002805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6111c4806100ed6000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c806391d14854116100a2578063caa6fea411610071578063caa6fea414610240578063d4b8399214610254578063d547741f1461026d578063dcf7bb5c14610280578063f82ec70b1461029357600080fd5b806391d148541461020a578063a217fddf1461021d578063b9f3163b14610225578063ca15c8731461022d57600080fd5b80636833f60d116100e95780636833f60d1461019c57806377a24f36146101a45780637a9ad019146101b75780637d4f7fc9146101cc5780639010d07c146101df57600080fd5b806301ffc9a71461011b578063248a9ca3146101435780632f2ff15d1461017457806336568abe14610189575b600080fd5b61012e610129366004610e11565b6102a6565b60405190151581526020015b60405180910390f35b610166610151366004610e3b565b60009081526020819052604090206001015490565b60405190815260200161013a565b610187610182366004610e79565b6102d1565b005b610187610197366004610e79565b6102fb565b61018761037e565b6101876101b2366004610ebf565b6104da565b61016660008051602061116f83398151915281565b6101876101da366004610fab565b610640565b6101f26101ed366004610fc8565b610663565b6040516001600160a01b03909116815260200161013a565b61012e610218366004610e79565b610682565b610166600081565b6101876106ab565b61016661023b366004610e3b565b610821565b60025461012e90600160b01b900460ff1681565b6002546101f2906201000090046001600160a01b031681565b61018761027b366004610e79565b610838565b61018761028e366004610fab565b61085d565b6101876102a1366004610fab565b610871565b60006001600160e01b03198216635a05180f60e01b14806102cb57506102cb82610894565b92915050565b6000828152602081905260409020600101546102ec816108c9565b6102f683836108d6565b505050565b6001600160a01b03811633146103705760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61037a82826108f8565b5050565b60008051602061116f833981519152610396816108c9565b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af11580156103e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040d9190610fea565b1561042b576040516310067f7560e11b815260040160405180910390fd5b60028054600160b01b60ff60b01b19909116179081905560408051638456cb5960e01b81529051620100009092046001600160a01b031691638456cb599160048082019260009290919082900301818387803b15801561048a57600080fd5b505af115801561049e573d6000803e3d6000fd5b50506040513381527fb8fad2fa0ed7a383e747c309ef2c4391d7b65592a48893e57ccc1fab70791456925060200190505b60405180910390a150565b600254610100900460ff16158080156104fa5750600254600160ff909116105b806105145750303b158015610514575060025460ff166001145b6105775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610367565b6002805460ff19166001179055801561059a576002805461ff0019166101001790555b6105a38461091a565b6105ae600084610972565b60005b82518110156105f3576105eb60008051602061116f8339815191528483815181106105de576105de61100c565b60200260200101516108d6565b6001016105b1565b50801561063a576002805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b600061064b816108c9565b61037a60008051602061116f833981519152836108d6565b600082815260016020526040812061067b908361097c565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008051602061116f8339815191526106c3816108c9565b600254600160b01b900460ff166106ed57604051631b2fd53f60e31b815260040160405180910390fd5b60028054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610740573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107649190610fea565b61078157604051631e87b57b60e31b815260040160405180910390fd5b6002805460ff60b01b19169081905560408051631fa5d41d60e11b81529051620100009092046001600160a01b031691633f4ba83a9160048082019260009290919082900301818387803b1580156107d857600080fd5b505af11580156107ec573d6000803e3d6000fd5b50506040513381527ff5cbf596165cc457b2cd92e8d8450827ee314968160a5696402d75766fc52caf925060200190506104cf565b60008181526001602052604081206102cb90610988565b600082815260208190526040902060010154610853816108c9565b6102f683836108f8565b6000610868816108c9565b61037a8261091a565b600061087c816108c9565b61037a60008051602061116f833981519152836108f8565b60006001600160e01b03198216637965db0b60e01b14806102cb57506301ffc9a760e01b6001600160e01b03198316146102cb565b6108d38133610992565b50565b6108e082826109f6565b60008281526001602052604090206102f69082610a7a565b6109028282610a8f565b60008281526001602052604090206102f69082610af4565b6002805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040519081527f7f8cffd58ac96898bdd25ab64868bd933141d15ad1cd4a0df228fd3fcba2a26d906020016104cf565b61037a82826108d6565b600061067b8383610b09565b60006102cb825490565b61099c8282610682565b61037a576109b4816001600160a01b03166014610b33565b6109bf836020610b33565b6040516020016109d0929190611046565b60408051601f198184030181529082905262461bcd60e51b8252610367916004016110bb565b610a008282610682565b61037a576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610a363390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061067b836001600160a01b038416610ccf565b610a998282610682565b1561037a576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061067b836001600160a01b038416610d1e565b6000826000018281548110610b2057610b2061100c565b9060005260206000200154905092915050565b60606000610b42836002611104565b610b4d90600261111b565b67ffffffffffffffff811115610b6557610b65610ea9565b6040519080825280601f01601f191660200182016040528015610b8f576020820181803683370190505b509050600360fc1b81600081518110610baa57610baa61100c565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610bd957610bd961100c565b60200101906001600160f81b031916908160001a9053506000610bfd846002611104565b610c0890600161111b565b90505b6001811115610c80576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610c3c57610c3c61100c565b1a60f81b828281518110610c5257610c5261100c565b60200101906001600160f81b031916908160001a90535060049490941c93610c798161112e565b9050610c0b565b50831561067b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610367565b6000818152600183016020526040812054610d16575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556102cb565b5060006102cb565b60008181526001830160205260408120548015610e07576000610d42600183611145565b8554909150600090610d5690600190611145565b9050818114610dbb576000866000018281548110610d7657610d7661100c565b9060005260206000200154905080876000018481548110610d9957610d9961100c565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610dcc57610dcc611158565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506102cb565b60009150506102cb565b600060208284031215610e2357600080fd5b81356001600160e01b03198116811461067b57600080fd5b600060208284031215610e4d57600080fd5b5035919050565b6001600160a01b03811681146108d357600080fd5b8035610e7481610e54565b919050565b60008060408385031215610e8c57600080fd5b823591506020830135610e9e81610e54565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600060608486031215610ed457600080fd5b8335610edf81610e54565b9250602084810135610ef081610e54565b9250604085013567ffffffffffffffff80821115610f0d57600080fd5b818701915087601f830112610f2157600080fd5b813581811115610f3357610f33610ea9565b8060051b604051601f19603f83011681018181108582111715610f5857610f58610ea9565b60405291825284820192508381018501918a831115610f7657600080fd5b938501935b82851015610f9b57610f8c85610e69565b84529385019392850192610f7b565b8096505050505050509250925092565b600060208284031215610fbd57600080fd5b813561067b81610e54565b60008060408385031215610fdb57600080fd5b50508035926020909101359150565b600060208284031215610ffc57600080fd5b8151801515811461067b57600080fd5b634e487b7160e01b600052603260045260246000fd5b60005b8381101561103d578181015183820152602001611025565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161107e816017850160208801611022565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516110af816028840160208801611022565b01602801949350505050565b60208152600082518060208401526110da816040850160208701611022565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176102cb576102cb6110ee565b808201808211156102cb576102cb6110ee565b60008161113d5761113d6110ee565b506000190190565b818103818111156102cb576102cb6110ee565b634e487b7160e01b600052603160045260246000fdfe5bea60102f2a7acc9e82b1af0e3bd4069661102bb5dd143a6051cd1980dded1ca26469706673582212205cd579cff7903082498e437ed3eb21f8623bfa7f518ca2799b5e3497b22a08a864736f6c63430008170033", "chainId": 11155111, "contractAbsolutePath": "PauseEnforcer.sol", @@ -534,8 +534,8 @@ }, "isFoundry": true, "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ErrNotOnEmergencyPause\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrTargetIsNotOnPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrTargetIsOnPaused\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"EmergencyPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"EmergencyUnpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IPauseTarget\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"TargetChanged\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SENTRY_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPauseTarget\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"changeTarget\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"emergency\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getRoleMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleMemberCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sentry\",\"type\":\"address\"}],\"name\":\"grantSentry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPauseTarget\",\"name\":\"_target\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_admin\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"_sentries\",\"type\":\"address[]\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sentry\",\"type\":\"address\"}],\"name\":\"revokeSentry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"target\",\"outputs\":[{\"internalType\":\"contract IPauseTarget\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"triggerPause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"triggerUnpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"ErrNotOnEmergencyPause()\":[{\"details\":\"Error thrown when the contract is not on emergency pause.\"}],\"ErrTargetIsNotOnPaused()\":[{\"details\":\"Error thrown when the target is not on paused state.\"}],\"ErrTargetIsOnPaused()\":[{\"details\":\"Error thrown when the target is already on paused state.\"}]},\"events\":{\"EmergencyPaused(address)\":{\"details\":\"Emitted when the emergency ppause is triggered by `account`.\"},\"EmergencyUnpaused(address)\":{\"details\":\"Emitted when the emergency unpause is triggered by `account`.\"},\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"RoleAdminChanged(bytes32,bytes32,bytes32)\":{\"details\":\"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this. _Available since v3.1._\"},\"RoleGranted(bytes32,address,address)\":{\"details\":\"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.\"},\"RoleRevoked(bytes32,address,address)\":{\"details\":\"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)\"},\"TargetChanged(address)\":{\"details\":\"Emitted when the target is changed.\"}},\"kind\":\"dev\",\"methods\":{\"changeTarget(address)\":{\"details\":\"Setter for `target`. Requirements: - Only admin can call this method.\"},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"getRoleMember(bytes32,uint256)\":{\"details\":\"Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.\"},\"getRoleMemberCount(bytes32)\":{\"details\":\"Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"grantSentry(address)\":{\"details\":\"Grants the SENTRY_ROLE to the specified address.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"initialize(address,address,address[])\":{\"details\":\"Initializes the contract storage.\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`. May emit a {RoleRevoked} event.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"revokeSentry(address)\":{\"details\":\"Revokes the SENTRY_ROLE from the specified address.\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"},\"triggerPause()\":{\"details\":\"Triggers a pause on the target contract. Requirements: - Only be called by accounts with the SENTRY_ROLE, - The target contract is not already paused.\"},\"triggerUnpause()\":{\"details\":\"Triggers an unpause on the target contract. Requirements: - Only be called by accounts with the SENTRY_ROLE, - The target contract is already paused. - The target contract is paused in emergency mode.\"}},\"stateVariables\":{\"emergency\":{\"details\":\"Indicating whether or not the target contract is paused in emergency mode.\"},\"target\":{\"details\":\"The contract that can be paused or unpaused by the SENTRY_ROLE.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/ronin/gateway/PauseEnforcer.sol\":\"PauseEnforcer\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@fdk/=lib/foundry-deployment-kit/script/\",\":@openzeppelin/=lib/openzeppelin-contracts/\",\":@prb/math/=lib/prb-math/\",\":@prb/test/=lib/prb-test/src/\",\":@ronin/contracts/=src/\",\":@ronin/script/=script/\",\":@ronin/test/=test/\",\":contract-libs/=lib/foundry-deployment-kit/lib/contract-libs/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/foundry-deployment-kit/lib/forge-std/src/\",\":foundry-deployment-kit/=lib/foundry-deployment-kit/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/contracts/\",\":prb-math/=lib/prb-math/src/\",\":prb-test/=lib/prb-test/src/\",\":solady/=lib/solady/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/access/AccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\nimport \\\"../utils/Context.sol\\\";\\nimport \\\"../utils/Strings.sol\\\";\\nimport \\\"../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it.\\n */\\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\\n struct RoleData {\\n mapping(address => bool) members;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with a standardized message including the required role.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n *\\n * _Available since v4.1._\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role);\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\\n return _roles[role].members[account];\\n }\\n\\n /**\\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\\n * Overriding this function changes the behavior of the {onlyRole} modifier.\\n *\\n * Format of the revert message is described in {_checkRole}.\\n *\\n * _Available since v4.6._\\n */\\n function _checkRole(bytes32 role) internal view virtual {\\n _checkRole(role, _msgSender());\\n }\\n\\n /**\\n * @dev Revert with a standard message if `account` is missing `role`.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert(\\n string(\\n abi.encodePacked(\\n \\\"AccessControl: account \\\",\\n Strings.toHexString(uint160(account), 20),\\n \\\" is missing role \\\",\\n Strings.toHexString(uint256(role), 32)\\n )\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function renounceRole(bytes32 role, address account) public virtual override {\\n require(account == _msgSender(), \\\"AccessControl: can only renounce roles for self\\\");\\n\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event. Note that unlike {grantRole}, this function doesn't perform any\\n * checks on the calling account.\\n *\\n * May emit a {RoleGranted} event.\\n *\\n * [WARNING]\\n * ====\\n * This function should only be called from the constructor when setting\\n * up the initial roles for the system.\\n *\\n * Using this function in any other way is effectively circumventing the admin\\n * system imposed by {AccessControl}.\\n * ====\\n *\\n * NOTE: This function is deprecated in favor of {_grantRole}.\\n */\\n function _setupRole(bytes32 role, address account) internal virtual {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual {\\n if (!hasRole(role, account)) {\\n _roles[role].members[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n }\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual {\\n if (hasRole(role, account)) {\\n _roles[role].members[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5b35d8e68aeaccc685239bd9dd79b9ba01a0357930f8a3307ab85511733d9724\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/access/AccessControlEnumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlEnumerable.sol\\\";\\nimport \\\"./AccessControl.sol\\\";\\nimport \\\"../utils/structs/EnumerableSet.sol\\\";\\n\\n/**\\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\\n */\\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {\\n return _roleMembers[role].at(index);\\n }\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {\\n return _roleMembers[role].length();\\n }\\n\\n /**\\n * @dev Overload {_grantRole} to track enumerable memberships\\n */\\n function _grantRole(bytes32 role, address account) internal virtual override {\\n super._grantRole(role, account);\\n _roleMembers[role].add(account);\\n }\\n\\n /**\\n * @dev Overload {_revokeRole} to track enumerable memberships\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual override {\\n super._revokeRole(role, account);\\n _roleMembers[role].remove(account);\\n }\\n}\\n\",\"keccak256\":\"0x13f5e15f2a0650c0b6aaee2ef19e89eaf4870d6e79662d572a393334c1397247\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/access/IAccessControlEnumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\n\\n/**\\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\\n */\\ninterface IAccessControlEnumerable is IAccessControl {\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xba4459ab871dfa300f5212c6c30178b63898c03533a1ede28436f11546626676\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2a21b14ff90012878752f230d3ffd5c3405e5938d06c97a7d89c0a64561d0d66\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _HEX_SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n // Inspired by OraclizeAPI's implementation - MIT licence\\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\\n\\n if (value == 0) {\\n return \\\"0\\\";\\n }\\n uint256 temp = value;\\n uint256 digits;\\n while (temp != 0) {\\n digits++;\\n temp /= 10;\\n }\\n bytes memory buffer = new bytes(digits);\\n while (value != 0) {\\n digits -= 1;\\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\\n value /= 10;\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n if (value == 0) {\\n return \\\"0x00\\\";\\n }\\n uint256 temp = value;\\n uint256 length = 0;\\n while (temp != 0) {\\n length++;\\n temp >>= 8;\\n }\\n return toHexString(value, length);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xaf159a8b1923ad2a26d516089bceca9bdeaeacd04be50983ea00ba63070f08a3\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n *\\n * [WARNING]\\n * ====\\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.\\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\\n *\\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.\\n * ====\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n bytes32 lastValue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastValue;\\n // Update the index for the moved value\\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n return set._values[index];\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function _values(Set storage set) private view returns (bytes32[] memory) {\\n return set._values;\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\\n return _values(set._inner);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(AddressSet storage set) internal view returns (address[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n address[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(UintSet storage set) internal view returns (uint256[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n uint256[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0x5050943b32b6a8f282573d166b2e9d87ab7eb4dbba4ab6acf36ecb54fe6995e4\",\"license\":\"MIT\"},\"src/interfaces/IPauseTarget.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IPauseTarget {\\n function pause() external;\\n\\n function unpause() external;\\n\\n function paused() external returns (bool);\\n}\\n\",\"keccak256\":\"0xc91073e61da572de0087b41018fd30b03661d58e0c5061e7b9d1c9235cd7c1c3\",\"license\":\"MIT\"},\"src/ronin/gateway/PauseEnforcer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/access/AccessControlEnumerable.sol\\\";\\nimport \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport \\\"../../interfaces/IPauseTarget.sol\\\";\\n\\ncontract PauseEnforcer is AccessControlEnumerable, Initializable {\\n /**\\n * @dev Error thrown when the target is already on paused state.\\n */\\n error ErrTargetIsOnPaused();\\n\\n /**\\n * @dev Error thrown when the target is not on paused state.\\n */\\n error ErrTargetIsNotOnPaused();\\n\\n /**\\n * @dev Error thrown when the contract is not on emergency pause.\\n */\\n error ErrNotOnEmergencyPause();\\n\\n bytes32 public constant SENTRY_ROLE = keccak256(\\\"SENTRY_ROLE\\\");\\n\\n /// @dev The contract that can be paused or unpaused by the SENTRY_ROLE.\\n IPauseTarget public target;\\n /// @dev Indicating whether or not the target contract is paused in emergency mode.\\n bool public emergency;\\n\\n /// @dev Emitted when the emergency ppause is triggered by `account`.\\n event EmergencyPaused(address account);\\n /// @dev Emitted when the emergency unpause is triggered by `account`.\\n event EmergencyUnpaused(address account);\\n /// @dev Emitted when the target is changed.\\n event TargetChanged(IPauseTarget target);\\n\\n modifier onEmergency() {\\n if (!emergency) revert ErrNotOnEmergencyPause();\\n\\n _;\\n }\\n\\n modifier targetPaused() {\\n if (!target.paused()) revert ErrTargetIsOnPaused();\\n\\n _;\\n }\\n\\n modifier targetNotPaused() {\\n if (target.paused()) revert ErrTargetIsNotOnPaused();\\n\\n _;\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /**\\n * @dev Initializes the contract storage.\\n */\\n function initialize(IPauseTarget _target, address _admin, address[] memory _sentries) external initializer {\\n _changeTarget(_target);\\n _setupRole(DEFAULT_ADMIN_ROLE, _admin);\\n for (uint _i; _i < _sentries.length;) {\\n _grantRole(SENTRY_ROLE, _sentries[_i]);\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n }\\n\\n /**\\n * @dev Grants the SENTRY_ROLE to the specified address.\\n */\\n function grantSentry(address _sentry) external onlyRole(DEFAULT_ADMIN_ROLE) {\\n _grantRole(SENTRY_ROLE, _sentry);\\n }\\n\\n /**\\n * @dev Revokes the SENTRY_ROLE from the specified address.\\n */\\n function revokeSentry(address _sentry) external onlyRole(DEFAULT_ADMIN_ROLE) {\\n _revokeRole(SENTRY_ROLE, _sentry);\\n }\\n\\n /**\\n * @dev Triggers a pause on the target contract.\\n *\\n * Requirements:\\n * - Only be called by accounts with the SENTRY_ROLE,\\n * - The target contract is not already paused.\\n */\\n function triggerPause() external onlyRole(SENTRY_ROLE) targetNotPaused {\\n emergency = true;\\n target.pause();\\n emit EmergencyPaused(msg.sender);\\n }\\n\\n /**\\n * @dev Triggers an unpause on the target contract.\\n *\\n * Requirements:\\n * - Only be called by accounts with the SENTRY_ROLE,\\n * - The target contract is already paused.\\n * - The target contract is paused in emergency mode.\\n */\\n function triggerUnpause() external onlyRole(SENTRY_ROLE) onEmergency targetPaused {\\n emergency = false;\\n target.unpause();\\n emit EmergencyUnpaused(msg.sender);\\n }\\n\\n /**\\n * @dev Setter for `target`.\\n *\\n * Requirements:\\n * - Only admin can call this method.\\n */\\n function changeTarget(IPauseTarget _target) external onlyRole(DEFAULT_ADMIN_ROLE) {\\n _changeTarget(_target);\\n }\\n\\n /**\\n * @dev Internal helper for setting value to `target`.\\n */\\n function _changeTarget(IPauseTarget _target) internal {\\n target = _target;\\n emit TargetChanged(_target);\\n }\\n}\\n\",\"keccak256\":\"0x4a758f6cc62826d0f513903df7cf9e63a5bbd7420d3f8349595fabea346beb37\",\"license\":\"MIT\"}},\"version\":1}", - "nonce": 27, - "numDeployments": 2, + "nonce": 25, + "numDeployments": 3, "storageLayout": { "storage": [ { @@ -715,7 +715,7 @@ } } }, - "timestamp": 1713254676, + "timestamp": 1713254892, "userdoc": { "version": 1, "kind": "user" diff --git a/deployments/sepolia/MainchainGatewayV3Logic.json b/deployments/sepolia/MainchainGatewayV3Logic.json index 984952fa..66f77e76 100644 --- a/deployments/sepolia/MainchainGatewayV3Logic.json +++ b/deployments/sepolia/MainchainGatewayV3Logic.json @@ -2321,14 +2321,14 @@ ] } ], - "address": "0x82f5483623D636BC3deBA8Ae67E1751b6CF2Bad2", + "address": "0x1050f2E63177b5eD18f3E88D000DB3a600d664e3", "args": "0x", "ast": "", - "blockNumber": 5709352, - "bytecode": "0x60806040523480156200001157600080fd5b506000805460ff19169055620000266200002c565b620000ee565b607154610100900460ff1615620000995760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60715460ff9081161015620000ec576071805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61556180620000fe6000396000f3fe60806040526004361061039b5760003560e01c80638f34e347116101dc578063b9c3620911610102578063d55ed103116100a0578063dff525e11161006f578063dff525e114610b04578063e400327c14610b24578063e75235b814610b44578063f23a6e6114610b5c576103aa565b8063d55ed10314610a77578063d64af2a614610aa4578063dafae40814610ac4578063de981f1b14610ae4576103aa565b8063ca15c873116100dc578063ca15c873146109f2578063cdb6744414610a12578063d19773d214610a2a578063d547741f14610a57576103aa565b8063b9c3620914610986578063bc197c81146109a6578063c48549de146109d2576103aa565b8063a217fddf1161017a578063affed0e011610149578063affed0e0146108f6578063b1a2567e1461090c578063b1d08a031461092c578063b297579414610959576103aa565b8063a217fddf14610894578063a3912ec8146103a8578063ab796566146108a9578063ac78dfe8146108d6576103aa565b80639157921c116101b65780639157921c146107ff57806391d148541461081f57806393c5678f1461083f5780639dcc4da31461085f576103aa565b80638f34e3471461077e5780638f851d8a146107b25780639010d07c146107df576103aa565b806338e454b1116102c1578063504af48c1161025f5780636c1ce6701161022e5780636c1ce670146107145780637de5dedd146107345780638456cb5914610749578063865e6fd31461075e576103aa565b8063504af48c1461068f57806359122f6b146106a25780635c975abb146106cf5780636932be98146106e7576103aa565b80634b14557e1161029b5780634b14557e1461060c5780634d0d66731461061f5780634d493f4e1461063f5780634f4247a11461066f576103aa565b806338e454b1146105c25780633e70838b146105d75780633f4ba83a146105f7576103aa565b80631d4a7210116103395780632f2ff15d116103085780632f2ff15d14610556578063302d12db146105765780633644e5151461058d57806336568abe146105a2576103aa565b80631d4a7210146104c3578063248a9ca3146104f057806329b6eca9146105205780632dfdf0b514610540576103aa565b806317ce2dd41161037557806317ce2dd41461043f57806317fcb39b146104635780631a8e55b0146104835780631b6e7594146104a3576103aa565b806301ffc9a7146103b2578063065b3adf146103e7578063110a83081461041f576103aa565b366103aa576103a8610b88565b005b6103a8610b88565b3480156103be57600080fd5b506103d26103cd36600461416e565b610bbc565b60405190151581526020015b60405180910390f35b3480156103f357600080fd5b50600554610407906001600160a01b031681565b6040516001600160a01b0390911681526020016103de565b34801561042b57600080fd5b506103a861043a3660046141ad565b610c01565b34801561044b57600080fd5b5061045560755481565b6040519081526020016103de565b34801561046f57600080fd5b50607454610407906001600160a01b031681565b34801561048f57600080fd5b506103a861049e36600461420e565b610ca6565b3480156104af57600080fd5b506103a86104be366004614279565b610ce2565b3480156104cf57600080fd5b506104556104de3660046141ad565b603e6020526000908152604090205481565b3480156104fc57600080fd5b5061045561050b36600461431d565b60009081526072602052604090206001015490565b34801561052c57600080fd5b506103a861053b3660046141ad565b610d22565b34801561054c57600080fd5b5061045560765481565b34801561056257600080fd5b506103a8610571366004614336565b610dab565b34801561058257600080fd5b50610455620f424081565b34801561059957600080fd5b50607754610455565b3480156105ae57600080fd5b506103a86105bd366004614336565b610dd5565b3480156105ce57600080fd5b506103a8610e53565b3480156105e357600080fd5b506103a86105f23660046141ad565b611030565b34801561060357600080fd5b506103a861105a565b6103a861061a366004614366565b61106a565b34801561062b57600080fd5b506103d261063a366004614391565b61108d565b34801561064b57600080fd5b506103d261065a36600461431d565b607a6020526000908152604090205460ff1681565b34801561067b57600080fd5b50607f54610407906001600160a01b031681565b6103a861069d36600461443b565b6110fd565b3480156106ae57600080fd5b506104556106bd3660046141ad565b603a6020526000908152604090205481565b3480156106db57600080fd5b5060005460ff166103d2565b3480156106f357600080fd5b5061045561070236600461431d565b60796020526000908152604090205481565b34801561072057600080fd5b506103d261072f366004614515565b6113c3565b34801561074057600080fd5b506104556113cf565b34801561075557600080fd5b506103a86113f0565b34801561076a57600080fd5b506103a8610779366004614550565b611400565b34801561078a57600080fd5b506104557f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e481565b3480156107be57600080fd5b506107d26107cd36600461461b565b61141b565b6040516103de9190614712565b3480156107eb57600080fd5b506104076107fa366004614727565b61159d565b34801561080b57600080fd5b506103a861081a366004614749565b6115b5565b34801561082b57600080fd5b506103d261083a366004614336565b611839565b34801561084b57600080fd5b506103a861085a36600461420e565b611864565b34801561086b57600080fd5b5061087f61087a366004614727565b61189a565b604080519283526020830191909152016103de565b3480156108a057600080fd5b50610455600081565b3480156108b557600080fd5b506104556108c43660046141ad565b603c6020526000908152604090205481565b3480156108e257600080fd5b506103d26108f136600461431d565b6118c3565b34801561090257600080fd5b5061045560045481565b34801561091857600080fd5b506103a861092736600461420e565b6118f9565b34801561093857600080fd5b506104556109473660046141ad565b60396020526000908152604090205481565b34801561096557600080fd5b506109796109743660046141ad565b61192f565b6040516103de9190614790565b34801561099257600080fd5b506103a86109a1366004614727565b6119d2565b3480156109b257600080fd5b506107d26109c1366004614893565b63bc197c8160e01b95945050505050565b3480156109de57600080fd5b506107d26109ed36600461420e565b6119ec565b3480156109fe57600080fd5b50610455610a0d36600461431d565b611b80565b348015610a1e57600080fd5b5060375460385461087f565b348015610a3657600080fd5b50610455610a453660046141ad565b603b6020526000908152604090205481565b348015610a6357600080fd5b506103a8610a72366004614336565b611b97565b348015610a8357600080fd5b50610455610a923660046141ad565b603d6020526000908152604090205481565b348015610ab057600080fd5b506103a8610abf3660046141ad565b611bbc565b348015610ad057600080fd5b506103d2610adf36600461431d565b611bcd565b348015610af057600080fd5b50610407610aff366004614940565b611bfb565b348015610b1057600080fd5b506103a8610b1f36600461495b565b611c71565b348015610b3057600080fd5b506103a8610b3f36600461420e565b611ce6565b348015610b5057600080fd5b5060015460025461087f565b348015610b6857600080fd5b506107d2610b77366004614a18565b63f23a6e6160e01b95945050505050565b6074546001600160a01b0316331480610bab5750607f546001600160a01b031633145b15610bb257565b610bba611d1c565b565b60006001600160e01b031982166246560160e51b1480610bec57506001600160e01b031982166312c0151560e21b145b80610bfb5750610bfb82611d46565b92915050565b607154600490610100900460ff16158015610c23575060715460ff8083169116105b610c485760405162461bcd60e51b8152600401610c3f90614a80565b60405180910390fd5b60718054607f80546001600160a01b0319166001600160a01b03861617905561ff001961010060ff851661ffff199093168317171690915560405190815260008051602061550c833981519152906020015b60405180910390a15050565b610cae611d6b565b6000839003610cd0576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484611dc5565b50505050565b610cea611d6b565b6000859003610d0c576040516316ee9d3b60e11b815260040160405180910390fd5b610d1a868686868686611e9a565b505050505050565b607154600290610100900460ff16158015610d44575060715460ff8083169116105b610d605760405162461bcd60e51b8152600401610c3f90614a80565b6071805461ffff191660ff831617610100179055610d7f600b83612042565b6071805461ff001916905560405160ff8216815260008051602061550c83398151915290602001610c9a565b600082815260726020526040902060010154610dc6816120e6565b610dd083836120f0565b505050565b6001600160a01b0381163314610e455760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610c3f565b610e4f8282612112565b5050565b607154600390610100900460ff16158015610e75575060715460ff8083169116105b610e915760405162461bcd60e51b8152600401610c3f90614a80565b6071805461ffff191660ff8316176101001790556000610eb1600b611bfb565b9050600080826001600160a01b031663c441c4a86040518163ffffffff1660e01b8152600401600060405180830381865afa158015610ef4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f1c9190810190614b4b565b92509250506000805b8351811015610fd957828181518110610f4057610f40614c31565b6020026020010151607e6000868481518110610f5e57610f5e614c31565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154816001600160601b0302191690836001600160601b03160217905550828181518110610fbc57610fbc614c31565b602002602001015182610fcf9190614c5d565b9150600101610f25565b50607d80546001600160601b0319166001600160601b039290921691909117905550506071805461ff00191690555060405160ff8216815260008051602061550c833981519152906020015b60405180910390a150565b611038611d6b565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b611062612134565b610bba6121a3565b6110726121f5565b61108a61108436839003830183614ccd565b3361223b565b50565b60006110976121f5565b6110f3848484808060200260200160405190810160405280939291908181526020016000905b828210156110e9576110da60608302860136819003810190614d20565b815260200190600101906110bd565b5050505050612516565b90505b9392505050565b607154610100900460ff161580801561111d5750607154600160ff909116105b806111375750303b158015611137575060715460ff166001145b6111535760405162461bcd60e51b8152600401610c3f90614a80565b6071805460ff191660011790558015611176576071805461ff0019166101001790555b61118160008c6129aa565b607589905561118f8a6129b4565b61121a6040517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81527f159f52c1e3a2b6a6aad3950adf713516211484e0516dad685ea662a094b7c43b60208201527fad7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5604082015246606082015230608082015260a0812060775550565b6112248887612a02565b61122e8787612a92565b5050611238612b29565b60006112448680614d6a565b905011156113055761126d6112598680614d6a565b6112666020890189614d6a565b8787611e9a565b61129361127a8680614d6a565b8660005b60200281019061128e9190614d6a565b612b76565b6112b96112a08680614d6a565b8660015b6020028101906112b49190614d6a565b611dc5565b6112df6112c68680614d6a565b8660025b6020028101906112da9190614d6a565b612c4b565b6113056112ec8680614d6a565b8660035b6020028101906113009190614d6a565b612d5c565b60005b6113156040870187614d6a565b9050811015611381576113797f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e461134f6040890189614d6a565b8481811061135f5761135f614c31565b905060200201602081019061137491906141ad565b6120f0565b600101611308565b5080156113b6576071805461ff00191690556040516001815260008051602061550c8339815191529060200160405180910390a15b5050505050505050505050565b60006110f68383612e31565b60006113eb6113e6607d546001600160601b031690565b612efc565b905090565b6113f8612134565b610bba612f32565b611408611d6b565b61141181612f6f565b610e4f8282612042565b6000600b61142881612fa5565b825186908114158061143a5750808514155b15611466576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b8060000361147e57506347c28ec560e11b9150611593565b60005b818110156115865784818151811061149b5761149b614c31565b60200260200101511561157e578686828181106114ba576114ba614c31565b90506020020160208101906114cf9190614db3565b607d80546001600160601b031981166001600160601b03918216939093011691909117905586868281811061150657611506614c31565b905060200201602081019061151b9190614db3565b607e60008b8b8581811061153157611531614c31565b905060200201602081019061154691906141ad565b6001600160a01b03168152602081019190915260400160002080546001600160601b0319166001600160601b03929092169190911790555b600101611481565b506347c28ec560e11b9250505b5095945050505050565b60008281526073602052604081206110f69083612ff1565b7f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e46115df816120e6565b60006115f86115f336859003850185614e2d565b612ffd565b905061160c6115f336859003850185614e2d565b83356000908152607960205260409020541461163b5760405163f4b8742f60e01b815260040160405180910390fd5b82356000908152607a602052604090205460ff1661166c5760405163147bfe0760e01b815260040160405180910390fd5b82356000908152607a602052604090819020805460ff19169055517fd639511b37b3b002cca6cfe6bca0d833945a5af5a045578a0627fc43b79b2630906116b69083908690614f00565b60405180910390a160006116d060808501606086016141ad565b905060006116e661012086016101008701614f86565b60028111156116f7576116f7614766565b036117be5760006117113686900386016101008701614fa1565b6001600160a01b0383166000908152603b602052604090205490915061173d90610140870135906130c7565b604082015260006117573687900387016101008801614fa1565b604083015190915061176e90610140880135614fbd565b604082015260745461178e908390339086906001600160a01b03166130e1565b6117b76117a160608801604089016141ad565b60745483919086906001600160a01b03166130e1565b50506117fa565b6117fa6117d160608601604087016141ad565b60745483906001600160a01b03166117f23689900389016101008a01614fa1565b9291906130e1565b7f21e88e956aa3e086f6388e899965cef814688f99ad8bb29b08d396571016372d828560405161182b929190614f00565b60405180910390a150505050565b60009182526072602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61186c611d6b565b600083900361188e576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484612b76565b6000806118a5611d6b565b6118af8484612a92565b90925090506118bc612b29565b9250929050565b60006118d7607d546001600160601b031690565b6037546118e49190614fd0565b6038546118f19084614fd0565b101592915050565b611901611d6b565b6000839003611923576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484612c4b565b60408051808201909152600080825260208201526001600160a01b0382166000908152607860205260409081902081518083019092528054829060ff16600281111561197d5761197d614766565b600281111561198e5761198e614766565b815290546001600160a01b03610100909104811660209283015290820151919250166119cd57604051631b79f53b60e21b815260040160405180910390fd5b919050565b6119da611d6b565b6119e48282612a02565b610e4f612b29565b6000600b6119f981612fa5565b84838114611a28576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b80600003611a405750636242a4ef60e11b9150611b77565b6000805b82811015611b2757868682818110611a5e57611a5e614c31565b9050602002016020810190611a739190614fe7565b15611b1f57607e60008a8a84818110611a8e57611a8e614c31565b9050602002016020810190611aa391906141ad565b6001600160a01b0316815260208101919091526040016000908120546001600160601b03169290920191607e908a8a84818110611ae257611ae2614c31565b9050602002016020810190611af791906141ad565b6001600160a01b03168152602081019190915260400160002080546001600160601b03191690555b600101611a44565b50607d8054829190600090611b469084906001600160601b0316615004565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555063c48549de60e01b935050505b50949350505050565b6000818152607360205260408120610bfb90613313565b600082815260726020526040902060010154611bb2816120e6565b610dd08383612112565b611bc4611d6b565b61108a816129b4565b6000611be1607d546001600160601b031690565b600154611bee9190614fd0565b6002546118f19084614fd0565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115611c3257611c32614766565b60ff1681526020810191909152604001600020546001600160a01b03169050806119cd578160405163409140df60e11b8152600401610c3f9190615034565b611c79611d6b565b6000869003611c9b576040516316ee9d3b60e11b815260040160405180910390fd5b611ca9878787878787611e9a565b611cb6878783600061127e565b611cc387878360016112a4565b611cd087878360026112ca565b611cdd87878360036112f0565b50505050505050565b611cee611d6b565b6000839003611d10576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484612d5c565b611d246121f5565b611d2c61412d565b33815260408082015134910152805161108a90829061223b565b60006001600160e01b03198216630271189760e51b1480610bfb5750610bfb8261331d565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610bba576000356001600160e01b0319166001604051620f948f60ea1b8152600401610c3f929190615042565b828114611df3576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015611e6457828282818110611e1057611e10614c31565b90506020020135603a6000878785818110611e2d57611e2d614c31565b9050602002016020810190611e4291906141ad565b6001600160a01b03168152602081019190915260400160002055600101611df6565b507f64557254143204d91ba2d95acb9fda1e5fea55f77efd028685765bc1e94dd4b58484848460405161182b94939291906150b9565b8483148015611ea857508481145b611ed3576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b85811015611ff857848482818110611ef057611ef0614c31565b9050602002016020810190611f0591906141ad565b60786000898985818110611f1b57611f1b614c31565b9050602002016020810190611f3091906141ad565b6001600160a01b03908116825260208201929092526040016000208054610100600160a81b0319166101009390921692909202179055828282818110611f7857611f78614c31565b9050602002016020810190611f8d9190614f86565b60786000898985818110611fa357611fa3614c31565b9050602002016020810190611fb891906141ad565b6001600160a01b031681526020810191909152604001600020805460ff19166001836002811115611feb57611feb614766565b0217905550600101611ed6565b507fa4f03cc9c0e0aeb5b71b4ec800702753f65748c2cf3064695ba8e8b46be7044486868686868660405161203296959493929190615105565b60405180910390a1505050505050565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f81111561207857612078614766565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f8111156120b9576120b9614766565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b61108a8133613342565b6120fa82826133a6565b6000828152607360205260409020610dd0908261342c565b61211c8282613441565b6000828152607360205260409020610dd090826134a8565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031633148061217657506005546001600160a01b031633145b610bba576000356001600160e01b0319166001604051620f948f60ea1b8152600401610c3f929190615042565b6121ab6134bd565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60005460ff1615610bba5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610c3f565b604080518082018252600080825260208201526074549184015190916001600160a01b03169061226a90613506565b60208401516001600160a01b031661230b5734846040015160400151146122a45760405163129c2ce160e31b815260040160405180910390fd5b6122ad8161192f565b60408501515190925060028111156122c7576122c7614766565b825160028111156122da576122da614766565b146122f75760405162035e2b60ea1b815260040160405180910390fd5b6001600160a01b03811660208501526124a3565b341561232a5760405163129c2ce160e31b815260040160405180910390fd5b612337846020015161192f565b604085015151909250600281111561235157612351614766565b8251600281111561236457612364614766565b146123815760405162035e2b60ea1b815260040160405180910390fd5b6020840151604085015161239691859061354a565b83602001516001600160a01b0316816001600160a01b0316036124a357607454607f54604086810151810151905163095ea7b360e01b81526001600160a01b039283166004820152602481019190915291169063095ea7b3906044016020604051808303816000875af1158015612411573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124359190615176565b50607f546040808601518101519051636f074d1f60e11b81526001600160a01b039092169163de0e9a3e916124709160040190815260200190565b600060405180830381600087803b15801561248a57600080fd5b505af115801561249e573d6000803e3d6000fd5b505050505b60768054600091826124b483615193565b91905055905060006124db858386602001516075548a6136c390949392919063ffffffff16565b90507fd7b25068d9dc8d00765254cfb7f5070f98d263c8d68931d937c7362fa738048b61250782612ffd565b826040516120329291906151cc565b600082356101408401358261253160808701606088016141ad565b905061254e6125493688900388016101008901614fa1565b613506565b60016125606040880160208901615268565b600181111561257157612571614766565b1461258f5760405163182f3d8760e11b815260040160405180910390fd5b608086013546146125d15760405163092048d160e11b81526000356001600160e01b031916600482015260808701356024820152466044820152606401610c3f565b60006125e66109746080890160608a016141ad565b90506125fa61012088016101008901614f86565b600281111561260b5761260b614766565b8151600281111561261e5761261e614766565b14801561264f575061263660e0880160c089016141ad565b6001600160a01b031681602001516001600160a01b0316145b8015612660575060755460e0880135145b61267d5760405163f4b8742f60e01b815260040160405180910390fd5b600084815260796020526040902054156126aa57604051634f13df6160e01b815260040160405180910390fd5b60016126be61012089016101008a01614f86565b60028111156126cf576126cf614766565b14806126e257506126e08284612e31565b155b6126ff5760405163c51297b760e01b815260040160405180910390fd5b60006127136115f3368a90038a018a614e2d565b9050600061272360775483613798565b9050600061274361273c6101208c016101008d01614f86565b86886137d9565b60408051606081018252600080825260208201819052918101829052919a50919250819081906000805b8e51811015612881578e818151811061278857612788614c31565b6020908102919091018101518051818301516040808401518151600081529586018083528e905260ff9093169085015260608401526080830152935060019060a0016020604051602081039080840390855afa1580156127ec573d6000803e3d6000fd5b505050602060405103519450846001600160a01b0316846001600160a01b031610612838576000356001600160e01b031916604051635d3dcd3160e01b8152600401610c3f9190614712565b6001600160a01b0385166000908152607e60205260409020548594506001600160601b03166128679083615283565b91508682106128795760019550612881565b60010161276d565b50846128a057604051639e8f5f6360e01b815260040160405180910390fd5b50505060008981526079602052604090208590555050871561291b576000878152607a602052604090819020805460ff19166001179055517f89e52969465b1f1866fc5d46fd62de953962e9cb33552443cd999eba05bd20dc906129079085908d90614f00565b60405180910390a150505050505050610bfb565b6129258587613869565b61296461293860608c0160408d016141ad565b86607460009054906101000a90046001600160a01b03168d610100018036038101906117f29190614fa1565b7f21e88e956aa3e086f6388e899965cef814688f99ad8bb29b08d396571016372d838b604051612995929190614f00565b60405180910390a15050505050505092915050565b610e4f82826120f0565b607480546001600160a01b0319166001600160a01b0383169081179091556040519081527f9d2334c23be647e994f27a72c5eee42a43d5bdcfe15bb88e939103c2b114cbaf90602001611025565b80821115612a31576000356001600160e01b0319166040516387f6f09560e01b8152600401610c3f9190614712565b6001805460028054858455908490556004805493840190556040805183815260208101839052929391928592879290917f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a450505050565b60008082841115612ac4576000356001600160e01b0319166040516387f6f09560e01b8152600401610c3f9190614712565b5050603780546038805492859055839055600480546001810190915560408051838152602081018590529293928592879290917f31312c97b89cc751b832d98fd459b967a2c3eef3b49757d1cf5ebaa12bb6eee1910160405180910390a49250929050565b600254603754612b399190614fd0565b603854600154612b499190614fd0565b1115610bba576000356001600160e01b0319166040516387f6f09560e01b8152600401610c3f9190614712565b828114612ba4576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015612c1557828282818110612bc157612bc1614c31565b9050602002013560396000878785818110612bde57612bde614c31565b9050602002016020810190612bf391906141ad565b6001600160a01b03168152602081019190915260400160002055600101612ba7565b507f80bc635c452ae67f12f9b6f12ad4daa6dbbc04eeb9ebb87d354ce10c0e210dc08484848460405161182b94939291906150b9565b828114612c79576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015612d2657620f4240838383818110612c9a57612c9a614c31565b905060200201351115612cc05760405163572d3bd360e11b815260040160405180910390fd5b828282818110612cd257612cd2614c31565b90506020020135603b6000878785818110612cef57612cef614c31565b9050602002016020810190612d0491906141ad565b6001600160a01b03168152602081019190915260400160002055600101612c7c565b507fb05f5de88ae0294ebb6f67c5af2fcbbd593cc6bdfe543e2869794a4c8ce3ea508484848460405161182b94939291906150b9565b828114612d8a576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015612dfb57828282818110612da757612da7614c31565b90506020020135603c6000878785818110612dc457612dc4614c31565b9050602002016020810190612dd991906141ad565b6001600160a01b03168152602081019190915260400160002055600101612d8d565b507fb5d2963614d72181b4df1f993d45b83edf42fa19710f0204217ba1b3e183bb738484848460405161182b94939291906150b9565b6001600160a01b0382166000908152603a60205260408120548210612e5857506000610bfb565b6000612e676201518042615296565b6001600160a01b0385166000908152603e6020526040902054909150811115612ead5750506001600160a01b0382166000908152603c6020526040902054811015610bfb565b6001600160a01b0384166000908152603d6020526040902054612ed1908490615283565b6001600160a01b0385166000908152603c602052604090205411159150610bfb9050565b5092915050565b6000600254600160025484600154612f149190614fd0565b612f1e9190615283565b612f289190614fbd565b610bfb9190615296565b612f3a6121f5565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586121d83390565b806001600160a01b03163b60000361108a57604051630bfc64a360e21b81526001600160a01b0382166004820152602401610c3f565b612fae81611bfb565b6001600160a01b0316336001600160a01b03161461108a576000356001600160e01b03191681336040516320e0f98d60e21b8152600401610c3f939291906152b8565b60006110f683836138f9565b60008061300d8360400151613923565b9050600061301e8460600151613923565b905060006130728560800151604080517f1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d815282516020808301919091528301518183015291015160608201526080902090565b604080517fb9d1fe7c9deeec5dc90a2f47ff1684239519f2545b2228d3d91fb27df3189eea815287516020808301919091529097015190870152606086019390935250608084015260a08301525060c0902090565b6000620f42406130d78385614fd0565b6110f69190615296565b806001600160a01b0316826001600160a01b03160361318e5760408085015190516001600160a01b0385169180156108fc02916000818181858888f1935050505061318957806001600160a01b031663d0e30db085604001516040518263ffffffff1660e01b81526004016000604051808303818588803b15801561316557600080fd5b505af1158015613179573d6000803e3d6000fd5b505050505061318984848461396b565b610cdc565b6000845160028111156131a3576131a3614766565b03613269576040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156131ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061321391906152ef565b905084604001518110156132585761323b83308388604001516132369190614fbd565b6139ea565b61325857604051632f739fff60e11b815260040160405180910390fd5b61326385858561396b565b50610cdc565b60018451600281111561327e5761327e614766565b036132af5761329282848660200151613a8f565b6131895760405163c8e3a09f60e01b815260040160405180910390fd5b6002845160028111156132c4576132c4614766565b036132fa576132dd828486602001518760400151613ab6565b613189576040516334b471a760e21b815260040160405180910390fd5b6040516361e411a760e11b815260040160405180910390fd5b6000610bfb825490565b60006001600160e01b03198216635a05180f60e01b1480610bfb5750610bfb82613ae3565b61334c8282611839565b610e4f57613364816001600160a01b03166014613b18565b61336f836020613b18565b60405160200161338092919061532c565b60408051601f198184030181529082905262461bcd60e51b8252610c3f916004016153cd565b6133b08282611839565b610e4f5760008281526072602090815260408083206001600160a01b03851684529091529020805460ff191660011790556133e83390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006110f6836001600160a01b038416613cb3565b61344b8282611839565b15610e4f5760008281526072602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006110f6836001600160a01b038416613d02565b60005460ff16610bba5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610c3f565b61350f81613df5565b8061351e575061351e81613e2c565b8061352d575061352d81613e54565b61108a5760405163034992a760e51b815260040160405180910390fd5b60006060818551600281111561356257613562614766565b0361363d5760408581015181516001600160a01b03878116602483015230604483015260648083019390935283518083039093018352608490910183526020820180516001600160e01b03166323b872dd60e01b1790529151918516916135c991906153e0565b6000604051808303816000865af19150503d8060008114613606576040519150601f19603f3d011682016040523d82523d6000602084013e61360b565b606091505b5090925090508180156136365750805115806136365750808060200190518101906136369190615176565b9150613696565b60018551600281111561365257613652614766565b03613667576136368385308860200151613e7d565b60028551600281111561367c5761367c614766565b036132fa5761363683853088602001518960400151613f2b565b816136bc5784843085604051639d2e4c6760e01b8152600401610c3f94939291906153fc565b5050505050565b6137336040805160a08101825260008082526020808301829052835160608082018652838252818301849052818601849052848601919091528451808201865283815280830184905280860184905281850152845190810185528281529081018290529283015290608082015290565b83815260006020820181905250604080820180516001600160a01b039788169052602080890151825190891690820152905146908301528751606084018051918916909152805195909716940193909352935182015292909201516080820152919050565b6040805161190160f01b60208083019190915260228201859052604280830185905283518084039091018152606290920190925280519101206000906110f6565b60008060006137f0607d546001600160601b031690565b90506137fb81612efc565b9250600086600281111561381157613811614766565b03613860576001600160a01b03851660009081526039602052604090205484106138415761383e81613fdf565b92505b6001600160a01b0385166000908152603a602052604090205484101591505b50935093915050565b60006138786201518042615296565b6001600160a01b0384166000908152603e60205260409020549091508111156138c7576001600160a01b03929092166000908152603e6020908152604080832094909455603d90529190912055565b6001600160a01b0383166000908152603d6020526040812080548492906138ef908490615283565b9091555050505050565b600082600001828154811061391057613910614c31565b9060005260206000200154905092915050565b604080517f353bdd8d69b9e3185b3972e08b03845c0c14a21a390215302776a7a34b0e8764815282516020808301919091528301518183015291015160608201526080902090565b6000808451600281111561398157613981614766565b0361399c5761399582848660400151613ff7565b90506139c6565b6001845160028111156139b1576139b1614766565b036132fa576139958230858760200151613e7d565b80610cdc578383836040516341bd7d9160e11b8152600401610c3f93929190615432565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b03166340c10f1960e01b1790529151600092861691613a42916153e0565b6000604051808303816000865af19150503d8060008114613a7f576040519150601f19603f3d011682016040523d82523d6000602084013e613a84565b606091505b509095945050505050565b6000613a9d84308585613e7d565b9050806110f657613aaf8484846139ea565b90506110f6565b6000613ac58530868686613f2b565b905080613adb57613ad8858585856140ca565b90505b949350505050565b60006001600160e01b03198216637965db0b60e01b1480610bfb57506301ffc9a760e01b6001600160e01b0319831614610bfb565b60606000613b27836002614fd0565b613b32906002615283565b6001600160401b03811115613b4957613b4961457c565b6040519080825280601f01601f191660200182016040528015613b73576020820181803683370190505b509050600360fc1b81600081518110613b8e57613b8e614c31565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613bbd57613bbd614c31565b60200101906001600160f81b031916908160001a9053506000613be1846002614fd0565b613bec906001615283565b90505b6001811115613c64576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613c2057613c20614c31565b1a60f81b828281518110613c3657613c36614c31565b60200101906001600160f81b031916908160001a90535060049490941c93613c5d81615462565b9050613bef565b5083156110f65760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c3f565b6000818152600183016020526040812054613cfa57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610bfb565b506000610bfb565b60008181526001830160205260408120548015613deb576000613d26600183614fbd565b8554909150600090613d3a90600190614fbd565b9050818114613d9f576000866000018281548110613d5a57613d5a614c31565b9060005260206000200154905080876000018481548110613d7d57613d7d614c31565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613db057613db0615479565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610bfb565b6000915050610bfb565b60008082516002811115613e0b57613e0b614766565b148015613e1c575060008260400151115b8015610bfb575050602001511590565b6000600182516002811115613e4357613e43614766565b148015610bfb575050604001511590565b6000600282516002811115613e6b57613e6b614766565b148015610bfb57505060400151151590565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b1790529151600092871691613edd916153e0565b6000604051808303816000865af19150503d8060008114613f1a576040519150601f19603f3d011682016040523d82523d6000602084013e613f1f565b606091505b50909695505050505050565b604080516000808252602082019092526001600160a01b03871690613f5b9087908790879087906044810161548f565b60408051601f198184030181529181526020820180516001600160e01b0316637921219560e11b17905251613f9091906153e0565b6000604051808303816000865af19150503d8060008114613fcd576040519150601f19603f3d011682016040523d82523d6000602084013e613fd2565b606091505b5090979650505050505050565b6000603854600160385484603754612f149190614fd0565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000926060929087169161405491906153e0565b6000604051808303816000865af19150503d8060008114614091576040519150601f19603f3d011682016040523d82523d6000602084013e614096565b606091505b5090925090508180156140c15750805115806140c15750808060200190518101906140c19190615176565b95945050505050565b604080516000808252602082019092526001600160a01b038616906140f890869086908690604481016154d4565b60408051601f198184030181529181526020820180516001600160e01b031663731133e960e01b17905251613edd91906153e0565b60408051606081018252600080825260208201529081016141696040805160608101909152806000815260200160008152602001600081525090565b905290565b60006020828403121561418057600080fd5b81356001600160e01b0319811681146110f657600080fd5b6001600160a01b038116811461108a57600080fd5b6000602082840312156141bf57600080fd5b81356110f681614198565b60008083601f8401126141dc57600080fd5b5081356001600160401b038111156141f357600080fd5b6020830191508360208260051b85010111156118bc57600080fd5b6000806000806040858703121561422457600080fd5b84356001600160401b038082111561423b57600080fd5b614247888389016141ca565b9096509450602087013591508082111561426057600080fd5b5061426d878288016141ca565b95989497509550505050565b6000806000806000806060878903121561429257600080fd5b86356001600160401b03808211156142a957600080fd5b6142b58a838b016141ca565b909850965060208901359150808211156142ce57600080fd5b6142da8a838b016141ca565b909650945060408901359150808211156142f357600080fd5b5061430089828a016141ca565b979a9699509497509295939492505050565b80356119cd81614198565b60006020828403121561432f57600080fd5b5035919050565b6000806040838503121561434957600080fd5b82359150602083013561435b81614198565b809150509250929050565b600060a0828403121561437857600080fd5b50919050565b6000610160828403121561437857600080fd5b600080600061018084860312156143a757600080fd5b6143b1858561437e565b92506101608401356001600160401b03808211156143ce57600080fd5b818601915086601f8301126143e257600080fd5b8135818111156143f157600080fd5b87602060608302850101111561440657600080fd5b6020830194508093505050509250925092565b8060608101831015610bfb57600080fd5b8060808101831015610bfb57600080fd5b6000806000806000806000806000806101208b8d03121561445b57600080fd5b6144648b614312565b995061447260208c01614312565b985060408b0135975060608b0135965060808b0135955060a08b0135945060c08b01356001600160401b03808211156144aa57600080fd5b6144b68e838f01614419565b955060e08d01359150808211156144cc57600080fd5b6144d88e838f0161442a565b94506101008d01359150808211156144ef57600080fd5b506144fc8d828e016141ca565b915080935050809150509295989b9194979a5092959850565b6000806040838503121561452857600080fd5b823561453381614198565b946020939093013593505050565b8035601081106119cd57600080fd5b6000806040838503121561456357600080fd5b61456c83614541565b9150602083013561435b81614198565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b03811182821017156145b4576145b461457c565b60405290565b604051601f8201601f191681016001600160401b03811182821017156145e2576145e261457c565b604052919050565b60006001600160401b038211156146035761460361457c565b5060051b60200190565b801515811461108a57600080fd5b60008060008060006060868803121561463357600080fd5b85356001600160401b038082111561464a57600080fd5b61465689838a016141ca565b909750955060209150878201358181111561467057600080fd5b61467c8a828b016141ca565b90965094505060408801358181111561469457600080fd5b88019050601f810189136146a757600080fd5b80356146ba6146b5826145ea565b6145ba565b81815260059190911b8201830190838101908b8311156146d957600080fd5b928401925b828410156147005783356146f18161460d565b825292840192908401906146de565b80955050505050509295509295909350565b6001600160e01b031991909116815260200190565b6000806040838503121561473a57600080fd5b50508035926020909101359150565b6000610160828403121561475c57600080fd5b6110f6838361437e565b634e487b7160e01b600052602160045260246000fd5b6003811061478c5761478c614766565b9052565b60006040820190506147a382845161477c565b6020928301516001600160a01b0316919092015290565b600082601f8301126147cb57600080fd5b813560206147db6146b5836145ea565b8083825260208201915060208460051b8701019350868411156147fd57600080fd5b602086015b848110156148195780358352918301918301614802565b509695505050505050565b600082601f83011261483557600080fd5b81356001600160401b0381111561484e5761484e61457c565b614861601f8201601f19166020016145ba565b81815284602083860101111561487657600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a086880312156148ab57600080fd5b85356148b681614198565b945060208601356148c681614198565b935060408601356001600160401b03808211156148e257600080fd5b6148ee89838a016147ba565b9450606088013591508082111561490457600080fd5b61491089838a016147ba565b9350608088013591508082111561492657600080fd5b5061493388828901614824565b9150509295509295909350565b60006020828403121561495257600080fd5b6110f682614541565b60008060008060008060006080888a03121561497657600080fd5b87356001600160401b038082111561498d57600080fd5b6149998b838c016141ca565b909950975060208a01359150808211156149b257600080fd5b6149be8b838c016141ca565b909750955060408a01359150808211156149d757600080fd5b6149e38b838c016141ca565b909550935060608a01359150808211156149fc57600080fd5b50614a098a828b0161442a565b91505092959891949750929550565b600080600080600060a08688031215614a3057600080fd5b8535614a3b81614198565b94506020860135614a4b81614198565b9350604086013592506060860135915060808601356001600160401b03811115614a7457600080fd5b61493388828901614824565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b600082601f830112614adf57600080fd5b81516020614aef6146b5836145ea565b8083825260208201915060208460051b870101935086841115614b1157600080fd5b602086015b84811015614819578051614b2981614198565b8352918301918301614b16565b6001600160601b038116811461108a57600080fd5b600080600060608486031215614b6057600080fd5b83516001600160401b0380821115614b7757600080fd5b614b8387838801614ace565b9450602091508186015181811115614b9a57600080fd5b614ba688828901614ace565b945050604086015181811115614bbb57600080fd5b86019050601f81018713614bce57600080fd5b8051614bdc6146b5826145ea565b81815260059190911b82018301908381019089831115614bfb57600080fd5b928401925b82841015614c22578351614c1381614b36565b82529284019290840190614c00565b80955050505050509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6001600160601b03818116838216019080821115612ef557612ef5614c47565b8035600381106119cd57600080fd5b600060608284031215614c9e57600080fd5b614ca6614592565b9050614cb182614c7d565b8152602082013560208201526040820135604082015292915050565b600060a08284031215614cdf57600080fd5b614ce7614592565b8235614cf281614198565b81526020830135614d0281614198565b6020820152614d148460408501614c8c565b60408201529392505050565b600060608284031215614d3257600080fd5b614d3a614592565b823560ff81168114614d4b57600080fd5b8152602083810135908201526040928301359281019290925250919050565b6000808335601e19843603018112614d8157600080fd5b8301803591506001600160401b03821115614d9b57600080fd5b6020019150600581901b36038213156118bc57600080fd5b600060208284031215614dc557600080fd5b81356110f681614b36565b8035600281106119cd57600080fd5b600060608284031215614df157600080fd5b614df9614592565b90508135614e0681614198565b81526020820135614e1681614198565b806020830152506040820135604082015292915050565b60006101608284031215614e4057600080fd5b60405160a081018181106001600160401b0382111715614e6257614e6261457c565b60405282358152614e7560208401614dd0565b6020820152614e878460408501614ddf565b6040820152614e998460a08501614ddf565b6060820152614eac846101008501614c8c565b60808201529392505050565b6002811061478c5761478c614766565b8035614ed381614198565b6001600160a01b039081168352602082013590614eef82614198565b166020830152604090810135910152565b60006101808201905083825282356020830152614f1f60208401614dd0565b614f2c6040840182614eb8565b50614f3d6060830160408501614ec8565b614f4d60c0830160a08501614ec8565b610120614f68818401614f636101008701614c7d565b61477c565b61014081850135818501528085013561016085015250509392505050565b600060208284031215614f9857600080fd5b6110f682614c7d565b600060608284031215614fb357600080fd5b6110f68383614c8c565b81810381811115610bfb57610bfb614c47565b8082028115828204841417610bfb57610bfb614c47565b600060208284031215614ff957600080fd5b81356110f68161460d565b6001600160601b03828116828216039080821115612ef557612ef5614c47565b6010811061478c5761478c614766565b60208101610bfb8284615024565b6001600160e01b03198316815260408101600b831061506357615063614766565b8260208301529392505050565b8183526000602080850194508260005b858110156150ae57813561509381614198565b6001600160a01b031687529582019590820190600101615080565b509495945050505050565b6040815260006150cd604083018688615070565b82810360208401528381526001600160fb1b038411156150ec57600080fd5b8360051b80866020840137016020019695505050505050565b60608152600061511960608301888a615070565b6020838203602085015261512e82888a615070565b848103604086015285815286925060200160005b868110156151675761515782614f6386614c7d565b9282019290820190600101615142565b509a9950505050505050505050565b60006020828403121561518857600080fd5b81516110f68161460d565b6000600182016151a5576151a5614c47565b5060010190565b6151b782825161477c565b60208181015190830152604090810151910152565b6000610180820190508382528251602083015260208301516151f16040840182614eb8565b5060408381015180516001600160a01b03908116606086015260208201511660808501529081015160a084015250606083015180516001600160a01b0390811660c085015260208201511660e084015260408101516101008401525060808301516152606101208401826151ac565b509392505050565b60006020828403121561527a57600080fd5b6110f682614dd0565b80820180821115610bfb57610bfb614c47565b6000826152b357634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031984168152606081016152d66020830185615024565b6001600160a01b03929092166040919091015292915050565b60006020828403121561530157600080fd5b5051919050565b60005b8381101561532357818101518382015260200161530b565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615364816017850160208801615308565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615395816028840160208801615308565b01602801949350505050565b600081518084526153b9816020860160208601615308565b601f01601f19169290920160200192915050565b6020815260006110f660208301846153a1565b600082516153f2818460208701615308565b9190910192915050565b60c0810161540a82876151ac565b6001600160a01b0394851660608301529284166080820152921660a090920191909152919050565b60a0810161544082866151ac565b6001600160a01b03938416606083015291909216608090920191909152919050565b60008161547157615471614c47565b506000190190565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906154c9908301846153a1565b979650505050505050565b60018060a01b038516815283602082015282604082015260806060820152600061550160808301846153a1565b969550505050505056fe7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498a264697066735822122039bdd676fa56a806e2f91eb197d0a444b13ff0899114d328ae5983c28d58606164736f6c63430008170033", + "blockNumber": 5709370, + "bytecode": "0x60806040523480156200001157600080fd5b506000805460ff19169055620000266200002c565b620000ee565b607154610100900460ff1615620000995760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60715460ff9081161015620000ec576071805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61556180620000fe6000396000f3fe60806040526004361061039b5760003560e01c80638f34e347116101dc578063b9c3620911610102578063d55ed103116100a0578063dff525e11161006f578063dff525e114610b04578063e400327c14610b24578063e75235b814610b44578063f23a6e6114610b5c576103aa565b8063d55ed10314610a77578063d64af2a614610aa4578063dafae40814610ac4578063de981f1b14610ae4576103aa565b8063ca15c873116100dc578063ca15c873146109f2578063cdb6744414610a12578063d19773d214610a2a578063d547741f14610a57576103aa565b8063b9c3620914610986578063bc197c81146109a6578063c48549de146109d2576103aa565b8063a217fddf1161017a578063affed0e011610149578063affed0e0146108f6578063b1a2567e1461090c578063b1d08a031461092c578063b297579414610959576103aa565b8063a217fddf14610894578063a3912ec8146103a8578063ab796566146108a9578063ac78dfe8146108d6576103aa565b80639157921c116101b65780639157921c146107ff57806391d148541461081f57806393c5678f1461083f5780639dcc4da31461085f576103aa565b80638f34e3471461077e5780638f851d8a146107b25780639010d07c146107df576103aa565b806338e454b1116102c1578063504af48c1161025f5780636c1ce6701161022e5780636c1ce670146107145780637de5dedd146107345780638456cb5914610749578063865e6fd31461075e576103aa565b8063504af48c1461068f57806359122f6b146106a25780635c975abb146106cf5780636932be98146106e7576103aa565b80634b14557e1161029b5780634b14557e1461060c5780634d0d66731461061f5780634d493f4e1461063f5780634f4247a11461066f576103aa565b806338e454b1146105c25780633e70838b146105d75780633f4ba83a146105f7576103aa565b80631d4a7210116103395780632f2ff15d116103085780632f2ff15d14610556578063302d12db146105765780633644e5151461058d57806336568abe146105a2576103aa565b80631d4a7210146104c3578063248a9ca3146104f057806329b6eca9146105205780632dfdf0b514610540576103aa565b806317ce2dd41161037557806317ce2dd41461043f57806317fcb39b146104635780631a8e55b0146104835780631b6e7594146104a3576103aa565b806301ffc9a7146103b2578063065b3adf146103e7578063110a83081461041f576103aa565b366103aa576103a8610b88565b005b6103a8610b88565b3480156103be57600080fd5b506103d26103cd36600461416e565b610bbc565b60405190151581526020015b60405180910390f35b3480156103f357600080fd5b50600554610407906001600160a01b031681565b6040516001600160a01b0390911681526020016103de565b34801561042b57600080fd5b506103a861043a3660046141ad565b610c01565b34801561044b57600080fd5b5061045560755481565b6040519081526020016103de565b34801561046f57600080fd5b50607454610407906001600160a01b031681565b34801561048f57600080fd5b506103a861049e36600461420e565b610ca6565b3480156104af57600080fd5b506103a86104be366004614279565b610ce2565b3480156104cf57600080fd5b506104556104de3660046141ad565b603e6020526000908152604090205481565b3480156104fc57600080fd5b5061045561050b36600461431d565b60009081526072602052604090206001015490565b34801561052c57600080fd5b506103a861053b3660046141ad565b610d22565b34801561054c57600080fd5b5061045560765481565b34801561056257600080fd5b506103a8610571366004614336565b610dab565b34801561058257600080fd5b50610455620f424081565b34801561059957600080fd5b50607754610455565b3480156105ae57600080fd5b506103a86105bd366004614336565b610dd5565b3480156105ce57600080fd5b506103a8610e53565b3480156105e357600080fd5b506103a86105f23660046141ad565b611030565b34801561060357600080fd5b506103a861105a565b6103a861061a366004614366565b61106a565b34801561062b57600080fd5b506103d261063a366004614391565b61108d565b34801561064b57600080fd5b506103d261065a36600461431d565b607a6020526000908152604090205460ff1681565b34801561067b57600080fd5b50607f54610407906001600160a01b031681565b6103a861069d36600461443b565b6110fd565b3480156106ae57600080fd5b506104556106bd3660046141ad565b603a6020526000908152604090205481565b3480156106db57600080fd5b5060005460ff166103d2565b3480156106f357600080fd5b5061045561070236600461431d565b60796020526000908152604090205481565b34801561072057600080fd5b506103d261072f366004614515565b6113c3565b34801561074057600080fd5b506104556113cf565b34801561075557600080fd5b506103a86113f0565b34801561076a57600080fd5b506103a8610779366004614550565b611400565b34801561078a57600080fd5b506104557f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e481565b3480156107be57600080fd5b506107d26107cd36600461461b565b61141b565b6040516103de9190614712565b3480156107eb57600080fd5b506104076107fa366004614727565b61159d565b34801561080b57600080fd5b506103a861081a366004614749565b6115b5565b34801561082b57600080fd5b506103d261083a366004614336565b611839565b34801561084b57600080fd5b506103a861085a36600461420e565b611864565b34801561086b57600080fd5b5061087f61087a366004614727565b61189a565b604080519283526020830191909152016103de565b3480156108a057600080fd5b50610455600081565b3480156108b557600080fd5b506104556108c43660046141ad565b603c6020526000908152604090205481565b3480156108e257600080fd5b506103d26108f136600461431d565b6118c3565b34801561090257600080fd5b5061045560045481565b34801561091857600080fd5b506103a861092736600461420e565b6118f9565b34801561093857600080fd5b506104556109473660046141ad565b60396020526000908152604090205481565b34801561096557600080fd5b506109796109743660046141ad565b61192f565b6040516103de9190614790565b34801561099257600080fd5b506103a86109a1366004614727565b6119d2565b3480156109b257600080fd5b506107d26109c1366004614893565b63bc197c8160e01b95945050505050565b3480156109de57600080fd5b506107d26109ed36600461420e565b6119ec565b3480156109fe57600080fd5b50610455610a0d36600461431d565b611b80565b348015610a1e57600080fd5b5060375460385461087f565b348015610a3657600080fd5b50610455610a453660046141ad565b603b6020526000908152604090205481565b348015610a6357600080fd5b506103a8610a72366004614336565b611b97565b348015610a8357600080fd5b50610455610a923660046141ad565b603d6020526000908152604090205481565b348015610ab057600080fd5b506103a8610abf3660046141ad565b611bbc565b348015610ad057600080fd5b506103d2610adf36600461431d565b611bcd565b348015610af057600080fd5b50610407610aff366004614940565b611bfb565b348015610b1057600080fd5b506103a8610b1f36600461495b565b611c71565b348015610b3057600080fd5b506103a8610b3f36600461420e565b611ce6565b348015610b5057600080fd5b5060015460025461087f565b348015610b6857600080fd5b506107d2610b77366004614a18565b63f23a6e6160e01b95945050505050565b6074546001600160a01b0316331480610bab5750607f546001600160a01b031633145b15610bb257565b610bba611d1c565b565b60006001600160e01b031982166246560160e51b1480610bec57506001600160e01b031982166312c0151560e21b145b80610bfb5750610bfb82611d46565b92915050565b607154600490610100900460ff16158015610c23575060715460ff8083169116105b610c485760405162461bcd60e51b8152600401610c3f90614a80565b60405180910390fd5b60718054607f80546001600160a01b0319166001600160a01b03861617905561ff001961010060ff851661ffff199093168317171690915560405190815260008051602061550c833981519152906020015b60405180910390a15050565b610cae611d6b565b6000839003610cd0576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484611dc5565b50505050565b610cea611d6b565b6000859003610d0c576040516316ee9d3b60e11b815260040160405180910390fd5b610d1a868686868686611e9a565b505050505050565b607154600290610100900460ff16158015610d44575060715460ff8083169116105b610d605760405162461bcd60e51b8152600401610c3f90614a80565b6071805461ffff191660ff831617610100179055610d7f600b83612042565b6071805461ff001916905560405160ff8216815260008051602061550c83398151915290602001610c9a565b600082815260726020526040902060010154610dc6816120e6565b610dd083836120f0565b505050565b6001600160a01b0381163314610e455760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610c3f565b610e4f8282612112565b5050565b607154600390610100900460ff16158015610e75575060715460ff8083169116105b610e915760405162461bcd60e51b8152600401610c3f90614a80565b6071805461ffff191660ff8316176101001790556000610eb1600b611bfb565b9050600080826001600160a01b031663c441c4a86040518163ffffffff1660e01b8152600401600060405180830381865afa158015610ef4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f1c9190810190614b4b565b92509250506000805b8351811015610fd957828181518110610f4057610f40614c31565b6020026020010151607e6000868481518110610f5e57610f5e614c31565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154816001600160601b0302191690836001600160601b03160217905550828181518110610fbc57610fbc614c31565b602002602001015182610fcf9190614c5d565b9150600101610f25565b50607d80546001600160601b0319166001600160601b039290921691909117905550506071805461ff00191690555060405160ff8216815260008051602061550c833981519152906020015b60405180910390a150565b611038611d6b565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b611062612134565b610bba6121a3565b6110726121f5565b61108a61108436839003830183614ccd565b3361223b565b50565b60006110976121f5565b6110f3848484808060200260200160405190810160405280939291908181526020016000905b828210156110e9576110da60608302860136819003810190614d20565b815260200190600101906110bd565b5050505050612516565b90505b9392505050565b607154610100900460ff161580801561111d5750607154600160ff909116105b806111375750303b158015611137575060715460ff166001145b6111535760405162461bcd60e51b8152600401610c3f90614a80565b6071805460ff191660011790558015611176576071805461ff0019166101001790555b61118160008c6129aa565b607589905561118f8a6129b4565b61121a6040517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81527f159f52c1e3a2b6a6aad3950adf713516211484e0516dad685ea662a094b7c43b60208201527fad7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5604082015246606082015230608082015260a0812060775550565b6112248887612a02565b61122e8787612a92565b5050611238612b29565b60006112448680614d6a565b905011156113055761126d6112598680614d6a565b6112666020890189614d6a565b8787611e9a565b61129361127a8680614d6a565b8660005b60200281019061128e9190614d6a565b612b76565b6112b96112a08680614d6a565b8660015b6020028101906112b49190614d6a565b611dc5565b6112df6112c68680614d6a565b8660025b6020028101906112da9190614d6a565b612c4b565b6113056112ec8680614d6a565b8660035b6020028101906113009190614d6a565b612d5c565b60005b6113156040870187614d6a565b9050811015611381576113797f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e461134f6040890189614d6a565b8481811061135f5761135f614c31565b905060200201602081019061137491906141ad565b6120f0565b600101611308565b5080156113b6576071805461ff00191690556040516001815260008051602061550c8339815191529060200160405180910390a15b5050505050505050505050565b60006110f68383612e31565b60006113eb6113e6607d546001600160601b031690565b612efc565b905090565b6113f8612134565b610bba612f32565b611408611d6b565b61141181612f6f565b610e4f8282612042565b6000600b61142881612fa5565b825186908114158061143a5750808514155b15611466576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b8060000361147e57506347c28ec560e11b9150611593565b60005b818110156115865784818151811061149b5761149b614c31565b60200260200101511561157e578686828181106114ba576114ba614c31565b90506020020160208101906114cf9190614db3565b607d80546001600160601b031981166001600160601b03918216939093011691909117905586868281811061150657611506614c31565b905060200201602081019061151b9190614db3565b607e60008b8b8581811061153157611531614c31565b905060200201602081019061154691906141ad565b6001600160a01b03168152602081019190915260400160002080546001600160601b0319166001600160601b03929092169190911790555b600101611481565b506347c28ec560e11b9250505b5095945050505050565b60008281526073602052604081206110f69083612ff1565b7f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e46115df816120e6565b60006115f86115f336859003850185614e2d565b612ffd565b905061160c6115f336859003850185614e2d565b83356000908152607960205260409020541461163b5760405163f4b8742f60e01b815260040160405180910390fd5b82356000908152607a602052604090205460ff1661166c5760405163147bfe0760e01b815260040160405180910390fd5b82356000908152607a602052604090819020805460ff19169055517fd639511b37b3b002cca6cfe6bca0d833945a5af5a045578a0627fc43b79b2630906116b69083908690614f00565b60405180910390a160006116d060808501606086016141ad565b905060006116e661012086016101008701614f86565b60028111156116f7576116f7614766565b036117be5760006117113686900386016101008701614fa1565b6001600160a01b0383166000908152603b602052604090205490915061173d90610140870135906130c7565b604082015260006117573687900387016101008801614fa1565b604083015190915061176e90610140880135614fbd565b604082015260745461178e908390339086906001600160a01b03166130e1565b6117b76117a160608801604089016141ad565b60745483919086906001600160a01b03166130e1565b50506117fa565b6117fa6117d160608601604087016141ad565b60745483906001600160a01b03166117f23689900389016101008a01614fa1565b9291906130e1565b7f21e88e956aa3e086f6388e899965cef814688f99ad8bb29b08d396571016372d828560405161182b929190614f00565b60405180910390a150505050565b60009182526072602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61186c611d6b565b600083900361188e576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484612b76565b6000806118a5611d6b565b6118af8484612a92565b90925090506118bc612b29565b9250929050565b60006118d7607d546001600160601b031690565b6037546118e49190614fd0565b6038546118f19084614fd0565b101592915050565b611901611d6b565b6000839003611923576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484612c4b565b60408051808201909152600080825260208201526001600160a01b0382166000908152607860205260409081902081518083019092528054829060ff16600281111561197d5761197d614766565b600281111561198e5761198e614766565b815290546001600160a01b03610100909104811660209283015290820151919250166119cd57604051631b79f53b60e21b815260040160405180910390fd5b919050565b6119da611d6b565b6119e48282612a02565b610e4f612b29565b6000600b6119f981612fa5565b84838114611a28576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b80600003611a405750636242a4ef60e11b9150611b77565b6000805b82811015611b2757868682818110611a5e57611a5e614c31565b9050602002016020810190611a739190614fe7565b15611b1f57607e60008a8a84818110611a8e57611a8e614c31565b9050602002016020810190611aa391906141ad565b6001600160a01b0316815260208101919091526040016000908120546001600160601b03169290920191607e908a8a84818110611ae257611ae2614c31565b9050602002016020810190611af791906141ad565b6001600160a01b03168152602081019190915260400160002080546001600160601b03191690555b600101611a44565b50607d8054829190600090611b469084906001600160601b0316615004565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555063c48549de60e01b935050505b50949350505050565b6000818152607360205260408120610bfb90613313565b600082815260726020526040902060010154611bb2816120e6565b610dd08383612112565b611bc4611d6b565b61108a816129b4565b6000611be1607d546001600160601b031690565b600154611bee9190614fd0565b6002546118f19084614fd0565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115611c3257611c32614766565b60ff1681526020810191909152604001600020546001600160a01b03169050806119cd578160405163409140df60e11b8152600401610c3f9190615034565b611c79611d6b565b6000869003611c9b576040516316ee9d3b60e11b815260040160405180910390fd5b611ca9878787878787611e9a565b611cb6878783600061127e565b611cc387878360016112a4565b611cd087878360026112ca565b611cdd87878360036112f0565b50505050505050565b611cee611d6b565b6000839003611d10576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484612d5c565b611d246121f5565b611d2c61412d565b33815260408082015134910152805161108a90829061223b565b60006001600160e01b03198216630271189760e51b1480610bfb5750610bfb8261331d565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610bba576000356001600160e01b0319166001604051620f948f60ea1b8152600401610c3f929190615042565b828114611df3576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015611e6457828282818110611e1057611e10614c31565b90506020020135603a6000878785818110611e2d57611e2d614c31565b9050602002016020810190611e4291906141ad565b6001600160a01b03168152602081019190915260400160002055600101611df6565b507f64557254143204d91ba2d95acb9fda1e5fea55f77efd028685765bc1e94dd4b58484848460405161182b94939291906150b9565b8483148015611ea857508481145b611ed3576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b85811015611ff857848482818110611ef057611ef0614c31565b9050602002016020810190611f0591906141ad565b60786000898985818110611f1b57611f1b614c31565b9050602002016020810190611f3091906141ad565b6001600160a01b03908116825260208201929092526040016000208054610100600160a81b0319166101009390921692909202179055828282818110611f7857611f78614c31565b9050602002016020810190611f8d9190614f86565b60786000898985818110611fa357611fa3614c31565b9050602002016020810190611fb891906141ad565b6001600160a01b031681526020810191909152604001600020805460ff19166001836002811115611feb57611feb614766565b0217905550600101611ed6565b507fa4f03cc9c0e0aeb5b71b4ec800702753f65748c2cf3064695ba8e8b46be7044486868686868660405161203296959493929190615105565b60405180910390a1505050505050565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f81111561207857612078614766565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f8111156120b9576120b9614766565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b61108a8133613342565b6120fa82826133a6565b6000828152607360205260409020610dd0908261342c565b61211c8282613441565b6000828152607360205260409020610dd090826134a8565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031633148061217657506005546001600160a01b031633145b610bba576000356001600160e01b0319166001604051620f948f60ea1b8152600401610c3f929190615042565b6121ab6134bd565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60005460ff1615610bba5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610c3f565b604080518082018252600080825260208201526074549184015190916001600160a01b03169061226a90613506565b60208401516001600160a01b031661230b5734846040015160400151146122a45760405163129c2ce160e31b815260040160405180910390fd5b6122ad8161192f565b60408501515190925060028111156122c7576122c7614766565b825160028111156122da576122da614766565b146122f75760405162035e2b60ea1b815260040160405180910390fd5b6001600160a01b03811660208501526124a3565b341561232a5760405163129c2ce160e31b815260040160405180910390fd5b612337846020015161192f565b604085015151909250600281111561235157612351614766565b8251600281111561236457612364614766565b146123815760405162035e2b60ea1b815260040160405180910390fd5b6020840151604085015161239691859061354a565b83602001516001600160a01b0316816001600160a01b0316036124a357607454607f54604086810151810151905163095ea7b360e01b81526001600160a01b039283166004820152602481019190915291169063095ea7b3906044016020604051808303816000875af1158015612411573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124359190615176565b50607f546040808601518101519051636f074d1f60e11b81526001600160a01b039092169163de0e9a3e916124709160040190815260200190565b600060405180830381600087803b15801561248a57600080fd5b505af115801561249e573d6000803e3d6000fd5b505050505b60768054600091826124b483615193565b91905055905060006124db858386602001516075548a6136c390949392919063ffffffff16565b90507fd7b25068d9dc8d00765254cfb7f5070f98d263c8d68931d937c7362fa738048b61250782612ffd565b826040516120329291906151cc565b600082356101408401358261253160808701606088016141ad565b905061254e6125493688900388016101008901614fa1565b613506565b60016125606040880160208901615268565b600181111561257157612571614766565b1461258f5760405163182f3d8760e11b815260040160405180910390fd5b608086013546146125d15760405163092048d160e11b81526000356001600160e01b031916600482015260808701356024820152466044820152606401610c3f565b60006125e66109746080890160608a016141ad565b90506125fa61012088016101008901614f86565b600281111561260b5761260b614766565b8151600281111561261e5761261e614766565b14801561264f575061263660e0880160c089016141ad565b6001600160a01b031681602001516001600160a01b0316145b8015612660575060755460e0880135145b61267d5760405163f4b8742f60e01b815260040160405180910390fd5b600084815260796020526040902054156126aa57604051634f13df6160e01b815260040160405180910390fd5b60016126be61012089016101008a01614f86565b60028111156126cf576126cf614766565b14806126e257506126e08284612e31565b155b6126ff5760405163c51297b760e01b815260040160405180910390fd5b60006127136115f3368a90038a018a614e2d565b9050600061272360775483613798565b9050600061274361273c6101208c016101008d01614f86565b86886137d9565b60408051606081018252600080825260208201819052918101829052919a50919250819081906000805b8e51811015612881578e818151811061278857612788614c31565b6020908102919091018101518051818301516040808401518151600081529586018083528e905260ff9093169085015260608401526080830152935060019060a0016020604051602081039080840390855afa1580156127ec573d6000803e3d6000fd5b505050602060405103519450846001600160a01b0316846001600160a01b031610612838576000356001600160e01b031916604051635d3dcd3160e01b8152600401610c3f9190614712565b6001600160a01b0385166000908152607e60205260409020548594506001600160601b03166128679083615283565b91508682106128795760019550612881565b60010161276d565b50846128a057604051639e8f5f6360e01b815260040160405180910390fd5b50505060008981526079602052604090208590555050871561291b576000878152607a602052604090819020805460ff19166001179055517f89e52969465b1f1866fc5d46fd62de953962e9cb33552443cd999eba05bd20dc906129079085908d90614f00565b60405180910390a150505050505050610bfb565b6129258587613869565b61296461293860608c0160408d016141ad565b86607460009054906101000a90046001600160a01b03168d610100018036038101906117f29190614fa1565b7f21e88e956aa3e086f6388e899965cef814688f99ad8bb29b08d396571016372d838b604051612995929190614f00565b60405180910390a15050505050505092915050565b610e4f82826120f0565b607480546001600160a01b0319166001600160a01b0383169081179091556040519081527f9d2334c23be647e994f27a72c5eee42a43d5bdcfe15bb88e939103c2b114cbaf90602001611025565b80821115612a31576000356001600160e01b0319166040516387f6f09560e01b8152600401610c3f9190614712565b6001805460028054858455908490556004805493840190556040805183815260208101839052929391928592879290917f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a450505050565b60008082841115612ac4576000356001600160e01b0319166040516387f6f09560e01b8152600401610c3f9190614712565b5050603780546038805492859055839055600480546001810190915560408051838152602081018590529293928592879290917f31312c97b89cc751b832d98fd459b967a2c3eef3b49757d1cf5ebaa12bb6eee1910160405180910390a49250929050565b600254603754612b399190614fd0565b603854600154612b499190614fd0565b1115610bba576000356001600160e01b0319166040516387f6f09560e01b8152600401610c3f9190614712565b828114612ba4576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015612c1557828282818110612bc157612bc1614c31565b9050602002013560396000878785818110612bde57612bde614c31565b9050602002016020810190612bf391906141ad565b6001600160a01b03168152602081019190915260400160002055600101612ba7565b507f80bc635c452ae67f12f9b6f12ad4daa6dbbc04eeb9ebb87d354ce10c0e210dc08484848460405161182b94939291906150b9565b828114612c79576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015612d2657620f4240838383818110612c9a57612c9a614c31565b905060200201351115612cc05760405163572d3bd360e11b815260040160405180910390fd5b828282818110612cd257612cd2614c31565b90506020020135603b6000878785818110612cef57612cef614c31565b9050602002016020810190612d0491906141ad565b6001600160a01b03168152602081019190915260400160002055600101612c7c565b507fb05f5de88ae0294ebb6f67c5af2fcbbd593cc6bdfe543e2869794a4c8ce3ea508484848460405161182b94939291906150b9565b828114612d8a576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015612dfb57828282818110612da757612da7614c31565b90506020020135603c6000878785818110612dc457612dc4614c31565b9050602002016020810190612dd991906141ad565b6001600160a01b03168152602081019190915260400160002055600101612d8d565b507fb5d2963614d72181b4df1f993d45b83edf42fa19710f0204217ba1b3e183bb738484848460405161182b94939291906150b9565b6001600160a01b0382166000908152603a60205260408120548210612e5857506000610bfb565b6000612e676201518042615296565b6001600160a01b0385166000908152603e6020526040902054909150811115612ead5750506001600160a01b0382166000908152603c6020526040902054811015610bfb565b6001600160a01b0384166000908152603d6020526040902054612ed1908490615283565b6001600160a01b0385166000908152603c602052604090205411159150610bfb9050565b5092915050565b6000600254600160025484600154612f149190614fd0565b612f1e9190615283565b612f289190614fbd565b610bfb9190615296565b612f3a6121f5565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586121d83390565b806001600160a01b03163b60000361108a57604051630bfc64a360e21b81526001600160a01b0382166004820152602401610c3f565b612fae81611bfb565b6001600160a01b0316336001600160a01b03161461108a576000356001600160e01b03191681336040516320e0f98d60e21b8152600401610c3f939291906152b8565b60006110f683836138f9565b60008061300d8360400151613923565b9050600061301e8460600151613923565b905060006130728560800151604080517f1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d815282516020808301919091528301518183015291015160608201526080902090565b604080517fb9d1fe7c9deeec5dc90a2f47ff1684239519f2545b2228d3d91fb27df3189eea815287516020808301919091529097015190870152606086019390935250608084015260a08301525060c0902090565b6000620f42406130d78385614fd0565b6110f69190615296565b806001600160a01b0316826001600160a01b03160361318e5760408085015190516001600160a01b0385169180156108fc02916000818181858888f1935050505061318957806001600160a01b031663d0e30db085604001516040518263ffffffff1660e01b81526004016000604051808303818588803b15801561316557600080fd5b505af1158015613179573d6000803e3d6000fd5b505050505061318984848461396b565b610cdc565b6000845160028111156131a3576131a3614766565b03613269576040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156131ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061321391906152ef565b905084604001518110156132585761323b83308388604001516132369190614fbd565b6139ea565b61325857604051632f739fff60e11b815260040160405180910390fd5b61326385858561396b565b50610cdc565b60018451600281111561327e5761327e614766565b036132af5761329282848660200151613a8f565b6131895760405163c8e3a09f60e01b815260040160405180910390fd5b6002845160028111156132c4576132c4614766565b036132fa576132dd828486602001518760400151613ab6565b613189576040516334b471a760e21b815260040160405180910390fd5b6040516361e411a760e11b815260040160405180910390fd5b6000610bfb825490565b60006001600160e01b03198216635a05180f60e01b1480610bfb5750610bfb82613ae3565b61334c8282611839565b610e4f57613364816001600160a01b03166014613b18565b61336f836020613b18565b60405160200161338092919061532c565b60408051601f198184030181529082905262461bcd60e51b8252610c3f916004016153cd565b6133b08282611839565b610e4f5760008281526072602090815260408083206001600160a01b03851684529091529020805460ff191660011790556133e83390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006110f6836001600160a01b038416613cb3565b61344b8282611839565b15610e4f5760008281526072602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006110f6836001600160a01b038416613d02565b60005460ff16610bba5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610c3f565b61350f81613df5565b8061351e575061351e81613e2c565b8061352d575061352d81613e54565b61108a5760405163034992a760e51b815260040160405180910390fd5b60006060818551600281111561356257613562614766565b0361363d5760408581015181516001600160a01b03878116602483015230604483015260648083019390935283518083039093018352608490910183526020820180516001600160e01b03166323b872dd60e01b1790529151918516916135c991906153e0565b6000604051808303816000865af19150503d8060008114613606576040519150601f19603f3d011682016040523d82523d6000602084013e61360b565b606091505b5090925090508180156136365750805115806136365750808060200190518101906136369190615176565b9150613696565b60018551600281111561365257613652614766565b03613667576136368385308860200151613e7d565b60028551600281111561367c5761367c614766565b036132fa5761363683853088602001518960400151613f2b565b816136bc5784843085604051639d2e4c6760e01b8152600401610c3f94939291906153fc565b5050505050565b6137336040805160a08101825260008082526020808301829052835160608082018652838252818301849052818601849052848601919091528451808201865283815280830184905280860184905281850152845190810185528281529081018290529283015290608082015290565b83815260006020820181905250604080820180516001600160a01b039788169052602080890151825190891690820152905146908301528751606084018051918916909152805195909716940193909352935182015292909201516080820152919050565b6040805161190160f01b60208083019190915260228201859052604280830185905283518084039091018152606290920190925280519101206000906110f6565b60008060006137f0607d546001600160601b031690565b90506137fb81612efc565b9250600086600281111561381157613811614766565b03613860576001600160a01b03851660009081526039602052604090205484106138415761383e81613fdf565b92505b6001600160a01b0385166000908152603a602052604090205484101591505b50935093915050565b60006138786201518042615296565b6001600160a01b0384166000908152603e60205260409020549091508111156138c7576001600160a01b03929092166000908152603e6020908152604080832094909455603d90529190912055565b6001600160a01b0383166000908152603d6020526040812080548492906138ef908490615283565b9091555050505050565b600082600001828154811061391057613910614c31565b9060005260206000200154905092915050565b604080517f353bdd8d69b9e3185b3972e08b03845c0c14a21a390215302776a7a34b0e8764815282516020808301919091528301518183015291015160608201526080902090565b6000808451600281111561398157613981614766565b0361399c5761399582848660400151613ff7565b90506139c6565b6001845160028111156139b1576139b1614766565b036132fa576139958230858760200151613e7d565b80610cdc578383836040516341bd7d9160e11b8152600401610c3f93929190615432565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b03166340c10f1960e01b1790529151600092861691613a42916153e0565b6000604051808303816000865af19150503d8060008114613a7f576040519150601f19603f3d011682016040523d82523d6000602084013e613a84565b606091505b509095945050505050565b6000613a9d84308585613e7d565b9050806110f657613aaf8484846139ea565b90506110f6565b6000613ac58530868686613f2b565b905080613adb57613ad8858585856140ca565b90505b949350505050565b60006001600160e01b03198216637965db0b60e01b1480610bfb57506301ffc9a760e01b6001600160e01b0319831614610bfb565b60606000613b27836002614fd0565b613b32906002615283565b6001600160401b03811115613b4957613b4961457c565b6040519080825280601f01601f191660200182016040528015613b73576020820181803683370190505b509050600360fc1b81600081518110613b8e57613b8e614c31565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613bbd57613bbd614c31565b60200101906001600160f81b031916908160001a9053506000613be1846002614fd0565b613bec906001615283565b90505b6001811115613c64576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613c2057613c20614c31565b1a60f81b828281518110613c3657613c36614c31565b60200101906001600160f81b031916908160001a90535060049490941c93613c5d81615462565b9050613bef565b5083156110f65760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c3f565b6000818152600183016020526040812054613cfa57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610bfb565b506000610bfb565b60008181526001830160205260408120548015613deb576000613d26600183614fbd565b8554909150600090613d3a90600190614fbd565b9050818114613d9f576000866000018281548110613d5a57613d5a614c31565b9060005260206000200154905080876000018481548110613d7d57613d7d614c31565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613db057613db0615479565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610bfb565b6000915050610bfb565b60008082516002811115613e0b57613e0b614766565b148015613e1c575060008260400151115b8015610bfb575050602001511590565b6000600182516002811115613e4357613e43614766565b148015610bfb575050604001511590565b6000600282516002811115613e6b57613e6b614766565b148015610bfb57505060400151151590565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b1790529151600092871691613edd916153e0565b6000604051808303816000865af19150503d8060008114613f1a576040519150601f19603f3d011682016040523d82523d6000602084013e613f1f565b606091505b50909695505050505050565b604080516000808252602082019092526001600160a01b03871690613f5b9087908790879087906044810161548f565b60408051601f198184030181529181526020820180516001600160e01b0316637921219560e11b17905251613f9091906153e0565b6000604051808303816000865af19150503d8060008114613fcd576040519150601f19603f3d011682016040523d82523d6000602084013e613fd2565b606091505b5090979650505050505050565b6000603854600160385484603754612f149190614fd0565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000926060929087169161405491906153e0565b6000604051808303816000865af19150503d8060008114614091576040519150601f19603f3d011682016040523d82523d6000602084013e614096565b606091505b5090925090508180156140c15750805115806140c15750808060200190518101906140c19190615176565b95945050505050565b604080516000808252602082019092526001600160a01b038616906140f890869086908690604481016154d4565b60408051601f198184030181529181526020820180516001600160e01b031663731133e960e01b17905251613edd91906153e0565b60408051606081018252600080825260208201529081016141696040805160608101909152806000815260200160008152602001600081525090565b905290565b60006020828403121561418057600080fd5b81356001600160e01b0319811681146110f657600080fd5b6001600160a01b038116811461108a57600080fd5b6000602082840312156141bf57600080fd5b81356110f681614198565b60008083601f8401126141dc57600080fd5b5081356001600160401b038111156141f357600080fd5b6020830191508360208260051b85010111156118bc57600080fd5b6000806000806040858703121561422457600080fd5b84356001600160401b038082111561423b57600080fd5b614247888389016141ca565b9096509450602087013591508082111561426057600080fd5b5061426d878288016141ca565b95989497509550505050565b6000806000806000806060878903121561429257600080fd5b86356001600160401b03808211156142a957600080fd5b6142b58a838b016141ca565b909850965060208901359150808211156142ce57600080fd5b6142da8a838b016141ca565b909650945060408901359150808211156142f357600080fd5b5061430089828a016141ca565b979a9699509497509295939492505050565b80356119cd81614198565b60006020828403121561432f57600080fd5b5035919050565b6000806040838503121561434957600080fd5b82359150602083013561435b81614198565b809150509250929050565b600060a0828403121561437857600080fd5b50919050565b6000610160828403121561437857600080fd5b600080600061018084860312156143a757600080fd5b6143b1858561437e565b92506101608401356001600160401b03808211156143ce57600080fd5b818601915086601f8301126143e257600080fd5b8135818111156143f157600080fd5b87602060608302850101111561440657600080fd5b6020830194508093505050509250925092565b8060608101831015610bfb57600080fd5b8060808101831015610bfb57600080fd5b6000806000806000806000806000806101208b8d03121561445b57600080fd5b6144648b614312565b995061447260208c01614312565b985060408b0135975060608b0135965060808b0135955060a08b0135945060c08b01356001600160401b03808211156144aa57600080fd5b6144b68e838f01614419565b955060e08d01359150808211156144cc57600080fd5b6144d88e838f0161442a565b94506101008d01359150808211156144ef57600080fd5b506144fc8d828e016141ca565b915080935050809150509295989b9194979a5092959850565b6000806040838503121561452857600080fd5b823561453381614198565b946020939093013593505050565b8035601081106119cd57600080fd5b6000806040838503121561456357600080fd5b61456c83614541565b9150602083013561435b81614198565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b03811182821017156145b4576145b461457c565b60405290565b604051601f8201601f191681016001600160401b03811182821017156145e2576145e261457c565b604052919050565b60006001600160401b038211156146035761460361457c565b5060051b60200190565b801515811461108a57600080fd5b60008060008060006060868803121561463357600080fd5b85356001600160401b038082111561464a57600080fd5b61465689838a016141ca565b909750955060209150878201358181111561467057600080fd5b61467c8a828b016141ca565b90965094505060408801358181111561469457600080fd5b88019050601f810189136146a757600080fd5b80356146ba6146b5826145ea565b6145ba565b81815260059190911b8201830190838101908b8311156146d957600080fd5b928401925b828410156147005783356146f18161460d565b825292840192908401906146de565b80955050505050509295509295909350565b6001600160e01b031991909116815260200190565b6000806040838503121561473a57600080fd5b50508035926020909101359150565b6000610160828403121561475c57600080fd5b6110f6838361437e565b634e487b7160e01b600052602160045260246000fd5b6003811061478c5761478c614766565b9052565b60006040820190506147a382845161477c565b6020928301516001600160a01b0316919092015290565b600082601f8301126147cb57600080fd5b813560206147db6146b5836145ea565b8083825260208201915060208460051b8701019350868411156147fd57600080fd5b602086015b848110156148195780358352918301918301614802565b509695505050505050565b600082601f83011261483557600080fd5b81356001600160401b0381111561484e5761484e61457c565b614861601f8201601f19166020016145ba565b81815284602083860101111561487657600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a086880312156148ab57600080fd5b85356148b681614198565b945060208601356148c681614198565b935060408601356001600160401b03808211156148e257600080fd5b6148ee89838a016147ba565b9450606088013591508082111561490457600080fd5b61491089838a016147ba565b9350608088013591508082111561492657600080fd5b5061493388828901614824565b9150509295509295909350565b60006020828403121561495257600080fd5b6110f682614541565b60008060008060008060006080888a03121561497657600080fd5b87356001600160401b038082111561498d57600080fd5b6149998b838c016141ca565b909950975060208a01359150808211156149b257600080fd5b6149be8b838c016141ca565b909750955060408a01359150808211156149d757600080fd5b6149e38b838c016141ca565b909550935060608a01359150808211156149fc57600080fd5b50614a098a828b0161442a565b91505092959891949750929550565b600080600080600060a08688031215614a3057600080fd5b8535614a3b81614198565b94506020860135614a4b81614198565b9350604086013592506060860135915060808601356001600160401b03811115614a7457600080fd5b61493388828901614824565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b600082601f830112614adf57600080fd5b81516020614aef6146b5836145ea565b8083825260208201915060208460051b870101935086841115614b1157600080fd5b602086015b84811015614819578051614b2981614198565b8352918301918301614b16565b6001600160601b038116811461108a57600080fd5b600080600060608486031215614b6057600080fd5b83516001600160401b0380821115614b7757600080fd5b614b8387838801614ace565b9450602091508186015181811115614b9a57600080fd5b614ba688828901614ace565b945050604086015181811115614bbb57600080fd5b86019050601f81018713614bce57600080fd5b8051614bdc6146b5826145ea565b81815260059190911b82018301908381019089831115614bfb57600080fd5b928401925b82841015614c22578351614c1381614b36565b82529284019290840190614c00565b80955050505050509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6001600160601b03818116838216019080821115612ef557612ef5614c47565b8035600381106119cd57600080fd5b600060608284031215614c9e57600080fd5b614ca6614592565b9050614cb182614c7d565b8152602082013560208201526040820135604082015292915050565b600060a08284031215614cdf57600080fd5b614ce7614592565b8235614cf281614198565b81526020830135614d0281614198565b6020820152614d148460408501614c8c565b60408201529392505050565b600060608284031215614d3257600080fd5b614d3a614592565b823560ff81168114614d4b57600080fd5b8152602083810135908201526040928301359281019290925250919050565b6000808335601e19843603018112614d8157600080fd5b8301803591506001600160401b03821115614d9b57600080fd5b6020019150600581901b36038213156118bc57600080fd5b600060208284031215614dc557600080fd5b81356110f681614b36565b8035600281106119cd57600080fd5b600060608284031215614df157600080fd5b614df9614592565b90508135614e0681614198565b81526020820135614e1681614198565b806020830152506040820135604082015292915050565b60006101608284031215614e4057600080fd5b60405160a081018181106001600160401b0382111715614e6257614e6261457c565b60405282358152614e7560208401614dd0565b6020820152614e878460408501614ddf565b6040820152614e998460a08501614ddf565b6060820152614eac846101008501614c8c565b60808201529392505050565b6002811061478c5761478c614766565b8035614ed381614198565b6001600160a01b039081168352602082013590614eef82614198565b166020830152604090810135910152565b60006101808201905083825282356020830152614f1f60208401614dd0565b614f2c6040840182614eb8565b50614f3d6060830160408501614ec8565b614f4d60c0830160a08501614ec8565b610120614f68818401614f636101008701614c7d565b61477c565b61014081850135818501528085013561016085015250509392505050565b600060208284031215614f9857600080fd5b6110f682614c7d565b600060608284031215614fb357600080fd5b6110f68383614c8c565b81810381811115610bfb57610bfb614c47565b8082028115828204841417610bfb57610bfb614c47565b600060208284031215614ff957600080fd5b81356110f68161460d565b6001600160601b03828116828216039080821115612ef557612ef5614c47565b6010811061478c5761478c614766565b60208101610bfb8284615024565b6001600160e01b03198316815260408101600b831061506357615063614766565b8260208301529392505050565b8183526000602080850194508260005b858110156150ae57813561509381614198565b6001600160a01b031687529582019590820190600101615080565b509495945050505050565b6040815260006150cd604083018688615070565b82810360208401528381526001600160fb1b038411156150ec57600080fd5b8360051b80866020840137016020019695505050505050565b60608152600061511960608301888a615070565b6020838203602085015261512e82888a615070565b848103604086015285815286925060200160005b868110156151675761515782614f6386614c7d565b9282019290820190600101615142565b509a9950505050505050505050565b60006020828403121561518857600080fd5b81516110f68161460d565b6000600182016151a5576151a5614c47565b5060010190565b6151b782825161477c565b60208181015190830152604090810151910152565b6000610180820190508382528251602083015260208301516151f16040840182614eb8565b5060408381015180516001600160a01b03908116606086015260208201511660808501529081015160a084015250606083015180516001600160a01b0390811660c085015260208201511660e084015260408101516101008401525060808301516152606101208401826151ac565b509392505050565b60006020828403121561527a57600080fd5b6110f682614dd0565b80820180821115610bfb57610bfb614c47565b6000826152b357634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031984168152606081016152d66020830185615024565b6001600160a01b03929092166040919091015292915050565b60006020828403121561530157600080fd5b5051919050565b60005b8381101561532357818101518382015260200161530b565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615364816017850160208801615308565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615395816028840160208801615308565b01602801949350505050565b600081518084526153b9816020860160208601615308565b601f01601f19169290920160200192915050565b6020815260006110f660208301846153a1565b600082516153f2818460208701615308565b9190910192915050565b60c0810161540a82876151ac565b6001600160a01b0394851660608301529284166080820152921660a090920191909152919050565b60a0810161544082866151ac565b6001600160a01b03938416606083015291909216608090920191909152919050565b60008161547157615471614c47565b506000190190565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906154c9908301846153a1565b979650505050505050565b60018060a01b038516815283602082015282604082015260806060820152600061550160808301846153a1565b969550505050505056fe7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498a2646970667358221220a2f9831a0e3d85059cd7b361f6be20ecc705006971478a7cb6c6bfef562802c064736f6c63430008170033", "chainId": 11155111, "contractAbsolutePath": "MainchainGatewayV3.sol", - "deployedBytecode": "0x60806040526004361061039b5760003560e01c80638f34e347116101dc578063b9c3620911610102578063d55ed103116100a0578063dff525e11161006f578063dff525e114610b04578063e400327c14610b24578063e75235b814610b44578063f23a6e6114610b5c576103aa565b8063d55ed10314610a77578063d64af2a614610aa4578063dafae40814610ac4578063de981f1b14610ae4576103aa565b8063ca15c873116100dc578063ca15c873146109f2578063cdb6744414610a12578063d19773d214610a2a578063d547741f14610a57576103aa565b8063b9c3620914610986578063bc197c81146109a6578063c48549de146109d2576103aa565b8063a217fddf1161017a578063affed0e011610149578063affed0e0146108f6578063b1a2567e1461090c578063b1d08a031461092c578063b297579414610959576103aa565b8063a217fddf14610894578063a3912ec8146103a8578063ab796566146108a9578063ac78dfe8146108d6576103aa565b80639157921c116101b65780639157921c146107ff57806391d148541461081f57806393c5678f1461083f5780639dcc4da31461085f576103aa565b80638f34e3471461077e5780638f851d8a146107b25780639010d07c146107df576103aa565b806338e454b1116102c1578063504af48c1161025f5780636c1ce6701161022e5780636c1ce670146107145780637de5dedd146107345780638456cb5914610749578063865e6fd31461075e576103aa565b8063504af48c1461068f57806359122f6b146106a25780635c975abb146106cf5780636932be98146106e7576103aa565b80634b14557e1161029b5780634b14557e1461060c5780634d0d66731461061f5780634d493f4e1461063f5780634f4247a11461066f576103aa565b806338e454b1146105c25780633e70838b146105d75780633f4ba83a146105f7576103aa565b80631d4a7210116103395780632f2ff15d116103085780632f2ff15d14610556578063302d12db146105765780633644e5151461058d57806336568abe146105a2576103aa565b80631d4a7210146104c3578063248a9ca3146104f057806329b6eca9146105205780632dfdf0b514610540576103aa565b806317ce2dd41161037557806317ce2dd41461043f57806317fcb39b146104635780631a8e55b0146104835780631b6e7594146104a3576103aa565b806301ffc9a7146103b2578063065b3adf146103e7578063110a83081461041f576103aa565b366103aa576103a8610b88565b005b6103a8610b88565b3480156103be57600080fd5b506103d26103cd36600461416e565b610bbc565b60405190151581526020015b60405180910390f35b3480156103f357600080fd5b50600554610407906001600160a01b031681565b6040516001600160a01b0390911681526020016103de565b34801561042b57600080fd5b506103a861043a3660046141ad565b610c01565b34801561044b57600080fd5b5061045560755481565b6040519081526020016103de565b34801561046f57600080fd5b50607454610407906001600160a01b031681565b34801561048f57600080fd5b506103a861049e36600461420e565b610ca6565b3480156104af57600080fd5b506103a86104be366004614279565b610ce2565b3480156104cf57600080fd5b506104556104de3660046141ad565b603e6020526000908152604090205481565b3480156104fc57600080fd5b5061045561050b36600461431d565b60009081526072602052604090206001015490565b34801561052c57600080fd5b506103a861053b3660046141ad565b610d22565b34801561054c57600080fd5b5061045560765481565b34801561056257600080fd5b506103a8610571366004614336565b610dab565b34801561058257600080fd5b50610455620f424081565b34801561059957600080fd5b50607754610455565b3480156105ae57600080fd5b506103a86105bd366004614336565b610dd5565b3480156105ce57600080fd5b506103a8610e53565b3480156105e357600080fd5b506103a86105f23660046141ad565b611030565b34801561060357600080fd5b506103a861105a565b6103a861061a366004614366565b61106a565b34801561062b57600080fd5b506103d261063a366004614391565b61108d565b34801561064b57600080fd5b506103d261065a36600461431d565b607a6020526000908152604090205460ff1681565b34801561067b57600080fd5b50607f54610407906001600160a01b031681565b6103a861069d36600461443b565b6110fd565b3480156106ae57600080fd5b506104556106bd3660046141ad565b603a6020526000908152604090205481565b3480156106db57600080fd5b5060005460ff166103d2565b3480156106f357600080fd5b5061045561070236600461431d565b60796020526000908152604090205481565b34801561072057600080fd5b506103d261072f366004614515565b6113c3565b34801561074057600080fd5b506104556113cf565b34801561075557600080fd5b506103a86113f0565b34801561076a57600080fd5b506103a8610779366004614550565b611400565b34801561078a57600080fd5b506104557f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e481565b3480156107be57600080fd5b506107d26107cd36600461461b565b61141b565b6040516103de9190614712565b3480156107eb57600080fd5b506104076107fa366004614727565b61159d565b34801561080b57600080fd5b506103a861081a366004614749565b6115b5565b34801561082b57600080fd5b506103d261083a366004614336565b611839565b34801561084b57600080fd5b506103a861085a36600461420e565b611864565b34801561086b57600080fd5b5061087f61087a366004614727565b61189a565b604080519283526020830191909152016103de565b3480156108a057600080fd5b50610455600081565b3480156108b557600080fd5b506104556108c43660046141ad565b603c6020526000908152604090205481565b3480156108e257600080fd5b506103d26108f136600461431d565b6118c3565b34801561090257600080fd5b5061045560045481565b34801561091857600080fd5b506103a861092736600461420e565b6118f9565b34801561093857600080fd5b506104556109473660046141ad565b60396020526000908152604090205481565b34801561096557600080fd5b506109796109743660046141ad565b61192f565b6040516103de9190614790565b34801561099257600080fd5b506103a86109a1366004614727565b6119d2565b3480156109b257600080fd5b506107d26109c1366004614893565b63bc197c8160e01b95945050505050565b3480156109de57600080fd5b506107d26109ed36600461420e565b6119ec565b3480156109fe57600080fd5b50610455610a0d36600461431d565b611b80565b348015610a1e57600080fd5b5060375460385461087f565b348015610a3657600080fd5b50610455610a453660046141ad565b603b6020526000908152604090205481565b348015610a6357600080fd5b506103a8610a72366004614336565b611b97565b348015610a8357600080fd5b50610455610a923660046141ad565b603d6020526000908152604090205481565b348015610ab057600080fd5b506103a8610abf3660046141ad565b611bbc565b348015610ad057600080fd5b506103d2610adf36600461431d565b611bcd565b348015610af057600080fd5b50610407610aff366004614940565b611bfb565b348015610b1057600080fd5b506103a8610b1f36600461495b565b611c71565b348015610b3057600080fd5b506103a8610b3f36600461420e565b611ce6565b348015610b5057600080fd5b5060015460025461087f565b348015610b6857600080fd5b506107d2610b77366004614a18565b63f23a6e6160e01b95945050505050565b6074546001600160a01b0316331480610bab5750607f546001600160a01b031633145b15610bb257565b610bba611d1c565b565b60006001600160e01b031982166246560160e51b1480610bec57506001600160e01b031982166312c0151560e21b145b80610bfb5750610bfb82611d46565b92915050565b607154600490610100900460ff16158015610c23575060715460ff8083169116105b610c485760405162461bcd60e51b8152600401610c3f90614a80565b60405180910390fd5b60718054607f80546001600160a01b0319166001600160a01b03861617905561ff001961010060ff851661ffff199093168317171690915560405190815260008051602061550c833981519152906020015b60405180910390a15050565b610cae611d6b565b6000839003610cd0576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484611dc5565b50505050565b610cea611d6b565b6000859003610d0c576040516316ee9d3b60e11b815260040160405180910390fd5b610d1a868686868686611e9a565b505050505050565b607154600290610100900460ff16158015610d44575060715460ff8083169116105b610d605760405162461bcd60e51b8152600401610c3f90614a80565b6071805461ffff191660ff831617610100179055610d7f600b83612042565b6071805461ff001916905560405160ff8216815260008051602061550c83398151915290602001610c9a565b600082815260726020526040902060010154610dc6816120e6565b610dd083836120f0565b505050565b6001600160a01b0381163314610e455760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610c3f565b610e4f8282612112565b5050565b607154600390610100900460ff16158015610e75575060715460ff8083169116105b610e915760405162461bcd60e51b8152600401610c3f90614a80565b6071805461ffff191660ff8316176101001790556000610eb1600b611bfb565b9050600080826001600160a01b031663c441c4a86040518163ffffffff1660e01b8152600401600060405180830381865afa158015610ef4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f1c9190810190614b4b565b92509250506000805b8351811015610fd957828181518110610f4057610f40614c31565b6020026020010151607e6000868481518110610f5e57610f5e614c31565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154816001600160601b0302191690836001600160601b03160217905550828181518110610fbc57610fbc614c31565b602002602001015182610fcf9190614c5d565b9150600101610f25565b50607d80546001600160601b0319166001600160601b039290921691909117905550506071805461ff00191690555060405160ff8216815260008051602061550c833981519152906020015b60405180910390a150565b611038611d6b565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b611062612134565b610bba6121a3565b6110726121f5565b61108a61108436839003830183614ccd565b3361223b565b50565b60006110976121f5565b6110f3848484808060200260200160405190810160405280939291908181526020016000905b828210156110e9576110da60608302860136819003810190614d20565b815260200190600101906110bd565b5050505050612516565b90505b9392505050565b607154610100900460ff161580801561111d5750607154600160ff909116105b806111375750303b158015611137575060715460ff166001145b6111535760405162461bcd60e51b8152600401610c3f90614a80565b6071805460ff191660011790558015611176576071805461ff0019166101001790555b61118160008c6129aa565b607589905561118f8a6129b4565b61121a6040517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81527f159f52c1e3a2b6a6aad3950adf713516211484e0516dad685ea662a094b7c43b60208201527fad7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5604082015246606082015230608082015260a0812060775550565b6112248887612a02565b61122e8787612a92565b5050611238612b29565b60006112448680614d6a565b905011156113055761126d6112598680614d6a565b6112666020890189614d6a565b8787611e9a565b61129361127a8680614d6a565b8660005b60200281019061128e9190614d6a565b612b76565b6112b96112a08680614d6a565b8660015b6020028101906112b49190614d6a565b611dc5565b6112df6112c68680614d6a565b8660025b6020028101906112da9190614d6a565b612c4b565b6113056112ec8680614d6a565b8660035b6020028101906113009190614d6a565b612d5c565b60005b6113156040870187614d6a565b9050811015611381576113797f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e461134f6040890189614d6a565b8481811061135f5761135f614c31565b905060200201602081019061137491906141ad565b6120f0565b600101611308565b5080156113b6576071805461ff00191690556040516001815260008051602061550c8339815191529060200160405180910390a15b5050505050505050505050565b60006110f68383612e31565b60006113eb6113e6607d546001600160601b031690565b612efc565b905090565b6113f8612134565b610bba612f32565b611408611d6b565b61141181612f6f565b610e4f8282612042565b6000600b61142881612fa5565b825186908114158061143a5750808514155b15611466576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b8060000361147e57506347c28ec560e11b9150611593565b60005b818110156115865784818151811061149b5761149b614c31565b60200260200101511561157e578686828181106114ba576114ba614c31565b90506020020160208101906114cf9190614db3565b607d80546001600160601b031981166001600160601b03918216939093011691909117905586868281811061150657611506614c31565b905060200201602081019061151b9190614db3565b607e60008b8b8581811061153157611531614c31565b905060200201602081019061154691906141ad565b6001600160a01b03168152602081019190915260400160002080546001600160601b0319166001600160601b03929092169190911790555b600101611481565b506347c28ec560e11b9250505b5095945050505050565b60008281526073602052604081206110f69083612ff1565b7f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e46115df816120e6565b60006115f86115f336859003850185614e2d565b612ffd565b905061160c6115f336859003850185614e2d565b83356000908152607960205260409020541461163b5760405163f4b8742f60e01b815260040160405180910390fd5b82356000908152607a602052604090205460ff1661166c5760405163147bfe0760e01b815260040160405180910390fd5b82356000908152607a602052604090819020805460ff19169055517fd639511b37b3b002cca6cfe6bca0d833945a5af5a045578a0627fc43b79b2630906116b69083908690614f00565b60405180910390a160006116d060808501606086016141ad565b905060006116e661012086016101008701614f86565b60028111156116f7576116f7614766565b036117be5760006117113686900386016101008701614fa1565b6001600160a01b0383166000908152603b602052604090205490915061173d90610140870135906130c7565b604082015260006117573687900387016101008801614fa1565b604083015190915061176e90610140880135614fbd565b604082015260745461178e908390339086906001600160a01b03166130e1565b6117b76117a160608801604089016141ad565b60745483919086906001600160a01b03166130e1565b50506117fa565b6117fa6117d160608601604087016141ad565b60745483906001600160a01b03166117f23689900389016101008a01614fa1565b9291906130e1565b7f21e88e956aa3e086f6388e899965cef814688f99ad8bb29b08d396571016372d828560405161182b929190614f00565b60405180910390a150505050565b60009182526072602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61186c611d6b565b600083900361188e576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484612b76565b6000806118a5611d6b565b6118af8484612a92565b90925090506118bc612b29565b9250929050565b60006118d7607d546001600160601b031690565b6037546118e49190614fd0565b6038546118f19084614fd0565b101592915050565b611901611d6b565b6000839003611923576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484612c4b565b60408051808201909152600080825260208201526001600160a01b0382166000908152607860205260409081902081518083019092528054829060ff16600281111561197d5761197d614766565b600281111561198e5761198e614766565b815290546001600160a01b03610100909104811660209283015290820151919250166119cd57604051631b79f53b60e21b815260040160405180910390fd5b919050565b6119da611d6b565b6119e48282612a02565b610e4f612b29565b6000600b6119f981612fa5565b84838114611a28576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b80600003611a405750636242a4ef60e11b9150611b77565b6000805b82811015611b2757868682818110611a5e57611a5e614c31565b9050602002016020810190611a739190614fe7565b15611b1f57607e60008a8a84818110611a8e57611a8e614c31565b9050602002016020810190611aa391906141ad565b6001600160a01b0316815260208101919091526040016000908120546001600160601b03169290920191607e908a8a84818110611ae257611ae2614c31565b9050602002016020810190611af791906141ad565b6001600160a01b03168152602081019190915260400160002080546001600160601b03191690555b600101611a44565b50607d8054829190600090611b469084906001600160601b0316615004565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555063c48549de60e01b935050505b50949350505050565b6000818152607360205260408120610bfb90613313565b600082815260726020526040902060010154611bb2816120e6565b610dd08383612112565b611bc4611d6b565b61108a816129b4565b6000611be1607d546001600160601b031690565b600154611bee9190614fd0565b6002546118f19084614fd0565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115611c3257611c32614766565b60ff1681526020810191909152604001600020546001600160a01b03169050806119cd578160405163409140df60e11b8152600401610c3f9190615034565b611c79611d6b565b6000869003611c9b576040516316ee9d3b60e11b815260040160405180910390fd5b611ca9878787878787611e9a565b611cb6878783600061127e565b611cc387878360016112a4565b611cd087878360026112ca565b611cdd87878360036112f0565b50505050505050565b611cee611d6b565b6000839003611d10576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484612d5c565b611d246121f5565b611d2c61412d565b33815260408082015134910152805161108a90829061223b565b60006001600160e01b03198216630271189760e51b1480610bfb5750610bfb8261331d565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610bba576000356001600160e01b0319166001604051620f948f60ea1b8152600401610c3f929190615042565b828114611df3576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015611e6457828282818110611e1057611e10614c31565b90506020020135603a6000878785818110611e2d57611e2d614c31565b9050602002016020810190611e4291906141ad565b6001600160a01b03168152602081019190915260400160002055600101611df6565b507f64557254143204d91ba2d95acb9fda1e5fea55f77efd028685765bc1e94dd4b58484848460405161182b94939291906150b9565b8483148015611ea857508481145b611ed3576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b85811015611ff857848482818110611ef057611ef0614c31565b9050602002016020810190611f0591906141ad565b60786000898985818110611f1b57611f1b614c31565b9050602002016020810190611f3091906141ad565b6001600160a01b03908116825260208201929092526040016000208054610100600160a81b0319166101009390921692909202179055828282818110611f7857611f78614c31565b9050602002016020810190611f8d9190614f86565b60786000898985818110611fa357611fa3614c31565b9050602002016020810190611fb891906141ad565b6001600160a01b031681526020810191909152604001600020805460ff19166001836002811115611feb57611feb614766565b0217905550600101611ed6565b507fa4f03cc9c0e0aeb5b71b4ec800702753f65748c2cf3064695ba8e8b46be7044486868686868660405161203296959493929190615105565b60405180910390a1505050505050565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f81111561207857612078614766565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f8111156120b9576120b9614766565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b61108a8133613342565b6120fa82826133a6565b6000828152607360205260409020610dd0908261342c565b61211c8282613441565b6000828152607360205260409020610dd090826134a8565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031633148061217657506005546001600160a01b031633145b610bba576000356001600160e01b0319166001604051620f948f60ea1b8152600401610c3f929190615042565b6121ab6134bd565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60005460ff1615610bba5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610c3f565b604080518082018252600080825260208201526074549184015190916001600160a01b03169061226a90613506565b60208401516001600160a01b031661230b5734846040015160400151146122a45760405163129c2ce160e31b815260040160405180910390fd5b6122ad8161192f565b60408501515190925060028111156122c7576122c7614766565b825160028111156122da576122da614766565b146122f75760405162035e2b60ea1b815260040160405180910390fd5b6001600160a01b03811660208501526124a3565b341561232a5760405163129c2ce160e31b815260040160405180910390fd5b612337846020015161192f565b604085015151909250600281111561235157612351614766565b8251600281111561236457612364614766565b146123815760405162035e2b60ea1b815260040160405180910390fd5b6020840151604085015161239691859061354a565b83602001516001600160a01b0316816001600160a01b0316036124a357607454607f54604086810151810151905163095ea7b360e01b81526001600160a01b039283166004820152602481019190915291169063095ea7b3906044016020604051808303816000875af1158015612411573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124359190615176565b50607f546040808601518101519051636f074d1f60e11b81526001600160a01b039092169163de0e9a3e916124709160040190815260200190565b600060405180830381600087803b15801561248a57600080fd5b505af115801561249e573d6000803e3d6000fd5b505050505b60768054600091826124b483615193565b91905055905060006124db858386602001516075548a6136c390949392919063ffffffff16565b90507fd7b25068d9dc8d00765254cfb7f5070f98d263c8d68931d937c7362fa738048b61250782612ffd565b826040516120329291906151cc565b600082356101408401358261253160808701606088016141ad565b905061254e6125493688900388016101008901614fa1565b613506565b60016125606040880160208901615268565b600181111561257157612571614766565b1461258f5760405163182f3d8760e11b815260040160405180910390fd5b608086013546146125d15760405163092048d160e11b81526000356001600160e01b031916600482015260808701356024820152466044820152606401610c3f565b60006125e66109746080890160608a016141ad565b90506125fa61012088016101008901614f86565b600281111561260b5761260b614766565b8151600281111561261e5761261e614766565b14801561264f575061263660e0880160c089016141ad565b6001600160a01b031681602001516001600160a01b0316145b8015612660575060755460e0880135145b61267d5760405163f4b8742f60e01b815260040160405180910390fd5b600084815260796020526040902054156126aa57604051634f13df6160e01b815260040160405180910390fd5b60016126be61012089016101008a01614f86565b60028111156126cf576126cf614766565b14806126e257506126e08284612e31565b155b6126ff5760405163c51297b760e01b815260040160405180910390fd5b60006127136115f3368a90038a018a614e2d565b9050600061272360775483613798565b9050600061274361273c6101208c016101008d01614f86565b86886137d9565b60408051606081018252600080825260208201819052918101829052919a50919250819081906000805b8e51811015612881578e818151811061278857612788614c31565b6020908102919091018101518051818301516040808401518151600081529586018083528e905260ff9093169085015260608401526080830152935060019060a0016020604051602081039080840390855afa1580156127ec573d6000803e3d6000fd5b505050602060405103519450846001600160a01b0316846001600160a01b031610612838576000356001600160e01b031916604051635d3dcd3160e01b8152600401610c3f9190614712565b6001600160a01b0385166000908152607e60205260409020548594506001600160601b03166128679083615283565b91508682106128795760019550612881565b60010161276d565b50846128a057604051639e8f5f6360e01b815260040160405180910390fd5b50505060008981526079602052604090208590555050871561291b576000878152607a602052604090819020805460ff19166001179055517f89e52969465b1f1866fc5d46fd62de953962e9cb33552443cd999eba05bd20dc906129079085908d90614f00565b60405180910390a150505050505050610bfb565b6129258587613869565b61296461293860608c0160408d016141ad565b86607460009054906101000a90046001600160a01b03168d610100018036038101906117f29190614fa1565b7f21e88e956aa3e086f6388e899965cef814688f99ad8bb29b08d396571016372d838b604051612995929190614f00565b60405180910390a15050505050505092915050565b610e4f82826120f0565b607480546001600160a01b0319166001600160a01b0383169081179091556040519081527f9d2334c23be647e994f27a72c5eee42a43d5bdcfe15bb88e939103c2b114cbaf90602001611025565b80821115612a31576000356001600160e01b0319166040516387f6f09560e01b8152600401610c3f9190614712565b6001805460028054858455908490556004805493840190556040805183815260208101839052929391928592879290917f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a450505050565b60008082841115612ac4576000356001600160e01b0319166040516387f6f09560e01b8152600401610c3f9190614712565b5050603780546038805492859055839055600480546001810190915560408051838152602081018590529293928592879290917f31312c97b89cc751b832d98fd459b967a2c3eef3b49757d1cf5ebaa12bb6eee1910160405180910390a49250929050565b600254603754612b399190614fd0565b603854600154612b499190614fd0565b1115610bba576000356001600160e01b0319166040516387f6f09560e01b8152600401610c3f9190614712565b828114612ba4576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015612c1557828282818110612bc157612bc1614c31565b9050602002013560396000878785818110612bde57612bde614c31565b9050602002016020810190612bf391906141ad565b6001600160a01b03168152602081019190915260400160002055600101612ba7565b507f80bc635c452ae67f12f9b6f12ad4daa6dbbc04eeb9ebb87d354ce10c0e210dc08484848460405161182b94939291906150b9565b828114612c79576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015612d2657620f4240838383818110612c9a57612c9a614c31565b905060200201351115612cc05760405163572d3bd360e11b815260040160405180910390fd5b828282818110612cd257612cd2614c31565b90506020020135603b6000878785818110612cef57612cef614c31565b9050602002016020810190612d0491906141ad565b6001600160a01b03168152602081019190915260400160002055600101612c7c565b507fb05f5de88ae0294ebb6f67c5af2fcbbd593cc6bdfe543e2869794a4c8ce3ea508484848460405161182b94939291906150b9565b828114612d8a576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015612dfb57828282818110612da757612da7614c31565b90506020020135603c6000878785818110612dc457612dc4614c31565b9050602002016020810190612dd991906141ad565b6001600160a01b03168152602081019190915260400160002055600101612d8d565b507fb5d2963614d72181b4df1f993d45b83edf42fa19710f0204217ba1b3e183bb738484848460405161182b94939291906150b9565b6001600160a01b0382166000908152603a60205260408120548210612e5857506000610bfb565b6000612e676201518042615296565b6001600160a01b0385166000908152603e6020526040902054909150811115612ead5750506001600160a01b0382166000908152603c6020526040902054811015610bfb565b6001600160a01b0384166000908152603d6020526040902054612ed1908490615283565b6001600160a01b0385166000908152603c602052604090205411159150610bfb9050565b5092915050565b6000600254600160025484600154612f149190614fd0565b612f1e9190615283565b612f289190614fbd565b610bfb9190615296565b612f3a6121f5565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586121d83390565b806001600160a01b03163b60000361108a57604051630bfc64a360e21b81526001600160a01b0382166004820152602401610c3f565b612fae81611bfb565b6001600160a01b0316336001600160a01b03161461108a576000356001600160e01b03191681336040516320e0f98d60e21b8152600401610c3f939291906152b8565b60006110f683836138f9565b60008061300d8360400151613923565b9050600061301e8460600151613923565b905060006130728560800151604080517f1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d815282516020808301919091528301518183015291015160608201526080902090565b604080517fb9d1fe7c9deeec5dc90a2f47ff1684239519f2545b2228d3d91fb27df3189eea815287516020808301919091529097015190870152606086019390935250608084015260a08301525060c0902090565b6000620f42406130d78385614fd0565b6110f69190615296565b806001600160a01b0316826001600160a01b03160361318e5760408085015190516001600160a01b0385169180156108fc02916000818181858888f1935050505061318957806001600160a01b031663d0e30db085604001516040518263ffffffff1660e01b81526004016000604051808303818588803b15801561316557600080fd5b505af1158015613179573d6000803e3d6000fd5b505050505061318984848461396b565b610cdc565b6000845160028111156131a3576131a3614766565b03613269576040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156131ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061321391906152ef565b905084604001518110156132585761323b83308388604001516132369190614fbd565b6139ea565b61325857604051632f739fff60e11b815260040160405180910390fd5b61326385858561396b565b50610cdc565b60018451600281111561327e5761327e614766565b036132af5761329282848660200151613a8f565b6131895760405163c8e3a09f60e01b815260040160405180910390fd5b6002845160028111156132c4576132c4614766565b036132fa576132dd828486602001518760400151613ab6565b613189576040516334b471a760e21b815260040160405180910390fd5b6040516361e411a760e11b815260040160405180910390fd5b6000610bfb825490565b60006001600160e01b03198216635a05180f60e01b1480610bfb5750610bfb82613ae3565b61334c8282611839565b610e4f57613364816001600160a01b03166014613b18565b61336f836020613b18565b60405160200161338092919061532c565b60408051601f198184030181529082905262461bcd60e51b8252610c3f916004016153cd565b6133b08282611839565b610e4f5760008281526072602090815260408083206001600160a01b03851684529091529020805460ff191660011790556133e83390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006110f6836001600160a01b038416613cb3565b61344b8282611839565b15610e4f5760008281526072602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006110f6836001600160a01b038416613d02565b60005460ff16610bba5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610c3f565b61350f81613df5565b8061351e575061351e81613e2c565b8061352d575061352d81613e54565b61108a5760405163034992a760e51b815260040160405180910390fd5b60006060818551600281111561356257613562614766565b0361363d5760408581015181516001600160a01b03878116602483015230604483015260648083019390935283518083039093018352608490910183526020820180516001600160e01b03166323b872dd60e01b1790529151918516916135c991906153e0565b6000604051808303816000865af19150503d8060008114613606576040519150601f19603f3d011682016040523d82523d6000602084013e61360b565b606091505b5090925090508180156136365750805115806136365750808060200190518101906136369190615176565b9150613696565b60018551600281111561365257613652614766565b03613667576136368385308860200151613e7d565b60028551600281111561367c5761367c614766565b036132fa5761363683853088602001518960400151613f2b565b816136bc5784843085604051639d2e4c6760e01b8152600401610c3f94939291906153fc565b5050505050565b6137336040805160a08101825260008082526020808301829052835160608082018652838252818301849052818601849052848601919091528451808201865283815280830184905280860184905281850152845190810185528281529081018290529283015290608082015290565b83815260006020820181905250604080820180516001600160a01b039788169052602080890151825190891690820152905146908301528751606084018051918916909152805195909716940193909352935182015292909201516080820152919050565b6040805161190160f01b60208083019190915260228201859052604280830185905283518084039091018152606290920190925280519101206000906110f6565b60008060006137f0607d546001600160601b031690565b90506137fb81612efc565b9250600086600281111561381157613811614766565b03613860576001600160a01b03851660009081526039602052604090205484106138415761383e81613fdf565b92505b6001600160a01b0385166000908152603a602052604090205484101591505b50935093915050565b60006138786201518042615296565b6001600160a01b0384166000908152603e60205260409020549091508111156138c7576001600160a01b03929092166000908152603e6020908152604080832094909455603d90529190912055565b6001600160a01b0383166000908152603d6020526040812080548492906138ef908490615283565b9091555050505050565b600082600001828154811061391057613910614c31565b9060005260206000200154905092915050565b604080517f353bdd8d69b9e3185b3972e08b03845c0c14a21a390215302776a7a34b0e8764815282516020808301919091528301518183015291015160608201526080902090565b6000808451600281111561398157613981614766565b0361399c5761399582848660400151613ff7565b90506139c6565b6001845160028111156139b1576139b1614766565b036132fa576139958230858760200151613e7d565b80610cdc578383836040516341bd7d9160e11b8152600401610c3f93929190615432565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b03166340c10f1960e01b1790529151600092861691613a42916153e0565b6000604051808303816000865af19150503d8060008114613a7f576040519150601f19603f3d011682016040523d82523d6000602084013e613a84565b606091505b509095945050505050565b6000613a9d84308585613e7d565b9050806110f657613aaf8484846139ea565b90506110f6565b6000613ac58530868686613f2b565b905080613adb57613ad8858585856140ca565b90505b949350505050565b60006001600160e01b03198216637965db0b60e01b1480610bfb57506301ffc9a760e01b6001600160e01b0319831614610bfb565b60606000613b27836002614fd0565b613b32906002615283565b6001600160401b03811115613b4957613b4961457c565b6040519080825280601f01601f191660200182016040528015613b73576020820181803683370190505b509050600360fc1b81600081518110613b8e57613b8e614c31565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613bbd57613bbd614c31565b60200101906001600160f81b031916908160001a9053506000613be1846002614fd0565b613bec906001615283565b90505b6001811115613c64576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613c2057613c20614c31565b1a60f81b828281518110613c3657613c36614c31565b60200101906001600160f81b031916908160001a90535060049490941c93613c5d81615462565b9050613bef565b5083156110f65760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c3f565b6000818152600183016020526040812054613cfa57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610bfb565b506000610bfb565b60008181526001830160205260408120548015613deb576000613d26600183614fbd565b8554909150600090613d3a90600190614fbd565b9050818114613d9f576000866000018281548110613d5a57613d5a614c31565b9060005260206000200154905080876000018481548110613d7d57613d7d614c31565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613db057613db0615479565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610bfb565b6000915050610bfb565b60008082516002811115613e0b57613e0b614766565b148015613e1c575060008260400151115b8015610bfb575050602001511590565b6000600182516002811115613e4357613e43614766565b148015610bfb575050604001511590565b6000600282516002811115613e6b57613e6b614766565b148015610bfb57505060400151151590565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b1790529151600092871691613edd916153e0565b6000604051808303816000865af19150503d8060008114613f1a576040519150601f19603f3d011682016040523d82523d6000602084013e613f1f565b606091505b50909695505050505050565b604080516000808252602082019092526001600160a01b03871690613f5b9087908790879087906044810161548f565b60408051601f198184030181529181526020820180516001600160e01b0316637921219560e11b17905251613f9091906153e0565b6000604051808303816000865af19150503d8060008114613fcd576040519150601f19603f3d011682016040523d82523d6000602084013e613fd2565b606091505b5090979650505050505050565b6000603854600160385484603754612f149190614fd0565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000926060929087169161405491906153e0565b6000604051808303816000865af19150503d8060008114614091576040519150601f19603f3d011682016040523d82523d6000602084013e614096565b606091505b5090925090508180156140c15750805115806140c15750808060200190518101906140c19190615176565b95945050505050565b604080516000808252602082019092526001600160a01b038616906140f890869086908690604481016154d4565b60408051601f198184030181529181526020820180516001600160e01b031663731133e960e01b17905251613edd91906153e0565b60408051606081018252600080825260208201529081016141696040805160608101909152806000815260200160008152602001600081525090565b905290565b60006020828403121561418057600080fd5b81356001600160e01b0319811681146110f657600080fd5b6001600160a01b038116811461108a57600080fd5b6000602082840312156141bf57600080fd5b81356110f681614198565b60008083601f8401126141dc57600080fd5b5081356001600160401b038111156141f357600080fd5b6020830191508360208260051b85010111156118bc57600080fd5b6000806000806040858703121561422457600080fd5b84356001600160401b038082111561423b57600080fd5b614247888389016141ca565b9096509450602087013591508082111561426057600080fd5b5061426d878288016141ca565b95989497509550505050565b6000806000806000806060878903121561429257600080fd5b86356001600160401b03808211156142a957600080fd5b6142b58a838b016141ca565b909850965060208901359150808211156142ce57600080fd5b6142da8a838b016141ca565b909650945060408901359150808211156142f357600080fd5b5061430089828a016141ca565b979a9699509497509295939492505050565b80356119cd81614198565b60006020828403121561432f57600080fd5b5035919050565b6000806040838503121561434957600080fd5b82359150602083013561435b81614198565b809150509250929050565b600060a0828403121561437857600080fd5b50919050565b6000610160828403121561437857600080fd5b600080600061018084860312156143a757600080fd5b6143b1858561437e565b92506101608401356001600160401b03808211156143ce57600080fd5b818601915086601f8301126143e257600080fd5b8135818111156143f157600080fd5b87602060608302850101111561440657600080fd5b6020830194508093505050509250925092565b8060608101831015610bfb57600080fd5b8060808101831015610bfb57600080fd5b6000806000806000806000806000806101208b8d03121561445b57600080fd5b6144648b614312565b995061447260208c01614312565b985060408b0135975060608b0135965060808b0135955060a08b0135945060c08b01356001600160401b03808211156144aa57600080fd5b6144b68e838f01614419565b955060e08d01359150808211156144cc57600080fd5b6144d88e838f0161442a565b94506101008d01359150808211156144ef57600080fd5b506144fc8d828e016141ca565b915080935050809150509295989b9194979a5092959850565b6000806040838503121561452857600080fd5b823561453381614198565b946020939093013593505050565b8035601081106119cd57600080fd5b6000806040838503121561456357600080fd5b61456c83614541565b9150602083013561435b81614198565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b03811182821017156145b4576145b461457c565b60405290565b604051601f8201601f191681016001600160401b03811182821017156145e2576145e261457c565b604052919050565b60006001600160401b038211156146035761460361457c565b5060051b60200190565b801515811461108a57600080fd5b60008060008060006060868803121561463357600080fd5b85356001600160401b038082111561464a57600080fd5b61465689838a016141ca565b909750955060209150878201358181111561467057600080fd5b61467c8a828b016141ca565b90965094505060408801358181111561469457600080fd5b88019050601f810189136146a757600080fd5b80356146ba6146b5826145ea565b6145ba565b81815260059190911b8201830190838101908b8311156146d957600080fd5b928401925b828410156147005783356146f18161460d565b825292840192908401906146de565b80955050505050509295509295909350565b6001600160e01b031991909116815260200190565b6000806040838503121561473a57600080fd5b50508035926020909101359150565b6000610160828403121561475c57600080fd5b6110f6838361437e565b634e487b7160e01b600052602160045260246000fd5b6003811061478c5761478c614766565b9052565b60006040820190506147a382845161477c565b6020928301516001600160a01b0316919092015290565b600082601f8301126147cb57600080fd5b813560206147db6146b5836145ea565b8083825260208201915060208460051b8701019350868411156147fd57600080fd5b602086015b848110156148195780358352918301918301614802565b509695505050505050565b600082601f83011261483557600080fd5b81356001600160401b0381111561484e5761484e61457c565b614861601f8201601f19166020016145ba565b81815284602083860101111561487657600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a086880312156148ab57600080fd5b85356148b681614198565b945060208601356148c681614198565b935060408601356001600160401b03808211156148e257600080fd5b6148ee89838a016147ba565b9450606088013591508082111561490457600080fd5b61491089838a016147ba565b9350608088013591508082111561492657600080fd5b5061493388828901614824565b9150509295509295909350565b60006020828403121561495257600080fd5b6110f682614541565b60008060008060008060006080888a03121561497657600080fd5b87356001600160401b038082111561498d57600080fd5b6149998b838c016141ca565b909950975060208a01359150808211156149b257600080fd5b6149be8b838c016141ca565b909750955060408a01359150808211156149d757600080fd5b6149e38b838c016141ca565b909550935060608a01359150808211156149fc57600080fd5b50614a098a828b0161442a565b91505092959891949750929550565b600080600080600060a08688031215614a3057600080fd5b8535614a3b81614198565b94506020860135614a4b81614198565b9350604086013592506060860135915060808601356001600160401b03811115614a7457600080fd5b61493388828901614824565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b600082601f830112614adf57600080fd5b81516020614aef6146b5836145ea565b8083825260208201915060208460051b870101935086841115614b1157600080fd5b602086015b84811015614819578051614b2981614198565b8352918301918301614b16565b6001600160601b038116811461108a57600080fd5b600080600060608486031215614b6057600080fd5b83516001600160401b0380821115614b7757600080fd5b614b8387838801614ace565b9450602091508186015181811115614b9a57600080fd5b614ba688828901614ace565b945050604086015181811115614bbb57600080fd5b86019050601f81018713614bce57600080fd5b8051614bdc6146b5826145ea565b81815260059190911b82018301908381019089831115614bfb57600080fd5b928401925b82841015614c22578351614c1381614b36565b82529284019290840190614c00565b80955050505050509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6001600160601b03818116838216019080821115612ef557612ef5614c47565b8035600381106119cd57600080fd5b600060608284031215614c9e57600080fd5b614ca6614592565b9050614cb182614c7d565b8152602082013560208201526040820135604082015292915050565b600060a08284031215614cdf57600080fd5b614ce7614592565b8235614cf281614198565b81526020830135614d0281614198565b6020820152614d148460408501614c8c565b60408201529392505050565b600060608284031215614d3257600080fd5b614d3a614592565b823560ff81168114614d4b57600080fd5b8152602083810135908201526040928301359281019290925250919050565b6000808335601e19843603018112614d8157600080fd5b8301803591506001600160401b03821115614d9b57600080fd5b6020019150600581901b36038213156118bc57600080fd5b600060208284031215614dc557600080fd5b81356110f681614b36565b8035600281106119cd57600080fd5b600060608284031215614df157600080fd5b614df9614592565b90508135614e0681614198565b81526020820135614e1681614198565b806020830152506040820135604082015292915050565b60006101608284031215614e4057600080fd5b60405160a081018181106001600160401b0382111715614e6257614e6261457c565b60405282358152614e7560208401614dd0565b6020820152614e878460408501614ddf565b6040820152614e998460a08501614ddf565b6060820152614eac846101008501614c8c565b60808201529392505050565b6002811061478c5761478c614766565b8035614ed381614198565b6001600160a01b039081168352602082013590614eef82614198565b166020830152604090810135910152565b60006101808201905083825282356020830152614f1f60208401614dd0565b614f2c6040840182614eb8565b50614f3d6060830160408501614ec8565b614f4d60c0830160a08501614ec8565b610120614f68818401614f636101008701614c7d565b61477c565b61014081850135818501528085013561016085015250509392505050565b600060208284031215614f9857600080fd5b6110f682614c7d565b600060608284031215614fb357600080fd5b6110f68383614c8c565b81810381811115610bfb57610bfb614c47565b8082028115828204841417610bfb57610bfb614c47565b600060208284031215614ff957600080fd5b81356110f68161460d565b6001600160601b03828116828216039080821115612ef557612ef5614c47565b6010811061478c5761478c614766565b60208101610bfb8284615024565b6001600160e01b03198316815260408101600b831061506357615063614766565b8260208301529392505050565b8183526000602080850194508260005b858110156150ae57813561509381614198565b6001600160a01b031687529582019590820190600101615080565b509495945050505050565b6040815260006150cd604083018688615070565b82810360208401528381526001600160fb1b038411156150ec57600080fd5b8360051b80866020840137016020019695505050505050565b60608152600061511960608301888a615070565b6020838203602085015261512e82888a615070565b848103604086015285815286925060200160005b868110156151675761515782614f6386614c7d565b9282019290820190600101615142565b509a9950505050505050505050565b60006020828403121561518857600080fd5b81516110f68161460d565b6000600182016151a5576151a5614c47565b5060010190565b6151b782825161477c565b60208181015190830152604090810151910152565b6000610180820190508382528251602083015260208301516151f16040840182614eb8565b5060408381015180516001600160a01b03908116606086015260208201511660808501529081015160a084015250606083015180516001600160a01b0390811660c085015260208201511660e084015260408101516101008401525060808301516152606101208401826151ac565b509392505050565b60006020828403121561527a57600080fd5b6110f682614dd0565b80820180821115610bfb57610bfb614c47565b6000826152b357634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031984168152606081016152d66020830185615024565b6001600160a01b03929092166040919091015292915050565b60006020828403121561530157600080fd5b5051919050565b60005b8381101561532357818101518382015260200161530b565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615364816017850160208801615308565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615395816028840160208801615308565b01602801949350505050565b600081518084526153b9816020860160208601615308565b601f01601f19169290920160200192915050565b6020815260006110f660208301846153a1565b600082516153f2818460208701615308565b9190910192915050565b60c0810161540a82876151ac565b6001600160a01b0394851660608301529284166080820152921660a090920191909152919050565b60a0810161544082866151ac565b6001600160a01b03938416606083015291909216608090920191909152919050565b60008161547157615471614c47565b506000190190565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906154c9908301846153a1565b979650505050505050565b60018060a01b038516815283602082015282604082015260806060820152600061550160808301846153a1565b969550505050505056fe7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498a264697066735822122039bdd676fa56a806e2f91eb197d0a444b13ff0899114d328ae5983c28d58606164736f6c63430008170033", + "deployedBytecode": "0x60806040526004361061039b5760003560e01c80638f34e347116101dc578063b9c3620911610102578063d55ed103116100a0578063dff525e11161006f578063dff525e114610b04578063e400327c14610b24578063e75235b814610b44578063f23a6e6114610b5c576103aa565b8063d55ed10314610a77578063d64af2a614610aa4578063dafae40814610ac4578063de981f1b14610ae4576103aa565b8063ca15c873116100dc578063ca15c873146109f2578063cdb6744414610a12578063d19773d214610a2a578063d547741f14610a57576103aa565b8063b9c3620914610986578063bc197c81146109a6578063c48549de146109d2576103aa565b8063a217fddf1161017a578063affed0e011610149578063affed0e0146108f6578063b1a2567e1461090c578063b1d08a031461092c578063b297579414610959576103aa565b8063a217fddf14610894578063a3912ec8146103a8578063ab796566146108a9578063ac78dfe8146108d6576103aa565b80639157921c116101b65780639157921c146107ff57806391d148541461081f57806393c5678f1461083f5780639dcc4da31461085f576103aa565b80638f34e3471461077e5780638f851d8a146107b25780639010d07c146107df576103aa565b806338e454b1116102c1578063504af48c1161025f5780636c1ce6701161022e5780636c1ce670146107145780637de5dedd146107345780638456cb5914610749578063865e6fd31461075e576103aa565b8063504af48c1461068f57806359122f6b146106a25780635c975abb146106cf5780636932be98146106e7576103aa565b80634b14557e1161029b5780634b14557e1461060c5780634d0d66731461061f5780634d493f4e1461063f5780634f4247a11461066f576103aa565b806338e454b1146105c25780633e70838b146105d75780633f4ba83a146105f7576103aa565b80631d4a7210116103395780632f2ff15d116103085780632f2ff15d14610556578063302d12db146105765780633644e5151461058d57806336568abe146105a2576103aa565b80631d4a7210146104c3578063248a9ca3146104f057806329b6eca9146105205780632dfdf0b514610540576103aa565b806317ce2dd41161037557806317ce2dd41461043f57806317fcb39b146104635780631a8e55b0146104835780631b6e7594146104a3576103aa565b806301ffc9a7146103b2578063065b3adf146103e7578063110a83081461041f576103aa565b366103aa576103a8610b88565b005b6103a8610b88565b3480156103be57600080fd5b506103d26103cd36600461416e565b610bbc565b60405190151581526020015b60405180910390f35b3480156103f357600080fd5b50600554610407906001600160a01b031681565b6040516001600160a01b0390911681526020016103de565b34801561042b57600080fd5b506103a861043a3660046141ad565b610c01565b34801561044b57600080fd5b5061045560755481565b6040519081526020016103de565b34801561046f57600080fd5b50607454610407906001600160a01b031681565b34801561048f57600080fd5b506103a861049e36600461420e565b610ca6565b3480156104af57600080fd5b506103a86104be366004614279565b610ce2565b3480156104cf57600080fd5b506104556104de3660046141ad565b603e6020526000908152604090205481565b3480156104fc57600080fd5b5061045561050b36600461431d565b60009081526072602052604090206001015490565b34801561052c57600080fd5b506103a861053b3660046141ad565b610d22565b34801561054c57600080fd5b5061045560765481565b34801561056257600080fd5b506103a8610571366004614336565b610dab565b34801561058257600080fd5b50610455620f424081565b34801561059957600080fd5b50607754610455565b3480156105ae57600080fd5b506103a86105bd366004614336565b610dd5565b3480156105ce57600080fd5b506103a8610e53565b3480156105e357600080fd5b506103a86105f23660046141ad565b611030565b34801561060357600080fd5b506103a861105a565b6103a861061a366004614366565b61106a565b34801561062b57600080fd5b506103d261063a366004614391565b61108d565b34801561064b57600080fd5b506103d261065a36600461431d565b607a6020526000908152604090205460ff1681565b34801561067b57600080fd5b50607f54610407906001600160a01b031681565b6103a861069d36600461443b565b6110fd565b3480156106ae57600080fd5b506104556106bd3660046141ad565b603a6020526000908152604090205481565b3480156106db57600080fd5b5060005460ff166103d2565b3480156106f357600080fd5b5061045561070236600461431d565b60796020526000908152604090205481565b34801561072057600080fd5b506103d261072f366004614515565b6113c3565b34801561074057600080fd5b506104556113cf565b34801561075557600080fd5b506103a86113f0565b34801561076a57600080fd5b506103a8610779366004614550565b611400565b34801561078a57600080fd5b506104557f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e481565b3480156107be57600080fd5b506107d26107cd36600461461b565b61141b565b6040516103de9190614712565b3480156107eb57600080fd5b506104076107fa366004614727565b61159d565b34801561080b57600080fd5b506103a861081a366004614749565b6115b5565b34801561082b57600080fd5b506103d261083a366004614336565b611839565b34801561084b57600080fd5b506103a861085a36600461420e565b611864565b34801561086b57600080fd5b5061087f61087a366004614727565b61189a565b604080519283526020830191909152016103de565b3480156108a057600080fd5b50610455600081565b3480156108b557600080fd5b506104556108c43660046141ad565b603c6020526000908152604090205481565b3480156108e257600080fd5b506103d26108f136600461431d565b6118c3565b34801561090257600080fd5b5061045560045481565b34801561091857600080fd5b506103a861092736600461420e565b6118f9565b34801561093857600080fd5b506104556109473660046141ad565b60396020526000908152604090205481565b34801561096557600080fd5b506109796109743660046141ad565b61192f565b6040516103de9190614790565b34801561099257600080fd5b506103a86109a1366004614727565b6119d2565b3480156109b257600080fd5b506107d26109c1366004614893565b63bc197c8160e01b95945050505050565b3480156109de57600080fd5b506107d26109ed36600461420e565b6119ec565b3480156109fe57600080fd5b50610455610a0d36600461431d565b611b80565b348015610a1e57600080fd5b5060375460385461087f565b348015610a3657600080fd5b50610455610a453660046141ad565b603b6020526000908152604090205481565b348015610a6357600080fd5b506103a8610a72366004614336565b611b97565b348015610a8357600080fd5b50610455610a923660046141ad565b603d6020526000908152604090205481565b348015610ab057600080fd5b506103a8610abf3660046141ad565b611bbc565b348015610ad057600080fd5b506103d2610adf36600461431d565b611bcd565b348015610af057600080fd5b50610407610aff366004614940565b611bfb565b348015610b1057600080fd5b506103a8610b1f36600461495b565b611c71565b348015610b3057600080fd5b506103a8610b3f36600461420e565b611ce6565b348015610b5057600080fd5b5060015460025461087f565b348015610b6857600080fd5b506107d2610b77366004614a18565b63f23a6e6160e01b95945050505050565b6074546001600160a01b0316331480610bab5750607f546001600160a01b031633145b15610bb257565b610bba611d1c565b565b60006001600160e01b031982166246560160e51b1480610bec57506001600160e01b031982166312c0151560e21b145b80610bfb5750610bfb82611d46565b92915050565b607154600490610100900460ff16158015610c23575060715460ff8083169116105b610c485760405162461bcd60e51b8152600401610c3f90614a80565b60405180910390fd5b60718054607f80546001600160a01b0319166001600160a01b03861617905561ff001961010060ff851661ffff199093168317171690915560405190815260008051602061550c833981519152906020015b60405180910390a15050565b610cae611d6b565b6000839003610cd0576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484611dc5565b50505050565b610cea611d6b565b6000859003610d0c576040516316ee9d3b60e11b815260040160405180910390fd5b610d1a868686868686611e9a565b505050505050565b607154600290610100900460ff16158015610d44575060715460ff8083169116105b610d605760405162461bcd60e51b8152600401610c3f90614a80565b6071805461ffff191660ff831617610100179055610d7f600b83612042565b6071805461ff001916905560405160ff8216815260008051602061550c83398151915290602001610c9a565b600082815260726020526040902060010154610dc6816120e6565b610dd083836120f0565b505050565b6001600160a01b0381163314610e455760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610c3f565b610e4f8282612112565b5050565b607154600390610100900460ff16158015610e75575060715460ff8083169116105b610e915760405162461bcd60e51b8152600401610c3f90614a80565b6071805461ffff191660ff8316176101001790556000610eb1600b611bfb565b9050600080826001600160a01b031663c441c4a86040518163ffffffff1660e01b8152600401600060405180830381865afa158015610ef4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f1c9190810190614b4b565b92509250506000805b8351811015610fd957828181518110610f4057610f40614c31565b6020026020010151607e6000868481518110610f5e57610f5e614c31565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154816001600160601b0302191690836001600160601b03160217905550828181518110610fbc57610fbc614c31565b602002602001015182610fcf9190614c5d565b9150600101610f25565b50607d80546001600160601b0319166001600160601b039290921691909117905550506071805461ff00191690555060405160ff8216815260008051602061550c833981519152906020015b60405180910390a150565b611038611d6b565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b611062612134565b610bba6121a3565b6110726121f5565b61108a61108436839003830183614ccd565b3361223b565b50565b60006110976121f5565b6110f3848484808060200260200160405190810160405280939291908181526020016000905b828210156110e9576110da60608302860136819003810190614d20565b815260200190600101906110bd565b5050505050612516565b90505b9392505050565b607154610100900460ff161580801561111d5750607154600160ff909116105b806111375750303b158015611137575060715460ff166001145b6111535760405162461bcd60e51b8152600401610c3f90614a80565b6071805460ff191660011790558015611176576071805461ff0019166101001790555b61118160008c6129aa565b607589905561118f8a6129b4565b61121a6040517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81527f159f52c1e3a2b6a6aad3950adf713516211484e0516dad685ea662a094b7c43b60208201527fad7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5604082015246606082015230608082015260a0812060775550565b6112248887612a02565b61122e8787612a92565b5050611238612b29565b60006112448680614d6a565b905011156113055761126d6112598680614d6a565b6112666020890189614d6a565b8787611e9a565b61129361127a8680614d6a565b8660005b60200281019061128e9190614d6a565b612b76565b6112b96112a08680614d6a565b8660015b6020028101906112b49190614d6a565b611dc5565b6112df6112c68680614d6a565b8660025b6020028101906112da9190614d6a565b612c4b565b6113056112ec8680614d6a565b8660035b6020028101906113009190614d6a565b612d5c565b60005b6113156040870187614d6a565b9050811015611381576113797f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e461134f6040890189614d6a565b8481811061135f5761135f614c31565b905060200201602081019061137491906141ad565b6120f0565b600101611308565b5080156113b6576071805461ff00191690556040516001815260008051602061550c8339815191529060200160405180910390a15b5050505050505050505050565b60006110f68383612e31565b60006113eb6113e6607d546001600160601b031690565b612efc565b905090565b6113f8612134565b610bba612f32565b611408611d6b565b61141181612f6f565b610e4f8282612042565b6000600b61142881612fa5565b825186908114158061143a5750808514155b15611466576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b8060000361147e57506347c28ec560e11b9150611593565b60005b818110156115865784818151811061149b5761149b614c31565b60200260200101511561157e578686828181106114ba576114ba614c31565b90506020020160208101906114cf9190614db3565b607d80546001600160601b031981166001600160601b03918216939093011691909117905586868281811061150657611506614c31565b905060200201602081019061151b9190614db3565b607e60008b8b8581811061153157611531614c31565b905060200201602081019061154691906141ad565b6001600160a01b03168152602081019190915260400160002080546001600160601b0319166001600160601b03929092169190911790555b600101611481565b506347c28ec560e11b9250505b5095945050505050565b60008281526073602052604081206110f69083612ff1565b7f5e5712e902fff5e704bc4d506ad976718319e019e9d2a872528a01a85db433e46115df816120e6565b60006115f86115f336859003850185614e2d565b612ffd565b905061160c6115f336859003850185614e2d565b83356000908152607960205260409020541461163b5760405163f4b8742f60e01b815260040160405180910390fd5b82356000908152607a602052604090205460ff1661166c5760405163147bfe0760e01b815260040160405180910390fd5b82356000908152607a602052604090819020805460ff19169055517fd639511b37b3b002cca6cfe6bca0d833945a5af5a045578a0627fc43b79b2630906116b69083908690614f00565b60405180910390a160006116d060808501606086016141ad565b905060006116e661012086016101008701614f86565b60028111156116f7576116f7614766565b036117be5760006117113686900386016101008701614fa1565b6001600160a01b0383166000908152603b602052604090205490915061173d90610140870135906130c7565b604082015260006117573687900387016101008801614fa1565b604083015190915061176e90610140880135614fbd565b604082015260745461178e908390339086906001600160a01b03166130e1565b6117b76117a160608801604089016141ad565b60745483919086906001600160a01b03166130e1565b50506117fa565b6117fa6117d160608601604087016141ad565b60745483906001600160a01b03166117f23689900389016101008a01614fa1565b9291906130e1565b7f21e88e956aa3e086f6388e899965cef814688f99ad8bb29b08d396571016372d828560405161182b929190614f00565b60405180910390a150505050565b60009182526072602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61186c611d6b565b600083900361188e576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484612b76565b6000806118a5611d6b565b6118af8484612a92565b90925090506118bc612b29565b9250929050565b60006118d7607d546001600160601b031690565b6037546118e49190614fd0565b6038546118f19084614fd0565b101592915050565b611901611d6b565b6000839003611923576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484612c4b565b60408051808201909152600080825260208201526001600160a01b0382166000908152607860205260409081902081518083019092528054829060ff16600281111561197d5761197d614766565b600281111561198e5761198e614766565b815290546001600160a01b03610100909104811660209283015290820151919250166119cd57604051631b79f53b60e21b815260040160405180910390fd5b919050565b6119da611d6b565b6119e48282612a02565b610e4f612b29565b6000600b6119f981612fa5565b84838114611a28576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b80600003611a405750636242a4ef60e11b9150611b77565b6000805b82811015611b2757868682818110611a5e57611a5e614c31565b9050602002016020810190611a739190614fe7565b15611b1f57607e60008a8a84818110611a8e57611a8e614c31565b9050602002016020810190611aa391906141ad565b6001600160a01b0316815260208101919091526040016000908120546001600160601b03169290920191607e908a8a84818110611ae257611ae2614c31565b9050602002016020810190611af791906141ad565b6001600160a01b03168152602081019190915260400160002080546001600160601b03191690555b600101611a44565b50607d8054829190600090611b469084906001600160601b0316615004565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555063c48549de60e01b935050505b50949350505050565b6000818152607360205260408120610bfb90613313565b600082815260726020526040902060010154611bb2816120e6565b610dd08383612112565b611bc4611d6b565b61108a816129b4565b6000611be1607d546001600160601b031690565b600154611bee9190614fd0565b6002546118f19084614fd0565b60007fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600083600f811115611c3257611c32614766565b60ff1681526020810191909152604001600020546001600160a01b03169050806119cd578160405163409140df60e11b8152600401610c3f9190615034565b611c79611d6b565b6000869003611c9b576040516316ee9d3b60e11b815260040160405180910390fd5b611ca9878787878787611e9a565b611cb6878783600061127e565b611cc387878360016112a4565b611cd087878360026112ca565b611cdd87878360036112f0565b50505050505050565b611cee611d6b565b6000839003611d10576040516316ee9d3b60e11b815260040160405180910390fd5b610cdc84848484612d5c565b611d246121f5565b611d2c61412d565b33815260408082015134910152805161108a90829061223b565b60006001600160e01b03198216630271189760e51b1480610bfb5750610bfb8261331d565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b03163314610bba576000356001600160e01b0319166001604051620f948f60ea1b8152600401610c3f929190615042565b828114611df3576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015611e6457828282818110611e1057611e10614c31565b90506020020135603a6000878785818110611e2d57611e2d614c31565b9050602002016020810190611e4291906141ad565b6001600160a01b03168152602081019190915260400160002055600101611df6565b507f64557254143204d91ba2d95acb9fda1e5fea55f77efd028685765bc1e94dd4b58484848460405161182b94939291906150b9565b8483148015611ea857508481145b611ed3576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b85811015611ff857848482818110611ef057611ef0614c31565b9050602002016020810190611f0591906141ad565b60786000898985818110611f1b57611f1b614c31565b9050602002016020810190611f3091906141ad565b6001600160a01b03908116825260208201929092526040016000208054610100600160a81b0319166101009390921692909202179055828282818110611f7857611f78614c31565b9050602002016020810190611f8d9190614f86565b60786000898985818110611fa357611fa3614c31565b9050602002016020810190611fb891906141ad565b6001600160a01b031681526020810191909152604001600020805460ff19166001836002811115611feb57611feb614766565b0217905550600101611ed6565b507fa4f03cc9c0e0aeb5b71b4ec800702753f65748c2cf3064695ba8e8b46be7044486868686868660405161203296959493929190615105565b60405180910390a1505050505050565b807fdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb600084600f81111561207857612078614766565b60ff168152602081019190915260400160002080546001600160a01b0319166001600160a01b03928316179055811682600f8111156120b9576120b9614766565b6040517f865d1c228a8ea13709cfe61f346f7ff67f1bbd4a18ff31ad3e7147350d317c5990600090a35050565b61108a8133613342565b6120fa82826133a6565b6000828152607360205260409020610dd0908261342c565b61211c8282613441565b6000828152607360205260409020610dd090826134a8565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031633148061217657506005546001600160a01b031633145b610bba576000356001600160e01b0319166001604051620f948f60ea1b8152600401610c3f929190615042565b6121ab6134bd565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60005460ff1615610bba5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610c3f565b604080518082018252600080825260208201526074549184015190916001600160a01b03169061226a90613506565b60208401516001600160a01b031661230b5734846040015160400151146122a45760405163129c2ce160e31b815260040160405180910390fd5b6122ad8161192f565b60408501515190925060028111156122c7576122c7614766565b825160028111156122da576122da614766565b146122f75760405162035e2b60ea1b815260040160405180910390fd5b6001600160a01b03811660208501526124a3565b341561232a5760405163129c2ce160e31b815260040160405180910390fd5b612337846020015161192f565b604085015151909250600281111561235157612351614766565b8251600281111561236457612364614766565b146123815760405162035e2b60ea1b815260040160405180910390fd5b6020840151604085015161239691859061354a565b83602001516001600160a01b0316816001600160a01b0316036124a357607454607f54604086810151810151905163095ea7b360e01b81526001600160a01b039283166004820152602481019190915291169063095ea7b3906044016020604051808303816000875af1158015612411573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124359190615176565b50607f546040808601518101519051636f074d1f60e11b81526001600160a01b039092169163de0e9a3e916124709160040190815260200190565b600060405180830381600087803b15801561248a57600080fd5b505af115801561249e573d6000803e3d6000fd5b505050505b60768054600091826124b483615193565b91905055905060006124db858386602001516075548a6136c390949392919063ffffffff16565b90507fd7b25068d9dc8d00765254cfb7f5070f98d263c8d68931d937c7362fa738048b61250782612ffd565b826040516120329291906151cc565b600082356101408401358261253160808701606088016141ad565b905061254e6125493688900388016101008901614fa1565b613506565b60016125606040880160208901615268565b600181111561257157612571614766565b1461258f5760405163182f3d8760e11b815260040160405180910390fd5b608086013546146125d15760405163092048d160e11b81526000356001600160e01b031916600482015260808701356024820152466044820152606401610c3f565b60006125e66109746080890160608a016141ad565b90506125fa61012088016101008901614f86565b600281111561260b5761260b614766565b8151600281111561261e5761261e614766565b14801561264f575061263660e0880160c089016141ad565b6001600160a01b031681602001516001600160a01b0316145b8015612660575060755460e0880135145b61267d5760405163f4b8742f60e01b815260040160405180910390fd5b600084815260796020526040902054156126aa57604051634f13df6160e01b815260040160405180910390fd5b60016126be61012089016101008a01614f86565b60028111156126cf576126cf614766565b14806126e257506126e08284612e31565b155b6126ff5760405163c51297b760e01b815260040160405180910390fd5b60006127136115f3368a90038a018a614e2d565b9050600061272360775483613798565b9050600061274361273c6101208c016101008d01614f86565b86886137d9565b60408051606081018252600080825260208201819052918101829052919a50919250819081906000805b8e51811015612881578e818151811061278857612788614c31565b6020908102919091018101518051818301516040808401518151600081529586018083528e905260ff9093169085015260608401526080830152935060019060a0016020604051602081039080840390855afa1580156127ec573d6000803e3d6000fd5b505050602060405103519450846001600160a01b0316846001600160a01b031610612838576000356001600160e01b031916604051635d3dcd3160e01b8152600401610c3f9190614712565b6001600160a01b0385166000908152607e60205260409020548594506001600160601b03166128679083615283565b91508682106128795760019550612881565b60010161276d565b50846128a057604051639e8f5f6360e01b815260040160405180910390fd5b50505060008981526079602052604090208590555050871561291b576000878152607a602052604090819020805460ff19166001179055517f89e52969465b1f1866fc5d46fd62de953962e9cb33552443cd999eba05bd20dc906129079085908d90614f00565b60405180910390a150505050505050610bfb565b6129258587613869565b61296461293860608c0160408d016141ad565b86607460009054906101000a90046001600160a01b03168d610100018036038101906117f29190614fa1565b7f21e88e956aa3e086f6388e899965cef814688f99ad8bb29b08d396571016372d838b604051612995929190614f00565b60405180910390a15050505050505092915050565b610e4f82826120f0565b607480546001600160a01b0319166001600160a01b0383169081179091556040519081527f9d2334c23be647e994f27a72c5eee42a43d5bdcfe15bb88e939103c2b114cbaf90602001611025565b80821115612a31576000356001600160e01b0319166040516387f6f09560e01b8152600401610c3f9190614712565b6001805460028054858455908490556004805493840190556040805183815260208101839052929391928592879290917f976f8a9c5bdf8248dec172376d6e2b80a8e3df2f0328e381c6db8e1cf138c0f8910160405180910390a450505050565b60008082841115612ac4576000356001600160e01b0319166040516387f6f09560e01b8152600401610c3f9190614712565b5050603780546038805492859055839055600480546001810190915560408051838152602081018590529293928592879290917f31312c97b89cc751b832d98fd459b967a2c3eef3b49757d1cf5ebaa12bb6eee1910160405180910390a49250929050565b600254603754612b399190614fd0565b603854600154612b499190614fd0565b1115610bba576000356001600160e01b0319166040516387f6f09560e01b8152600401610c3f9190614712565b828114612ba4576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015612c1557828282818110612bc157612bc1614c31565b9050602002013560396000878785818110612bde57612bde614c31565b9050602002016020810190612bf391906141ad565b6001600160a01b03168152602081019190915260400160002055600101612ba7565b507f80bc635c452ae67f12f9b6f12ad4daa6dbbc04eeb9ebb87d354ce10c0e210dc08484848460405161182b94939291906150b9565b828114612c79576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015612d2657620f4240838383818110612c9a57612c9a614c31565b905060200201351115612cc05760405163572d3bd360e11b815260040160405180910390fd5b828282818110612cd257612cd2614c31565b90506020020135603b6000878785818110612cef57612cef614c31565b9050602002016020810190612d0491906141ad565b6001600160a01b03168152602081019190915260400160002055600101612c7c565b507fb05f5de88ae0294ebb6f67c5af2fcbbd593cc6bdfe543e2869794a4c8ce3ea508484848460405161182b94939291906150b9565b828114612d8a576000356001600160e01b0319166040516306b5667560e21b8152600401610c3f9190614712565b60005b83811015612dfb57828282818110612da757612da7614c31565b90506020020135603c6000878785818110612dc457612dc4614c31565b9050602002016020810190612dd991906141ad565b6001600160a01b03168152602081019190915260400160002055600101612d8d565b507fb5d2963614d72181b4df1f993d45b83edf42fa19710f0204217ba1b3e183bb738484848460405161182b94939291906150b9565b6001600160a01b0382166000908152603a60205260408120548210612e5857506000610bfb565b6000612e676201518042615296565b6001600160a01b0385166000908152603e6020526040902054909150811115612ead5750506001600160a01b0382166000908152603c6020526040902054811015610bfb565b6001600160a01b0384166000908152603d6020526040902054612ed1908490615283565b6001600160a01b0385166000908152603c602052604090205411159150610bfb9050565b5092915050565b6000600254600160025484600154612f149190614fd0565b612f1e9190615283565b612f289190614fbd565b610bfb9190615296565b612f3a6121f5565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586121d83390565b806001600160a01b03163b60000361108a57604051630bfc64a360e21b81526001600160a01b0382166004820152602401610c3f565b612fae81611bfb565b6001600160a01b0316336001600160a01b03161461108a576000356001600160e01b03191681336040516320e0f98d60e21b8152600401610c3f939291906152b8565b60006110f683836138f9565b60008061300d8360400151613923565b9050600061301e8460600151613923565b905060006130728560800151604080517f1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d815282516020808301919091528301518183015291015160608201526080902090565b604080517fb9d1fe7c9deeec5dc90a2f47ff1684239519f2545b2228d3d91fb27df3189eea815287516020808301919091529097015190870152606086019390935250608084015260a08301525060c0902090565b6000620f42406130d78385614fd0565b6110f69190615296565b806001600160a01b0316826001600160a01b03160361318e5760408085015190516001600160a01b0385169180156108fc02916000818181858888f1935050505061318957806001600160a01b031663d0e30db085604001516040518263ffffffff1660e01b81526004016000604051808303818588803b15801561316557600080fd5b505af1158015613179573d6000803e3d6000fd5b505050505061318984848461396b565b610cdc565b6000845160028111156131a3576131a3614766565b03613269576040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156131ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061321391906152ef565b905084604001518110156132585761323b83308388604001516132369190614fbd565b6139ea565b61325857604051632f739fff60e11b815260040160405180910390fd5b61326385858561396b565b50610cdc565b60018451600281111561327e5761327e614766565b036132af5761329282848660200151613a8f565b6131895760405163c8e3a09f60e01b815260040160405180910390fd5b6002845160028111156132c4576132c4614766565b036132fa576132dd828486602001518760400151613ab6565b613189576040516334b471a760e21b815260040160405180910390fd5b6040516361e411a760e11b815260040160405180910390fd5b6000610bfb825490565b60006001600160e01b03198216635a05180f60e01b1480610bfb5750610bfb82613ae3565b61334c8282611839565b610e4f57613364816001600160a01b03166014613b18565b61336f836020613b18565b60405160200161338092919061532c565b60408051601f198184030181529082905262461bcd60e51b8252610c3f916004016153cd565b6133b08282611839565b610e4f5760008281526072602090815260408083206001600160a01b03851684529091529020805460ff191660011790556133e83390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006110f6836001600160a01b038416613cb3565b61344b8282611839565b15610e4f5760008281526072602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006110f6836001600160a01b038416613d02565b60005460ff16610bba5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610c3f565b61350f81613df5565b8061351e575061351e81613e2c565b8061352d575061352d81613e54565b61108a5760405163034992a760e51b815260040160405180910390fd5b60006060818551600281111561356257613562614766565b0361363d5760408581015181516001600160a01b03878116602483015230604483015260648083019390935283518083039093018352608490910183526020820180516001600160e01b03166323b872dd60e01b1790529151918516916135c991906153e0565b6000604051808303816000865af19150503d8060008114613606576040519150601f19603f3d011682016040523d82523d6000602084013e61360b565b606091505b5090925090508180156136365750805115806136365750808060200190518101906136369190615176565b9150613696565b60018551600281111561365257613652614766565b03613667576136368385308860200151613e7d565b60028551600281111561367c5761367c614766565b036132fa5761363683853088602001518960400151613f2b565b816136bc5784843085604051639d2e4c6760e01b8152600401610c3f94939291906153fc565b5050505050565b6137336040805160a08101825260008082526020808301829052835160608082018652838252818301849052818601849052848601919091528451808201865283815280830184905280860184905281850152845190810185528281529081018290529283015290608082015290565b83815260006020820181905250604080820180516001600160a01b039788169052602080890151825190891690820152905146908301528751606084018051918916909152805195909716940193909352935182015292909201516080820152919050565b6040805161190160f01b60208083019190915260228201859052604280830185905283518084039091018152606290920190925280519101206000906110f6565b60008060006137f0607d546001600160601b031690565b90506137fb81612efc565b9250600086600281111561381157613811614766565b03613860576001600160a01b03851660009081526039602052604090205484106138415761383e81613fdf565b92505b6001600160a01b0385166000908152603a602052604090205484101591505b50935093915050565b60006138786201518042615296565b6001600160a01b0384166000908152603e60205260409020549091508111156138c7576001600160a01b03929092166000908152603e6020908152604080832094909455603d90529190912055565b6001600160a01b0383166000908152603d6020526040812080548492906138ef908490615283565b9091555050505050565b600082600001828154811061391057613910614c31565b9060005260206000200154905092915050565b604080517f353bdd8d69b9e3185b3972e08b03845c0c14a21a390215302776a7a34b0e8764815282516020808301919091528301518183015291015160608201526080902090565b6000808451600281111561398157613981614766565b0361399c5761399582848660400151613ff7565b90506139c6565b6001845160028111156139b1576139b1614766565b036132fa576139958230858760200151613e7d565b80610cdc578383836040516341bd7d9160e11b8152600401610c3f93929190615432565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b03166340c10f1960e01b1790529151600092861691613a42916153e0565b6000604051808303816000865af19150503d8060008114613a7f576040519150601f19603f3d011682016040523d82523d6000602084013e613a84565b606091505b509095945050505050565b6000613a9d84308585613e7d565b9050806110f657613aaf8484846139ea565b90506110f6565b6000613ac58530868686613f2b565b905080613adb57613ad8858585856140ca565b90505b949350505050565b60006001600160e01b03198216637965db0b60e01b1480610bfb57506301ffc9a760e01b6001600160e01b0319831614610bfb565b60606000613b27836002614fd0565b613b32906002615283565b6001600160401b03811115613b4957613b4961457c565b6040519080825280601f01601f191660200182016040528015613b73576020820181803683370190505b509050600360fc1b81600081518110613b8e57613b8e614c31565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613bbd57613bbd614c31565b60200101906001600160f81b031916908160001a9053506000613be1846002614fd0565b613bec906001615283565b90505b6001811115613c64576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613c2057613c20614c31565b1a60f81b828281518110613c3657613c36614c31565b60200101906001600160f81b031916908160001a90535060049490941c93613c5d81615462565b9050613bef565b5083156110f65760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c3f565b6000818152600183016020526040812054613cfa57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610bfb565b506000610bfb565b60008181526001830160205260408120548015613deb576000613d26600183614fbd565b8554909150600090613d3a90600190614fbd565b9050818114613d9f576000866000018281548110613d5a57613d5a614c31565b9060005260206000200154905080876000018481548110613d7d57613d7d614c31565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613db057613db0615479565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610bfb565b6000915050610bfb565b60008082516002811115613e0b57613e0b614766565b148015613e1c575060008260400151115b8015610bfb575050602001511590565b6000600182516002811115613e4357613e43614766565b148015610bfb575050604001511590565b6000600282516002811115613e6b57613e6b614766565b148015610bfb57505060400151151590565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b1790529151600092871691613edd916153e0565b6000604051808303816000865af19150503d8060008114613f1a576040519150601f19603f3d011682016040523d82523d6000602084013e613f1f565b606091505b50909695505050505050565b604080516000808252602082019092526001600160a01b03871690613f5b9087908790879087906044810161548f565b60408051601f198184030181529181526020820180516001600160e01b0316637921219560e11b17905251613f9091906153e0565b6000604051808303816000865af19150503d8060008114613fcd576040519150601f19603f3d011682016040523d82523d6000602084013e613fd2565b606091505b5090979650505050505050565b6000603854600160385484603754612f149190614fd0565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000926060929087169161405491906153e0565b6000604051808303816000865af19150503d8060008114614091576040519150601f19603f3d011682016040523d82523d6000602084013e614096565b606091505b5090925090508180156140c15750805115806140c15750808060200190518101906140c19190615176565b95945050505050565b604080516000808252602082019092526001600160a01b038616906140f890869086908690604481016154d4565b60408051601f198184030181529181526020820180516001600160e01b031663731133e960e01b17905251613edd91906153e0565b60408051606081018252600080825260208201529081016141696040805160608101909152806000815260200160008152602001600081525090565b905290565b60006020828403121561418057600080fd5b81356001600160e01b0319811681146110f657600080fd5b6001600160a01b038116811461108a57600080fd5b6000602082840312156141bf57600080fd5b81356110f681614198565b60008083601f8401126141dc57600080fd5b5081356001600160401b038111156141f357600080fd5b6020830191508360208260051b85010111156118bc57600080fd5b6000806000806040858703121561422457600080fd5b84356001600160401b038082111561423b57600080fd5b614247888389016141ca565b9096509450602087013591508082111561426057600080fd5b5061426d878288016141ca565b95989497509550505050565b6000806000806000806060878903121561429257600080fd5b86356001600160401b03808211156142a957600080fd5b6142b58a838b016141ca565b909850965060208901359150808211156142ce57600080fd5b6142da8a838b016141ca565b909650945060408901359150808211156142f357600080fd5b5061430089828a016141ca565b979a9699509497509295939492505050565b80356119cd81614198565b60006020828403121561432f57600080fd5b5035919050565b6000806040838503121561434957600080fd5b82359150602083013561435b81614198565b809150509250929050565b600060a0828403121561437857600080fd5b50919050565b6000610160828403121561437857600080fd5b600080600061018084860312156143a757600080fd5b6143b1858561437e565b92506101608401356001600160401b03808211156143ce57600080fd5b818601915086601f8301126143e257600080fd5b8135818111156143f157600080fd5b87602060608302850101111561440657600080fd5b6020830194508093505050509250925092565b8060608101831015610bfb57600080fd5b8060808101831015610bfb57600080fd5b6000806000806000806000806000806101208b8d03121561445b57600080fd5b6144648b614312565b995061447260208c01614312565b985060408b0135975060608b0135965060808b0135955060a08b0135945060c08b01356001600160401b03808211156144aa57600080fd5b6144b68e838f01614419565b955060e08d01359150808211156144cc57600080fd5b6144d88e838f0161442a565b94506101008d01359150808211156144ef57600080fd5b506144fc8d828e016141ca565b915080935050809150509295989b9194979a5092959850565b6000806040838503121561452857600080fd5b823561453381614198565b946020939093013593505050565b8035601081106119cd57600080fd5b6000806040838503121561456357600080fd5b61456c83614541565b9150602083013561435b81614198565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b03811182821017156145b4576145b461457c565b60405290565b604051601f8201601f191681016001600160401b03811182821017156145e2576145e261457c565b604052919050565b60006001600160401b038211156146035761460361457c565b5060051b60200190565b801515811461108a57600080fd5b60008060008060006060868803121561463357600080fd5b85356001600160401b038082111561464a57600080fd5b61465689838a016141ca565b909750955060209150878201358181111561467057600080fd5b61467c8a828b016141ca565b90965094505060408801358181111561469457600080fd5b88019050601f810189136146a757600080fd5b80356146ba6146b5826145ea565b6145ba565b81815260059190911b8201830190838101908b8311156146d957600080fd5b928401925b828410156147005783356146f18161460d565b825292840192908401906146de565b80955050505050509295509295909350565b6001600160e01b031991909116815260200190565b6000806040838503121561473a57600080fd5b50508035926020909101359150565b6000610160828403121561475c57600080fd5b6110f6838361437e565b634e487b7160e01b600052602160045260246000fd5b6003811061478c5761478c614766565b9052565b60006040820190506147a382845161477c565b6020928301516001600160a01b0316919092015290565b600082601f8301126147cb57600080fd5b813560206147db6146b5836145ea565b8083825260208201915060208460051b8701019350868411156147fd57600080fd5b602086015b848110156148195780358352918301918301614802565b509695505050505050565b600082601f83011261483557600080fd5b81356001600160401b0381111561484e5761484e61457c565b614861601f8201601f19166020016145ba565b81815284602083860101111561487657600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a086880312156148ab57600080fd5b85356148b681614198565b945060208601356148c681614198565b935060408601356001600160401b03808211156148e257600080fd5b6148ee89838a016147ba565b9450606088013591508082111561490457600080fd5b61491089838a016147ba565b9350608088013591508082111561492657600080fd5b5061493388828901614824565b9150509295509295909350565b60006020828403121561495257600080fd5b6110f682614541565b60008060008060008060006080888a03121561497657600080fd5b87356001600160401b038082111561498d57600080fd5b6149998b838c016141ca565b909950975060208a01359150808211156149b257600080fd5b6149be8b838c016141ca565b909750955060408a01359150808211156149d757600080fd5b6149e38b838c016141ca565b909550935060608a01359150808211156149fc57600080fd5b50614a098a828b0161442a565b91505092959891949750929550565b600080600080600060a08688031215614a3057600080fd5b8535614a3b81614198565b94506020860135614a4b81614198565b9350604086013592506060860135915060808601356001600160401b03811115614a7457600080fd5b61493388828901614824565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b600082601f830112614adf57600080fd5b81516020614aef6146b5836145ea565b8083825260208201915060208460051b870101935086841115614b1157600080fd5b602086015b84811015614819578051614b2981614198565b8352918301918301614b16565b6001600160601b038116811461108a57600080fd5b600080600060608486031215614b6057600080fd5b83516001600160401b0380821115614b7757600080fd5b614b8387838801614ace565b9450602091508186015181811115614b9a57600080fd5b614ba688828901614ace565b945050604086015181811115614bbb57600080fd5b86019050601f81018713614bce57600080fd5b8051614bdc6146b5826145ea565b81815260059190911b82018301908381019089831115614bfb57600080fd5b928401925b82841015614c22578351614c1381614b36565b82529284019290840190614c00565b80955050505050509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6001600160601b03818116838216019080821115612ef557612ef5614c47565b8035600381106119cd57600080fd5b600060608284031215614c9e57600080fd5b614ca6614592565b9050614cb182614c7d565b8152602082013560208201526040820135604082015292915050565b600060a08284031215614cdf57600080fd5b614ce7614592565b8235614cf281614198565b81526020830135614d0281614198565b6020820152614d148460408501614c8c565b60408201529392505050565b600060608284031215614d3257600080fd5b614d3a614592565b823560ff81168114614d4b57600080fd5b8152602083810135908201526040928301359281019290925250919050565b6000808335601e19843603018112614d8157600080fd5b8301803591506001600160401b03821115614d9b57600080fd5b6020019150600581901b36038213156118bc57600080fd5b600060208284031215614dc557600080fd5b81356110f681614b36565b8035600281106119cd57600080fd5b600060608284031215614df157600080fd5b614df9614592565b90508135614e0681614198565b81526020820135614e1681614198565b806020830152506040820135604082015292915050565b60006101608284031215614e4057600080fd5b60405160a081018181106001600160401b0382111715614e6257614e6261457c565b60405282358152614e7560208401614dd0565b6020820152614e878460408501614ddf565b6040820152614e998460a08501614ddf565b6060820152614eac846101008501614c8c565b60808201529392505050565b6002811061478c5761478c614766565b8035614ed381614198565b6001600160a01b039081168352602082013590614eef82614198565b166020830152604090810135910152565b60006101808201905083825282356020830152614f1f60208401614dd0565b614f2c6040840182614eb8565b50614f3d6060830160408501614ec8565b614f4d60c0830160a08501614ec8565b610120614f68818401614f636101008701614c7d565b61477c565b61014081850135818501528085013561016085015250509392505050565b600060208284031215614f9857600080fd5b6110f682614c7d565b600060608284031215614fb357600080fd5b6110f68383614c8c565b81810381811115610bfb57610bfb614c47565b8082028115828204841417610bfb57610bfb614c47565b600060208284031215614ff957600080fd5b81356110f68161460d565b6001600160601b03828116828216039080821115612ef557612ef5614c47565b6010811061478c5761478c614766565b60208101610bfb8284615024565b6001600160e01b03198316815260408101600b831061506357615063614766565b8260208301529392505050565b8183526000602080850194508260005b858110156150ae57813561509381614198565b6001600160a01b031687529582019590820190600101615080565b509495945050505050565b6040815260006150cd604083018688615070565b82810360208401528381526001600160fb1b038411156150ec57600080fd5b8360051b80866020840137016020019695505050505050565b60608152600061511960608301888a615070565b6020838203602085015261512e82888a615070565b848103604086015285815286925060200160005b868110156151675761515782614f6386614c7d565b9282019290820190600101615142565b509a9950505050505050505050565b60006020828403121561518857600080fd5b81516110f68161460d565b6000600182016151a5576151a5614c47565b5060010190565b6151b782825161477c565b60208181015190830152604090810151910152565b6000610180820190508382528251602083015260208301516151f16040840182614eb8565b5060408381015180516001600160a01b03908116606086015260208201511660808501529081015160a084015250606083015180516001600160a01b0390811660c085015260208201511660e084015260408101516101008401525060808301516152606101208401826151ac565b509392505050565b60006020828403121561527a57600080fd5b6110f682614dd0565b80820180821115610bfb57610bfb614c47565b6000826152b357634e487b7160e01b600052601260045260246000fd5b500490565b6001600160e01b031984168152606081016152d66020830185615024565b6001600160a01b03929092166040919091015292915050565b60006020828403121561530157600080fd5b5051919050565b60005b8381101561532357818101518382015260200161530b565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615364816017850160208801615308565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615395816028840160208801615308565b01602801949350505050565b600081518084526153b9816020860160208601615308565b601f01601f19169290920160200192915050565b6020815260006110f660208301846153a1565b600082516153f2818460208701615308565b9190910192915050565b60c0810161540a82876151ac565b6001600160a01b0394851660608301529284166080820152921660a090920191909152919050565b60a0810161544082866151ac565b6001600160a01b03938416606083015291909216608090920191909152919050565b60008161547157615471614c47565b506000190190565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906154c9908301846153a1565b979650505050505050565b60018060a01b038516815283602082015282604082015260806060820152600061550160808301846153a1565b969550505050505056fe7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498a2646970667358221220a2f9831a0e3d85059cd7b361f6be20ecc705006971478a7cb6c6bfef562802c064736f6c63430008170033", "deployer": "0x968D0Cd7343f711216817E617d3f92a23dC91c07", "devdoc": { "version": 1, @@ -2697,9 +2697,9 @@ } }, "isFoundry": true, - "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"ErrContractTypeNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrERC1155MintingFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrERC20MintingFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrERC721MintingFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrEmptyArray\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"}],\"name\":\"ErrInvalidChainId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidInfo\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidOrder\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidPercentage\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidReceipt\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidReceiptKind\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidRequest\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidThreshold\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidTokenStandard\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrLengthMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrQueryForApprovedWithdrawal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrQueryForInsufficientVoteWeight\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrQueryForProcessedWithdrawal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrReachedDailyWithdrawalLimit\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"tokenInfo\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"ErrTokenCouldNotTransfer\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"tokenInfo\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"ErrTokenCouldNotTransferFrom\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum RoleAccess\",\"name\":\"expectedRole\",\"type\":\"uint8\"}],\"name\":\"ErrUnauthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum ContractType\",\"name\":\"expectedContractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"actual\",\"type\":\"address\"}],\"name\":\"ErrUnexpectedInternalCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrUnsupportedStandard\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrUnsupportedToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrZeroCodeContract\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ContractUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"limits\",\"type\":\"uint256[]\"}],\"name\":\"DailyWithdrawalLimitsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"receiptHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"struct Transfer.Receipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"DepositRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"thresholds\",\"type\":\"uint256[]\"}],\"name\":\"HighTierThresholdsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"numerator\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"denominator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousNumerator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousDenominator\",\"type\":\"uint256\"}],\"name\":\"HighTierVoteWeightThresholdUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"thresholds\",\"type\":\"uint256[]\"}],\"name\":\"LockedThresholdsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"numerator\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"denominator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousNumerator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousDenominator\",\"type\":\"uint256\"}],\"name\":\"ThresholdUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"mainchainTokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"roninTokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"enum TokenStandard[]\",\"name\":\"standards\",\"type\":\"uint8[]\"}],\"name\":\"TokenMapped\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"percentages\",\"type\":\"uint256[]\"}],\"name\":\"UnlockFeePercentagesUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"receiptHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"struct Transfer.Receipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"WithdrawalLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"receiptHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"struct Transfer.Receipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"WithdrawalUnlocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"receiptHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"struct Transfer.Receipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"Withdrew\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IWETH\",\"name\":\"weth\",\"type\":\"address\"}],\"name\":\"WrappedNativeTokenContractUpdated\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WITHDRAWAL_UNLOCKER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_MAX_PERCENTAGE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_voteWeight\",\"type\":\"uint256\"}],\"name\":\"checkHighTierVoteWeightThreshold\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_voteWeight\",\"type\":\"uint256\"}],\"name\":\"checkThreshold\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"dailyWithdrawalLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"emergencyPauser\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"getContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"contract_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getHighTierVoteWeightThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getRoleMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleMemberCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"mainchainToken\",\"type\":\"address\"}],\"name\":\"getRoninToken\",\"outputs\":[{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"}],\"internalType\":\"struct MappedTokenConsumer.MappedToken\",\"name\":\"token\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"num_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"highTierThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_roleSetter\",\"type\":\"address\"},{\"internalType\":\"contract IWETH\",\"name\":\"_wrappedToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_roninChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_numerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_highTierVWNumerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_denominator\",\"type\":\"uint256\"},{\"internalType\":\"address[][3]\",\"name\":\"_addresses\",\"type\":\"address[][3]\"},{\"internalType\":\"uint256[][4]\",\"name\":\"_thresholds\",\"type\":\"uint256[][4]\"},{\"internalType\":\"enum TokenStandard[]\",\"name\":\"_standards\",\"type\":\"uint8[]\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeManagerContract\",\"type\":\"address\"}],\"name\":\"initializeV2\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initializeV3\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"wethUnwrapper_\",\"type\":\"address\"}],\"name\":\"initializeV4\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"lastDateSynced\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"lastSyncedWithdrawal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"lockedThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_mainchainTokens\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"_roninTokens\",\"type\":\"address[]\"},{\"internalType\":\"enum TokenStandard[]\",\"name\":\"_standards\",\"type\":\"uint8[]\"}],\"name\":\"mapTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_mainchainTokens\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"_roninTokens\",\"type\":\"address[]\"},{\"internalType\":\"enum TokenStandard[]\",\"name\":\"_standards\",\"type\":\"uint8[]\"},{\"internalType\":\"uint256[][4]\",\"name\":\"_thresholds\",\"type\":\"uint256[][4]\"}],\"name\":\"mapTokensAndThresholds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minimumVoteWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"operators\",\"type\":\"address[]\"},{\"internalType\":\"uint96[]\",\"name\":\"weights\",\"type\":\"uint96[]\"},{\"internalType\":\"bool[]\",\"name\":\"addeds\",\"type\":\"bool[]\"}],\"name\":\"onBridgeOperatorsAdded\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"operators\",\"type\":\"address[]\"},{\"internalType\":\"bool[]\",\"name\":\"removeds\",\"type\":\"bool[]\"}],\"name\":\"onBridgeOperatorsRemoved\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155BatchReceived\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_quantity\",\"type\":\"uint256\"}],\"name\":\"reachedWithdrawalLimit\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"receiveEther\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipientAddr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"internalType\":\"struct Transfer.Request\",\"name\":\"_request\",\"type\":\"tuple\"}],\"name\":\"requestDepositFor\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"roninChainId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_tokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_limits\",\"type\":\"uint256[]\"}],\"name\":\"setDailyWithdrawalLimits\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"setEmergencyPauser\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_tokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_thresholds\",\"type\":\"uint256[]\"}],\"name\":\"setHighTierThresholds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_numerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_denominator\",\"type\":\"uint256\"}],\"name\":\"setHighTierVoteWeightThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_previousNum\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_previousDenom\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_tokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_thresholds\",\"type\":\"uint256[]\"}],\"name\":\"setLockedThresholds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom\",\"type\":\"uint256\"}],\"name\":\"setThreshold\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_tokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_percentages\",\"type\":\"uint256[]\"}],\"name\":\"setUnlockFeePercentages\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IWETH\",\"name\":\"_wrappedToken\",\"type\":\"address\"}],\"name\":\"setWrappedNativeTokenContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"internalType\":\"struct Transfer.Receipt\",\"name\":\"_receipt\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"_signatures\",\"type\":\"tuple[]\"}],\"name\":\"submitWithdrawal\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"_locked\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"unlockFeePercentages\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"internalType\":\"struct Transfer.Receipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"unlockWithdrawal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"wethUnwrapper\",\"outputs\":[{\"internalType\":\"contract WethUnwrapper\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"withdrawalHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"withdrawalLocked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"wrappedNativeToken\",\"outputs\":[{\"internalType\":\"contract IWETH\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"errors\":{\"ErrContractTypeNotFound(uint8)\":[{\"details\":\"Error of invalid role.\"}],\"ErrERC1155MintingFailed()\":[{\"details\":\"Error indicating that the mint of ERC1155 tokens has failed.\"}],\"ErrERC20MintingFailed()\":[{\"details\":\"Error indicating that the minting of ERC20 tokens has failed.\"}],\"ErrERC721MintingFailed()\":[{\"details\":\"Error indicating that the minting of ERC721 tokens has failed.\"}],\"ErrEmptyArray()\":[{\"details\":\"Error indicating that an array is empty when it should contain elements.\"}],\"ErrInvalidChainId(bytes4,uint256,uint256)\":[{\"details\":\"Error indicating that the chain ID is invalid.\",\"params\":{\"actual\":\"Current chain ID that executing function.\",\"expected\":\"Expected chain ID required for the tx to success.\",\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid chain ID.\"}}],\"ErrInvalidInfo()\":[{\"details\":\"Error indicating that the provided information is invalid.\"}],\"ErrInvalidOrder(bytes4)\":[{\"details\":\"Error indicating that an order is invalid.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid order.\"}}],\"ErrInvalidPercentage()\":[{\"details\":\"Error of invalid percentage.\"}],\"ErrInvalidReceipt()\":[{\"details\":\"Error indicating that a receipt is invalid.\"}],\"ErrInvalidReceiptKind()\":[{\"details\":\"Error indicating that a receipt kind is invalid.\"}],\"ErrInvalidRequest()\":[{\"details\":\"Error indicating that a request is invalid.\"}],\"ErrInvalidThreshold(bytes4)\":[{\"details\":\"Error indicating that the provided threshold is invalid for a specific function signature.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that the invalid threshold applies to.\"}}],\"ErrInvalidTokenStandard()\":[{\"details\":\"Error indicating that a token standard is invalid.\"}],\"ErrLengthMismatch(bytes4)\":[{\"details\":\"Error indicating a mismatch in the length of input parameters or arrays for a specific function.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that has a length mismatch.\"}}],\"ErrQueryForApprovedWithdrawal()\":[{\"details\":\"Error indicating that a query was made for an approved withdrawal.\"}],\"ErrQueryForInsufficientVoteWeight()\":[{\"details\":\"Error indicating that a query was made for insufficient vote weight.\"}],\"ErrQueryForProcessedWithdrawal()\":[{\"details\":\"Error indicating that a query was made for a processed withdrawal.\"}],\"ErrReachedDailyWithdrawalLimit()\":[{\"details\":\"Error indicating that the daily withdrawal limit has been reached.\"}],\"ErrTokenCouldNotTransfer((uint8,uint256,uint256),address,address)\":[{\"details\":\"Error indicating that the `transfer` has failed.\",\"params\":{\"to\":\"Receiver of the token value.\",\"token\":\"Address of the token.\",\"tokenInfo\":\"Info of the token including ERC standard, id or quantity.\"}}],\"ErrTokenCouldNotTransferFrom((uint8,uint256,uint256),address,address,address)\":[{\"details\":\"Error indicating that the `handleAssetIn` has failed.\",\"params\":{\"from\":\"Owner of the token value.\",\"to\":\"Receiver of the token value.\",\"token\":\"Address of the token.\",\"tokenInfo\":\"Info of the token including ERC standard, id or quantity.\"}}],\"ErrUnauthorized(bytes4,uint8)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"expectedRole\":\"The role required to perform the function.\",\"msgSig\":\"The function signature (bytes4) that the caller is unauthorized to perform.\"}}],\"ErrUnexpectedInternalCall(bytes4,uint8,address)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"actual\":\"The actual address that called to the function.\",\"expectedContractType\":\"The contract type required to perform the function.\",\"msgSig\":\"The function signature (bytes4).\"}}],\"ErrUnsupportedStandard()\":[{\"details\":\"Error indicating that an unsupported standard is encountered.\"}],\"ErrUnsupportedToken()\":[{\"details\":\"Error indicating that a token is not supported.\"}],\"ErrZeroCodeContract(address)\":[{\"details\":\"Error of set to non-contract.\"}]},\"events\":{\"ContractUpdated(uint8,address)\":{\"details\":\"Emitted when a contract is updated.\"},\"DailyWithdrawalLimitsUpdated(address[],uint256[])\":{\"details\":\"Emitted when the daily limit thresholds are updated\"},\"DepositRequested(bytes32,(uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Emitted when the deposit is requested\"},\"HighTierThresholdsUpdated(address[],uint256[])\":{\"details\":\"Emitted when the thresholds for high-tier withdrawals that requires high-tier vote weights are updated\"},\"HighTierVoteWeightThresholdUpdated(uint256,uint256,uint256,uint256,uint256)\":{\"details\":\"Emitted when the high-tier vote weight threshold is updated\"},\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"LockedThresholdsUpdated(address[],uint256[])\":{\"details\":\"Emitted when the thresholds for locked withdrawals are updated\"},\"Paused(address)\":{\"details\":\"Emitted when the pause is triggered by `account`.\"},\"RoleAdminChanged(bytes32,bytes32,bytes32)\":{\"details\":\"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this. _Available since v3.1._\"},\"RoleGranted(bytes32,address,address)\":{\"details\":\"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.\"},\"RoleRevoked(bytes32,address,address)\":{\"details\":\"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)\"},\"ThresholdUpdated(uint256,uint256,uint256,uint256,uint256)\":{\"details\":\"Emitted when the threshold is updated\"},\"TokenMapped(address[],address[],uint8[])\":{\"details\":\"Emitted when the tokens are mapped\"},\"UnlockFeePercentagesUpdated(address[],uint256[])\":{\"details\":\"Emitted when the fee percentages to unlock withdraw are updated\"},\"Unpaused(address)\":{\"details\":\"Emitted when the pause is lifted by `account`.\"},\"WithdrawalLocked(bytes32,(uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Emitted when the withdrawal is locked\"},\"WithdrawalUnlocked(bytes32,(uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Emitted when the withdrawal is unlocked\"},\"Withdrew(bytes32,(uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Emitted when the assets are withdrawn\"},\"WrappedNativeTokenContractUpdated(address)\":{\"details\":\"Emitted when the wrapped native token contract is updated\"}},\"kind\":\"dev\",\"methods\":{\"DOMAIN_SEPARATOR()\":{\"details\":\"Returns the domain seperator.\"},\"checkHighTierVoteWeightThreshold(uint256)\":{\"details\":\"Checks whether the `_voteWeight` passes the high-tier vote weight threshold.\"},\"checkThreshold(uint256)\":{\"details\":\"Checks whether the `_voteWeight` passes the threshold.\"},\"getContract(uint8)\":{\"details\":\"Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.\",\"params\":{\"contractType\":\"The role of the contract to retrieve.\"},\"returns\":{\"contract_\":\"The address of the contract with the specified role.\"}},\"getHighTierVoteWeightThreshold()\":{\"details\":\"Returns the high-tier vote weight threshold.\"},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"getRoleMember(bytes32,uint256)\":{\"details\":\"Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.\"},\"getRoleMemberCount(bytes32)\":{\"details\":\"Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.\"},\"getRoninToken(address)\":{\"details\":\"Returns token address on Ronin network. Note: Reverts for unsupported token.\"},\"getThreshold()\":{\"details\":\"Returns the threshold.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"initialize(address,address,uint256,uint256,uint256,uint256,address[][3],uint256[][4],uint8[])\":{\"details\":\"Initializes contract storage.\"},\"mapTokens(address[],address[],uint8[])\":{\"details\":\"Maps mainchain tokens to Ronin network. Requirement: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `TokenMapped` event.\"},\"mapTokensAndThresholds(address[],address[],uint8[],uint256[][4])\":{\"details\":\"Maps mainchain tokens to Ronin network and sets thresholds. Requirement: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `TokenMapped` event.\"},\"minimumVoteWeight()\":{\"details\":\"Returns the minimum vote weight to pass the threshold.\"},\"onBridgeOperatorsAdded(address[],uint96[],bool[])\":{\"details\":\"Handles the event when bridge operators are added.\",\"params\":{\"addeds\":\"The corresponding boolean values indicating whether the operators were added or not.\",\"bridgeOperators\":\"The addresses of the bridge operators.\"},\"returns\":{\"_0\":\"The selector of the function being called.\"}},\"onBridgeOperatorsRemoved(address[],bool[])\":{\"details\":\"Handles the event when bridge operators are removed.\",\"params\":{\"bridgeOperators\":\"The addresses of the bridge operators.\",\"removeds\":\"The corresponding boolean values indicating whether the operators were removed or not.\"},\"returns\":{\"_0\":\"The selector of the function being called.\"}},\"pause()\":{\"details\":\"Triggers paused state.\"},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"reachedWithdrawalLimit(address,uint256)\":{\"details\":\"Checks whether the withdrawal reaches the limitation.\"},\"receiveEther()\":{\"details\":\"Receives ether without doing anything. Use this function to topup native token.\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`. May emit a {RoleRevoked} event.\"},\"requestDepositFor((address,address,(uint8,uint256,uint256)))\":{\"details\":\"Locks the assets and request deposit.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"setContract(uint8,address)\":{\"details\":\"Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.\",\"params\":{\"addr\":\"The address of the contract to set.\",\"contractType\":\"The role of the contract to set.\"}},\"setDailyWithdrawalLimits(address[],uint256[])\":{\"details\":\"Sets daily limit amounts for the withdrawals. Requirements: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `DailyWithdrawalLimitsUpdated` event.\"},\"setEmergencyPauser(address)\":{\"details\":\"Grant emergency pauser role for `_addr`.\"},\"setHighTierThresholds(address[],uint256[])\":{\"details\":\"Sets the thresholds for high-tier withdrawals that requires high-tier vote weights. Requirements: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `HighTierThresholdsUpdated` event.\"},\"setHighTierVoteWeightThreshold(uint256,uint256)\":{\"details\":\"Sets high-tier vote weight threshold and returns the old one. Requirements: - The method caller is admin. - The high-tier vote weight threshold must equal to or larger than the normal threshold. Emits the `HighTierVoteWeightThresholdUpdated` event.\"},\"setLockedThresholds(address[],uint256[])\":{\"details\":\"Sets the amount thresholds to lock withdrawal. Requirements: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `LockedThresholdsUpdated` event.\"},\"setThreshold(uint256,uint256)\":{\"details\":\"Override `GatewayV3-setThreshold`. Requirements: - The high-tier vote weight threshold must equal to or larger than the normal threshold.\"},\"setUnlockFeePercentages(address[],uint256[])\":{\"details\":\"Sets fee percentages to unlock withdrawal. Requirements: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `UnlockFeePercentagesUpdated` event.\"},\"setWrappedNativeTokenContract(address)\":{\"details\":\"Sets the wrapped native token contract. Requirements: - The method caller is admin. Emits the `WrappedNativeTokenContractUpdated` event.\"},\"submitWithdrawal((uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)),(uint8,bytes32,bytes32)[])\":{\"details\":\"Withdraws based on the receipt and the validator signatures. Returns whether the withdrawal is locked. Emits the `Withdrew` once the assets are released.\"},\"unlockWithdrawal((uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Approves a specific withdrawal. Requirements: - The method caller is a validator. Emits the `Withdrew` once the assets are released.\"},\"unpause()\":{\"details\":\"Triggers unpaused state.\"}},\"stateVariables\":{\"WITHDRAWAL_UNLOCKER_ROLE\":{\"details\":\"Withdrawal unlocker role hash\"},\"______deprecatedBridgeOperatorAddedBlock\":{\"custom:deprecated\":\"Previously `_bridgeOperatorAddedBlock` (mapping(address => uint256))\"},\"______deprecatedBridgeOperators\":{\"custom:deprecated\":\"Previously `_bridgeOperators` (uint256[])\"},\"_domainSeparator\":{\"details\":\"Domain separator\"},\"_roninToken\":{\"details\":\"Mapping from mainchain token => token address on Ronin network\"},\"depositCount\":{\"details\":\"Total deposit\"},\"roninChainId\":{\"details\":\"Ronin network id\"},\"withdrawalHash\":{\"details\":\"Mapping from withdrawal id => withdrawal hash\"},\"withdrawalLocked\":{\"details\":\"Mapping from withdrawal id => locked\"},\"wrappedNativeToken\":{\"details\":\"Wrapped native token address\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"unlockFeePercentages(address)\":{\"notice\":\"Values 0-1,000,000 map to 0%-100%\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/mainchain/MainchainGatewayV3.sol\":\"MainchainGatewayV3\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@fdk/=lib/foundry-deployment-kit/script/\",\":@openzeppelin/=lib/openzeppelin-contracts/\",\":@prb/math/=lib/prb-math/\",\":@prb/test/=lib/prb-test/src/\",\":@ronin/contracts/=src/\",\":@ronin/script/=script/\",\":@ronin/test/=test/\",\":contract-libs/=lib/foundry-deployment-kit/lib/contract-libs/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/foundry-deployment-kit/lib/forge-std/src/\",\":foundry-deployment-kit/=lib/foundry-deployment-kit/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/contracts/\",\":prb-math/=lib/prb-math/src/\",\":prb-test/=lib/prb-test/src/\",\":solady/=lib/solady/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/access/AccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\nimport \\\"../utils/Context.sol\\\";\\nimport \\\"../utils/Strings.sol\\\";\\nimport \\\"../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it.\\n */\\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\\n struct RoleData {\\n mapping(address => bool) members;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with a standardized message including the required role.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n *\\n * _Available since v4.1._\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role);\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\\n return _roles[role].members[account];\\n }\\n\\n /**\\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\\n * Overriding this function changes the behavior of the {onlyRole} modifier.\\n *\\n * Format of the revert message is described in {_checkRole}.\\n *\\n * _Available since v4.6._\\n */\\n function _checkRole(bytes32 role) internal view virtual {\\n _checkRole(role, _msgSender());\\n }\\n\\n /**\\n * @dev Revert with a standard message if `account` is missing `role`.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert(\\n string(\\n abi.encodePacked(\\n \\\"AccessControl: account \\\",\\n Strings.toHexString(uint160(account), 20),\\n \\\" is missing role \\\",\\n Strings.toHexString(uint256(role), 32)\\n )\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function renounceRole(bytes32 role, address account) public virtual override {\\n require(account == _msgSender(), \\\"AccessControl: can only renounce roles for self\\\");\\n\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event. Note that unlike {grantRole}, this function doesn't perform any\\n * checks on the calling account.\\n *\\n * May emit a {RoleGranted} event.\\n *\\n * [WARNING]\\n * ====\\n * This function should only be called from the constructor when setting\\n * up the initial roles for the system.\\n *\\n * Using this function in any other way is effectively circumventing the admin\\n * system imposed by {AccessControl}.\\n * ====\\n *\\n * NOTE: This function is deprecated in favor of {_grantRole}.\\n */\\n function _setupRole(bytes32 role, address account) internal virtual {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual {\\n if (!hasRole(role, account)) {\\n _roles[role].members[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n }\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual {\\n if (hasRole(role, account)) {\\n _roles[role].members[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5b35d8e68aeaccc685239bd9dd79b9ba01a0357930f8a3307ab85511733d9724\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/access/AccessControlEnumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlEnumerable.sol\\\";\\nimport \\\"./AccessControl.sol\\\";\\nimport \\\"../utils/structs/EnumerableSet.sol\\\";\\n\\n/**\\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\\n */\\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {\\n return _roleMembers[role].at(index);\\n }\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {\\n return _roleMembers[role].length();\\n }\\n\\n /**\\n * @dev Overload {_grantRole} to track enumerable memberships\\n */\\n function _grantRole(bytes32 role, address account) internal virtual override {\\n super._grantRole(role, account);\\n _roleMembers[role].add(account);\\n }\\n\\n /**\\n * @dev Overload {_revokeRole} to track enumerable memberships\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual override {\\n super._revokeRole(role, account);\\n _roleMembers[role].remove(account);\\n }\\n}\\n\",\"keccak256\":\"0x13f5e15f2a0650c0b6aaee2ef19e89eaf4870d6e79662d572a393334c1397247\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/access/IAccessControlEnumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\n\\n/**\\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\\n */\\ninterface IAccessControlEnumerable is IAccessControl {\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xba4459ab871dfa300f5212c6c30178b63898c03533a1ede28436f11546626676\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0xa6a787e7a901af6511e19aa53e1a00352db215a011d2c7a438d0582dd5da76f9\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2a21b14ff90012878752f230d3ffd5c3405e5938d06c97a7d89c0a64561d0d66\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/security/Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract Pausable is Context {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n constructor() {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n _requireNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n _requirePaused();\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Throws if the contract is paused.\\n */\\n function _requireNotPaused() internal view virtual {\\n require(!paused(), \\\"Pausable: paused\\\");\\n }\\n\\n /**\\n * @dev Throws if the contract is not paused.\\n */\\n function _requirePaused() internal view virtual {\\n require(paused(), \\\"Pausable: not paused\\\");\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n}\\n\",\"keccak256\":\"0x0849d93b16c9940beb286a7864ed02724b248b93e0d80ef6355af5ef15c64773\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/security/ReentrancyGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuard {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n constructor() {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n // On the first call to nonReentrant, _notEntered will be true\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n}\\n\",\"keccak256\":\"0x0e9621f60b2faabe65549f7ed0f24e8853a45c1b7990d47e8160e523683f3935\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/ERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/ERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC1155.sol\\\";\\nimport \\\"./IERC1155Receiver.sol\\\";\\nimport \\\"./extensions/IERC1155MetadataURI.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\nimport \\\"../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the basic standard multi-token.\\n * See https://eips.ethereum.org/EIPS/eip-1155\\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\\n *\\n * _Available since v3.1._\\n */\\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\\n using Address for address;\\n\\n // Mapping from token ID to account balances\\n mapping(uint256 => mapping(address => uint256)) private _balances;\\n\\n // Mapping from account to operator approvals\\n mapping(address => mapping(address => bool)) private _operatorApprovals;\\n\\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\\n string private _uri;\\n\\n /**\\n * @dev See {_setURI}.\\n */\\n constructor(string memory uri_) {\\n _setURI(uri_);\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return\\n interfaceId == type(IERC1155).interfaceId ||\\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC1155MetadataURI-uri}.\\n *\\n * This implementation returns the same URI for *all* token types. It relies\\n * on the token type ID substitution mechanism\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\\n *\\n * Clients calling this function must replace the `\\\\{id\\\\}` substring with the\\n * actual token type ID.\\n */\\n function uri(uint256) public view virtual override returns (string memory) {\\n return _uri;\\n }\\n\\n /**\\n * @dev See {IERC1155-balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\\n require(account != address(0), \\\"ERC1155: address zero is not a valid owner\\\");\\n return _balances[id][account];\\n }\\n\\n /**\\n * @dev See {IERC1155-balanceOfBatch}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\\n public\\n view\\n virtual\\n override\\n returns (uint256[] memory)\\n {\\n require(accounts.length == ids.length, \\\"ERC1155: accounts and ids length mismatch\\\");\\n\\n uint256[] memory batchBalances = new uint256[](accounts.length);\\n\\n for (uint256 i = 0; i < accounts.length; ++i) {\\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\\n }\\n\\n return batchBalances;\\n }\\n\\n /**\\n * @dev See {IERC1155-setApprovalForAll}.\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual override {\\n _setApprovalForAll(_msgSender(), operator, approved);\\n }\\n\\n /**\\n * @dev See {IERC1155-isApprovedForAll}.\\n */\\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\\n return _operatorApprovals[account][operator];\\n }\\n\\n /**\\n * @dev See {IERC1155-safeTransferFrom}.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) public virtual override {\\n require(\\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\\n \\\"ERC1155: caller is not token owner nor approved\\\"\\n );\\n _safeTransferFrom(from, to, id, amount, data);\\n }\\n\\n /**\\n * @dev See {IERC1155-safeBatchTransferFrom}.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) public virtual override {\\n require(\\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\\n \\\"ERC1155: caller is not token owner nor approved\\\"\\n );\\n _safeBatchTransferFrom(from, to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function _safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: transfer to the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: insufficient balance for transfer\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n _balances[id][to] += amount;\\n\\n emit TransferSingle(operator, from, to, id, amount);\\n\\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function _safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n require(to != address(0), \\\"ERC1155: transfer to the zero address\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n for (uint256 i = 0; i < ids.length; ++i) {\\n uint256 id = ids[i];\\n uint256 amount = amounts[i];\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: insufficient balance for transfer\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n _balances[id][to] += amount;\\n }\\n\\n emit TransferBatch(operator, from, to, ids, amounts);\\n\\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Sets a new URI for all token types, by relying on the token type ID\\n * substitution mechanism\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\\n *\\n * By this mechanism, any occurrence of the `\\\\{id\\\\}` substring in either the\\n * URI or any of the amounts in the JSON file at said URI will be replaced by\\n * clients with the token type ID.\\n *\\n * For example, the `https://token-cdn-domain/\\\\{id\\\\}.json` URI would be\\n * interpreted by clients as\\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\\n * for token type ID 0x4cce0.\\n *\\n * See {uri}.\\n *\\n * Because these URIs cannot be meaningfully represented by the {URI} event,\\n * this function emits no events.\\n */\\n function _setURI(string memory newuri) internal virtual {\\n _uri = newuri;\\n }\\n\\n /**\\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function _mint(\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: mint to the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _balances[id][to] += amount;\\n emit TransferSingle(operator, address(0), to, id, amount);\\n\\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function _mintBatch(\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: mint to the zero address\\\");\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n for (uint256 i = 0; i < ids.length; i++) {\\n _balances[ids[i]][to] += amounts[i];\\n }\\n\\n emit TransferBatch(operator, address(0), to, ids, amounts);\\n\\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens of token type `id` from `from`\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `from` must have at least `amount` tokens of token type `id`.\\n */\\n function _burn(\\n address from,\\n uint256 id,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC1155: burn from the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n\\n emit TransferSingle(operator, from, address(0), id, amount);\\n\\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n */\\n function _burnBatch(\\n address from,\\n uint256[] memory ids,\\n uint256[] memory amounts\\n ) internal virtual {\\n require(from != address(0), \\\"ERC1155: burn from the zero address\\\");\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n\\n for (uint256 i = 0; i < ids.length; i++) {\\n uint256 id = ids[i];\\n uint256 amount = amounts[i];\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n }\\n\\n emit TransferBatch(operator, from, address(0), ids, amounts);\\n\\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n }\\n\\n /**\\n * @dev Approve `operator` to operate on all of `owner` tokens\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function _setApprovalForAll(\\n address owner,\\n address operator,\\n bool approved\\n ) internal virtual {\\n require(owner != operator, \\\"ERC1155: setting approval status for self\\\");\\n _operatorApprovals[owner][operator] = approved;\\n emit ApprovalForAll(owner, operator, approved);\\n }\\n\\n /**\\n * @dev Hook that is called before any token transfer. This includes minting\\n * and burning, as well as batched variants.\\n *\\n * The same hook is called on both single and batched variants. For single\\n * transfers, the length of the `ids` and `amounts` arrays will be 1.\\n *\\n * Calling conditions (for each `id` and `amount` pair):\\n *\\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * of token type `id` will be transferred to `to`.\\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\\n * for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\\n * will be burned.\\n * - `from` and `to` are never both zero.\\n * - `ids` and `amounts` have the same, non-zero length.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any token transfer. This includes minting\\n * and burning, as well as batched variants.\\n *\\n * The same hook is called on both single and batched variants. For single\\n * transfers, the length of the `id` and `amount` arrays will be 1.\\n *\\n * Calling conditions (for each `id` and `amount` pair):\\n *\\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * of token type `id` will be transferred to `to`.\\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\\n * for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\\n * will be burned.\\n * - `from` and `to` are never both zero.\\n * - `ids` and `amounts` have the same, non-zero length.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {}\\n\\n function _doSafeTransferAcceptanceCheck(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) private {\\n if (to.isContract()) {\\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\\n if (response != IERC1155Receiver.onERC1155Received.selector) {\\n revert(\\\"ERC1155: ERC1155Receiver rejected tokens\\\");\\n }\\n } catch Error(string memory reason) {\\n revert(reason);\\n } catch {\\n revert(\\\"ERC1155: transfer to non ERC1155Receiver implementer\\\");\\n }\\n }\\n }\\n\\n function _doSafeBatchTransferAcceptanceCheck(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) private {\\n if (to.isContract()) {\\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\\n bytes4 response\\n ) {\\n if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\\n revert(\\\"ERC1155: ERC1155Receiver rejected tokens\\\");\\n }\\n } catch Error(string memory reason) {\\n revert(reason);\\n } catch {\\n revert(\\\"ERC1155: transfer to non ERC1155Receiver implementer\\\");\\n }\\n }\\n }\\n\\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\\n uint256[] memory array = new uint256[](1);\\n array[0] = element;\\n\\n return array;\\n }\\n}\\n\",\"keccak256\":\"0x447a21c87433c0f11252912313a96f3454629ef88cca7a4eefbb283b3ec409f9\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155 is IERC165 {\\n /**\\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\\n */\\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\\n\\n /**\\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\\n * transfers.\\n */\\n event TransferBatch(\\n address indexed operator,\\n address indexed from,\\n address indexed to,\\n uint256[] ids,\\n uint256[] values\\n );\\n\\n /**\\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\\n * `approved`.\\n */\\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\\n\\n /**\\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\\n *\\n * If an {URI} event was emitted for `id`, the standard\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\\n * returned by {IERC1155MetadataURI-uri}.\\n */\\n event URI(string value, uint256 indexed id);\\n\\n /**\\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\\n external\\n view\\n returns (uint256[] memory);\\n\\n /**\\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\\n *\\n * Emits an {ApprovalForAll} event.\\n *\\n * Requirements:\\n *\\n * - `operator` cannot be the caller.\\n */\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n /**\\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\\n *\\n * See {setApprovalForAll}.\\n */\\n function isApprovedForAll(address account, address operator) external view returns (bool);\\n\\n /**\\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] calldata ids,\\n uint256[] calldata amounts,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x6392f2cfe3a5ee802227fe7a2dfd47096d881aec89bddd214b35c5b46d3cd941\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev _Available since v3.1._\\n */\\ninterface IERC1155Receiver is IERC165 {\\n /**\\n * @dev Handles the receipt of a single ERC1155 token type. This function is\\n * called at the end of a `safeTransferFrom` after the balance has been updated.\\n *\\n * NOTE: To accept the transfer, this must return\\n * `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))`\\n * (i.e. 0xf23a6e61, or its own function selector).\\n *\\n * @param operator The address which initiated the transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param id The ID of the token being transferred\\n * @param value The amount of tokens being transferred\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155Received(\\n address operator,\\n address from,\\n uint256 id,\\n uint256 value,\\n bytes calldata data\\n ) external returns (bytes4);\\n\\n /**\\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\\n * is called at the end of a `safeBatchTransferFrom` after the balances have\\n * been updated.\\n *\\n * NOTE: To accept the transfer(s), this must return\\n * `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))`\\n * (i.e. 0xbc197c81, or its own function selector).\\n *\\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155BatchReceived(\\n address operator,\\n address from,\\n uint256[] calldata ids,\\n uint256[] calldata values,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xeb373f1fdc7b755c6a750123a9b9e3a8a02c1470042fd6505d875000a80bde0b\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/ERC1155Burnable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/extensions/ERC1155Burnable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1155.sol\\\";\\n\\n/**\\n * @dev Extension of {ERC1155} that allows token holders to destroy both their\\n * own tokens and those that they have been approved to use.\\n *\\n * _Available since v3.1._\\n */\\nabstract contract ERC1155Burnable is ERC1155 {\\n function burn(\\n address account,\\n uint256 id,\\n uint256 value\\n ) public virtual {\\n require(\\n account == _msgSender() || isApprovedForAll(account, _msgSender()),\\n \\\"ERC1155: caller is not token owner nor approved\\\"\\n );\\n\\n _burn(account, id, value);\\n }\\n\\n function burnBatch(\\n address account,\\n uint256[] memory ids,\\n uint256[] memory values\\n ) public virtual {\\n require(\\n account == _msgSender() || isApprovedForAll(account, _msgSender()),\\n \\\"ERC1155: caller is not token owner nor approved\\\"\\n );\\n\\n _burnBatch(account, ids, values);\\n }\\n}\\n\",\"keccak256\":\"0xb11d1ade7146ac3da122e1f387ea82b0bd385d50823946c3f967dbffef3e9f4f\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/ERC1155Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1155.sol\\\";\\nimport \\\"../../../security/Pausable.sol\\\";\\n\\n/**\\n * @dev ERC1155 token with pausable token transfers, minting and burning.\\n *\\n * Useful for scenarios such as preventing trades until the end of an evaluation\\n * period, or having an emergency switch for freezing all token transfers in the\\n * event of a large bug.\\n *\\n * _Available since v3.1._\\n */\\nabstract contract ERC1155Pausable is ERC1155, Pausable {\\n /**\\n * @dev See {ERC1155-_beforeTokenTransfer}.\\n *\\n * Requirements:\\n *\\n * - the contract must not be paused.\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual override {\\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n require(!paused(), \\\"ERC1155Pausable: token transfer while paused\\\");\\n }\\n}\\n\",\"keccak256\":\"0xdad22b949de979bb2ad9001c044b2aeaacf8a25e3de09ed6f022a9469f936d5b\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC1155.sol\\\";\\n\\n/**\\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155MetadataURI is IERC1155 {\\n /**\\n * @dev Returns the URI for token type `id`.\\n *\\n * If the `\\\\{id\\\\}` substring is present in the URI, it must be replaced by\\n * clients with the actual token type ID.\\n */\\n function uri(uint256 id) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xa66d18b9a85458d28fc3304717964502ae36f7f8a2ff35bc83f6f85d74b03574\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/presets/ERC1155PresetMinterPauser.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/presets/ERC1155PresetMinterPauser.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1155.sol\\\";\\nimport \\\"../extensions/ERC1155Burnable.sol\\\";\\nimport \\\"../extensions/ERC1155Pausable.sol\\\";\\nimport \\\"../../../access/AccessControlEnumerable.sol\\\";\\nimport \\\"../../../utils/Context.sol\\\";\\n\\n/**\\n * @dev {ERC1155} token, including:\\n *\\n * - ability for holders to burn (destroy) their tokens\\n * - a minter role that allows for token minting (creation)\\n * - a pauser role that allows to stop all token transfers\\n *\\n * This contract uses {AccessControl} to lock permissioned functions using the\\n * different roles - head to its documentation for details.\\n *\\n * The account that deploys the contract will be granted the minter and pauser\\n * roles, as well as the default admin role, which will let it grant both minter\\n * and pauser roles to other accounts.\\n *\\n * _Deprecated in favor of https://wizard.openzeppelin.com/[Contracts Wizard]._\\n */\\ncontract ERC1155PresetMinterPauser is Context, AccessControlEnumerable, ERC1155Burnable, ERC1155Pausable {\\n bytes32 public constant MINTER_ROLE = keccak256(\\\"MINTER_ROLE\\\");\\n bytes32 public constant PAUSER_ROLE = keccak256(\\\"PAUSER_ROLE\\\");\\n\\n /**\\n * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE`, and `PAUSER_ROLE` to the account that\\n * deploys the contract.\\n */\\n constructor(string memory uri) ERC1155(uri) {\\n _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());\\n\\n _setupRole(MINTER_ROLE, _msgSender());\\n _setupRole(PAUSER_ROLE, _msgSender());\\n }\\n\\n /**\\n * @dev Creates `amount` new tokens for `to`, of token type `id`.\\n *\\n * See {ERC1155-_mint}.\\n *\\n * Requirements:\\n *\\n * - the caller must have the `MINTER_ROLE`.\\n */\\n function mint(\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) public virtual {\\n require(hasRole(MINTER_ROLE, _msgSender()), \\\"ERC1155PresetMinterPauser: must have minter role to mint\\\");\\n\\n _mint(to, id, amount, data);\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] variant of {mint}.\\n */\\n function mintBatch(\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) public virtual {\\n require(hasRole(MINTER_ROLE, _msgSender()), \\\"ERC1155PresetMinterPauser: must have minter role to mint\\\");\\n\\n _mintBatch(to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Pauses all token transfers.\\n *\\n * See {ERC1155Pausable} and {Pausable-_pause}.\\n *\\n * Requirements:\\n *\\n * - the caller must have the `PAUSER_ROLE`.\\n */\\n function pause() public virtual {\\n require(hasRole(PAUSER_ROLE, _msgSender()), \\\"ERC1155PresetMinterPauser: must have pauser role to pause\\\");\\n _pause();\\n }\\n\\n /**\\n * @dev Unpauses all token transfers.\\n *\\n * See {ERC1155Pausable} and {Pausable-_unpause}.\\n *\\n * Requirements:\\n *\\n * - the caller must have the `PAUSER_ROLE`.\\n */\\n function unpause() public virtual {\\n require(hasRole(PAUSER_ROLE, _msgSender()), \\\"ERC1155PresetMinterPauser: must have pauser role to unpause\\\");\\n _unpause();\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId)\\n public\\n view\\n virtual\\n override(AccessControlEnumerable, ERC1155)\\n returns (bool)\\n {\\n return super.supportsInterface(interfaceId);\\n }\\n\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual override(ERC1155, ERC1155Pausable) {\\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n }\\n}\\n\",\"keccak256\":\"0x775e248004d21e0666740534a732daa9f17ceeee660ded876829e98a3a62b657\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/utils/ERC1155Holder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ERC1155Receiver.sol\\\";\\n\\n/**\\n * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens.\\n *\\n * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be\\n * stuck.\\n *\\n * @dev _Available since v3.1._\\n */\\ncontract ERC1155Holder is ERC1155Receiver {\\n function onERC1155Received(\\n address,\\n address,\\n uint256,\\n uint256,\\n bytes memory\\n ) public virtual override returns (bytes4) {\\n return this.onERC1155Received.selector;\\n }\\n\\n function onERC1155BatchReceived(\\n address,\\n address,\\n uint256[] memory,\\n uint256[] memory,\\n bytes memory\\n ) public virtual override returns (bytes4) {\\n return this.onERC1155BatchReceived.selector;\\n }\\n}\\n\",\"keccak256\":\"0x2e024ca51ce5abe16c0d34e6992a1104f356e2244eb4ccbec970435e8b3405e3\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/utils/ERC1155Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC1155Receiver.sol\\\";\\nimport \\\"../../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev _Available since v3.1._\\n */\\nabstract contract ERC1155Receiver is ERC165, IERC1155Receiver {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);\\n }\\n}\\n\",\"keccak256\":\"0x3dd5e1a66a56f30302108a1da97d677a42b1daa60e503696b2bcbbf3e4c95bcb\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC721 compliant contract.\\n */\\ninterface IERC721 is IERC165 {\\n /**\\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\\n */\\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\\n */\\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\\n\\n /**\\n * @dev Returns the number of tokens in ``owner``'s account.\\n */\\n function balanceOf(address owner) external view returns (uint256 balance);\\n\\n /**\\n * @dev Returns the owner of the `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function ownerOf(uint256 tokenId) external view returns (address owner);\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) external;\\n\\n /**\\n * @dev Transfers `tokenId` token from `from` to `to`.\\n *\\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) external;\\n\\n /**\\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\\n * The approval is cleared when the token is transferred.\\n *\\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\\n *\\n * Requirements:\\n *\\n * - The caller must own the token or be an approved operator.\\n * - `tokenId` must exist.\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Approve or remove `operator` as an operator for the caller.\\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\\n *\\n * Requirements:\\n *\\n * - The `operator` cannot be the caller.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function setApprovalForAll(address operator, bool _approved) external;\\n\\n /**\\n * @dev Returns the account approved for `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function getApproved(uint256 tokenId) external view returns (address operator);\\n\\n /**\\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\\n *\\n * See {setApprovalForAll}\\n */\\n function isApprovedForAll(address owner, address operator) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xed6a749c5373af398105ce6ee3ac4763aa450ea7285d268c85d9eeca809cdb1f\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _HEX_SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n // Inspired by OraclizeAPI's implementation - MIT licence\\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\\n\\n if (value == 0) {\\n return \\\"0\\\";\\n }\\n uint256 temp = value;\\n uint256 digits;\\n while (temp != 0) {\\n digits++;\\n temp /= 10;\\n }\\n bytes memory buffer = new bytes(digits);\\n while (value != 0) {\\n digits -= 1;\\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\\n value /= 10;\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n if (value == 0) {\\n return \\\"0x00\\\";\\n }\\n uint256 temp = value;\\n uint256 length = 0;\\n while (temp != 0) {\\n length++;\\n temp >>= 8;\\n }\\n return toHexString(value, length);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xaf159a8b1923ad2a26d516089bceca9bdeaeacd04be50983ea00ba63070f08a3\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.3) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSA {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n } else if (error == RecoverError.InvalidSignatureV) {\\n revert(\\\"ECDSA: invalid signature 'v' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n if (v != 27 && v != 28) {\\n return (address(0), RecoverError.InvalidSignatureV);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", Strings.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0xdb7f5c28fc61cda0bd8ab60ce288e206b791643bcd3ba464a70cbec18895a2f5\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n *\\n * [WARNING]\\n * ====\\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.\\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\\n *\\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.\\n * ====\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n bytes32 lastValue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastValue;\\n // Update the index for the moved value\\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n return set._values[index];\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function _values(Set storage set) private view returns (bytes32[] memory) {\\n return set._values;\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\\n return _values(set._inner);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(AddressSet storage set) internal view returns (address[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n address[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(UintSet storage set) internal view returns (uint256[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n uint256[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0x5050943b32b6a8f282573d166b2e9d87ab7eb4dbba4ab6acf36ecb54fe6995e4\",\"license\":\"MIT\"},\"src/extensions/GatewayV3.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/security/Pausable.sol\\\";\\nimport \\\"../interfaces/IQuorum.sol\\\";\\nimport \\\"./collections/HasProxyAdmin.sol\\\";\\n\\nabstract contract GatewayV3 is HasProxyAdmin, Pausable, IQuorum {\\n uint256 internal _num;\\n uint256 internal _denom;\\n\\n address private ______deprecated;\\n uint256 public nonce;\\n\\n address public emergencyPauser;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n */\\n uint256[49] private ______gap;\\n\\n /**\\n * @dev Grant emergency pauser role for `_addr`.\\n */\\n function setEmergencyPauser(address _addr) external onlyProxyAdmin {\\n emergencyPauser = _addr;\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function getThreshold() external view virtual returns (uint256 num_, uint256 denom_) {\\n return (_num, _denom);\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function checkThreshold(uint256 _voteWeight) external view virtual returns (bool) {\\n return _voteWeight * _denom >= _num * _getTotalWeight();\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function setThreshold(uint256 _numerator, uint256 _denominator) external virtual onlyProxyAdmin {\\n return _setThreshold(_numerator, _denominator);\\n }\\n\\n /**\\n * @dev Triggers paused state.\\n */\\n function pause() external {\\n _requireAuth();\\n _pause();\\n }\\n\\n /**\\n * @dev Triggers unpaused state.\\n */\\n function unpause() external {\\n _requireAuth();\\n _unpause();\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function minimumVoteWeight() public view virtual returns (uint256) {\\n return _minimumVoteWeight(_getTotalWeight());\\n }\\n\\n /**\\n * @dev Sets threshold and returns the old one.\\n *\\n * Emits the `ThresholdUpdated` event.\\n *\\n */\\n function _setThreshold(uint256 num, uint256 denom) internal virtual {\\n if (num > denom) revert ErrInvalidThreshold(msg.sig);\\n uint256 prevNum = _num;\\n uint256 prevDenom = _denom;\\n _num = num;\\n _denom = denom;\\n unchecked {\\n emit ThresholdUpdated(nonce++, num, denom, prevNum, prevDenom);\\n }\\n }\\n\\n /**\\n * @dev Returns minimum vote weight.\\n */\\n function _minimumVoteWeight(uint256 _totalWeight) internal view virtual returns (uint256) {\\n return (_num * _totalWeight + _denom - 1) / _denom;\\n }\\n\\n /**\\n * @dev Internal method to check method caller.\\n *\\n * Requirements:\\n *\\n * - The method caller must be admin or pauser.\\n *\\n */\\n function _requireAuth() private view {\\n if (!(msg.sender == _getProxyAdmin() || msg.sender == emergencyPauser)) {\\n revert ErrUnauthorized(msg.sig, RoleAccess.ADMIN);\\n }\\n }\\n\\n /**\\n * @dev Returns the total weight.\\n */\\n function _getTotalWeight() internal view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0x010a0021a377e4b23a4f56269b9c6e3e3fc2684897928ff9b9da1b47c3f07baf\",\"license\":\"MIT\"},\"src/extensions/TransparentUpgradeableProxyV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\\\";\\n\\ncontract TransparentUpgradeableProxyV2 is TransparentUpgradeableProxy {\\n constructor(address _logic, address admin_, bytes memory _data) payable TransparentUpgradeableProxy(_logic, admin_, _data) { }\\n\\n /**\\n * @dev Calls a function from the current implementation as specified by `_data`, which should be an encoded function call.\\n *\\n * Requirements:\\n * - Only the admin can call this function.\\n *\\n * Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid\\n * triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider\\n * reviewing the encoded data `_data` and the method which is called before using this.\\n *\\n */\\n function functionDelegateCall(bytes memory _data) public payable ifAdmin {\\n address _addr = _implementation();\\n assembly {\\n let _result := delegatecall(gas(), _addr, add(_data, 32), mload(_data), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n switch _result\\n case 0 { revert(0, returndatasize()) }\\n default { return(0, returndatasize()) }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x45fc7b71d09da99414b977a56e586b3604670d865e5f36f395d5c98bc4ba64af\",\"license\":\"MIT\"},\"src/extensions/WethUnwrapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/security/ReentrancyGuard.sol\\\";\\nimport \\\"../interfaces/IWETH.sol\\\";\\n\\ncontract WethUnwrapper is ReentrancyGuard {\\n IWETH public immutable weth;\\n\\n error ErrCannotTransferFrom();\\n error ErrNotWrappedContract();\\n error ErrExternalCallFailed(address sender, bytes4 sig);\\n\\n constructor(address weth_) {\\n if (address(weth_).code.length == 0) revert ErrNotWrappedContract();\\n weth = IWETH(weth_);\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n receive() external payable {\\n _fallback();\\n }\\n\\n function unwrap(uint256 amount) external nonReentrant {\\n _deductWrappedAndWithdraw(amount);\\n _sendNativeTo(payable(msg.sender), amount);\\n }\\n\\n function unwrapTo(uint256 amount, address payable to) external nonReentrant {\\n _deductWrappedAndWithdraw(amount);\\n _sendNativeTo(payable(to), amount);\\n }\\n\\n function _deductWrappedAndWithdraw(uint256 amount) internal {\\n (bool success,) = address(weth).call(abi.encodeCall(IWETH.transferFrom, (msg.sender, address(this), amount)));\\n if (!success) revert ErrCannotTransferFrom();\\n\\n weth.withdraw(amount);\\n }\\n\\n function _sendNativeTo(address payable to, uint256 val) internal {\\n (bool success,) = to.call{ value: val }(\\\"\\\");\\n if (!success) {\\n revert ErrExternalCallFailed(to, msg.sig);\\n }\\n }\\n\\n function _fallback() internal view {\\n if (msg.sender != address(weth)) revert ErrNotWrappedContract();\\n }\\n}\\n\",\"keccak256\":\"0x5f7b72d9ed8944724d2f228358d565a61ea345cba1883e5424fb801bebc758ff\",\"license\":\"MIT\"},\"src/extensions/WithdrawalLimitation.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./GatewayV3.sol\\\";\\n\\nabstract contract WithdrawalLimitation is GatewayV3 {\\n /// @dev Error of invalid percentage.\\n error ErrInvalidPercentage();\\n\\n /// @dev Emitted when the high-tier vote weight threshold is updated\\n event HighTierVoteWeightThresholdUpdated(\\n uint256 indexed nonce, uint256 indexed numerator, uint256 indexed denominator, uint256 previousNumerator, uint256 previousDenominator\\n );\\n /// @dev Emitted when the thresholds for high-tier withdrawals that requires high-tier vote weights are updated\\n event HighTierThresholdsUpdated(address[] tokens, uint256[] thresholds);\\n /// @dev Emitted when the thresholds for locked withdrawals are updated\\n event LockedThresholdsUpdated(address[] tokens, uint256[] thresholds);\\n /// @dev Emitted when the fee percentages to unlock withdraw are updated\\n event UnlockFeePercentagesUpdated(address[] tokens, uint256[] percentages);\\n /// @dev Emitted when the daily limit thresholds are updated\\n event DailyWithdrawalLimitsUpdated(address[] tokens, uint256[] limits);\\n\\n uint256 public constant _MAX_PERCENTAGE = 1_000_000;\\n\\n uint256 internal _highTierVWNum;\\n uint256 internal _highTierVWDenom;\\n\\n /// @dev Mapping from mainchain token => the amount thresholds for high-tier withdrawals that requires high-tier vote weights\\n mapping(address => uint256) public highTierThreshold;\\n /// @dev Mapping from mainchain token => the amount thresholds to lock withdrawal\\n mapping(address => uint256) public lockedThreshold;\\n /// @dev Mapping from mainchain token => unlock fee percentages for unlocker\\n /// @notice Values 0-1,000,000 map to 0%-100%\\n mapping(address => uint256) public unlockFeePercentages;\\n /// @dev Mapping from mainchain token => daily limit amount for withdrawal\\n mapping(address => uint256) public dailyWithdrawalLimit;\\n /// @dev Mapping from token address => today withdrawal amount\\n mapping(address => uint256) public lastSyncedWithdrawal;\\n /// @dev Mapping from token address => last date synced to record the `lastSyncedWithdrawal`\\n mapping(address => uint256) public lastDateSynced;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n */\\n uint256[50] private ______gap;\\n\\n /**\\n * @dev Override `GatewayV3-setThreshold`.\\n *\\n * Requirements:\\n * - The high-tier vote weight threshold must equal to or larger than the normal threshold.\\n *\\n */\\n function setThreshold(uint256 num, uint256 denom) external virtual override onlyProxyAdmin {\\n _setThreshold(num, denom);\\n _verifyThresholds();\\n }\\n\\n /**\\n * @dev Returns the high-tier vote weight threshold.\\n */\\n function getHighTierVoteWeightThreshold() external view virtual returns (uint256, uint256) {\\n return (_highTierVWNum, _highTierVWDenom);\\n }\\n\\n /**\\n * @dev Checks whether the `_voteWeight` passes the high-tier vote weight threshold.\\n */\\n function checkHighTierVoteWeightThreshold(uint256 _voteWeight) external view virtual returns (bool) {\\n return _voteWeight * _highTierVWDenom >= _highTierVWNum * _getTotalWeight();\\n }\\n\\n /**\\n * @dev Sets high-tier vote weight threshold and returns the old one.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n * - The high-tier vote weight threshold must equal to or larger than the normal threshold.\\n *\\n * Emits the `HighTierVoteWeightThresholdUpdated` event.\\n *\\n */\\n function setHighTierVoteWeightThreshold(\\n uint256 _numerator,\\n uint256 _denominator\\n ) external virtual onlyProxyAdmin returns (uint256 _previousNum, uint256 _previousDenom) {\\n (_previousNum, _previousDenom) = _setHighTierVoteWeightThreshold(_numerator, _denominator);\\n _verifyThresholds();\\n }\\n\\n /**\\n * @dev Sets the thresholds for high-tier withdrawals that requires high-tier vote weights.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n * - The arrays have the same length and its length larger than 0.\\n *\\n * Emits the `HighTierThresholdsUpdated` event.\\n *\\n */\\n function setHighTierThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) external virtual onlyProxyAdmin {\\n if (_tokens.length == 0) revert ErrEmptyArray();\\n _setHighTierThresholds(_tokens, _thresholds);\\n }\\n\\n /**\\n * @dev Sets the amount thresholds to lock withdrawal.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n * - The arrays have the same length and its length larger than 0.\\n *\\n * Emits the `LockedThresholdsUpdated` event.\\n *\\n */\\n function setLockedThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) external virtual onlyProxyAdmin {\\n if (_tokens.length == 0) revert ErrEmptyArray();\\n _setLockedThresholds(_tokens, _thresholds);\\n }\\n\\n /**\\n * @dev Sets fee percentages to unlock withdrawal.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n * - The arrays have the same length and its length larger than 0.\\n *\\n * Emits the `UnlockFeePercentagesUpdated` event.\\n *\\n */\\n function setUnlockFeePercentages(address[] calldata _tokens, uint256[] calldata _percentages) external virtual onlyProxyAdmin {\\n if (_tokens.length == 0) revert ErrEmptyArray();\\n _setUnlockFeePercentages(_tokens, _percentages);\\n }\\n\\n /**\\n * @dev Sets daily limit amounts for the withdrawals.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n * - The arrays have the same length and its length larger than 0.\\n *\\n * Emits the `DailyWithdrawalLimitsUpdated` event.\\n *\\n */\\n function setDailyWithdrawalLimits(address[] calldata _tokens, uint256[] calldata _limits) external virtual onlyProxyAdmin {\\n if (_tokens.length == 0) revert ErrEmptyArray();\\n _setDailyWithdrawalLimits(_tokens, _limits);\\n }\\n\\n /**\\n * @dev Checks whether the withdrawal reaches the limitation.\\n */\\n function reachedWithdrawalLimit(address _token, uint256 _quantity) external view virtual returns (bool) {\\n return _reachedWithdrawalLimit(_token, _quantity);\\n }\\n\\n /**\\n * @dev Sets high-tier vote weight threshold and returns the old one.\\n *\\n * Emits the `HighTierVoteWeightThresholdUpdated` event.\\n *\\n */\\n function _setHighTierVoteWeightThreshold(uint256 _numerator, uint256 _denominator) internal returns (uint256 _previousNum, uint256 _previousDenom) {\\n if (_numerator > _denominator) revert ErrInvalidThreshold(msg.sig);\\n\\n _previousNum = _highTierVWNum;\\n _previousDenom = _highTierVWDenom;\\n _highTierVWNum = _numerator;\\n _highTierVWDenom = _denominator;\\n\\n unchecked {\\n emit HighTierVoteWeightThresholdUpdated(nonce++, _numerator, _denominator, _previousNum, _previousDenom);\\n }\\n }\\n\\n /**\\n * @dev Sets the thresholds for high-tier withdrawals that requires high-tier vote weights.\\n *\\n * Requirements:\\n * - The array lengths are equal.\\n *\\n * Emits the `HighTierThresholdsUpdated` event.\\n *\\n */\\n function _setHighTierThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) internal virtual {\\n if (_tokens.length != _thresholds.length) revert ErrLengthMismatch(msg.sig);\\n\\n for (uint256 _i; _i < _tokens.length;) {\\n highTierThreshold[_tokens[_i]] = _thresholds[_i];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n emit HighTierThresholdsUpdated(_tokens, _thresholds);\\n }\\n\\n /**\\n * @dev Sets the amount thresholds to lock withdrawal.\\n *\\n * Requirements:\\n * - The array lengths are equal.\\n *\\n * Emits the `LockedThresholdsUpdated` event.\\n *\\n */\\n function _setLockedThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) internal virtual {\\n if (_tokens.length != _thresholds.length) revert ErrLengthMismatch(msg.sig);\\n\\n for (uint256 _i; _i < _tokens.length;) {\\n lockedThreshold[_tokens[_i]] = _thresholds[_i];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n emit LockedThresholdsUpdated(_tokens, _thresholds);\\n }\\n\\n /**\\n * @dev Sets fee percentages to unlock withdrawal.\\n *\\n * Requirements:\\n * - The array lengths are equal.\\n * - The percentage is equal to or less than 100_000.\\n *\\n * Emits the `UnlockFeePercentagesUpdated` event.\\n *\\n */\\n function _setUnlockFeePercentages(address[] calldata _tokens, uint256[] calldata _percentages) internal virtual {\\n if (_tokens.length != _percentages.length) revert ErrLengthMismatch(msg.sig);\\n\\n for (uint256 _i; _i < _tokens.length;) {\\n if (_percentages[_i] > _MAX_PERCENTAGE) revert ErrInvalidPercentage();\\n\\n unlockFeePercentages[_tokens[_i]] = _percentages[_i];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n emit UnlockFeePercentagesUpdated(_tokens, _percentages);\\n }\\n\\n /**\\n * @dev Sets daily limit amounts for the withdrawals.\\n *\\n * Requirements:\\n * - The array lengths are equal.\\n *\\n * Emits the `DailyWithdrawalLimitsUpdated` event.\\n *\\n */\\n function _setDailyWithdrawalLimits(address[] calldata _tokens, uint256[] calldata _limits) internal virtual {\\n if (_tokens.length != _limits.length) revert ErrLengthMismatch(msg.sig);\\n\\n for (uint256 _i; _i < _tokens.length;) {\\n dailyWithdrawalLimit[_tokens[_i]] = _limits[_i];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n emit DailyWithdrawalLimitsUpdated(_tokens, _limits);\\n }\\n\\n /**\\n * @dev Checks whether the withdrawal reaches the daily limitation.\\n *\\n * Requirements:\\n * - The daily withdrawal threshold should not apply for locked withdrawals.\\n *\\n */\\n function _reachedWithdrawalLimit(address _token, uint256 _quantity) internal view virtual returns (bool) {\\n if (_lockedWithdrawalRequest(_token, _quantity)) {\\n return false;\\n }\\n\\n uint256 _currentDate = block.timestamp / 1 days;\\n if (_currentDate > lastDateSynced[_token]) {\\n return dailyWithdrawalLimit[_token] <= _quantity;\\n } else {\\n return dailyWithdrawalLimit[_token] <= lastSyncedWithdrawal[_token] + _quantity;\\n }\\n }\\n\\n /**\\n * @dev Record withdrawal token.\\n */\\n function _recordWithdrawal(address _token, uint256 _quantity) internal virtual {\\n uint256 _currentDate = block.timestamp / 1 days;\\n if (_currentDate > lastDateSynced[_token]) {\\n lastDateSynced[_token] = _currentDate;\\n lastSyncedWithdrawal[_token] = _quantity;\\n } else {\\n lastSyncedWithdrawal[_token] += _quantity;\\n }\\n }\\n\\n /**\\n * @dev Returns whether the withdrawal request is locked or not.\\n */\\n function _lockedWithdrawalRequest(address _token, uint256 _quantity) internal view virtual returns (bool) {\\n return lockedThreshold[_token] <= _quantity;\\n }\\n\\n /**\\n * @dev Computes fee percentage.\\n */\\n function _computeFeePercentage(uint256 _amount, uint256 _percentage) internal view virtual returns (uint256) {\\n return (_amount * _percentage) / _MAX_PERCENTAGE;\\n }\\n\\n /**\\n * @dev Returns high-tier vote weight.\\n */\\n function _highTierVoteWeight(uint256 _totalWeight) internal view virtual returns (uint256) {\\n return (_highTierVWNum * _totalWeight + _highTierVWDenom - 1) / _highTierVWDenom;\\n }\\n\\n /**\\n * @dev Validates whether the high-tier vote weight threshold is larger than the normal threshold.\\n */\\n function _verifyThresholds() internal view {\\n if (_num * _highTierVWDenom > _highTierVWNum * _denom) revert ErrInvalidThreshold(msg.sig);\\n }\\n}\\n\",\"keccak256\":\"0x4b7d559d4b1f53239b8690776318db8d63f578f72fb269d8024570aa70c2c2a6\",\"license\":\"MIT\"},\"src/extensions/collections/HasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { HasProxyAdmin } from \\\"./HasProxyAdmin.sol\\\";\\nimport \\\"../../interfaces/collections/IHasContracts.sol\\\";\\nimport { IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\nimport { ErrUnexpectedInternalCall } from \\\"../../utils/CommonErrors.sol\\\";\\n\\n/**\\n * @title HasContracts\\n * @dev A contract that provides functionality to manage multiple contracts with different roles.\\n */\\nabstract contract HasContracts is HasProxyAdmin, IHasContracts, IdentityGuard {\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.collections.HasContracts.slot\\\") - 1\\n bytes32 private constant _STORAGE_SLOT = 0xdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb;\\n\\n /**\\n * @dev Modifier to restrict access to functions only to contracts with a specific role.\\n * @param contractType The contract type that allowed to call\\n */\\n modifier onlyContract(ContractType contractType) virtual {\\n _requireContract(contractType);\\n _;\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function setContract(ContractType contractType, address addr) external virtual onlyProxyAdmin {\\n _requireHasCode(addr);\\n _setContract(contractType, addr);\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function getContract(ContractType contractType) public view returns (address contract_) {\\n contract_ = _getContractMap()[uint8(contractType)];\\n if (contract_ == address(0)) revert ErrContractTypeNotFound(contractType);\\n }\\n\\n /**\\n * @dev Internal function to set the address of a contract with a specific role.\\n * @param contractType The contract type of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function _setContract(ContractType contractType, address addr) internal virtual {\\n _getContractMap()[uint8(contractType)] = addr;\\n emit ContractUpdated(contractType, addr);\\n }\\n\\n /**\\n * @dev Internal function to access the mapping of contract addresses with roles.\\n * @return contracts_ The mapping of contract addresses with roles.\\n */\\n function _getContractMap() private pure returns (mapping(uint8 => address) storage contracts_) {\\n assembly {\\n contracts_.slot := _STORAGE_SLOT\\n }\\n }\\n\\n /**\\n * @dev Internal function to check if the calling contract has a specific role.\\n * @param contractType The contract type that the calling contract must have.\\n * @dev Throws an error if the calling contract does not have the specified role.\\n */\\n function _requireContract(ContractType contractType) private view {\\n if (msg.sender != getContract(contractType)) {\\n revert ErrUnexpectedInternalCall(msg.sig, contractType, msg.sender);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7dbefa31230e6e4bd319f02d94893cbfd07ee12a0e016f5fadc57660df01891\",\"license\":\"MIT\"},\"src/extensions/collections/HasProxyAdmin.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/StorageSlot.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\n\\nabstract contract HasProxyAdmin {\\n // bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n modifier onlyProxyAdmin() {\\n _requireProxyAdmin();\\n _;\\n }\\n\\n /**\\n * @dev Returns proxy admin.\\n */\\n function _getProxyAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n function _requireProxyAdmin() internal view {\\n if (msg.sender != _getProxyAdmin()) revert ErrUnauthorized(msg.sig, RoleAccess.ADMIN);\\n }\\n}\\n\",\"keccak256\":\"0xad3db02c99a960b60151f2ad45eed46073d14fe1ed861f496c7aeefacbbc528e\",\"license\":\"MIT\"},\"src/interfaces/IMainchainGatewayV3.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IWETH.sol\\\";\\nimport \\\"./consumers/SignatureConsumer.sol\\\";\\nimport \\\"./consumers/MappedTokenConsumer.sol\\\";\\nimport \\\"../libraries/Transfer.sol\\\";\\n\\ninterface IMainchainGatewayV3 is SignatureConsumer, MappedTokenConsumer {\\n /**\\n * @dev Error indicating that a query was made for an approved withdrawal.\\n */\\n error ErrQueryForApprovedWithdrawal();\\n\\n /**\\n * @dev Error indicating that the daily withdrawal limit has been reached.\\n */\\n error ErrReachedDailyWithdrawalLimit();\\n\\n /**\\n * @dev Error indicating that a query was made for a processed withdrawal.\\n */\\n error ErrQueryForProcessedWithdrawal();\\n\\n /**\\n * @dev Error indicating that a query was made for insufficient vote weight.\\n */\\n error ErrQueryForInsufficientVoteWeight();\\n\\n /// @dev Emitted when the deposit is requested\\n event DepositRequested(bytes32 receiptHash, Transfer.Receipt receipt);\\n /// @dev Emitted when the assets are withdrawn\\n event Withdrew(bytes32 receiptHash, Transfer.Receipt receipt);\\n /// @dev Emitted when the tokens are mapped\\n event TokenMapped(address[] mainchainTokens, address[] roninTokens, TokenStandard[] standards);\\n /// @dev Emitted when the wrapped native token contract is updated\\n event WrappedNativeTokenContractUpdated(IWETH weth);\\n /// @dev Emitted when the withdrawal is locked\\n event WithdrawalLocked(bytes32 receiptHash, Transfer.Receipt receipt);\\n /// @dev Emitted when the withdrawal is unlocked\\n event WithdrawalUnlocked(bytes32 receiptHash, Transfer.Receipt receipt);\\n\\n /**\\n * @dev Returns the domain seperator.\\n */\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n\\n /**\\n * @dev Returns deposit count.\\n */\\n function depositCount() external view returns (uint256);\\n\\n /**\\n * @dev Sets the wrapped native token contract.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `WrappedNativeTokenContractUpdated` event.\\n *\\n */\\n function setWrappedNativeTokenContract(IWETH _wrappedToken) external;\\n\\n /**\\n * @dev Returns whether the withdrawal is locked.\\n */\\n function withdrawalLocked(uint256 withdrawalId) external view returns (bool);\\n\\n /**\\n * @dev Returns the withdrawal hash.\\n */\\n function withdrawalHash(uint256 withdrawalId) external view returns (bytes32);\\n\\n /**\\n * @dev Locks the assets and request deposit.\\n */\\n function requestDepositFor(Transfer.Request calldata _request) external payable;\\n\\n /**\\n * @dev Withdraws based on the receipt and the validator signatures.\\n * Returns whether the withdrawal is locked.\\n *\\n * Emits the `Withdrew` once the assets are released.\\n *\\n */\\n function submitWithdrawal(Transfer.Receipt memory _receipt, Signature[] memory _signatures) external returns (bool _locked);\\n\\n /**\\n * @dev Approves a specific withdrawal.\\n *\\n * Requirements:\\n * - The method caller is a validator.\\n *\\n * Emits the `Withdrew` once the assets are released.\\n *\\n */\\n function unlockWithdrawal(Transfer.Receipt calldata _receipt) external;\\n\\n /**\\n * @dev Maps mainchain tokens to Ronin network.\\n *\\n * Requirement:\\n * - The method caller is admin.\\n * - The arrays have the same length and its length larger than 0.\\n *\\n * Emits the `TokenMapped` event.\\n *\\n */\\n function mapTokens(address[] calldata _mainchainTokens, address[] calldata _roninTokens, TokenStandard[] calldata _standards) external;\\n\\n /**\\n * @dev Maps mainchain tokens to Ronin network and sets thresholds.\\n *\\n * Requirement:\\n * - The method caller is admin.\\n * - The arrays have the same length and its length larger than 0.\\n *\\n * Emits the `TokenMapped` event.\\n *\\n */\\n function mapTokensAndThresholds(\\n address[] calldata _mainchainTokens,\\n address[] calldata _roninTokens,\\n TokenStandard[] calldata _standards,\\n uint256[][4] calldata _thresholds\\n ) external;\\n\\n /**\\n * @dev Returns token address on Ronin network.\\n * Note: Reverts for unsupported token.\\n */\\n function getRoninToken(address _mainchainToken) external view returns (MappedToken memory _token);\\n}\\n\",\"keccak256\":\"0x2d4f53a65e76e903040f5f4dbe5aea53367d61243c60efdc8402ff184bd50a87\",\"license\":\"MIT\"},\"src/interfaces/IQuorum.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IQuorum {\\n /// @dev Emitted when the threshold is updated\\n event ThresholdUpdated(uint256 indexed nonce, uint256 indexed numerator, uint256 indexed denominator, uint256 previousNumerator, uint256 previousDenominator);\\n\\n /**\\n * @dev Returns the threshold.\\n */\\n function getThreshold() external view returns (uint256 _num, uint256 _denom);\\n\\n /**\\n * @dev Checks whether the `_voteWeight` passes the threshold.\\n */\\n function checkThreshold(uint256 _voteWeight) external view returns (bool);\\n\\n /**\\n * @dev Returns the minimum vote weight to pass the threshold.\\n */\\n function minimumVoteWeight() external view returns (uint256);\\n\\n /**\\n * @dev Sets the threshold.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `ThresholdUpdated` event.\\n *\\n */\\n function setThreshold(uint256 numerator, uint256 denominator) external;\\n}\\n\",\"keccak256\":\"0xc924e9480f59acc9bc8c033f05d3be9451de5cee0c224d76d4542fa5b67fa10f\",\"license\":\"MIT\"},\"src/interfaces/IWETH.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IWETH {\\n event Transfer(address indexed src, address indexed dst, uint wad);\\n\\n function deposit() external payable;\\n\\n function transfer(address dst, uint wad) external returns (bool);\\n\\n function approve(address guy, uint wad) external returns (bool);\\n\\n function transferFrom(address src, address dst, uint wad) external returns (bool);\\n\\n function withdraw(uint256 _wad) external;\\n\\n function balanceOf(address) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x000700e2b9c1985d53bb1cdba435f0f3d7b48e76e596e7dbbdfec1da47131415\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IBridgeManagerEvents } from \\\"./events/IBridgeManagerEvents.sol\\\";\\n\\n/**\\n * @title IBridgeManager\\n * @dev The interface for managing bridge operators.\\n */\\ninterface IBridgeManager is IBridgeManagerEvents {\\n /// @notice Error indicating that cannot find the querying operator\\n error ErrOperatorNotFound(address operator);\\n /// @notice Error indicating that cannot find the querying governor\\n error ErrGovernorNotFound(address governor);\\n /// @notice Error indicating that the msg.sender is not match the required governor\\n error ErrGovernorNotMatch(address required, address sender);\\n /// @notice Error indicating that the governors list will go below minimum number of required governor.\\n error ErrBelowMinRequiredGovernors();\\n /// @notice Common invalid input error\\n error ErrInvalidInput();\\n\\n /**\\n * @dev The domain separator used for computing hash digests in the contract.\\n */\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n\\n /**\\n * @dev Returns the total number of bridge operators.\\n * @return The total number of bridge operators.\\n */\\n function totalBridgeOperator() external view returns (uint256);\\n\\n /**\\n * @dev Checks if the given address is a bridge operator.\\n * @param addr The address to check.\\n * @return A boolean indicating whether the address is a bridge operator.\\n */\\n function isBridgeOperator(address addr) external view returns (bool);\\n\\n /**\\n * @dev Retrieves the full information of all registered bridge operators.\\n *\\n * This external function allows external callers to obtain the full information of all the registered bridge operators.\\n * The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.\\n *\\n * @return governors An array of addresses representing the governors of each bridge operator.\\n * @return bridgeOperators An array of addresses representing the registered bridge operators.\\n * @return weights An array of uint256 values representing the vote weights of each bridge operator.\\n *\\n * Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator.\\n *\\n * Example Usage:\\n * ```\\n * (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos();\\n * for (uint256 i = 0; i < bridgeOperators.length; i++) {\\n * // Access individual information for each bridge operator.\\n * address governor = governors[i];\\n * address bridgeOperator = bridgeOperators[i];\\n * uint256 weight = weights[i];\\n * // ... (Process or use the information as required) ...\\n * }\\n * ```\\n *\\n */\\n function getFullBridgeOperatorInfos() external view returns (address[] memory governors, address[] memory bridgeOperators, uint96[] memory weights);\\n\\n /**\\n * @dev Returns total weights of the governor list.\\n */\\n function sumGovernorsWeight(address[] calldata governors) external view returns (uint256 sum);\\n\\n /**\\n * @dev Returns total weights.\\n */\\n function getTotalWeight() external view returns (uint256);\\n\\n /**\\n * @dev Returns an array of all bridge operators.\\n * @return An array containing the addresses of all bridge operators.\\n */\\n function getBridgeOperators() external view returns (address[] memory);\\n\\n /**\\n * @dev Returns the corresponding `operator` of a `governor`.\\n */\\n function getOperatorOf(address governor) external view returns (address operator);\\n\\n /**\\n * @dev Returns the corresponding `governor` of a `operator`.\\n */\\n function getGovernorOf(address operator) external view returns (address governor);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific governor.\\n * @param governor The address of the governor to get the vote weight for.\\n * @return voteWeight The vote weight of the specified governor.\\n */\\n function getGovernorWeight(address governor) external view returns (uint96);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific bridge operator.\\n * @param bridgeOperator The address of the bridge operator to get the vote weight for.\\n * @return weight The vote weight of the specified bridge operator.\\n */\\n function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint96 weight);\\n\\n /**\\n * @dev Returns the weights of a list of governor addresses.\\n */\\n function getGovernorWeights(address[] calldata governors) external view returns (uint96[] memory weights);\\n\\n /**\\n * @dev Returns an array of all governors.\\n * @return An array containing the addresses of all governors.\\n */\\n function getGovernors() external view returns (address[] memory);\\n\\n /**\\n * @dev Adds multiple bridge operators.\\n * @param governors An array of addresses of hot/cold wallets for bridge operator to update their node address.\\n * @param bridgeOperators An array of addresses representing the bridge operators to add.\\n */\\n function addBridgeOperators(uint96[] calldata voteWeights, address[] calldata governors, address[] calldata bridgeOperators) external;\\n\\n /**\\n * @dev Removes multiple bridge operators.\\n * @param bridgeOperators An array of addresses representing the bridge operators to remove.\\n */\\n function removeBridgeOperators(address[] calldata bridgeOperators) external;\\n\\n /**\\n * @dev Self-call to update the minimum required governor.\\n * @param min The minimum number, this must not less than 3.\\n */\\n function setMinRequiredGovernor(uint min) external;\\n}\\n\",\"keccak256\":\"0xefc46318a240371031e77ef3c355e2c18432e4479145378de6782277f9b44923\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManagerCallback.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @title IBridgeManagerCallback\\n * @dev Interface for the callback functions to be implemented by the Bridge Manager contract.\\n */\\ninterface IBridgeManagerCallback is IERC165 {\\n /**\\n * @dev Handles the event when bridge operators are added.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @param addeds The corresponding boolean values indicating whether the operators were added or not.\\n * @return selector The selector of the function being called.\\n */\\n function onBridgeOperatorsAdded(address[] memory bridgeOperators, uint96[] calldata weights, bool[] memory addeds) external returns (bytes4 selector);\\n\\n /**\\n * @dev Handles the event when bridge operators are removed.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @param removeds The corresponding boolean values indicating whether the operators were removed or not.\\n * @return selector The selector of the function being called.\\n */\\n function onBridgeOperatorsRemoved(address[] memory bridgeOperators, bool[] memory removeds) external returns (bytes4 selector);\\n}\\n\",\"keccak256\":\"0x6c8ce7e2478e28c5ed5e6f5d8305a77d6d5f9125a47adfb77632940b9a0f3625\",\"license\":\"MIT\"},\"src/interfaces/bridge/events/IBridgeManagerEvents.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeManagerEvents {\\n /**\\n * @dev Emitted when new bridge operators are added.\\n */\\n event BridgeOperatorsAdded(bool[] statuses, uint96[] voteWeights, address[] governors, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is failed to add.\\n */\\n event BridgeOperatorAddingFailed(address indexed operator);\\n\\n /**\\n * @dev Emitted when bridge operators are removed.\\n */\\n event BridgeOperatorsRemoved(bool[] statuses, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is failed to remove.\\n */\\n event BridgeOperatorRemovingFailed(address indexed operator);\\n\\n /**\\n * @dev Emitted when a bridge operator is updated.\\n */\\n event BridgeOperatorUpdated(address indexed governor, address indexed fromBridgeOperator, address indexed toBridgeOperator);\\n\\n /**\\n * @dev Emitted when the minimum number of required governors is updated.\\n */\\n event MinRequiredGovernorUpdated(uint min);\\n}\\n\",\"keccak256\":\"0x38bc3709c98a7c08fb9b6fa3e07a725903dcb0bd07de8a828bac6c3bcf7d997d\",\"license\":\"MIT\"},\"src/interfaces/collections/IHasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport { ContractType } from \\\"../../utils/ContractType.sol\\\";\\n\\ninterface IHasContracts {\\n /// @dev Error of invalid role.\\n error ErrContractTypeNotFound(ContractType contractType);\\n\\n /// @dev Emitted when a contract is updated.\\n event ContractUpdated(ContractType indexed contractType, address indexed addr);\\n\\n /**\\n * @dev Returns the address of a contract with a specific role.\\n * Throws an error if no contract is set for the specified role.\\n *\\n * @param contractType The role of the contract to retrieve.\\n * @return contract_ The address of the contract with the specified role.\\n */\\n function getContract(ContractType contractType) external view returns (address contract_);\\n\\n /**\\n * @dev Sets the address of a contract with a specific role.\\n * Emits the event {ContractUpdated}.\\n * @param contractType The role of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function setContract(ContractType contractType, address addr) external;\\n}\\n\",\"keccak256\":\"0x99d8213d857e30d367155abd15dc42730afdfbbac3a22dfb3b95ffea2083a92e\",\"license\":\"MIT\"},\"src/interfaces/consumers/MappedTokenConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../libraries/LibTokenInfo.sol\\\";\\n\\ninterface MappedTokenConsumer {\\n struct MappedToken {\\n TokenStandard erc;\\n address tokenAddr;\\n }\\n}\\n\",\"keccak256\":\"0xc53dcba9dc7d950ab6561149f76b45617ddbce5037e4c86ea00b976018bbfde1\",\"license\":\"MIT\"},\"src/interfaces/consumers/SignatureConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface SignatureConsumer {\\n struct Signature {\\n uint8 v;\\n bytes32 r;\\n bytes32 s;\\n }\\n}\\n\",\"keccak256\":\"0xd370e350722067097dec1a5c31bda6e47e83417fa5c3288293bb910028cd136b\",\"license\":\"MIT\"},\"src/libraries/AddressArrayUtils.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\nlibrary AddressArrayUtils {\\n /**\\n * @dev Error thrown when a duplicated element is detected in an array.\\n * @param msgSig The function signature that invoke the error.\\n */\\n error ErrDuplicated(bytes4 msgSig);\\n\\n /**\\n * @dev Returns whether or not there's a duplicate. Runs in O(n^2).\\n * @param A Array to search\\n * @return Returns true if duplicate, false otherwise\\n */\\n function hasDuplicate(address[] memory A) internal pure returns (bool) {\\n if (A.length == 0) {\\n return false;\\n }\\n unchecked {\\n for (uint256 i = 0; i < A.length - 1; i++) {\\n for (uint256 j = i + 1; j < A.length; j++) {\\n if (A[i] == A[j]) {\\n return true;\\n }\\n }\\n }\\n }\\n return false;\\n }\\n\\n /**\\n * @dev Returns whether two arrays of addresses are equal or not.\\n */\\n function isEqual(address[] memory _this, address[] memory _other) internal pure returns (bool yes_) {\\n // Hashing two arrays and compare their hash\\n assembly {\\n let _thisHash := keccak256(add(_this, 32), mul(mload(_this), 32))\\n let _otherHash := keccak256(add(_other, 32), mul(mload(_other), 32))\\n yes_ := eq(_thisHash, _otherHash)\\n }\\n }\\n\\n /**\\n * @dev Return the concatenated array from a and b.\\n */\\n function extend(address[] memory a, address[] memory b) internal pure returns (address[] memory c) {\\n uint256 lengthA = a.length;\\n uint256 lengthB = b.length;\\n unchecked {\\n c = new address[](lengthA + lengthB);\\n }\\n uint256 i;\\n for (; i < lengthA;) {\\n c[i] = a[i];\\n unchecked {\\n ++i;\\n }\\n }\\n for (uint256 j; j < lengthB;) {\\n c[i] = b[j];\\n unchecked {\\n ++i;\\n ++j;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce5d578861167da47a965c8a0e1592b808aad6eb79ccb1873bf2e2280ddb85ee\",\"license\":\"UNLICENSED\"},\"src/libraries/LibTokenInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/IERC721.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC1155/presets/ERC1155PresetMinterPauser.sol\\\";\\nimport \\\"../interfaces/IWETH.sol\\\";\\n\\nenum TokenStandard {\\n ERC20,\\n ERC721,\\n ERC1155\\n}\\n\\nstruct TokenInfo {\\n TokenStandard erc;\\n // For ERC20: the id must be 0 and the quantity is larger than 0.\\n // For ERC721: the quantity must be 0.\\n uint256 id;\\n uint256 quantity;\\n}\\n\\n/**\\n * @dev Error indicating that the `transfer` has failed.\\n * @param tokenInfo Info of the token including ERC standard, id or quantity.\\n * @param to Receiver of the token value.\\n * @param token Address of the token.\\n */\\nerror ErrTokenCouldNotTransfer(TokenInfo tokenInfo, address to, address token);\\n\\n/**\\n * @dev Error indicating that the `handleAssetIn` has failed.\\n * @param tokenInfo Info of the token including ERC standard, id or quantity.\\n * @param from Owner of the token value.\\n * @param to Receiver of the token value.\\n * @param token Address of the token.\\n */\\nerror ErrTokenCouldNotTransferFrom(TokenInfo tokenInfo, address from, address to, address token);\\n\\n/// @dev Error indicating that the provided information is invalid.\\nerror ErrInvalidInfo();\\n\\n/// @dev Error indicating that the minting of ERC20 tokens has failed.\\nerror ErrERC20MintingFailed();\\n\\n/// @dev Error indicating that the minting of ERC721 tokens has failed.\\nerror ErrERC721MintingFailed();\\n\\n/// @dev Error indicating that the transfer of ERC1155 tokens has failed.\\nerror ErrERC1155TransferFailed();\\n\\n/// @dev Error indicating that the mint of ERC1155 tokens has failed.\\nerror ErrERC1155MintingFailed();\\n\\n/// @dev Error indicating that an unsupported standard is encountered.\\nerror ErrUnsupportedStandard();\\n\\nlibrary LibTokenInfo {\\n /**\\n *\\n * HASH\\n *\\n */\\n\\n // keccak256(\\\"TokenInfo(uint8 erc,uint256 id,uint256 quantity)\\\");\\n bytes32 public constant INFO_TYPE_HASH_SINGLE = 0x1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d;\\n\\n /**\\n * @dev Returns token info struct hash.\\n */\\n function hash(TokenInfo memory self) internal pure returns (bytes32 digest) {\\n // keccak256(abi.encode(INFO_TYPE_HASH_SINGLE, info.erc, info.id, info.quantity))\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n mstore(ptr, INFO_TYPE_HASH_SINGLE)\\n mstore(add(ptr, 0x20), mload(self)) // info.erc\\n mstore(add(ptr, 0x40), mload(add(self, 0x20))) // info.id\\n mstore(add(ptr, 0x60), mload(add(self, 0x40))) // info.quantity\\n digest := keccak256(ptr, 0x80)\\n }\\n }\\n\\n /**\\n *\\n * VALIDATE\\n *\\n */\\n\\n /**\\n * @dev Validates the token info.\\n */\\n function validate(TokenInfo memory self) internal pure {\\n if (!(_checkERC20(self) || _checkERC721(self) || _checkERC1155(self))) {\\n revert ErrInvalidInfo();\\n }\\n }\\n\\n function _checkERC20(TokenInfo memory self) private pure returns (bool) {\\n return (self.erc == TokenStandard.ERC20 && self.quantity > 0 && self.id == 0);\\n }\\n\\n function _checkERC721(TokenInfo memory self) private pure returns (bool) {\\n return (self.erc == TokenStandard.ERC721 && self.quantity == 0);\\n }\\n\\n function _checkERC1155(TokenInfo memory self) private pure returns (bool res) {\\n // Only validate the quantity, because id of ERC-1155 can be 0.\\n return (self.erc == TokenStandard.ERC1155 && self.quantity > 0);\\n }\\n\\n /**\\n *\\n * TRANSFER IN/OUT METHOD\\n *\\n */\\n\\n /**\\n * @dev Transfer asset in.\\n *\\n * Requirements:\\n * - The `_from` address must approve for the contract using this library.\\n *\\n */\\n function handleAssetIn(TokenInfo memory self, address from, address token) internal {\\n bool success;\\n bytes memory data;\\n if (self.erc == TokenStandard.ERC20) {\\n (success, data) = token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, address(this), self.quantity));\\n success = success && (data.length == 0 || abi.decode(data, (bool)));\\n } else if (self.erc == TokenStandard.ERC721) {\\n success = _tryTransferFromERC721(token, from, address(this), self.id);\\n } else if (self.erc == TokenStandard.ERC1155) {\\n success = _tryTransferFromERC1155(token, from, address(this), self.id, self.quantity);\\n } else {\\n revert ErrUnsupportedStandard();\\n }\\n\\n if (!success) revert ErrTokenCouldNotTransferFrom(self, from, address(this), token);\\n }\\n\\n /**\\n * @dev Tries transfer assets out, or mint the assets if cannot transfer.\\n *\\n * @notice Prioritizes transfer native token if the token is wrapped.\\n *\\n */\\n function handleAssetOut(TokenInfo memory self, address payable to, address token, IWETH wrappedNativeToken) internal {\\n if (token == address(wrappedNativeToken)) {\\n // Try sending the native token before transferring the wrapped token\\n if (!to.send(self.quantity)) {\\n wrappedNativeToken.deposit{ value: self.quantity }();\\n _transferTokenOut(self, to, token);\\n }\\n\\n return;\\n }\\n\\n if (self.erc == TokenStandard.ERC20) {\\n uint256 balance = IERC20(token).balanceOf(address(this));\\n if (balance < self.quantity) {\\n if (!_tryMintERC20(token, address(this), self.quantity - balance)) revert ErrERC20MintingFailed();\\n }\\n\\n _transferTokenOut(self, to, token);\\n return;\\n }\\n\\n if (self.erc == TokenStandard.ERC721) {\\n if (!_tryTransferOutOrMintERC721(token, to, self.id)) {\\n revert ErrERC721MintingFailed();\\n }\\n return;\\n }\\n\\n if (self.erc == TokenStandard.ERC1155) {\\n if (!_tryTransferOutOrMintERC1155(token, to, self.id, self.quantity)) {\\n revert ErrERC1155MintingFailed();\\n }\\n return;\\n }\\n\\n revert ErrUnsupportedStandard();\\n }\\n\\n /**\\n *\\n * TRANSFER HELPERS\\n *\\n */\\n\\n /**\\n * @dev Transfer assets from current address to `_to` address.\\n */\\n function _transferTokenOut(TokenInfo memory self, address to, address token) private {\\n bool success;\\n if (self.erc == TokenStandard.ERC20) {\\n success = _tryTransferERC20(token, to, self.quantity);\\n } else if (self.erc == TokenStandard.ERC721) {\\n success = _tryTransferFromERC721(token, address(this), to, self.id);\\n } else {\\n revert ErrUnsupportedStandard();\\n }\\n\\n if (!success) revert ErrTokenCouldNotTransfer(self, to, token);\\n }\\n\\n /**\\n * TRANSFER ERC-20\\n */\\n\\n /**\\n * @dev Transfers ERC20 token and returns the result.\\n */\\n function _tryTransferERC20(address token, address to, uint256 quantity) private returns (bool success) {\\n bytes memory data;\\n (success, data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, quantity));\\n success = success && (data.length == 0 || abi.decode(data, (bool)));\\n }\\n\\n /**\\n * @dev Mints ERC20 token and returns the result.\\n */\\n function _tryMintERC20(address token, address to, uint256 quantity) private returns (bool success) {\\n // bytes4(keccak256(\\\"mint(address,uint256)\\\"))\\n (success,) = token.call(abi.encodeWithSelector(0x40c10f19, to, quantity));\\n }\\n\\n /**\\n * TRANSFER ERC-721\\n */\\n\\n /**\\n * @dev Transfers the ERC721 token out. If the transfer failed, mints the ERC721.\\n * @return success Returns `false` if both transfer and mint are failed.\\n */\\n function _tryTransferOutOrMintERC721(address token, address to, uint256 id) private returns (bool success) {\\n success = _tryTransferFromERC721(token, address(this), to, id);\\n if (!success) {\\n return _tryMintERC721(token, to, id);\\n }\\n }\\n\\n /**\\n * @dev Transfers ERC721 token and returns the result.\\n */\\n function _tryTransferFromERC721(address token, address from, address to, uint256 id) private returns (bool success) {\\n (success,) = token.call(abi.encodeWithSelector(IERC721.transferFrom.selector, from, to, id));\\n }\\n\\n /**\\n * @dev Mints ERC721 token and returns the result.\\n */\\n function _tryMintERC721(address token, address to, uint256 id) private returns (bool success) {\\n // bytes4(keccak256(\\\"mint(address,uint256)\\\"))\\n (success,) = token.call(abi.encodeWithSelector(0x40c10f19, to, id));\\n }\\n\\n /**\\n * TRANSFER ERC-1155\\n */\\n\\n /**\\n * @dev Transfers the ERC1155 token out. If the transfer failed, mints the ERC11555.\\n * @return success Returns `false` if both transfer and mint are failed.\\n */\\n function _tryTransferOutOrMintERC1155(address token, address to, uint256 id, uint256 amount) private returns (bool success) {\\n success = _tryTransferFromERC1155(token, address(this), to, id, amount);\\n if (!success) {\\n return _tryMintERC1155(token, to, id, amount);\\n }\\n }\\n\\n /**\\n * @dev Transfers ERC1155 token and returns the result.\\n */\\n function _tryTransferFromERC1155(address token, address from, address to, uint256 id, uint256 amount) private returns (bool success) {\\n (success,) = token.call(abi.encodeCall(IERC1155.safeTransferFrom, (from, to, id, amount, new bytes(0))));\\n }\\n\\n /**\\n * @dev Mints ERC1155 token and returns the result.\\n */\\n function _tryMintERC1155(address token, address to, uint256 id, uint256 amount) private returns (bool success) {\\n (success,) = token.call(abi.encodeCall(ERC1155PresetMinterPauser.mint, (to, id, amount, new bytes(0))));\\n }\\n}\\n\",\"keccak256\":\"0x56b413a42c6c39a51dc1737e735d1623b89ecdf00bacd960f70b3f18ccaa6de2\",\"license\":\"MIT\"},\"src/libraries/LibTokenOwner.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nstruct TokenOwner {\\n address addr;\\n address tokenAddr;\\n uint256 chainId;\\n}\\n\\nlibrary LibTokenOwner {\\n // keccak256(\\\"TokenOwner(address addr,address tokenAddr,uint256 chainId)\\\");\\n bytes32 public constant OWNER_TYPE_HASH = 0x353bdd8d69b9e3185b3972e08b03845c0c14a21a390215302776a7a34b0e8764;\\n\\n /**\\n * @dev Returns ownership struct hash.\\n */\\n function hash(TokenOwner memory owner) internal pure returns (bytes32 digest) {\\n // keccak256(abi.encode(OWNER_TYPE_HASH, owner.addr, owner.tokenAddr, owner.chainId))\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n mstore(ptr, OWNER_TYPE_HASH)\\n mstore(add(ptr, 0x20), mload(owner)) // owner.addr\\n mstore(add(ptr, 0x40), mload(add(owner, 0x20))) // owner.tokenAddr\\n mstore(add(ptr, 0x60), mload(add(owner, 0x40))) // owner.chainId\\n digest := keccak256(ptr, 0x80)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb104fd02056a3ed52bf06c202e87b748200320682871b1801985050587ec2d51\",\"license\":\"MIT\"},\"src/libraries/Transfer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./LibTokenInfo.sol\\\";\\nimport \\\"./LibTokenOwner.sol\\\";\\n\\nlibrary Transfer {\\n using ECDSA for bytes32;\\n using LibTokenOwner for TokenOwner;\\n using LibTokenInfo for TokenInfo;\\n\\n enum Kind {\\n Deposit,\\n Withdrawal\\n }\\n\\n struct Request {\\n // For deposit request: Recipient address on Ronin network\\n // For withdrawal request: Recipient address on mainchain network\\n address recipientAddr;\\n // Token address to deposit/withdraw\\n // Value 0: native token\\n address tokenAddr;\\n TokenInfo info;\\n }\\n\\n /**\\n * @dev Converts the transfer request into the deposit receipt.\\n */\\n function into_deposit_receipt(\\n Request memory _request,\\n address _requester,\\n uint256 _id,\\n address _roninTokenAddr,\\n uint256 _roninChainId\\n ) internal view returns (Receipt memory _receipt) {\\n _receipt.id = _id;\\n _receipt.kind = Kind.Deposit;\\n _receipt.mainchain.addr = _requester;\\n _receipt.mainchain.tokenAddr = _request.tokenAddr;\\n _receipt.mainchain.chainId = block.chainid;\\n _receipt.ronin.addr = _request.recipientAddr;\\n _receipt.ronin.tokenAddr = _roninTokenAddr;\\n _receipt.ronin.chainId = _roninChainId;\\n _receipt.info = _request.info;\\n }\\n\\n /**\\n * @dev Converts the transfer request into the withdrawal receipt.\\n */\\n function into_withdrawal_receipt(\\n Request memory _request,\\n address _requester,\\n uint256 _id,\\n address _mainchainTokenAddr,\\n uint256 _mainchainId\\n ) internal view returns (Receipt memory _receipt) {\\n _receipt.id = _id;\\n _receipt.kind = Kind.Withdrawal;\\n _receipt.ronin.addr = _requester;\\n _receipt.ronin.tokenAddr = _request.tokenAddr;\\n _receipt.ronin.chainId = block.chainid;\\n _receipt.mainchain.addr = _request.recipientAddr;\\n _receipt.mainchain.tokenAddr = _mainchainTokenAddr;\\n _receipt.mainchain.chainId = _mainchainId;\\n _receipt.info = _request.info;\\n }\\n\\n struct Receipt {\\n uint256 id;\\n Kind kind;\\n TokenOwner mainchain;\\n TokenOwner ronin;\\n TokenInfo info;\\n }\\n\\n // keccak256(\\\"Receipt(uint256 id,uint8 kind,TokenOwner mainchain,TokenOwner ronin,TokenInfo info)TokenInfo(uint8 erc,uint256 id,uint256 quantity)TokenOwner(address addr,address tokenAddr,uint256 chainId)\\\");\\n bytes32 public constant TYPE_HASH = 0xb9d1fe7c9deeec5dc90a2f47ff1684239519f2545b2228d3d91fb27df3189eea;\\n\\n /**\\n * @dev Returns token info struct hash.\\n */\\n function hash(Receipt memory _receipt) internal pure returns (bytes32 digest) {\\n bytes32 hashedReceiptMainchain = _receipt.mainchain.hash();\\n bytes32 hashedReceiptRonin = _receipt.ronin.hash();\\n bytes32 hashedReceiptInfo = _receipt.info.hash();\\n\\n /*\\n * return\\n * keccak256(\\n * abi.encode(\\n * TYPE_HASH,\\n * _receipt.id,\\n * _receipt.kind,\\n * Token.hash(_receipt.mainchain),\\n * Token.hash(_receipt.ronin),\\n * Token.hash(_receipt.info)\\n * )\\n * );\\n */\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, TYPE_HASH)\\n mstore(add(ptr, 0x20), mload(_receipt)) // _receipt.id\\n mstore(add(ptr, 0x40), mload(add(_receipt, 0x20))) // _receipt.kind\\n mstore(add(ptr, 0x60), hashedReceiptMainchain)\\n mstore(add(ptr, 0x80), hashedReceiptRonin)\\n mstore(add(ptr, 0xa0), hashedReceiptInfo)\\n digest := keccak256(ptr, 0xc0)\\n }\\n }\\n\\n /**\\n * @dev Returns the receipt digest.\\n */\\n function receiptDigest(bytes32 _domainSeparator, bytes32 _receiptHash) internal pure returns (bytes32) {\\n return _domainSeparator.toTypedDataHash(_receiptHash);\\n }\\n}\\n\",\"keccak256\":\"0x652c72f4e9aeffed1be05759c84c538a416d2c264deef9af4c53de0a1ad04ee4\",\"license\":\"MIT\"},\"src/mainchain/MainchainGatewayV3.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.23;\\n\\nimport \\\"@openzeppelin/contracts/access/AccessControlEnumerable.sol\\\";\\nimport \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol\\\";\\nimport { IBridgeManager } from \\\"../interfaces/bridge/IBridgeManager.sol\\\";\\nimport { IBridgeManagerCallback } from \\\"../interfaces/bridge/IBridgeManagerCallback.sol\\\";\\nimport { HasContracts, ContractType } from \\\"../extensions/collections/HasContracts.sol\\\";\\nimport \\\"../extensions/WethUnwrapper.sol\\\";\\nimport \\\"../extensions/WithdrawalLimitation.sol\\\";\\nimport \\\"../libraries/Transfer.sol\\\";\\nimport \\\"../interfaces/IMainchainGatewayV3.sol\\\";\\n\\ncontract MainchainGatewayV3 is\\n WithdrawalLimitation,\\n Initializable,\\n AccessControlEnumerable,\\n ERC1155Holder,\\n IMainchainGatewayV3,\\n HasContracts,\\n IBridgeManagerCallback\\n{\\n using LibTokenInfo for TokenInfo;\\n using Transfer for Transfer.Request;\\n using Transfer for Transfer.Receipt;\\n\\n /// @dev Withdrawal unlocker role hash\\n bytes32 public constant WITHDRAWAL_UNLOCKER_ROLE = keccak256(\\\"WITHDRAWAL_UNLOCKER_ROLE\\\");\\n\\n /// @dev Wrapped native token address\\n IWETH public wrappedNativeToken;\\n /// @dev Ronin network id\\n uint256 public roninChainId;\\n /// @dev Total deposit\\n uint256 public depositCount;\\n /// @dev Domain separator\\n bytes32 internal _domainSeparator;\\n /// @dev Mapping from mainchain token => token address on Ronin network\\n mapping(address => MappedToken) internal _roninToken;\\n /// @dev Mapping from withdrawal id => withdrawal hash\\n mapping(uint256 => bytes32) public withdrawalHash;\\n /// @dev Mapping from withdrawal id => locked\\n mapping(uint256 => bool) public withdrawalLocked;\\n\\n /// @custom:deprecated Previously `_bridgeOperatorAddedBlock` (mapping(address => uint256))\\n uint256 private ______deprecatedBridgeOperatorAddedBlock;\\n /// @custom:deprecated Previously `_bridgeOperators` (uint256[])\\n uint256 private ______deprecatedBridgeOperators;\\n\\n uint96 private _totalOperatorWeight;\\n mapping(address operator => uint96 weight) private _operatorWeight;\\n WethUnwrapper public wethUnwrapper;\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n receive() external payable {\\n _fallback();\\n }\\n\\n /**\\n * @dev Initializes contract storage.\\n */\\n function initialize(\\n address _roleSetter,\\n IWETH _wrappedToken,\\n uint256 _roninChainId,\\n uint256 _numerator,\\n uint256 _highTierVWNumerator,\\n uint256 _denominator,\\n // _addresses[0]: mainchainTokens\\n // _addresses[1]: roninTokens\\n // _addresses[2]: withdrawalUnlockers\\n address[][3] calldata _addresses,\\n // _thresholds[0]: highTierThreshold\\n // _thresholds[1]: lockedThreshold\\n // _thresholds[2]: unlockFeePercentages\\n // _thresholds[3]: dailyWithdrawalLimit\\n uint256[][4] calldata _thresholds,\\n TokenStandard[] calldata _standards\\n ) external payable virtual initializer {\\n _setupRole(DEFAULT_ADMIN_ROLE, _roleSetter);\\n roninChainId = _roninChainId;\\n\\n _setWrappedNativeTokenContract(_wrappedToken);\\n _updateDomainSeparator();\\n _setThreshold(_numerator, _denominator);\\n _setHighTierVoteWeightThreshold(_highTierVWNumerator, _denominator);\\n _verifyThresholds();\\n\\n if (_addresses[0].length > 0) {\\n // Map mainchain tokens to ronin tokens\\n _mapTokens(_addresses[0], _addresses[1], _standards);\\n // Sets thresholds based on the mainchain tokens\\n _setHighTierThresholds(_addresses[0], _thresholds[0]);\\n _setLockedThresholds(_addresses[0], _thresholds[1]);\\n _setUnlockFeePercentages(_addresses[0], _thresholds[2]);\\n _setDailyWithdrawalLimits(_addresses[0], _thresholds[3]);\\n }\\n\\n // Grant role for withdrawal unlocker\\n for (uint256 i; i < _addresses[2].length; i++) {\\n _grantRole(WITHDRAWAL_UNLOCKER_ROLE, _addresses[2][i]);\\n }\\n }\\n\\n function initializeV2(address bridgeManagerContract) external reinitializer(2) {\\n _setContract(ContractType.BRIDGE_MANAGER, bridgeManagerContract);\\n }\\n\\n function initializeV3() external reinitializer(3) {\\n IBridgeManager mainchainBridgeManager = IBridgeManager(getContract(ContractType.BRIDGE_MANAGER));\\n (, address[] memory operators, uint96[] memory weights) = mainchainBridgeManager.getFullBridgeOperatorInfos();\\n\\n uint96 totalWeight;\\n for (uint i; i < operators.length; i++) {\\n _operatorWeight[operators[i]] = weights[i];\\n totalWeight += weights[i];\\n }\\n _totalOperatorWeight = totalWeight;\\n }\\n\\n function initializeV4(address payable wethUnwrapper_) external reinitializer(4) {\\n wethUnwrapper = WethUnwrapper(wethUnwrapper_);\\n }\\n\\n /**\\n * @dev Receives ether without doing anything. Use this function to topup native token.\\n */\\n function receiveEther() external payable { }\\n\\n /**\\n * @inheritdoc IMainchainGatewayV3\\n */\\n function DOMAIN_SEPARATOR() external view virtual returns (bytes32) {\\n return _domainSeparator;\\n }\\n\\n /**\\n * @inheritdoc IMainchainGatewayV3\\n */\\n function setWrappedNativeTokenContract(IWETH _wrappedToken) external virtual onlyProxyAdmin {\\n _setWrappedNativeTokenContract(_wrappedToken);\\n }\\n\\n /**\\n * @inheritdoc IMainchainGatewayV3\\n */\\n function requestDepositFor(Transfer.Request calldata _request) external payable virtual whenNotPaused {\\n _requestDepositFor(_request, msg.sender);\\n }\\n\\n /**\\n * @inheritdoc IMainchainGatewayV3\\n */\\n function submitWithdrawal(Transfer.Receipt calldata _receipt, Signature[] calldata _signatures) external virtual whenNotPaused returns (bool _locked) {\\n return _submitWithdrawal(_receipt, _signatures);\\n }\\n\\n /**\\n * @inheritdoc IMainchainGatewayV3\\n */\\n function unlockWithdrawal(Transfer.Receipt calldata receipt) external onlyRole(WITHDRAWAL_UNLOCKER_ROLE) {\\n bytes32 _receiptHash = receipt.hash();\\n if (withdrawalHash[receipt.id] != receipt.hash()) {\\n revert ErrInvalidReceipt();\\n }\\n if (!withdrawalLocked[receipt.id]) {\\n revert ErrQueryForApprovedWithdrawal();\\n }\\n delete withdrawalLocked[receipt.id];\\n emit WithdrawalUnlocked(_receiptHash, receipt);\\n\\n address token = receipt.mainchain.tokenAddr;\\n if (receipt.info.erc == TokenStandard.ERC20) {\\n TokenInfo memory feeInfo = receipt.info;\\n feeInfo.quantity = _computeFeePercentage(receipt.info.quantity, unlockFeePercentages[token]);\\n TokenInfo memory withdrawInfo = receipt.info;\\n withdrawInfo.quantity = receipt.info.quantity - feeInfo.quantity;\\n\\n feeInfo.handleAssetOut(payable(msg.sender), token, wrappedNativeToken);\\n withdrawInfo.handleAssetOut(payable(receipt.mainchain.addr), token, wrappedNativeToken);\\n } else {\\n receipt.info.handleAssetOut(payable(receipt.mainchain.addr), token, wrappedNativeToken);\\n }\\n\\n emit Withdrew(_receiptHash, receipt);\\n }\\n\\n /**\\n * @inheritdoc IMainchainGatewayV3\\n */\\n function mapTokens(address[] calldata _mainchainTokens, address[] calldata _roninTokens, TokenStandard[] calldata _standards) external virtual onlyProxyAdmin {\\n if (_mainchainTokens.length == 0) revert ErrEmptyArray();\\n _mapTokens(_mainchainTokens, _roninTokens, _standards);\\n }\\n\\n /**\\n * @inheritdoc IMainchainGatewayV3\\n */\\n function mapTokensAndThresholds(\\n address[] calldata _mainchainTokens,\\n address[] calldata _roninTokens,\\n TokenStandard[] calldata _standards,\\n // _thresholds[0]: highTierThreshold\\n // _thresholds[1]: lockedThreshold\\n // _thresholds[2]: unlockFeePercentages\\n // _thresholds[3]: dailyWithdrawalLimit\\n uint256[][4] calldata _thresholds\\n ) external virtual onlyProxyAdmin {\\n if (_mainchainTokens.length == 0) revert ErrEmptyArray();\\n _mapTokens(_mainchainTokens, _roninTokens, _standards);\\n _setHighTierThresholds(_mainchainTokens, _thresholds[0]);\\n _setLockedThresholds(_mainchainTokens, _thresholds[1]);\\n _setUnlockFeePercentages(_mainchainTokens, _thresholds[2]);\\n _setDailyWithdrawalLimits(_mainchainTokens, _thresholds[3]);\\n }\\n\\n /**\\n * @inheritdoc IMainchainGatewayV3\\n */\\n function getRoninToken(address mainchainToken) public view returns (MappedToken memory token) {\\n token = _roninToken[mainchainToken];\\n if (token.tokenAddr == address(0)) revert ErrUnsupportedToken();\\n }\\n\\n /**\\n * @dev Maps mainchain tokens to Ronin network.\\n *\\n * Requirement:\\n * - The arrays have the same length.\\n *\\n * Emits the `TokenMapped` event.\\n *\\n */\\n function _mapTokens(address[] calldata mainchainTokens, address[] calldata roninTokens, TokenStandard[] calldata standards) internal virtual {\\n if (!(mainchainTokens.length == roninTokens.length && mainchainTokens.length == standards.length)) revert ErrLengthMismatch(msg.sig);\\n\\n for (uint256 i; i < mainchainTokens.length; ++i) {\\n _roninToken[mainchainTokens[i]].tokenAddr = roninTokens[i];\\n _roninToken[mainchainTokens[i]].erc = standards[i];\\n }\\n\\n emit TokenMapped(mainchainTokens, roninTokens, standards);\\n }\\n\\n /**\\n * @dev Submits withdrawal receipt.\\n *\\n * Requirements:\\n * - The receipt kind is withdrawal.\\n * - The receipt is to withdraw on this chain.\\n * - The receipt is not used to withdraw before.\\n * - The withdrawal is not reached the limit threshold.\\n * - The signer weight total is larger than or equal to the minimum threshold.\\n * - The signature signers are in order.\\n *\\n * Emits the `Withdrew` once the assets are released.\\n *\\n */\\n function _submitWithdrawal(Transfer.Receipt calldata receipt, Signature[] memory signatures) internal virtual returns (bool locked) {\\n uint256 id = receipt.id;\\n uint256 quantity = receipt.info.quantity;\\n address tokenAddr = receipt.mainchain.tokenAddr;\\n\\n receipt.info.validate();\\n if (receipt.kind != Transfer.Kind.Withdrawal) revert ErrInvalidReceiptKind();\\n\\n if (receipt.mainchain.chainId != block.chainid) {\\n revert ErrInvalidChainId(msg.sig, receipt.mainchain.chainId, block.chainid);\\n }\\n\\n MappedToken memory token = getRoninToken(receipt.mainchain.tokenAddr);\\n\\n if (!(token.erc == receipt.info.erc && token.tokenAddr == receipt.ronin.tokenAddr && receipt.ronin.chainId == roninChainId)) {\\n revert ErrInvalidReceipt();\\n }\\n\\n if (withdrawalHash[id] != 0) revert ErrQueryForProcessedWithdrawal();\\n\\n if (!(receipt.info.erc == TokenStandard.ERC721 || !_reachedWithdrawalLimit(tokenAddr, quantity))) {\\n revert ErrReachedDailyWithdrawalLimit();\\n }\\n\\n bytes32 receiptHash = receipt.hash();\\n bytes32 receiptDigest = Transfer.receiptDigest(_domainSeparator, receiptHash);\\n\\n uint256 minimumWeight;\\n (minimumWeight, locked) = _computeMinVoteWeight(receipt.info.erc, tokenAddr, quantity);\\n\\n {\\n bool passed;\\n address signer;\\n address lastSigner;\\n Signature memory sig;\\n uint256 weight;\\n for (uint256 i; i < signatures.length; i++) {\\n sig = signatures[i];\\n signer = ecrecover(receiptDigest, sig.v, sig.r, sig.s);\\n if (lastSigner >= signer) revert ErrInvalidOrder(msg.sig);\\n\\n lastSigner = signer;\\n\\n weight += _getWeight(signer);\\n if (weight >= minimumWeight) {\\n passed = true;\\n break;\\n }\\n }\\n\\n if (!passed) revert ErrQueryForInsufficientVoteWeight();\\n withdrawalHash[id] = receiptHash;\\n }\\n\\n if (locked) {\\n withdrawalLocked[id] = true;\\n emit WithdrawalLocked(receiptHash, receipt);\\n return locked;\\n }\\n\\n _recordWithdrawal(tokenAddr, quantity);\\n receipt.info.handleAssetOut(payable(receipt.mainchain.addr), tokenAddr, wrappedNativeToken);\\n emit Withdrew(receiptHash, receipt);\\n }\\n\\n /**\\n * @dev Requests deposit made by `_requester` address.\\n *\\n * Requirements:\\n * - The token info is valid.\\n * - The `msg.value` is 0 while depositing ERC20 token.\\n * - The `msg.value` is equal to deposit quantity while depositing native token.\\n *\\n * Emits the `DepositRequested` event.\\n *\\n */\\n function _requestDepositFor(Transfer.Request memory _request, address _requester) internal virtual {\\n MappedToken memory _token;\\n address _roninWeth = address(wrappedNativeToken);\\n\\n _request.info.validate();\\n if (_request.tokenAddr == address(0)) {\\n if (_request.info.quantity != msg.value) revert ErrInvalidRequest();\\n\\n _token = getRoninToken(_roninWeth);\\n if (_token.erc != _request.info.erc) revert ErrInvalidTokenStandard();\\n\\n _request.tokenAddr = _roninWeth;\\n } else {\\n if (msg.value != 0) revert ErrInvalidRequest();\\n\\n _token = getRoninToken(_request.tokenAddr);\\n if (_token.erc != _request.info.erc) revert ErrInvalidTokenStandard();\\n\\n _request.info.handleAssetIn(_requester, _request.tokenAddr);\\n // Withdraw if token is WETH\\n // The withdraw of WETH must go via `WethUnwrapper`, because `WETH.withdraw` only sends 2300 gas, which is insufficient when recipient is a proxy.\\n if (_roninWeth == _request.tokenAddr) {\\n wrappedNativeToken.approve(address(wethUnwrapper), _request.info.quantity);\\n wethUnwrapper.unwrap(_request.info.quantity);\\n }\\n }\\n\\n uint256 _depositId = depositCount++;\\n Transfer.Receipt memory _receipt = _request.into_deposit_receipt(_requester, _depositId, _token.tokenAddr, roninChainId);\\n\\n emit DepositRequested(_receipt.hash(), _receipt);\\n }\\n\\n /**\\n * @dev Returns the minimum vote weight for the token.\\n */\\n function _computeMinVoteWeight(TokenStandard _erc, address _token, uint256 _quantity) internal virtual returns (uint256 _weight, bool _locked) {\\n uint256 _totalWeight = _getTotalWeight();\\n _weight = _minimumVoteWeight(_totalWeight);\\n if (_erc == TokenStandard.ERC20) {\\n if (highTierThreshold[_token] <= _quantity) {\\n _weight = _highTierVoteWeight(_totalWeight);\\n }\\n _locked = _lockedWithdrawalRequest(_token, _quantity);\\n }\\n }\\n\\n /**\\n * @dev Update domain seperator.\\n */\\n function _updateDomainSeparator() internal {\\n /*\\n * _domainSeparator = keccak256(\\n * abi.encode(\\n * keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"),\\n * keccak256(\\\"MainchainGatewayV2\\\"),\\n * keccak256(\\\"2\\\"),\\n * block.chainid,\\n * address(this)\\n * )\\n * );\\n */\\n assembly {\\n let ptr := mload(0x40)\\n // keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\")\\n mstore(ptr, 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f)\\n // keccak256(\\\"MainchainGatewayV2\\\")\\n mstore(add(ptr, 0x20), 0x159f52c1e3a2b6a6aad3950adf713516211484e0516dad685ea662a094b7c43b)\\n // keccak256(\\\"2\\\")\\n mstore(add(ptr, 0x40), 0xad7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5)\\n mstore(add(ptr, 0x60), chainid())\\n mstore(add(ptr, 0x80), address())\\n sstore(_domainSeparator.slot, keccak256(ptr, 0xa0))\\n }\\n }\\n\\n /**\\n * @dev Sets the WETH contract.\\n *\\n * Emits the `WrappedNativeTokenContractUpdated` event.\\n *\\n */\\n function _setWrappedNativeTokenContract(IWETH _wrapedToken) internal {\\n wrappedNativeToken = _wrapedToken;\\n emit WrappedNativeTokenContractUpdated(_wrapedToken);\\n }\\n\\n /**\\n * @dev Receives ETH from WETH or creates deposit request if sender is not WETH or WETHUnwrapper.\\n */\\n function _fallback() internal virtual {\\n if (msg.sender == address(wrappedNativeToken) || msg.sender == address(wethUnwrapper)) {\\n return;\\n }\\n\\n _createDepositOnFallback();\\n }\\n\\n /**\\n * @dev Creates deposit request.\\n */\\n function _createDepositOnFallback() internal virtual whenNotPaused {\\n Transfer.Request memory _request;\\n _request.recipientAddr = msg.sender;\\n _request.info.quantity = msg.value;\\n _requestDepositFor(_request, _request.recipientAddr);\\n }\\n\\n /**\\n * @inheritdoc GatewayV3\\n */\\n function _getTotalWeight() internal view override returns (uint256) {\\n return _totalOperatorWeight;\\n }\\n\\n /**\\n * @dev Returns the weight of an address.\\n */\\n function _getWeight(address addr) internal view returns (uint256) {\\n return _operatorWeight[addr];\\n }\\n\\n ///////////////////////////////////////////////\\n // CALLBACKS\\n ///////////////////////////////////////////////\\n\\n /**\\n * @inheritdoc IBridgeManagerCallback\\n */\\n function onBridgeOperatorsAdded(\\n address[] calldata operators,\\n uint96[] calldata weights,\\n bool[] memory addeds\\n ) external onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) {\\n uint256 length = operators.length;\\n if (length != addeds.length || length != weights.length) revert ErrLengthMismatch(msg.sig);\\n if (length == 0) {\\n return IBridgeManagerCallback.onBridgeOperatorsAdded.selector;\\n }\\n\\n for (uint256 i; i < length; ++i) {\\n unchecked {\\n if (addeds[i]) {\\n _totalOperatorWeight += weights[i];\\n _operatorWeight[operators[i]] = weights[i];\\n }\\n }\\n }\\n\\n return IBridgeManagerCallback.onBridgeOperatorsAdded.selector;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallback\\n */\\n function onBridgeOperatorsRemoved(address[] calldata operators, bool[] calldata removeds) external onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) {\\n uint length = operators.length;\\n if (length != removeds.length) revert ErrLengthMismatch(msg.sig);\\n if (length == 0) {\\n return IBridgeManagerCallback.onBridgeOperatorsRemoved.selector;\\n }\\n\\n uint96 totalRemovingWeight;\\n for (uint i; i < length; ++i) {\\n unchecked {\\n if (removeds[i]) {\\n totalRemovingWeight += _operatorWeight[operators[i]];\\n delete _operatorWeight[operators[i]];\\n }\\n }\\n }\\n\\n _totalOperatorWeight -= totalRemovingWeight;\\n\\n return IBridgeManagerCallback.onBridgeOperatorsRemoved.selector;\\n }\\n\\n function supportsInterface(bytes4 interfaceId) public view override(AccessControlEnumerable, IERC165, ERC1155Receiver) returns (bool) {\\n return interfaceId == type(IMainchainGatewayV3).interfaceId || interfaceId == type(IBridgeManagerCallback).interfaceId || super.supportsInterface(interfaceId);\\n }\\n}\\n\",\"keccak256\":\"0xec96f442086b449ebfd100c3bee1c866e816fea34a443a4b43a0dd7b85751595\",\"license\":\"MIT\"},\"src/utils/CommonErrors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ContractType } from \\\"./ContractType.sol\\\";\\nimport { RoleAccess } from \\\"./RoleAccess.sol\\\";\\n\\nerror ErrSyncTooFarPeriod(uint256 period, uint256 latestRewardedPeriod);\\n/**\\n * @dev Error thrown when an address is expected to be an already created externally owned account (EOA).\\n * This error indicates that the provided address is invalid for certain contract operations that require already created EOA.\\n */\\nerror ErrAddressIsNotCreatedEOA(address addr, bytes32 codehash);\\n/**\\n * @dev Error raised when a bridge operator update operation fails.\\n * @param bridgeOperator The address of the bridge operator that failed to update.\\n */\\nerror ErrBridgeOperatorUpdateFailed(address bridgeOperator);\\n/**\\n * @dev Error thrown when attempting to add a bridge operator that already exists in the contract.\\n * This error indicates that the provided bridge operator address is already registered as a bridge operator in the contract.\\n */\\nerror ErrBridgeOperatorAlreadyExisted(address bridgeOperator);\\n/**\\n * @dev The error indicating an unsupported interface.\\n * @param interfaceId The bytes4 interface identifier that is not supported.\\n * @param addr The address where the unsupported interface was encountered.\\n */\\nerror ErrUnsupportedInterface(bytes4 interfaceId, address addr);\\n/**\\n * @dev Error thrown when the return data from a callback function is invalid.\\n * @param callbackFnSig The signature of the callback function that returned invalid data.\\n * @param register The address of the register where the callback function was invoked.\\n * @param returnData The invalid return data received from the callback function.\\n */\\nerror ErrInvalidReturnData(bytes4 callbackFnSig, address register, bytes returnData);\\n/**\\n * @dev Error of set to non-contract.\\n */\\nerror ErrZeroCodeContract(address addr);\\n/**\\n * @dev Error indicating that arguments are invalid.\\n */\\nerror ErrInvalidArguments(bytes4 msgSig);\\n/**\\n * @dev Error indicating that given address is null when it should not.\\n */\\nerror ErrZeroAddress(bytes4 msgSig);\\n/**\\n * @dev Error indicating that the provided threshold is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that the invalid threshold applies to.\\n */\\nerror ErrInvalidThreshold(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a function can only be called by the contract itself.\\n * @param msgSig The function signature (bytes4) that can only be called by the contract itself.\\n */\\nerror ErrOnlySelfCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n * @param expectedRole The role required to perform the function.\\n */\\nerror ErrUnauthorized(bytes4 msgSig, RoleAccess expectedRole);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n */\\nerror ErrUnauthorizedCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4).\\n * @param expectedContractType The contract type required to perform the function.\\n * @param actual The actual address that called to the function.\\n */\\nerror ErrUnexpectedInternalCall(bytes4 msgSig, ContractType expectedContractType, address actual);\\n\\n/**\\n * @dev Error indicating that an array is empty when it should contain elements.\\n */\\nerror ErrEmptyArray();\\n\\n/**\\n * @dev Error indicating a mismatch in the length of input parameters or arrays for a specific function.\\n * @param msgSig The function signature (bytes4) that has a length mismatch.\\n */\\nerror ErrLengthMismatch(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a proxy call to an external contract has failed.\\n * @param msgSig The function signature (bytes4) of the proxy call that failed.\\n * @param extCallSig The function signature (bytes4) of the external contract call that failed.\\n */\\nerror ErrProxyCallFailed(bytes4 msgSig, bytes4 extCallSig);\\n\\n/**\\n * @dev Error indicating that a function tried to call a precompiled contract that is not allowed.\\n * @param msgSig The function signature (bytes4) that attempted to call a precompiled contract.\\n */\\nerror ErrCallPrecompiled(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a native token transfer has failed.\\n * @param msgSig The function signature (bytes4) of the token transfer that failed.\\n */\\nerror ErrNativeTransferFailed(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that an order is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid order.\\n */\\nerror ErrInvalidOrder(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the chain ID is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid chain ID.\\n * @param actual Current chain ID that executing function.\\n * @param expected Expected chain ID required for the tx to success.\\n */\\nerror ErrInvalidChainId(bytes4 msgSig, uint256 actual, uint256 expected);\\n\\n/**\\n * @dev Error indicating that a vote type is not supported.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an unsupported vote type.\\n */\\nerror ErrUnsupportedVoteType(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the proposal nonce is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid proposal nonce.\\n */\\nerror ErrInvalidProposalNonce(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a voter has already voted.\\n * @param voter The address of the voter who has already voted.\\n */\\nerror ErrAlreadyVoted(address voter);\\n\\n/**\\n * @dev Error indicating that a signature is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid signature.\\n */\\nerror ErrInvalidSignatures(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a relay call has failed.\\n * @param msgSig The function signature (bytes4) of the relay call that failed.\\n */\\nerror ErrRelayFailed(bytes4 msgSig);\\n/**\\n * @dev Error indicating that a vote weight is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid vote weight.\\n */\\nerror ErrInvalidVoteWeight(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a query was made for an outdated bridge operator set.\\n */\\nerror ErrQueryForOutdatedBridgeOperatorSet();\\n\\n/**\\n * @dev Error indicating that a request is invalid.\\n */\\nerror ErrInvalidRequest();\\n\\n/**\\n * @dev Error indicating that a token standard is invalid.\\n */\\nerror ErrInvalidTokenStandard();\\n\\n/**\\n * @dev Error indicating that a token is not supported.\\n */\\nerror ErrUnsupportedToken();\\n\\n/**\\n * @dev Error indicating that a receipt kind is invalid.\\n */\\nerror ErrInvalidReceiptKind();\\n\\n/**\\n * @dev Error indicating that a receipt is invalid.\\n */\\nerror ErrInvalidReceipt();\\n\\n/**\\n * @dev Error indicating that an address is not payable.\\n */\\nerror ErrNonpayableAddress(address);\\n\\n/**\\n * @dev Error indicating that the period is already processed, i.e. scattered reward.\\n */\\nerror ErrPeriodAlreadyProcessed(uint256 requestingPeriod, uint256 latestPeriod);\\n\\n/**\\n * @dev Error thrown when an invalid vote hash is provided.\\n */\\nerror ErrInvalidVoteHash();\\n\\n/**\\n * @dev Error thrown when querying for an empty vote.\\n */\\nerror ErrQueryForEmptyVote();\\n\\n/**\\n * @dev Error thrown when querying for an expired vote.\\n */\\nerror ErrQueryForExpiredVote();\\n\\n/**\\n * @dev Error thrown when querying for a non-existent vote.\\n */\\nerror ErrQueryForNonExistentVote();\\n\\n/**\\n * @dev Error indicating that the method is only called once per block.\\n */\\nerror ErrOncePerBlock();\\n\\n/**\\n * @dev Error of method caller must be coinbase\\n */\\nerror ErrCallerMustBeCoinbase();\\n\\n/**\\n * @dev Error thrown when an invalid proposal is encountered.\\n * @param actual The actual value of the proposal.\\n * @param expected The expected value of the proposal.\\n */\\nerror ErrInvalidProposal(bytes32 actual, bytes32 expected);\\n\\n/**\\n * @dev Error of proposal is not approved for executing.\\n */\\nerror ErrProposalNotApproved();\\n\\n/**\\n * @dev Error of the caller is not the specified executor.\\n */\\nerror ErrInvalidExecutor();\\n\\n/**\\n * @dev Error of the `caller` to relay is not the specified `executor`.\\n */\\nerror ErrNonExecutorCannotRelay(address executor, address caller);\\n\",\"keccak256\":\"0x0d9e2fd98f6b704273faad707ed9eadbd4c79551ee3f902bff5b29213a204679\",\"license\":\"MIT\"},\"src/utils/ContractType.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum ContractType {\\n UNKNOWN, // 0\\n PAUSE_ENFORCER, // 1\\n BRIDGE, // 2\\n BRIDGE_TRACKING, // 3\\n GOVERNANCE_ADMIN, // 4\\n MAINTENANCE, // 5\\n SLASH_INDICATOR, // 6\\n STAKING_VESTING, // 7\\n VALIDATOR, // 8\\n STAKING, // 9\\n RONIN_TRUSTED_ORGANIZATION, // 10\\n BRIDGE_MANAGER, // 11\\n BRIDGE_SLASH, // 12\\n BRIDGE_REWARD, // 13\\n FAST_FINALITY_TRACKING, // 14\\n PROFILE // 15\\n\\n}\\n\",\"keccak256\":\"0xec088aa939cd885dbe84e944942d7ea674e1fff8802c1f2ae5d8e84e4578357d\",\"license\":\"MIT\"},\"src/utils/IdentityGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { AddressArrayUtils } from \\\"../libraries/AddressArrayUtils.sol\\\";\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport { TransparentUpgradeableProxyV2 } from \\\"../extensions/TransparentUpgradeableProxyV2.sol\\\";\\nimport { ErrAddressIsNotCreatedEOA, ErrZeroAddress, ErrOnlySelfCall, ErrZeroCodeContract, ErrUnsupportedInterface } from \\\"./CommonErrors.sol\\\";\\n\\nabstract contract IdentityGuard {\\n using AddressArrayUtils for address[];\\n\\n /// @dev value is equal to keccak256(abi.encode())\\n /// @dev see: https://eips.ethereum.org/EIPS/eip-1052\\n bytes32 internal constant CREATED_ACCOUNT_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\\n\\n /**\\n * @dev Modifier to restrict functions to only be called by this contract.\\n * @dev Reverts if the caller is not this contract.\\n */\\n modifier onlySelfCall() virtual {\\n _requireSelfCall();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to ensure that the elements in the `arr` array are non-duplicates.\\n * It calls the internal `_checkDuplicate` function to perform the duplicate check.\\n *\\n * Requirements:\\n * - The elements in the `arr` array must not contain any duplicates.\\n */\\n modifier nonDuplicate(address[] memory arr) virtual {\\n _requireNonDuplicate(arr);\\n _;\\n }\\n\\n /**\\n * @dev Internal method to check the method caller.\\n * @dev Reverts if the method caller is not this contract.\\n */\\n function _requireSelfCall() internal view virtual {\\n if (msg.sender != address(this)) revert ErrOnlySelfCall(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to check if a contract address has code.\\n * @param addr The address of the contract to check.\\n * @dev Throws an error if the contract address has no code.\\n */\\n function _requireHasCode(address addr) internal view {\\n if (addr.code.length == 0) revert ErrZeroCodeContract(addr);\\n }\\n\\n /**\\n * @dev Checks if an address is zero and reverts if it is.\\n * @param addr The address to check.\\n */\\n function _requireNonZeroAddress(address addr) internal pure {\\n if (addr == address(0)) revert ErrZeroAddress(msg.sig);\\n }\\n\\n /**\\n * @dev Check if arr is empty and revert if it is.\\n * Checks if an array contains any duplicate addresses and reverts if duplicates are found.\\n * @param arr The array of addresses to check.\\n */\\n function _requireNonDuplicate(address[] memory arr) internal pure {\\n if (arr.hasDuplicate()) revert AddressArrayUtils.ErrDuplicated(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to require that the provided address is a created externally owned account (EOA).\\n * This internal function is used to ensure that the provided address is a valid externally owned account (EOA).\\n * It checks the codehash of the address against a predefined constant to confirm that the address is a created EOA.\\n * @notice This method only works with non-state EOA accounts\\n */\\n function _requireCreatedEOA(address addr) internal view {\\n _requireNonZeroAddress(addr);\\n bytes32 codehash = addr.codehash;\\n if (codehash != CREATED_ACCOUNT_HASH) revert ErrAddressIsNotCreatedEOA(addr, codehash);\\n }\\n\\n /**\\n * @dev Internal function to require that the specified contract supports the given interface. This method handle in\\n * both case that the callee is either or not the proxy admin of the caller. If the contract does not support the\\n * interface `interfaceId` or EIP165, a revert with the corresponding error message is triggered.\\n *\\n * @param contractAddr The address of the contract to check for interface support.\\n * @param interfaceId The interface ID to check for support.\\n */\\n function _requireSupportsInterface(address contractAddr, bytes4 interfaceId) internal view {\\n bytes memory supportsInterfaceParams = abi.encodeCall(IERC165.supportsInterface, (interfaceId));\\n (bool success, bytes memory returnOrRevertData) = contractAddr.staticcall(supportsInterfaceParams);\\n if (!success) {\\n (success, returnOrRevertData) = contractAddr.staticcall(abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (supportsInterfaceParams)));\\n if (!success) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n if (!abi.decode(returnOrRevertData, (bool))) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n}\\n\",\"keccak256\":\"0x546ab4c9cdb0e7f8e650f140349225305ba1d0706dcaceeb9180c96aa765da59\",\"license\":\"MIT\"},\"src/utils/RoleAccess.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum RoleAccess {\\n UNKNOWN, // 0\\n ADMIN, // 1\\n COINBASE, // 2\\n GOVERNOR, // 3\\n CANDIDATE_ADMIN, // 4\\n WITHDRAWAL_MIGRATOR, // 5\\n __DEPRECATED_BRIDGE_OPERATOR, // 6\\n BLOCK_PRODUCER, // 7\\n VALIDATOR_CANDIDATE, // 8\\n CONSENSUS, // 9\\n TREASURY // 10\\n\\n}\\n\",\"keccak256\":\"0x671ff40dd874c508c4b3879a580996c7987fc018669256f47151e420a55c0e51\",\"license\":\"MIT\"}},\"version\":1}", - "nonce": 28, - "numDeployments": 2, + "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"ErrContractTypeNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrERC1155MintingFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrERC20MintingFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrERC721MintingFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrEmptyArray\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"}],\"name\":\"ErrInvalidChainId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidInfo\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidOrder\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidPercentage\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidReceipt\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidReceiptKind\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidRequest\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrInvalidThreshold\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidTokenStandard\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"}],\"name\":\"ErrLengthMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrQueryForApprovedWithdrawal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrQueryForInsufficientVoteWeight\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrQueryForProcessedWithdrawal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrReachedDailyWithdrawalLimit\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"tokenInfo\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"ErrTokenCouldNotTransfer\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"tokenInfo\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"ErrTokenCouldNotTransferFrom\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum RoleAccess\",\"name\":\"expectedRole\",\"type\":\"uint8\"}],\"name\":\"ErrUnauthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"msgSig\",\"type\":\"bytes4\"},{\"internalType\":\"enum ContractType\",\"name\":\"expectedContractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"actual\",\"type\":\"address\"}],\"name\":\"ErrUnexpectedInternalCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrUnsupportedStandard\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrUnsupportedToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ErrZeroCodeContract\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ContractUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"limits\",\"type\":\"uint256[]\"}],\"name\":\"DailyWithdrawalLimitsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"receiptHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"struct Transfer.Receipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"DepositRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"thresholds\",\"type\":\"uint256[]\"}],\"name\":\"HighTierThresholdsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"numerator\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"denominator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousNumerator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousDenominator\",\"type\":\"uint256\"}],\"name\":\"HighTierVoteWeightThresholdUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"thresholds\",\"type\":\"uint256[]\"}],\"name\":\"LockedThresholdsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"numerator\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"denominator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousNumerator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousDenominator\",\"type\":\"uint256\"}],\"name\":\"ThresholdUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"mainchainTokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"roninTokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"enum TokenStandard[]\",\"name\":\"standards\",\"type\":\"uint8[]\"}],\"name\":\"TokenMapped\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"percentages\",\"type\":\"uint256[]\"}],\"name\":\"UnlockFeePercentagesUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"receiptHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"struct Transfer.Receipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"WithdrawalLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"receiptHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"struct Transfer.Receipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"WithdrawalUnlocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"receiptHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"struct Transfer.Receipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"Withdrew\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IWETH\",\"name\":\"weth\",\"type\":\"address\"}],\"name\":\"WrappedNativeTokenContractUpdated\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WITHDRAWAL_UNLOCKER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_MAX_PERCENTAGE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_voteWeight\",\"type\":\"uint256\"}],\"name\":\"checkHighTierVoteWeightThreshold\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_voteWeight\",\"type\":\"uint256\"}],\"name\":\"checkThreshold\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"dailyWithdrawalLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"emergencyPauser\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"}],\"name\":\"getContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"contract_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getHighTierVoteWeightThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getRoleMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleMemberCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"mainchainToken\",\"type\":\"address\"}],\"name\":\"getRoninToken\",\"outputs\":[{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"}],\"internalType\":\"struct MappedTokenConsumer.MappedToken\",\"name\":\"token\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"num_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"highTierThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_roleSetter\",\"type\":\"address\"},{\"internalType\":\"contract IWETH\",\"name\":\"_wrappedToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_roninChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_numerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_highTierVWNumerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_denominator\",\"type\":\"uint256\"},{\"internalType\":\"address[][3]\",\"name\":\"_addresses\",\"type\":\"address[][3]\"},{\"internalType\":\"uint256[][4]\",\"name\":\"_thresholds\",\"type\":\"uint256[][4]\"},{\"internalType\":\"enum TokenStandard[]\",\"name\":\"_standards\",\"type\":\"uint8[]\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeManagerContract\",\"type\":\"address\"}],\"name\":\"initializeV2\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initializeV3\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"wethUnwrapper_\",\"type\":\"address\"}],\"name\":\"initializeV4\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"lastDateSynced\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"lastSyncedWithdrawal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"lockedThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_mainchainTokens\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"_roninTokens\",\"type\":\"address[]\"},{\"internalType\":\"enum TokenStandard[]\",\"name\":\"_standards\",\"type\":\"uint8[]\"}],\"name\":\"mapTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_mainchainTokens\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"_roninTokens\",\"type\":\"address[]\"},{\"internalType\":\"enum TokenStandard[]\",\"name\":\"_standards\",\"type\":\"uint8[]\"},{\"internalType\":\"uint256[][4]\",\"name\":\"_thresholds\",\"type\":\"uint256[][4]\"}],\"name\":\"mapTokensAndThresholds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minimumVoteWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"operators\",\"type\":\"address[]\"},{\"internalType\":\"uint96[]\",\"name\":\"weights\",\"type\":\"uint96[]\"},{\"internalType\":\"bool[]\",\"name\":\"addeds\",\"type\":\"bool[]\"}],\"name\":\"onBridgeOperatorsAdded\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"operators\",\"type\":\"address[]\"},{\"internalType\":\"bool[]\",\"name\":\"removeds\",\"type\":\"bool[]\"}],\"name\":\"onBridgeOperatorsRemoved\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155BatchReceived\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_quantity\",\"type\":\"uint256\"}],\"name\":\"reachedWithdrawalLimit\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"receiveEther\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipientAddr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"internalType\":\"struct Transfer.Request\",\"name\":\"_request\",\"type\":\"tuple\"}],\"name\":\"requestDepositFor\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"roninChainId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ContractType\",\"name\":\"contractType\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_tokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_limits\",\"type\":\"uint256[]\"}],\"name\":\"setDailyWithdrawalLimits\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"setEmergencyPauser\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_tokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_thresholds\",\"type\":\"uint256[]\"}],\"name\":\"setHighTierThresholds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_numerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_denominator\",\"type\":\"uint256\"}],\"name\":\"setHighTierVoteWeightThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_previousNum\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_previousDenom\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_tokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_thresholds\",\"type\":\"uint256[]\"}],\"name\":\"setLockedThresholds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denom\",\"type\":\"uint256\"}],\"name\":\"setThreshold\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_tokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_percentages\",\"type\":\"uint256[]\"}],\"name\":\"setUnlockFeePercentages\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IWETH\",\"name\":\"_wrappedToken\",\"type\":\"address\"}],\"name\":\"setWrappedNativeTokenContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"internalType\":\"struct Transfer.Receipt\",\"name\":\"_receipt\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"struct SignatureConsumer.Signature[]\",\"name\":\"_signatures\",\"type\":\"tuple[]\"}],\"name\":\"submitWithdrawal\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"_locked\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"unlockFeePercentages\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"enum Transfer.Kind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"mainchain\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenOwner\",\"name\":\"ronin\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum TokenStandard\",\"name\":\"erc\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"internalType\":\"struct Transfer.Receipt\",\"name\":\"receipt\",\"type\":\"tuple\"}],\"name\":\"unlockWithdrawal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"wethUnwrapper\",\"outputs\":[{\"internalType\":\"contract WethUnwrapper\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"withdrawalHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"withdrawalLocked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"wrappedNativeToken\",\"outputs\":[{\"internalType\":\"contract IWETH\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"errors\":{\"ErrContractTypeNotFound(uint8)\":[{\"details\":\"Error of invalid role.\"}],\"ErrERC1155MintingFailed()\":[{\"details\":\"Error indicating that the mint of ERC1155 tokens has failed.\"}],\"ErrERC20MintingFailed()\":[{\"details\":\"Error indicating that the minting of ERC20 tokens has failed.\"}],\"ErrERC721MintingFailed()\":[{\"details\":\"Error indicating that the minting of ERC721 tokens has failed.\"}],\"ErrEmptyArray()\":[{\"details\":\"Error indicating that an array is empty when it should contain elements.\"}],\"ErrInvalidChainId(bytes4,uint256,uint256)\":[{\"details\":\"Error indicating that the chain ID is invalid.\",\"params\":{\"actual\":\"Current chain ID that executing function.\",\"expected\":\"Expected chain ID required for the tx to success.\",\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid chain ID.\"}}],\"ErrInvalidInfo()\":[{\"details\":\"Error indicating that the provided information is invalid.\"}],\"ErrInvalidOrder(bytes4)\":[{\"details\":\"Error indicating that an order is invalid.\",\"params\":{\"msgSig\":\"The function signature (bytes4) of the operation that encountered an invalid order.\"}}],\"ErrInvalidPercentage()\":[{\"details\":\"Error of invalid percentage.\"}],\"ErrInvalidReceipt()\":[{\"details\":\"Error indicating that a receipt is invalid.\"}],\"ErrInvalidReceiptKind()\":[{\"details\":\"Error indicating that a receipt kind is invalid.\"}],\"ErrInvalidRequest()\":[{\"details\":\"Error indicating that a request is invalid.\"}],\"ErrInvalidThreshold(bytes4)\":[{\"details\":\"Error indicating that the provided threshold is invalid for a specific function signature.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that the invalid threshold applies to.\"}}],\"ErrInvalidTokenStandard()\":[{\"details\":\"Error indicating that a token standard is invalid.\"}],\"ErrLengthMismatch(bytes4)\":[{\"details\":\"Error indicating a mismatch in the length of input parameters or arrays for a specific function.\",\"params\":{\"msgSig\":\"The function signature (bytes4) that has a length mismatch.\"}}],\"ErrQueryForApprovedWithdrawal()\":[{\"details\":\"Error indicating that a query was made for an approved withdrawal.\"}],\"ErrQueryForInsufficientVoteWeight()\":[{\"details\":\"Error indicating that a query was made for insufficient vote weight.\"}],\"ErrQueryForProcessedWithdrawal()\":[{\"details\":\"Error indicating that a query was made for a processed withdrawal.\"}],\"ErrReachedDailyWithdrawalLimit()\":[{\"details\":\"Error indicating that the daily withdrawal limit has been reached.\"}],\"ErrTokenCouldNotTransfer((uint8,uint256,uint256),address,address)\":[{\"details\":\"Error indicating that the `transfer` has failed.\",\"params\":{\"to\":\"Receiver of the token value.\",\"token\":\"Address of the token.\",\"tokenInfo\":\"Info of the token including ERC standard, id or quantity.\"}}],\"ErrTokenCouldNotTransferFrom((uint8,uint256,uint256),address,address,address)\":[{\"details\":\"Error indicating that the `handleAssetIn` has failed.\",\"params\":{\"from\":\"Owner of the token value.\",\"to\":\"Receiver of the token value.\",\"token\":\"Address of the token.\",\"tokenInfo\":\"Info of the token including ERC standard, id or quantity.\"}}],\"ErrUnauthorized(bytes4,uint8)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"expectedRole\":\"The role required to perform the function.\",\"msgSig\":\"The function signature (bytes4) that the caller is unauthorized to perform.\"}}],\"ErrUnexpectedInternalCall(bytes4,uint8,address)\":[{\"details\":\"Error indicating that the caller is unauthorized to perform a specific function.\",\"params\":{\"actual\":\"The actual address that called to the function.\",\"expectedContractType\":\"The contract type required to perform the function.\",\"msgSig\":\"The function signature (bytes4).\"}}],\"ErrUnsupportedStandard()\":[{\"details\":\"Error indicating that an unsupported standard is encountered.\"}],\"ErrUnsupportedToken()\":[{\"details\":\"Error indicating that a token is not supported.\"}],\"ErrZeroCodeContract(address)\":[{\"details\":\"Error of set to non-contract.\"}]},\"events\":{\"ContractUpdated(uint8,address)\":{\"details\":\"Emitted when a contract is updated.\"},\"DailyWithdrawalLimitsUpdated(address[],uint256[])\":{\"details\":\"Emitted when the daily limit thresholds are updated\"},\"DepositRequested(bytes32,(uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Emitted when the deposit is requested\"},\"HighTierThresholdsUpdated(address[],uint256[])\":{\"details\":\"Emitted when the thresholds for high-tier withdrawals that requires high-tier vote weights are updated\"},\"HighTierVoteWeightThresholdUpdated(uint256,uint256,uint256,uint256,uint256)\":{\"details\":\"Emitted when the high-tier vote weight threshold is updated\"},\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"LockedThresholdsUpdated(address[],uint256[])\":{\"details\":\"Emitted when the thresholds for locked withdrawals are updated\"},\"Paused(address)\":{\"details\":\"Emitted when the pause is triggered by `account`.\"},\"RoleAdminChanged(bytes32,bytes32,bytes32)\":{\"details\":\"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this. _Available since v3.1._\"},\"RoleGranted(bytes32,address,address)\":{\"details\":\"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.\"},\"RoleRevoked(bytes32,address,address)\":{\"details\":\"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)\"},\"ThresholdUpdated(uint256,uint256,uint256,uint256,uint256)\":{\"details\":\"Emitted when the threshold is updated\"},\"TokenMapped(address[],address[],uint8[])\":{\"details\":\"Emitted when the tokens are mapped\"},\"UnlockFeePercentagesUpdated(address[],uint256[])\":{\"details\":\"Emitted when the fee percentages to unlock withdraw are updated\"},\"Unpaused(address)\":{\"details\":\"Emitted when the pause is lifted by `account`.\"},\"WithdrawalLocked(bytes32,(uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Emitted when the withdrawal is locked\"},\"WithdrawalUnlocked(bytes32,(uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Emitted when the withdrawal is unlocked\"},\"Withdrew(bytes32,(uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Emitted when the assets are withdrawn\"},\"WrappedNativeTokenContractUpdated(address)\":{\"details\":\"Emitted when the wrapped native token contract is updated\"}},\"kind\":\"dev\",\"methods\":{\"DOMAIN_SEPARATOR()\":{\"details\":\"Returns the domain seperator.\"},\"checkHighTierVoteWeightThreshold(uint256)\":{\"details\":\"Checks whether the `_voteWeight` passes the high-tier vote weight threshold.\"},\"checkThreshold(uint256)\":{\"details\":\"Checks whether the `_voteWeight` passes the threshold.\"},\"getContract(uint8)\":{\"details\":\"Returns the address of a contract with a specific role. Throws an error if no contract is set for the specified role.\",\"params\":{\"contractType\":\"The role of the contract to retrieve.\"},\"returns\":{\"contract_\":\"The address of the contract with the specified role.\"}},\"getHighTierVoteWeightThreshold()\":{\"details\":\"Returns the high-tier vote weight threshold.\"},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"getRoleMember(bytes32,uint256)\":{\"details\":\"Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.\"},\"getRoleMemberCount(bytes32)\":{\"details\":\"Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.\"},\"getRoninToken(address)\":{\"details\":\"Returns token address on Ronin network. Note: Reverts for unsupported token.\"},\"getThreshold()\":{\"details\":\"Returns the threshold.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"initialize(address,address,uint256,uint256,uint256,uint256,address[][3],uint256[][4],uint8[])\":{\"details\":\"Initializes contract storage.\"},\"mapTokens(address[],address[],uint8[])\":{\"details\":\"Maps mainchain tokens to Ronin network. Requirement: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `TokenMapped` event.\"},\"mapTokensAndThresholds(address[],address[],uint8[],uint256[][4])\":{\"details\":\"Maps mainchain tokens to Ronin network and sets thresholds. Requirement: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `TokenMapped` event.\"},\"minimumVoteWeight()\":{\"details\":\"Returns the minimum vote weight to pass the threshold.\"},\"onBridgeOperatorsAdded(address[],uint96[],bool[])\":{\"details\":\"Handles the event when bridge operators are added.\",\"params\":{\"addeds\":\"The corresponding boolean values indicating whether the operators were added or not.\",\"bridgeOperators\":\"The addresses of the bridge operators.\"},\"returns\":{\"_0\":\"The selector of the function being called.\"}},\"onBridgeOperatorsRemoved(address[],bool[])\":{\"details\":\"Handles the event when bridge operators are removed.\",\"params\":{\"bridgeOperators\":\"The addresses of the bridge operators.\",\"removeds\":\"The corresponding boolean values indicating whether the operators were removed or not.\"},\"returns\":{\"_0\":\"The selector of the function being called.\"}},\"pause()\":{\"details\":\"Triggers paused state.\"},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"reachedWithdrawalLimit(address,uint256)\":{\"details\":\"Checks whether the withdrawal reaches the limitation.\"},\"receiveEther()\":{\"details\":\"Receives ether without doing anything. Use this function to topup native token.\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`. May emit a {RoleRevoked} event.\"},\"requestDepositFor((address,address,(uint8,uint256,uint256)))\":{\"details\":\"Locks the assets and request deposit.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"setContract(uint8,address)\":{\"details\":\"Sets the address of a contract with a specific role. Emits the event {ContractUpdated}.\",\"params\":{\"addr\":\"The address of the contract to set.\",\"contractType\":\"The role of the contract to set.\"}},\"setDailyWithdrawalLimits(address[],uint256[])\":{\"details\":\"Sets daily limit amounts for the withdrawals. Requirements: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `DailyWithdrawalLimitsUpdated` event.\"},\"setEmergencyPauser(address)\":{\"details\":\"Grant emergency pauser role for `_addr`.\"},\"setHighTierThresholds(address[],uint256[])\":{\"details\":\"Sets the thresholds for high-tier withdrawals that requires high-tier vote weights. Requirements: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `HighTierThresholdsUpdated` event.\"},\"setHighTierVoteWeightThreshold(uint256,uint256)\":{\"details\":\"Sets high-tier vote weight threshold and returns the old one. Requirements: - The method caller is admin. - The high-tier vote weight threshold must equal to or larger than the normal threshold. Emits the `HighTierVoteWeightThresholdUpdated` event.\"},\"setLockedThresholds(address[],uint256[])\":{\"details\":\"Sets the amount thresholds to lock withdrawal. Requirements: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `LockedThresholdsUpdated` event.\"},\"setThreshold(uint256,uint256)\":{\"details\":\"Override `GatewayV3-setThreshold`. Requirements: - The high-tier vote weight threshold must equal to or larger than the normal threshold.\"},\"setUnlockFeePercentages(address[],uint256[])\":{\"details\":\"Sets fee percentages to unlock withdrawal. Requirements: - The method caller is admin. - The arrays have the same length and its length larger than 0. Emits the `UnlockFeePercentagesUpdated` event.\"},\"setWrappedNativeTokenContract(address)\":{\"details\":\"Sets the wrapped native token contract. Requirements: - The method caller is admin. Emits the `WrappedNativeTokenContractUpdated` event.\"},\"submitWithdrawal((uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)),(uint8,bytes32,bytes32)[])\":{\"details\":\"Withdraws based on the receipt and the validator signatures. Returns whether the withdrawal is locked. Emits the `Withdrew` once the assets are released.\"},\"unlockWithdrawal((uint256,uint8,(address,address,uint256),(address,address,uint256),(uint8,uint256,uint256)))\":{\"details\":\"Approves a specific withdrawal. Requirements: - The method caller is a validator. Emits the `Withdrew` once the assets are released.\"},\"unpause()\":{\"details\":\"Triggers unpaused state.\"}},\"stateVariables\":{\"WITHDRAWAL_UNLOCKER_ROLE\":{\"details\":\"Withdrawal unlocker role hash\"},\"______deprecatedBridgeOperatorAddedBlock\":{\"custom:deprecated\":\"Previously `_bridgeOperatorAddedBlock` (mapping(address => uint256))\"},\"______deprecatedBridgeOperators\":{\"custom:deprecated\":\"Previously `_bridgeOperators` (uint256[])\"},\"_domainSeparator\":{\"details\":\"Domain separator\"},\"_roninToken\":{\"details\":\"Mapping from mainchain token => token address on Ronin network\"},\"depositCount\":{\"details\":\"Total deposit\"},\"roninChainId\":{\"details\":\"Ronin network id\"},\"withdrawalHash\":{\"details\":\"Mapping from withdrawal id => withdrawal hash\"},\"withdrawalLocked\":{\"details\":\"Mapping from withdrawal id => locked\"},\"wrappedNativeToken\":{\"details\":\"Wrapped native token address\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"unlockFeePercentages(address)\":{\"notice\":\"Values 0-1,000,000 map to 0%-100%\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/mainchain/MainchainGatewayV3.sol\":\"MainchainGatewayV3\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@fdk/=lib/foundry-deployment-kit/script/\",\":@openzeppelin/=lib/openzeppelin-contracts/\",\":@prb/math/=lib/prb-math/\",\":@prb/test/=lib/prb-test/src/\",\":@ronin/contracts/=src/\",\":@ronin/script/=script/\",\":@ronin/test/=test/\",\":contract-libs/=lib/foundry-deployment-kit/lib/contract-libs/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/foundry-deployment-kit/lib/forge-std/src/\",\":foundry-deployment-kit/=lib/foundry-deployment-kit/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/contracts/\",\":prb-math/=lib/prb-math/src/\",\":prb-test/=lib/prb-test/src/\",\":sample-projects/=node_modules/hardhat/sample-projects/\",\":solady/=lib/solady/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/access/AccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\nimport \\\"../utils/Context.sol\\\";\\nimport \\\"../utils/Strings.sol\\\";\\nimport \\\"../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it.\\n */\\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\\n struct RoleData {\\n mapping(address => bool) members;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with a standardized message including the required role.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n *\\n * _Available since v4.1._\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role);\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\\n return _roles[role].members[account];\\n }\\n\\n /**\\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\\n * Overriding this function changes the behavior of the {onlyRole} modifier.\\n *\\n * Format of the revert message is described in {_checkRole}.\\n *\\n * _Available since v4.6._\\n */\\n function _checkRole(bytes32 role) internal view virtual {\\n _checkRole(role, _msgSender());\\n }\\n\\n /**\\n * @dev Revert with a standard message if `account` is missing `role`.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert(\\n string(\\n abi.encodePacked(\\n \\\"AccessControl: account \\\",\\n Strings.toHexString(uint160(account), 20),\\n \\\" is missing role \\\",\\n Strings.toHexString(uint256(role), 32)\\n )\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function renounceRole(bytes32 role, address account) public virtual override {\\n require(account == _msgSender(), \\\"AccessControl: can only renounce roles for self\\\");\\n\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event. Note that unlike {grantRole}, this function doesn't perform any\\n * checks on the calling account.\\n *\\n * May emit a {RoleGranted} event.\\n *\\n * [WARNING]\\n * ====\\n * This function should only be called from the constructor when setting\\n * up the initial roles for the system.\\n *\\n * Using this function in any other way is effectively circumventing the admin\\n * system imposed by {AccessControl}.\\n * ====\\n *\\n * NOTE: This function is deprecated in favor of {_grantRole}.\\n */\\n function _setupRole(bytes32 role, address account) internal virtual {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual {\\n if (!hasRole(role, account)) {\\n _roles[role].members[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n }\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual {\\n if (hasRole(role, account)) {\\n _roles[role].members[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5b35d8e68aeaccc685239bd9dd79b9ba01a0357930f8a3307ab85511733d9724\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/access/AccessControlEnumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlEnumerable.sol\\\";\\nimport \\\"./AccessControl.sol\\\";\\nimport \\\"../utils/structs/EnumerableSet.sol\\\";\\n\\n/**\\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\\n */\\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {\\n return _roleMembers[role].at(index);\\n }\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {\\n return _roleMembers[role].length();\\n }\\n\\n /**\\n * @dev Overload {_grantRole} to track enumerable memberships\\n */\\n function _grantRole(bytes32 role, address account) internal virtual override {\\n super._grantRole(role, account);\\n _roleMembers[role].add(account);\\n }\\n\\n /**\\n * @dev Overload {_revokeRole} to track enumerable memberships\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual override {\\n super._revokeRole(role, account);\\n _roleMembers[role].remove(account);\\n }\\n}\\n\",\"keccak256\":\"0x13f5e15f2a0650c0b6aaee2ef19e89eaf4870d6e79662d572a393334c1397247\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/access/IAccessControlEnumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\n\\n/**\\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\\n */\\ninterface IAccessControlEnumerable is IAccessControl {\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xba4459ab871dfa300f5212c6c30178b63898c03533a1ede28436f11546626676\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0xa6a787e7a901af6511e19aa53e1a00352db215a011d2c7a438d0582dd5da76f9\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2a21b14ff90012878752f230d3ffd5c3405e5938d06c97a7d89c0a64561d0d66\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/security/Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract Pausable is Context {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n constructor() {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n _requireNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n _requirePaused();\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Throws if the contract is paused.\\n */\\n function _requireNotPaused() internal view virtual {\\n require(!paused(), \\\"Pausable: paused\\\");\\n }\\n\\n /**\\n * @dev Throws if the contract is not paused.\\n */\\n function _requirePaused() internal view virtual {\\n require(paused(), \\\"Pausable: not paused\\\");\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n}\\n\",\"keccak256\":\"0x0849d93b16c9940beb286a7864ed02724b248b93e0d80ef6355af5ef15c64773\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/security/ReentrancyGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuard {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n constructor() {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n // On the first call to nonReentrant, _notEntered will be true\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n}\\n\",\"keccak256\":\"0x0e9621f60b2faabe65549f7ed0f24e8853a45c1b7990d47e8160e523683f3935\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/ERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/ERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC1155.sol\\\";\\nimport \\\"./IERC1155Receiver.sol\\\";\\nimport \\\"./extensions/IERC1155MetadataURI.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\nimport \\\"../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the basic standard multi-token.\\n * See https://eips.ethereum.org/EIPS/eip-1155\\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\\n *\\n * _Available since v3.1._\\n */\\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\\n using Address for address;\\n\\n // Mapping from token ID to account balances\\n mapping(uint256 => mapping(address => uint256)) private _balances;\\n\\n // Mapping from account to operator approvals\\n mapping(address => mapping(address => bool)) private _operatorApprovals;\\n\\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\\n string private _uri;\\n\\n /**\\n * @dev See {_setURI}.\\n */\\n constructor(string memory uri_) {\\n _setURI(uri_);\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return\\n interfaceId == type(IERC1155).interfaceId ||\\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC1155MetadataURI-uri}.\\n *\\n * This implementation returns the same URI for *all* token types. It relies\\n * on the token type ID substitution mechanism\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\\n *\\n * Clients calling this function must replace the `\\\\{id\\\\}` substring with the\\n * actual token type ID.\\n */\\n function uri(uint256) public view virtual override returns (string memory) {\\n return _uri;\\n }\\n\\n /**\\n * @dev See {IERC1155-balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\\n require(account != address(0), \\\"ERC1155: address zero is not a valid owner\\\");\\n return _balances[id][account];\\n }\\n\\n /**\\n * @dev See {IERC1155-balanceOfBatch}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\\n public\\n view\\n virtual\\n override\\n returns (uint256[] memory)\\n {\\n require(accounts.length == ids.length, \\\"ERC1155: accounts and ids length mismatch\\\");\\n\\n uint256[] memory batchBalances = new uint256[](accounts.length);\\n\\n for (uint256 i = 0; i < accounts.length; ++i) {\\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\\n }\\n\\n return batchBalances;\\n }\\n\\n /**\\n * @dev See {IERC1155-setApprovalForAll}.\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual override {\\n _setApprovalForAll(_msgSender(), operator, approved);\\n }\\n\\n /**\\n * @dev See {IERC1155-isApprovedForAll}.\\n */\\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\\n return _operatorApprovals[account][operator];\\n }\\n\\n /**\\n * @dev See {IERC1155-safeTransferFrom}.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) public virtual override {\\n require(\\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\\n \\\"ERC1155: caller is not token owner nor approved\\\"\\n );\\n _safeTransferFrom(from, to, id, amount, data);\\n }\\n\\n /**\\n * @dev See {IERC1155-safeBatchTransferFrom}.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) public virtual override {\\n require(\\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\\n \\\"ERC1155: caller is not token owner nor approved\\\"\\n );\\n _safeBatchTransferFrom(from, to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function _safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: transfer to the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: insufficient balance for transfer\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n _balances[id][to] += amount;\\n\\n emit TransferSingle(operator, from, to, id, amount);\\n\\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function _safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n require(to != address(0), \\\"ERC1155: transfer to the zero address\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n for (uint256 i = 0; i < ids.length; ++i) {\\n uint256 id = ids[i];\\n uint256 amount = amounts[i];\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: insufficient balance for transfer\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n _balances[id][to] += amount;\\n }\\n\\n emit TransferBatch(operator, from, to, ids, amounts);\\n\\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Sets a new URI for all token types, by relying on the token type ID\\n * substitution mechanism\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\\n *\\n * By this mechanism, any occurrence of the `\\\\{id\\\\}` substring in either the\\n * URI or any of the amounts in the JSON file at said URI will be replaced by\\n * clients with the token type ID.\\n *\\n * For example, the `https://token-cdn-domain/\\\\{id\\\\}.json` URI would be\\n * interpreted by clients as\\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\\n * for token type ID 0x4cce0.\\n *\\n * See {uri}.\\n *\\n * Because these URIs cannot be meaningfully represented by the {URI} event,\\n * this function emits no events.\\n */\\n function _setURI(string memory newuri) internal virtual {\\n _uri = newuri;\\n }\\n\\n /**\\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function _mint(\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: mint to the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _balances[id][to] += amount;\\n emit TransferSingle(operator, address(0), to, id, amount);\\n\\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function _mintBatch(\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: mint to the zero address\\\");\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n for (uint256 i = 0; i < ids.length; i++) {\\n _balances[ids[i]][to] += amounts[i];\\n }\\n\\n emit TransferBatch(operator, address(0), to, ids, amounts);\\n\\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens of token type `id` from `from`\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `from` must have at least `amount` tokens of token type `id`.\\n */\\n function _burn(\\n address from,\\n uint256 id,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC1155: burn from the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n\\n emit TransferSingle(operator, from, address(0), id, amount);\\n\\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n */\\n function _burnBatch(\\n address from,\\n uint256[] memory ids,\\n uint256[] memory amounts\\n ) internal virtual {\\n require(from != address(0), \\\"ERC1155: burn from the zero address\\\");\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n\\n for (uint256 i = 0; i < ids.length; i++) {\\n uint256 id = ids[i];\\n uint256 amount = amounts[i];\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n }\\n\\n emit TransferBatch(operator, from, address(0), ids, amounts);\\n\\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n }\\n\\n /**\\n * @dev Approve `operator` to operate on all of `owner` tokens\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function _setApprovalForAll(\\n address owner,\\n address operator,\\n bool approved\\n ) internal virtual {\\n require(owner != operator, \\\"ERC1155: setting approval status for self\\\");\\n _operatorApprovals[owner][operator] = approved;\\n emit ApprovalForAll(owner, operator, approved);\\n }\\n\\n /**\\n * @dev Hook that is called before any token transfer. This includes minting\\n * and burning, as well as batched variants.\\n *\\n * The same hook is called on both single and batched variants. For single\\n * transfers, the length of the `ids` and `amounts` arrays will be 1.\\n *\\n * Calling conditions (for each `id` and `amount` pair):\\n *\\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * of token type `id` will be transferred to `to`.\\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\\n * for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\\n * will be burned.\\n * - `from` and `to` are never both zero.\\n * - `ids` and `amounts` have the same, non-zero length.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any token transfer. This includes minting\\n * and burning, as well as batched variants.\\n *\\n * The same hook is called on both single and batched variants. For single\\n * transfers, the length of the `id` and `amount` arrays will be 1.\\n *\\n * Calling conditions (for each `id` and `amount` pair):\\n *\\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * of token type `id` will be transferred to `to`.\\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\\n * for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\\n * will be burned.\\n * - `from` and `to` are never both zero.\\n * - `ids` and `amounts` have the same, non-zero length.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {}\\n\\n function _doSafeTransferAcceptanceCheck(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) private {\\n if (to.isContract()) {\\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\\n if (response != IERC1155Receiver.onERC1155Received.selector) {\\n revert(\\\"ERC1155: ERC1155Receiver rejected tokens\\\");\\n }\\n } catch Error(string memory reason) {\\n revert(reason);\\n } catch {\\n revert(\\\"ERC1155: transfer to non ERC1155Receiver implementer\\\");\\n }\\n }\\n }\\n\\n function _doSafeBatchTransferAcceptanceCheck(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) private {\\n if (to.isContract()) {\\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\\n bytes4 response\\n ) {\\n if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\\n revert(\\\"ERC1155: ERC1155Receiver rejected tokens\\\");\\n }\\n } catch Error(string memory reason) {\\n revert(reason);\\n } catch {\\n revert(\\\"ERC1155: transfer to non ERC1155Receiver implementer\\\");\\n }\\n }\\n }\\n\\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\\n uint256[] memory array = new uint256[](1);\\n array[0] = element;\\n\\n return array;\\n }\\n}\\n\",\"keccak256\":\"0x447a21c87433c0f11252912313a96f3454629ef88cca7a4eefbb283b3ec409f9\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155 is IERC165 {\\n /**\\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\\n */\\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\\n\\n /**\\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\\n * transfers.\\n */\\n event TransferBatch(\\n address indexed operator,\\n address indexed from,\\n address indexed to,\\n uint256[] ids,\\n uint256[] values\\n );\\n\\n /**\\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\\n * `approved`.\\n */\\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\\n\\n /**\\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\\n *\\n * If an {URI} event was emitted for `id`, the standard\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\\n * returned by {IERC1155MetadataURI-uri}.\\n */\\n event URI(string value, uint256 indexed id);\\n\\n /**\\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\\n external\\n view\\n returns (uint256[] memory);\\n\\n /**\\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\\n *\\n * Emits an {ApprovalForAll} event.\\n *\\n * Requirements:\\n *\\n * - `operator` cannot be the caller.\\n */\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n /**\\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\\n *\\n * See {setApprovalForAll}.\\n */\\n function isApprovedForAll(address account, address operator) external view returns (bool);\\n\\n /**\\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] calldata ids,\\n uint256[] calldata amounts,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x6392f2cfe3a5ee802227fe7a2dfd47096d881aec89bddd214b35c5b46d3cd941\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev _Available since v3.1._\\n */\\ninterface IERC1155Receiver is IERC165 {\\n /**\\n * @dev Handles the receipt of a single ERC1155 token type. This function is\\n * called at the end of a `safeTransferFrom` after the balance has been updated.\\n *\\n * NOTE: To accept the transfer, this must return\\n * `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))`\\n * (i.e. 0xf23a6e61, or its own function selector).\\n *\\n * @param operator The address which initiated the transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param id The ID of the token being transferred\\n * @param value The amount of tokens being transferred\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155Received(\\n address operator,\\n address from,\\n uint256 id,\\n uint256 value,\\n bytes calldata data\\n ) external returns (bytes4);\\n\\n /**\\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\\n * is called at the end of a `safeBatchTransferFrom` after the balances have\\n * been updated.\\n *\\n * NOTE: To accept the transfer(s), this must return\\n * `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))`\\n * (i.e. 0xbc197c81, or its own function selector).\\n *\\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155BatchReceived(\\n address operator,\\n address from,\\n uint256[] calldata ids,\\n uint256[] calldata values,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xeb373f1fdc7b755c6a750123a9b9e3a8a02c1470042fd6505d875000a80bde0b\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/ERC1155Burnable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/extensions/ERC1155Burnable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1155.sol\\\";\\n\\n/**\\n * @dev Extension of {ERC1155} that allows token holders to destroy both their\\n * own tokens and those that they have been approved to use.\\n *\\n * _Available since v3.1._\\n */\\nabstract contract ERC1155Burnable is ERC1155 {\\n function burn(\\n address account,\\n uint256 id,\\n uint256 value\\n ) public virtual {\\n require(\\n account == _msgSender() || isApprovedForAll(account, _msgSender()),\\n \\\"ERC1155: caller is not token owner nor approved\\\"\\n );\\n\\n _burn(account, id, value);\\n }\\n\\n function burnBatch(\\n address account,\\n uint256[] memory ids,\\n uint256[] memory values\\n ) public virtual {\\n require(\\n account == _msgSender() || isApprovedForAll(account, _msgSender()),\\n \\\"ERC1155: caller is not token owner nor approved\\\"\\n );\\n\\n _burnBatch(account, ids, values);\\n }\\n}\\n\",\"keccak256\":\"0xb11d1ade7146ac3da122e1f387ea82b0bd385d50823946c3f967dbffef3e9f4f\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/ERC1155Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1155.sol\\\";\\nimport \\\"../../../security/Pausable.sol\\\";\\n\\n/**\\n * @dev ERC1155 token with pausable token transfers, minting and burning.\\n *\\n * Useful for scenarios such as preventing trades until the end of an evaluation\\n * period, or having an emergency switch for freezing all token transfers in the\\n * event of a large bug.\\n *\\n * _Available since v3.1._\\n */\\nabstract contract ERC1155Pausable is ERC1155, Pausable {\\n /**\\n * @dev See {ERC1155-_beforeTokenTransfer}.\\n *\\n * Requirements:\\n *\\n * - the contract must not be paused.\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual override {\\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n require(!paused(), \\\"ERC1155Pausable: token transfer while paused\\\");\\n }\\n}\\n\",\"keccak256\":\"0xdad22b949de979bb2ad9001c044b2aeaacf8a25e3de09ed6f022a9469f936d5b\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC1155.sol\\\";\\n\\n/**\\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155MetadataURI is IERC1155 {\\n /**\\n * @dev Returns the URI for token type `id`.\\n *\\n * If the `\\\\{id\\\\}` substring is present in the URI, it must be replaced by\\n * clients with the actual token type ID.\\n */\\n function uri(uint256 id) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xa66d18b9a85458d28fc3304717964502ae36f7f8a2ff35bc83f6f85d74b03574\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/presets/ERC1155PresetMinterPauser.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/presets/ERC1155PresetMinterPauser.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1155.sol\\\";\\nimport \\\"../extensions/ERC1155Burnable.sol\\\";\\nimport \\\"../extensions/ERC1155Pausable.sol\\\";\\nimport \\\"../../../access/AccessControlEnumerable.sol\\\";\\nimport \\\"../../../utils/Context.sol\\\";\\n\\n/**\\n * @dev {ERC1155} token, including:\\n *\\n * - ability for holders to burn (destroy) their tokens\\n * - a minter role that allows for token minting (creation)\\n * - a pauser role that allows to stop all token transfers\\n *\\n * This contract uses {AccessControl} to lock permissioned functions using the\\n * different roles - head to its documentation for details.\\n *\\n * The account that deploys the contract will be granted the minter and pauser\\n * roles, as well as the default admin role, which will let it grant both minter\\n * and pauser roles to other accounts.\\n *\\n * _Deprecated in favor of https://wizard.openzeppelin.com/[Contracts Wizard]._\\n */\\ncontract ERC1155PresetMinterPauser is Context, AccessControlEnumerable, ERC1155Burnable, ERC1155Pausable {\\n bytes32 public constant MINTER_ROLE = keccak256(\\\"MINTER_ROLE\\\");\\n bytes32 public constant PAUSER_ROLE = keccak256(\\\"PAUSER_ROLE\\\");\\n\\n /**\\n * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE`, and `PAUSER_ROLE` to the account that\\n * deploys the contract.\\n */\\n constructor(string memory uri) ERC1155(uri) {\\n _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());\\n\\n _setupRole(MINTER_ROLE, _msgSender());\\n _setupRole(PAUSER_ROLE, _msgSender());\\n }\\n\\n /**\\n * @dev Creates `amount` new tokens for `to`, of token type `id`.\\n *\\n * See {ERC1155-_mint}.\\n *\\n * Requirements:\\n *\\n * - the caller must have the `MINTER_ROLE`.\\n */\\n function mint(\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) public virtual {\\n require(hasRole(MINTER_ROLE, _msgSender()), \\\"ERC1155PresetMinterPauser: must have minter role to mint\\\");\\n\\n _mint(to, id, amount, data);\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] variant of {mint}.\\n */\\n function mintBatch(\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) public virtual {\\n require(hasRole(MINTER_ROLE, _msgSender()), \\\"ERC1155PresetMinterPauser: must have minter role to mint\\\");\\n\\n _mintBatch(to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Pauses all token transfers.\\n *\\n * See {ERC1155Pausable} and {Pausable-_pause}.\\n *\\n * Requirements:\\n *\\n * - the caller must have the `PAUSER_ROLE`.\\n */\\n function pause() public virtual {\\n require(hasRole(PAUSER_ROLE, _msgSender()), \\\"ERC1155PresetMinterPauser: must have pauser role to pause\\\");\\n _pause();\\n }\\n\\n /**\\n * @dev Unpauses all token transfers.\\n *\\n * See {ERC1155Pausable} and {Pausable-_unpause}.\\n *\\n * Requirements:\\n *\\n * - the caller must have the `PAUSER_ROLE`.\\n */\\n function unpause() public virtual {\\n require(hasRole(PAUSER_ROLE, _msgSender()), \\\"ERC1155PresetMinterPauser: must have pauser role to unpause\\\");\\n _unpause();\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId)\\n public\\n view\\n virtual\\n override(AccessControlEnumerable, ERC1155)\\n returns (bool)\\n {\\n return super.supportsInterface(interfaceId);\\n }\\n\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual override(ERC1155, ERC1155Pausable) {\\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n }\\n}\\n\",\"keccak256\":\"0x775e248004d21e0666740534a732daa9f17ceeee660ded876829e98a3a62b657\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/utils/ERC1155Holder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ERC1155Receiver.sol\\\";\\n\\n/**\\n * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens.\\n *\\n * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be\\n * stuck.\\n *\\n * @dev _Available since v3.1._\\n */\\ncontract ERC1155Holder is ERC1155Receiver {\\n function onERC1155Received(\\n address,\\n address,\\n uint256,\\n uint256,\\n bytes memory\\n ) public virtual override returns (bytes4) {\\n return this.onERC1155Received.selector;\\n }\\n\\n function onERC1155BatchReceived(\\n address,\\n address,\\n uint256[] memory,\\n uint256[] memory,\\n bytes memory\\n ) public virtual override returns (bytes4) {\\n return this.onERC1155BatchReceived.selector;\\n }\\n}\\n\",\"keccak256\":\"0x2e024ca51ce5abe16c0d34e6992a1104f356e2244eb4ccbec970435e8b3405e3\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC1155/utils/ERC1155Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC1155Receiver.sol\\\";\\nimport \\\"../../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev _Available since v3.1._\\n */\\nabstract contract ERC1155Receiver is ERC165, IERC1155Receiver {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);\\n }\\n}\\n\",\"keccak256\":\"0x3dd5e1a66a56f30302108a1da97d677a42b1daa60e503696b2bcbbf3e4c95bcb\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC721 compliant contract.\\n */\\ninterface IERC721 is IERC165 {\\n /**\\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\\n */\\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\\n */\\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\\n\\n /**\\n * @dev Returns the number of tokens in ``owner``'s account.\\n */\\n function balanceOf(address owner) external view returns (uint256 balance);\\n\\n /**\\n * @dev Returns the owner of the `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function ownerOf(uint256 tokenId) external view returns (address owner);\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) external;\\n\\n /**\\n * @dev Transfers `tokenId` token from `from` to `to`.\\n *\\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) external;\\n\\n /**\\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\\n * The approval is cleared when the token is transferred.\\n *\\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\\n *\\n * Requirements:\\n *\\n * - The caller must own the token or be an approved operator.\\n * - `tokenId` must exist.\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Approve or remove `operator` as an operator for the caller.\\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\\n *\\n * Requirements:\\n *\\n * - The `operator` cannot be the caller.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function setApprovalForAll(address operator, bool _approved) external;\\n\\n /**\\n * @dev Returns the account approved for `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function getApproved(uint256 tokenId) external view returns (address operator);\\n\\n /**\\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\\n *\\n * See {setApprovalForAll}\\n */\\n function isApprovedForAll(address owner, address operator) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xed6a749c5373af398105ce6ee3ac4763aa450ea7285d268c85d9eeca809cdb1f\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _HEX_SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n // Inspired by OraclizeAPI's implementation - MIT licence\\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\\n\\n if (value == 0) {\\n return \\\"0\\\";\\n }\\n uint256 temp = value;\\n uint256 digits;\\n while (temp != 0) {\\n digits++;\\n temp /= 10;\\n }\\n bytes memory buffer = new bytes(digits);\\n while (value != 0) {\\n digits -= 1;\\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\\n value /= 10;\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n if (value == 0) {\\n return \\\"0x00\\\";\\n }\\n uint256 temp = value;\\n uint256 length = 0;\\n while (temp != 0) {\\n length++;\\n temp >>= 8;\\n }\\n return toHexString(value, length);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xaf159a8b1923ad2a26d516089bceca9bdeaeacd04be50983ea00ba63070f08a3\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.3) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSA {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n } else if (error == RecoverError.InvalidSignatureV) {\\n revert(\\\"ECDSA: invalid signature 'v' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n if (v != 27 && v != 28) {\\n return (address(0), RecoverError.InvalidSignatureV);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", Strings.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0xdb7f5c28fc61cda0bd8ab60ce288e206b791643bcd3ba464a70cbec18895a2f5\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n *\\n * [WARNING]\\n * ====\\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.\\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\\n *\\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.\\n * ====\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n bytes32 lastValue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastValue;\\n // Update the index for the moved value\\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n return set._values[index];\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function _values(Set storage set) private view returns (bytes32[] memory) {\\n return set._values;\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\\n return _values(set._inner);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(AddressSet storage set) internal view returns (address[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n address[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(UintSet storage set) internal view returns (uint256[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n uint256[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0x5050943b32b6a8f282573d166b2e9d87ab7eb4dbba4ab6acf36ecb54fe6995e4\",\"license\":\"MIT\"},\"src/extensions/GatewayV3.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/security/Pausable.sol\\\";\\nimport \\\"../interfaces/IQuorum.sol\\\";\\nimport \\\"./collections/HasProxyAdmin.sol\\\";\\n\\nabstract contract GatewayV3 is HasProxyAdmin, Pausable, IQuorum {\\n uint256 internal _num;\\n uint256 internal _denom;\\n\\n address private ______deprecated;\\n uint256 public nonce;\\n\\n address public emergencyPauser;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n */\\n uint256[49] private ______gap;\\n\\n /**\\n * @dev Grant emergency pauser role for `_addr`.\\n */\\n function setEmergencyPauser(address _addr) external onlyProxyAdmin {\\n emergencyPauser = _addr;\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function getThreshold() external view virtual returns (uint256 num_, uint256 denom_) {\\n return (_num, _denom);\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function checkThreshold(uint256 _voteWeight) external view virtual returns (bool) {\\n return _voteWeight * _denom >= _num * _getTotalWeight();\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function setThreshold(uint256 _numerator, uint256 _denominator) external virtual onlyProxyAdmin {\\n return _setThreshold(_numerator, _denominator);\\n }\\n\\n /**\\n * @dev Triggers paused state.\\n */\\n function pause() external {\\n _requireAuth();\\n _pause();\\n }\\n\\n /**\\n * @dev Triggers unpaused state.\\n */\\n function unpause() external {\\n _requireAuth();\\n _unpause();\\n }\\n\\n /**\\n * @inheritdoc IQuorum\\n */\\n function minimumVoteWeight() public view virtual returns (uint256) {\\n return _minimumVoteWeight(_getTotalWeight());\\n }\\n\\n /**\\n * @dev Sets threshold and returns the old one.\\n *\\n * Emits the `ThresholdUpdated` event.\\n *\\n */\\n function _setThreshold(uint256 num, uint256 denom) internal virtual {\\n if (num > denom) revert ErrInvalidThreshold(msg.sig);\\n uint256 prevNum = _num;\\n uint256 prevDenom = _denom;\\n _num = num;\\n _denom = denom;\\n unchecked {\\n emit ThresholdUpdated(nonce++, num, denom, prevNum, prevDenom);\\n }\\n }\\n\\n /**\\n * @dev Returns minimum vote weight.\\n */\\n function _minimumVoteWeight(uint256 _totalWeight) internal view virtual returns (uint256) {\\n return (_num * _totalWeight + _denom - 1) / _denom;\\n }\\n\\n /**\\n * @dev Internal method to check method caller.\\n *\\n * Requirements:\\n *\\n * - The method caller must be admin or pauser.\\n *\\n */\\n function _requireAuth() private view {\\n if (!(msg.sender == _getProxyAdmin() || msg.sender == emergencyPauser)) {\\n revert ErrUnauthorized(msg.sig, RoleAccess.ADMIN);\\n }\\n }\\n\\n /**\\n * @dev Returns the total weight.\\n */\\n function _getTotalWeight() internal view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0x010a0021a377e4b23a4f56269b9c6e3e3fc2684897928ff9b9da1b47c3f07baf\",\"license\":\"MIT\"},\"src/extensions/TransparentUpgradeableProxyV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\\\";\\n\\ncontract TransparentUpgradeableProxyV2 is TransparentUpgradeableProxy {\\n constructor(address _logic, address admin_, bytes memory _data) payable TransparentUpgradeableProxy(_logic, admin_, _data) { }\\n\\n /**\\n * @dev Calls a function from the current implementation as specified by `_data`, which should be an encoded function call.\\n *\\n * Requirements:\\n * - Only the admin can call this function.\\n *\\n * Note: The proxy admin is not allowed to interact with the proxy logic through the fallback function to avoid\\n * triggering some unexpected logic. This is to allow the administrator to explicitly call the proxy, please consider\\n * reviewing the encoded data `_data` and the method which is called before using this.\\n *\\n */\\n function functionDelegateCall(bytes memory _data) public payable ifAdmin {\\n address _addr = _implementation();\\n assembly {\\n let _result := delegatecall(gas(), _addr, add(_data, 32), mload(_data), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n switch _result\\n case 0 { revert(0, returndatasize()) }\\n default { return(0, returndatasize()) }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x45fc7b71d09da99414b977a56e586b3604670d865e5f36f395d5c98bc4ba64af\",\"license\":\"MIT\"},\"src/extensions/WethUnwrapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/security/ReentrancyGuard.sol\\\";\\nimport \\\"../interfaces/IWETH.sol\\\";\\n\\ncontract WethUnwrapper is ReentrancyGuard {\\n IWETH public immutable weth;\\n\\n error ErrCannotTransferFrom();\\n error ErrNotWrappedContract();\\n error ErrExternalCallFailed(address sender, bytes4 sig);\\n\\n constructor(address weth_) {\\n if (address(weth_).code.length == 0) revert ErrNotWrappedContract();\\n weth = IWETH(weth_);\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n receive() external payable {\\n _fallback();\\n }\\n\\n function unwrap(uint256 amount) external nonReentrant {\\n _deductWrappedAndWithdraw(amount);\\n _sendNativeTo(payable(msg.sender), amount);\\n }\\n\\n function unwrapTo(uint256 amount, address payable to) external nonReentrant {\\n _deductWrappedAndWithdraw(amount);\\n _sendNativeTo(payable(to), amount);\\n }\\n\\n function _deductWrappedAndWithdraw(uint256 amount) internal {\\n (bool success,) = address(weth).call(abi.encodeCall(IWETH.transferFrom, (msg.sender, address(this), amount)));\\n if (!success) revert ErrCannotTransferFrom();\\n\\n weth.withdraw(amount);\\n }\\n\\n function _sendNativeTo(address payable to, uint256 val) internal {\\n (bool success,) = to.call{ value: val }(\\\"\\\");\\n if (!success) {\\n revert ErrExternalCallFailed(to, msg.sig);\\n }\\n }\\n\\n function _fallback() internal view {\\n if (msg.sender != address(weth)) revert ErrNotWrappedContract();\\n }\\n}\\n\",\"keccak256\":\"0x5f7b72d9ed8944724d2f228358d565a61ea345cba1883e5424fb801bebc758ff\",\"license\":\"MIT\"},\"src/extensions/WithdrawalLimitation.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./GatewayV3.sol\\\";\\n\\nabstract contract WithdrawalLimitation is GatewayV3 {\\n /// @dev Error of invalid percentage.\\n error ErrInvalidPercentage();\\n\\n /// @dev Emitted when the high-tier vote weight threshold is updated\\n event HighTierVoteWeightThresholdUpdated(\\n uint256 indexed nonce, uint256 indexed numerator, uint256 indexed denominator, uint256 previousNumerator, uint256 previousDenominator\\n );\\n /// @dev Emitted when the thresholds for high-tier withdrawals that requires high-tier vote weights are updated\\n event HighTierThresholdsUpdated(address[] tokens, uint256[] thresholds);\\n /// @dev Emitted when the thresholds for locked withdrawals are updated\\n event LockedThresholdsUpdated(address[] tokens, uint256[] thresholds);\\n /// @dev Emitted when the fee percentages to unlock withdraw are updated\\n event UnlockFeePercentagesUpdated(address[] tokens, uint256[] percentages);\\n /// @dev Emitted when the daily limit thresholds are updated\\n event DailyWithdrawalLimitsUpdated(address[] tokens, uint256[] limits);\\n\\n uint256 public constant _MAX_PERCENTAGE = 1_000_000;\\n\\n uint256 internal _highTierVWNum;\\n uint256 internal _highTierVWDenom;\\n\\n /// @dev Mapping from mainchain token => the amount thresholds for high-tier withdrawals that requires high-tier vote weights\\n mapping(address => uint256) public highTierThreshold;\\n /// @dev Mapping from mainchain token => the amount thresholds to lock withdrawal\\n mapping(address => uint256) public lockedThreshold;\\n /// @dev Mapping from mainchain token => unlock fee percentages for unlocker\\n /// @notice Values 0-1,000,000 map to 0%-100%\\n mapping(address => uint256) public unlockFeePercentages;\\n /// @dev Mapping from mainchain token => daily limit amount for withdrawal\\n mapping(address => uint256) public dailyWithdrawalLimit;\\n /// @dev Mapping from token address => today withdrawal amount\\n mapping(address => uint256) public lastSyncedWithdrawal;\\n /// @dev Mapping from token address => last date synced to record the `lastSyncedWithdrawal`\\n mapping(address => uint256) public lastDateSynced;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n */\\n uint256[50] private ______gap;\\n\\n /**\\n * @dev Override `GatewayV3-setThreshold`.\\n *\\n * Requirements:\\n * - The high-tier vote weight threshold must equal to or larger than the normal threshold.\\n *\\n */\\n function setThreshold(uint256 num, uint256 denom) external virtual override onlyProxyAdmin {\\n _setThreshold(num, denom);\\n _verifyThresholds();\\n }\\n\\n /**\\n * @dev Returns the high-tier vote weight threshold.\\n */\\n function getHighTierVoteWeightThreshold() external view virtual returns (uint256, uint256) {\\n return (_highTierVWNum, _highTierVWDenom);\\n }\\n\\n /**\\n * @dev Checks whether the `_voteWeight` passes the high-tier vote weight threshold.\\n */\\n function checkHighTierVoteWeightThreshold(uint256 _voteWeight) external view virtual returns (bool) {\\n return _voteWeight * _highTierVWDenom >= _highTierVWNum * _getTotalWeight();\\n }\\n\\n /**\\n * @dev Sets high-tier vote weight threshold and returns the old one.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n * - The high-tier vote weight threshold must equal to or larger than the normal threshold.\\n *\\n * Emits the `HighTierVoteWeightThresholdUpdated` event.\\n *\\n */\\n function setHighTierVoteWeightThreshold(\\n uint256 _numerator,\\n uint256 _denominator\\n ) external virtual onlyProxyAdmin returns (uint256 _previousNum, uint256 _previousDenom) {\\n (_previousNum, _previousDenom) = _setHighTierVoteWeightThreshold(_numerator, _denominator);\\n _verifyThresholds();\\n }\\n\\n /**\\n * @dev Sets the thresholds for high-tier withdrawals that requires high-tier vote weights.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n * - The arrays have the same length and its length larger than 0.\\n *\\n * Emits the `HighTierThresholdsUpdated` event.\\n *\\n */\\n function setHighTierThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) external virtual onlyProxyAdmin {\\n if (_tokens.length == 0) revert ErrEmptyArray();\\n _setHighTierThresholds(_tokens, _thresholds);\\n }\\n\\n /**\\n * @dev Sets the amount thresholds to lock withdrawal.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n * - The arrays have the same length and its length larger than 0.\\n *\\n * Emits the `LockedThresholdsUpdated` event.\\n *\\n */\\n function setLockedThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) external virtual onlyProxyAdmin {\\n if (_tokens.length == 0) revert ErrEmptyArray();\\n _setLockedThresholds(_tokens, _thresholds);\\n }\\n\\n /**\\n * @dev Sets fee percentages to unlock withdrawal.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n * - The arrays have the same length and its length larger than 0.\\n *\\n * Emits the `UnlockFeePercentagesUpdated` event.\\n *\\n */\\n function setUnlockFeePercentages(address[] calldata _tokens, uint256[] calldata _percentages) external virtual onlyProxyAdmin {\\n if (_tokens.length == 0) revert ErrEmptyArray();\\n _setUnlockFeePercentages(_tokens, _percentages);\\n }\\n\\n /**\\n * @dev Sets daily limit amounts for the withdrawals.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n * - The arrays have the same length and its length larger than 0.\\n *\\n * Emits the `DailyWithdrawalLimitsUpdated` event.\\n *\\n */\\n function setDailyWithdrawalLimits(address[] calldata _tokens, uint256[] calldata _limits) external virtual onlyProxyAdmin {\\n if (_tokens.length == 0) revert ErrEmptyArray();\\n _setDailyWithdrawalLimits(_tokens, _limits);\\n }\\n\\n /**\\n * @dev Checks whether the withdrawal reaches the limitation.\\n */\\n function reachedWithdrawalLimit(address _token, uint256 _quantity) external view virtual returns (bool) {\\n return _reachedWithdrawalLimit(_token, _quantity);\\n }\\n\\n /**\\n * @dev Sets high-tier vote weight threshold and returns the old one.\\n *\\n * Emits the `HighTierVoteWeightThresholdUpdated` event.\\n *\\n */\\n function _setHighTierVoteWeightThreshold(uint256 _numerator, uint256 _denominator) internal returns (uint256 _previousNum, uint256 _previousDenom) {\\n if (_numerator > _denominator) revert ErrInvalidThreshold(msg.sig);\\n\\n _previousNum = _highTierVWNum;\\n _previousDenom = _highTierVWDenom;\\n _highTierVWNum = _numerator;\\n _highTierVWDenom = _denominator;\\n\\n unchecked {\\n emit HighTierVoteWeightThresholdUpdated(nonce++, _numerator, _denominator, _previousNum, _previousDenom);\\n }\\n }\\n\\n /**\\n * @dev Sets the thresholds for high-tier withdrawals that requires high-tier vote weights.\\n *\\n * Requirements:\\n * - The array lengths are equal.\\n *\\n * Emits the `HighTierThresholdsUpdated` event.\\n *\\n */\\n function _setHighTierThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) internal virtual {\\n if (_tokens.length != _thresholds.length) revert ErrLengthMismatch(msg.sig);\\n\\n for (uint256 _i; _i < _tokens.length;) {\\n highTierThreshold[_tokens[_i]] = _thresholds[_i];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n emit HighTierThresholdsUpdated(_tokens, _thresholds);\\n }\\n\\n /**\\n * @dev Sets the amount thresholds to lock withdrawal.\\n *\\n * Requirements:\\n * - The array lengths are equal.\\n *\\n * Emits the `LockedThresholdsUpdated` event.\\n *\\n */\\n function _setLockedThresholds(address[] calldata _tokens, uint256[] calldata _thresholds) internal virtual {\\n if (_tokens.length != _thresholds.length) revert ErrLengthMismatch(msg.sig);\\n\\n for (uint256 _i; _i < _tokens.length;) {\\n lockedThreshold[_tokens[_i]] = _thresholds[_i];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n emit LockedThresholdsUpdated(_tokens, _thresholds);\\n }\\n\\n /**\\n * @dev Sets fee percentages to unlock withdrawal.\\n *\\n * Requirements:\\n * - The array lengths are equal.\\n * - The percentage is equal to or less than 100_000.\\n *\\n * Emits the `UnlockFeePercentagesUpdated` event.\\n *\\n */\\n function _setUnlockFeePercentages(address[] calldata _tokens, uint256[] calldata _percentages) internal virtual {\\n if (_tokens.length != _percentages.length) revert ErrLengthMismatch(msg.sig);\\n\\n for (uint256 _i; _i < _tokens.length;) {\\n if (_percentages[_i] > _MAX_PERCENTAGE) revert ErrInvalidPercentage();\\n\\n unlockFeePercentages[_tokens[_i]] = _percentages[_i];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n emit UnlockFeePercentagesUpdated(_tokens, _percentages);\\n }\\n\\n /**\\n * @dev Sets daily limit amounts for the withdrawals.\\n *\\n * Requirements:\\n * - The array lengths are equal.\\n *\\n * Emits the `DailyWithdrawalLimitsUpdated` event.\\n *\\n */\\n function _setDailyWithdrawalLimits(address[] calldata _tokens, uint256[] calldata _limits) internal virtual {\\n if (_tokens.length != _limits.length) revert ErrLengthMismatch(msg.sig);\\n\\n for (uint256 _i; _i < _tokens.length;) {\\n dailyWithdrawalLimit[_tokens[_i]] = _limits[_i];\\n\\n unchecked {\\n ++_i;\\n }\\n }\\n emit DailyWithdrawalLimitsUpdated(_tokens, _limits);\\n }\\n\\n /**\\n * @dev Checks whether the withdrawal reaches the daily limitation.\\n *\\n * Requirements:\\n * - The daily withdrawal threshold should not apply for locked withdrawals.\\n *\\n */\\n function _reachedWithdrawalLimit(address _token, uint256 _quantity) internal view virtual returns (bool) {\\n if (_lockedWithdrawalRequest(_token, _quantity)) {\\n return false;\\n }\\n\\n uint256 _currentDate = block.timestamp / 1 days;\\n if (_currentDate > lastDateSynced[_token]) {\\n return dailyWithdrawalLimit[_token] <= _quantity;\\n } else {\\n return dailyWithdrawalLimit[_token] <= lastSyncedWithdrawal[_token] + _quantity;\\n }\\n }\\n\\n /**\\n * @dev Record withdrawal token.\\n */\\n function _recordWithdrawal(address _token, uint256 _quantity) internal virtual {\\n uint256 _currentDate = block.timestamp / 1 days;\\n if (_currentDate > lastDateSynced[_token]) {\\n lastDateSynced[_token] = _currentDate;\\n lastSyncedWithdrawal[_token] = _quantity;\\n } else {\\n lastSyncedWithdrawal[_token] += _quantity;\\n }\\n }\\n\\n /**\\n * @dev Returns whether the withdrawal request is locked or not.\\n */\\n function _lockedWithdrawalRequest(address _token, uint256 _quantity) internal view virtual returns (bool) {\\n return lockedThreshold[_token] <= _quantity;\\n }\\n\\n /**\\n * @dev Computes fee percentage.\\n */\\n function _computeFeePercentage(uint256 _amount, uint256 _percentage) internal view virtual returns (uint256) {\\n return (_amount * _percentage) / _MAX_PERCENTAGE;\\n }\\n\\n /**\\n * @dev Returns high-tier vote weight.\\n */\\n function _highTierVoteWeight(uint256 _totalWeight) internal view virtual returns (uint256) {\\n return (_highTierVWNum * _totalWeight + _highTierVWDenom - 1) / _highTierVWDenom;\\n }\\n\\n /**\\n * @dev Validates whether the high-tier vote weight threshold is larger than the normal threshold.\\n */\\n function _verifyThresholds() internal view {\\n if (_num * _highTierVWDenom > _highTierVWNum * _denom) revert ErrInvalidThreshold(msg.sig);\\n }\\n}\\n\",\"keccak256\":\"0x4b7d559d4b1f53239b8690776318db8d63f578f72fb269d8024570aa70c2c2a6\",\"license\":\"MIT\"},\"src/extensions/collections/HasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { HasProxyAdmin } from \\\"./HasProxyAdmin.sol\\\";\\nimport \\\"../../interfaces/collections/IHasContracts.sol\\\";\\nimport { IdentityGuard } from \\\"../../utils/IdentityGuard.sol\\\";\\nimport { ErrUnexpectedInternalCall } from \\\"../../utils/CommonErrors.sol\\\";\\n\\n/**\\n * @title HasContracts\\n * @dev A contract that provides functionality to manage multiple contracts with different roles.\\n */\\nabstract contract HasContracts is HasProxyAdmin, IHasContracts, IdentityGuard {\\n /// @dev value is equal to keccak256(\\\"@ronin.dpos.collections.HasContracts.slot\\\") - 1\\n bytes32 private constant _STORAGE_SLOT = 0xdea3103d22025c269050bea94c0c84688877f12fa22b7e6d2d5d78a9a49aa1cb;\\n\\n /**\\n * @dev Modifier to restrict access to functions only to contracts with a specific role.\\n * @param contractType The contract type that allowed to call\\n */\\n modifier onlyContract(ContractType contractType) virtual {\\n _requireContract(contractType);\\n _;\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function setContract(ContractType contractType, address addr) external virtual onlyProxyAdmin {\\n _requireHasCode(addr);\\n _setContract(contractType, addr);\\n }\\n\\n /**\\n * @inheritdoc IHasContracts\\n */\\n function getContract(ContractType contractType) public view returns (address contract_) {\\n contract_ = _getContractMap()[uint8(contractType)];\\n if (contract_ == address(0)) revert ErrContractTypeNotFound(contractType);\\n }\\n\\n /**\\n * @dev Internal function to set the address of a contract with a specific role.\\n * @param contractType The contract type of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function _setContract(ContractType contractType, address addr) internal virtual {\\n _getContractMap()[uint8(contractType)] = addr;\\n emit ContractUpdated(contractType, addr);\\n }\\n\\n /**\\n * @dev Internal function to access the mapping of contract addresses with roles.\\n * @return contracts_ The mapping of contract addresses with roles.\\n */\\n function _getContractMap() private pure returns (mapping(uint8 => address) storage contracts_) {\\n assembly {\\n contracts_.slot := _STORAGE_SLOT\\n }\\n }\\n\\n /**\\n * @dev Internal function to check if the calling contract has a specific role.\\n * @param contractType The contract type that the calling contract must have.\\n * @dev Throws an error if the calling contract does not have the specified role.\\n */\\n function _requireContract(ContractType contractType) private view {\\n if (msg.sender != getContract(contractType)) {\\n revert ErrUnexpectedInternalCall(msg.sig, contractType, msg.sender);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7dbefa31230e6e4bd319f02d94893cbfd07ee12a0e016f5fadc57660df01891\",\"license\":\"MIT\"},\"src/extensions/collections/HasProxyAdmin.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/StorageSlot.sol\\\";\\nimport \\\"../../utils/CommonErrors.sol\\\";\\n\\nabstract contract HasProxyAdmin {\\n // bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n modifier onlyProxyAdmin() {\\n _requireProxyAdmin();\\n _;\\n }\\n\\n /**\\n * @dev Returns proxy admin.\\n */\\n function _getProxyAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n function _requireProxyAdmin() internal view {\\n if (msg.sender != _getProxyAdmin()) revert ErrUnauthorized(msg.sig, RoleAccess.ADMIN);\\n }\\n}\\n\",\"keccak256\":\"0xad3db02c99a960b60151f2ad45eed46073d14fe1ed861f496c7aeefacbbc528e\",\"license\":\"MIT\"},\"src/interfaces/IMainchainGatewayV3.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IWETH.sol\\\";\\nimport \\\"./consumers/SignatureConsumer.sol\\\";\\nimport \\\"./consumers/MappedTokenConsumer.sol\\\";\\nimport \\\"../libraries/Transfer.sol\\\";\\n\\ninterface IMainchainGatewayV3 is SignatureConsumer, MappedTokenConsumer {\\n /**\\n * @dev Error indicating that a query was made for an approved withdrawal.\\n */\\n error ErrQueryForApprovedWithdrawal();\\n\\n /**\\n * @dev Error indicating that the daily withdrawal limit has been reached.\\n */\\n error ErrReachedDailyWithdrawalLimit();\\n\\n /**\\n * @dev Error indicating that a query was made for a processed withdrawal.\\n */\\n error ErrQueryForProcessedWithdrawal();\\n\\n /**\\n * @dev Error indicating that a query was made for insufficient vote weight.\\n */\\n error ErrQueryForInsufficientVoteWeight();\\n\\n /// @dev Emitted when the deposit is requested\\n event DepositRequested(bytes32 receiptHash, Transfer.Receipt receipt);\\n /// @dev Emitted when the assets are withdrawn\\n event Withdrew(bytes32 receiptHash, Transfer.Receipt receipt);\\n /// @dev Emitted when the tokens are mapped\\n event TokenMapped(address[] mainchainTokens, address[] roninTokens, TokenStandard[] standards);\\n /// @dev Emitted when the wrapped native token contract is updated\\n event WrappedNativeTokenContractUpdated(IWETH weth);\\n /// @dev Emitted when the withdrawal is locked\\n event WithdrawalLocked(bytes32 receiptHash, Transfer.Receipt receipt);\\n /// @dev Emitted when the withdrawal is unlocked\\n event WithdrawalUnlocked(bytes32 receiptHash, Transfer.Receipt receipt);\\n\\n /**\\n * @dev Returns the domain seperator.\\n */\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n\\n /**\\n * @dev Returns deposit count.\\n */\\n function depositCount() external view returns (uint256);\\n\\n /**\\n * @dev Sets the wrapped native token contract.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `WrappedNativeTokenContractUpdated` event.\\n *\\n */\\n function setWrappedNativeTokenContract(IWETH _wrappedToken) external;\\n\\n /**\\n * @dev Returns whether the withdrawal is locked.\\n */\\n function withdrawalLocked(uint256 withdrawalId) external view returns (bool);\\n\\n /**\\n * @dev Returns the withdrawal hash.\\n */\\n function withdrawalHash(uint256 withdrawalId) external view returns (bytes32);\\n\\n /**\\n * @dev Locks the assets and request deposit.\\n */\\n function requestDepositFor(Transfer.Request calldata _request) external payable;\\n\\n /**\\n * @dev Withdraws based on the receipt and the validator signatures.\\n * Returns whether the withdrawal is locked.\\n *\\n * Emits the `Withdrew` once the assets are released.\\n *\\n */\\n function submitWithdrawal(Transfer.Receipt memory _receipt, Signature[] memory _signatures) external returns (bool _locked);\\n\\n /**\\n * @dev Approves a specific withdrawal.\\n *\\n * Requirements:\\n * - The method caller is a validator.\\n *\\n * Emits the `Withdrew` once the assets are released.\\n *\\n */\\n function unlockWithdrawal(Transfer.Receipt calldata _receipt) external;\\n\\n /**\\n * @dev Maps mainchain tokens to Ronin network.\\n *\\n * Requirement:\\n * - The method caller is admin.\\n * - The arrays have the same length and its length larger than 0.\\n *\\n * Emits the `TokenMapped` event.\\n *\\n */\\n function mapTokens(address[] calldata _mainchainTokens, address[] calldata _roninTokens, TokenStandard[] calldata _standards) external;\\n\\n /**\\n * @dev Maps mainchain tokens to Ronin network and sets thresholds.\\n *\\n * Requirement:\\n * - The method caller is admin.\\n * - The arrays have the same length and its length larger than 0.\\n *\\n * Emits the `TokenMapped` event.\\n *\\n */\\n function mapTokensAndThresholds(\\n address[] calldata _mainchainTokens,\\n address[] calldata _roninTokens,\\n TokenStandard[] calldata _standards,\\n uint256[][4] calldata _thresholds\\n ) external;\\n\\n /**\\n * @dev Returns token address on Ronin network.\\n * Note: Reverts for unsupported token.\\n */\\n function getRoninToken(address _mainchainToken) external view returns (MappedToken memory _token);\\n}\\n\",\"keccak256\":\"0x2d4f53a65e76e903040f5f4dbe5aea53367d61243c60efdc8402ff184bd50a87\",\"license\":\"MIT\"},\"src/interfaces/IQuorum.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IQuorum {\\n /// @dev Emitted when the threshold is updated\\n event ThresholdUpdated(uint256 indexed nonce, uint256 indexed numerator, uint256 indexed denominator, uint256 previousNumerator, uint256 previousDenominator);\\n\\n /**\\n * @dev Returns the threshold.\\n */\\n function getThreshold() external view returns (uint256 _num, uint256 _denom);\\n\\n /**\\n * @dev Checks whether the `_voteWeight` passes the threshold.\\n */\\n function checkThreshold(uint256 _voteWeight) external view returns (bool);\\n\\n /**\\n * @dev Returns the minimum vote weight to pass the threshold.\\n */\\n function minimumVoteWeight() external view returns (uint256);\\n\\n /**\\n * @dev Sets the threshold.\\n *\\n * Requirements:\\n * - The method caller is admin.\\n *\\n * Emits the `ThresholdUpdated` event.\\n *\\n */\\n function setThreshold(uint256 numerator, uint256 denominator) external;\\n}\\n\",\"keccak256\":\"0xc924e9480f59acc9bc8c033f05d3be9451de5cee0c224d76d4542fa5b67fa10f\",\"license\":\"MIT\"},\"src/interfaces/IWETH.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IWETH {\\n event Transfer(address indexed src, address indexed dst, uint wad);\\n\\n function deposit() external payable;\\n\\n function transfer(address dst, uint wad) external returns (bool);\\n\\n function approve(address guy, uint wad) external returns (bool);\\n\\n function transferFrom(address src, address dst, uint wad) external returns (bool);\\n\\n function withdraw(uint256 _wad) external;\\n\\n function balanceOf(address) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x000700e2b9c1985d53bb1cdba435f0f3d7b48e76e596e7dbbdfec1da47131415\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IBridgeManagerEvents } from \\\"./events/IBridgeManagerEvents.sol\\\";\\n\\n/**\\n * @title IBridgeManager\\n * @dev The interface for managing bridge operators.\\n */\\ninterface IBridgeManager is IBridgeManagerEvents {\\n /// @notice Error indicating that cannot find the querying operator\\n error ErrOperatorNotFound(address operator);\\n /// @notice Error indicating that cannot find the querying governor\\n error ErrGovernorNotFound(address governor);\\n /// @notice Error indicating that the msg.sender is not match the required governor\\n error ErrGovernorNotMatch(address required, address sender);\\n /// @notice Error indicating that the governors list will go below minimum number of required governor.\\n error ErrBelowMinRequiredGovernors();\\n /// @notice Common invalid input error\\n error ErrInvalidInput();\\n\\n /**\\n * @dev The domain separator used for computing hash digests in the contract.\\n */\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n\\n /**\\n * @dev Returns the total number of bridge operators.\\n * @return The total number of bridge operators.\\n */\\n function totalBridgeOperator() external view returns (uint256);\\n\\n /**\\n * @dev Checks if the given address is a bridge operator.\\n * @param addr The address to check.\\n * @return A boolean indicating whether the address is a bridge operator.\\n */\\n function isBridgeOperator(address addr) external view returns (bool);\\n\\n /**\\n * @dev Retrieves the full information of all registered bridge operators.\\n *\\n * This external function allows external callers to obtain the full information of all the registered bridge operators.\\n * The returned arrays include the addresses of governors, bridge operators, and their corresponding vote weights.\\n *\\n * @return governors An array of addresses representing the governors of each bridge operator.\\n * @return bridgeOperators An array of addresses representing the registered bridge operators.\\n * @return weights An array of uint256 values representing the vote weights of each bridge operator.\\n *\\n * Note: The length of each array will be the same, and the order of elements corresponds to the same bridge operator.\\n *\\n * Example Usage:\\n * ```\\n * (address[] memory governors, address[] memory bridgeOperators, uint256[] memory weights) = getFullBridgeOperatorInfos();\\n * for (uint256 i = 0; i < bridgeOperators.length; i++) {\\n * // Access individual information for each bridge operator.\\n * address governor = governors[i];\\n * address bridgeOperator = bridgeOperators[i];\\n * uint256 weight = weights[i];\\n * // ... (Process or use the information as required) ...\\n * }\\n * ```\\n *\\n */\\n function getFullBridgeOperatorInfos() external view returns (address[] memory governors, address[] memory bridgeOperators, uint96[] memory weights);\\n\\n /**\\n * @dev Returns total weights of the governor list.\\n */\\n function sumGovernorsWeight(address[] calldata governors) external view returns (uint256 sum);\\n\\n /**\\n * @dev Returns total weights.\\n */\\n function getTotalWeight() external view returns (uint256);\\n\\n /**\\n * @dev Returns an array of all bridge operators.\\n * @return An array containing the addresses of all bridge operators.\\n */\\n function getBridgeOperators() external view returns (address[] memory);\\n\\n /**\\n * @dev Returns the corresponding `operator` of a `governor`.\\n */\\n function getOperatorOf(address governor) external view returns (address operator);\\n\\n /**\\n * @dev Returns the corresponding `governor` of a `operator`.\\n */\\n function getGovernorOf(address operator) external view returns (address governor);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific governor.\\n * @param governor The address of the governor to get the vote weight for.\\n * @return voteWeight The vote weight of the specified governor.\\n */\\n function getGovernorWeight(address governor) external view returns (uint96);\\n\\n /**\\n * @dev External function to retrieve the vote weight of a specific bridge operator.\\n * @param bridgeOperator The address of the bridge operator to get the vote weight for.\\n * @return weight The vote weight of the specified bridge operator.\\n */\\n function getBridgeOperatorWeight(address bridgeOperator) external view returns (uint96 weight);\\n\\n /**\\n * @dev Returns the weights of a list of governor addresses.\\n */\\n function getGovernorWeights(address[] calldata governors) external view returns (uint96[] memory weights);\\n\\n /**\\n * @dev Returns an array of all governors.\\n * @return An array containing the addresses of all governors.\\n */\\n function getGovernors() external view returns (address[] memory);\\n\\n /**\\n * @dev Adds multiple bridge operators.\\n * @param governors An array of addresses of hot/cold wallets for bridge operator to update their node address.\\n * @param bridgeOperators An array of addresses representing the bridge operators to add.\\n */\\n function addBridgeOperators(uint96[] calldata voteWeights, address[] calldata governors, address[] calldata bridgeOperators) external;\\n\\n /**\\n * @dev Removes multiple bridge operators.\\n * @param bridgeOperators An array of addresses representing the bridge operators to remove.\\n */\\n function removeBridgeOperators(address[] calldata bridgeOperators) external;\\n\\n /**\\n * @dev Self-call to update the minimum required governor.\\n * @param min The minimum number, this must not less than 3.\\n */\\n function setMinRequiredGovernor(uint min) external;\\n}\\n\",\"keccak256\":\"0xefc46318a240371031e77ef3c355e2c18432e4479145378de6782277f9b44923\",\"license\":\"MIT\"},\"src/interfaces/bridge/IBridgeManagerCallback.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @title IBridgeManagerCallback\\n * @dev Interface for the callback functions to be implemented by the Bridge Manager contract.\\n */\\ninterface IBridgeManagerCallback is IERC165 {\\n /**\\n * @dev Handles the event when bridge operators are added.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @param addeds The corresponding boolean values indicating whether the operators were added or not.\\n * @return selector The selector of the function being called.\\n */\\n function onBridgeOperatorsAdded(address[] memory bridgeOperators, uint96[] calldata weights, bool[] memory addeds) external returns (bytes4 selector);\\n\\n /**\\n * @dev Handles the event when bridge operators are removed.\\n * @param bridgeOperators The addresses of the bridge operators.\\n * @param removeds The corresponding boolean values indicating whether the operators were removed or not.\\n * @return selector The selector of the function being called.\\n */\\n function onBridgeOperatorsRemoved(address[] memory bridgeOperators, bool[] memory removeds) external returns (bytes4 selector);\\n}\\n\",\"keccak256\":\"0x6c8ce7e2478e28c5ed5e6f5d8305a77d6d5f9125a47adfb77632940b9a0f3625\",\"license\":\"MIT\"},\"src/interfaces/bridge/events/IBridgeManagerEvents.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeManagerEvents {\\n /**\\n * @dev Emitted when new bridge operators are added.\\n */\\n event BridgeOperatorsAdded(bool[] statuses, uint96[] voteWeights, address[] governors, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is failed to add.\\n */\\n event BridgeOperatorAddingFailed(address indexed operator);\\n\\n /**\\n * @dev Emitted when bridge operators are removed.\\n */\\n event BridgeOperatorsRemoved(bool[] statuses, address[] bridgeOperators);\\n\\n /**\\n * @dev Emitted when a bridge operator is failed to remove.\\n */\\n event BridgeOperatorRemovingFailed(address indexed operator);\\n\\n /**\\n * @dev Emitted when a bridge operator is updated.\\n */\\n event BridgeOperatorUpdated(address indexed governor, address indexed fromBridgeOperator, address indexed toBridgeOperator);\\n\\n /**\\n * @dev Emitted when the minimum number of required governors is updated.\\n */\\n event MinRequiredGovernorUpdated(uint min);\\n}\\n\",\"keccak256\":\"0x38bc3709c98a7c08fb9b6fa3e07a725903dcb0bd07de8a828bac6c3bcf7d997d\",\"license\":\"MIT\"},\"src/interfaces/collections/IHasContracts.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.9;\\n\\nimport { ContractType } from \\\"../../utils/ContractType.sol\\\";\\n\\ninterface IHasContracts {\\n /// @dev Error of invalid role.\\n error ErrContractTypeNotFound(ContractType contractType);\\n\\n /// @dev Emitted when a contract is updated.\\n event ContractUpdated(ContractType indexed contractType, address indexed addr);\\n\\n /**\\n * @dev Returns the address of a contract with a specific role.\\n * Throws an error if no contract is set for the specified role.\\n *\\n * @param contractType The role of the contract to retrieve.\\n * @return contract_ The address of the contract with the specified role.\\n */\\n function getContract(ContractType contractType) external view returns (address contract_);\\n\\n /**\\n * @dev Sets the address of a contract with a specific role.\\n * Emits the event {ContractUpdated}.\\n * @param contractType The role of the contract to set.\\n * @param addr The address of the contract to set.\\n */\\n function setContract(ContractType contractType, address addr) external;\\n}\\n\",\"keccak256\":\"0x99d8213d857e30d367155abd15dc42730afdfbbac3a22dfb3b95ffea2083a92e\",\"license\":\"MIT\"},\"src/interfaces/consumers/MappedTokenConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../libraries/LibTokenInfo.sol\\\";\\n\\ninterface MappedTokenConsumer {\\n struct MappedToken {\\n TokenStandard erc;\\n address tokenAddr;\\n }\\n}\\n\",\"keccak256\":\"0xc53dcba9dc7d950ab6561149f76b45617ddbce5037e4c86ea00b976018bbfde1\",\"license\":\"MIT\"},\"src/interfaces/consumers/SignatureConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface SignatureConsumer {\\n struct Signature {\\n uint8 v;\\n bytes32 r;\\n bytes32 s;\\n }\\n}\\n\",\"keccak256\":\"0xd370e350722067097dec1a5c31bda6e47e83417fa5c3288293bb910028cd136b\",\"license\":\"MIT\"},\"src/libraries/AddressArrayUtils.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\nlibrary AddressArrayUtils {\\n /**\\n * @dev Error thrown when a duplicated element is detected in an array.\\n * @param msgSig The function signature that invoke the error.\\n */\\n error ErrDuplicated(bytes4 msgSig);\\n\\n /**\\n * @dev Returns whether or not there's a duplicate. Runs in O(n^2).\\n * @param A Array to search\\n * @return Returns true if duplicate, false otherwise\\n */\\n function hasDuplicate(address[] memory A) internal pure returns (bool) {\\n if (A.length == 0) {\\n return false;\\n }\\n unchecked {\\n for (uint256 i = 0; i < A.length - 1; i++) {\\n for (uint256 j = i + 1; j < A.length; j++) {\\n if (A[i] == A[j]) {\\n return true;\\n }\\n }\\n }\\n }\\n return false;\\n }\\n\\n /**\\n * @dev Returns whether two arrays of addresses are equal or not.\\n */\\n function isEqual(address[] memory _this, address[] memory _other) internal pure returns (bool yes_) {\\n // Hashing two arrays and compare their hash\\n assembly {\\n let _thisHash := keccak256(add(_this, 32), mul(mload(_this), 32))\\n let _otherHash := keccak256(add(_other, 32), mul(mload(_other), 32))\\n yes_ := eq(_thisHash, _otherHash)\\n }\\n }\\n\\n /**\\n * @dev Return the concatenated array from a and b.\\n */\\n function extend(address[] memory a, address[] memory b) internal pure returns (address[] memory c) {\\n uint256 lengthA = a.length;\\n uint256 lengthB = b.length;\\n unchecked {\\n c = new address[](lengthA + lengthB);\\n }\\n uint256 i;\\n for (; i < lengthA;) {\\n c[i] = a[i];\\n unchecked {\\n ++i;\\n }\\n }\\n for (uint256 j; j < lengthB;) {\\n c[i] = b[j];\\n unchecked {\\n ++i;\\n ++j;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce5d578861167da47a965c8a0e1592b808aad6eb79ccb1873bf2e2280ddb85ee\",\"license\":\"UNLICENSED\"},\"src/libraries/LibTokenInfo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/IERC721.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC1155/presets/ERC1155PresetMinterPauser.sol\\\";\\nimport \\\"../interfaces/IWETH.sol\\\";\\n\\nenum TokenStandard {\\n ERC20,\\n ERC721,\\n ERC1155\\n}\\n\\nstruct TokenInfo {\\n TokenStandard erc;\\n // For ERC20: the id must be 0 and the quantity is larger than 0.\\n // For ERC721: the quantity must be 0.\\n uint256 id;\\n uint256 quantity;\\n}\\n\\n/**\\n * @dev Error indicating that the `transfer` has failed.\\n * @param tokenInfo Info of the token including ERC standard, id or quantity.\\n * @param to Receiver of the token value.\\n * @param token Address of the token.\\n */\\nerror ErrTokenCouldNotTransfer(TokenInfo tokenInfo, address to, address token);\\n\\n/**\\n * @dev Error indicating that the `handleAssetIn` has failed.\\n * @param tokenInfo Info of the token including ERC standard, id or quantity.\\n * @param from Owner of the token value.\\n * @param to Receiver of the token value.\\n * @param token Address of the token.\\n */\\nerror ErrTokenCouldNotTransferFrom(TokenInfo tokenInfo, address from, address to, address token);\\n\\n/// @dev Error indicating that the provided information is invalid.\\nerror ErrInvalidInfo();\\n\\n/// @dev Error indicating that the minting of ERC20 tokens has failed.\\nerror ErrERC20MintingFailed();\\n\\n/// @dev Error indicating that the minting of ERC721 tokens has failed.\\nerror ErrERC721MintingFailed();\\n\\n/// @dev Error indicating that the transfer of ERC1155 tokens has failed.\\nerror ErrERC1155TransferFailed();\\n\\n/// @dev Error indicating that the mint of ERC1155 tokens has failed.\\nerror ErrERC1155MintingFailed();\\n\\n/// @dev Error indicating that an unsupported standard is encountered.\\nerror ErrUnsupportedStandard();\\n\\nlibrary LibTokenInfo {\\n /**\\n *\\n * HASH\\n *\\n */\\n\\n // keccak256(\\\"TokenInfo(uint8 erc,uint256 id,uint256 quantity)\\\");\\n bytes32 public constant INFO_TYPE_HASH_SINGLE = 0x1e2b74b2a792d5c0f0b6e59b037fa9d43d84fbb759337f0112fcc15ca414fc8d;\\n\\n /**\\n * @dev Returns token info struct hash.\\n */\\n function hash(TokenInfo memory self) internal pure returns (bytes32 digest) {\\n // keccak256(abi.encode(INFO_TYPE_HASH_SINGLE, info.erc, info.id, info.quantity))\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n mstore(ptr, INFO_TYPE_HASH_SINGLE)\\n mstore(add(ptr, 0x20), mload(self)) // info.erc\\n mstore(add(ptr, 0x40), mload(add(self, 0x20))) // info.id\\n mstore(add(ptr, 0x60), mload(add(self, 0x40))) // info.quantity\\n digest := keccak256(ptr, 0x80)\\n }\\n }\\n\\n /**\\n *\\n * VALIDATE\\n *\\n */\\n\\n /**\\n * @dev Validates the token info.\\n */\\n function validate(TokenInfo memory self) internal pure {\\n if (!(_checkERC20(self) || _checkERC721(self) || _checkERC1155(self))) {\\n revert ErrInvalidInfo();\\n }\\n }\\n\\n function _checkERC20(TokenInfo memory self) private pure returns (bool) {\\n return (self.erc == TokenStandard.ERC20 && self.quantity > 0 && self.id == 0);\\n }\\n\\n function _checkERC721(TokenInfo memory self) private pure returns (bool) {\\n return (self.erc == TokenStandard.ERC721 && self.quantity == 0);\\n }\\n\\n function _checkERC1155(TokenInfo memory self) private pure returns (bool res) {\\n // Only validate the quantity, because id of ERC-1155 can be 0.\\n return (self.erc == TokenStandard.ERC1155 && self.quantity > 0);\\n }\\n\\n /**\\n *\\n * TRANSFER IN/OUT METHOD\\n *\\n */\\n\\n /**\\n * @dev Transfer asset in.\\n *\\n * Requirements:\\n * - The `_from` address must approve for the contract using this library.\\n *\\n */\\n function handleAssetIn(TokenInfo memory self, address from, address token) internal {\\n bool success;\\n bytes memory data;\\n if (self.erc == TokenStandard.ERC20) {\\n (success, data) = token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, address(this), self.quantity));\\n success = success && (data.length == 0 || abi.decode(data, (bool)));\\n } else if (self.erc == TokenStandard.ERC721) {\\n success = _tryTransferFromERC721(token, from, address(this), self.id);\\n } else if (self.erc == TokenStandard.ERC1155) {\\n success = _tryTransferFromERC1155(token, from, address(this), self.id, self.quantity);\\n } else {\\n revert ErrUnsupportedStandard();\\n }\\n\\n if (!success) revert ErrTokenCouldNotTransferFrom(self, from, address(this), token);\\n }\\n\\n /**\\n * @dev Tries transfer assets out, or mint the assets if cannot transfer.\\n *\\n * @notice Prioritizes transfer native token if the token is wrapped.\\n *\\n */\\n function handleAssetOut(TokenInfo memory self, address payable to, address token, IWETH wrappedNativeToken) internal {\\n if (token == address(wrappedNativeToken)) {\\n // Try sending the native token before transferring the wrapped token\\n if (!to.send(self.quantity)) {\\n wrappedNativeToken.deposit{ value: self.quantity }();\\n _transferTokenOut(self, to, token);\\n }\\n\\n return;\\n }\\n\\n if (self.erc == TokenStandard.ERC20) {\\n uint256 balance = IERC20(token).balanceOf(address(this));\\n if (balance < self.quantity) {\\n if (!_tryMintERC20(token, address(this), self.quantity - balance)) revert ErrERC20MintingFailed();\\n }\\n\\n _transferTokenOut(self, to, token);\\n return;\\n }\\n\\n if (self.erc == TokenStandard.ERC721) {\\n if (!_tryTransferOutOrMintERC721(token, to, self.id)) {\\n revert ErrERC721MintingFailed();\\n }\\n return;\\n }\\n\\n if (self.erc == TokenStandard.ERC1155) {\\n if (!_tryTransferOutOrMintERC1155(token, to, self.id, self.quantity)) {\\n revert ErrERC1155MintingFailed();\\n }\\n return;\\n }\\n\\n revert ErrUnsupportedStandard();\\n }\\n\\n /**\\n *\\n * TRANSFER HELPERS\\n *\\n */\\n\\n /**\\n * @dev Transfer assets from current address to `_to` address.\\n */\\n function _transferTokenOut(TokenInfo memory self, address to, address token) private {\\n bool success;\\n if (self.erc == TokenStandard.ERC20) {\\n success = _tryTransferERC20(token, to, self.quantity);\\n } else if (self.erc == TokenStandard.ERC721) {\\n success = _tryTransferFromERC721(token, address(this), to, self.id);\\n } else {\\n revert ErrUnsupportedStandard();\\n }\\n\\n if (!success) revert ErrTokenCouldNotTransfer(self, to, token);\\n }\\n\\n /**\\n * TRANSFER ERC-20\\n */\\n\\n /**\\n * @dev Transfers ERC20 token and returns the result.\\n */\\n function _tryTransferERC20(address token, address to, uint256 quantity) private returns (bool success) {\\n bytes memory data;\\n (success, data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, quantity));\\n success = success && (data.length == 0 || abi.decode(data, (bool)));\\n }\\n\\n /**\\n * @dev Mints ERC20 token and returns the result.\\n */\\n function _tryMintERC20(address token, address to, uint256 quantity) private returns (bool success) {\\n // bytes4(keccak256(\\\"mint(address,uint256)\\\"))\\n (success,) = token.call(abi.encodeWithSelector(0x40c10f19, to, quantity));\\n }\\n\\n /**\\n * TRANSFER ERC-721\\n */\\n\\n /**\\n * @dev Transfers the ERC721 token out. If the transfer failed, mints the ERC721.\\n * @return success Returns `false` if both transfer and mint are failed.\\n */\\n function _tryTransferOutOrMintERC721(address token, address to, uint256 id) private returns (bool success) {\\n success = _tryTransferFromERC721(token, address(this), to, id);\\n if (!success) {\\n return _tryMintERC721(token, to, id);\\n }\\n }\\n\\n /**\\n * @dev Transfers ERC721 token and returns the result.\\n */\\n function _tryTransferFromERC721(address token, address from, address to, uint256 id) private returns (bool success) {\\n (success,) = token.call(abi.encodeWithSelector(IERC721.transferFrom.selector, from, to, id));\\n }\\n\\n /**\\n * @dev Mints ERC721 token and returns the result.\\n */\\n function _tryMintERC721(address token, address to, uint256 id) private returns (bool success) {\\n // bytes4(keccak256(\\\"mint(address,uint256)\\\"))\\n (success,) = token.call(abi.encodeWithSelector(0x40c10f19, to, id));\\n }\\n\\n /**\\n * TRANSFER ERC-1155\\n */\\n\\n /**\\n * @dev Transfers the ERC1155 token out. If the transfer failed, mints the ERC11555.\\n * @return success Returns `false` if both transfer and mint are failed.\\n */\\n function _tryTransferOutOrMintERC1155(address token, address to, uint256 id, uint256 amount) private returns (bool success) {\\n success = _tryTransferFromERC1155(token, address(this), to, id, amount);\\n if (!success) {\\n return _tryMintERC1155(token, to, id, amount);\\n }\\n }\\n\\n /**\\n * @dev Transfers ERC1155 token and returns the result.\\n */\\n function _tryTransferFromERC1155(address token, address from, address to, uint256 id, uint256 amount) private returns (bool success) {\\n (success,) = token.call(abi.encodeCall(IERC1155.safeTransferFrom, (from, to, id, amount, new bytes(0))));\\n }\\n\\n /**\\n * @dev Mints ERC1155 token and returns the result.\\n */\\n function _tryMintERC1155(address token, address to, uint256 id, uint256 amount) private returns (bool success) {\\n (success,) = token.call(abi.encodeCall(ERC1155PresetMinterPauser.mint, (to, id, amount, new bytes(0))));\\n }\\n}\\n\",\"keccak256\":\"0x56b413a42c6c39a51dc1737e735d1623b89ecdf00bacd960f70b3f18ccaa6de2\",\"license\":\"MIT\"},\"src/libraries/LibTokenOwner.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nstruct TokenOwner {\\n address addr;\\n address tokenAddr;\\n uint256 chainId;\\n}\\n\\nlibrary LibTokenOwner {\\n // keccak256(\\\"TokenOwner(address addr,address tokenAddr,uint256 chainId)\\\");\\n bytes32 public constant OWNER_TYPE_HASH = 0x353bdd8d69b9e3185b3972e08b03845c0c14a21a390215302776a7a34b0e8764;\\n\\n /**\\n * @dev Returns ownership struct hash.\\n */\\n function hash(TokenOwner memory owner) internal pure returns (bytes32 digest) {\\n // keccak256(abi.encode(OWNER_TYPE_HASH, owner.addr, owner.tokenAddr, owner.chainId))\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n mstore(ptr, OWNER_TYPE_HASH)\\n mstore(add(ptr, 0x20), mload(owner)) // owner.addr\\n mstore(add(ptr, 0x40), mload(add(owner, 0x20))) // owner.tokenAddr\\n mstore(add(ptr, 0x60), mload(add(owner, 0x40))) // owner.chainId\\n digest := keccak256(ptr, 0x80)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb104fd02056a3ed52bf06c202e87b748200320682871b1801985050587ec2d51\",\"license\":\"MIT\"},\"src/libraries/Transfer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./LibTokenInfo.sol\\\";\\nimport \\\"./LibTokenOwner.sol\\\";\\n\\nlibrary Transfer {\\n using ECDSA for bytes32;\\n using LibTokenOwner for TokenOwner;\\n using LibTokenInfo for TokenInfo;\\n\\n enum Kind {\\n Deposit,\\n Withdrawal\\n }\\n\\n struct Request {\\n // For deposit request: Recipient address on Ronin network\\n // For withdrawal request: Recipient address on mainchain network\\n address recipientAddr;\\n // Token address to deposit/withdraw\\n // Value 0: native token\\n address tokenAddr;\\n TokenInfo info;\\n }\\n\\n /**\\n * @dev Converts the transfer request into the deposit receipt.\\n */\\n function into_deposit_receipt(\\n Request memory _request,\\n address _requester,\\n uint256 _id,\\n address _roninTokenAddr,\\n uint256 _roninChainId\\n ) internal view returns (Receipt memory _receipt) {\\n _receipt.id = _id;\\n _receipt.kind = Kind.Deposit;\\n _receipt.mainchain.addr = _requester;\\n _receipt.mainchain.tokenAddr = _request.tokenAddr;\\n _receipt.mainchain.chainId = block.chainid;\\n _receipt.ronin.addr = _request.recipientAddr;\\n _receipt.ronin.tokenAddr = _roninTokenAddr;\\n _receipt.ronin.chainId = _roninChainId;\\n _receipt.info = _request.info;\\n }\\n\\n /**\\n * @dev Converts the transfer request into the withdrawal receipt.\\n */\\n function into_withdrawal_receipt(\\n Request memory _request,\\n address _requester,\\n uint256 _id,\\n address _mainchainTokenAddr,\\n uint256 _mainchainId\\n ) internal view returns (Receipt memory _receipt) {\\n _receipt.id = _id;\\n _receipt.kind = Kind.Withdrawal;\\n _receipt.ronin.addr = _requester;\\n _receipt.ronin.tokenAddr = _request.tokenAddr;\\n _receipt.ronin.chainId = block.chainid;\\n _receipt.mainchain.addr = _request.recipientAddr;\\n _receipt.mainchain.tokenAddr = _mainchainTokenAddr;\\n _receipt.mainchain.chainId = _mainchainId;\\n _receipt.info = _request.info;\\n }\\n\\n struct Receipt {\\n uint256 id;\\n Kind kind;\\n TokenOwner mainchain;\\n TokenOwner ronin;\\n TokenInfo info;\\n }\\n\\n // keccak256(\\\"Receipt(uint256 id,uint8 kind,TokenOwner mainchain,TokenOwner ronin,TokenInfo info)TokenInfo(uint8 erc,uint256 id,uint256 quantity)TokenOwner(address addr,address tokenAddr,uint256 chainId)\\\");\\n bytes32 public constant TYPE_HASH = 0xb9d1fe7c9deeec5dc90a2f47ff1684239519f2545b2228d3d91fb27df3189eea;\\n\\n /**\\n * @dev Returns token info struct hash.\\n */\\n function hash(Receipt memory _receipt) internal pure returns (bytes32 digest) {\\n bytes32 hashedReceiptMainchain = _receipt.mainchain.hash();\\n bytes32 hashedReceiptRonin = _receipt.ronin.hash();\\n bytes32 hashedReceiptInfo = _receipt.info.hash();\\n\\n /*\\n * return\\n * keccak256(\\n * abi.encode(\\n * TYPE_HASH,\\n * _receipt.id,\\n * _receipt.kind,\\n * Token.hash(_receipt.mainchain),\\n * Token.hash(_receipt.ronin),\\n * Token.hash(_receipt.info)\\n * )\\n * );\\n */\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, TYPE_HASH)\\n mstore(add(ptr, 0x20), mload(_receipt)) // _receipt.id\\n mstore(add(ptr, 0x40), mload(add(_receipt, 0x20))) // _receipt.kind\\n mstore(add(ptr, 0x60), hashedReceiptMainchain)\\n mstore(add(ptr, 0x80), hashedReceiptRonin)\\n mstore(add(ptr, 0xa0), hashedReceiptInfo)\\n digest := keccak256(ptr, 0xc0)\\n }\\n }\\n\\n /**\\n * @dev Returns the receipt digest.\\n */\\n function receiptDigest(bytes32 _domainSeparator, bytes32 _receiptHash) internal pure returns (bytes32) {\\n return _domainSeparator.toTypedDataHash(_receiptHash);\\n }\\n}\\n\",\"keccak256\":\"0x652c72f4e9aeffed1be05759c84c538a416d2c264deef9af4c53de0a1ad04ee4\",\"license\":\"MIT\"},\"src/mainchain/MainchainGatewayV3.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.23;\\n\\nimport \\\"@openzeppelin/contracts/access/AccessControlEnumerable.sol\\\";\\nimport \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol\\\";\\nimport { IBridgeManager } from \\\"../interfaces/bridge/IBridgeManager.sol\\\";\\nimport { IBridgeManagerCallback } from \\\"../interfaces/bridge/IBridgeManagerCallback.sol\\\";\\nimport { HasContracts, ContractType } from \\\"../extensions/collections/HasContracts.sol\\\";\\nimport \\\"../extensions/WethUnwrapper.sol\\\";\\nimport \\\"../extensions/WithdrawalLimitation.sol\\\";\\nimport \\\"../libraries/Transfer.sol\\\";\\nimport \\\"../interfaces/IMainchainGatewayV3.sol\\\";\\n\\ncontract MainchainGatewayV3 is\\n WithdrawalLimitation,\\n Initializable,\\n AccessControlEnumerable,\\n ERC1155Holder,\\n IMainchainGatewayV3,\\n HasContracts,\\n IBridgeManagerCallback\\n{\\n using LibTokenInfo for TokenInfo;\\n using Transfer for Transfer.Request;\\n using Transfer for Transfer.Receipt;\\n\\n /// @dev Withdrawal unlocker role hash\\n bytes32 public constant WITHDRAWAL_UNLOCKER_ROLE = keccak256(\\\"WITHDRAWAL_UNLOCKER_ROLE\\\");\\n\\n /// @dev Wrapped native token address\\n IWETH public wrappedNativeToken;\\n /// @dev Ronin network id\\n uint256 public roninChainId;\\n /// @dev Total deposit\\n uint256 public depositCount;\\n /// @dev Domain separator\\n bytes32 internal _domainSeparator;\\n /// @dev Mapping from mainchain token => token address on Ronin network\\n mapping(address => MappedToken) internal _roninToken;\\n /// @dev Mapping from withdrawal id => withdrawal hash\\n mapping(uint256 => bytes32) public withdrawalHash;\\n /// @dev Mapping from withdrawal id => locked\\n mapping(uint256 => bool) public withdrawalLocked;\\n\\n /// @custom:deprecated Previously `_bridgeOperatorAddedBlock` (mapping(address => uint256))\\n uint256 private ______deprecatedBridgeOperatorAddedBlock;\\n /// @custom:deprecated Previously `_bridgeOperators` (uint256[])\\n uint256 private ______deprecatedBridgeOperators;\\n\\n uint96 private _totalOperatorWeight;\\n mapping(address operator => uint96 weight) private _operatorWeight;\\n WethUnwrapper public wethUnwrapper;\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n receive() external payable {\\n _fallback();\\n }\\n\\n /**\\n * @dev Initializes contract storage.\\n */\\n function initialize(\\n address _roleSetter,\\n IWETH _wrappedToken,\\n uint256 _roninChainId,\\n uint256 _numerator,\\n uint256 _highTierVWNumerator,\\n uint256 _denominator,\\n // _addresses[0]: mainchainTokens\\n // _addresses[1]: roninTokens\\n // _addresses[2]: withdrawalUnlockers\\n address[][3] calldata _addresses,\\n // _thresholds[0]: highTierThreshold\\n // _thresholds[1]: lockedThreshold\\n // _thresholds[2]: unlockFeePercentages\\n // _thresholds[3]: dailyWithdrawalLimit\\n uint256[][4] calldata _thresholds,\\n TokenStandard[] calldata _standards\\n ) external payable virtual initializer {\\n _setupRole(DEFAULT_ADMIN_ROLE, _roleSetter);\\n roninChainId = _roninChainId;\\n\\n _setWrappedNativeTokenContract(_wrappedToken);\\n _updateDomainSeparator();\\n _setThreshold(_numerator, _denominator);\\n _setHighTierVoteWeightThreshold(_highTierVWNumerator, _denominator);\\n _verifyThresholds();\\n\\n if (_addresses[0].length > 0) {\\n // Map mainchain tokens to ronin tokens\\n _mapTokens(_addresses[0], _addresses[1], _standards);\\n // Sets thresholds based on the mainchain tokens\\n _setHighTierThresholds(_addresses[0], _thresholds[0]);\\n _setLockedThresholds(_addresses[0], _thresholds[1]);\\n _setUnlockFeePercentages(_addresses[0], _thresholds[2]);\\n _setDailyWithdrawalLimits(_addresses[0], _thresholds[3]);\\n }\\n\\n // Grant role for withdrawal unlocker\\n for (uint256 i; i < _addresses[2].length; i++) {\\n _grantRole(WITHDRAWAL_UNLOCKER_ROLE, _addresses[2][i]);\\n }\\n }\\n\\n function initializeV2(address bridgeManagerContract) external reinitializer(2) {\\n _setContract(ContractType.BRIDGE_MANAGER, bridgeManagerContract);\\n }\\n\\n function initializeV3() external reinitializer(3) {\\n IBridgeManager mainchainBridgeManager = IBridgeManager(getContract(ContractType.BRIDGE_MANAGER));\\n (, address[] memory operators, uint96[] memory weights) = mainchainBridgeManager.getFullBridgeOperatorInfos();\\n\\n uint96 totalWeight;\\n for (uint i; i < operators.length; i++) {\\n _operatorWeight[operators[i]] = weights[i];\\n totalWeight += weights[i];\\n }\\n _totalOperatorWeight = totalWeight;\\n }\\n\\n function initializeV4(address payable wethUnwrapper_) external reinitializer(4) {\\n wethUnwrapper = WethUnwrapper(wethUnwrapper_);\\n }\\n\\n /**\\n * @dev Receives ether without doing anything. Use this function to topup native token.\\n */\\n function receiveEther() external payable { }\\n\\n /**\\n * @inheritdoc IMainchainGatewayV3\\n */\\n function DOMAIN_SEPARATOR() external view virtual returns (bytes32) {\\n return _domainSeparator;\\n }\\n\\n /**\\n * @inheritdoc IMainchainGatewayV3\\n */\\n function setWrappedNativeTokenContract(IWETH _wrappedToken) external virtual onlyProxyAdmin {\\n _setWrappedNativeTokenContract(_wrappedToken);\\n }\\n\\n /**\\n * @inheritdoc IMainchainGatewayV3\\n */\\n function requestDepositFor(Transfer.Request calldata _request) external payable virtual whenNotPaused {\\n _requestDepositFor(_request, msg.sender);\\n }\\n\\n /**\\n * @inheritdoc IMainchainGatewayV3\\n */\\n function submitWithdrawal(Transfer.Receipt calldata _receipt, Signature[] calldata _signatures) external virtual whenNotPaused returns (bool _locked) {\\n return _submitWithdrawal(_receipt, _signatures);\\n }\\n\\n /**\\n * @inheritdoc IMainchainGatewayV3\\n */\\n function unlockWithdrawal(Transfer.Receipt calldata receipt) external onlyRole(WITHDRAWAL_UNLOCKER_ROLE) {\\n bytes32 _receiptHash = receipt.hash();\\n if (withdrawalHash[receipt.id] != receipt.hash()) {\\n revert ErrInvalidReceipt();\\n }\\n if (!withdrawalLocked[receipt.id]) {\\n revert ErrQueryForApprovedWithdrawal();\\n }\\n delete withdrawalLocked[receipt.id];\\n emit WithdrawalUnlocked(_receiptHash, receipt);\\n\\n address token = receipt.mainchain.tokenAddr;\\n if (receipt.info.erc == TokenStandard.ERC20) {\\n TokenInfo memory feeInfo = receipt.info;\\n feeInfo.quantity = _computeFeePercentage(receipt.info.quantity, unlockFeePercentages[token]);\\n TokenInfo memory withdrawInfo = receipt.info;\\n withdrawInfo.quantity = receipt.info.quantity - feeInfo.quantity;\\n\\n feeInfo.handleAssetOut(payable(msg.sender), token, wrappedNativeToken);\\n withdrawInfo.handleAssetOut(payable(receipt.mainchain.addr), token, wrappedNativeToken);\\n } else {\\n receipt.info.handleAssetOut(payable(receipt.mainchain.addr), token, wrappedNativeToken);\\n }\\n\\n emit Withdrew(_receiptHash, receipt);\\n }\\n\\n /**\\n * @inheritdoc IMainchainGatewayV3\\n */\\n function mapTokens(address[] calldata _mainchainTokens, address[] calldata _roninTokens, TokenStandard[] calldata _standards) external virtual onlyProxyAdmin {\\n if (_mainchainTokens.length == 0) revert ErrEmptyArray();\\n _mapTokens(_mainchainTokens, _roninTokens, _standards);\\n }\\n\\n /**\\n * @inheritdoc IMainchainGatewayV3\\n */\\n function mapTokensAndThresholds(\\n address[] calldata _mainchainTokens,\\n address[] calldata _roninTokens,\\n TokenStandard[] calldata _standards,\\n // _thresholds[0]: highTierThreshold\\n // _thresholds[1]: lockedThreshold\\n // _thresholds[2]: unlockFeePercentages\\n // _thresholds[3]: dailyWithdrawalLimit\\n uint256[][4] calldata _thresholds\\n ) external virtual onlyProxyAdmin {\\n if (_mainchainTokens.length == 0) revert ErrEmptyArray();\\n _mapTokens(_mainchainTokens, _roninTokens, _standards);\\n _setHighTierThresholds(_mainchainTokens, _thresholds[0]);\\n _setLockedThresholds(_mainchainTokens, _thresholds[1]);\\n _setUnlockFeePercentages(_mainchainTokens, _thresholds[2]);\\n _setDailyWithdrawalLimits(_mainchainTokens, _thresholds[3]);\\n }\\n\\n /**\\n * @inheritdoc IMainchainGatewayV3\\n */\\n function getRoninToken(address mainchainToken) public view returns (MappedToken memory token) {\\n token = _roninToken[mainchainToken];\\n if (token.tokenAddr == address(0)) revert ErrUnsupportedToken();\\n }\\n\\n /**\\n * @dev Maps mainchain tokens to Ronin network.\\n *\\n * Requirement:\\n * - The arrays have the same length.\\n *\\n * Emits the `TokenMapped` event.\\n *\\n */\\n function _mapTokens(address[] calldata mainchainTokens, address[] calldata roninTokens, TokenStandard[] calldata standards) internal virtual {\\n if (!(mainchainTokens.length == roninTokens.length && mainchainTokens.length == standards.length)) revert ErrLengthMismatch(msg.sig);\\n\\n for (uint256 i; i < mainchainTokens.length; ++i) {\\n _roninToken[mainchainTokens[i]].tokenAddr = roninTokens[i];\\n _roninToken[mainchainTokens[i]].erc = standards[i];\\n }\\n\\n emit TokenMapped(mainchainTokens, roninTokens, standards);\\n }\\n\\n /**\\n * @dev Submits withdrawal receipt.\\n *\\n * Requirements:\\n * - The receipt kind is withdrawal.\\n * - The receipt is to withdraw on this chain.\\n * - The receipt is not used to withdraw before.\\n * - The withdrawal is not reached the limit threshold.\\n * - The signer weight total is larger than or equal to the minimum threshold.\\n * - The signature signers are in order.\\n *\\n * Emits the `Withdrew` once the assets are released.\\n *\\n */\\n function _submitWithdrawal(Transfer.Receipt calldata receipt, Signature[] memory signatures) internal virtual returns (bool locked) {\\n uint256 id = receipt.id;\\n uint256 quantity = receipt.info.quantity;\\n address tokenAddr = receipt.mainchain.tokenAddr;\\n\\n receipt.info.validate();\\n if (receipt.kind != Transfer.Kind.Withdrawal) revert ErrInvalidReceiptKind();\\n\\n if (receipt.mainchain.chainId != block.chainid) {\\n revert ErrInvalidChainId(msg.sig, receipt.mainchain.chainId, block.chainid);\\n }\\n\\n MappedToken memory token = getRoninToken(receipt.mainchain.tokenAddr);\\n\\n if (!(token.erc == receipt.info.erc && token.tokenAddr == receipt.ronin.tokenAddr && receipt.ronin.chainId == roninChainId)) {\\n revert ErrInvalidReceipt();\\n }\\n\\n if (withdrawalHash[id] != 0) revert ErrQueryForProcessedWithdrawal();\\n\\n if (!(receipt.info.erc == TokenStandard.ERC721 || !_reachedWithdrawalLimit(tokenAddr, quantity))) {\\n revert ErrReachedDailyWithdrawalLimit();\\n }\\n\\n bytes32 receiptHash = receipt.hash();\\n bytes32 receiptDigest = Transfer.receiptDigest(_domainSeparator, receiptHash);\\n\\n uint256 minimumWeight;\\n (minimumWeight, locked) = _computeMinVoteWeight(receipt.info.erc, tokenAddr, quantity);\\n\\n {\\n bool passed;\\n address signer;\\n address lastSigner;\\n Signature memory sig;\\n uint256 weight;\\n for (uint256 i; i < signatures.length; i++) {\\n sig = signatures[i];\\n signer = ecrecover(receiptDigest, sig.v, sig.r, sig.s);\\n if (lastSigner >= signer) revert ErrInvalidOrder(msg.sig);\\n\\n lastSigner = signer;\\n\\n weight += _getWeight(signer);\\n if (weight >= minimumWeight) {\\n passed = true;\\n break;\\n }\\n }\\n\\n if (!passed) revert ErrQueryForInsufficientVoteWeight();\\n withdrawalHash[id] = receiptHash;\\n }\\n\\n if (locked) {\\n withdrawalLocked[id] = true;\\n emit WithdrawalLocked(receiptHash, receipt);\\n return locked;\\n }\\n\\n _recordWithdrawal(tokenAddr, quantity);\\n receipt.info.handleAssetOut(payable(receipt.mainchain.addr), tokenAddr, wrappedNativeToken);\\n emit Withdrew(receiptHash, receipt);\\n }\\n\\n /**\\n * @dev Requests deposit made by `_requester` address.\\n *\\n * Requirements:\\n * - The token info is valid.\\n * - The `msg.value` is 0 while depositing ERC20 token.\\n * - The `msg.value` is equal to deposit quantity while depositing native token.\\n *\\n * Emits the `DepositRequested` event.\\n *\\n */\\n function _requestDepositFor(Transfer.Request memory _request, address _requester) internal virtual {\\n MappedToken memory _token;\\n address _roninWeth = address(wrappedNativeToken);\\n\\n _request.info.validate();\\n if (_request.tokenAddr == address(0)) {\\n if (_request.info.quantity != msg.value) revert ErrInvalidRequest();\\n\\n _token = getRoninToken(_roninWeth);\\n if (_token.erc != _request.info.erc) revert ErrInvalidTokenStandard();\\n\\n _request.tokenAddr = _roninWeth;\\n } else {\\n if (msg.value != 0) revert ErrInvalidRequest();\\n\\n _token = getRoninToken(_request.tokenAddr);\\n if (_token.erc != _request.info.erc) revert ErrInvalidTokenStandard();\\n\\n _request.info.handleAssetIn(_requester, _request.tokenAddr);\\n // Withdraw if token is WETH\\n // The withdraw of WETH must go via `WethUnwrapper`, because `WETH.withdraw` only sends 2300 gas, which is insufficient when recipient is a proxy.\\n if (_roninWeth == _request.tokenAddr) {\\n wrappedNativeToken.approve(address(wethUnwrapper), _request.info.quantity);\\n wethUnwrapper.unwrap(_request.info.quantity);\\n }\\n }\\n\\n uint256 _depositId = depositCount++;\\n Transfer.Receipt memory _receipt = _request.into_deposit_receipt(_requester, _depositId, _token.tokenAddr, roninChainId);\\n\\n emit DepositRequested(_receipt.hash(), _receipt);\\n }\\n\\n /**\\n * @dev Returns the minimum vote weight for the token.\\n */\\n function _computeMinVoteWeight(TokenStandard _erc, address _token, uint256 _quantity) internal virtual returns (uint256 _weight, bool _locked) {\\n uint256 _totalWeight = _getTotalWeight();\\n _weight = _minimumVoteWeight(_totalWeight);\\n if (_erc == TokenStandard.ERC20) {\\n if (highTierThreshold[_token] <= _quantity) {\\n _weight = _highTierVoteWeight(_totalWeight);\\n }\\n _locked = _lockedWithdrawalRequest(_token, _quantity);\\n }\\n }\\n\\n /**\\n * @dev Update domain seperator.\\n */\\n function _updateDomainSeparator() internal {\\n /*\\n * _domainSeparator = keccak256(\\n * abi.encode(\\n * keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"),\\n * keccak256(\\\"MainchainGatewayV2\\\"),\\n * keccak256(\\\"2\\\"),\\n * block.chainid,\\n * address(this)\\n * )\\n * );\\n */\\n assembly {\\n let ptr := mload(0x40)\\n // keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\")\\n mstore(ptr, 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f)\\n // keccak256(\\\"MainchainGatewayV2\\\")\\n mstore(add(ptr, 0x20), 0x159f52c1e3a2b6a6aad3950adf713516211484e0516dad685ea662a094b7c43b)\\n // keccak256(\\\"2\\\")\\n mstore(add(ptr, 0x40), 0xad7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5)\\n mstore(add(ptr, 0x60), chainid())\\n mstore(add(ptr, 0x80), address())\\n sstore(_domainSeparator.slot, keccak256(ptr, 0xa0))\\n }\\n }\\n\\n /**\\n * @dev Sets the WETH contract.\\n *\\n * Emits the `WrappedNativeTokenContractUpdated` event.\\n *\\n */\\n function _setWrappedNativeTokenContract(IWETH _wrapedToken) internal {\\n wrappedNativeToken = _wrapedToken;\\n emit WrappedNativeTokenContractUpdated(_wrapedToken);\\n }\\n\\n /**\\n * @dev Receives ETH from WETH or creates deposit request if sender is not WETH or WETHUnwrapper.\\n */\\n function _fallback() internal virtual {\\n if (msg.sender == address(wrappedNativeToken) || msg.sender == address(wethUnwrapper)) {\\n return;\\n }\\n\\n _createDepositOnFallback();\\n }\\n\\n /**\\n * @dev Creates deposit request.\\n */\\n function _createDepositOnFallback() internal virtual whenNotPaused {\\n Transfer.Request memory _request;\\n _request.recipientAddr = msg.sender;\\n _request.info.quantity = msg.value;\\n _requestDepositFor(_request, _request.recipientAddr);\\n }\\n\\n /**\\n * @inheritdoc GatewayV3\\n */\\n function _getTotalWeight() internal view override returns (uint256) {\\n return _totalOperatorWeight;\\n }\\n\\n /**\\n * @dev Returns the weight of an address.\\n */\\n function _getWeight(address addr) internal view returns (uint256) {\\n return _operatorWeight[addr];\\n }\\n\\n ///////////////////////////////////////////////\\n // CALLBACKS\\n ///////////////////////////////////////////////\\n\\n /**\\n * @inheritdoc IBridgeManagerCallback\\n */\\n function onBridgeOperatorsAdded(\\n address[] calldata operators,\\n uint96[] calldata weights,\\n bool[] memory addeds\\n ) external onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) {\\n uint256 length = operators.length;\\n if (length != addeds.length || length != weights.length) revert ErrLengthMismatch(msg.sig);\\n if (length == 0) {\\n return IBridgeManagerCallback.onBridgeOperatorsAdded.selector;\\n }\\n\\n for (uint256 i; i < length; ++i) {\\n unchecked {\\n if (addeds[i]) {\\n _totalOperatorWeight += weights[i];\\n _operatorWeight[operators[i]] = weights[i];\\n }\\n }\\n }\\n\\n return IBridgeManagerCallback.onBridgeOperatorsAdded.selector;\\n }\\n\\n /**\\n * @inheritdoc IBridgeManagerCallback\\n */\\n function onBridgeOperatorsRemoved(address[] calldata operators, bool[] calldata removeds) external onlyContract(ContractType.BRIDGE_MANAGER) returns (bytes4) {\\n uint length = operators.length;\\n if (length != removeds.length) revert ErrLengthMismatch(msg.sig);\\n if (length == 0) {\\n return IBridgeManagerCallback.onBridgeOperatorsRemoved.selector;\\n }\\n\\n uint96 totalRemovingWeight;\\n for (uint i; i < length; ++i) {\\n unchecked {\\n if (removeds[i]) {\\n totalRemovingWeight += _operatorWeight[operators[i]];\\n delete _operatorWeight[operators[i]];\\n }\\n }\\n }\\n\\n _totalOperatorWeight -= totalRemovingWeight;\\n\\n return IBridgeManagerCallback.onBridgeOperatorsRemoved.selector;\\n }\\n\\n function supportsInterface(bytes4 interfaceId) public view override(AccessControlEnumerable, IERC165, ERC1155Receiver) returns (bool) {\\n return\\n interfaceId == type(IMainchainGatewayV3).interfaceId || interfaceId == type(IBridgeManagerCallback).interfaceId || super.supportsInterface(interfaceId);\\n }\\n}\\n\",\"keccak256\":\"0x6fc5c51508dd63916c19d07f93fa37e265fd7c347b9e5e0ad50a14f9ff85ab14\",\"license\":\"MIT\"},\"src/utils/CommonErrors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ContractType } from \\\"./ContractType.sol\\\";\\nimport { RoleAccess } from \\\"./RoleAccess.sol\\\";\\n\\nerror ErrSyncTooFarPeriod(uint256 period, uint256 latestRewardedPeriod);\\n/**\\n * @dev Error thrown when an address is expected to be an already created externally owned account (EOA).\\n * This error indicates that the provided address is invalid for certain contract operations that require already created EOA.\\n */\\nerror ErrAddressIsNotCreatedEOA(address addr, bytes32 codehash);\\n/**\\n * @dev Error raised when a bridge operator update operation fails.\\n * @param bridgeOperator The address of the bridge operator that failed to update.\\n */\\nerror ErrBridgeOperatorUpdateFailed(address bridgeOperator);\\n/**\\n * @dev Error thrown when attempting to add a bridge operator that already exists in the contract.\\n * This error indicates that the provided bridge operator address is already registered as a bridge operator in the contract.\\n */\\nerror ErrBridgeOperatorAlreadyExisted(address bridgeOperator);\\n/**\\n * @dev The error indicating an unsupported interface.\\n * @param interfaceId The bytes4 interface identifier that is not supported.\\n * @param addr The address where the unsupported interface was encountered.\\n */\\nerror ErrUnsupportedInterface(bytes4 interfaceId, address addr);\\n/**\\n * @dev Error thrown when the return data from a callback function is invalid.\\n * @param callbackFnSig The signature of the callback function that returned invalid data.\\n * @param register The address of the register where the callback function was invoked.\\n * @param returnData The invalid return data received from the callback function.\\n */\\nerror ErrInvalidReturnData(bytes4 callbackFnSig, address register, bytes returnData);\\n/**\\n * @dev Error of set to non-contract.\\n */\\nerror ErrZeroCodeContract(address addr);\\n/**\\n * @dev Error indicating that arguments are invalid.\\n */\\nerror ErrInvalidArguments(bytes4 msgSig);\\n/**\\n * @dev Error indicating that given address is null when it should not.\\n */\\nerror ErrZeroAddress(bytes4 msgSig);\\n/**\\n * @dev Error indicating that the provided threshold is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that the invalid threshold applies to.\\n */\\nerror ErrInvalidThreshold(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a function can only be called by the contract itself.\\n * @param msgSig The function signature (bytes4) that can only be called by the contract itself.\\n */\\nerror ErrOnlySelfCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n * @param expectedRole The role required to perform the function.\\n */\\nerror ErrUnauthorized(bytes4 msgSig, RoleAccess expectedRole);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4) that the caller is unauthorized to perform.\\n */\\nerror ErrUnauthorizedCall(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the caller is unauthorized to perform a specific function.\\n * @param msgSig The function signature (bytes4).\\n * @param expectedContractType The contract type required to perform the function.\\n * @param actual The actual address that called to the function.\\n */\\nerror ErrUnexpectedInternalCall(bytes4 msgSig, ContractType expectedContractType, address actual);\\n\\n/**\\n * @dev Error indicating that an array is empty when it should contain elements.\\n */\\nerror ErrEmptyArray();\\n\\n/**\\n * @dev Error indicating a mismatch in the length of input parameters or arrays for a specific function.\\n * @param msgSig The function signature (bytes4) that has a length mismatch.\\n */\\nerror ErrLengthMismatch(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a proxy call to an external contract has failed.\\n * @param msgSig The function signature (bytes4) of the proxy call that failed.\\n * @param extCallSig The function signature (bytes4) of the external contract call that failed.\\n */\\nerror ErrProxyCallFailed(bytes4 msgSig, bytes4 extCallSig);\\n\\n/**\\n * @dev Error indicating that a function tried to call a precompiled contract that is not allowed.\\n * @param msgSig The function signature (bytes4) that attempted to call a precompiled contract.\\n */\\nerror ErrCallPrecompiled(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a native token transfer has failed.\\n * @param msgSig The function signature (bytes4) of the token transfer that failed.\\n */\\nerror ErrNativeTransferFailed(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that an order is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid order.\\n */\\nerror ErrInvalidOrder(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the chain ID is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid chain ID.\\n * @param actual Current chain ID that executing function.\\n * @param expected Expected chain ID required for the tx to success.\\n */\\nerror ErrInvalidChainId(bytes4 msgSig, uint256 actual, uint256 expected);\\n\\n/**\\n * @dev Error indicating that a vote type is not supported.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an unsupported vote type.\\n */\\nerror ErrUnsupportedVoteType(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that the proposal nonce is invalid.\\n * @param msgSig The function signature (bytes4) of the operation that encountered an invalid proposal nonce.\\n */\\nerror ErrInvalidProposalNonce(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a voter has already voted.\\n * @param voter The address of the voter who has already voted.\\n */\\nerror ErrAlreadyVoted(address voter);\\n\\n/**\\n * @dev Error indicating that a signature is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid signature.\\n */\\nerror ErrInvalidSignatures(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a relay call has failed.\\n * @param msgSig The function signature (bytes4) of the relay call that failed.\\n */\\nerror ErrRelayFailed(bytes4 msgSig);\\n/**\\n * @dev Error indicating that a vote weight is invalid for a specific function signature.\\n * @param msgSig The function signature (bytes4) that encountered an invalid vote weight.\\n */\\nerror ErrInvalidVoteWeight(bytes4 msgSig);\\n\\n/**\\n * @dev Error indicating that a query was made for an outdated bridge operator set.\\n */\\nerror ErrQueryForOutdatedBridgeOperatorSet();\\n\\n/**\\n * @dev Error indicating that a request is invalid.\\n */\\nerror ErrInvalidRequest();\\n\\n/**\\n * @dev Error indicating that a token standard is invalid.\\n */\\nerror ErrInvalidTokenStandard();\\n\\n/**\\n * @dev Error indicating that a token is not supported.\\n */\\nerror ErrUnsupportedToken();\\n\\n/**\\n * @dev Error indicating that a receipt kind is invalid.\\n */\\nerror ErrInvalidReceiptKind();\\n\\n/**\\n * @dev Error indicating that a receipt is invalid.\\n */\\nerror ErrInvalidReceipt();\\n\\n/**\\n * @dev Error indicating that an address is not payable.\\n */\\nerror ErrNonpayableAddress(address);\\n\\n/**\\n * @dev Error indicating that the period is already processed, i.e. scattered reward.\\n */\\nerror ErrPeriodAlreadyProcessed(uint256 requestingPeriod, uint256 latestPeriod);\\n\\n/**\\n * @dev Error thrown when an invalid vote hash is provided.\\n */\\nerror ErrInvalidVoteHash();\\n\\n/**\\n * @dev Error thrown when querying for an empty vote.\\n */\\nerror ErrQueryForEmptyVote();\\n\\n/**\\n * @dev Error thrown when querying for an expired vote.\\n */\\nerror ErrQueryForExpiredVote();\\n\\n/**\\n * @dev Error thrown when querying for a non-existent vote.\\n */\\nerror ErrQueryForNonExistentVote();\\n\\n/**\\n * @dev Error indicating that the method is only called once per block.\\n */\\nerror ErrOncePerBlock();\\n\\n/**\\n * @dev Error of method caller must be coinbase\\n */\\nerror ErrCallerMustBeCoinbase();\\n\\n/**\\n * @dev Error thrown when an invalid proposal is encountered.\\n * @param actual The actual value of the proposal.\\n * @param expected The expected value of the proposal.\\n */\\nerror ErrInvalidProposal(bytes32 actual, bytes32 expected);\\n\\n/**\\n * @dev Error of proposal is not approved for executing.\\n */\\nerror ErrProposalNotApproved();\\n\\n/**\\n * @dev Error of the caller is not the specified executor.\\n */\\nerror ErrInvalidExecutor();\\n\\n/**\\n * @dev Error of the `caller` to relay is not the specified `executor`.\\n */\\nerror ErrNonExecutorCannotRelay(address executor, address caller);\\n\",\"keccak256\":\"0x0d9e2fd98f6b704273faad707ed9eadbd4c79551ee3f902bff5b29213a204679\",\"license\":\"MIT\"},\"src/utils/ContractType.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum ContractType {\\n UNKNOWN, // 0\\n PAUSE_ENFORCER, // 1\\n BRIDGE, // 2\\n BRIDGE_TRACKING, // 3\\n GOVERNANCE_ADMIN, // 4\\n MAINTENANCE, // 5\\n SLASH_INDICATOR, // 6\\n STAKING_VESTING, // 7\\n VALIDATOR, // 8\\n STAKING, // 9\\n RONIN_TRUSTED_ORGANIZATION, // 10\\n BRIDGE_MANAGER, // 11\\n BRIDGE_SLASH, // 12\\n BRIDGE_REWARD, // 13\\n FAST_FINALITY_TRACKING, // 14\\n PROFILE // 15\\n\\n}\\n\",\"keccak256\":\"0xec088aa939cd885dbe84e944942d7ea674e1fff8802c1f2ae5d8e84e4578357d\",\"license\":\"MIT\"},\"src/utils/IdentityGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { AddressArrayUtils } from \\\"../libraries/AddressArrayUtils.sol\\\";\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport { TransparentUpgradeableProxyV2 } from \\\"../extensions/TransparentUpgradeableProxyV2.sol\\\";\\nimport { ErrAddressIsNotCreatedEOA, ErrZeroAddress, ErrOnlySelfCall, ErrZeroCodeContract, ErrUnsupportedInterface } from \\\"./CommonErrors.sol\\\";\\n\\nabstract contract IdentityGuard {\\n using AddressArrayUtils for address[];\\n\\n /// @dev value is equal to keccak256(abi.encode())\\n /// @dev see: https://eips.ethereum.org/EIPS/eip-1052\\n bytes32 internal constant CREATED_ACCOUNT_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\\n\\n /**\\n * @dev Modifier to restrict functions to only be called by this contract.\\n * @dev Reverts if the caller is not this contract.\\n */\\n modifier onlySelfCall() virtual {\\n _requireSelfCall();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to ensure that the elements in the `arr` array are non-duplicates.\\n * It calls the internal `_checkDuplicate` function to perform the duplicate check.\\n *\\n * Requirements:\\n * - The elements in the `arr` array must not contain any duplicates.\\n */\\n modifier nonDuplicate(address[] memory arr) virtual {\\n _requireNonDuplicate(arr);\\n _;\\n }\\n\\n /**\\n * @dev Internal method to check the method caller.\\n * @dev Reverts if the method caller is not this contract.\\n */\\n function _requireSelfCall() internal view virtual {\\n if (msg.sender != address(this)) revert ErrOnlySelfCall(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to check if a contract address has code.\\n * @param addr The address of the contract to check.\\n * @dev Throws an error if the contract address has no code.\\n */\\n function _requireHasCode(address addr) internal view {\\n if (addr.code.length == 0) revert ErrZeroCodeContract(addr);\\n }\\n\\n /**\\n * @dev Checks if an address is zero and reverts if it is.\\n * @param addr The address to check.\\n */\\n function _requireNonZeroAddress(address addr) internal pure {\\n if (addr == address(0)) revert ErrZeroAddress(msg.sig);\\n }\\n\\n /**\\n * @dev Check if arr is empty and revert if it is.\\n * Checks if an array contains any duplicate addresses and reverts if duplicates are found.\\n * @param arr The array of addresses to check.\\n */\\n function _requireNonDuplicate(address[] memory arr) internal pure {\\n if (arr.hasDuplicate()) revert AddressArrayUtils.ErrDuplicated(msg.sig);\\n }\\n\\n /**\\n * @dev Internal function to require that the provided address is a created externally owned account (EOA).\\n * This internal function is used to ensure that the provided address is a valid externally owned account (EOA).\\n * It checks the codehash of the address against a predefined constant to confirm that the address is a created EOA.\\n * @notice This method only works with non-state EOA accounts\\n */\\n function _requireCreatedEOA(address addr) internal view {\\n _requireNonZeroAddress(addr);\\n bytes32 codehash = addr.codehash;\\n if (codehash != CREATED_ACCOUNT_HASH) revert ErrAddressIsNotCreatedEOA(addr, codehash);\\n }\\n\\n /**\\n * @dev Internal function to require that the specified contract supports the given interface. This method handle in\\n * both case that the callee is either or not the proxy admin of the caller. If the contract does not support the\\n * interface `interfaceId` or EIP165, a revert with the corresponding error message is triggered.\\n *\\n * @param contractAddr The address of the contract to check for interface support.\\n * @param interfaceId The interface ID to check for support.\\n */\\n function _requireSupportsInterface(address contractAddr, bytes4 interfaceId) internal view {\\n bytes memory supportsInterfaceParams = abi.encodeCall(IERC165.supportsInterface, (interfaceId));\\n (bool success, bytes memory returnOrRevertData) = contractAddr.staticcall(supportsInterfaceParams);\\n if (!success) {\\n (success, returnOrRevertData) = contractAddr.staticcall(abi.encodeCall(TransparentUpgradeableProxyV2.functionDelegateCall, (supportsInterfaceParams)));\\n if (!success) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n if (!abi.decode(returnOrRevertData, (bool))) revert ErrUnsupportedInterface(interfaceId, contractAddr);\\n }\\n}\\n\",\"keccak256\":\"0x546ab4c9cdb0e7f8e650f140349225305ba1d0706dcaceeb9180c96aa765da59\",\"license\":\"MIT\"},\"src/utils/RoleAccess.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nenum RoleAccess {\\n UNKNOWN, // 0\\n ADMIN, // 1\\n COINBASE, // 2\\n GOVERNOR, // 3\\n CANDIDATE_ADMIN, // 4\\n WITHDRAWAL_MIGRATOR, // 5\\n __DEPRECATED_BRIDGE_OPERATOR, // 6\\n BLOCK_PRODUCER, // 7\\n VALIDATOR_CANDIDATE, // 8\\n CONSENSUS, // 9\\n TREASURY // 10\\n\\n}\\n\",\"keccak256\":\"0x671ff40dd874c508c4b3879a580996c7987fc018669256f47151e420a55c0e51\",\"license\":\"MIT\"}},\"version\":1}", + "nonce": 26, + "numDeployments": 3, "storageLayout": { "storage": [ { @@ -3172,7 +3172,7 @@ } } }, - "timestamp": 1713254676, + "timestamp": 1713254892, "userdoc": { "version": 1, "kind": "user", diff --git a/deployments/sepolia/WethUnwrapper.json b/deployments/sepolia/WethUnwrapper.json index e4f5d0ed..6bdcf94e 100644 --- a/deployments/sepolia/WethUnwrapper.json +++ b/deployments/sepolia/WethUnwrapper.json @@ -90,10 +90,10 @@ "inputs": [] } ], - "address": "0x1050f2E63177b5eD18f3E88D000DB3a600d664e3", + "address": "0xdbf1c9FB0cb61Ae76901e55c5C04e77d2BE131A1", "args": "0x0000000000000000000000001aa1bc6baefcf09d6fd0139b828b5e764d050f08", "ast": "", - "blockNumber": 5709352, + "blockNumber": 5709370, "bytecode": "0x60a060405234801561001057600080fd5b5060405161059138038061059183398101604081905261002f91610071565b600160009081556001600160a01b0382163b90036100605760405163155634d360e31b815260040160405180910390fd5b6001600160a01b03166080526100a1565b60006020828403121561008357600080fd5b81516001600160a01b038116811461009a57600080fd5b9392505050565b6080516104c26100cf6000396000818160610152818160ea01528181610237015261030a01526104c26000f3fe6080604052600436106100385760003560e01c80633fc8cef31461004f5780635dbd60591461009f578063de0e9a3e146100bf57610047565b36610047576100456100df565b005b6100456100df565b34801561005b57600080fd5b506100837f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b3480156100ab57600080fd5b506100456100ba366004610408565b61012a565b3480156100cb57600080fd5b506100456100da366004610444565b6101a2565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146101285760405163155634d360e31b815260040160405180910390fd5b565b6002600054036101815760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b600260005561018f82610214565b6101998183610372565b50506001600055565b6002600054036101f45760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610178565b600260005561020281610214565b61020c3382610372565b506001600055565b604051336024820152306044820152606481018290526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b17905251610290919061045d565b6000604051808303816000865af19150503d80600081146102cd576040519150601f19603f3d011682016040523d82523d6000602084013e6102d2565b606091505b50509050806102f4576040516302805e0360e11b815260040160405180910390fd5b604051632e1a7d4d60e01b8152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561035657600080fd5b505af115801561036a573d6000803e3d6000fd5b505050505050565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146103bf576040519150601f19603f3d011682016040523d82523d6000602084013e6103c4565b606091505b50509050806104035760405163094b984760e21b81526001600160a01b03841660048201526001600160e01b0319600035166024820152604401610178565b505050565b6000806040838503121561041b57600080fd5b8235915060208301356001600160a01b038116811461043957600080fd5b809150509250929050565b60006020828403121561045657600080fd5b5035919050565b6000825160005b8181101561047e5760208186018101518583015201610464565b50600092019182525091905056fea2646970667358221220aaebf21164f6d2f08d44be8bf09fb75965583264b715eb60df75d1b1d0f7cb9e64736f6c63430008170033", "chainId": 11155111, "contractAbsolutePath": "WethUnwrapper.sol", @@ -105,8 +105,8 @@ }, "isFoundry": true, "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"weth_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ErrCannotTransferFrom\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes4\",\"name\":\"sig\",\"type\":\"bytes4\"}],\"name\":\"ErrExternalCallFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrNotWrappedContract\",\"type\":\"error\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"unwrap\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address payable\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"unwrapTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"weth\",\"outputs\":[{\"internalType\":\"contract IWETH\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/extensions/WethUnwrapper.sol\":\"WethUnwrapper\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@fdk/=lib/foundry-deployment-kit/script/\",\":@openzeppelin/=lib/openzeppelin-contracts/\",\":@prb/math/=lib/prb-math/\",\":@prb/test/=lib/prb-test/src/\",\":@ronin/contracts/=src/\",\":@ronin/script/=script/\",\":@ronin/test/=test/\",\":contract-libs/=lib/foundry-deployment-kit/lib/contract-libs/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/foundry-deployment-kit/lib/forge-std/src/\",\":foundry-deployment-kit/=lib/foundry-deployment-kit/\",\":hardhat/=node_modules/hardhat/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/foundry-deployment-kit/lib/openzeppelin-contracts/contracts/\",\":prb-math/=lib/prb-math/src/\",\":prb-test/=lib/prb-test/src/\",\":solady/=lib/solady/src/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/security/ReentrancyGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuard {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n constructor() {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n // On the first call to nonReentrant, _notEntered will be true\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n}\\n\",\"keccak256\":\"0x0e9621f60b2faabe65549f7ed0f24e8853a45c1b7990d47e8160e523683f3935\",\"license\":\"MIT\"},\"src/extensions/WethUnwrapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/security/ReentrancyGuard.sol\\\";\\nimport \\\"../interfaces/IWETH.sol\\\";\\n\\ncontract WethUnwrapper is ReentrancyGuard {\\n IWETH public immutable weth;\\n\\n error ErrCannotTransferFrom();\\n error ErrNotWrappedContract();\\n error ErrExternalCallFailed(address sender, bytes4 sig);\\n\\n constructor(address weth_) {\\n if (address(weth_).code.length == 0) revert ErrNotWrappedContract();\\n weth = IWETH(weth_);\\n }\\n\\n fallback() external payable {\\n _fallback();\\n }\\n\\n receive() external payable {\\n _fallback();\\n }\\n\\n function unwrap(uint256 amount) external nonReentrant {\\n _deductWrappedAndWithdraw(amount);\\n _sendNativeTo(payable(msg.sender), amount);\\n }\\n\\n function unwrapTo(uint256 amount, address payable to) external nonReentrant {\\n _deductWrappedAndWithdraw(amount);\\n _sendNativeTo(payable(to), amount);\\n }\\n\\n function _deductWrappedAndWithdraw(uint256 amount) internal {\\n (bool success,) = address(weth).call(abi.encodeCall(IWETH.transferFrom, (msg.sender, address(this), amount)));\\n if (!success) revert ErrCannotTransferFrom();\\n\\n weth.withdraw(amount);\\n }\\n\\n function _sendNativeTo(address payable to, uint256 val) internal {\\n (bool success,) = to.call{ value: val }(\\\"\\\");\\n if (!success) {\\n revert ErrExternalCallFailed(to, msg.sig);\\n }\\n }\\n\\n function _fallback() internal view {\\n if (msg.sender != address(weth)) revert ErrNotWrappedContract();\\n }\\n}\\n\",\"keccak256\":\"0x5f7b72d9ed8944724d2f228358d565a61ea345cba1883e5424fb801bebc758ff\",\"license\":\"MIT\"},\"src/interfaces/IWETH.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IWETH {\\n event Transfer(address indexed src, address indexed dst, uint wad);\\n\\n function deposit() external payable;\\n\\n function transfer(address dst, uint wad) external returns (bool);\\n\\n function approve(address guy, uint wad) external returns (bool);\\n\\n function transferFrom(address src, address dst, uint wad) external returns (bool);\\n\\n function withdraw(uint256 _wad) external;\\n\\n function balanceOf(address) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x000700e2b9c1985d53bb1cdba435f0f3d7b48e76e596e7dbbdfec1da47131415\",\"license\":\"MIT\"}},\"version\":1}", - "nonce": 26, - "numDeployments": 1, + "nonce": 24, + "numDeployments": 2, "storageLayout": { "storage": [ { @@ -126,7 +126,7 @@ } } }, - "timestamp": 1713254676, + "timestamp": 1713254892, "userdoc": { "version": 1, "kind": "user"