-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adapt all migrations to new version of 'foundry-deployment-kit' (…
- Loading branch information
Showing
39 changed files
with
517 additions
and
469 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1 @@ | ||
# Source (or "dot") the .env file to load environment variables | ||
if [ -f .env ]; then | ||
source .debug.env | ||
else | ||
echo "Error: .debug.env file not found." | ||
fi | ||
|
||
verify_arg="" | ||
extra_argument="" | ||
op_command="" | ||
|
||
for arg in "$@"; do | ||
case $arg in | ||
--trezor) | ||
op_command="" | ||
extra_argument+=trezor@ | ||
;; | ||
--broadcast) | ||
op_command="op run --env-file="./.env" --" | ||
;; | ||
--log) | ||
set -- "${@/#--log/}" | ||
extra_argument+=log@ | ||
;; | ||
*) ;; | ||
esac | ||
done | ||
|
||
# Remove the @ character from the end of extra_argument | ||
extra_argument="${extra_argument%%@}" | ||
|
||
echo Debug Tx... | ||
echo From: ${FROM} | ||
echo To: ${TO} | ||
echo Value: ${VALUE} | ||
echo Calldata: | ||
cast pretty-calldata ${CALLDATA} | ||
calldata=$(cast calldata 'debug(uint256,address,address,uint256,bytes)' ${BLOCK} ${FROM} ${TO} ${VALUE} ${CALLDATA}) | ||
${op_command} forge script ${verify_arg} --legacy ${@} script/Debug.s.sol --sig 'run(bytes,string)' ${calldata} "${extra_argument}" | ||
source lib/foundry-deployment-kit/debug.sh |
Submodule contract-libs
added at
f177e3
Submodule foundry-deployment-kit
updated
72 files
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.19; | ||
|
||
import { ContractKey } from "foundry-deployment-kit/configs/ContractConfig.sol"; | ||
import { RNSDeploy } from "script/RNSDeploy.s.sol"; | ||
import { Contract } from "script/utils/Contract.sol"; | ||
import { Migration } from "script/Migration.s.sol"; | ||
|
||
contract Migration__20231020_RNSUpgrade is RNSDeploy { | ||
function run() public trySetUp { | ||
_upgradeProxy(ContractKey.RNSUnified, EMPTY_ARGS); | ||
contract Migration__20231020_RNSUpgrade is Migration { | ||
function run() public { | ||
_upgradeProxy(Contract.RNSUnified.key()); | ||
} | ||
} |
12 changes: 6 additions & 6 deletions
12
script/20231021-upgrade-domain-price-and-auction/20231021_UpgradeDomainPriceAndAuction.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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.19; | ||
|
||
import { ContractKey } from "foundry-deployment-kit/configs/ContractConfig.sol"; | ||
import { RNSDeploy } from "script/RNSDeploy.s.sol"; | ||
import { Contract } from "script/utils/Contract.sol"; | ||
import { Migration } from "script/Migration.s.sol"; | ||
|
||
contract Migration__20231021_UpgradeDomainPriceAndAuction is RNSDeploy { | ||
function run() public trySetUp { | ||
_upgradeProxy(ContractKey.RNSAuction, EMPTY_ARGS); | ||
_upgradeProxy(ContractKey.RNSDomainPrice, EMPTY_ARGS); | ||
contract Migration__20231021_UpgradeDomainPriceAndAuction is Migration { | ||
function run() public { | ||
_upgradeProxy(Contract.RNSAuction.key()); | ||
_upgradeProxy(Contract.RNSDomainPrice.key()); | ||
} | ||
} |
10 changes: 5 additions & 5 deletions
10
script/20231024-upgrade-auction/20231024_UpgradeAuction.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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.19; | ||
|
||
import { ContractKey } from "foundry-deployment-kit/configs/ContractConfig.sol"; | ||
import { RNSDeploy } from "script/RNSDeploy.s.sol"; | ||
import { Contract } from "script/utils/Contract.sol"; | ||
import { Migration } from "script/Migration.s.sol"; | ||
|
||
contract Migration__20231024_UpgradeAuction is RNSDeploy { | ||
function run() public trySetUp { | ||
_upgradeProxy(ContractKey.RNSAuction, EMPTY_ARGS); | ||
contract Migration__20231024_UpgradeAuction is Migration { | ||
function run() public { | ||
_upgradeProxy(Contract.RNSAuction.key()); | ||
} | ||
} |
23 changes: 14 additions & 9 deletions
23
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 |
---|---|---|
@@ -1,17 +1,22 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.19; | ||
|
||
import { Network, RNSDeploy } from "script/RNSDeploy.s.sol"; | ||
import { ISharedArgument, DefaultNetwork, Migration } from "script/Migration.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"); | ||
abstract contract Config__20231024 is Migration { | ||
function _sharedArguments() internal view virtual override returns (bytes memory rawArgs) { | ||
rawArgs = super._sharedArguments(); | ||
|
||
ISharedArgument.SharedParameter memory param = abi.decode(rawArgs, (ISharedArgument.SharedParameter)); | ||
|
||
if (network() == DefaultNetwork.RoninTestnet.key()) { | ||
param.overrider = param.operator; | ||
} else if (network() == DefaultNetwork.RoninMainnet.key()) { | ||
revert("Missing param"); | ||
} else { | ||
revert("Missing config"); | ||
revert("Missing param"); | ||
} | ||
|
||
rawArgs = abi.encode(param); | ||
} | ||
} |
20 changes: 10 additions & 10 deletions
20
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 |
---|---|---|
@@ -1,23 +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 { console2 as console } from "forge-std/console2.sol"; | ||
import { Contract } from "script/utils/Contract.sol"; | ||
import { RNSDomainPrice } from "@rns-contracts/RNSDomainPrice.sol"; | ||
import { Config__20231024 } from "./20231024_Config.s.sol"; | ||
import { ISharedArgument, 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); | ||
function run() public { | ||
ISharedArgument.SharedParameter memory param = config.sharedArguments(); | ||
_upgradeProxy(Contract.RNSDomainPrice.key()); | ||
|
||
console2.log("operator", config.operator); | ||
console2.log("overrider", config.overrider); | ||
console.log("operator", param.operator); | ||
console.log("overrider", param.overrider); | ||
|
||
RNSDomainPrice domainPrice = RNSDomainPrice(_config.getAddressFromCurrentNetwork(ContractKey.RNSDomainPrice)); | ||
RNSDomainPrice domainPrice = RNSDomainPrice(config.getAddressFromCurrentNetwork(Contract.RNSDomainPrice.key())); | ||
address admin = domainPrice.getRoleMember(0x00, 0); | ||
bytes32 overriderRole = domainPrice.OVERRIDER_ROLE(); | ||
vm.broadcast(admin); | ||
domainPrice.grantRole(overriderRole, config.overrider); | ||
domainPrice.grantRole(overriderRole, param.overrider); | ||
} | ||
} |
10 changes: 5 additions & 5 deletions
10
script/20231024-upgrade-rns-unified/20231024_UpgradeRNSUnified.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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.19; | ||
|
||
import { ContractKey } from "foundry-deployment-kit/configs/ContractConfig.sol"; | ||
import { RNSDeploy } from "script/RNSDeploy.s.sol"; | ||
import { Contract } from "script/utils/Contract.sol"; | ||
import { Migration } from "script/Migration.s.sol"; | ||
|
||
contract Migration__20231024_UpgradeRNSUnified is RNSDeploy { | ||
function run() public trySetUp { | ||
_upgradeProxy(ContractKey.RNSUnified, EMPTY_ARGS); | ||
contract Migration__20231024_UpgradeRNSUnified is Migration { | ||
function run() public { | ||
_upgradeProxy(Contract.RNSUnified.key()); | ||
} | ||
} |
10 changes: 5 additions & 5 deletions
10
script/20231025-upgrade-controller/20231025_UpgradeController.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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.19; | ||
|
||
import { ContractKey } from "foundry-deployment-kit/configs/ContractConfig.sol"; | ||
import { RNSDeploy } from "script/RNSDeploy.s.sol"; | ||
import { Contract } from "script/utils/Contract.sol"; | ||
import { Migration } from "script/Migration.s.sol"; | ||
|
||
contract Migration__20231025_UpgradeController is RNSDeploy { | ||
function run() public trySetUp { | ||
_upgradeProxy(ContractKey.RONRegistrarController, EMPTY_ARGS); | ||
contract Migration__20231025_UpgradeController is Migration { | ||
function run() public { | ||
_upgradeProxy(Contract.RONRegistrarController.key()); | ||
} | ||
} |
14 changes: 6 additions & 8 deletions
14
script/20231106-config-prelaunch/20231106_RevertRenewalFees.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 |
---|---|---|
@@ -1,18 +1,16 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.19; | ||
|
||
import { ContractKey } from "foundry-deployment-kit/configs/ContractConfig.sol"; | ||
import { RNSDeploy } from "script/RNSDeploy.s.sol"; | ||
import { Contract } from "script/utils/Contract.sol"; | ||
import { ISharedArgument, Migration } from "script/Migration.s.sol"; | ||
import { RNSDomainPrice } from "@rns-contracts/RNSDomainPrice.sol"; | ||
|
||
contract Migration__20231106_RevertRenewalFees is RNSDeploy { | ||
contract Migration__20231106_RevertRenewalFees is Migration { | ||
function run() public { | ||
RNSDomainPrice domainPrice = RNSDomainPrice(_config.getAddressFromCurrentNetwork(ContractKey.RNSDomainPrice)); | ||
RNSDomainPrice domainPrice = RNSDomainPrice(config.getAddressFromCurrentNetwork(Contract.RNSDomainPrice.key())); | ||
|
||
Config memory config = getConfig(); | ||
ISharedArgument.SharedParameter memory param = config.sharedArguments(); | ||
vm.broadcast(domainPrice.getRoleMember(domainPrice.DEFAULT_ADMIN_ROLE(), 0)); | ||
vm.resumeGasMetering(); | ||
domainPrice.setRenewalFeeByLengths(config.renewalFees); | ||
vm.pauseGasMetering(); | ||
domainPrice.setRenewalFeeByLengths(param.renewalFees); | ||
} | ||
} |
Oops, something went wrong.