Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
Foundry consists of:
- Forge: Ethereum testing framework (like Truffle, Hardhat and DappTools).
- Cast: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
- Anvil: Local Ethereum node, akin to Ganache, Hardhat Network.
- Chisel: Fast, utilitarian, and verbose solidity REPL.
$ forge build$ forge test$ forge fmt$ forge snapshot$ anvil$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>$ cast <subcommand>$ forge --help
$ anvil --help
$ cast --helpINPUT -> Lucas deposita 100 TOKENS INPUT -> Aluno deposit 1 TOKEN
REQUIRE :: Só pode interagir uma vez
OUTPUT <- Aluno sacar 1 x 2 TOKEN
Faça uma chama usando cast de approve no seguinte formato
- Approve no Erc20: 0x5FbDB2315678afecb367f032d93F642f64180aa3
- De 100 Tokens para o contrato: 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512
Faça uma chama usando cast de approve no seguinte formato
- Chame a funcao found no contrato: 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512
- chame a funcao getBalance no contrao: 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512
cast send 0x70ed51B53FB968083349B8B037DDF23a0CB36Ae8
"approve(address,uint256)"
0x7FbF2586957eEc6252CD89EeeC033Af6CbF33c6E
100000000000000000000
--rpc-url https://sepolia.gateway.tenderly.co
--account testff80
cast send 0x7FbF2586957eEc6252CD89EeeC033Af6CbF33c6E
"found()"
--rpc-url https://sepolia.gateway.tenderly.co
--account testff80
cast call 0x7FbF2586957eEc6252CD89EeeC033Af6CbF33c6E
"getBalance()"
--rpc-url https://sepolia.gateway.tenderly.co
cast send 0x5FbDB2315678afecb367f032d93F642f64180aa3
"approve(address,uint256)"
0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512
1000000000000000000
--rpc-url http://localhost:8545
--private-key 0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d
cast send 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512
"deposit()"
--rpc-url http://localhost:8545
--private-key 0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d
cast send 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512
"claim()"
--rpc-url http://localhost:8545
--private-key 0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d
cast call 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512
"getBalance()"
--rpc-url http://localhost:8545
cast call 0x5FbDB2315678afecb367f032d93F642f64180aa3
"balanceOf()"
0x70997970C51812dc3A010C7d01b50e0d17dc79C8
--rpc-url http://localhost:8545