Skip to content

Commit

Permalink
fix(script): ERC20 as USDC for main deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
jdubpark committed Apr 8, 2024
1 parent c0ca714 commit 1ade7ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 2 additions & 4 deletions script/foundry/deployment/Main.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@ import { DeployHelper } from "../utils/DeployHelper.sol";

contract Main is DeployHelper {
address internal ERC6551_REGISTRY = 0x000000006551c19487814612e58FE06813775758;
// ERC20 to whitelist for arbitration policy and royalty policy
address internal ERC20 = 0x0000000000000000000000000000000000000001;
// For arbitration policy
uint256 internal constant ARBITRATION_PRICE = 1000 * 10 ** 18; // 1000 MockToken
uint256 internal constant ARBITRATION_PRICE = 1000 * 10 ** 6; // 1000 USDC
// For royalty policy
uint256 internal constant MAX_ROYALTY_APPROVAL = 10000 ether;

constructor()
DeployHelper(
ERC6551_REGISTRY,
ERC20,
USDC,
ARBITRATION_PRICE,
MAX_ROYALTY_APPROVAL
)
Expand Down
6 changes: 6 additions & 0 deletions script/foundry/utils/BroadcastManager.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,27 @@ contract BroadcastManager is Script {
address public multisig;
address public deployer;

/// @dev USDC addresses are fetched from
/// (mainnet) https://developers.circle.com/stablecoins/docs/usdc-on-main-networks
/// (testnet) https://developers.circle.com/stablecoins/docs/usdc-on-test-networks
function _beginBroadcast() internal {
uint256 deployerPrivateKey;
if (block.chainid == 1) { // Tenderly mainnet fork
deployerPrivateKey = vm.envUint("MAINNET_PRIVATEKEY");
deployer = vm.addr(deployerPrivateKey);
multisig = vm.envAddress("MAINNET_MULTISIG_ADDRESS");
USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
vm.startBroadcast(deployerPrivateKey);
} else if (block.chainid == 11155111) {
deployerPrivateKey = vm.envUint("SEPOLIA_PRIVATEKEY");
deployer = vm.addr(deployerPrivateKey);
multisig = vm.envAddress("SEPOLIA_MULTISIG_ADDRESS");
USDC = 0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238;
vm.startBroadcast(deployerPrivateKey);
} else if (block.chainid == 31337) {
require(deployer != address(0), "Deployer not set");
multisig = vm.addr(0x987321);
USDC = vm.envAddress("LOCAL_USDC_ADDRESS");
vm.startPrank(deployer);
} else {
revert("Unsupported chain");
Expand Down

0 comments on commit 1ade7ac

Please sign in to comment.