LIQUID STAKING
卡了我三天,字母哥一句话就思路畅通了,无敌了。
还是先看部署合约
pragma solidity 0.8.21;
import {PoolVault} from "src/PoolVault.sol";
import {SyntheticTokenFactory} from "src/SyntheticTokenFactory.sol";
import {Script} from "forge-std/Script.sol";
import {console} from "forge-std/console.sol";
contract Deploy is Script {
function run() external {
address user = vm.envAddress("USER");
vm.startBroadcast();
user.call{value: 100 ether}("");
PoolVault pv = new PoolVault();
SyntheticTokenFactory stf = new SyntheticTokenFactory(address(this), pv);
console.log("address:PoolVault", address(pv));
console.log("address:SyntheticTokenFactory", address(stf));
vm.stopBroadcast();
}
}
题目部署了两个合约,并给user100个eth。
看下解决条件,
pragma solidity 0.8.21;
import {PoolVault} from "src/PoolVault.sol";
import {SyntheticTokenFactory} from "src/SyntheticTokenFactory.sol";
import {Script} from "forge-std/Script.sol";
import {console} from "forge-std/console.sol";
contract Deploy is Script {
function run() external {
address user = vm.envAddress("USER");
vm.startBroadcast();
user.call{value: 100 ether}("");
PoolVault pv = new PoolVault();
SyntheticTokenFactory stf = new SyntheticTokenFactory(address(this), pv);
console.log("address:PoolVault", address(pv));
console.log("address:SyntheticTokenFactory", address(stf));
vm.stopBroadcast();
}
}
要求stf.syntheticsLength() > 0或user.blance>=100。
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容