# foundry cast 入門 Deploy `1_Storage.sol` with Remix ```solidity= // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.2 <0.9.0; /** * @title Storage * @dev Store & retrieve value in a variable * @custom:dev-run-script ./scripts/deploy_with_ethers.ts */ contract Storage { uint256 number; /** * @dev Store value in variable * @param num value to store */ function store(uint256 num) public { number = num; } /** * @dev Return value * @return value of 'number' */ function retrieve() public view returns (uint256){ return number; } } ``` Call on-chain data ```bash= cast call \ --rpc-url $arbitrum_sepolia \ 0x2C2e0791722d9c675FA8d23f9d45AF1ED22C8a24 \ "function retrieve() public view returns (uint256)" ``` Send a transaction ```bash= cast send --account dev \ --rpc-url $arbitrum_sepolia \ 0x2C2e0791722d9c675FA8d23f9d45AF1ED22C8a24 \ "function store(uint256 num)" \ 24 ``` Manage wallet with foundry cast ```bash= cast wallet import dev --private-key <PRIVATE_KEY> cast wallet list # delete rm -rf ~/.foundry/keystores/dev ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up