Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deploy script and .example.env #12

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading