feat: add guarded Base Sepolia encore
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity 0.8.35;
|
||||
|
||||
import {BankV1} from "../src/BankV1.sol";
|
||||
import {MockUSDC} from "../src/MockUSDC.sol";
|
||||
import {DemoScript} from "./lib/DemoScript.sol";
|
||||
|
||||
contract SeedBaseSepolia is DemoScript {
|
||||
uint256 internal constant SEED_AMOUNT = 1_000e6;
|
||||
|
||||
function run() external {
|
||||
if (block.chainid != BASE_SEPOLIA_CHAIN_ID) revert UnsupportedChain(block.chainid);
|
||||
_printEducationalWarning();
|
||||
address scriptSender = vm.envAddress("SCRIPT_SENDER");
|
||||
(address presenter, address recipient,) = _requireBaseConfig(scriptSender);
|
||||
Manifest memory manifest = _readManifest(_manifestPath(ACTIVE_MANIFEST_PATH), true);
|
||||
_assertAddress("Presenter", manifest.actors[0].address_, presenter);
|
||||
_assertAddress("Recipient", manifest.actors[1].address_, recipient);
|
||||
|
||||
BankV1 bank = BankV1(manifest.proxy);
|
||||
MockUSDC token = MockUSDC(manifest.token);
|
||||
_assertDeployedState(manifest);
|
||||
|
||||
vm.startBroadcast(presenter);
|
||||
token.mint(presenter, SEED_AMOUNT);
|
||||
token.approve(manifest.proxy, SEED_AMOUNT);
|
||||
bank.deposit(SEED_AMOUNT);
|
||||
vm.stopBroadcast();
|
||||
|
||||
_assertUint("Presenter internal balance", SEED_AMOUNT, bank.balanceOf(presenter));
|
||||
_assertUint("Recipient internal balance", 0, bank.balanceOf(recipient));
|
||||
_assertUint("liabilities", SEED_AMOUNT, bank.totalLiabilities());
|
||||
_assertUint("reserves", SEED_AMOUNT, token.balanceOf(manifest.proxy));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user