Agent Skillskeypo-us/keypo-cli › weth-base-sepolia

weth-base-sepolia

GitHub

提供 Base Sepolia 测试网上 WETH 合约的交互指南,涵盖 ETH 包裹/解包、余额查询及授权等读写操作的 CLI 命令示例。

skills/contracts/weth-base-sepolia/SKILL.md keypo-us/keypo-cli

Trigger Scenarios

用户需要与 Base Sepolia 上的 WETH 合约进行交互 用户询问如何打包或解包 ETH 用户需要查询 WETH 余额或授权额度

Install

npx skills add keypo-us/keypo-cli --skill weth-base-sepolia -g -y
More Options

Non-standard path

npx skills add https://github.com/keypo-us/keypo-cli/tree/main/skills/contracts/weth-base-sepolia -g -y

Use without installing

npx skills use keypo-us/keypo-cli@weth-base-sepolia

指定 Agent (Claude Code)

npx skills add keypo-us/keypo-cli --skill weth-base-sepolia -a claude-code -g -y

安装 repo 全部 skill

npx skills add keypo-us/keypo-cli --all -g -y

预览 repo 内 skill

npx skills add keypo-us/keypo-cli --list

SKILL.md

Frontmatter
{
    "name": "weth-base-sepolia",
    "license": "MIT",
    "metadata": {
        "chain": "Base Sepolia",
        "author": "auto-generated by contract-learner",
        "version": "1.0.0",
        "chain-id": 84532,
        "generated": "2026-03-06",
        "source-contract": "0x4200000000000000000000000000000000000006"
    },
    "description": "Interact with Wrapped Ether (WETH) at 0x4200000000000000000000000000000000000006 on Base Sepolia. Wrap and unwrap ETH, check balances, and manage ERC-20 WETH allowances. Use with keypo-wallet for transaction execution — use `cast calldata` to encode function calls and pipe to `keypo-wallet send` or `keypo-wallet batch`."
}

Wrapped Ether — WETH (Base Sepolia)

Field Value
Address 0x4200000000000000000000000000000000000006
Chain Base Sepolia (Chain ID: 84532)
Type Token (ERC-20 wrapper for native ETH)
Decimals 18
Symbol WETH
RPC https://sepolia.base.org

Auto-generated from verified ABI. Do not modify the address or function signatures.


Read Functions

Use cast call — no wallet needed, no gas cost.

name

cast call 0x4200000000000000000000000000000000000006 "name()(string)" --rpc-url https://sepolia.base.org

symbol

cast call 0x4200000000000000000000000000000000000006 "symbol()(string)" --rpc-url https://sepolia.base.org

decimals

cast call 0x4200000000000000000000000000000000000006 "decimals()(uint8)" --rpc-url https://sepolia.base.org

totalSupply

cast call 0x4200000000000000000000000000000000000006 "totalSupply()(uint256)" --rpc-url https://sepolia.base.org

balanceOf

cast call 0x4200000000000000000000000000000000000006 "balanceOf(address)(uint256)" <account> --rpc-url https://sepolia.base.org

allowance

cast call 0x4200000000000000000000000000000000000006 "allowance(address,address)(uint256)" <owner> <spender> --rpc-url https://sepolia.base.org

Write Functions

Encode calldata with cast calldata, then execute via keypo-wallet.

deposit

Wrap ETH into WETH. Send ETH with the transaction and receive an equal amount of WETH.

# This function is payable — specify the ETH amount to wrap in --value (wei)
keypo-wallet send --key <key-name> --to 0x4200000000000000000000000000000000000006 --value <wei-amount>

No calldata needed — calling the contract with ETH triggers the fallback/deposit. To use the explicit deposit() function:

CALLDATA=$(cast calldata "deposit()")
keypo-wallet send --key <key-name> --to 0x4200000000000000000000000000000000000006 --data $CALLDATA --value <wei-amount>

Verify: Check your WETH balance after wrapping:

cast call 0x4200000000000000000000000000000000000006 "balanceOf(address)(uint256)" <your-address> --rpc-url https://sepolia.base.org

withdraw

