Skip to content

Commit

Permalink
fix: always authorized for router, correct pool init code hash
Browse files Browse the repository at this point in the history
  • Loading branch information
thaixuandang committed Aug 8, 2024
1 parent 9ab198e commit 14dd489
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion script/ronin-mainnet/DeployKatanaOperationMainnet.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ contract DeployKatanaOperationMainnet is UpgradeKatanaGovernance {
v2Factory: 0xB255D6A720BB7c39fee173cE22113397119cB930, // KatanaV2Factory
v3Factory: address(0), // TODO: To be deployed
pairInitCodeHash: 0xe85772d2fe4ad93037659afaee57751696456eb5dd99987e43f3cf11c6e255a2,
poolInitCodeHash: 0x97ee45181a4d14c00cdcc956fefebfa98f8c8744e3fe6d83e1861dc77ff40a99
poolInitCodeHash: 0x8055b6834943f8f684de0aebfd2f61ab734b814b3b15f7e76661ed7012d0ec11
});

proxyAdmin = 0xA3e7d085E65CB0B916f6717da876b7bE5cC92f03; // Proxy Admin
Expand Down
2 changes: 1 addition & 1 deletion script/ronin-testnet/DeployKatanaOperationTestnet.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ contract DeployKatanaOperationTestnet is UpgradeKatanaGovernance {
v2Factory: 0x86587380C4c815Ba0066c90aDB2B45CC9C15E72c,
v3Factory: 0x249F235bB9Fed56131B7E44Fe453E71b422B0A42,
pairInitCodeHash: 0x1cc97ead4d6949b7a6ecb28652b21159b9fd5608ae51a1960224099caab07dca,
poolInitCodeHash: 0x97ee45181a4d14c00cdcc956fefebfa98f8c8744e3fe6d83e1861dc77ff40a99
poolInitCodeHash: 0x8055b6834943f8f684de0aebfd2f61ab734b814b3b15f7e76661ed7012d0ec11
});

proxyAdmin = 0x505d91E8fd2091794b45b27f86C045529fa92CD7;
Expand Down
12 changes: 6 additions & 6 deletions src/governance/KatanaGovernance.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ contract KatanaGovernance is OwnableUpgradeable, IKatanaV2Factory, IKatanaGovern
address private _router;

/// @dev Only use this modifier for boolean-returned methods
modifier skipIfAllowedAllOrOwner(address account) {
_skipIfAllowedAllOrOwner(account);
modifier skipIfRouterOrAllowedAllOrOwner(address account) {
_skipIfRouterOrAllowedAllOrOwner(account);
_;
}

Expand Down Expand Up @@ -200,7 +200,7 @@ contract KatanaGovernance is OwnableUpgradeable, IKatanaV2Factory, IKatanaGovern
function isAuthorized(address token, address account)
external
view
skipIfAllowedAllOrOwner(account)
skipIfRouterOrAllowedAllOrOwner(account)
returns (bool authorized)
{
authorized = _isAuthorized(_permission[token], account);
Expand All @@ -212,7 +212,7 @@ contract KatanaGovernance is OwnableUpgradeable, IKatanaV2Factory, IKatanaGovern
function isAuthorized(address[] calldata tokens, address account)
external
view
skipIfAllowedAllOrOwner(account)
skipIfRouterOrAllowedAllOrOwner(account)
returns (bool authorized)
{
uint256 length = tokens.length;
Expand Down Expand Up @@ -342,8 +342,8 @@ contract KatanaGovernance is OwnableUpgradeable, IKatanaV2Factory, IKatanaGovern
* @dev Skips the function if the caller is allowed all or the owner.
* WARNING: This function can return and exit current context and skip the function.
*/
function _skipIfAllowedAllOrOwner(address account) internal view {
if (allowedAll() || account == owner()) {
function _skipIfRouterOrAllowedAllOrOwner(address account) internal view {
if (account == _router || allowedAll() || account == owner()) {
assembly ("memory-safe") {
mstore(0x0, true)
return(0x0, returndatasize())
Expand Down

0 comments on commit 14dd489

Please sign in to comment.