Skip to content

Commit

Permalink
Merge pull request #12 from centrifuge/update-deploy-script
Browse files Browse the repository at this point in the history
Update deploy script and .example.env
  • Loading branch information
AStox authored Jul 23, 2024
2 parents 765bc7a + 1d14854 commit 37faefa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
7 changes: 4 additions & 3 deletions .example.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
UNDERLYING_TOKEN=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
MORPHO=0x0000000000000000000000000000000000000000
BUNDLER=0x0000000000000000000000000000000000000000
MORPHO=0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb
BUNDLER=0x23055618898e202386e6c13955a58D3C68200BFB
ATTESTATION_SERVICE=0x4200000000000000000000000000000000000021
ATTESTATION_INDEXER=0x2c7eE1E5f416dfF40054c27A62f7B357C4E8619C
ADMIN=0x0000000000000000000000000000000000000000
ADMIN=0x0000000000000000000000000000000000000000
VAULT=0x0000000000000000000000000000000000000000
14 changes: 12 additions & 2 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {Script} from "forge-std/Script.sol";
import {Memberlist} from "src/Memberlist.sol";
import {PermissionedERC20Wrapper} from "src/PermissionedERC20Wrapper.sol";
import {ERC20PermissionedBase, IERC20} from "lib/erc20-permissioned/src/ERC20PermissionedBase.sol";
import {VaultOracle} from "src/VaultOracle.sol";

contract DeployScript is Script {
address USDC = vm.envAddress("UNDERLYING_TOKEN");
Expand All @@ -13,27 +14,36 @@ contract DeployScript is Script {
address attestationService = vm.envAddress("ATTESTATION_SERVICE");
address attestationIndexer = vm.envAddress("ATTESTATION_INDEXER");
address admin = vm.envAddress("ADMIN");
address vault = vm.envAddress("VAULT");

function setUp() public {}

function run() public {
vm.startBroadcast();
VaultOracle oracle;
Memberlist memberlist = new Memberlist();
PermissionedERC20Wrapper wrappedUSDC = new PermissionedERC20Wrapper(
"Attested USDC",
"aUSDC",
"Verified USDC",
"verUSDC",
IERC20(USDC),
morpho,
bundler,
attestationService,
attestationIndexer,
address(memberlist)
);
if (vault != address(0)) {
oracle = new VaultOracle(vault);
}
if (admin != msg.sender && admin != address(0)) {
memberlist.rely(admin);
wrappedUSDC.rely(admin);
memberlist.deny(msg.sender);
wrappedUSDC.deny(msg.sender);
if (address(oracle) != address(0)) {
oracle.rely(admin);
oracle.deny(msg.sender);
}
}
vm.stopBroadcast();
}
Expand Down

0 comments on commit 37faefa

Please sign in to comment.