pnpm installnpm install -g @forge/cli
foundryuppnpm compileIf you prefer one over the other, you can use the tooling-specific commands:
pnpm compile:forgepnpm compile:hardhatSimilarly to the contract compilation, we support both hardhat and forge tests. By default, the test command will
execute both:
pnpm testIf you prefer one over the other, you can use the tooling-specific commands:
pnpm test:forge
pnpm test:hardhatSet up deployer wallet/account:
- Rename
.env.example->.env - Choose your preferred means of setting up your deployer wallet/account:
MNEMONIC="test test test test test test test test test test test junk"
or...
PRIVATE_KEY="0xabc...def"
npx hardhat 尝试使用全局安装的 Hardhat,但 Hardhat 需要在本地项目中安装才能正常工作
pnpm install --save-dev hardhat
npx hardhat export-abinpx hardhat deploy --network bscTestnet --tags Timelocknpx hardhat deploy --network bscTestnet --tags WithdrawVaultnpx hardhat deploy --network bscTestnet --tags Earnnpx hardhat deploy --network bscTestnet --tags TimelockVerifynpx hardhat deploy --network bscTestnet --tags WithdrawVaultVerifynpx hardhat deploy --network bscTestnet --tags EarnVerifyhardhat deploy --network bscTestnet --tags WithdrawVaultImplementationhardhat deploy --network bscTestnet --tags EarnImplementationnpx hardhat deploy --network bscTestnet --tags AssBTCnpx hardhat deploy --network bscTestnet --tags AssBNBnpx hardhat deploy --network bscTestnet --tags AssUSDTnpx hardhat deploy --network bscTestnet --tags AssUSDCBNB 地址 const BNB_CHAIN_TESTNET_WRAPPED = '0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd'; const BNB_CHAIN_WRAPPED = '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c';
hardhat deploy --network bscTestnet --tags BTCTesthardhat deploy --network bscTestnet --tags USDTTesthardhat deploy --network bscTestnet --tags USDCTestnpx hardhat upgrade:WithdrawVault --network bscTestnetnpx hardhat upgrade:Earn --network bscTestnetgrantRole: 把 Earn合约地址加到 MINTER_AND_BURN_ROLE 角色下 approve: 授权spender(Earn合约地址)使用多少数量的token
approve: 授权spender(Earn合约地址)使用多少数量的token
grantRole: 把 bot(后端发起交易地址)地址加到 BOT_ROLE 角色下
grantRole: 把 Earn合约地址加到 TRANSFER_ROLE 角色下
[Earn 合约] grantRole: 把 bot(后端发起交易地址)地址加到 BOT_ROLE 角色下 npx hardhat grantRole:minter_and_burn_role --network bscTestnet [WithdrawVault 合约] grantRole: 把 Earn合约地址加到 TRANSFER_ROLE 角色下
更改 const contract='AssUSDT' 变量值
npx hardhat grantRole:minter_and_burn_role --network bscTestnet[{"assTokenAddress":"0x3f41a2d00D9D294B4097B68EbFBE7dfE955fc3Cc","assToSourceExchangeRate":"100000000","exchangeRateExpiredTimestamp":"1735660800"}]
[{"assTokenAddress":"0x3f41a2d00D9D294B4097B68EbFBE7dfE955fc3Cc","sourceTokenAmount":"100000000000000000","requestWithdrawNo":1,"receipt":"0xf4903f4544558515b26ec4C6D6e91D2293b27275"}]
[{"assTokenAddress":"0xbb8f7E2321c4a7D8b9B432792103A5d48A74ace8","sourceTokenAmount":"10000000000000000","requestWithdrawNo":2,"receipt":"0xf4903f4544558515b26ec4C6D6e91D2293b27275"}]
跨链部署文档 https://docs.layerzero.network/v2/developers/evm/create-lz-oapp/start 查看交易 https://testnet.layerzeroscan.com/address/0xf4903f4544558515b26ec4c6d6e91d2293b27275 链上跟踪交易 https://dashboard.tenderly.co/tx/bnb-testnet/0xeb394f04f8a578d1bbecbdee25093f98bff892c9289cf7d064a37ab04d36c1cb
npx hardhat deploy --network bscTestnet --tags AssUSDCnpx hardhat deploy --network sepoliaTestnet --tags AssUSDCnpx hardhat deploy --network bscTestnet --tags AssUSDCVerifynpx hardhat deploy --network sepoliaTestnet --tags AssUSDCVerifynpx hardhat lz:oapp:config:init --contract-name AssXXX --oapp-config testnet.layerzero.config.tsnpx hardhat lz:oapp:wire --oapp-config testnet.layerzero.config.ts[{"dstEid":40161,"maxDailyTransferAmount":"1000000000000000000000000000","singleTransferUpperLimit":"10000000000000000000000000","singleTransferLowerLimit":"0","dailyTransferAmountPerAddress":"100000000000000000000000000","dailyTransferAttemptPerAddress":"10000000"}]
[{"dstEid":40102,"maxDailyTransferAmount":"1000000000000000000000000000","singleTransferUpperLimit":"10000000000000000000000000","singleTransferLowerLimit":"0","dailyTransferAmountPerAddress":"100000000000000000000000000","dailyTransferAttemptPerAddress":"10000000"}]
const toBytes32Value = arrayToBytes32(ethers.utils.zeroPad('0xf4903f4544558515b26ec4C6D6e91D2293b27275', 32));
console.log(toBytes32Value); const extraOptions = Options.newOptions().addExecutorLzReceiveOption(600000, 0).toHex().toString()
console.log(extraOptions)$ forge testforge test --match-contract SignTest -vvvvv --via-ir
forge clean && forge test --match-contract SignTest -vvvvv --via-ir
forge clean && forge test --match-contract SignTest --match-test "testSign" -vvvv --via-ir
### storage slot
cast storage 0x0612Aaa3Dd5E50368A95Bd2D2dB0025641B79cE5 --via-ir --rpc-url https://data-seed-prebsc-1-s1.bnbchain.org:8545/ --etherscan-api-key TDID7NM35CIQ35RU4TUV5XQV9GBDKCBJYI
cast storage 0x7f1be83A1CDA4a903323cfF3390a2721D46f219E --via-ir --rpc-url https://data-seed-prebsc-1-s1.bnbchain.org:8545/ --etherscan-api-key TDID7NM35CIQ35RU4TUV5XQV9GBDKCBJYI
cast storage 0x541d298047312DCBCc4Ae55d9f9FAb6104132c9e --via-ir --rpc-url https://data-seed-prebsc-1-s1.bnbchain.org:8545/ --etherscan-api-key TDID7NM35CIQ35RU4TUV5XQV9GBDKCBJYI

