Skip to content

Commit

Permalink
add base sepolia config
Browse files Browse the repository at this point in the history
  • Loading branch information
0xPilou committed Feb 12, 2024
1 parent f004918 commit 5c2e9dc
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 0 deletions.
2 changes: 2 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ remappings = [
[rpc_endpoints]
optimism-goerli = "${OPTIMISM_GOERLI_RPC}"
base-goerli = "${BASE_GOERLI_RPC}"
base-sepolia = "${BASE_SEPOLIA_RPC}"
base = "${BASE_RPC}"

[etherscan]
optimism-goerli = { key = "${OPTIMISM_ETHERSCAN_API_KEY}", chain = 420 }
base-goerli = { key = "${ETHERSCAN_API_KEY}", chain = 84531, url = "https://api-goerli.basescan.org/api" }
base-sepolia = { key = "${BASE_ETHERSCAN_API_KEY}", chain = 84532, url = "https://api-sepolia.basescan.org/api" }
base = { key = "${BASE_ETHERSCAN_API_KEY}", chain = 8453 }

[fuzz]
Expand Down
59 changes: 59 additions & 0 deletions script/base-sepolia/deploy-abClaim.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// SPDX-License-Identifier: MIT

/*
forge script script/base-sepolia/deploy-abClaim.s.sol:DeployABClaim --rpc-url base-sepolia --sig "run(bool)" false
forge script script/base-sepolia/deploy-abClaim.s.sol:DeployABClaim --rpc-url base-sepolia --broadcast --verify --sig "run(bool)" true
*/
pragma solidity ^0.8.18;

import "forge-std/Script.sol";

import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol";

import {ABClaim} from "src/royalty/ABClaim.sol";

contract DeployABClaim is Script {
string constant PROXY_ADMIN_PATH = "deployment/84532/ProxyAdmin/address";
string constant AB_CLAIM_PATH = "deployment/84532/ABClaim/address";
string constant AB_KYC_MODULE_PATH = "deployment/84532/ABKYCModule/address";

ProxyAdmin public proxyAdmin;

function run(bool isBroadcasted) external {
// Account to deploy from
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");

// Read deployed address

address abKycModule = address(0);
address baseSepoliaUSDC = 0x036CbD53842c5426634e7929541eC2318f3dCF7e;

vm.startBroadcast(deployerPrivateKey);

// Check if a Proxy Admin has already been deployed
try vm.readFile(PROXY_ADMIN_PATH) returns (string memory proxyAdminAddr) {
proxyAdmin = ProxyAdmin(vm.parseAddress(proxyAdminAddr));
} catch {
proxyAdmin = new ProxyAdmin();
if (isBroadcasted) {
vm.writeFile(PROXY_ADMIN_PATH, vm.toString(address(proxyAdmin)));
}
}

// Deploy Implementation Contracts
TransparentUpgradeableProxy abClaimProxy = new TransparentUpgradeableProxy(
address(new ABClaim()),
address(proxyAdmin),
abi.encodeWithSelector(
ABClaim.initialize.selector, baseSepoliaUSDC, abKycModule, vm.addr(deployerPrivateKey)
)
);

if (isBroadcasted) {
vm.writeFile(AB_CLAIM_PATH, vm.toString(address(abClaimProxy)));
}

vm.stopBroadcast();
}
}
25 changes: 25 additions & 0 deletions script/base-sepolia/utils/setDropData.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

import "forge-std/Script.sol";

import {ABClaim} from "src/royalty/ABClaim.sol";

contract SetDropData is Script {
string constant PROXY_ADMIN_PATH = "deployment/84531/ProxyAdmin/address";
string constant AB_KYC_MODULE_PATH = "deployment/84531/ABDataRegistry/address";

function run() external {
// Account to deploy from
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");

vm.startBroadcast(deployerPrivateKey);

ABClaim abClaim = ABClaim(0x5f683fB071F9656e45C271765E4C56976A424d18);

// abClaim.setDropData(20073, 0x2b5974e07331f3D1dCff454C1ff4b4481e5385de, false, 18);
abClaim.depositRoyalty(20073, 15e5);

vm.stopBroadcast();
}
}

0 comments on commit 5c2e9dc

Please sign in to comment.