-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
86 additions
and
0 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 |
---|---|---|
@@ -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(); | ||
} | ||
} |
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,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(); | ||
} | ||
} |