Get the FREE Ultimate OpenClaw Setup Guide →
M

Abstract Toolkit

Scanned

@Masoncags-tech

npx machina-cli add skill @Masoncags-tech/abstract-toolkit --openclaw
Files (1)
SKILL.md
3.2 KB

Abstract Onboard

Everything an agent needs to operate on Abstract.

Quick Start

Create Abstract Global Wallet (AGW)

AGW is a smart contract wallet that earns XP on Abstract. Essential for agents!

export WALLET_PRIVATE_KEY=0x...
node scripts/create-agw.js

Your EOA becomes the signer, AGW is a separate smart contract address.

Check Balances

node scripts/check-balances.js <wallet> all

Bridge ETH to Abstract

export WALLET_PRIVATE_KEY=0x...
node scripts/relay-bridge.js --from base --amount 0.01

Deploy a Contract

export WALLET_PRIVATE_KEY=0x...
node scripts/deploy-abstract.js ./artifacts/MyContract.json "constructor-arg"

Transfer Tokens

export WALLET_PRIVATE_KEY=0x...
node scripts/transfer.js --to 0x... --amount 0.01           # ETH
node scripts/transfer.js --to 0x... --amount 100 --token USDC  # Token

Swap Tokens

export WALLET_PRIVATE_KEY=0x...
export DEX_ROUTER=0x...  # Set DEX router address
node scripts/swap-tokens.js --from ETH --to USDC --amount 0.01

Call Any Contract

# Read
node scripts/call-contract.js --address 0x... --abi ./abi.json --function balanceOf --args 0x1234

# Write
export WALLET_PRIVATE_KEY=0x...
node scripts/call-contract.js --address 0x... --abi ./abi.json --function transfer --args 0x1234,100 --write

Key Information

ItemValue
Chain ID2741
RPChttps://api.mainnet.abs.xyz
Explorerhttps://abscan.org
Bridgehttps://relay.link/bridge/abstract
USDC0x84A71ccD554Cc1b02749b35d22F684CC8ec987e1
WETH0x3439153EB7AF838Ad19d56E1571FBD09333C2809

Scripts

ScriptPurpose
create-agw.jsCreate Abstract Global Wallet (earns XP!)
check-balances.jsCheck ETH and token balances
relay-bridge.jsBridge ETH from other chains
deploy-abstract.jsDeploy contracts to Abstract
transfer.jsSend ETH or tokens
swap-tokens.jsTrade tokens via DEX
call-contract.jsCall any contract function

References

FileContents
agw.mdAbstract Global Wallet guide (XP, activation)
hardhat.config.jsWorking Hardhat config for Abstract
addresses.mdKey contract addresses
troubleshooting.mdCommon errors and fixes

Common Issues

  1. Gas estimation fails → Use Hardhat, not foundry-zksync
  2. Compiler errors → Use Solidity 0.8.x with zksolc
  3. TX stuck → Check gas price, verify on abscan.org

See references/troubleshooting.md for detailed solutions.

Dependencies

# Core dependencies
npm install ethers zksync-ethers viem

# For contract deployment
npm install @matterlabs/hardhat-zksync

# For AGW (Abstract Global Wallet)
npm install @abstract-foundation/agw-client

Source

git clone https://clawhub.ai/Masoncags-tech/abstract-toolkitView on GitHub

Overview

Abstract Toolkit provides a ready-to-run set of scripts and configurations to operate on Abstract (ZK Stack L2). It enables deploying contracts via zksolc and Hardhat, bridging ETH and tokens through Relay, and trading on a DEX, while offering direct interaction with the Abstract mainnet. It centralizes key addresses, scripts, and dependencies for efficient on-chain work.

How This Skill Works

The toolkit exposes a collection of scripts (create-agw.js, check-balances.js, relay-bridge.js, deploy-abstract.js, transfer.js, swap-tokens.js, call-contract.js) that connect to Abstract using ethers and zksync-ethers, guided by a signer derived from WALLET_PRIVATE_KEY. You can deploy contracts, bridge assets, transfer or swap tokens, and call contract functions on Abstract, with Hardhat handling deployment and zksolc for compilation. Key addresses and chain information are documented for reliable interactions.

When to Use It

  • You need to deploy a new smart contract to Abstract using zksolc and Hardhat.
  • You want to bridge ETH or tokens from a base chain into Abstract via Relay.
  • You intend to trade or swap tokens on Abstract using a DEX.
  • You need to check balances or transfer ETH/tokens within Abstract.
  • You need to call a contract function on Abstract (read or write) and verify results.

Quick Start

  1. Step 1: export WALLET_PRIVATE_KEY and create the AGW: export WALLET_PRIVATE_KEY=0x...; node scripts/create-agw.js
  2. Step 2: Run a task with the appropriate script, e.g., node scripts/check-balances.js <wallet> all or node scripts/relay-bridge.js --from base --amount 0.01 or node scripts/deploy-abstract.js ./artifacts/MyContract.json 'constructor-arg'
  3. Step 3: Verify results on abscan.org and consult addresses.md for key contract addresses and chain details

Best Practices

  • Use the Abstract Global Wallet (AGW) as the signer for all actions.
  • Securely manage WALLET_PRIVATE_KEY and avoid hardcoding it in scripts.
  • Verify network details and addresses from the Key Information table and addresses.md before actions.
  • Pin versions of zksolc, Hardhat, and ethers; test with small amounts first.
  • Review transaction results on abscan.org after each operation.

Example Use Cases

  • Deploy a new contract to Abstract with deploy-abstract.js and a constructor argument.
  • Bridge 0.01 ETH from the base chain to Abstract using relay-bridge.js.
  • Swap 0.01 ETH for USDC on Abstract via swap-tokens.js with a specified DEX router.
  • Transfer 100 USDC to another address using transfer.js.
  • Read balanceOf for an address using call-contract.js.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers