-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add overrider role to set & override name price, renewal fee (#101
- Loading branch information
Showing
5 changed files
with
50 additions
and
2 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
script/20231024-upgrade-domain-price/20231024_Config.s.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.19; | ||
|
||
import { Network, RNSDeploy } from "script/RNSDeploy.s.sol"; | ||
|
||
abstract contract Config__20231024 is RNSDeploy { | ||
function _buildMigrationConfig() internal view virtual override returns (Config memory config) { | ||
config = super._buildMigrationConfig(); | ||
if (_network == Network.RoninTestnet) { | ||
config.overrider = config.operator; | ||
} else if (_network == Network.RoninMainnet) { | ||
revert("Missing config"); | ||
} else { | ||
revert("Missing config"); | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
script/20231024-upgrade-domain-price/20231024_UpgradeDomainPrice.s.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.19; | ||
|
||
import { console2 } from "forge-std/console2.sol"; | ||
import { ContractKey } from "foundry-deployment-kit/configs/ContractConfig.sol"; | ||
import { RNSDomainPrice } from "@rns-contracts/RNSDomainPrice.sol"; | ||
import { Config__20231024 } from "./20231024_Config.s.sol"; | ||
|
||
contract Migration__20231024_UpgradeDomainPrice is Config__20231024 { | ||
function run() public trySetUp { | ||
Config memory config = getConfig(); | ||
_upgradeProxy(ContractKey.RNSDomainPrice, EMPTY_ARGS); | ||
|
||
console2.log("operator", config.operator); | ||
console2.log("overrider", config.overrider); | ||
|
||
RNSDomainPrice domainPrice = RNSDomainPrice(_config.getAddressFromCurrentNetwork(ContractKey.RNSDomainPrice)); | ||
address admin = domainPrice.getRoleMember(0x00, 0); | ||
bytes32 overriderRole = domainPrice.OVERRIDER_ROLE(); | ||
vm.broadcast(admin); | ||
domainPrice.grantRole(overriderRole, config.overrider); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters