generated from AngleProtocol/boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 11
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
1 parent
91f6cbd
commit d13e2da
Showing
1 changed file
with
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity ^0.8.17; | ||
|
||
import { console } from "forge-std/console.sol"; | ||
import { BaseScript } from "./utils/Base.s.sol"; | ||
import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; | ||
import { ReferralRegistry } from "../contracts/ReferralRegistry.sol"; | ||
import { DistributionCreator } from "../contracts/DistributionCreator.sol"; | ||
import { IAccessControlManager } from "../contracts/interfaces/IAccessControlManager.sol"; | ||
interface IDistributionCreator { | ||
function distributor() external view returns (address); | ||
|
||
function feeRecipient() external view returns (address); | ||
|
||
function accessControlManager() external view returns (IAccessControlManager); | ||
} | ||
|
||
contract DeployReferralRegistry is BaseScript { | ||
function run() public { | ||
uint256 deployerPrivateKey = vm.envUint("DEPLOYER_PRIVATE_KEY"); | ||
vm.startBroadcast(deployerPrivateKey); | ||
uint256 feeSetup = 0; | ||
// uint32 cliffDuration = 1 weeks; | ||
IDistributionCreator distributionCreator = IDistributionCreator(0x8BB4C975Ff3c250e0ceEA271728547f3802B36Fd); | ||
address feeRecipient = distributionCreator.feeRecipient(); | ||
IAccessControlManager accessControlManager = distributionCreator.accessControlManager(); | ||
|
||
// Deploy implementation | ||
address implementation = address(new ReferralRegistry()); | ||
console.log("ReferralRegistry Implementation:", implementation); | ||
|
||
// Deploy proxy | ||
ERC1967Proxy proxy = new ERC1967Proxy(implementation, ""); | ||
console.log("ReferralRegistry Proxy:", address(proxy)); | ||
|
||
// Initialize | ||
ReferralRegistry(payable(address(proxy))).initialize(accessControlManager, feeSetup, feeRecipient); | ||
vm.stopBroadcast(); | ||
} | ||
} |