Unwrap WETH back into native ETH. Burns WETH and returns ETH to your wallet.

CALLDATA=$(cast calldata "withdraw(uint256)" <wad>)
keypo-wallet send --key <key-name> --to 0x4200000000000000000000000000000000000006 --data $CALLDATA

Verify: Check your WETH balance decreased:

cast call 0x4200000000000000000000000000000000000006 "balanceOf(address)(uint256)" <your-address> --rpc-url https://sepolia.base.org

approve

Approve a spender to transfer WETH on your behalf.

CALLDATA=$(cast calldata "approve(address,uint256)" <spender> <wad>)
keypo-wallet send --key <key-name> --to 0x4200000000000000000000000000000000000006 --data $CALLDATA

Verify:

cast call 0x4200000000000000000000000000000000000006 "allowance(address,address)(uint256)" <your-address> <spender> --rpc-url https://sepolia.base.org

transfer

Transfer WETH to another address.

CALLDATA=$(cast calldata "transfer(address,uint256)" <recipient> <wad>)
keypo-wallet send --key <key-name> --to 0x4200000000000000000000000000000000000006 --data $CALLDATA

Verify:

cast call 0x4200000000000000000000000000000000000006 "balanceOf(address)(uint256)" <recipient> --rpc-url https://sepolia.base.org

transferFrom

Transfer WETH from one address to another (requires prior approval).

CALLDATA=$(cast calldata "transferFrom(address,address,uint256)" <src> <dst> <wad>)
keypo-wallet send --key <key-name> --to 0x4200000000000000000000000000000000000006 --data $CALLDATA

Verify:

cast call 0x4200000000000000000000000000000000000006 "balanceOf(address)(uint256)" <dst> --rpc-url https://sepolia.base.org

Common Patterns

Wrap ETH (deposit)

# Wrap 0.01 ETH into WETH
keypo-wallet send --key <key-name> --to 0x4200000000000000000000000000000000000006 --value 10000000000000000

Unwrap WETH (withdraw)

# Unwrap 0.01 WETH back to ETH
CALLDATA=$(cast calldata "withdraw(uint256)" 10000000000000000)
keypo-wallet send --key <key-name> --to 0x4200000000000000000000000000000000000006 --data $CALLDATA

Approve + TransferFrom (batched)

APPROVE_DATA=$(cast calldata "approve(address,uint256)" <spender> <wad>)
TRANSFER_DATA=$(cast calldata "transferFrom(address,address,uint256)" <your-address> <recipient> <wad>)

echo "[
  {\"to\": \"0x4200000000000000000000000000000000000006\", \"value\": \"0\", \"data\": \"$APPROVE_DATA\"},
  {\"to\": \"0x4200000000000000000000000000000000000006\", \"value\": \"0\", \"data\": \"$TRANSFER_DATA\"}
]" | keypo-wallet batch --key <key-name> --calls -

Amount Encoding

This token uses 18 decimals. Always convert human-readable amounts:

Human Amount Raw Amount (wei)
1.0 1000000000000000000
0.1 100000000000000000
0.01 10000000000000000
0.001 1000000000000000
100 100000000000000000000

To wrap 1.0 ETH into WETH:

keypo-wallet send --key <key-name> --to 0x4200000000000000000000000000000000000006 --value 1000000000000000000

To transfer 1.0 WETH:

CALLDATA=$(cast calldata "transfer(address,uint256)" <recipient> 1000000000000000000)
keypo-wallet send --key <key-name> --to 0x4200000000000000000000000000000000000006 --data $CALLDATA

Version History

  • 7331b6f Current 2026-07-25 09:50

Same Skill Collection

demo/checkout/SKILL.md
demo/hermes-checkout/hermes/skills/keypo-shopping/SKILL.md
skills/contracts/uniswap-v3/SKILL.md
skills/keypo-wallet/SKILL.md
skills/portfolio-tracker/SKILL.md
skills/contract-learner/SKILL.md

Metadata

Files
0
Version
7331b6f
Hash
a089815f
Indexed
2026-07-25 09:50

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-30 04:07
浙ICP备14020137号-1 $Гость$